@aiwg/cli 2026.10.15 → 2026.10.16
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/agentic/code/providers/pi/aiwg-bridge.ts +45 -7
- package/dist/src/artifacts/citation-parser.js +7 -6
- package/dist/src/artifacts/corpus-tools/citation-densify.js +4 -2
- package/dist/src/artifacts/corpus-tools/cli.js +8 -3
- package/dist/src/artifacts/corpus-tools/discovery-log.js +26 -24
- package/dist/src/artifacts/corpus-tools/expand-cli.js +3 -2
- package/dist/src/artifacts/corpus-tools/expand-dates.js +107 -0
- package/dist/src/artifacts/corpus-tools/expand-queue.js +4 -1
- package/dist/src/artifacts/corpus-tools/expand-review.js +104 -0
- package/dist/src/artifacts/corpus-tools/expand-state.js +17 -1
- package/dist/src/artifacts/corpus-tools/expand.js +16 -17
- package/dist/src/artifacts/corpus-tools/induction-audit.js +7 -6
- package/dist/src/artifacts/corpus-tools/integrity-scan.js +3 -3
- package/dist/src/artifacts/corpus-tools/radar-shared.js +7 -9
- package/dist/src/artifacts/corpus-tools/ref-files.js +11 -0
- package/dist/src/artifacts/corpus-tools/resolve-cli.js +11 -3
- package/dist/src/artifacts/corpus-tools/resolve.js +23 -9
- package/dist/src/artifacts/corpus-tools/retrieval-lab.js +2 -1
- package/dist/src/artifacts/corpus-tools/sidecar-lint.js +4 -4
- package/dist/src/artifacts/corpus-tools/sidecar-repair.js +2 -1
- package/dist/src/artifacts/corpus-views/ref-parser.js +3 -17
- package/dist/src/artifacts/graph-query.js +5 -3
- package/dist/src/artifacts/hybrid-query.js +11 -2
- package/dist/src/artifacts/index-refresh.js +2 -0
- package/dist/src/cli/handlers/daemon.js +17 -1
- package/dist/src/cli/handlers/doctor-args.js +10 -5
- package/dist/src/cli/handlers/doctor-help.js +4 -1
- package/dist/src/cli/handlers/index.js +2 -2
- package/dist/src/cli/handlers/models-resource-sample.js +10 -0
- package/dist/src/cli/handlers/models.js +3 -2
- package/dist/src/cli/handlers/regenerate.js +8 -16
- package/dist/src/cli/handlers/sessions.js +7 -7
- package/dist/src/cli/handlers/subcommands.js +8 -0
- package/dist/src/cli/handlers/update.js +157 -0
- package/dist/src/cli/handlers/use.js +14 -4
- package/dist/src/cli/handlers/utilities.js +3 -560
- package/dist/src/cli/handlers/utility-doctor.js +412 -0
- package/dist/src/cli/services/deployment-verification.js +0 -1
- package/dist/src/config/aiwg-config.js +2 -1
- package/dist/src/config/authorization-cli.js +7 -3
- package/dist/src/config/dispatch-thresholds-runtime.d.mts +3 -2
- package/dist/src/config/dispatch-thresholds-runtime.mjs +17 -7
- package/dist/src/config/framework-aliases.js +12 -0
- package/dist/src/config/host-resource-report.d.mts +19 -0
- package/dist/src/config/host-resource-report.mjs +80 -0
- package/dist/src/config/host-resource-runtime.d.mts +34 -0
- package/dist/src/config/host-resource-runtime.mjs +293 -0
- package/dist/src/config/installed-selection.js +22 -0
- package/dist/src/config/worker-invocation-marker.d.mts +1 -0
- package/dist/src/config/worker-invocation-marker.mjs +2 -0
- package/dist/src/decision/heldout/access.js +74 -0
- package/dist/src/decision/heldout/calibration.js +1 -0
- package/dist/src/decision/heldout/collector.js +8 -1
- package/dist/src/effects/verifiers/file.js +22 -5
- package/dist/src/extensions/claude-attribution.js +82 -0
- package/dist/src/extensions/claude-hooks-installer.js +115 -69
- package/dist/src/extensions/commands/daemon.js +109 -0
- package/dist/src/extensions/commands/definitions.js +5 -89
- package/dist/src/gates/heldout.js +17 -7
- package/dist/src/lint/check-patterns.js +163 -0
- package/dist/src/lint/checks.js +268 -0
- package/dist/src/lint/reference-resolution.js +54 -0
- package/dist/src/lint/runner.js +3 -465
- package/dist/src/mcp/helpers.mjs +11 -1
- package/dist/src/memory/project-registry.js +44 -4
- package/dist/src/models/worker-plan.js +36 -5
- package/dist/src/models/wrapper-deployment.js +25 -12
- package/dist/src/models/wrapper-enforcement.js +47 -7
- package/dist/src/network-analysis/research.js +2 -1
- package/dist/src/policy/hitl-check.js +14 -4
- package/dist/src/policy/hitl-consume.js +54 -0
- package/dist/src/policy/hitl-receipt.js +2 -0
- package/dist/src/policy/hitl.js +11 -3
- package/dist/src/providers/provider-context-contracts.js +162 -0
- package/dist/src/providers/provider-definition-schema.js +136 -0
- package/dist/src/providers/provider-definitions.js +8 -1298
- package/dist/src/providers/provider-seeds-1.js +360 -0
- package/dist/src/providers/provider-seeds-2.js +387 -0
- package/dist/src/providers/provider-seeds-3.js +262 -0
- package/dist/src/research/clients/arxiv.js +4 -30
- package/dist/src/research/clients/base.js +48 -22
- package/dist/src/research/identity.js +34 -2
- package/dist/src/research/query-cli.js +3 -87
- package/dist/src/research/query-options.js +87 -0
- package/dist/src/research/reference-match.js +70 -24
- package/dist/src/research/services/acquisition.js +9 -7
- package/dist/src/research/services/citation.js +5 -2
- package/dist/src/research/types.js +2 -0
- package/dist/src/serve/mission-conductor.js +48 -4
- package/dist/src/sessions/adapters/grok-build-native.js +23 -0
- package/dist/src/sessions/adapters/grok-build.js +14 -7
- package/dist/src/sessions/workspace-discovery.js +5 -5
- package/dist/src/smiths/context-pipeline/aiwg-md.js +16 -46
- package/dist/src/smiths/context-pipeline/claude-hook.js +1 -1
- package/dist/src/smiths/context-pipeline/code-regions.js +28 -0
- package/dist/src/smiths/context-pipeline/finalization.js +81 -51
- package/dist/src/smiths/context-pipeline/generator.js +9 -10
- package/dist/src/smiths/context-pipeline/managed-hook.js +1 -1
- package/dist/src/smiths/context-pipeline/muse-bridge.js +2 -2
- package/dist/src/smiths/context-pipeline/provider-policy.js +6 -12
- package/dist/src/smiths/context-pipeline/workspace-audit.js +299 -0
- package/dist/src/smiths/context-pipeline/workspace-bootstrap.js +148 -0
- package/dist/src/smiths/context-pipeline/workspace-context-shared.js +111 -0
- package/dist/src/smiths/context-pipeline/workspace-context.js +8 -1373
- package/dist/src/smiths/context-pipeline/workspace-doctor.js +192 -0
- package/dist/src/smiths/context-pipeline/workspace-document.js +201 -0
- package/dist/src/smiths/context-pipeline/workspace-extraction.js +205 -0
- package/dist/src/smiths/context-pipeline/workspace-migration.js +250 -0
- package/package.json +10 -1
- package/schemas/decision/D29Study.v10.schema.json +65 -0
- package/tools/agents/deploy-agents.mjs +10 -0
- package/tools/agents/providers/claude-post-deploy.mjs +12 -1
- package/tools/agents/providers/context-write.mjs +4 -0
- package/tools/agents/providers/pi.mjs +3 -1
- package/tools/agents/providers/rule-delivery-surface.mjs +332 -0
- package/tools/agents/providers/rule-delivery.mjs +20 -1144
- package/tools/agents/providers/rule-deployment-commit.mjs +144 -0
- package/tools/agents/providers/rule-deployment-prepare.mjs +452 -0
- package/tools/agents/providers/rule-deployment-state.mjs +300 -0
- package/tools/daemon/README.md +511 -0
- package/tools/daemon/adapters/base-adapter.mjs +84 -0
- package/tools/daemon/adapters/webhook-adapter.mjs +107 -0
- package/tools/daemon/agent-supervisor.mjs +299 -0
- package/tools/daemon/automation-engine.mjs +310 -0
- package/tools/daemon/autonomous-engine.mjs +346 -0
- package/tools/daemon/behavior-loader.mjs +316 -0
- package/tools/daemon/behavior.mjs +174 -0
- package/tools/daemon/concierge/intent-router.mjs +401 -0
- package/tools/daemon/concierge/orchestrator.mjs +272 -0
- package/tools/daemon/concierge/response-translator.mjs +462 -0
- package/tools/daemon/config.mjs +377 -0
- package/tools/daemon/cron-scheduler.mjs +178 -0
- package/tools/daemon/daemon-main.mjs +1169 -0
- package/tools/daemon/event-router.mjs +84 -0
- package/tools/daemon/file-watcher.mjs +383 -0
- package/tools/daemon/index.mjs +1181 -0
- package/tools/daemon/init-profile.mjs +124 -0
- package/tools/daemon/ipc-client.mjs +197 -0
- package/tools/daemon/ipc-ops-handlers.mjs +236 -0
- package/tools/daemon/ipc-server.mjs +275 -0
- package/tools/daemon/maintenance-owner.mjs +79 -0
- package/tools/daemon/memory-manager.mjs +386 -0
- package/tools/daemon/message-router.mjs +194 -0
- package/tools/daemon/provider-watcher.mjs +585 -0
- package/tools/daemon/pty-adapter.mjs +420 -0
- package/tools/daemon/repl-chat.mjs +359 -0
- package/tools/daemon/resource-bounds.mjs +88 -0
- package/tools/daemon/sandbox-transport.mjs +295 -0
- package/tools/daemon/scheduled-task-runner.mjs +535 -0
- package/tools/daemon/task-store.mjs +450 -0
- package/tools/daemon/tmux-manager.mjs +324 -0
- package/tools/daemon/update-policy.mjs +517 -0
- package/tools/daemon/web-server.mjs +399 -0
- package/tools/daemon/web-ui/index.html +585 -0
- package/tools/daemon/web-ui/styles.css +156 -0
- package/tools/docker/Dockerfile.daemon +35 -0
- package/tools/docker/container-manager.mjs +291 -0
- package/tools/messaging/adapter-registry.mjs +230 -0
- package/tools/messaging/adapters/base.mjs +326 -0
- package/tools/messaging/adapters/discord.mjs +462 -0
- package/tools/messaging/adapters/slack.mjs +402 -0
- package/tools/messaging/adapters/telegram.mjs +552 -0
- package/tools/messaging/chat-handler.mjs +297 -0
- package/tools/messaging/command-router.mjs +269 -0
- package/tools/messaging/event-bus.mjs +199 -0
- package/tools/messaging/index.mjs +456 -0
- package/tools/messaging/message-formatter.mjs +320 -0
- package/tools/messaging/room-manager.mjs +277 -0
- package/tools/messaging/types.mjs +94 -0
- package/tools/providers/pi-bridge-policy.mjs +4 -0
- package/tools/ralph-external/daemon-supervisor.mjs +394 -0
- package/tools/ralph-external/lib/behavior-registry.mjs +270 -0
- package/tools/ralph-external/lib/worker-invocation-processes.mjs +3 -2
- package/tools/ralph-external/lib/worker-isolation-args.mjs +217 -0
- package/tools/ralph-external/lib/worker-isolation-status.mjs +19 -0
- package/tools/ralph-external/lib/worker-isolation.mjs +11 -237
- package/tools/ralph-external/lib/worker-overflow.mjs +10 -2
- package/tools/ralph-external/lib/worker-unit-cleanup.mjs +72 -0
- package/tools/ralph-external/session-launcher.mjs +7 -7
- package/tools/scripts/resource-preflight.mjs +3 -242
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import { promises as fs } from 'node:fs';
|
|
30
30
|
import * as path from 'node:path';
|
|
31
|
+
import { mergeClaudeAttribution, undoClaudeAttribution } from './claude-attribution.js';
|
|
31
32
|
/**
|
|
32
33
|
* Hook script → Claude Code hook event mapping.
|
|
33
34
|
*
|
|
@@ -113,7 +114,7 @@ export async function installAiwgHooks(opts) {
|
|
|
113
114
|
const sourceHooksDir = path.join(opts.frameworkRoot, 'agentic', 'code', 'addons', 'aiwg-hooks', 'hooks');
|
|
114
115
|
let sourceFiles;
|
|
115
116
|
try {
|
|
116
|
-
sourceFiles = await fs.readdir(sourceHooksDir);
|
|
117
|
+
sourceFiles = opts.hooks === false ? [] : await fs.readdir(sourceHooksDir);
|
|
117
118
|
}
|
|
118
119
|
catch (err) {
|
|
119
120
|
if (err.code === 'ENOENT')
|
|
@@ -128,10 +129,10 @@ export async function installAiwgHooks(opts) {
|
|
|
128
129
|
};
|
|
129
130
|
// 1. Copy hook scripts to .claude/hooks/
|
|
130
131
|
const claudeHooksDir = path.join(opts.projectPath, '.claude', 'hooks');
|
|
131
|
-
if (!opts.dryRun) {
|
|
132
|
+
if (!opts.dryRun && opts.hooks !== false) {
|
|
132
133
|
await fs.mkdir(claudeHooksDir, { recursive: true });
|
|
133
134
|
}
|
|
134
|
-
for (const { file } of HOOK_SCRIPTS) {
|
|
135
|
+
for (const { file } of opts.hooks === false ? [] : HOOK_SCRIPTS) {
|
|
135
136
|
if (!sourceFiles.includes(file)) {
|
|
136
137
|
result.warnings.push(`hook script not found in addon source: ${file}`);
|
|
137
138
|
continue;
|
|
@@ -177,76 +178,80 @@ export async function installAiwgHooks(opts) {
|
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
180
|
catch (err) {
|
|
180
|
-
|
|
181
|
+
throw new Error(`Backup failed; settings.json was not changed: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
for (const
|
|
220
|
-
|
|
221
|
-
const sameScript = typeof h.command === 'string' && h.command.includes(script);
|
|
222
|
-
if (!sameId && !sameScript)
|
|
184
|
+
if (opts.attribution !== false)
|
|
185
|
+
mergeClaudeAttribution(settings, result.warnings);
|
|
186
|
+
if (opts.hooks !== false) {
|
|
187
|
+
// 4. Normalize (migrate legacy array shape → object shape) and merge
|
|
188
|
+
const [hooksObj, migrated] = normalizeHooks(settings.hooks);
|
|
189
|
+
if (migrated) {
|
|
190
|
+
result.migratedFromLegacy = true;
|
|
191
|
+
result.warnings.push('Migrated legacy array-shaped hooks field to object form (#107).');
|
|
192
|
+
}
|
|
193
|
+
settings.hooks = hooksObj;
|
|
194
|
+
for (const { file, events } of HOOK_SCRIPTS) {
|
|
195
|
+
if (!sourceFiles.includes(file))
|
|
196
|
+
continue;
|
|
197
|
+
// Claude Code parses hook commands as shell command strings. Keep the
|
|
198
|
+
// embedded script path POSIX-style on every host: native Windows
|
|
199
|
+
// backslashes are interpreted as escapes and collapse into a nonexistent
|
|
200
|
+
// path such as `.claudehooksaiwg-session.cjs` (#133).
|
|
201
|
+
const script = path.posix.join('.claude', 'hooks', file);
|
|
202
|
+
const hookId = file.replace(/\.(cjs|js)$/, '');
|
|
203
|
+
for (const [event, argument] of Object.entries(events)) {
|
|
204
|
+
const command = `node ${script}${argument ? ` ${argument}` : ''}`;
|
|
205
|
+
if (!hooksObj[event])
|
|
206
|
+
hooksObj[event] = [];
|
|
207
|
+
const groups = hooksObj[event];
|
|
208
|
+
// Find any existing AIWG-managed entry for this hookId and refresh
|
|
209
|
+
// its `command` to the current script path/extension. Required for
|
|
210
|
+
// users upgrading from pre-`.cjs` installs where the registered
|
|
211
|
+
// command still references `aiwg-{session,trace,permissions}.js` —
|
|
212
|
+
// those files no longer exist on disk after refresh, causing
|
|
213
|
+
// `MODULE_NOT_FOUND` at `node:internal/modules/cjs/loader` on every
|
|
214
|
+
// hook invocation. (Fixes regression report on Claude Code 2.1.157.)
|
|
215
|
+
// Match by `_aiwg_id` first, then by the script path. An entry invoking an
|
|
216
|
+
// AIWG-owned hook script without the managed tag is AIWG residue from an
|
|
217
|
+
// earlier install; appending a managed entry beside it registers the hook
|
|
218
|
+
// twice and runs it twice per event. Adopt it instead. (#2543)
|
|
219
|
+
let updated = false;
|
|
220
|
+
for (const group of groups) {
|
|
221
|
+
if (!Array.isArray(group.hooks))
|
|
223
222
|
continue;
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
h.
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
223
|
+
for (const h of group.hooks) {
|
|
224
|
+
const sameId = h._aiwg_id === hookId;
|
|
225
|
+
const sameScript = typeof h.command === 'string' && h.command.includes(script);
|
|
226
|
+
if (!sameId && !sameScript)
|
|
227
|
+
continue;
|
|
228
|
+
const adopting = !sameId && sameScript;
|
|
229
|
+
if (h.command !== command || h.type !== 'command' || h._aiwg_managed !== true || h._aiwg_id !== hookId) {
|
|
230
|
+
h.type = 'command';
|
|
231
|
+
h.command = command;
|
|
232
|
+
h._aiwg_managed = true;
|
|
233
|
+
h._aiwg_id = hookId;
|
|
234
|
+
result.warnings.push(adopting
|
|
235
|
+
? `Adopted pre-existing untagged ${event} → ${hookId} entry instead of registering a duplicate`
|
|
236
|
+
: `Refreshed stale ${event} → ${hookId} command path`);
|
|
237
|
+
}
|
|
238
|
+
updated = true;
|
|
233
239
|
}
|
|
234
|
-
updated = true;
|
|
235
240
|
}
|
|
241
|
+
if (updated)
|
|
242
|
+
continue;
|
|
243
|
+
groups.push({
|
|
244
|
+
hooks: [
|
|
245
|
+
{
|
|
246
|
+
type: 'command',
|
|
247
|
+
command,
|
|
248
|
+
_aiwg_managed: true,
|
|
249
|
+
_aiwg_id: hookId,
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
});
|
|
253
|
+
result.registeredEvents.push(`${event} → ${hookId}`);
|
|
236
254
|
}
|
|
237
|
-
if (updated)
|
|
238
|
-
continue;
|
|
239
|
-
groups.push({
|
|
240
|
-
hooks: [
|
|
241
|
-
{
|
|
242
|
-
type: 'command',
|
|
243
|
-
command,
|
|
244
|
-
_aiwg_managed: true,
|
|
245
|
-
_aiwg_id: hookId,
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
});
|
|
249
|
-
result.registeredEvents.push(`${event} → ${hookId}`);
|
|
250
255
|
}
|
|
251
256
|
}
|
|
252
257
|
// 5. Atomic write
|
|
@@ -278,11 +283,52 @@ export async function restoreSettingsBackup(projectPath) {
|
|
|
278
283
|
const backups = entries
|
|
279
284
|
.filter((e) => e.startsWith('settings.json.bak.'))
|
|
280
285
|
.sort();
|
|
281
|
-
if (backups.length === 0)
|
|
286
|
+
if (backups.length === 0) {
|
|
287
|
+
await removeClaudeAttribution(projectPath);
|
|
282
288
|
return null;
|
|
289
|
+
}
|
|
283
290
|
const latest = backups[backups.length - 1];
|
|
284
291
|
const src = path.join(claudeDir, latest);
|
|
285
|
-
await fs.
|
|
292
|
+
const restored = JSON.parse(await fs.readFile(src, 'utf8'));
|
|
293
|
+
const currentRaw = await fs.readFile(settingsPath, 'utf8').catch((err) => {
|
|
294
|
+
if (err.code === 'ENOENT')
|
|
295
|
+
return null;
|
|
296
|
+
throw err;
|
|
297
|
+
});
|
|
298
|
+
// Attribution rollback is ownership-based; keep later operator edits.
|
|
299
|
+
if (currentRaw !== null) {
|
|
300
|
+
let current;
|
|
301
|
+
try {
|
|
302
|
+
current = JSON.parse(currentRaw);
|
|
303
|
+
}
|
|
304
|
+
catch { /* A corrupt current file must still be recoverable from backup. */ }
|
|
305
|
+
if (current && typeof current === 'object' && !Array.isArray(current)) {
|
|
306
|
+
undoClaudeAttribution(current);
|
|
307
|
+
if ('attribution' in current)
|
|
308
|
+
restored.attribution = current.attribution;
|
|
309
|
+
else
|
|
310
|
+
delete restored.attribution;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (restored.aiwg)
|
|
314
|
+
delete restored.aiwg.attributionKeys;
|
|
315
|
+
await atomicWrite(settingsPath, JSON.stringify(restored, null, 2) + '\n');
|
|
286
316
|
return src;
|
|
287
317
|
}
|
|
318
|
+
/** Remove only unchanged attribution defaults owned by AIWG. */
|
|
319
|
+
export async function removeClaudeAttribution(projectPath, dryRun = false) {
|
|
320
|
+
const file = path.join(projectPath, '.claude', 'settings.json');
|
|
321
|
+
let settings;
|
|
322
|
+
try {
|
|
323
|
+
settings = JSON.parse(await fs.readFile(file, 'utf8'));
|
|
324
|
+
}
|
|
325
|
+
catch (err) {
|
|
326
|
+
if (err.code === 'ENOENT')
|
|
327
|
+
return;
|
|
328
|
+
throw err;
|
|
329
|
+
}
|
|
330
|
+
if (undoClaudeAttribution(settings) && !dryRun) {
|
|
331
|
+
await atomicWrite(file, JSON.stringify(settings, null, 2) + '\n');
|
|
332
|
+
}
|
|
333
|
+
}
|
|
288
334
|
//# sourceMappingURL=claude-hooks-installer.js.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export const daemonCommand = {
|
|
2
|
+
id: 'daemon',
|
|
3
|
+
type: 'skill',
|
|
4
|
+
name: 'Daemon',
|
|
5
|
+
description: 'Manage the daemon: start, stop, status, chat, attach and scheduled tasks',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
capabilities: ['cli', 'daemon', 'lifecycle'],
|
|
8
|
+
keywords: ['daemon', 'start', 'stop', 'status', 'chat', 'attach'],
|
|
9
|
+
category: 'daemon',
|
|
10
|
+
platforms: { claude: 'full', generic: 'full' },
|
|
11
|
+
deployment: { pathTemplate: '.{platform}/commands/{id}.md', core: false },
|
|
12
|
+
metadata: {
|
|
13
|
+
type: 'skill',
|
|
14
|
+
triggerPhrases: ['daemon', 'daemon start', 'daemon status'],
|
|
15
|
+
commandHint: {
|
|
16
|
+
template: 'utility',
|
|
17
|
+
argumentHint: '<start|stop|status|restart|logs|chat|attach|task|init|rooms|autonomous|schedule|memory|pty> [options]',
|
|
18
|
+
allowedTools: ['Bash', 'Read', 'Write'],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const behaviorCommand = {
|
|
23
|
+
id: 'behavior',
|
|
24
|
+
type: 'skill',
|
|
25
|
+
name: 'Behavior',
|
|
26
|
+
description: 'Manage behavior YAML bundles that bind directives and toolsets to agent types',
|
|
27
|
+
version: '1.0.0',
|
|
28
|
+
capabilities: ['cli', 'behavior', 'daemon', 'configuration'],
|
|
29
|
+
keywords: ['behavior', 'directive', 'toolset', 'daemon', 'ops', 'agent-type'],
|
|
30
|
+
category: 'daemon',
|
|
31
|
+
platforms: {
|
|
32
|
+
claude: 'full',
|
|
33
|
+
generic: 'full',
|
|
34
|
+
},
|
|
35
|
+
deployment: {
|
|
36
|
+
pathTemplate: '.{platform}/commands/{id}.md',
|
|
37
|
+
core: false,
|
|
38
|
+
},
|
|
39
|
+
metadata: {
|
|
40
|
+
type: 'skill',
|
|
41
|
+
triggerPhrases: ['behavior', 'list behaviors', 'apply behavior', 'manage behaviors'],
|
|
42
|
+
commandHint: {
|
|
43
|
+
template: 'utility',
|
|
44
|
+
argumentHint: '<list|info|apply|remove> [name] [--to <agent>] [--from <agent>]',
|
|
45
|
+
allowedTools: ['Read', 'Bash', 'Write'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
export const daemonInitCommand = {
|
|
50
|
+
id: 'daemon-init',
|
|
51
|
+
type: 'skill',
|
|
52
|
+
name: 'Daemon Init',
|
|
53
|
+
description: 'Initialize daemon config from a profile template (default: manager)',
|
|
54
|
+
version: '1.0.0',
|
|
55
|
+
capabilities: ['cli', 'daemon', 'configuration', 'scaffolding'],
|
|
56
|
+
keywords: ['daemon', 'init', 'profile', 'manager', 'orchestrator', 'config'],
|
|
57
|
+
category: 'daemon',
|
|
58
|
+
platforms: {
|
|
59
|
+
claude: 'full',
|
|
60
|
+
generic: 'full',
|
|
61
|
+
},
|
|
62
|
+
deployment: {
|
|
63
|
+
pathTemplate: '.{platform}/commands/{id}.md',
|
|
64
|
+
core: false,
|
|
65
|
+
},
|
|
66
|
+
metadata: {
|
|
67
|
+
type: 'skill',
|
|
68
|
+
triggerPhrases: ['daemon init', 'init daemon', 'initialize daemon', 'daemon setup'],
|
|
69
|
+
commandHint: {
|
|
70
|
+
template: 'utility',
|
|
71
|
+
argumentHint: '[profile-name] [--force]',
|
|
72
|
+
allowedTools: ['Bash', 'Read', 'Write'],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
export const housekeeperCommand = {
|
|
77
|
+
id: 'housekeeper',
|
|
78
|
+
type: 'skill',
|
|
79
|
+
name: 'Housekeeper',
|
|
80
|
+
description: 'Deterministic maintenance daemon: start/stop/status/run-once, jobs, watch roots, autostart units',
|
|
81
|
+
version: '1.0.0',
|
|
82
|
+
capabilities: ['cli', 'daemon', 'maintenance', 'scheduler'],
|
|
83
|
+
keywords: ['housekeeper', 'daemon', 'maintenance', 'schedule', 'run-once', 'autostart'],
|
|
84
|
+
category: 'daemon',
|
|
85
|
+
platforms: {
|
|
86
|
+
claude: 'full',
|
|
87
|
+
generic: 'full',
|
|
88
|
+
},
|
|
89
|
+
deployment: {
|
|
90
|
+
pathTemplate: '.{platform}/commands/{id}.md',
|
|
91
|
+
core: false,
|
|
92
|
+
},
|
|
93
|
+
metadata: {
|
|
94
|
+
type: 'skill',
|
|
95
|
+
triggerPhrases: ['housekeeper', 'housekeeper status', 'housekeeper start', 'maintenance daemon'],
|
|
96
|
+
commandHint: {
|
|
97
|
+
template: 'utility',
|
|
98
|
+
argumentHint: '<start|stop|status|run-once|job|watch|install|uninstall> [options]',
|
|
99
|
+
allowedTools: ['Bash', 'Read', 'Write'],
|
|
100
|
+
executionSteps: [
|
|
101
|
+
'Parse subcommand and flags',
|
|
102
|
+
'Start/stop/query the housekeeper-profile daemon or edit its config',
|
|
103
|
+
'Run one job without a daemon (run-once) or write autostart units (install)',
|
|
104
|
+
'Display result',
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=daemon.js.map
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* @tests @test/unit/extensions/commands/definitions.test.ts
|
|
11
11
|
* @issue #42
|
|
12
12
|
*/
|
|
13
|
+
import { daemonCommand, behaviorCommand, daemonInitCommand, housekeeperCommand } from './daemon.js';
|
|
14
|
+
export { daemonCommand, behaviorCommand, daemonInitCommand, housekeeperCommand } from './daemon.js';
|
|
13
15
|
// ============================================
|
|
14
16
|
// Individual Command Definitions
|
|
15
17
|
// ============================================
|
|
@@ -3124,93 +3126,6 @@ export const reproducibilityValidateCommand = {
|
|
|
3124
3126
|
},
|
|
3125
3127
|
},
|
|
3126
3128
|
};
|
|
3127
|
-
export const behaviorCommand = {
|
|
3128
|
-
id: 'behavior',
|
|
3129
|
-
type: 'skill',
|
|
3130
|
-
name: 'Behavior',
|
|
3131
|
-
description: 'Manage behavior YAML bundles that bind directives and toolsets to agent types',
|
|
3132
|
-
version: '1.0.0',
|
|
3133
|
-
capabilities: ['cli', 'behavior', 'daemon', 'configuration'],
|
|
3134
|
-
keywords: ['behavior', 'directive', 'toolset', 'daemon', 'ops', 'agent-type'],
|
|
3135
|
-
category: 'daemon',
|
|
3136
|
-
platforms: {
|
|
3137
|
-
claude: 'full',
|
|
3138
|
-
generic: 'full',
|
|
3139
|
-
},
|
|
3140
|
-
deployment: {
|
|
3141
|
-
pathTemplate: '.{platform}/commands/{id}.md',
|
|
3142
|
-
core: false,
|
|
3143
|
-
},
|
|
3144
|
-
metadata: {
|
|
3145
|
-
type: 'skill',
|
|
3146
|
-
triggerPhrases: ['behavior', 'list behaviors', 'apply behavior', 'manage behaviors'],
|
|
3147
|
-
commandHint: {
|
|
3148
|
-
template: 'utility',
|
|
3149
|
-
argumentHint: '<list|info|apply|remove> [name] [--to <agent>] [--from <agent>]',
|
|
3150
|
-
allowedTools: ['Read', 'Bash', 'Write'],
|
|
3151
|
-
},
|
|
3152
|
-
},
|
|
3153
|
-
};
|
|
3154
|
-
export const daemonInitCommand = {
|
|
3155
|
-
id: 'daemon-init',
|
|
3156
|
-
type: 'skill',
|
|
3157
|
-
name: 'Daemon Init',
|
|
3158
|
-
description: 'Initialize daemon config from a profile template (default: manager)',
|
|
3159
|
-
version: '1.0.0',
|
|
3160
|
-
capabilities: ['cli', 'daemon', 'configuration', 'scaffolding'],
|
|
3161
|
-
keywords: ['daemon', 'init', 'profile', 'manager', 'orchestrator', 'config'],
|
|
3162
|
-
category: 'daemon',
|
|
3163
|
-
platforms: {
|
|
3164
|
-
claude: 'full',
|
|
3165
|
-
generic: 'full',
|
|
3166
|
-
},
|
|
3167
|
-
deployment: {
|
|
3168
|
-
pathTemplate: '.{platform}/commands/{id}.md',
|
|
3169
|
-
core: false,
|
|
3170
|
-
},
|
|
3171
|
-
metadata: {
|
|
3172
|
-
type: 'skill',
|
|
3173
|
-
triggerPhrases: ['daemon init', 'init daemon', 'initialize daemon', 'daemon setup'],
|
|
3174
|
-
commandHint: {
|
|
3175
|
-
template: 'utility',
|
|
3176
|
-
argumentHint: '[profile-name] [--force]',
|
|
3177
|
-
allowedTools: ['Bash', 'Read', 'Write'],
|
|
3178
|
-
},
|
|
3179
|
-
},
|
|
3180
|
-
};
|
|
3181
|
-
export const housekeeperCommand = {
|
|
3182
|
-
id: 'housekeeper',
|
|
3183
|
-
type: 'skill',
|
|
3184
|
-
name: 'Housekeeper',
|
|
3185
|
-
description: 'Deterministic maintenance daemon: start/stop/status/run-once, jobs, watch roots, autostart units',
|
|
3186
|
-
version: '1.0.0',
|
|
3187
|
-
capabilities: ['cli', 'daemon', 'maintenance', 'scheduler'],
|
|
3188
|
-
keywords: ['housekeeper', 'daemon', 'maintenance', 'schedule', 'run-once', 'autostart'],
|
|
3189
|
-
category: 'daemon',
|
|
3190
|
-
platforms: {
|
|
3191
|
-
claude: 'full',
|
|
3192
|
-
generic: 'full',
|
|
3193
|
-
},
|
|
3194
|
-
deployment: {
|
|
3195
|
-
pathTemplate: '.{platform}/commands/{id}.md',
|
|
3196
|
-
core: false,
|
|
3197
|
-
},
|
|
3198
|
-
metadata: {
|
|
3199
|
-
type: 'skill',
|
|
3200
|
-
triggerPhrases: ['housekeeper', 'housekeeper status', 'housekeeper start', 'maintenance daemon'],
|
|
3201
|
-
commandHint: {
|
|
3202
|
-
template: 'utility',
|
|
3203
|
-
argumentHint: '<start|stop|status|run-once|job|watch|install|uninstall> [options]',
|
|
3204
|
-
allowedTools: ['Bash', 'Read', 'Write'],
|
|
3205
|
-
executionSteps: [
|
|
3206
|
-
'Parse subcommand and flags',
|
|
3207
|
-
'Start/stop/query the housekeeper-profile daemon or edit its config',
|
|
3208
|
-
'Run one job without a daemon (run-once) or write autostart units (install)',
|
|
3209
|
-
'Display result',
|
|
3210
|
-
],
|
|
3211
|
-
},
|
|
3212
|
-
},
|
|
3213
|
-
};
|
|
3214
3129
|
// Config Commands
|
|
3215
3130
|
export const configCommand = {
|
|
3216
3131
|
id: 'config',
|
|
@@ -3794,7 +3709,7 @@ export const rlmCacheCommand = {
|
|
|
3794
3709
|
* - SDLC Orchestration (1): sdlc-accelerate
|
|
3795
3710
|
* - Index (1): index
|
|
3796
3711
|
* - Reproducibility (4): execution-mode, snapshot, checkpoint, reproducibility-validate
|
|
3797
|
-
* - Daemon (
|
|
3712
|
+
* - Daemon (4): daemon, behavior, daemon-init, housekeeper
|
|
3798
3713
|
* - Config (1): config
|
|
3799
3714
|
* - Ops (1): ops
|
|
3800
3715
|
* - Agentic Tools (5): chunk, fanout, rlm-prep, rlm-search, rlm-status
|
|
@@ -3925,7 +3840,8 @@ export const commandDefinitions = [
|
|
|
3925
3840
|
snapshotCommand,
|
|
3926
3841
|
checkpointCommand,
|
|
3927
3842
|
reproducibilityValidateCommand,
|
|
3928
|
-
// Daemon (
|
|
3843
|
+
// Daemon (4)
|
|
3844
|
+
daemonCommand,
|
|
3929
3845
|
behaviorCommand,
|
|
3930
3846
|
daemonInitCommand,
|
|
3931
3847
|
housekeeperCommand,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// Verify the frozen bundle, its pinned analysis and the independently anchored first-access record.
|
|
2
2
|
import { heldoutDigest } from '../decision/heldout/contract.js';
|
|
3
3
|
import { artifactDigest } from '../decision/validate.js';
|
|
4
|
+
import { verifyHeldoutAccess } from '../decision/heldout/access.js';
|
|
4
5
|
import { evaluateGates, GateEvaluationError, sealGateHoldout } from './evaluate.js';
|
|
5
6
|
/**
|
|
6
7
|
* Derive gate inputs from HeldoutFrozen without altering its historical bytes.
|
|
7
8
|
* The existing bundle contains only corpus, preregistration and approval, so
|
|
8
9
|
* its studyAnalysisDigest must first verify the supplied analysis containing
|
|
9
10
|
* the binding. The access record pins that same analysis (and hence binding).
|
|
10
|
-
* Its
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* the access anchor independently, just as for the existing D29 scorer.
|
|
11
|
+
* Its signed body covers both digests, run ID and first-access time. The host
|
|
12
|
+
* selects the keyring independently; the retained access digest is an extra
|
|
13
|
+
* integrity check, never a substitute for signature verification.
|
|
14
14
|
*/
|
|
15
15
|
export function sealGateHoldoutFromFrozen(input) {
|
|
16
|
-
const { frozen, analysis, access, trustedAccessDigest } = input;
|
|
16
|
+
const { frozen, analysis, access, trustedAccessDigest, keyring } = input;
|
|
17
17
|
if (!frozen?.bundle || frozen.digest !== heldoutDigest(frozen.bundle)) {
|
|
18
18
|
throw new GateEvaluationError('frozen bundle digest does not match its content');
|
|
19
19
|
}
|
|
@@ -25,11 +25,21 @@ export function sealGateHoldoutFromFrozen(input) {
|
|
|
25
25
|
|| heldoutDigest(access) !== trustedAccessDigest) {
|
|
26
26
|
throw new GateEvaluationError('first-access digest does not match its trusted pin');
|
|
27
27
|
}
|
|
28
|
+
if (!access.signature)
|
|
29
|
+
throw new GateEvaluationError('first-access signature missing');
|
|
28
30
|
if (access.analysisDigest !== analysisDigest) {
|
|
29
31
|
throw new GateEvaluationError('first-access record does not belong to the frozen analysis and binding');
|
|
30
32
|
}
|
|
31
|
-
if (
|
|
32
|
-
throw new GateEvaluationError('first-access
|
|
33
|
+
if (access.frozenBundleDigest !== frozen.digest) {
|
|
34
|
+
throw new GateEvaluationError('first-access frozen-bundle digest does not match the frozen record');
|
|
35
|
+
}
|
|
36
|
+
if (access.runId !== frozen.bundle.approval.runId)
|
|
37
|
+
throw new GateEvaluationError('first-access run ID does not match the frozen approval');
|
|
38
|
+
try {
|
|
39
|
+
verifyHeldoutAccess(access, keyring);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
throw new GateEvaluationError(error.message);
|
|
33
43
|
}
|
|
34
44
|
const trustedBindingDigest = artifactDigest(analysis.gateBinding);
|
|
35
45
|
return { trustedBindingDigest,
|