Skip to content

Commit a4a9047

Browse files
authored
ci: sync manifest.json version from release tag (#147)
1 parent 0f5e360 commit a4a9047

12 files changed

Lines changed: 1096 additions & 0 deletions

File tree

.agents/myco-run.cjs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env node
2+
// Myco hook guard — silently no-ops when myco is not installed.
3+
//
4+
// This file is committed to the repo so open-source contributors without
5+
// Myco don't see hook errors in their agent sessions. It stays deliberately
6+
// thin: its only jobs are (1) provide a cross-platform entry point that
7+
// works under every shell our symbionts fire hooks from, and (2) resolve
8+
// which myco binary to exec via .myco/runtime.command.
9+
//
10+
// Managed by: myco init / myco update
11+
// Safe to delete: myco remove
12+
'use strict';
13+
14+
// Skip hooks for Myco's own agent pipeline sessions — they are internal
15+
// and should not be captured as user sessions.
16+
if (process.env.MYCO_AGENT_SESSION) process.exit(0);
17+
18+
const fs = require('node:fs');
19+
const path = require('node:path');
20+
const { execFileSync } = require('node:child_process');
21+
22+
// Resolve the myco command name.
23+
//
24+
// Source of truth is `.myco/runtime.command` — a one-line plain-text file
25+
// containing the command to invoke (e.g. `myco`, `myco-dev`, or a user's
26+
// own alias). When absent or empty, the default is `myco`.
27+
//
28+
// We resolve the file path via __dirname so the guard doesn't depend on
29+
// the agent's current working directory. Lifecycle hook wrappers `cd` to
30+
// project root before invoking us, but not every agent keeps that contract
31+
// reliably under every shell — __dirname removes the dependency entirely.
32+
let bin = 'myco';
33+
try {
34+
const aliasPath = path.resolve(__dirname, '..', '.myco', 'runtime.command');
35+
const alias = fs.readFileSync(aliasPath, 'utf-8').trim();
36+
if (alias) bin = alias;
37+
} catch { /* missing file → use default */ }
38+
39+
try {
40+
execFileSync(bin, process.argv.slice(2), { stdio: 'inherit' });
41+
} catch (e) {
42+
if (e.code === 'ENOENT') process.exit(0);
43+
process.exit(e.status ?? 1);
44+
}

.agents/skills/myco

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/opt/homebrew/lib/node_modules/@goondocks/myco/skills/myco

.agents/skills/myco-rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/opt/homebrew/lib/node_modules/@goondocks/myco/skills/myco-rules

.claude/skills/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Myco-managed symlinks — generated skills are symlinked here automatically.
2+
# The canonical location for all skills is .agents/skills/.
3+
#
4+
# To add your own skill to this directory, un-ignore it:
5+
# !my-skill
6+
*
7+
!.gitignore

.codex/hooks.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"hooks": [
6+
{
7+
"type": "command",
8+
"command": "cd \"$(git rev-parse --show-toplevel 2>/dev/null || echo .)\" && node .agents/myco-run.cjs hook session-start --symbiont codex",
9+
"timeout": 10
10+
}
11+
]
12+
}
13+
],
14+
"UserPromptSubmit": [
15+
{
16+
"hooks": [
17+
{
18+
"type": "command",
19+
"command": "cd \"$(git rev-parse --show-toplevel 2>/dev/null || echo .)\" && node .agents/myco-run.cjs hook user-prompt-submit --symbiont codex",
20+
"timeout": 5
21+
}
22+
]
23+
}
24+
],
25+
"PostToolUse": [
26+
{
27+
"hooks": [
28+
{
29+
"type": "command",
30+
"command": "cd \"$(git rev-parse --show-toplevel 2>/dev/null || echo .)\" && node .agents/myco-run.cjs hook post-tool-use --symbiont codex",
31+
"timeout": 5
32+
}
33+
]
34+
}
35+
],
36+
"Stop": [
37+
{
38+
"hooks": [
39+
{
40+
"type": "command",
41+
"command": "cd \"$(git rev-parse --show-toplevel 2>/dev/null || echo .)\" && node .agents/myco-run.cjs hook stop --symbiont codex",
42+
"timeout": 30
43+
}
44+
]
45+
}
46+
]
47+
}
48+
}

