@aiwg/cli 2026.10.15 → 2026.10.18
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 +42 -11
- 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/artifacts/query-engine-corpus.js +217 -0
- package/dist/src/artifacts/query-engine-discover-output.js +229 -0
- package/dist/src/artifacts/query-engine-discover.js +285 -0
- package/dist/src/artifacts/query-engine-entries.js +188 -0
- package/dist/src/artifacts/query-engine-index.js +249 -0
- package/dist/src/artifacts/query-engine-matching.js +143 -0
- package/dist/src/artifacts/query-engine-options.js +2 -0
- package/dist/src/artifacts/query-engine-rules.js +202 -0
- package/dist/src/artifacts/query-engine-scoring.js +436 -0
- package/dist/src/artifacts/query-engine-show-card.js +194 -0
- package/dist/src/artifacts/query-engine-show-load.js +211 -0
- package/dist/src/artifacts/query-engine-show.js +300 -0
- package/dist/src/artifacts/query-engine.js +7 -2576
- 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/mc-agents.js +111 -0
- package/dist/src/cli/handlers/mc-args.js +54 -0
- package/dist/src/cli/handlers/mc-control.js +227 -0
- package/dist/src/cli/handlers/mc-dispatch.js +203 -0
- package/dist/src/cli/handlers/mc-help.js +171 -0
- package/dist/src/cli/handlers/mc-run.js +343 -0
- package/dist/src/cli/handlers/mc-session.js +138 -0
- package/dist/src/cli/handlers/mc-status.js +258 -0
- package/dist/src/cli/handlers/mc-summary.js +43 -0
- package/dist/src/cli/handlers/mc-types.js +3 -0
- package/dist/src/cli/handlers/mc-worker.js +205 -0
- package/dist/src/cli/handlers/mc.js +12 -1665
- package/dist/src/cli/handlers/models-refusal.js +13 -0
- package/dist/src/cli/handlers/models-resource-sample.js +10 -0
- package/dist/src/cli/handlers/models.js +5 -3
- package/dist/src/cli/handlers/regenerate.js +8 -16
- package/dist/src/cli/handlers/remove-bundled.js +133 -0
- package/dist/src/cli/handlers/remove-options.js +31 -0
- package/dist/src/cli/handlers/remove-user.js +174 -0
- package/dist/src/cli/handlers/remove.js +201 -0
- package/dist/src/cli/handlers/sessions.js +7 -7
- package/dist/src/cli/handlers/subcommands-bundles.js +257 -0
- package/dist/src/cli/handlers/subcommands-discovery.js +165 -0
- package/dist/src/cli/handlers/subcommands-list-format.js +129 -0
- package/dist/src/cli/handlers/subcommands-list.js +250 -0
- package/dist/src/cli/handlers/subcommands-plugins.js +213 -0
- package/dist/src/cli/handlers/subcommands-quickref.js +58 -0
- package/dist/src/cli/handlers/subcommands-rlm.js +113 -0
- package/dist/src/cli/handlers/subcommands-services.js +66 -0
- package/dist/src/cli/handlers/subcommands-storage.js +259 -0
- package/dist/src/cli/handlers/subcommands.js +18 -1976
- 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/scope-resolver.js +1 -142
- package/dist/src/cli/services/deployment-verification.js +0 -1
- package/dist/src/cli/user-scope-mirror.js +173 -0
- package/dist/src/config/aiwg-config.js +2 -1
- package/dist/src/config/authorization-cli.js +7 -3
- package/dist/src/config/dispatch-host-thresholds.js +2 -0
- package/dist/src/config/dispatch-thresholds-runtime.d.mts +3 -2
- package/dist/src/config/dispatch-thresholds-runtime.mjs +21 -7
- package/dist/src/config/framework-aliases.js +12 -0
- package/dist/src/config/host-resource-report.d.mts +24 -0
- package/dist/src/config/host-resource-report.mjs +110 -0
- package/dist/src/config/host-resource-runtime.d.mts +37 -0
- package/dist/src/config/host-resource-runtime.mjs +296 -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/ensemble-study/artifacts.js +7 -0
- package/dist/src/decision/ensemble-study/gate-policy.js +58 -0
- package/dist/src/decision/ensemble-study/gates.js +78 -0
- package/dist/src/decision/ensemble-study/protocol.js +18 -21
- package/dist/src/decision/ensemble-study/score.js +3 -2
- package/dist/src/decision/ensemble-study/statistics.js +7 -26
- 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/decision/sensitivity/comparative-gates.js +135 -0
- package/dist/src/decision/sensitivity/comparative.js +18 -41
- 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 +133 -69
- package/dist/src/extensions/commands/daemon.js +109 -0
- package/dist/src/extensions/commands/definitions.js +5 -89
- package/dist/src/gates/evaluate.js +2 -358
- package/dist/src/gates/heldout.js +17 -7
- package/dist/src/gates/observations.js +363 -0
- package/dist/src/gates/pack-composition.js +270 -0
- package/dist/src/gates/pack-tightening.js +197 -0
- package/dist/src/gates/pack-validation.js +262 -0
- package/dist/src/gates/registry-error.js +5 -0
- package/dist/src/gates/registry.js +13 -685
- 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/mcp/json-document.mjs +29 -0
- package/dist/src/mcp/muse-native-config.mjs +1 -28
- package/dist/src/memory/project-registry.js +44 -4
- package/dist/src/mission-protocol/worker-review-gate.js +7 -0
- 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/plugin/command-ownership.js +34 -0
- package/dist/src/plugin/skill-command-frontmatter.js +197 -0
- package/dist/src/plugin/skill-command-translator.js +6 -232
- 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/context-output-ownership.js +26 -0
- package/dist/src/providers/deployment-ownership.d.mts +19 -0
- package/dist/src/providers/deployment-ownership.mjs +226 -0
- package/dist/src/providers/deployment-removal.js +200 -0
- 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/providers/removal-transaction.js +86 -0
- package/dist/src/providers/settings-document.d.mts +3 -0
- package/dist/src/providers/settings-document.mjs +47 -0
- package/dist/src/providers/settings-removal.js +190 -0
- package/dist/src/providers/skill-ownership.d.mts +19 -2
- package/dist/src/providers/skill-ownership.mjs +12 -4
- package/dist/src/providers/transformation-receipt-integration.js +15 -271
- package/dist/src/providers/transformation-receipt-outputs.js +99 -0
- package/dist/src/providers/transformation-receipt-source.js +194 -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 +42 -4
- 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 +105 -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/rules/activation.mjs +15 -6
- package/dist/src/rules/core-startup.mjs +2 -2
- package/dist/src/serve/mission-conductor.js +52 -4
- package/dist/src/serve/mission-summary.js +56 -0
- 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 +39 -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/context-file-safety.js +3 -0
- package/dist/src/smiths/context-pipeline/finalization.js +81 -51
- package/dist/src/smiths/context-pipeline/generator.js +10 -11
- 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/dist/src/smiths/hook-bridge/index.js +9 -0
- package/package.json +13 -1
- package/schemas/decision/D17StudyProtocol.v1.schema.json +39 -67
- package/schemas/decision/D29Study.v10.schema.json +65 -0
- package/tools/agents/deploy-agents.mjs +24 -675
- package/tools/agents/deploy-command-mirrors.mjs +229 -0
- package/tools/agents/deploy-options.mjs +258 -0
- package/tools/agents/deploy-support.mjs +165 -0
- package/tools/agents/providers/base-addon-discovery.mjs +139 -0
- package/tools/agents/providers/base-behaviors.mjs +168 -0
- package/tools/agents/providers/base-context.mjs +205 -0
- package/tools/agents/providers/base-contract.mjs +116 -0
- package/tools/agents/providers/base-files.mjs +252 -0
- package/tools/agents/providers/base-flat-artifacts.mjs +233 -0
- package/tools/agents/providers/base-framework-discovery.mjs +309 -0
- package/tools/agents/providers/base-frontmatter.mjs +196 -0
- package/tools/agents/providers/base-inventory.mjs +269 -0
- package/tools/agents/providers/base-kernel-skills.mjs +354 -0
- package/tools/agents/providers/base-migrations.mjs +258 -0
- package/tools/agents/providers/base-models-platforms.mjs +273 -0
- package/tools/agents/providers/base-rule-index.mjs +450 -0
- package/tools/agents/providers/base-runtime.mjs +60 -0
- package/tools/agents/providers/base-skill-copy.mjs +273 -0
- package/tools/agents/providers/base.mjs +16 -3364
- package/tools/agents/providers/claude-post-deploy.mjs +20 -1
- package/tools/agents/providers/context-write.mjs +4 -0
- package/tools/agents/providers/hermes-startup.mjs +0 -5
- package/tools/agents/providers/muse.mjs +7 -2
- package/tools/agents/providers/pi.mjs +3 -1
- package/tools/agents/providers/rule-delivery-surface.mjs +359 -0
- package/tools/agents/providers/rule-delivery.mjs +20 -1144
- package/tools/agents/providers/rule-deployment-commit.mjs +148 -0
- package/tools/agents/providers/rule-deployment-prepare.mjs +461 -0
- package/tools/agents/providers/rule-deployment-state.mjs +300 -0
- package/tools/agents/providers/rule-projection.mjs +3 -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 +7 -4
- 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-termination.mjs +15 -8
- 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
- package/vscode-extension/schemas/aiwg.config.v1.json +2 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hostResourceReport } from '../config/host-resource-report.mjs';
|
|
1
2
|
import { workerReviewLineageDiagnostics } from './worker-review-lineage.js';
|
|
2
3
|
// Resolves eligible worker tuples against current config, catalog and installation snapshots.
|
|
3
4
|
import { isFlagshipModel, flagshipElected, normalizeModelTier } from './tiers.js';
|
|
@@ -41,6 +42,10 @@ export function resolveWorkerPlan(snapshot, request, ceilingDefaults = {}) {
|
|
|
41
42
|
policy: structuredClone(policy), origins: structuredClone(snapshot.models.workerPolicyOrigins),
|
|
42
43
|
choice: null, capacity: 'conductor-guidance-only', ceilings: {},
|
|
43
44
|
};
|
|
45
|
+
const resourceInput = { config: snapshot.config, live: snapshot.hostResources ?? { supported: false, reason: 'host snapshot missing' },
|
|
46
|
+
now: () => Date.parse(request.now) };
|
|
47
|
+
plan.resources = hostResourceReport(resourceInput);
|
|
48
|
+
plan.slots = plan.resources.slots;
|
|
44
49
|
const diagnostic = (code, pointer, message) => ({ code, pointer, message });
|
|
45
50
|
const block = (code, pointer, message) => {
|
|
46
51
|
plan.diagnostics.push(diagnostic(code, pointer, message));
|
|
@@ -269,10 +274,29 @@ export function resolveWorkerPlan(snapshot, request, ceilingDefaults = {}) {
|
|
|
269
274
|
if (authority.requiresConfirmation)
|
|
270
275
|
deny('OG_MODEL_UNAPPROVED', '/request/authority', `${authority.rationale.join('; ')}; agents may pass --authorize-premium only after the human explicitly confirmed the premium escalation (escalation-discipline rule)`);
|
|
271
276
|
const installation = parallelism.clis?.[member.cli];
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
parallelism.
|
|
275
|
-
|
|
277
|
+
const admission = parallelism.admission;
|
|
278
|
+
const capEntries = [
|
|
279
|
+
['max_parallel_subagents', parallelism.max_parallel_subagents], ['group.maxParallel', group.maxParallel],
|
|
280
|
+
['admission.groupCaps', admission?.groupCaps?.[groupId]],
|
|
281
|
+
['admission.memberCaps', admission?.memberCaps?.[`${groupId}/${member.id}`]],
|
|
282
|
+
['admission.cliCaps', admission?.cliCaps?.[member.cli]], ['admission.modelCaps', admission?.modelCaps?.[key]],
|
|
283
|
+
['admission.quotaCaps', installation && admission?.quotaCaps?.[installation.quotaScope]],
|
|
284
|
+
];
|
|
285
|
+
const caps = [...capEntries.map(([, value]) => value), snapshot.constraints?.maxParallel, request.maxParallel]
|
|
286
|
+
.filter((value) => value !== undefined);
|
|
287
|
+
// The shared report owns project/group caps; the remaining entries scope the tuple.
|
|
288
|
+
const resources = hostResourceReport({ ...resourceInput, group: groupId,
|
|
289
|
+
caps: [...capEntries.slice(3).map(([threshold, limit]) => ({ threshold, limit })),
|
|
290
|
+
{ threshold: 'constraints.maxParallel', limit: snapshot.constraints?.maxParallel, running: 0 },
|
|
291
|
+
{ threshold: 'request.maxParallel', limit: request.maxParallel, running: 0 }] });
|
|
292
|
+
if (resources) {
|
|
293
|
+
if (!plan.eligible.length) {
|
|
294
|
+
plan.resources = resources;
|
|
295
|
+
plan.slots = resources.slots;
|
|
296
|
+
}
|
|
297
|
+
if (!resources.ok)
|
|
298
|
+
deny('OG_ADAPTER_UNQUALIFIED', '/parallelism/admission/hostResources', resources.failures.map(failure => `${failure.signal}: ${failure.reason}`).join('; '));
|
|
299
|
+
}
|
|
276
300
|
const effectiveMaxParallel = caps.length ? Math.min(...caps) : null;
|
|
277
301
|
if (effectiveMaxParallel === 0)
|
|
278
302
|
deny('OG_ADAPTER_UNQUALIFIED', '/constraints/maxParallel', 'Current capacity ceiling is zero');
|
|
@@ -282,7 +306,7 @@ export function resolveWorkerPlan(snapshot, request, ceilingDefaults = {}) {
|
|
|
282
306
|
profile: binding.profile, transport,
|
|
283
307
|
permissions: structuredClone(permissions), context: workerContextHeadroom(request.context, observation),
|
|
284
308
|
observedAt: observation.observedAt, verifiedAt: observation.verifiedAt, observationRef: observation.recordId,
|
|
285
|
-
effectiveMaxParallel, diagnostics: reasons });
|
|
309
|
+
effectiveMaxParallel, ...(resources ? { resources } : {}), diagnostics: reasons });
|
|
286
310
|
}
|
|
287
311
|
if (reasons.some(reason => reason.blocking !== false))
|
|
288
312
|
plan.exclusions.push({ ...tuple, diagnostics: reasons });
|
|
@@ -301,12 +325,19 @@ export function resolveWorkerPlan(snapshot, request, ceilingDefaults = {}) {
|
|
|
301
325
|
if (plan.diagnostics.length)
|
|
302
326
|
plan.selected = null;
|
|
303
327
|
if (plan.selected) {
|
|
328
|
+
if (plan.selected.resources) {
|
|
329
|
+
plan.resources = plan.selected.resources;
|
|
330
|
+
plan.slots = plan.resources.slots;
|
|
331
|
+
}
|
|
304
332
|
plan.policy = groupPolicies.get(plan.selected.group);
|
|
305
333
|
plan.status = 'eligible';
|
|
306
334
|
plan.diagnostics.push(...plan.selected.diagnostics.filter(item => item.code === 'OG_SANDBOX_EXTERNAL'));
|
|
307
335
|
plan.choice = { source: request.choice ? 'conductor' : 'default', rationale: request.choice?.rationale ?? 'Role group order, member priority/declaration order, then qualified effort ladder',
|
|
308
336
|
...(request.substitution && matchesChoice(plan.selected, request.substitution) ? { substitution: structuredClone(request.substitution) } : {}) };
|
|
309
337
|
}
|
|
338
|
+
if (!plan.selected && plan.resources?.slots === 0) {
|
|
339
|
+
block('OG_ADAPTER_UNQUALIFIED', '/parallelism/admission/hostResources', plan.resources.failures.map(failure => `${failure.signal}: ${failure.reason}`).join('; '));
|
|
340
|
+
}
|
|
310
341
|
plan.alternatives = plan.eligible.filter(tuple => tuple !== plan.selected);
|
|
311
342
|
return plan;
|
|
312
343
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { load as loadYaml } from 'js-yaml';
|
|
4
|
+
import { getStaticTOMLValue, parseTOML } from 'toml-eslint-parser';
|
|
4
5
|
import { MODEL_WRAPPER_DEFINITIONS } from './wrapper-definitions.js';
|
|
5
6
|
import { isFlagshipModel } from './tiers.js';
|
|
6
7
|
const CLAUDE_ALIASES = {
|
|
@@ -30,19 +31,12 @@ async function collectFiles(root) {
|
|
|
30
31
|
return files.sort();
|
|
31
32
|
}
|
|
32
33
|
function tomlFields(content) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
fields[match[1]] = JSON.parse(`"${match[2]}"`);
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
fields[match[1]] = match[2];
|
|
43
|
-
}
|
|
34
|
+
try {
|
|
35
|
+
return getStaticTOMLValue(parseTOML(content));
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return null;
|
|
44
39
|
}
|
|
45
|
-
return fields;
|
|
46
40
|
}
|
|
47
41
|
function markdownFields(content) {
|
|
48
42
|
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
@@ -67,6 +61,25 @@ function artifactFields(file, content) {
|
|
|
67
61
|
return markdownFields(content);
|
|
68
62
|
return null;
|
|
69
63
|
}
|
|
64
|
+
/** Read the same deployed artifacts used by verification, without repairing them. */
|
|
65
|
+
export async function readModelWrapperArtifacts(agentsPath) {
|
|
66
|
+
const artifacts = [];
|
|
67
|
+
if (!agentsPath)
|
|
68
|
+
return artifacts;
|
|
69
|
+
for (const file of await collectFiles(agentsPath)) {
|
|
70
|
+
const name = path.basename(file).replace(/(?:\.agent)?\.(?:md|toml|json|yaml|yml)$/i, '');
|
|
71
|
+
const wrapper = MODEL_WRAPPER_DEFINITIONS.find(item => item.name === name);
|
|
72
|
+
if (!wrapper)
|
|
73
|
+
continue;
|
|
74
|
+
let fields = null;
|
|
75
|
+
try {
|
|
76
|
+
fields = artifactFields(file, await fs.readFile(file, 'utf8'));
|
|
77
|
+
}
|
|
78
|
+
catch { /* unresolved metadata */ }
|
|
79
|
+
artifacts.push({ wrapper, file, fields });
|
|
80
|
+
}
|
|
81
|
+
return artifacts;
|
|
82
|
+
}
|
|
70
83
|
function fieldValue(fields, ...names) {
|
|
71
84
|
for (const name of names) {
|
|
72
85
|
const value = fields[name];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Describes controls on deployed wrapper artifacts, distinct from headless CLI controls.
|
|
2
2
|
import { compileModelPolicy, loadProviderModelCatalog } from './catalog-policy.js';
|
|
3
3
|
import { MODEL_WRAPPER_DEFINITIONS } from './wrapper-definitions.js';
|
|
4
|
+
import { flagshipElected, isFlagshipModel } from './tiers.js';
|
|
5
|
+
import { loadProviderModelCapabilities } from './provider-policy.js';
|
|
4
6
|
const NATIVE_CONTROLS = {
|
|
5
7
|
claude: { model: 'model', effort: 'effort' },
|
|
6
8
|
codex: { model: 'model', effort: 'model_reasoning_effort' },
|
|
@@ -8,12 +10,49 @@ const NATIVE_CONTROLS = {
|
|
|
8
10
|
factory: { model: 'model', effort: 'reasoningEffort' },
|
|
9
11
|
opencode: { model: 'model' }, omp: { model: 'model', effort: 'thinkingLevel' },
|
|
10
12
|
};
|
|
13
|
+
export const GLOBAL_WRAPPER_SETTINGS = {
|
|
14
|
+
hermes: 'Hermes config.yaml: delegation.model / delegation.effort',
|
|
15
|
+
warp: 'Warp agent run --model <MODEL_ID> (run/profile-wide); effort: unavailable',
|
|
16
|
+
muse: 'Muse --model / --reasoning-effort; $XDG_CONFIG_HOME/muse/settings.json model supplies the model fallback',
|
|
17
|
+
grokbot: 'Grok Bot model: unavailable; effort: unavailable (no verified native setting in the provider catalog)',
|
|
18
|
+
};
|
|
11
19
|
const GLOBAL_ONLY = new Set(['warp', 'hermes', 'grokbot', 'muse']);
|
|
12
20
|
export function wrapperControls(provider) {
|
|
13
21
|
return NATIVE_CONTROLS[provider] ?? {};
|
|
14
22
|
}
|
|
15
23
|
export function isConcreteWrapperModel(model) {
|
|
16
|
-
return Boolean(model && !/^(?:configured\/|Hint\(|auto$|inherit(?:ed)?$|default$|profile-selected$|global-delegation-model$)
|
|
24
|
+
return Boolean(model?.trim() && !/^(?:configured\/|Hint\(|auto$|inherit(?:ed)?$|default$|profile-selected$|global-delegation-model$|unknown$|unresolved$|placeholder$|todo$)|\$\{|<[^>]+>/i.test(model.trim()));
|
|
25
|
+
}
|
|
26
|
+
/** Observed artifact controls, never a claim about an active provider session. */
|
|
27
|
+
export function deployedWrapperEnforcement(provider, artifact) {
|
|
28
|
+
const controls = wrapperControls(provider);
|
|
29
|
+
const globalOnly = GLOBAL_ONLY.has(provider);
|
|
30
|
+
const pinned = Boolean(controls.model && isConcreteWrapperModel(artifact.model) && !artifact.forceInheritedModel);
|
|
31
|
+
const model = globalOnly ? 'global-only' : pinned ? 'pinned' : 'inherited';
|
|
32
|
+
const effort = globalOnly ? 'global-only'
|
|
33
|
+
: controls.effort && artifact.effort && loadProviderModelCapabilities().providers[provider]?.effortValues?.includes(artifact.effort) ? 'pinned' : 'inherited';
|
|
34
|
+
return { model, effort, effectiveModel: pinned ? artifact.model : artifact.inheritedModel,
|
|
35
|
+
effectiveEffort: effort === 'pinned' ? artifact.effort : artifact.inheritedEffort };
|
|
36
|
+
}
|
|
37
|
+
export function wrapperModelRisks(provider, artifact, catalog = loadProviderModelCatalog()) {
|
|
38
|
+
const state = deployedWrapperEnforcement(provider, artifact);
|
|
39
|
+
const findings = [];
|
|
40
|
+
if ((artifact.model !== undefined && !isConcreteWrapperModel(artifact.model))
|
|
41
|
+
|| !isConcreteWrapperModel(state.effectiveModel))
|
|
42
|
+
findings.push('delegation.unresolved-model');
|
|
43
|
+
const matches = (ids) => ids.filter(isConcreteWrapperModel)
|
|
44
|
+
.some(id => state.effectiveModel === id || state.effectiveModel?.endsWith(`/${id}`));
|
|
45
|
+
const flagship = !!state.effectiveModel && (isFlagshipModel(state.effectiveModel)
|
|
46
|
+
|| Object.values(catalog.providers).some(entry => matches([entry?.tiers?.flagship?.id])));
|
|
47
|
+
const premium = !!state.effectiveModel && (Object.values(catalog.providers)
|
|
48
|
+
.some(entry => matches([entry?.tiers?.premium?.id, entry?.roles.reasoning.id]))
|
|
49
|
+
|| (provider === 'claude' && state.effectiveModel === 'opus'));
|
|
50
|
+
// Flagship always needs an operator election, pinned or not. Premium is a normal ladder tier
|
|
51
|
+
// (the reasoning role's default), so it is a risk only when a wrapper inherits it.
|
|
52
|
+
if ((flagship || (premium && state.model !== 'pinned')) && !flagshipElected(artifact)) {
|
|
53
|
+
findings.push('delegation.flagship-inheritance');
|
|
54
|
+
}
|
|
55
|
+
return findings;
|
|
17
56
|
}
|
|
18
57
|
export function resolveWrapperPin(provider, wrapper, options = {}) {
|
|
19
58
|
const controls = wrapperControls(provider);
|
|
@@ -41,14 +80,15 @@ export function resolveWrapperPin(provider, wrapper, options = {}) {
|
|
|
41
80
|
enforcement: (GLOBAL_ONLY.has(provider) ? 'global-only' : model ? 'pinned' : 'inherited') };
|
|
42
81
|
}
|
|
43
82
|
/** Static artifact defaults; this does not inspect live sessions or assert runtime enforcement. */
|
|
44
|
-
export function wrapperEnforcementReport(provider) {
|
|
83
|
+
export function wrapperEnforcementReport(provider, artifact) {
|
|
45
84
|
const catalog = loadProviderModelCatalog();
|
|
46
85
|
const controls = wrapperControls(provider);
|
|
47
86
|
const known = provider in catalog.providers;
|
|
48
87
|
const states = known ? MODEL_WRAPPER_DEFINITIONS.map(wrapper => resolveWrapperPin(provider, wrapper, { catalog }).enforcement) : [];
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
88
|
+
const observed = artifact ? deployedWrapperEnforcement(provider, artifact) : undefined;
|
|
89
|
+
const state = observed?.model ?? (GLOBAL_ONLY.has(provider) ? 'global-only'
|
|
90
|
+
: states.length > 0 && states.every(value => value === 'pinned') ? 'pinned' : 'inherited');
|
|
91
|
+
const effort = observed ? `${observed.effort}${observed.effort === 'pinned' ? ` via ${controls.effort}` : ''}` : state === 'pinned' && controls.effort
|
|
52
92
|
? `pinned via ${controls.effort} (high/medium/low by wrapper)` : 'not enforced per wrapper';
|
|
53
93
|
const details = {
|
|
54
94
|
claude: 'Use AIWG wrappers or an explicit invocation model. Unpinned general-purpose agents inherit; CLAUDE_CODE_SUBAGENT_MODEL supplies a fallback and CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 can override pins.',
|
|
@@ -65,8 +105,8 @@ export function wrapperEnforcementReport(provider) {
|
|
|
65
105
|
grokbot: 'No verified AIWG-owned per-worker model setting is available.',
|
|
66
106
|
muse: 'Session --model or settings.json model controls selection; per-agent pins are unverified.',
|
|
67
107
|
};
|
|
68
|
-
return `Tier enforcement (generated wrapper defaults): ${state}; effort: ${effort}. `
|
|
69
|
-
+ `${details[provider] ?? (known ? 'Native custom subagents carry explicit catalog model selectors.' : 'Provider wrapper controls are unverified.')} `
|
|
108
|
+
return `Tier enforcement (${artifact ? 'deployed wrapper' : 'generated wrapper defaults'}): ${state}; effort: ${effort}. `
|
|
109
|
+
+ `${GLOBAL_WRAPPER_SETTINGS[provider] ? `${GLOBAL_WRAPPER_SETTINGS[provider]}. ` : ''}${details[provider] ?? (known ? 'Native custom subagents carry explicit catalog model selectors.' : 'Provider wrapper controls are unverified.')} `
|
|
70
110
|
+ 'Explicit operator pins are preserved where supported. This is not a live resolved-model audit; provider/account policy may substitute models.';
|
|
71
111
|
}
|
|
72
112
|
//# sourceMappingURL=wrapper-enforcement.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRefId } from '../research/identity.js';
|
|
1
2
|
import { formatEvidenceCitation, validateEvidenceReferences } from './citations.js';
|
|
2
3
|
import { assertLocalOutputAllowed } from './governance.js';
|
|
3
4
|
export const RESEARCH_PACKET_SOURCE_SCHEMA = 'aiwg.research.packet-evidence-source.v1';
|
|
@@ -145,7 +146,7 @@ function frameForStream(citations) {
|
|
|
145
146
|
return frame?.locator.type === 'frame' ? frame.locator.frame_number : null;
|
|
146
147
|
}
|
|
147
148
|
function validateResearchInput(input) {
|
|
148
|
-
if (
|
|
149
|
+
if (!isRefId(input.refId))
|
|
149
150
|
throw new Error('Packet evidence research source requires a REF-NNN identifier');
|
|
150
151
|
requiredString(input.title, 'Research source title');
|
|
151
152
|
if (input.evidence.kind !== 'PacketEvidenceBundle' || input.evidence.status === 'error') {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Preserve source skill ownership when emitting command wrappers and prompts.
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { extractFrameworkSlug, mergeArtifactOwnership } from '../providers/skill-ownership.mjs';
|
|
6
|
+
export async function recordManagedCommands(targetDir, entries, version, source) {
|
|
7
|
+
if (!entries.length)
|
|
8
|
+
return;
|
|
9
|
+
const sidecarPath = path.join(targetDir, '.aiwg-manifest.json');
|
|
10
|
+
let receipt = { managed: {} };
|
|
11
|
+
try {
|
|
12
|
+
receipt = JSON.parse(await fs.readFile(sidecarPath, 'utf8'));
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (error.code !== 'ENOENT')
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
for (const entry of entries) {
|
|
19
|
+
let skill;
|
|
20
|
+
try {
|
|
21
|
+
skill = JSON.parse(await fs.readFile(path.join(path.dirname(entry.sourcePath), '.aiwg-manifest.json'), 'utf8'));
|
|
22
|
+
}
|
|
23
|
+
catch { /* Canonical sources may not be deployed skills. */ }
|
|
24
|
+
const sourceEntry = skill?.managed?.['SKILL.md'];
|
|
25
|
+
const owners = sourceEntry?.owners || [sourceEntry?.frameworkSlug
|
|
26
|
+
|| extractFrameworkSlug(`${skill?.skillSource}/SKILL.md`) || extractFrameworkSlug(entry.sourcePath) || source];
|
|
27
|
+
const record = { hash: `sha256:${createHash('sha256').update(entry.content).digest('hex')}`,
|
|
28
|
+
source, version, kind: 'skill-command', sourcePath: entry.sourcePath,
|
|
29
|
+
frameworkSlug: sourceEntry?.frameworkSlug || extractFrameworkSlug(`${skill?.skillSource}/SKILL.md`) || extractFrameworkSlug(entry.sourcePath) || owners[0] };
|
|
30
|
+
receipt.managed[entry.filename] = owners.reduce((current, owner) => mergeArtifactOwnership(receipt.managed[entry.filename], current, owner), record);
|
|
31
|
+
}
|
|
32
|
+
await fs.writeFile(sidecarPath, `${JSON.stringify(receipt, null, 2)}\n`);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=command-ownership.js.map
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// Provider Configuration
|
|
3
|
+
// ============================================
|
|
4
|
+
/**
|
|
5
|
+
* Providers that need command files generated from skills.
|
|
6
|
+
*
|
|
7
|
+
* Providers not listed here get skills deployed natively (no translation needed).
|
|
8
|
+
*/
|
|
9
|
+
const PROVIDERS_NEEDING_COMMANDS = new Set([
|
|
10
|
+
'factory',
|
|
11
|
+
'opencode', // OpenCode scans .opencode/command/**/*.md via ConfigCommand.load() (PUW-006 #1107)
|
|
12
|
+
'warp',
|
|
13
|
+
'windsurf',
|
|
14
|
+
'copilot',
|
|
15
|
+
'codex',
|
|
16
|
+
'openclaw',
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* Providers where skills are deployed natively (no command generation needed).
|
|
20
|
+
*/
|
|
21
|
+
const SKILLS_ONLY_PROVIDERS = new Set([
|
|
22
|
+
'antigravity',
|
|
23
|
+
'claude',
|
|
24
|
+
'cursor',
|
|
25
|
+
'grokbot',
|
|
26
|
+
'hermes',
|
|
27
|
+
'muse', // #236: skills deploy natively; no command translation (indexed-only agents/commands/rules)
|
|
28
|
+
'openhuman',
|
|
29
|
+
'pi',
|
|
30
|
+
'omp',
|
|
31
|
+
]);
|
|
32
|
+
/**
|
|
33
|
+
* Check if a provider needs command files generated from skills.
|
|
34
|
+
*/
|
|
35
|
+
export function providerNeedsCommands(provider) {
|
|
36
|
+
return PROVIDERS_NEEDING_COMMANDS.has(provider);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if a provider uses skills natively (no command translation).
|
|
40
|
+
*/
|
|
41
|
+
export function providerUsesSkillsNatively(provider) {
|
|
42
|
+
return SKILLS_ONLY_PROVIDERS.has(provider);
|
|
43
|
+
}
|
|
44
|
+
// ============================================
|
|
45
|
+
// Frontmatter Parsing
|
|
46
|
+
// ============================================
|
|
47
|
+
/**
|
|
48
|
+
* Parse YAML-like frontmatter from a SKILL.md file.
|
|
49
|
+
*
|
|
50
|
+
* This is a lightweight parser that handles the subset of YAML used in
|
|
51
|
+
* SKILL.md frontmatter. For full YAML support, a library like js-yaml
|
|
52
|
+
* would be needed, but the frontmatter format is simple enough for this.
|
|
53
|
+
*/
|
|
54
|
+
export function parseFrontmatter(content) {
|
|
55
|
+
const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
|
|
56
|
+
if (!fmMatch) {
|
|
57
|
+
return { frontmatter: {}, body: content };
|
|
58
|
+
}
|
|
59
|
+
const fmRaw = fmMatch[1];
|
|
60
|
+
const body = fmMatch[2];
|
|
61
|
+
const frontmatter = {};
|
|
62
|
+
// Parse top-level keys
|
|
63
|
+
const lines = fmRaw.split('\n');
|
|
64
|
+
let i = 0;
|
|
65
|
+
while (i < lines.length) {
|
|
66
|
+
const line = lines[i];
|
|
67
|
+
// description: ...
|
|
68
|
+
const descMatch = line.match(/^description:\s*(.+)/);
|
|
69
|
+
if (descMatch) {
|
|
70
|
+
frontmatter.description = descMatch[1].trim();
|
|
71
|
+
i++;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
// userInvocable: false
|
|
75
|
+
const uiMatch = line.match(/^userInvocable:\s*(true|false)/i);
|
|
76
|
+
if (uiMatch) {
|
|
77
|
+
frontmatter.userInvocable = uiMatch[1].toLowerCase() === 'true';
|
|
78
|
+
i++;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
// user-invocable: false (kebab-case variant)
|
|
82
|
+
const uiKebabMatch = line.match(/^user-invocable:\s*(true|false)/i);
|
|
83
|
+
if (uiKebabMatch) {
|
|
84
|
+
frontmatter.userInvocable = uiKebabMatch[1].toLowerCase() === 'true';
|
|
85
|
+
i++;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
// effort: N
|
|
89
|
+
const effortMatch = line.match(/^effort:\s*(\d+)/);
|
|
90
|
+
if (effortMatch) {
|
|
91
|
+
frontmatter.effort = parseInt(effortMatch[1], 10);
|
|
92
|
+
i++;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
// context: fork|inherit
|
|
96
|
+
const ctxMatch = line.match(/^context:\s*(\w+)/);
|
|
97
|
+
if (ctxMatch) {
|
|
98
|
+
frontmatter.context = ctxMatch[1];
|
|
99
|
+
i++;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
// disableModelInvocation: true
|
|
103
|
+
const dmiMatch = line.match(/^(?:disableModelInvocation|disable-model-invocation):\s*(true|false)/i);
|
|
104
|
+
if (dmiMatch) {
|
|
105
|
+
frontmatter.disableModelInvocation = dmiMatch[1].toLowerCase() === 'true';
|
|
106
|
+
i++;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
// allowed-tools: (top-level, for the skill itself)
|
|
110
|
+
const atMatch = line.match(/^allowed-tools:\s*(.+)/);
|
|
111
|
+
if (atMatch) {
|
|
112
|
+
frontmatter.allowedTools = atMatch[1].trim();
|
|
113
|
+
i++;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
// commandHint: block
|
|
117
|
+
if (line.match(/^commandHint:\s*$/)) {
|
|
118
|
+
const hint = {};
|
|
119
|
+
i++;
|
|
120
|
+
while (i < lines.length && lines[i].match(/^\s+/)) {
|
|
121
|
+
const hintLine = lines[i].trim();
|
|
122
|
+
const ahMatch = hintLine.match(/^argumentHint:\s*(.+)/);
|
|
123
|
+
if (ahMatch) {
|
|
124
|
+
hint.argumentHint = ahMatch[1].trim();
|
|
125
|
+
i++;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const hatMatch = hintLine.match(/^allowedTools:\s*(.+)/);
|
|
129
|
+
if (hatMatch) {
|
|
130
|
+
hint.allowedTools = hatMatch[1].trim();
|
|
131
|
+
i++;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const tmplMatch = hintLine.match(/^template:\s*(.+)/);
|
|
135
|
+
if (tmplMatch) {
|
|
136
|
+
hint.template = tmplMatch[1].trim();
|
|
137
|
+
i++;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const modMatch = hintLine.match(/^model:\s*(.+)/);
|
|
141
|
+
if (modMatch) {
|
|
142
|
+
hint.model = modMatch[1].trim();
|
|
143
|
+
i++;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const roleMatch = hintLine.match(/^modelRole:\s*(reasoning|coding|efficiency)\s*$/);
|
|
147
|
+
if (roleMatch) {
|
|
148
|
+
hint.modelRole = roleMatch[1];
|
|
149
|
+
i++;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const tierMatch = hintLine.match(/^modelTier:\s*(economy|standard|premium)\s*$/);
|
|
153
|
+
if (tierMatch) {
|
|
154
|
+
hint.modelTier = tierMatch[1];
|
|
155
|
+
i++;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
const effortMatch = hintLine.match(/^modelEffort:\s*(minimal|low|medium|high|xhigh)\s*$/);
|
|
159
|
+
if (effortMatch) {
|
|
160
|
+
hint.modelEffort = effortMatch[1];
|
|
161
|
+
i++;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const rationaleMatch = hintLine.match(/^modelRationale:\s*(.+)$/);
|
|
165
|
+
if (rationaleMatch) {
|
|
166
|
+
hint.modelRationale = rationaleMatch[1].trim();
|
|
167
|
+
i++;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const catMatch = hintLine.match(/^category:\s*(.+)/);
|
|
171
|
+
if (catMatch) {
|
|
172
|
+
hint.category = catMatch[1].trim();
|
|
173
|
+
i++;
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const orchMatch = hintLine.match(/^orchestration:\s*(true|false)/i);
|
|
177
|
+
if (orchMatch) {
|
|
178
|
+
hint.orchestration = orchMatch[1].toLowerCase() === 'true';
|
|
179
|
+
i++;
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const cliMatch = hintLine.match(/^cliDisabled:\s*(true|false)/i);
|
|
183
|
+
if (cliMatch) {
|
|
184
|
+
hint.cliDisabled = cliMatch[1].toLowerCase() === 'true';
|
|
185
|
+
i++;
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
i++;
|
|
189
|
+
}
|
|
190
|
+
frontmatter.commandHint = hint;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
i++;
|
|
194
|
+
}
|
|
195
|
+
return { frontmatter, body };
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=skill-command-frontmatter.js.map
|