agent-mockingbird 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/btca-cli/SKILL.md +64 -0
- package/.agents/skills/btca-cli/agents/openai.yaml +3 -0
- package/.agents/skills/frontend-design/SKILL.md +42 -0
- package/.agents/skills/frontend-design/agents/openai.yaml +3 -0
- package/.env.example +36 -0
- package/.githooks/pre-commit +33 -0
- package/.github/workflows/ci.yml +309 -0
- package/.opencode/bun.lock +18 -0
- package/.opencode/package.json +5 -0
- package/.opencode/tools/agent_type_manager.ts +100 -0
- package/.opencode/tools/config_manager.ts +87 -0
- package/.opencode/tools/cron_manager.ts +145 -0
- package/.opencode/tools/memory_get.ts +43 -0
- package/.opencode/tools/memory_remember.ts +53 -0
- package/.opencode/tools/memory_search.ts +48 -0
- package/AGENTS.md +126 -0
- package/MEMORY.md +2 -0
- package/README.md +451 -0
- package/THIRD_PARTY_NOTICES.md +11 -0
- package/agent-mockingbird.config.example.json +135 -0
- package/apps/server/package.json +32 -0
- package/apps/server/src/backend/agents/bootstrapContext.ts +362 -0
- package/apps/server/src/backend/agents/openclawImport.test.ts +133 -0
- package/apps/server/src/backend/agents/openclawImport.ts +797 -0
- package/apps/server/src/backend/agents/opencodeConfig.ts +428 -0
- package/apps/server/src/backend/agents/service.ts +10 -0
- package/apps/server/src/backend/config/example-config.test.ts +20 -0
- package/apps/server/src/backend/config/orchestration.ts +243 -0
- package/apps/server/src/backend/config/policy.ts +158 -0
- package/apps/server/src/backend/config/schema.test.ts +15 -0
- package/apps/server/src/backend/config/schema.ts +391 -0
- package/apps/server/src/backend/config/semantic.test.ts +34 -0
- package/apps/server/src/backend/config/semantic.ts +149 -0
- package/apps/server/src/backend/config/service.test.ts +75 -0
- package/apps/server/src/backend/config/service.ts +207 -0
- package/apps/server/src/backend/config/smoke.ts +77 -0
- package/apps/server/src/backend/config/store.test.ts +123 -0
- package/apps/server/src/backend/config/store.ts +581 -0
- package/apps/server/src/backend/config/testFixtures.ts +5 -0
- package/apps/server/src/backend/config/types.ts +56 -0
- package/apps/server/src/backend/contracts/events.ts +320 -0
- package/apps/server/src/backend/contracts/runtime.ts +111 -0
- package/apps/server/src/backend/cron/executor.ts +435 -0
- package/apps/server/src/backend/cron/repository.ts +170 -0
- package/apps/server/src/backend/cron/service.ts +660 -0
- package/apps/server/src/backend/cron/storage.ts +92 -0
- package/apps/server/src/backend/cron/types.ts +138 -0
- package/apps/server/src/backend/cron/utils.ts +351 -0
- package/apps/server/src/backend/db/client.ts +20 -0
- package/apps/server/src/backend/db/migrate.ts +40 -0
- package/apps/server/src/backend/db/repository.ts +1762 -0
- package/apps/server/src/backend/db/schema.ts +113 -0
- package/apps/server/src/backend/db/usageDashboard.test.ts +102 -0
- package/apps/server/src/backend/db/wipe.ts +13 -0
- package/apps/server/src/backend/defaults.ts +32 -0
- package/apps/server/src/backend/env.ts +48 -0
- package/apps/server/src/backend/heartbeat/activeHours.ts +45 -0
- package/apps/server/src/backend/heartbeat/defaultJob.ts +88 -0
- package/apps/server/src/backend/heartbeat/heartbeat.test.ts +110 -0
- package/apps/server/src/backend/heartbeat/runtimeService.ts +190 -0
- package/apps/server/src/backend/heartbeat/service.ts +176 -0
- package/apps/server/src/backend/heartbeat/state.test.ts +63 -0
- package/apps/server/src/backend/heartbeat/state.ts +167 -0
- package/apps/server/src/backend/heartbeat/types.ts +54 -0
- package/apps/server/src/backend/http/boundedQueue.test.ts +49 -0
- package/apps/server/src/backend/http/boundedQueue.ts +92 -0
- package/apps/server/src/backend/http/parsers.ts +40 -0
- package/apps/server/src/backend/http/router.ts +61 -0
- package/apps/server/src/backend/http/routes/agentRoutes.ts +67 -0
- package/apps/server/src/backend/http/routes/backgroundRoutes.ts +203 -0
- package/apps/server/src/backend/http/routes/chatRoutes.ts +107 -0
- package/apps/server/src/backend/http/routes/configRoutes.ts +602 -0
- package/apps/server/src/backend/http/routes/cronRoutes.ts +221 -0
- package/apps/server/src/backend/http/routes/dashboardRoutes.ts +308 -0
- package/apps/server/src/backend/http/routes/eventRoutes.ts +7 -0
- package/apps/server/src/backend/http/routes/heartbeatRoutes.test.ts +41 -0
- package/apps/server/src/backend/http/routes/heartbeatRoutes.ts +28 -0
- package/apps/server/src/backend/http/routes/index.ts +101 -0
- package/apps/server/src/backend/http/routes/mcpRoutes.ts +213 -0
- package/apps/server/src/backend/http/routes/memoryRoutes.ts +154 -0
- package/apps/server/src/backend/http/routes/runRoutes.ts +310 -0
- package/apps/server/src/backend/http/routes/runtimeRoutes.ts +197 -0
- package/apps/server/src/backend/http/routes/skillRoutes.ts +112 -0
- package/apps/server/src/backend/http/routes/uiRoutes.test.ts +161 -0
- package/apps/server/src/backend/http/routes/uiRoutes.ts +177 -0
- package/apps/server/src/backend/http/routes/usageRoutes.test.ts +104 -0
- package/apps/server/src/backend/http/routes/usageRoutes.ts +767 -0
- package/apps/server/src/backend/http/schemas.ts +64 -0
- package/apps/server/src/backend/http/sse.ts +144 -0
- package/apps/server/src/backend/integration/backend-core.test.ts +2316 -0
- package/apps/server/src/backend/logging/logger.ts +64 -0
- package/apps/server/src/backend/mcp/service.ts +326 -0
- package/apps/server/src/backend/memory/cli.ts +170 -0
- package/apps/server/src/backend/memory/conceptExpansion.test.ts +28 -0
- package/apps/server/src/backend/memory/conceptExpansion.ts +80 -0
- package/apps/server/src/backend/memory/qmdPort.test.ts +54 -0
- package/apps/server/src/backend/memory/qmdPort.ts +61 -0
- package/apps/server/src/backend/memory/records.test.ts +66 -0
- package/apps/server/src/backend/memory/records.ts +229 -0
- package/apps/server/src/backend/memory/service.ts +2012 -0
- package/apps/server/src/backend/memory/sqliteVec.ts +58 -0
- package/apps/server/src/backend/memory/types.ts +104 -0
- package/apps/server/src/backend/opencode/agentMockingbirdPlugin.test.ts +396 -0
- package/apps/server/src/backend/opencode/client.ts +98 -0
- package/apps/server/src/backend/opencode/models.ts +41 -0
- package/apps/server/src/backend/opencode/systemPrompt.test.ts +146 -0
- package/apps/server/src/backend/opencode/systemPrompt.ts +284 -0
- package/apps/server/src/backend/paths.ts +57 -0
- package/apps/server/src/backend/prompts/service.ts +100 -0
- package/apps/server/src/backend/queue/queue.test.ts +189 -0
- package/apps/server/src/backend/queue/service.ts +177 -0
- package/apps/server/src/backend/queue/types.ts +39 -0
- package/apps/server/src/backend/run/service.ts +576 -0
- package/apps/server/src/backend/run/storage.ts +47 -0
- package/apps/server/src/backend/run/types.ts +44 -0
- package/apps/server/src/backend/runtime/errors.ts +61 -0
- package/apps/server/src/backend/runtime/index.ts +72 -0
- package/apps/server/src/backend/runtime/memoryPromptDedup.test.ts +153 -0
- package/apps/server/src/backend/runtime/memoryPromptDedup.ts +76 -0
- package/apps/server/src/backend/runtime/opencodeRuntime/backgroundMethods.ts +765 -0
- package/apps/server/src/backend/runtime/opencodeRuntime/coreMethods.ts +705 -0
- package/apps/server/src/backend/runtime/opencodeRuntime/eventMethods.ts +503 -0
- package/apps/server/src/backend/runtime/opencodeRuntime/memoryMethods.ts +462 -0
- package/apps/server/src/backend/runtime/opencodeRuntime/promptMethods.ts +1167 -0
- package/apps/server/src/backend/runtime/opencodeRuntime/shared.ts +254 -0
- package/apps/server/src/backend/runtime/opencodeRuntime.test.ts +2899 -0
- package/apps/server/src/backend/runtime/opencodeRuntime.ts +135 -0
- package/apps/server/src/backend/runtime/sessionScope.ts +45 -0
- package/apps/server/src/backend/skills/service.ts +442 -0
- package/apps/server/src/backend/workspace/resolve.ts +27 -0
- package/apps/server/src/cli/agent-mockingbird.mjs +2522 -0
- package/apps/server/src/cli/agent-mockingbird.test.ts +68 -0
- package/apps/server/src/cli/runtime-assets.mjs +269 -0
- package/apps/server/src/cli/runtime-assets.test.ts +52 -0
- package/apps/server/src/cli/runtime-layout.mjs +75 -0
- package/apps/server/src/cli/standaloneBuild.test.ts +19 -0
- package/apps/server/src/cli/standaloneBuild.ts +19 -0
- package/apps/server/src/cli/standaloneCronBinary.test.ts +187 -0
- package/apps/server/src/index.ts +178 -0
- package/apps/server/tsconfig.json +12 -0
- package/backlog.md +5 -0
- package/bin/agent-mockingbird +2522 -0
- package/bin/runtime-layout.mjs +75 -0
- package/build-bin.ts +34 -0
- package/build-cli.mjs +37 -0
- package/build.ts +40 -0
- package/bun-env.d.ts +11 -0
- package/bun.lock +888 -0
- package/bunfig.toml +2 -0
- package/components.json +21 -0
- package/config.json +130 -0
- package/deploy/RELEASE_INSTALL.md +112 -0
- package/deploy/docker-compose.yml +42 -0
- package/deploy/systemd/README.md +46 -0
- package/deploy/systemd/agent-mockingbird.service +28 -0
- package/deploy/systemd/opencode.service +25 -0
- package/docs/legacy-config-ui-reference.md +51 -0
- package/docs/memory-e2e-trace-2026-03-04.md +63 -0
- package/docs/memory-ops.md +96 -0
- package/docs/memory-runtime-contract.md +42 -0
- package/docs/memory-tuning-remote-2026-03-04.md +59 -0
- package/docs/opencode-rebase-workflow-plan.md +614 -0
- package/docs/opencode-startup-sync-plan.md +94 -0
- package/docs/vendor-opencode.md +41 -0
- package/drizzle/0000_famous_turbo.sql +49 -0
- package/drizzle/0001_cron_memory_aux.sql +160 -0
- package/drizzle/0002_runtime_session_bindings.sql +28 -0
- package/drizzle/0003_background_runs.sql +27 -0
- package/drizzle/0004_memory_open_write.sql +63 -0
- package/drizzle/0005_signal_channel.sql +47 -0
- package/drizzle/0006_usage_event_dimensions.sql +7 -0
- package/drizzle/meta/0000_snapshot.json +341 -0
- package/drizzle/meta/_journal.json +55 -0
- package/drizzle.config.ts +14 -0
- package/eslint.config.mjs +77 -0
- package/knip.json +18 -0
- package/memory/2026-03-04.md +4 -0
- package/opencode.lock.json +16 -0
- package/package.json +67 -0
- package/packages/agent-mockingbird-installer/README.md +31 -0
- package/packages/agent-mockingbird-installer/bin/agent-mockingbird-installer.mjs +44 -0
- package/packages/agent-mockingbird-installer/opencode.lock.json +16 -0
- package/packages/agent-mockingbird-installer/package.json +23 -0
- package/packages/contracts/package.json +19 -0
- package/packages/contracts/src/agentTypes.ts +122 -0
- package/packages/contracts/src/cron.ts +146 -0
- package/packages/contracts/src/dashboard.ts +378 -0
- package/packages/contracts/src/index.ts +3 -0
- package/packages/contracts/tsconfig.json +4 -0
- package/patches/opencode/0001-Wafflebot-OpenCode-baseline.patch +2341 -0
- package/patches/opencode/0002-Fix-OpenCode-web-entry-and-settings-icons.patch +104 -0
- package/patches/opencode/0003-fix-app-remove-duplicate-sidebar-mount.patch +32 -0
- package/patches/opencode/0004-Add-heartbeat-settings-and-usage-nav.patch +506 -0
- package/patches/opencode/0005-Use-chart-icon-for-usage-nav.patch +38 -0
- package/patches/opencode/0006-Modernize-cron-settings.patch +399 -0
- package/patches/opencode/0007-Rename-waffle-namespaces-to-mockingbird.patch +1110 -0
- package/patches/opencode/0008-Remove-cron-contract-section.patch +178 -0
- package/patches/opencode/0009-Rework-cron-tab-as-operations-console.patch +414 -0
- package/patches/opencode/0010-Refine-heartbeat-settings-controls.patch +208 -0
- package/runtime-assets/opencode-config/opencode.jsonc +25 -0
- package/runtime-assets/opencode-config/package.json +5 -0
- package/runtime-assets/opencode-config/plugins/agent-mockingbird.ts +715 -0
- package/runtime-assets/workspace/.agents/skills/config-auditor/SKILL.md +25 -0
- package/runtime-assets/workspace/.agents/skills/config-editor/SKILL.md +24 -0
- package/runtime-assets/workspace/.agents/skills/cron-manager/SKILL.md +57 -0
- package/runtime-assets/workspace/.agents/skills/memory-ops/SKILL.md +120 -0
- package/runtime-assets/workspace/.agents/skills/runtime-diagnose/SKILL.md +25 -0
- package/runtime-assets/workspace/AGENTS.md +56 -0
- package/runtime-assets/workspace/MEMORY.md +4 -0
- package/scripts/build-release-bundle.sh +66 -0
- package/scripts/check-ship.ts +383 -0
- package/scripts/dev-opencode.sh +17 -0
- package/scripts/dev-stack-opencode.sh +15 -0
- package/scripts/dev-stack.sh +61 -0
- package/scripts/install-systemd.sh +87 -0
- package/scripts/memory-e2e.sh +76 -0
- package/scripts/memory-trace-e2e.sh +141 -0
- package/scripts/migrate-opencode-env.ts +108 -0
- package/scripts/onboard/bootstrap.sh +32 -0
- package/scripts/opencode-swap.ts +78 -0
- package/scripts/opencode-sync.ts +715 -0
- package/scripts/runtime-assets-sync.mjs +83 -0
- package/scripts/setup-git-hooks.ts +39 -0
- package/tsconfig.json +45 -0
- package/tui.json +98 -0
- package/turbo.json +36 -0
- package/vendor/OPENCODE_VENDOR.md +13 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: config-auditor
|
|
3
|
+
description: Audit Agent Mockingbird config for drift, risky values, and operability issues, then suggest minimal safe patches.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# config-auditor
|
|
7
|
+
|
|
8
|
+
Use this skill to evaluate config quality before changing it.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Fetch current config with `config_manager` using `get_config`.
|
|
13
|
+
2. Inspect runtime settings for:
|
|
14
|
+
- timeouts that are too low for current providers
|
|
15
|
+
- memory settings that can cause noisy retrieval
|
|
16
|
+
- cron defaults that may cause retry storms
|
|
17
|
+
- invalid model/provider references
|
|
18
|
+
3. Propose explicit patch candidates.
|
|
19
|
+
4. Apply only when the user asks to apply.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- Favor small, isolated changes.
|
|
24
|
+
- Explain expected impact of each proposed patch.
|
|
25
|
+
- Never apply multiple unrelated config changes in one patch unless requested.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: config-editor
|
|
3
|
+
description: Safely read and update Agent Mockingbird runtime configuration with hash-aware, smoke-tested writes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# config-editor
|
|
7
|
+
|
|
8
|
+
Use this skill for runtime configuration updates.
|
|
9
|
+
|
|
10
|
+
## Required workflow
|
|
11
|
+
|
|
12
|
+
1. Call `config_manager` with `action: "get_config"` and capture `hash`.
|
|
13
|
+
2. Build a minimal `patch`.
|
|
14
|
+
3. Call `config_manager` with:
|
|
15
|
+
- `action: "patch_config"`
|
|
16
|
+
- `expectedHash` from step 1
|
|
17
|
+
- `runSmokeTest: true`
|
|
18
|
+
4. If a hash conflict occurs, refresh with `get_config` and retry once with a fresh hash.
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
- Prefer `patch_config` over `replace_config`.
|
|
23
|
+
- Keep patches narrow and reversible.
|
|
24
|
+
- Do not attempt to modify smoke-test policy fields unless explicitly instructed by the user.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cron-manager
|
|
3
|
+
description: Create, inspect, update, run, and delete Agent Mockingbird cron jobs using cron_manager with the 3-mode model (background, conditional_agent, agent).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cron-manager
|
|
7
|
+
|
|
8
|
+
Use this skill when users want to manage scheduled jobs in Agent Mockingbird.
|
|
9
|
+
|
|
10
|
+
## Cron mode model
|
|
11
|
+
|
|
12
|
+
- `background`: execute workspace module at `conditionModulePath`; no agent step.
|
|
13
|
+
- `conditional_agent`: execute workspace module at `conditionModulePath`; module can request agent invocation with `invokeAgent.shouldInvoke === true`.
|
|
14
|
+
- `agent`: agent runs every execution.
|
|
15
|
+
|
|
16
|
+
## Required fields by mode
|
|
17
|
+
|
|
18
|
+
- `background`
|
|
19
|
+
- requires: `conditionModulePath`
|
|
20
|
+
- should include: `conditionDescription` when a short Job Details summary is useful
|
|
21
|
+
- should not include: `agentPromptTemplate`
|
|
22
|
+
|
|
23
|
+
- `conditional_agent`
|
|
24
|
+
- requires: `conditionModulePath`
|
|
25
|
+
- should include: `conditionDescription` (1-2 sentence plain summary for Job Details UI)
|
|
26
|
+
- `agentPromptTemplate` is optional fallback when module does not provide `invokeAgent.prompt`
|
|
27
|
+
|
|
28
|
+
- `agent`
|
|
29
|
+
- requires: `agentPromptTemplate`
|
|
30
|
+
- should not include: `conditionModulePath`
|
|
31
|
+
|
|
32
|
+
## Safe workflow
|
|
33
|
+
|
|
34
|
+
1. Call `cron_manager` with `action: "describe_contract"` and `action: "list_jobs"` first.
|
|
35
|
+
2. Prefer `action: "upsert_job"` with stable `job.id` for idempotent create/update.
|
|
36
|
+
3. For create/update, send minimal fields and preserve unrelated job settings.
|
|
37
|
+
4. After creating/updating, verify with `action: "get_job"`.
|
|
38
|
+
5. Optionally smoke test with `action: "run_job_now"` and inspect `list_instances` / `list_steps`.
|
|
39
|
+
6. For deletions, confirm intent before `action: "delete_job"`.
|
|
40
|
+
7. Prefer pausing via `action: "disable_job"` when the user wants to stop runs without deleting history.
|
|
41
|
+
|
|
42
|
+
## Patterns
|
|
43
|
+
|
|
44
|
+
- Create recurring background job:
|
|
45
|
+
- `scheduleKind: "every"`, `everyMs`, `runMode: "background"`, `conditionModulePath`, optional `conditionDescription`.
|
|
46
|
+
|
|
47
|
+
- Create cron-expression conditional job:
|
|
48
|
+
- `scheduleKind: "cron"`, `scheduleExpr`, `runMode: "conditional_agent"`, `conditionModulePath`, `conditionDescription`, optional `agentPromptTemplate`.
|
|
49
|
+
|
|
50
|
+
- Create one-shot agent job:
|
|
51
|
+
- `scheduleKind: "at"`, `atIso`, `runMode: "agent"`, `agentPromptTemplate`.
|
|
52
|
+
|
|
53
|
+
## Rules
|
|
54
|
+
|
|
55
|
+
- Prefer `upsert_job` with stable IDs over delete+create.
|
|
56
|
+
- Use `enable_job` / `disable_job` for quick pause/resume instead of delete+recreate.
|
|
57
|
+
- Keep payloads small and explicit; avoid storing secrets in payload unless user explicitly requests it.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-ops
|
|
3
|
+
description: Use Agent Mockingbird memory effectively for persistent context across sessions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# memory-ops
|
|
7
|
+
|
|
8
|
+
Use Agent Mockingbird memory effectively for persistent context across sessions.
|
|
9
|
+
|
|
10
|
+
## Memory Tools
|
|
11
|
+
|
|
12
|
+
| Tool | Purpose |
|
|
13
|
+
|------|---------|
|
|
14
|
+
| `memory_search` | Find relevant prior context by semantic query |
|
|
15
|
+
| `memory_get` | Read specific memory file by path |
|
|
16
|
+
| `memory_remember` | Persist a durable fact, decision, or context |
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
### 1. Always Search First
|
|
21
|
+
|
|
22
|
+
Before making decisions or asking clarifying questions, search memory:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
memory_search(query="project architecture decisions", maxResults=5)
|
|
26
|
+
memory_search(query="user preferences for tests", maxResults=3)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use semantically specific queries first, then broaden carefully. Current runtime defaults are `maxResults=4` and `minScore=0.35`.
|
|
30
|
+
|
|
31
|
+
#### Query steering (important)
|
|
32
|
+
|
|
33
|
+
- Prefer concrete entities over vague categories.
|
|
34
|
+
- Include relationship terms the memory likely contains.
|
|
35
|
+
- Try 2-4 reformulations before concluding "not found".
|
|
36
|
+
|
|
37
|
+
Examples:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
# weak (often misses lexical filter)
|
|
41
|
+
memory_search(query="family")
|
|
42
|
+
|
|
43
|
+
# stronger
|
|
44
|
+
memory_search(query="daughter name")
|
|
45
|
+
memory_search(query="Lucy Lee")
|
|
46
|
+
memory_search(query="wife Tiffany")
|
|
47
|
+
memory_search(query="who is my daughter Lucy")
|
|
48
|
+
|
|
49
|
+
# broader adjacent lookup (portfolio -> metals/silver)
|
|
50
|
+
memory_search(query="portfolio allocation metals silver")
|
|
51
|
+
memory_search(query="investments including precious metals")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
If zero results:
|
|
55
|
+
|
|
56
|
+
1. Retry with exact entities (`Lucy Lee`, `Tiffany`, `silver`).
|
|
57
|
+
2. Retry with relation/domain words (`daughter`, `wife`, `spouse`, `child`, `portfolio`, `metals`).
|
|
58
|
+
3. Lower threshold once (`minScore=0.2`) for recall probe.
|
|
59
|
+
4. If still empty, confirm memory was actually written and indexed.
|
|
60
|
+
|
|
61
|
+
### 2. Validate with Get
|
|
62
|
+
|
|
63
|
+
Memory files live in `MEMORY.md` or `memory/*.md`. Use `memory_get` to read full context around a snippet:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
memory_get(path="memory/decisions.md", from=1, lines=50)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 3. Persist What Matters
|
|
70
|
+
|
|
71
|
+
Use `memory_remember` for durable information that should survive session boundaries:
|
|
72
|
+
|
|
73
|
+
**Good candidates:**
|
|
74
|
+
- Project-level decisions and rationale
|
|
75
|
+
- User preferences and constraints
|
|
76
|
+
- Recurring patterns or conventions discovered
|
|
77
|
+
- Critical context about third-party integrations
|
|
78
|
+
|
|
79
|
+
**Parameters:**
|
|
80
|
+
|
|
81
|
+
| Param | Purpose | Example |
|
|
82
|
+
|-------|---------|---------|
|
|
83
|
+
| `content` | The fact/decision to remember | "Use Bun, not Node.js" |
|
|
84
|
+
| `topic` | Category for organization | "conventions", "decisions" |
|
|
85
|
+
| `entities` | Related identifiers | ["bun", "runtime"] |
|
|
86
|
+
| `confidence` | Certainty level 0-1 | 0.9 for verified facts |
|
|
87
|
+
| `source` | Who provided this | "user", "assistant", "system" |
|
|
88
|
+
| `supersedes` | IDs of outdated memories to replace | ["mem_abc123"] |
|
|
89
|
+
|
|
90
|
+
### 4. Supersede, Don't Duplicate
|
|
91
|
+
|
|
92
|
+
When information changes, include `supersedes` to link the replacement:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
memory_remember(
|
|
96
|
+
content="Testing framework: bun test (switched from vitest)",
|
|
97
|
+
topic="conventions",
|
|
98
|
+
supersedes=["mem_old_testing_config"]
|
|
99
|
+
)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Memory Modes
|
|
103
|
+
|
|
104
|
+
Runtime config `runtime.memory.toolMode` controls behavior:
|
|
105
|
+
|
|
106
|
+
| Mode | Behavior |
|
|
107
|
+
|------|----------|
|
|
108
|
+
| `hybrid` | Prompt context + tools available |
|
|
109
|
+
| `inject_only` | Prompt context only, tools disabled |
|
|
110
|
+
| `tool_only` | Tools only, no prompt injection (default) |
|
|
111
|
+
|
|
112
|
+
Adjust usage accordingly — in `inject_only`, rely on existing memories in prompt context.
|
|
113
|
+
|
|
114
|
+
## Anti-Patterns
|
|
115
|
+
|
|
116
|
+
- **Don't** use only abstract terms as your only query; follow with specific entities/adjacent terms
|
|
117
|
+
- **Don't** memorize ephemeral state (current task progress, temp files)
|
|
118
|
+
- **Don't** write memories for information already in code/docs
|
|
119
|
+
- **Don't** create redundant memories — search first, then supersede
|
|
120
|
+
- **Don't** use low confidence (<0.5) for critical decisions
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: runtime-diagnose
|
|
3
|
+
description: Diagnose runtime failures (timeouts, send failures, model/provider issues) and recommend config fixes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# runtime-diagnose
|
|
7
|
+
|
|
8
|
+
Use this skill when the runtime is reachable but requests fail, stall, or time out.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Read current config and hash via `config_manager` (`get_config`).
|
|
13
|
+
2. Correlate failures with settings:
|
|
14
|
+
- `runtime.opencode.timeoutMs`
|
|
15
|
+
- `runtime.opencode.promptTimeoutMs`
|
|
16
|
+
- `runtime.opencode.runWaitTimeoutMs`
|
|
17
|
+
- `runtime.runStream.*`
|
|
18
|
+
3. Propose one minimal fix at a time.
|
|
19
|
+
4. If asked to apply, use `patch_config` with `expectedHash` and `runSmokeTest: true`.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- Prefer timeout tuning before model/provider swaps.
|
|
24
|
+
- Avoid broad config replacement during incident response.
|
|
25
|
+
- After each applied change, verify the smoke test result in the response.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Agent Mockingbird Runtime Agent Guide
|
|
2
|
+
|
|
3
|
+
You are operating as a runtime assistant inside a Agent Mockingbird workspace.
|
|
4
|
+
|
|
5
|
+
## Priorities
|
|
6
|
+
|
|
7
|
+
1. Follow explicit user instructions.
|
|
8
|
+
2. Use configured tools and skills instead of guessing.
|
|
9
|
+
3. Keep changes minimal and reversible.
|
|
10
|
+
|
|
11
|
+
## Tool Usage
|
|
12
|
+
|
|
13
|
+
For independent reads, searches, listings, and other non-dependent tool calls, prefer the `batch` tool so they run in parallel.
|
|
14
|
+
|
|
15
|
+
Do not use `batch` for ordered mutations or steps that depend on earlier tool output.
|
|
16
|
+
|
|
17
|
+
## Runtime Skills
|
|
18
|
+
|
|
19
|
+
Use workspace skills from `.agents/skills` when relevant:
|
|
20
|
+
|
|
21
|
+
- `config-editor` for safe config patching with hash + smoke test.
|
|
22
|
+
- `config-auditor` for drift/risk audits and minimal patch proposals.
|
|
23
|
+
- `runtime-diagnose` for runtime timeout/provider/model incident triage.
|
|
24
|
+
- `memory-ops` for memory status/sync/reindex/retrieval validation.
|
|
25
|
+
- `cron-manager` for cron job lifecycle operations.
|
|
26
|
+
|
|
27
|
+
## Cron Behavior
|
|
28
|
+
|
|
29
|
+
When using cron tools:
|
|
30
|
+
|
|
31
|
+
1. Start with `cron_manager` `action: "describe_contract"` for current mode requirements.
|
|
32
|
+
2. Prefer `action: "upsert_job"` with explicit `job.id` for idempotent job management.
|
|
33
|
+
3. For `background` and `conditional_agent`, use `conditionModulePath` (workspace module file). For `conditional_agent`, include `conditionDescription` for the Job Details summary.
|
|
34
|
+
4. Use `agentPromptTemplate` as optional fallback prompt; per-run overrides can come from `invokeAgent.prompt`.
|
|
35
|
+
5. Use `run_job_now` + `list_instances` + `list_steps` to validate behavior after create/update.
|
|
36
|
+
6. Use `disable_job` to pause without deleting, and `enable_job` to resume.
|
|
37
|
+
|
|
38
|
+
## Memory Behavior
|
|
39
|
+
|
|
40
|
+
Durable memory lives in workspace markdown (`MEMORY.md` and `memory/*.md`).
|
|
41
|
+
|
|
42
|
+
When memory tools are available:
|
|
43
|
+
|
|
44
|
+
1. Use `memory_search` first.
|
|
45
|
+
2. Validate details with `memory_get` before relying on them.
|
|
46
|
+
3. Persist durable facts/decisions with `memory_remember`.
|
|
47
|
+
4. For people/relationship recall, start with concrete terms (for example: daughter, spouse, partner, child, parent, names) instead of only broad words.
|
|
48
|
+
5. When search misses, reformulate once using concrete entities/relationship words before concluding no memory exists.
|
|
49
|
+
|
|
50
|
+
Respect runtime memory mode:
|
|
51
|
+
|
|
52
|
+
- `hybrid`: prompt memory + tools
|
|
53
|
+
- `inject_only`: prompt memory only
|
|
54
|
+
- `tool_only`: tools only
|
|
55
|
+
|
|
56
|
+
When replacing older memory content, include `supersedes` where possible.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
5
|
+
DIST_DIR="${ROOT_DIR}/dist"
|
|
6
|
+
STAGE_DIR="${DIST_DIR}/release-stage"
|
|
7
|
+
|
|
8
|
+
VERSION="${1:-}"
|
|
9
|
+
if [[ -z "${VERSION}" ]]; then
|
|
10
|
+
echo "usage: $0 <version>"
|
|
11
|
+
echo "example: $0 v0.1.0"
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
if ! command -v git >/dev/null 2>&1; then
|
|
16
|
+
echo "git is required"
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
21
|
+
echo "bun is required"
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
mkdir -p "${DIST_DIR}"
|
|
26
|
+
rm -rf "${STAGE_DIR}"
|
|
27
|
+
|
|
28
|
+
ARCHIVE_PATH="${DIST_DIR}/agent-mockingbird-${VERSION}.tar.gz"
|
|
29
|
+
CHECKSUM_PATH="${ARCHIVE_PATH}.sha256"
|
|
30
|
+
PREFIX="agent-mockingbird-${VERSION}"
|
|
31
|
+
|
|
32
|
+
echo "Building vendored OpenCode app + standalone runtime..."
|
|
33
|
+
(
|
|
34
|
+
cd "${ROOT_DIR}"
|
|
35
|
+
bun run build
|
|
36
|
+
bun run build:bin
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
mkdir -p "${STAGE_DIR}/${PREFIX}"
|
|
40
|
+
|
|
41
|
+
echo "Exporting tracked files..."
|
|
42
|
+
git -C "${ROOT_DIR}" archive --format=tar HEAD | tar -x -C "${STAGE_DIR}/${PREFIX}"
|
|
43
|
+
|
|
44
|
+
echo "Refreshing built dist artifacts..."
|
|
45
|
+
rm -rf "${STAGE_DIR:?}/${PREFIX}/dist"
|
|
46
|
+
cp -R "${ROOT_DIR}/dist" "${STAGE_DIR}/${PREFIX}/dist"
|
|
47
|
+
rm -rf "${STAGE_DIR:?}/${PREFIX}/dist/release-stage"
|
|
48
|
+
|
|
49
|
+
test -f "${STAGE_DIR}/${PREFIX}/dist/agent-mockingbird"
|
|
50
|
+
test -f "${STAGE_DIR}/${PREFIX}/dist/drizzle/meta/_journal.json"
|
|
51
|
+
test -f "${STAGE_DIR}/${PREFIX}/dist/app/index.html"
|
|
52
|
+
test -f "${STAGE_DIR}/${PREFIX}/drizzle/meta/_journal.json"
|
|
53
|
+
|
|
54
|
+
echo "Packing release bundle..."
|
|
55
|
+
tar -C "${STAGE_DIR}" -czf "${ARCHIVE_PATH}" "${PREFIX}"
|
|
56
|
+
|
|
57
|
+
(
|
|
58
|
+
cd "${DIST_DIR}"
|
|
59
|
+
sha256sum "agent-mockingbird-${VERSION}.tar.gz" > "agent-mockingbird-${VERSION}.tar.gz.sha256"
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
rm -rf "${STAGE_DIR}"
|
|
63
|
+
|
|
64
|
+
echo "Created:"
|
|
65
|
+
echo " ${ARCHIVE_PATH}"
|
|
66
|
+
echo " ${CHECKSUM_PATH}"
|