.cursor/skills/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Myco-managed symlinks — generated skills are symlinked here automatically.
2+
# The canonical location for all skills is .agents/skills/.
3+
#
4+
# To add your own skill to this directory, un-ignore it:
5+
# !my-skill
6+
*
7+
!.gitignore
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Sync manifest version from tag
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
concurrency:
9+
group: sync-manifest-version
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
sync:
17+
name: Sync manifest.json version to release tag
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout main
21+
uses: actions/checkout@v4
22+
with:
23+
ref: main
24+
fetch-depth: 0
25+
token: ${{ secrets.PUSH_TOKEN || secrets.GITHUB_TOKEN }}
26+
27+
- name: Verify tag commit is in main history
28+
env:
29+
TAG_NAME: ${{ github.ref_name }}
30+
run: |
31+
TAG_COMMIT=$(git rev-list -n 1 "refs/tags/${TAG_NAME}")
32+
if ! git merge-base --is-ancestor "$TAG_COMMIT" HEAD; then
33+
echo "Tag ${TAG_NAME} (${TAG_COMMIT}) is not an ancestor of main; refusing to sync manifest."
34+
exit 1
35+
fi
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: '3.13'
41+
42+
- name: Install packaging
43+
run: python -m pip install --quiet packaging
44+
45+
- name: Update manifest.json version
46+
env:
47+
TAG_NAME: ${{ github.ref_name }}
48+
run: |
49+
VERSION="${TAG_NAME#v}"
50+
MANIFEST="custom_components/unifi_network_rules/manifest.json"
51+
52+
python3 - "$MANIFEST" "$VERSION" <<'PY'
53+
import json, re, sys
54+
from packaging.version import InvalidVersion, Version
55+
56+
path, new = sys.argv[1], sys.argv[2]
57+
with open(path) as f:
58+
text = f.read()
59+
current = json.loads(text)["version"]
60+
61+
try:
62+
if Version(new) <= Version(current):
63+
print(f"manifest.json version {current} is already >= tag {new}; skipping")
64+
sys.exit(0)
65+
except InvalidVersion as err:
66+
print(f"Unable to compare versions ({err}); refusing to update")
67+
sys.exit(1)
68+
69+
updated, n = re.subn(
70+
r'("version"\s*:\s*")[^"]+(")',
71+
lambda m: m.group(1) + new + m.group(2),
72+
text,
73+
count=1,
74+
)
75+
if n != 1:
76+
print("Could not locate version field in manifest.json")
77+
sys.exit(1)
78+
with open(path, "w") as f:
79+
f.write(updated)
80+
print(f"manifest.json: {current} -> {new}")
81+
PY
82+
83+
- name: Commit and push if changed
84+
env:
85+
TAG_NAME: ${{ github.ref_name }}
86+
run: |
87+
git config user.name "github-actions[bot]"
88+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
89+
90+
git add custom_components/unifi_network_rules/manifest.json
91+
92+
if git diff --cached --quiet; then
93+
echo "No version changes to commit"
94+
exit 0
95+
fi
96+
97+
git commit -m "chore(release): sync manifest.json to ${TAG_NAME} [skip ci]"
98+
git push

.myco/.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SQLite database
2+
myco.db*
3+
vectors.db*
4+
5+
# Daemon state — per-machine, ephemeral
6+
daemon.json
7+
buffer/
8+
logs/
9+
10+
# Secrets — API keys for cloud providers
11+
secrets.env
12+
13+
# Machine ID
14+
machine_id
15+
16+
# Update tracking — per-machine state
17+
last-update-version
18+
restart-reason.json
19+
20+
# Binary attachments — screenshots captured from transcripts
21+
attachments/
22+
23+
# Team sync admin state + worker deployment
24+
team/
25+
26+
# Staged files generated by the myco agent
27+
staging/
28+
29+
# Runtime command alias — per-contributor override for which myco binary
30+
# the hook guard invokes. Default (file absent) is `myco`; `make dev-link`
31+
# writes `myco-dev`; users can hand-edit for PATH conflicts or pinning.
32+
# Never committed — different contributors use different aliases.
33+
runtime.command
34+
35+
# Per-user appearance and settings overrides
36+
local.yaml

.myco/myco.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: 3
2+
config_version: 6
3+
embedding:
4+
provider: ollama
5+
model: bge-m3
6+
daemon:
7+
port: 28183
8+
log_level: info
9+
log_retention_days: 30
10+
stale_session_threshold_ms: 3600000
11+
capture:
12+
transcript_paths: []
13+
plan_dirs: []
14+
ignore_plan_dirs_in_git: false
15+
artifact_extensions:
16+
- .md
17+
buffer_max_events: 500
18+
agent:
19+
summary_batch_interval: 5
20+
scheduled_tasks_enabled: true
21+
event_tasks_enabled: true
22+
context:
23+
digest_tier: 5000
24+
session_start_digest_enabled: false
25+
cortex_enabled: true
26+
prompt_search: true
27+
prompt_max_spores: 3
28+
backup: {}
29+
maintenance:
30+
auto_optimize: true
31+
auto_optimize_interval_hours: 24
32+
team:
33+
enabled: false
34+
interval_minutes: 15
35+
skills:
36+
confidence_threshold: 0.7
37+
usage_stale_days: 30
38+
notifications:
39+
enabled: true
40+
system_notifications: false
41+
default_mode: summary
42+
domains:
43+
settings:
44+
enabled: true
45+
mode: banner
46+
appearance:
47+
theme: sage
48+
mode: dark
49+
font: default
50+
density: normal
51+
symbionts:
52+
claude-code:
53+
enabled: true
54+
codex:
55+
enabled: true
56+
cursor:
57+
enabled: true
58+
opencode:
59+
enabled: true

.opencode/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"@opencode-ai/plugin": "^1.1.59"
4+
}
5+
}

0 commit comments

Comments
 (0)