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,341 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "93dda59b-0dc1-4e46-9a63-9adc146b1696",
|
|
5
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
6
|
+
"tables": {
|
|
7
|
+
"heartbeat_events": {
|
|
8
|
+
"name": "heartbeat_events",
|
|
9
|
+
"columns": {
|
|
10
|
+
"id": {
|
|
11
|
+
"name": "id",
|
|
12
|
+
"type": "text",
|
|
13
|
+
"primaryKey": true,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": false
|
|
16
|
+
},
|
|
17
|
+
"online": {
|
|
18
|
+
"name": "online",
|
|
19
|
+
"type": "integer",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true,
|
|
22
|
+
"autoincrement": false,
|
|
23
|
+
"default": true
|
|
24
|
+
},
|
|
25
|
+
"source": {
|
|
26
|
+
"name": "source",
|
|
27
|
+
"type": "text",
|
|
28
|
+
"primaryKey": false,
|
|
29
|
+
"notNull": true,
|
|
30
|
+
"autoincrement": false,
|
|
31
|
+
"default": "'system'"
|
|
32
|
+
},
|
|
33
|
+
"created_at": {
|
|
34
|
+
"name": "created_at",
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"primaryKey": false,
|
|
37
|
+
"notNull": true,
|
|
38
|
+
"autoincrement": false,
|
|
39
|
+
"default": "(strftime('%s', 'now') * 1000)"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"indexes": {
|
|
43
|
+
"heartbeat_events_created_idx": {
|
|
44
|
+
"name": "heartbeat_events_created_idx",
|
|
45
|
+
"columns": [
|
|
46
|
+
"created_at"
|
|
47
|
+
],
|
|
48
|
+
"isUnique": false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"foreignKeys": {},
|
|
52
|
+
"compositePrimaryKeys": {},
|
|
53
|
+
"uniqueConstraints": {},
|
|
54
|
+
"checkConstraints": {}
|
|
55
|
+
},
|
|
56
|
+
"messages": {
|
|
57
|
+
"name": "messages",
|
|
58
|
+
"columns": {
|
|
59
|
+
"id": {
|
|
60
|
+
"name": "id",
|
|
61
|
+
"type": "text",
|
|
62
|
+
"primaryKey": true,
|
|
63
|
+
"notNull": true,
|
|
64
|
+
"autoincrement": false
|
|
65
|
+
},
|
|
66
|
+
"session_id": {
|
|
67
|
+
"name": "session_id",
|
|
68
|
+
"type": "text",
|
|
69
|
+
"primaryKey": false,
|
|
70
|
+
"notNull": true,
|
|
71
|
+
"autoincrement": false
|
|
72
|
+
},
|
|
73
|
+
"role": {
|
|
74
|
+
"name": "role",
|
|
75
|
+
"type": "text",
|
|
76
|
+
"primaryKey": false,
|
|
77
|
+
"notNull": true,
|
|
78
|
+
"autoincrement": false
|
|
79
|
+
},
|
|
80
|
+
"content": {
|
|
81
|
+
"name": "content",
|
|
82
|
+
"type": "text",
|
|
83
|
+
"primaryKey": false,
|
|
84
|
+
"notNull": true,
|
|
85
|
+
"autoincrement": false
|
|
86
|
+
},
|
|
87
|
+
"created_at": {
|
|
88
|
+
"name": "created_at",
|
|
89
|
+
"type": "integer",
|
|
90
|
+
"primaryKey": false,
|
|
91
|
+
"notNull": true,
|
|
92
|
+
"autoincrement": false,
|
|
93
|
+
"default": "(strftime('%s', 'now') * 1000)"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"indexes": {
|
|
97
|
+
"messages_session_created_idx": {
|
|
98
|
+
"name": "messages_session_created_idx",
|
|
99
|
+
"columns": [
|
|
100
|
+
"session_id",
|
|
101
|
+
"created_at"
|
|
102
|
+
],
|
|
103
|
+
"isUnique": false
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"foreignKeys": {
|
|
107
|
+
"messages_session_id_sessions_id_fk": {
|
|
108
|
+
"name": "messages_session_id_sessions_id_fk",
|
|
109
|
+
"tableFrom": "messages",
|
|
110
|
+
"tableTo": "sessions",
|
|
111
|
+
"columnsFrom": [
|
|
112
|
+
"session_id"
|
|
113
|
+
],
|
|
114
|
+
"columnsTo": [
|
|
115
|
+
"id"
|
|
116
|
+
],
|
|
117
|
+
"onDelete": "cascade",
|
|
118
|
+
"onUpdate": "no action"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"compositePrimaryKeys": {},
|
|
122
|
+
"uniqueConstraints": {},
|
|
123
|
+
"checkConstraints": {}
|
|
124
|
+
},
|
|
125
|
+
"runtime_config": {
|
|
126
|
+
"name": "runtime_config",
|
|
127
|
+
"columns": {
|
|
128
|
+
"key": {
|
|
129
|
+
"name": "key",
|
|
130
|
+
"type": "text",
|
|
131
|
+
"primaryKey": true,
|
|
132
|
+
"notNull": true,
|
|
133
|
+
"autoincrement": false
|
|
134
|
+
},
|
|
135
|
+
"value_json": {
|
|
136
|
+
"name": "value_json",
|
|
137
|
+
"type": "text",
|
|
138
|
+
"primaryKey": false,
|
|
139
|
+
"notNull": true,
|
|
140
|
+
"autoincrement": false
|
|
141
|
+
},
|
|
142
|
+
"updated_at": {
|
|
143
|
+
"name": "updated_at",
|
|
144
|
+
"type": "integer",
|
|
145
|
+
"primaryKey": false,
|
|
146
|
+
"notNull": true,
|
|
147
|
+
"autoincrement": false,
|
|
148
|
+
"default": "(strftime('%s', 'now') * 1000)"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"indexes": {},
|
|
152
|
+
"foreignKeys": {},
|
|
153
|
+
"compositePrimaryKeys": {},
|
|
154
|
+
"uniqueConstraints": {},
|
|
155
|
+
"checkConstraints": {}
|
|
156
|
+
},
|
|
157
|
+
"sessions": {
|
|
158
|
+
"name": "sessions",
|
|
159
|
+
"columns": {
|
|
160
|
+
"id": {
|
|
161
|
+
"name": "id",
|
|
162
|
+
"type": "text",
|
|
163
|
+
"primaryKey": true,
|
|
164
|
+
"notNull": true,
|
|
165
|
+
"autoincrement": false
|
|
166
|
+
},
|
|
167
|
+
"title": {
|
|
168
|
+
"name": "title",
|
|
169
|
+
"type": "text",
|
|
170
|
+
"primaryKey": false,
|
|
171
|
+
"notNull": true,
|
|
172
|
+
"autoincrement": false
|
|
173
|
+
},
|
|
174
|
+
"model": {
|
|
175
|
+
"name": "model",
|
|
176
|
+
"type": "text",
|
|
177
|
+
"primaryKey": false,
|
|
178
|
+
"notNull": true,
|
|
179
|
+
"autoincrement": false
|
|
180
|
+
},
|
|
181
|
+
"status": {
|
|
182
|
+
"name": "status",
|
|
183
|
+
"type": "text",
|
|
184
|
+
"primaryKey": false,
|
|
185
|
+
"notNull": true,
|
|
186
|
+
"autoincrement": false,
|
|
187
|
+
"default": "'idle'"
|
|
188
|
+
},
|
|
189
|
+
"message_count": {
|
|
190
|
+
"name": "message_count",
|
|
191
|
+
"type": "integer",
|
|
192
|
+
"primaryKey": false,
|
|
193
|
+
"notNull": true,
|
|
194
|
+
"autoincrement": false,
|
|
195
|
+
"default": 0
|
|
196
|
+
},
|
|
197
|
+
"created_at": {
|
|
198
|
+
"name": "created_at",
|
|
199
|
+
"type": "integer",
|
|
200
|
+
"primaryKey": false,
|
|
201
|
+
"notNull": true,
|
|
202
|
+
"autoincrement": false,
|
|
203
|
+
"default": "(strftime('%s', 'now') * 1000)"
|
|
204
|
+
},
|
|
205
|
+
"updated_at": {
|
|
206
|
+
"name": "updated_at",
|
|
207
|
+
"type": "integer",
|
|
208
|
+
"primaryKey": false,
|
|
209
|
+
"notNull": true,
|
|
210
|
+
"autoincrement": false,
|
|
211
|
+
"default": "(strftime('%s', 'now') * 1000)"
|
|
212
|
+
},
|
|
213
|
+
"last_active_at": {
|
|
214
|
+
"name": "last_active_at",
|
|
215
|
+
"type": "integer",
|
|
216
|
+
"primaryKey": false,
|
|
217
|
+
"notNull": true,
|
|
218
|
+
"autoincrement": false,
|
|
219
|
+
"default": "(strftime('%s', 'now') * 1000)"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"indexes": {
|
|
223
|
+
"sessions_last_active_idx": {
|
|
224
|
+
"name": "sessions_last_active_idx",
|
|
225
|
+
"columns": [
|
|
226
|
+
"last_active_at"
|
|
227
|
+
],
|
|
228
|
+
"isUnique": false
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"foreignKeys": {},
|
|
232
|
+
"compositePrimaryKeys": {},
|
|
233
|
+
"uniqueConstraints": {},
|
|
234
|
+
"checkConstraints": {}
|
|
235
|
+
},
|
|
236
|
+
"usage_events": {
|
|
237
|
+
"name": "usage_events",
|
|
238
|
+
"columns": {
|
|
239
|
+
"id": {
|
|
240
|
+
"name": "id",
|
|
241
|
+
"type": "text",
|
|
242
|
+
"primaryKey": true,
|
|
243
|
+
"notNull": true,
|
|
244
|
+
"autoincrement": false
|
|
245
|
+
},
|
|
246
|
+
"session_id": {
|
|
247
|
+
"name": "session_id",
|
|
248
|
+
"type": "text",
|
|
249
|
+
"primaryKey": false,
|
|
250
|
+
"notNull": false,
|
|
251
|
+
"autoincrement": false
|
|
252
|
+
},
|
|
253
|
+
"request_count_delta": {
|
|
254
|
+
"name": "request_count_delta",
|
|
255
|
+
"type": "integer",
|
|
256
|
+
"primaryKey": false,
|
|
257
|
+
"notNull": true,
|
|
258
|
+
"autoincrement": false,
|
|
259
|
+
"default": 0
|
|
260
|
+
},
|
|
261
|
+
"input_tokens_delta": {
|
|
262
|
+
"name": "input_tokens_delta",
|
|
263
|
+
"type": "integer",
|
|
264
|
+
"primaryKey": false,
|
|
265
|
+
"notNull": true,
|
|
266
|
+
"autoincrement": false,
|
|
267
|
+
"default": 0
|
|
268
|
+
},
|
|
269
|
+
"output_tokens_delta": {
|
|
270
|
+
"name": "output_tokens_delta",
|
|
271
|
+
"type": "integer",
|
|
272
|
+
"primaryKey": false,
|
|
273
|
+
"notNull": true,
|
|
274
|
+
"autoincrement": false,
|
|
275
|
+
"default": 0
|
|
276
|
+
},
|
|
277
|
+
"estimated_cost_usd_delta_micros": {
|
|
278
|
+
"name": "estimated_cost_usd_delta_micros",
|
|
279
|
+
"type": "integer",
|
|
280
|
+
"primaryKey": false,
|
|
281
|
+
"notNull": true,
|
|
282
|
+
"autoincrement": false,
|
|
283
|
+
"default": 0
|
|
284
|
+
},
|
|
285
|
+
"source": {
|
|
286
|
+
"name": "source",
|
|
287
|
+
"type": "text",
|
|
288
|
+
"primaryKey": false,
|
|
289
|
+
"notNull": true,
|
|
290
|
+
"autoincrement": false,
|
|
291
|
+
"default": "'system'"
|
|
292
|
+
},
|
|
293
|
+
"created_at": {
|
|
294
|
+
"name": "created_at",
|
|
295
|
+
"type": "integer",
|
|
296
|
+
"primaryKey": false,
|
|
297
|
+
"notNull": true,
|
|
298
|
+
"autoincrement": false,
|
|
299
|
+
"default": "(strftime('%s', 'now') * 1000)"
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"indexes": {
|
|
303
|
+
"usage_events_created_idx": {
|
|
304
|
+
"name": "usage_events_created_idx",
|
|
305
|
+
"columns": [
|
|
306
|
+
"created_at"
|
|
307
|
+
],
|
|
308
|
+
"isUnique": false
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"foreignKeys": {
|
|
312
|
+
"usage_events_session_id_sessions_id_fk": {
|
|
313
|
+
"name": "usage_events_session_id_sessions_id_fk",
|
|
314
|
+
"tableFrom": "usage_events",
|
|
315
|
+
"tableTo": "sessions",
|
|
316
|
+
"columnsFrom": [
|
|
317
|
+
"session_id"
|
|
318
|
+
],
|
|
319
|
+
"columnsTo": [
|
|
320
|
+
"id"
|
|
321
|
+
],
|
|
322
|
+
"onDelete": "set null",
|
|
323
|
+
"onUpdate": "no action"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"compositePrimaryKeys": {},
|
|
327
|
+
"uniqueConstraints": {},
|
|
328
|
+
"checkConstraints": {}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"views": {},
|
|
332
|
+
"enums": {},
|
|
333
|
+
"_meta": {
|
|
334
|
+
"schemas": {},
|
|
335
|
+
"tables": {},
|
|
336
|
+
"columns": {}
|
|
337
|
+
},
|
|
338
|
+
"internal": {
|
|
339
|
+
"indexes": {}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "7",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"entries": [
|
|
5
|
+
{
|
|
6
|
+
"idx": 0,
|
|
7
|
+
"version": "6",
|
|
8
|
+
"when": 1771276915987,
|
|
9
|
+
"tag": "0000_famous_turbo",
|
|
10
|
+
"breakpoints": true
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"idx": 1,
|
|
14
|
+
"version": "7",
|
|
15
|
+
"when": 1771401600000,
|
|
16
|
+
"tag": "0001_cron_memory_aux",
|
|
17
|
+
"breakpoints": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"idx": 2,
|
|
21
|
+
"version": "7",
|
|
22
|
+
"when": 1771872000000,
|
|
23
|
+
"tag": "0002_runtime_session_bindings",
|
|
24
|
+
"breakpoints": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"idx": 3,
|
|
28
|
+
"version": "7",
|
|
29
|
+
"when": 1771872600000,
|
|
30
|
+
"tag": "0003_background_runs",
|
|
31
|
+
"breakpoints": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"idx": 4,
|
|
35
|
+
"version": "7",
|
|
36
|
+
"when": 1771880000000,
|
|
37
|
+
"tag": "0004_memory_open_write",
|
|
38
|
+
"breakpoints": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"idx": 5,
|
|
42
|
+
"version": "7",
|
|
43
|
+
"when": 1772409600000,
|
|
44
|
+
"tag": "0005_signal_channel",
|
|
45
|
+
"breakpoints": true
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"idx": 6,
|
|
49
|
+
"version": "7",
|
|
50
|
+
"when": 1773619200000,
|
|
51
|
+
"tag": "0006_usage_event_dimensions",
|
|
52
|
+
"breakpoints": true
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineConfig } from "drizzle-kit";
|
|
2
|
+
|
|
3
|
+
const dbPath = process.env.AGENT_MOCKINGBIRD_DB_PATH ?? "./data/agent-mockingbird.db";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
schema: "./apps/server/src/backend/db/schema.ts",
|
|
7
|
+
out: "./drizzle",
|
|
8
|
+
dialect: "sqlite",
|
|
9
|
+
dbCredentials: {
|
|
10
|
+
url: dbPath,
|
|
11
|
+
},
|
|
12
|
+
strict: true,
|
|
13
|
+
verbose: true,
|
|
14
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import importPlugin from "eslint-plugin-import";
|
|
3
|
+
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
4
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
5
|
+
import globals from "globals";
|
|
6
|
+
import tseslint from "typescript-eslint";
|
|
7
|
+
|
|
8
|
+
export default tseslint.config(
|
|
9
|
+
{
|
|
10
|
+
ignores: [
|
|
11
|
+
"**/dist/**",
|
|
12
|
+
"**/node_modules/**",
|
|
13
|
+
"**/.turbo/**",
|
|
14
|
+
"openclaw/**",
|
|
15
|
+
"vendor/opencode/**",
|
|
16
|
+
"opencode-sdk-js/**",
|
|
17
|
+
"convex-backend/**",
|
|
18
|
+
"rivet/**",
|
|
19
|
+
"sandbox-agent/**",
|
|
20
|
+
"data/**",
|
|
21
|
+
"runtime-assets/**",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
js.configs.recommended,
|
|
25
|
+
...tseslint.configs.recommended,
|
|
26
|
+
{
|
|
27
|
+
files: ["**/*.{ts,tsx}"],
|
|
28
|
+
languageOptions: {
|
|
29
|
+
parserOptions: {
|
|
30
|
+
projectService: true,
|
|
31
|
+
tsconfigRootDir: import.meta.dirname,
|
|
32
|
+
},
|
|
33
|
+
globals: {
|
|
34
|
+
...globals.browser,
|
|
35
|
+
...globals.node,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
plugins: {
|
|
39
|
+
"react-hooks": reactHooks,
|
|
40
|
+
"jsx-a11y": jsxA11y,
|
|
41
|
+
import: importPlugin,
|
|
42
|
+
},
|
|
43
|
+
settings: {
|
|
44
|
+
"import/resolver": {
|
|
45
|
+
typescript: {
|
|
46
|
+
project: [
|
|
47
|
+
"./tsconfig.json",
|
|
48
|
+
"./apps/*/tsconfig.json",
|
|
49
|
+
"./packages/*/tsconfig.json",
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
rules: {
|
|
55
|
+
...reactHooks.configs.recommended.rules,
|
|
56
|
+
...jsxA11y.configs.recommended.rules,
|
|
57
|
+
"import/order": [
|
|
58
|
+
"error",
|
|
59
|
+
{
|
|
60
|
+
alphabetize: { order: "asc", caseInsensitive: true },
|
|
61
|
+
groups: [["builtin", "external"], "internal", ["parent", "sibling", "index"]],
|
|
62
|
+
"newlines-between": "always",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
"import/no-duplicates": "error",
|
|
66
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
67
|
+
"@typescript-eslint/no-unused-vars": [
|
|
68
|
+
"error",
|
|
69
|
+
{
|
|
70
|
+
argsIgnorePattern: "^_",
|
|
71
|
+
varsIgnorePattern: "^_",
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
"no-console": ["warn", { allow: ["log", "warn", "error"] }],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
);
|
package/knip.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/knip@5/schema.json",
|
|
3
|
+
"ignore": [
|
|
4
|
+
".opencode/tools/*.ts",
|
|
5
|
+
"runtime-assets/opencode-config/plugins/agent-mockingbird.ts",
|
|
6
|
+
"scripts/runtime-assets-sync.mjs"
|
|
7
|
+
],
|
|
8
|
+
"ignoreDependencies": ["@opencode-ai/plugin"],
|
|
9
|
+
"workspaces": {
|
|
10
|
+
".": {},
|
|
11
|
+
"apps/server": {
|
|
12
|
+
"entry": [
|
|
13
|
+
"src/backend/memory/cli.ts",
|
|
14
|
+
"src/cli/agent-mockingbird.mjs"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"upstream": {
|
|
3
|
+
"remote": "https://github.com/anomalyco/opencode.git",
|
|
4
|
+
"tag": "v1.2.27",
|
|
5
|
+
"commit": "4ee426ba549131c4903a71dfb6259200467aca81"
|
|
6
|
+
},
|
|
7
|
+
"packageVersion": "1.2.27",
|
|
8
|
+
"paths": {
|
|
9
|
+
"cleanroom": "cleanroom/opencode",
|
|
10
|
+
"vendor": "vendor/opencode",
|
|
11
|
+
"patches": "patches/opencode"
|
|
12
|
+
},
|
|
13
|
+
"branch": {
|
|
14
|
+
"name": "agent-mockingbird/opencode"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-mockingbird",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Bun-native orchestration dashboard scaffold for a long-running agent stack.",
|
|
6
|
+
"packageManager": "bun@1.3.10",
|
|
7
|
+
"homepage": "https://github.com/waffleophagus/agent-mockingbird",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/waffleophagus/agent-mockingbird/issues"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/waffleophagus/agent-mockingbird.git"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"agent-mockingbird": "bin/agent-mockingbird"
|
|
17
|
+
},
|
|
18
|
+
"workspaces": [
|
|
19
|
+
"apps/*",
|
|
20
|
+
"packages/*"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"prepare": "bun run ./scripts/setup-git-hooks.ts",
|
|
24
|
+
"setup:hooks": "bun run ./scripts/setup-git-hooks.ts",
|
|
25
|
+
"check:ship": "bun run ./scripts/check-ship.ts",
|
|
26
|
+
"opencode:sync": "bun run ./scripts/opencode-sync.ts",
|
|
27
|
+
"opencode:swap": "bun run ./scripts/opencode-swap.ts",
|
|
28
|
+
"dev": "turbo run dev --filter=@agent-mockingbird/server",
|
|
29
|
+
"dev:opencode": "bash scripts/dev-opencode.sh",
|
|
30
|
+
"dev:cleanroom:opencode": "bun run --cwd cleanroom/opencode/packages/opencode --conditions=browser ./src/index.ts serve --hostname 127.0.0.1 --port 4097 --print-logs --log-level INFO",
|
|
31
|
+
"dev:cleanroom:web": "VITE_OPENCODE_SERVER_HOST=127.0.0.1 VITE_OPENCODE_SERVER_PORT=4097 bun run --cwd cleanroom/opencode/packages/app dev -- --host 127.0.0.1 --port 4444",
|
|
32
|
+
"dev:cleanroom": "concurrently -k -n cleanroom-opencode,cleanroom-web -c cyan,green \"bun run dev:cleanroom:opencode\" \"bun run dev:cleanroom:web\"",
|
|
33
|
+
"dev:server": "turbo run dev --filter=@agent-mockingbird/server",
|
|
34
|
+
"dev:stack": "bash scripts/dev-stack-opencode.sh",
|
|
35
|
+
"build:cli": "bun run ./build-cli.mjs",
|
|
36
|
+
"build:bin": "bun run ./build-bin.ts",
|
|
37
|
+
"build": "turbo run build",
|
|
38
|
+
"build:server": "turbo run build --filter=@agent-mockingbird/server",
|
|
39
|
+
"build:app": "bun run ./build.ts",
|
|
40
|
+
"lint": "turbo run lint",
|
|
41
|
+
"test": "turbo run test",
|
|
42
|
+
"typecheck": "turbo run typecheck",
|
|
43
|
+
"db:generate": "turbo run db:generate --filter=@agent-mockingbird/server",
|
|
44
|
+
"db:migrate": "turbo run db:migrate --filter=@agent-mockingbird/server",
|
|
45
|
+
"db:check": "turbo run db:check --filter=@agent-mockingbird/server",
|
|
46
|
+
"db:wipe": "turbo run db:wipe --filter=@agent-mockingbird/server",
|
|
47
|
+
"config:migrate-opencode-env": "bun run ./scripts/migrate-opencode-env.ts"
|
|
48
|
+
},
|
|
49
|
+
"overrides": {
|
|
50
|
+
"remend": "1.2.2"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@eslint/js": "^9.39.3",
|
|
54
|
+
"@types/bun": "latest",
|
|
55
|
+
"concurrently": "^9.2.1",
|
|
56
|
+
"drizzle-kit": "^0.31.9",
|
|
57
|
+
"eslint": "^9.39.3",
|
|
58
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
59
|
+
"eslint-plugin-import": "^2.32.0",
|
|
60
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
61
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
62
|
+
"globals": "^17.3.0",
|
|
63
|
+
"turbo": "^2.5.8",
|
|
64
|
+
"typescript": "^5.9.3",
|
|
65
|
+
"typescript-eslint": "^8.56.1"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @waffleophagus/agent-mockingbird-installer
|
|
2
|
+
|
|
3
|
+
Compatibility wrapper for `agent-mockingbird`.
|
|
4
|
+
|
|
5
|
+
Canonical usage:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx --yes \
|
|
9
|
+
--package "@waffleophagus/agent-mockingbird-installer@latest" \
|
|
10
|
+
agent-mockingbird-installer install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
It forwards all arguments to:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm exec --yes --package agent-mockingbird@latest agent-mockingbird -- <args>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
By default it installs from npmjs. If you need a different registry for the `@waffleophagus` scope, set `AGENT_MOCKINGBIRD_REGISTRY_URL`.
|
|
20
|
+
|
|
21
|
+
Primary CLI is now:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
agent-mockingbird install
|
|
25
|
+
agent-mockingbird update
|
|
26
|
+
agent-mockingbird status
|
|
27
|
+
agent-mockingbird restart
|
|
28
|
+
agent-mockingbird start
|
|
29
|
+
agent-mockingbird stop
|
|
30
|
+
agent-mockingbird uninstall
|
|
31
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import process from "node:process";
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
|
|
8
|
+
const tag = process.env.AGENT_MOCKINGBIRD_INSTALLER_TAG || "latest";
|
|
9
|
+
const registry = process.env.AGENT_MOCKINGBIRD_REGISTRY_URL || "https://registry.npmjs.org/";
|
|
10
|
+
const publicRegistry = process.env.AGENT_MOCKINGBIRD_PUBLIC_REGISTRY_URL || "https://registry.npmjs.org/";
|
|
11
|
+
const pkg = `agent-mockingbird@${tag}`;
|
|
12
|
+
const installerDir = path.dirname(new URL(import.meta.url).pathname);
|
|
13
|
+
const opencodeLockPath = path.join(installerDir, "..", "opencode.lock.json");
|
|
14
|
+
const opencodeVersion = fs.existsSync(opencodeLockPath)
|
|
15
|
+
? JSON.parse(fs.readFileSync(opencodeLockPath, "utf8")).packageVersion
|
|
16
|
+
: undefined;
|
|
17
|
+
|
|
18
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "agent-mockingbird-installer-"));
|
|
19
|
+
const npmrcPath = path.join(tmpDir, ".npmrc");
|
|
20
|
+
fs.writeFileSync(
|
|
21
|
+
npmrcPath,
|
|
22
|
+
`registry=${registry}\n`,
|
|
23
|
+
"utf8",
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const result = spawnSync(
|
|
27
|
+
"npm",
|
|
28
|
+
["exec", "--yes", "--package", pkg, "agent-mockingbird", "--", ...process.argv.slice(2)],
|
|
29
|
+
{
|
|
30
|
+
stdio: "inherit",
|
|
31
|
+
env: {
|
|
32
|
+
...process.env,
|
|
33
|
+
...(opencodeVersion ? { AGENT_MOCKINGBIRD_OPENCODE_VERSION: opencodeVersion } : {}),
|
|
34
|
+
npm_config_userconfig: npmrcPath,
|
|
35
|
+
npm_config_registry: publicRegistry,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
41
|
+
|
|
42
|
+
if ((result.status ?? 1) !== 0) {
|
|
43
|
+
process.exit(result.status ?? 1);
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"upstream": {
|
|
3
|
+
"remote": "https://github.com/anomalyco/opencode.git",
|
|
4
|
+
"tag": "v1.2.27",
|
|
5
|
+
"commit": "4ee426ba549131c4903a71dfb6259200467aca81"
|
|
6
|
+
},
|
|
7
|
+
"packageVersion": "1.2.27",
|
|
8
|
+
"paths": {
|
|
9
|
+
"cleanroom": "cleanroom/opencode",
|
|
10
|
+
"vendor": "vendor/opencode",
|
|
11
|
+
"patches": "patches/opencode"
|
|
12
|
+
},
|
|
13
|
+
"branch": {
|
|
14
|
+
"name": "agent-mockingbird/opencode"
|
|
15
|
+
}
|
|
16
|
+
}
|