@aiwg/cli 2026.11.2 → 2026.11.4
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/addons/aiwg-hooks/canonical/aiwg-prompt-discovery.yaml +3 -2
- package/agentic/code/addons/aiwg-hooks/hooks/aiwg-prompt-discovery.cjs +12 -9
- package/agentic/code/addons/aiwg-utils/rules/anti-laziness.md +2 -0
- package/agentic/code/addons/composition-engine/lib/runtime.mjs +5 -26
- package/agentic/code/addons/composition-engine/schemas/flow-graph.schema.json +22 -0
- package/agentic/code/providers/capability-matrix.yaml +17 -20
- package/agentic/code/providers/model-capabilities.v1.json +17 -16
- package/dist/src/a2a/hitl-authorization.js +46 -0
- package/dist/src/a2a/hitl-driver.js +5 -5
- package/dist/src/artifacts/browser-export.js +2 -0
- package/dist/src/artifacts/framework-source-digest.js +1 -1
- package/dist/src/artifacts/index-builder.js +5 -25
- package/dist/src/artifacts/index-capability.js +24 -0
- package/dist/src/artifacts/query-engine-discover-output.js +8 -3
- package/dist/src/artifacts/query-engine-rules.js +27 -9
- package/dist/src/artifacts/query-engine-scoring.js +5 -5
- package/dist/src/artifacts/query-engine-show-card.js +5 -1
- package/dist/src/artifacts/query-engine-show-load.js +1 -1
- package/dist/src/artifacts/query-engine-show.js +3 -3
- package/dist/src/artifacts/query-engine-templates.js +10 -4
- package/dist/src/artifacts/query-engine-verbose.js +18 -4
- package/dist/src/artifacts/relations-builder.js +1 -0
- package/dist/src/artifacts/types.js +1 -1
- package/dist/src/cli/handlers/checkpoint-handoff.js +2 -1
- package/dist/src/cli/handlers/dataset.js +17 -0
- package/dist/src/cli/handlers/guided-setup.js +3 -1
- package/dist/src/cli/handlers/refresh-managed-deployment.js +17 -5
- package/dist/src/cli/handlers/rules.js +1 -1
- package/dist/src/cli/handlers/sessions.js +1 -1
- package/dist/src/cli/handlers/steward.js +1 -1
- package/dist/src/cli/handlers/use.js +18 -5
- package/dist/src/cli/handlers/utility-doctor.js +5 -2
- package/dist/src/cli/handlers/workspace.js +1 -1
- package/dist/src/cli/services/deployment-probe-scope.js +40 -0
- package/dist/src/cli/services/deployment-verification.js +5 -6
- package/dist/src/config/aiwg-config.js +6 -0
- package/dist/src/config/authorization-cli.js +61 -3
- package/dist/src/config/cli-help.js +1 -1
- package/dist/src/config/cli.js +4 -2
- package/dist/src/config/decision-config.js +2 -1
- package/dist/src/config/host-resource-runtime.mjs +1 -1
- package/dist/src/config/jev-credential-reference.js +56 -0
- package/dist/src/config/user-config.js +13 -19
- package/dist/src/config/user-registry.js +9 -1
- package/dist/src/config/worker-owner-lock.js +90 -10
- package/dist/src/decision/ask.js +3 -2
- package/dist/src/decision/graph-flow-adapter.js +1 -1
- package/dist/src/decision/jev-credentials.js +22 -0
- package/dist/src/decision/offload.js +1 -1
- package/dist/src/decision/openbao-kv-resolver.mjs +96 -0
- package/dist/src/decision/openbao-runtime.js +101 -0
- package/dist/src/effects/authorization-grant.js +50 -0
- package/dist/src/effects/authorization-store.js +130 -0
- package/dist/src/effects/index.js +2 -0
- package/dist/src/effects/ledger.js +1 -0
- package/dist/src/effects/lifecycle.js +1 -1
- package/dist/src/effects/reader.js +4 -0
- package/dist/src/effects/records.js +4 -0
- package/dist/src/effects/schema.js +2 -0
- package/dist/src/extensions/claude-hooks-installer.js +7 -7
- package/dist/src/extensions/muse-managed-hooks.js +11 -0
- package/dist/src/extensions/user-hook-diagnostics.js +32 -0
- package/dist/src/extensions/verified-hook-command.js +32 -0
- package/dist/src/lint/rule-conflicts.js +52 -0
- package/dist/src/lint/runner.js +3 -0
- package/dist/src/mcp/cli.mjs +3 -1
- package/dist/src/mcp/elicitation.mjs +30 -0
- package/dist/src/mcp/grok-build-config.mjs +1 -1
- package/dist/src/mcp/muse-native-config.mjs +1 -0
- package/dist/src/mcp/server.mjs +2 -0
- package/dist/src/mcp/tools/authorization.mjs +78 -0
- package/dist/src/models/model-capabilities.v1.json +17 -16
- package/dist/src/policy/authorization-capture.js +64 -0
- package/dist/src/policy/authorization-operations.js +108 -0
- package/dist/src/policy/hitl-check.js +3 -2
- package/dist/src/policy/hitl-consume.js +14 -0
- package/dist/src/policy/hitl-durable-store.js +60 -0
- package/dist/src/policy/hitl-durable.js +60 -0
- package/dist/src/policy/hitl-receipt.js +5 -0
- package/dist/src/policy/hitl.js +44 -6
- package/dist/src/process/bounded-child-process.mjs +49 -39
- package/dist/src/providers/capability-matrix.yaml +17 -20
- package/dist/src/providers/deployment-ownership.d.mts +1 -0
- package/dist/src/providers/deployment-ownership.mjs +21 -2
- package/dist/src/providers/grok-build-headless.js +170 -77
- package/dist/src/providers/grok-build-inspect.js +1 -0
- package/dist/src/providers/grok-build-paths.js +2 -0
- package/dist/src/providers/muse-paths.js +4 -2
- package/dist/src/providers/provider-context-contracts.js +12 -4
- package/dist/src/providers/provider-definition-schema.js +6 -0
- package/dist/src/providers/provider-seeds-1.js +3 -3
- package/dist/src/providers/provider-seeds-2.js +6 -4
- package/dist/src/providers/provider-seeds-3.js +6 -6
- package/dist/src/rules/activation.d.mts +2 -0
- package/dist/src/rules/activation.mjs +16 -7
- package/dist/src/rules/inline-budget.d.mts +2 -1
- package/dist/src/rules/inline-budget.mjs +4 -2
- package/dist/src/rules/inventory.js +3 -0
- package/dist/src/rules/precedence.d.mts +6 -0
- package/dist/src/rules/precedence.mjs +49 -0
- package/dist/src/rules/project-precedence.js +73 -0
- package/dist/src/rules/rule-frontmatter.schema.json +15 -0
- package/dist/src/serve/a2a-terminal-observer.js +12 -3
- package/dist/src/serve/mission-hitl.js +20 -1
- package/dist/src/sessions/adapters/grok-build-fallback.js +33 -0
- package/dist/src/sessions/adapters/grok-build-native-records.js +64 -0
- package/dist/src/sessions/adapters/grok-build-native.js +92 -100
- package/dist/src/sessions/adapters/grok-build.js +65 -24
- package/dist/src/sessions/grok-build-cli-output.js +113 -0
- package/dist/src/sessions/grok-build-cli.js +4 -28
- package/dist/src/smiths/context-pipeline/bridge-ownership.js +4 -3
- package/dist/src/smiths/context-pipeline/finalization.js +5 -0
- package/dist/src/smiths/context-pipeline/generator.js +1 -1
- package/dist/src/smiths/context-pipeline/workspace-bootstrap.js +20 -17
- package/dist/src/smiths/context-pipeline/workspace-doctor.js +6 -1
- package/dist/src/smiths/context-pipeline/workspace-document.js +6 -0
- package/dist/src/smiths/context-pipeline/workspace-migration.js +2 -12
- package/dist/src/smiths/hook-bridge/codex-translator.js +11 -14
- package/dist/src/smiths/hook-bridge/codex-trust.js +7 -2
- package/dist/src/smiths/hook-bridge/copilot-translator.js +2 -1
- package/dist/src/smiths/hook-bridge/factory-trust.js +56 -0
- package/dist/src/smiths/hook-bridge/grok-build-translator.js +3 -1
- package/dist/src/smiths/hook-bridge/hermes-prompt-discovery.js +78 -0
- package/dist/src/smiths/hook-bridge/hermes-translator.js +5 -3
- package/dist/src/smiths/hook-bridge/index.js +3 -1
- package/dist/src/smiths/hook-bridge/prompt-discovery-gaps.js +3 -2
- package/package.json +7 -1
- package/tools/agents/deploy-agents.mjs +5 -6
- package/tools/agents/deploy-options.mjs +1 -0
- package/tools/agents/providers/base-frontmatter.mjs +3 -2
- package/tools/agents/providers/claude-post-deploy.mjs +1 -1
- package/tools/agents/providers/codex-post-deploy.mjs +1 -1
- package/tools/agents/providers/generic.mjs +66 -0
- package/tools/agents/providers/grok-build.mjs +3 -1
- package/tools/agents/providers/muse-hooks.mjs +13 -11
- package/tools/agents/providers/muse-prompt-discovery.mjs +5 -1
- package/tools/agents/providers/muse.mjs +2 -1
- package/tools/agents/providers/openclaw.mjs +2 -1
- package/tools/agents/providers/rule-deployment-prepare.mjs +5 -3
- package/tools/agents/providers/rule-deployment-state.mjs +14 -6
- package/tools/agents/providers/rule-startup.mjs +11 -10
- package/tools/agents/providers/staged-directory-reference.mjs +14 -0
- package/tools/agents/providers/user-hooks.mjs +26 -0
- package/tools/cli/authorization-health.mjs +20 -0
- package/tools/cli/decision-offload-report.mjs +2 -0
- package/tools/cli/workspace-status.mjs +7 -0
- package/tools/commands/deploy-prompts-codex.mjs +15 -1
- package/tools/plugin/package-plugins.mjs +6 -1
- package/tools/ralph-external/lib/claude-adapter.mjs +2 -2
- package/vscode-extension/schemas/aiwg.config.v1.json +20 -0
|
@@ -1,75 +1,105 @@
|
|
|
1
1
|
/** Bounded Grok Build headless transport. The caller owns task authorization. */
|
|
2
2
|
import { signalChild } from '../process/signal-child.mjs';
|
|
3
3
|
import { spawn } from 'node:child_process';
|
|
4
|
+
/** Failed runs retain redacted partial output and observed accounting. */
|
|
5
|
+
export class GrokHeadlessError extends Error {
|
|
6
|
+
result;
|
|
7
|
+
constructor(message, result) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.result = result;
|
|
10
|
+
this.name = 'GrokHeadlessError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
4
13
|
const MAX_TIMEOUT_MS = 10 * 60_000;
|
|
5
14
|
const DEFAULT_TIMEOUT_MS = 2 * 60_000;
|
|
6
15
|
const DEFAULT_MAX_OUTPUT = 8 * 1024 * 1024;
|
|
7
|
-
//
|
|
8
|
-
// See docs/providers/grok-build-cli-evidence.md; json is a separate result object.
|
|
16
|
+
// Captured 1.0.77 headless events; this is not the agent-stdio ACP contract.
|
|
9
17
|
const STREAM_EVENT_TYPES = new Set(['text', 'thought', 'tool_call', 'tool_call_update',
|
|
10
18
|
'usage', 'plan', 'available_commands', 'end', 'error']);
|
|
19
|
+
const MESSAGE_EVENT_TYPES = new Set(['system', 'assistant', 'user', 'result', 'error']);
|
|
11
20
|
export function redactGrokOutput(value, env = process.env) {
|
|
12
21
|
let redacted = value
|
|
22
|
+
.replace(/("(?:api[_-]?key|access[_-]?token|authorization)"\s*:\s*)"(?:\\.|[^"\\])*"/gi, '$1"[REDACTED]"')
|
|
13
23
|
.replace(/\b(Bearer\s+)[A-Za-z0-9._~+/-]+/gi, '$1[REDACTED]')
|
|
14
24
|
.replace(/\b(xai-[A-Za-z0-9_-]{8,})\b/g, '[REDACTED]')
|
|
15
25
|
.replace(/\b((?:api[_-]?key|access[_-]?token|authorization)\s*[:=]\s*)[^\s,}"']+/gi, '$1[REDACTED]');
|
|
16
26
|
for (const key of ['XAI_API_KEY', 'GROK_CODE_XAI_API_KEY']) {
|
|
17
27
|
const secret = env[key];
|
|
18
|
-
if (secret && secret.length >= 4)
|
|
28
|
+
if (secret && secret.length >= 4) {
|
|
19
29
|
redacted = redacted.split(secret).join('[REDACTED]');
|
|
30
|
+
redacted = redacted.split(JSON.stringify(secret).slice(1, -1)).join('[REDACTED]');
|
|
31
|
+
}
|
|
20
32
|
}
|
|
21
33
|
return redacted;
|
|
22
34
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
function scrub(value, env) {
|
|
36
|
+
if (typeof value === 'string')
|
|
37
|
+
return redactGrokOutput(value, env);
|
|
38
|
+
if (Array.isArray(value))
|
|
39
|
+
return value.map(item => scrub(item, env));
|
|
40
|
+
if (value && typeof value === 'object') {
|
|
41
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [redactGrokOutput(key, env),
|
|
42
|
+
/^(?:api[_-]?key|access[_-]?token|authorization)$/i.test(key) ? '[REDACTED]' : scrub(item, env)]));
|
|
43
|
+
}
|
|
44
|
+
return value;
|
|
26
45
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
46
|
+
function record(value) {
|
|
47
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
29
48
|
}
|
|
30
49
|
function isError(event) {
|
|
31
50
|
return event.type === 'error' || event.is_error === true || event.error != null
|
|
32
|
-
|| (event.
|
|
51
|
+
|| (Array.isArray(event.errors) && event.errors.length > 0)
|
|
52
|
+
|| (event.type === 'result' && event.subtype !== 'success')
|
|
33
53
|
|| (['tool_call', 'tool_call_update'].includes(String(event.type)) && event.status === 'failed');
|
|
34
54
|
}
|
|
35
|
-
function
|
|
55
|
+
function signalProcess(child, signal) {
|
|
36
56
|
if (Number.isSafeInteger(child.pid) && child.pid > 0 && process.platform !== 'win32') {
|
|
37
57
|
try {
|
|
38
|
-
process.kill(-child.pid,
|
|
58
|
+
process.kill(-child.pid, signal);
|
|
39
59
|
return;
|
|
40
60
|
}
|
|
41
61
|
catch { /* process already exited */ }
|
|
42
62
|
}
|
|
43
|
-
signalChild(child,
|
|
63
|
+
signalChild(child, signal);
|
|
44
64
|
}
|
|
45
65
|
export async function runGrokHeadless(options) {
|
|
46
66
|
if (!options.prompt.trim())
|
|
47
67
|
throw new Error('Grok Build prompt is required');
|
|
48
68
|
const format = options.format ?? 'streaming-json';
|
|
49
|
-
if (!['plain', 'json', 'streaming-json'].includes(format))
|
|
69
|
+
if (!['plain', 'json', 'streaming-json', 'streaming-messages-json'].includes(format))
|
|
50
70
|
throw new Error(`Unsupported Grok output format: ${format}`);
|
|
51
|
-
const
|
|
71
|
+
for (const key of ['timeoutMs', 'maxOutputBytes']) {
|
|
72
|
+
if (options[key] !== undefined && (!Number.isFinite(options[key]) || options[key] <= 0)) {
|
|
73
|
+
throw new Error(`Grok Build ${key} must be a positive finite number`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const timeoutMs = Math.min(options.timeoutMs ?? DEFAULT_TIMEOUT_MS, MAX_TIMEOUT_MS);
|
|
52
77
|
const maxBytes = Math.min(Math.max(options.maxOutputBytes ?? DEFAULT_MAX_OUTPUT, 1024), DEFAULT_MAX_OUTPUT);
|
|
53
78
|
const env = options.env ?? process.env;
|
|
54
|
-
const args = [...(options.prefixArgs ?? []), ...(options.disableSubagents ? ['--no-subagents'] : []), '-p', options.prompt, '--output-format', format];
|
|
79
|
+
const args = [...(options.prefixArgs ?? []), '--no-auto-update', ...(options.disableSubagents ? ['--no-subagents'] : []), '-p', options.prompt, '--output-format', format];
|
|
80
|
+
const streaming = format === 'streaming-json' || format === 'streaming-messages-json';
|
|
55
81
|
return new Promise((resolve, reject) => {
|
|
56
82
|
const child = spawn(options.command ?? 'grok', args, {
|
|
57
|
-
cwd: options.cwd,
|
|
58
|
-
|
|
59
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
60
|
-
detached: process.platform !== 'win32',
|
|
61
|
-
shell: false,
|
|
83
|
+
cwd: options.cwd, env, stdio: ['ignore', 'pipe', 'pipe'],
|
|
84
|
+
detached: process.platform !== 'win32', shell: false,
|
|
62
85
|
});
|
|
86
|
+
// Stateful decoders preserve code points split across pipe reads.
|
|
87
|
+
child.stdout.setEncoding('utf8');
|
|
88
|
+
child.stderr.setEncoding('utf8');
|
|
63
89
|
let stdout = '';
|
|
64
90
|
let stderr = '';
|
|
65
91
|
let pending = '';
|
|
66
92
|
let bytes = 0;
|
|
93
|
+
let stderrBytes = 0;
|
|
67
94
|
let settled = false;
|
|
95
|
+
let closed = false;
|
|
96
|
+
let exitCode;
|
|
97
|
+
let exitSignal = null;
|
|
68
98
|
let terminalSeen = false;
|
|
69
99
|
let terminalError = false;
|
|
70
100
|
const events = [];
|
|
71
101
|
let drainTimer;
|
|
72
|
-
const finish = (error, code = 0) => {
|
|
102
|
+
const finish = (error, code = exitCode ?? 0) => {
|
|
73
103
|
if (settled)
|
|
74
104
|
return;
|
|
75
105
|
settled = true;
|
|
@@ -77,86 +107,126 @@ export async function runGrokHeadless(options) {
|
|
|
77
107
|
if (drainTimer)
|
|
78
108
|
clearTimeout(drainTimer);
|
|
79
109
|
options.signal?.removeEventListener('abort', abort);
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
110
|
+
if (format === 'json') {
|
|
111
|
+
try {
|
|
112
|
+
const parsed = JSON.parse(stdout);
|
|
113
|
+
if (!record(parsed) || typeof parsed.text !== 'string')
|
|
114
|
+
throw new Error('Invalid result');
|
|
115
|
+
const safe = scrub(parsed, env);
|
|
116
|
+
events.push(safe);
|
|
117
|
+
if (isError(safe) || safe.stopReason !== 'end_turn')
|
|
118
|
+
error ??= new Error('Grok Build returned a JSON error result');
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
error ??= new Error('Invalid Grok Build JSON error result');
|
|
122
|
+
}
|
|
84
123
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
124
|
+
if (code !== 0 || exitSignal || terminalError) {
|
|
125
|
+
error ??= new Error(`Grok Build headless failed (exit ${code}${exitSignal ? `, signal ${exitSignal}` : ''}): ${stderr || 'provider error event'}`);
|
|
126
|
+
}
|
|
127
|
+
if (streaming && !terminalSeen)
|
|
128
|
+
error ??= new Error(`Grok Build ${format} ended without a terminal event`);
|
|
129
|
+
const result = { format, text: redactGrokOutput(stdout, env), events,
|
|
130
|
+
exitCode: code, stderr: redactGrokOutput(stderr, env) };
|
|
131
|
+
// Terminal totals supersede per-turn usage; never sum cumulative frames.
|
|
132
|
+
for (const event of events) {
|
|
133
|
+
const reason = event.stopReason ?? event.stop_reason;
|
|
134
|
+
if (typeof reason === 'string')
|
|
135
|
+
result.stopReason = reason;
|
|
136
|
+
for (const key of ['usage', 'modelUsage']) {
|
|
137
|
+
const value = event[key] ?? (key === 'usage' && record(event.message) ? event.message.usage : undefined);
|
|
138
|
+
if (record(value))
|
|
139
|
+
result[key] = value;
|
|
140
|
+
}
|
|
141
|
+
for (const key of ['num_turns', 'total_cost_usd', 'total_cost_usd_ticks']) {
|
|
142
|
+
if (typeof event[key] === 'number' && Number.isFinite(event[key]))
|
|
143
|
+
result[key] = event[key];
|
|
144
|
+
}
|
|
90
145
|
}
|
|
91
|
-
|
|
92
|
-
|
|
146
|
+
const complete = () => {
|
|
147
|
+
if (error)
|
|
148
|
+
reject(new GrokHeadlessError(redactGrokOutput(error.message, env), result));
|
|
149
|
+
else
|
|
150
|
+
resolve(result);
|
|
151
|
+
};
|
|
152
|
+
if (closed) {
|
|
153
|
+
complete();
|
|
93
154
|
return;
|
|
94
155
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
156
|
+
// Bound cleanup even for a child ignoring TERM or descendants holding pipes.
|
|
157
|
+
signalProcess(child, 'SIGTERM');
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
signalProcess(child, 'SIGKILL');
|
|
160
|
+
child.stdout.destroy();
|
|
161
|
+
child.stderr.destroy();
|
|
162
|
+
complete();
|
|
163
|
+
}, 150);
|
|
164
|
+
};
|
|
165
|
+
const abort = () => finish(new Error('Grok Build headless aborted'), 1);
|
|
166
|
+
const timer = setTimeout(() => finish(new Error(`Grok Build headless timed out after ${timeoutMs}ms`), 1), timeoutMs);
|
|
167
|
+
const drain = () => {
|
|
168
|
+
drainTimer ??= setTimeout(() => {
|
|
169
|
+
if (streaming && pending.trim()) {
|
|
170
|
+
finish(new Error(`Invalid trailing Grok Build ${format} event`));
|
|
106
171
|
return;
|
|
107
172
|
}
|
|
108
|
-
|
|
109
|
-
|
|
173
|
+
finish();
|
|
174
|
+
}, 300);
|
|
110
175
|
};
|
|
111
|
-
const abort = () => finish(new Error('Grok Build headless aborted'));
|
|
112
|
-
const timer = setTimeout(() => finish(new Error(`Grok Build headless timed out after ${timeoutMs}ms`)), timeoutMs);
|
|
113
176
|
options.signal?.addEventListener('abort', abort, { once: true });
|
|
114
177
|
if (options.signal?.aborted)
|
|
115
178
|
abort();
|
|
116
|
-
child.on('error', error => finish(new Error(`Grok Build headless launch failed: ${error.message}`)));
|
|
179
|
+
child.on('error', error => finish(new Error(`Grok Build headless launch failed: ${error.message}`), 1));
|
|
117
180
|
const acceptEvent = (event) => {
|
|
118
181
|
if (settled)
|
|
119
182
|
return;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
finish(new Error(
|
|
183
|
+
const types = format === 'streaming-messages-json' ? MESSAGE_EVENT_TYPES : STREAM_EVENT_TYPES;
|
|
184
|
+
if (!record(event) || typeof event.type !== 'string' || !types.has(event.type)) {
|
|
185
|
+
finish(new Error(`Invalid Grok Build ${format} event`));
|
|
123
186
|
return;
|
|
124
187
|
}
|
|
125
|
-
// ACP end is always last. Failure is latched across the whole stream.
|
|
126
188
|
if (terminalSeen) {
|
|
127
189
|
finish(new Error('Grok Build event after terminal event'));
|
|
128
190
|
return;
|
|
129
191
|
}
|
|
130
|
-
|
|
192
|
+
if (['assistant', 'user'].includes(event.type) && (!record(event.message) || !Array.isArray(event.message.content))) {
|
|
193
|
+
finish(new Error('Invalid Grok Build message envelope'));
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const safe = scrub(event, env);
|
|
131
197
|
events.push(safe);
|
|
132
|
-
|
|
133
|
-
if (isError(safe))
|
|
198
|
+
const terminal = event.type === 'error' || event.type === (format === 'streaming-messages-json' ? 'result' : 'end');
|
|
199
|
+
if (isError(safe) || (terminal && (safe.stopReason ?? safe.stop_reason) !== 'end_turn'))
|
|
134
200
|
terminalError = true;
|
|
135
|
-
if (
|
|
201
|
+
if (terminal) {
|
|
136
202
|
terminalSeen = true;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
stopProcess(child);
|
|
145
|
-
finish(undefined, terminalError ? 1 : 0);
|
|
146
|
-
}, 300);
|
|
203
|
+
drain();
|
|
204
|
+
}
|
|
205
|
+
try {
|
|
206
|
+
options.onEvent?.(safe);
|
|
207
|
+
}
|
|
208
|
+
catch (cause) {
|
|
209
|
+
finish(new Error(`Grok Build event callback failed: ${cause instanceof Error ? cause.message : String(cause)}`));
|
|
147
210
|
}
|
|
148
211
|
};
|
|
149
|
-
child.stdout.on('data', (
|
|
212
|
+
child.stdout.on('data', (part) => {
|
|
150
213
|
if (settled)
|
|
151
214
|
return;
|
|
152
|
-
bytes +=
|
|
215
|
+
bytes += Buffer.byteLength(part);
|
|
153
216
|
if (bytes > maxBytes) {
|
|
154
217
|
finish(new Error(`Grok Build headless output exceeded ${maxBytes} bytes`));
|
|
155
218
|
return;
|
|
156
219
|
}
|
|
157
|
-
const part = chunk.toString('utf8');
|
|
158
220
|
stdout += part;
|
|
159
|
-
if (format
|
|
221
|
+
if (format === 'json') {
|
|
222
|
+
// A complete result can arrive without a newline or process exit.
|
|
223
|
+
try {
|
|
224
|
+
if (record(JSON.parse(stdout)))
|
|
225
|
+
drain();
|
|
226
|
+
}
|
|
227
|
+
catch { /* wait for the remainder */ }
|
|
228
|
+
}
|
|
229
|
+
if (!streaming)
|
|
160
230
|
return;
|
|
161
231
|
pending += part;
|
|
162
232
|
let end;
|
|
@@ -170,26 +240,49 @@ export async function runGrokHeadless(options) {
|
|
|
170
240
|
event = JSON.parse(line);
|
|
171
241
|
}
|
|
172
242
|
catch {
|
|
173
|
-
finish(new Error(
|
|
243
|
+
finish(new Error(`Invalid Grok Build ${format} event`));
|
|
174
244
|
return;
|
|
175
245
|
}
|
|
176
246
|
acceptEvent(event);
|
|
177
247
|
if (settled)
|
|
178
248
|
return;
|
|
179
249
|
}
|
|
250
|
+
// Parse complete newline-free frames now so background work cannot hold us.
|
|
251
|
+
if (pending.trim()) {
|
|
252
|
+
let event;
|
|
253
|
+
try {
|
|
254
|
+
event = JSON.parse(pending);
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
pending = '';
|
|
260
|
+
acceptEvent(event);
|
|
261
|
+
}
|
|
180
262
|
});
|
|
181
|
-
child.stderr.on('data', (
|
|
182
|
-
|
|
183
|
-
|
|
263
|
+
child.stderr.on('data', (part) => {
|
|
264
|
+
if (settled)
|
|
265
|
+
return;
|
|
266
|
+
stderrBytes += Buffer.byteLength(part);
|
|
267
|
+
if (stderrBytes > maxBytes) {
|
|
184
268
|
finish(new Error(`Grok Build stderr exceeded ${maxBytes} bytes`));
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
stderr += part;
|
|
185
272
|
});
|
|
273
|
+
child.on('exit', (code, signal) => { exitCode = code ?? 1; exitSignal = signal; });
|
|
186
274
|
child.on('close', code => {
|
|
187
|
-
|
|
275
|
+
closed = true;
|
|
276
|
+
if (settled)
|
|
277
|
+
return;
|
|
278
|
+
if (streaming && pending.trim()) {
|
|
279
|
+
const line = pending;
|
|
280
|
+
pending = '';
|
|
188
281
|
try {
|
|
189
|
-
acceptEvent(JSON.parse(
|
|
282
|
+
acceptEvent(JSON.parse(line));
|
|
190
283
|
}
|
|
191
284
|
catch {
|
|
192
|
-
finish(new Error(
|
|
285
|
+
finish(new Error(`Invalid trailing Grok Build ${format} event`));
|
|
193
286
|
return;
|
|
194
287
|
}
|
|
195
288
|
}
|
|
@@ -169,6 +169,7 @@ export function runGrokInspect(envOrOptions = process.env) {
|
|
|
169
169
|
const args = argSets[i];
|
|
170
170
|
const wantsJson = args.length > 1 && args[1] === '--json';
|
|
171
171
|
const result = spawnSync(binary, [...args], {
|
|
172
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
172
173
|
encoding: 'utf8',
|
|
173
174
|
env,
|
|
174
175
|
cwd,
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { homedir } from 'node:os';
|
|
14
14
|
import * as path from 'node:path';
|
|
15
|
+
/** Project-only opt-in bulk mirror, shared by the registry and deployment adapter. */
|
|
16
|
+
export const GROK_BUILD_STANDARD_SKILLS_PATH = '.grok/.aiwg/skills';
|
|
15
17
|
export const GROK_HOME_ENV = 'GROK_HOME';
|
|
16
18
|
export function isGrokFilesystemRoot(resolved, pathFlavor = path) {
|
|
17
19
|
return pathFlavor.parse(resolved).root === resolved;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Muse Code's documented user skill root is `$XDG_CONFIG_HOME/muse/skills`
|
|
5
5
|
* (default `~/.config/muse/skills` when XDG_CONFIG_HOME is unset). The
|
|
6
6
|
* project skill root (`<repo>/.agents/skills`) is static provider metadata
|
|
7
|
-
* on the `muse` skillNamespace; this module
|
|
8
|
-
* at deploy time.
|
|
7
|
+
* on the `muse` skillNamespace; this module shares the project bulk mirror
|
|
8
|
+
* path and resolves the XDG user root at deploy time.
|
|
9
9
|
*
|
|
10
10
|
* Unlike Grok Bot (AIWG_GROKBOT_SKILLS_DIR, fail-closed until configured),
|
|
11
11
|
* the Muse user root is documented, so an unset XDG_CONFIG_HOME falls back
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { homedir } from 'node:os';
|
|
23
23
|
import * as path from 'node:path';
|
|
24
|
+
/** Project-only opt-in bulk mirror, shared by the registry and deployment adapter. */
|
|
25
|
+
export const MUSE_STANDARD_SKILLS_PATH = '.agents/.aiwg/skills';
|
|
24
26
|
/** Muse's documented user skills subtree below the XDG config root. */
|
|
25
27
|
export const MUSE_XDG_SKILLS_SUBDIR = path.join('muse', 'skills');
|
|
26
28
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveHermesHomePath } from './hermes-home.js';
|
|
1
2
|
const VERIFIED_ON = '2026-07-21';
|
|
2
3
|
export const CONTEXT_CONTRACTS = {
|
|
3
4
|
flue: {
|
|
@@ -32,6 +33,7 @@ export const CONTEXT_CONTRACTS = {
|
|
|
32
33
|
verification: { method: 'official AGENTS.md discovery chain; no Markdown include claimed', source: 'https://developers.openai.com/codex/guides/agents-md', lastVerified: VERIFIED_ON },
|
|
33
34
|
},
|
|
34
35
|
copilot: {
|
|
36
|
+
promptDiscovery: { delivery: 'bootstrap-rule', files: ['.github/copilot-instructions.md'] },
|
|
35
37
|
startupFiles: ['.github/copilot-instructions.md', 'AGENTS.md', 'CLAUDE.md'], precedence: ['personal', 'repository', 'organization; CLI combines applicable files'],
|
|
36
38
|
loadMode: 'native-include', includeSyntax: '@WORKSPACE.md\n@AIWG.md', configRegistration: null,
|
|
37
39
|
bootstrapTargets: ['.github/copilot-instructions.md', 'AGENTS.md'], maxContextBytes: null, recommendedMaxLines: null, nestedContext: true, support: 'supported',
|
|
@@ -72,6 +74,7 @@ export const CONTEXT_CONTRACTS = {
|
|
|
72
74
|
},
|
|
73
75
|
},
|
|
74
76
|
'grok-build': {
|
|
77
|
+
promptDiscovery: { delivery: 'bootstrap-rule', files: ['AGENTS.md'] },
|
|
75
78
|
// config.toml is configuration (MCP/plugins/permissions), not a startup/context file.
|
|
76
79
|
// Hierarchical instructions: AGENTS.md + .grok/rules/*.md, root-to-cwd, deeper wins.
|
|
77
80
|
startupFiles: ['AGENTS.md', '.grok/rules/*.md'],
|
|
@@ -90,6 +93,9 @@ export const CONTEXT_CONTRACTS = {
|
|
|
90
93
|
},
|
|
91
94
|
},
|
|
92
95
|
hermes: {
|
|
96
|
+
promptDiscovery: { delivery: 'hook-bridge', event: 'pre_llm_call', optIn: true, files: [
|
|
97
|
+
resolveHermesHomePath('config.yaml'), resolveHermesHomePath('agent-hooks', 'aiwg-prompt-discovery.cjs'),
|
|
98
|
+
] },
|
|
93
99
|
startupFiles: ['.hermes.md', 'AGENTS.md'], precedence: ['provider/system', '.hermes.md', 'AGENTS.md'],
|
|
94
100
|
loadMode: 'prose-directive', includeSyntax: null, configRegistration: null,
|
|
95
101
|
bootstrapTargets: ['.hermes.md', 'AGENTS.md'], maxContextBytes: null, recommendedMaxLines: 30, nestedContext: false, support: 'degraded',
|
|
@@ -118,7 +124,9 @@ export const CONTEXT_CONTRACTS = {
|
|
|
118
124
|
openclaw: {
|
|
119
125
|
startupFiles: ['~/.openclaw/config.yaml'], precedence: ['provider/system', 'home configuration'],
|
|
120
126
|
loadMode: 'unsupported', includeSyntax: null, configRegistration: null,
|
|
121
|
-
|
|
127
|
+
// Default active workspace; the deployment adapter resolves profile/config overrides.
|
|
128
|
+
bootstrapTargets: ['~/.openclaw/workspace/AGENTS.md', '~/.openclaw/workspace/SOUL.md'],
|
|
129
|
+
maxContextBytes: null, recommendedMaxLines: null, nestedContext: false, support: 'degraded',
|
|
122
130
|
verification: { method: 'AIWG home-scope adapter contract; no verified project startup file', source: 'agentic/code/providers/capability-matrix.yaml', lastVerified: VERIFIED_ON },
|
|
123
131
|
},
|
|
124
132
|
openhuman: {
|
|
@@ -162,9 +170,9 @@ export const CONTEXT_CONTRACTS = {
|
|
|
162
170
|
verification: { method: 'AIWG Windsurf/Devin topology contract; provider-native rules retained', source: 'src/providers/provider-definitions.ts', lastVerified: VERIFIED_ON },
|
|
163
171
|
},
|
|
164
172
|
generic: {
|
|
165
|
-
startupFiles: [], precedence: ['host policy'], loadMode: '
|
|
166
|
-
bootstrapTargets: [], maxContextBytes: null, recommendedMaxLines: null, nestedContext: false, support: '
|
|
167
|
-
verification: { method: '
|
|
173
|
+
startupFiles: ['AGENTS.md'], precedence: ['host policy'], loadMode: 'prose-directive', includeSyntax: null, configRegistration: null,
|
|
174
|
+
bootstrapTargets: ['AGENTS.md'], maxContextBytes: null, recommendedMaxLines: null, nestedContext: false, support: 'degraded',
|
|
175
|
+
verification: { method: 'Portable Markdown adapter; host must explicitly load AGENTS.md; no automatic startup-file claim', source: 'tools/agents/providers/generic.mjs', lastVerified: VERIFIED_ON },
|
|
168
176
|
},
|
|
169
177
|
};
|
|
170
178
|
//# sourceMappingURL=provider-context-contracts.js.map
|
|
@@ -93,6 +93,12 @@ export const ProviderDefinitionSchema = z.object({
|
|
|
93
93
|
includeSyntax: z.string().nullable(),
|
|
94
94
|
configRegistration: z.object({ file: z.string().min(1), key: z.string().min(1) }).nullable(),
|
|
95
95
|
bootstrapTargets: z.array(z.string().min(1)),
|
|
96
|
+
promptDiscovery: z.object({
|
|
97
|
+
delivery: z.enum(['bootstrap-rule', 'hook-bridge']),
|
|
98
|
+
files: z.array(z.string().min(1)).min(1),
|
|
99
|
+
event: z.string().min(1).optional(),
|
|
100
|
+
optIn: z.boolean().optional(),
|
|
101
|
+
}).optional(),
|
|
96
102
|
maxContextBytes: integer().positive().nullable(),
|
|
97
103
|
recommendedMaxLines: integer().positive().nullable(),
|
|
98
104
|
nestedContext: z.boolean(),
|
|
@@ -162,8 +162,8 @@ export const BUILT_IN_SEEDS_1 = [
|
|
|
162
162
|
agents: '.github/agents',
|
|
163
163
|
commands: '.github/commands',
|
|
164
164
|
skills: '.github/.aiwg/skills',
|
|
165
|
-
rules: '.github/
|
|
166
|
-
behaviors: '.github/
|
|
165
|
+
rules: '.github/instructions',
|
|
166
|
+
behaviors: '.github/instructions',
|
|
167
167
|
},
|
|
168
168
|
kernelSkills: '.github/skills',
|
|
169
169
|
contextDiscovery: {
|
|
@@ -179,7 +179,7 @@ export const BUILT_IN_SEEDS_1 = [
|
|
|
179
179
|
agents: '.github/agents',
|
|
180
180
|
commands: '.github/agents',
|
|
181
181
|
skills: '.github/skills',
|
|
182
|
-
rules: '.github/
|
|
182
|
+
rules: '.github/instructions',
|
|
183
183
|
fileExtension: '.md',
|
|
184
184
|
configFile: 'copilot-instructions.md',
|
|
185
185
|
aggregated: false,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { resolveHermesHomePath } from './hermes-home.js';
|
|
2
|
+
import { GROK_BUILD_STANDARD_SKILLS_PATH } from './grok-build-paths.js';
|
|
3
|
+
import { MUSE_STANDARD_SKILLS_PATH } from './muse-paths.js';
|
|
2
4
|
export const BUILT_IN_SEEDS_2 = [
|
|
3
5
|
{
|
|
4
6
|
id: 'grok-build',
|
|
@@ -26,7 +28,7 @@ export const BUILT_IN_SEEDS_2 = [
|
|
|
26
28
|
artifacts: {
|
|
27
29
|
agents: '.grok/agents',
|
|
28
30
|
commands: null,
|
|
29
|
-
skills:
|
|
31
|
+
skills: GROK_BUILD_STANDARD_SKILLS_PATH,
|
|
30
32
|
rules: '.grok/rules',
|
|
31
33
|
behaviors: null,
|
|
32
34
|
},
|
|
@@ -133,11 +135,11 @@ export const BUILT_IN_SEEDS_2 = [
|
|
|
133
135
|
paths: {
|
|
134
136
|
deployTarget: 'mixed',
|
|
135
137
|
artifacts: {
|
|
136
|
-
//
|
|
137
|
-
// hook. Agents
|
|
138
|
+
// Bulk skills use an opt-in mirror; kernel skills stay native. Rule files
|
|
139
|
+
// use the AGENTS.md hook. Agents/commands stay indexed via discover/show.
|
|
138
140
|
agents: null,
|
|
139
141
|
commands: null,
|
|
140
|
-
skills:
|
|
142
|
+
skills: MUSE_STANDARD_SKILLS_PATH,
|
|
141
143
|
rules: '.muse/rules',
|
|
142
144
|
behaviors: null,
|
|
143
145
|
},
|
|
@@ -233,7 +233,7 @@ export const BUILT_IN_SEEDS_3 = [
|
|
|
233
233
|
status: 'stable',
|
|
234
234
|
aliases: [],
|
|
235
235
|
builtIn: true,
|
|
236
|
-
surfaces: { primary: 'generic', compatibility: [], precedence: ['agents/', 'skills/', 'rules/'], related: [] },
|
|
236
|
+
surfaces: { primary: 'generic', compatibility: [], precedence: ['AGENTS.md', 'agents/', '.agents/skills/', 'skills/', 'rules/'], related: [] },
|
|
237
237
|
detection: {
|
|
238
238
|
env: [],
|
|
239
239
|
process: [],
|
|
@@ -248,9 +248,9 @@ export const BUILT_IN_SEEDS_3 = [
|
|
|
248
248
|
rules: 'rules',
|
|
249
249
|
behaviors: null,
|
|
250
250
|
},
|
|
251
|
-
kernelSkills:
|
|
252
|
-
configFile: '
|
|
253
|
-
contextFiles: { aiwgMd: true, agentsMd:
|
|
251
|
+
kernelSkills: '.agents/skills',
|
|
252
|
+
configFile: 'AGENTS.md',
|
|
253
|
+
contextFiles: { aiwgMd: true, agentsMd: true, claudeMdHook: false, hookFile: null, contextFile: 'AGENTS.md' },
|
|
254
254
|
},
|
|
255
255
|
smithPaths: {
|
|
256
256
|
agents: 'agents',
|
|
@@ -258,7 +258,7 @@ export const BUILT_IN_SEEDS_3 = [
|
|
|
258
258
|
skills: 'skills',
|
|
259
259
|
rules: 'rules',
|
|
260
260
|
fileExtension: '.md',
|
|
261
|
-
configFile: '
|
|
261
|
+
configFile: 'AGENTS.md',
|
|
262
262
|
aggregated: false,
|
|
263
263
|
},
|
|
264
264
|
skillNamespace: {
|
|
@@ -271,7 +271,7 @@ export const BUILT_IN_SEEDS_3 = [
|
|
|
271
271
|
agentFormat: 'generic-markdown',
|
|
272
272
|
hookBridge: null,
|
|
273
273
|
mcpInjection: null,
|
|
274
|
-
contextAggregation:
|
|
274
|
+
contextAggregation: 'agents-md',
|
|
275
275
|
ruleFormat: 'markdown',
|
|
276
276
|
},
|
|
277
277
|
matrixRef: null,
|
|
@@ -4,6 +4,8 @@ export interface RuleBindings { skills: string[]; agents: string[]; flows: strin
|
|
|
4
4
|
export interface RuleFrontmatter extends Record<string, unknown> {
|
|
5
5
|
activation: RuleActivation;
|
|
6
6
|
tagged: boolean;
|
|
7
|
+
precedence: 'critical' | 'high' | 'medium' | 'low';
|
|
8
|
+
overridable: boolean;
|
|
7
9
|
summary?: string;
|
|
8
10
|
bound_to: RuleBindings;
|
|
9
11
|
paths?: string[];
|
|
@@ -51,6 +51,8 @@ export function validateRuleFrontmatter(data) {
|
|
|
51
51
|
...data,
|
|
52
52
|
activation: tagged ? data.activation : inferRuleActivation(data.enforcement),
|
|
53
53
|
tagged,
|
|
54
|
+
precedence: data.precedence ?? 'medium',
|
|
55
|
+
overridable: data.overridable ?? true,
|
|
54
56
|
...(typeof data.summary === 'string' ? { summary: data.summary.trim() } : {}),
|
|
55
57
|
bound_to: { skills: [], agents: [], flows: [], ...data.bound_to },
|
|
56
58
|
} } : {}),
|
|
@@ -98,22 +100,29 @@ export function coreBodyPath(ruleFile) {
|
|
|
98
100
|
return ruleFile.replace(/\.md$/, '.core.md');
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
/** Normalize Markdown line endings before enforcing the canonical core-body budget. */
|
|
104
|
+
function normalizeCoreBody(text) {
|
|
105
|
+
return text.replace(/\r\n?/g, '\n').trim();
|
|
106
|
+
}
|
|
107
|
+
|
|
101
108
|
/** Validate one core body's text. Returns error strings (empty when valid). */
|
|
102
109
|
export function validateCoreBody(text, label = 'core body') {
|
|
103
110
|
const errors = [];
|
|
104
|
-
const
|
|
105
|
-
|
|
111
|
+
const body = normalizeCoreBody(text);
|
|
112
|
+
const bytes = Buffer.byteLength(body, 'utf8');
|
|
113
|
+
if (!body) errors.push(`${label}: core body is empty`);
|
|
106
114
|
if (bytes > CORE_BODY_MAX_BYTES) errors.push(`${label}: core body is ${bytes} bytes; the per-body cap is ${CORE_BODY_MAX_BYTES} bytes`);
|
|
107
|
-
if (/^---\r?\n/.test(
|
|
108
|
-
if (AT_IMPORT.test(
|
|
115
|
+
if (/^---\r?\n/.test(body)) errors.push(`${label}: core body must not carry frontmatter`);
|
|
116
|
+
if (AT_IMPORT.test(body)) errors.push(`${label}: core body must not contain an @ file reference/import; use a plain path or \`aiwg show rule <name>\``);
|
|
109
117
|
return errors;
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
/** Validate the whole core set against the reserved budget. */
|
|
113
121
|
export function validateCoreSet(bodies) {
|
|
114
|
-
const
|
|
122
|
+
const measured = bodies.map(item => ({ name: item.name, bytes: Buffer.byteLength(normalizeCoreBody(item.text), 'utf8') }));
|
|
123
|
+
const total = measured.reduce((sum, item) => sum + item.bytes, 0);
|
|
115
124
|
return total > CORE_TOTAL_MAX_BYTES
|
|
116
|
-
? [`Core rules total ${total} bytes; the reserved core budget is ${CORE_TOTAL_MAX_BYTES} bytes (${
|
|
125
|
+
? [`Core rules total ${total} bytes; the reserved core budget is ${CORE_TOTAL_MAX_BYTES} bytes (${measured.map(item => `${item.name}: ${item.bytes}`).join(', ')})`]
|
|
117
126
|
: [];
|
|
118
127
|
}
|
|
119
128
|
|
|
@@ -121,7 +130,7 @@ export function validateCoreSet(bodies) {
|
|
|
121
130
|
export function readCoreBody(ruleFile) {
|
|
122
131
|
const file = coreBodyPath(ruleFile);
|
|
123
132
|
if (!existsSync(file)) throw new Error(`${ruleFile}: activation core requires a compact body file ${path.basename(file)}`);
|
|
124
|
-
const text = readFileSync(file, 'utf8')
|
|
133
|
+
const text = normalizeCoreBody(readFileSync(file, 'utf8'));
|
|
125
134
|
const errors = validateCoreBody(text, file);
|
|
126
135
|
if (errors.length) throw new Error(errors.join('; '));
|
|
127
136
|
return text;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RuleDiagnostic } from './activation.mjs';
|
|
2
2
|
export interface RulePinSelector { rules?: string[]; enforcement?: Array<'critical' | 'high' | 'medium' | 'low'>; capabilities?: string[]; group?: string; all?: true }
|
|
3
|
-
export interface
|
|
3
|
+
export interface RulePrecedenceOverride { tier?: 'critical' | 'high' | 'medium' | 'low'; project_context?: boolean }
|
|
4
|
+
export interface RulesConfig { precedence?: Record<string, RulePrecedenceOverride>; inline_budget_tokens?: number; always_load?: RulePinSelector[]; pin_groups?: Record<string, string[]> }
|
|
4
5
|
export interface InlineBudgetConfig { rules?: RulesConfig }
|
|
5
6
|
export interface StartupContributor { path: string; bytes?: number; content?: string }
|
|
6
7
|
export interface InlineBudgetReport {
|