agent-nuvira 3.3.13 → 3.3.15
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/README.md +67 -1
- package/dist/agents/agents/planner.d.ts.map +1 -1
- package/dist/agents/agents/planner.js +9 -0
- package/dist/agents/agents/planner.js.map +1 -1
- package/dist/agents/orchestrator.d.ts +31 -0
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +74 -126
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/cli/chat.d.ts +89 -0
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +765 -33
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/cli-program.d.ts.map +1 -1
- package/dist/cli/cli-program.js +12 -0
- package/dist/cli/cli-program.js.map +1 -1
- package/dist/cli/config.d.ts +12 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +86 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/decisions.d.ts +28 -0
- package/dist/cli/decisions.d.ts.map +1 -0
- package/dist/cli/decisions.js +140 -0
- package/dist/cli/decisions.js.map +1 -0
- package/dist/cli/doctor.d.ts +6 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +46 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/failover-runner.d.ts.map +1 -1
- package/dist/cli/failover-runner.js +19 -1
- package/dist/cli/failover-runner.js.map +1 -1
- package/dist/cli/feedback.d.ts.map +1 -1
- package/dist/cli/feedback.js +5 -1
- package/dist/cli/feedback.js.map +1 -1
- package/dist/cli/hooks.d.ts +30 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +224 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/knowledge.d.ts +9 -1
- package/dist/cli/knowledge.d.ts.map +1 -1
- package/dist/cli/knowledge.js +93 -2
- package/dist/cli/knowledge.js.map +1 -1
- package/dist/cli/loop-executor.d.ts.map +1 -1
- package/dist/cli/loop-executor.js +47 -12
- package/dist/cli/loop-executor.js.map +1 -1
- package/dist/cli/model.d.ts +20 -0
- package/dist/cli/model.d.ts.map +1 -1
- package/dist/cli/model.js +294 -14
- package/dist/cli/model.js.map +1 -1
- package/dist/cli/rate.d.ts +78 -0
- package/dist/cli/rate.d.ts.map +1 -0
- package/dist/cli/rate.js +294 -0
- package/dist/cli/rate.js.map +1 -0
- package/dist/config/process-env.d.ts.map +1 -1
- package/dist/config/process-env.js +10 -0
- package/dist/config/process-env.js.map +1 -1
- package/dist/enterprise/vault.d.ts.map +1 -1
- package/dist/enterprise/vault.js +5 -21
- package/dist/enterprise/vault.js.map +1 -1
- package/dist/gateway/hook-contract.d.ts +33 -0
- package/dist/gateway/hook-contract.d.ts.map +1 -1
- package/dist/gateway/hook-contract.js +97 -0
- package/dist/gateway/hook-contract.js.map +1 -1
- package/dist/inference/gemini-adapter.d.ts.map +1 -1
- package/dist/inference/gemini-adapter.js +4 -0
- package/dist/inference/gemini-adapter.js.map +1 -1
- package/dist/inference/interface.d.ts +37 -0
- package/dist/inference/interface.d.ts.map +1 -1
- package/dist/inference/native-tools.d.ts +16 -1
- package/dist/inference/native-tools.d.ts.map +1 -1
- package/dist/inference/native-tools.js +34 -10
- package/dist/inference/native-tools.js.map +1 -1
- package/dist/inference/route-resolver.d.ts +30 -0
- package/dist/inference/route-resolver.d.ts.map +1 -1
- package/dist/inference/route-resolver.js +158 -1
- package/dist/inference/route-resolver.js.map +1 -1
- package/dist/inference/tools.d.ts +16 -1
- package/dist/inference/tools.d.ts.map +1 -1
- package/dist/inference/tools.js +51 -18
- package/dist/inference/tools.js.map +1 -1
- package/dist/learning/acceptance-model.d.ts +247 -0
- package/dist/learning/acceptance-model.d.ts.map +1 -0
- package/dist/learning/acceptance-model.js +708 -0
- package/dist/learning/acceptance-model.js.map +1 -0
- package/dist/learning/auto-router.d.ts +68 -24
- package/dist/learning/auto-router.d.ts.map +1 -1
- package/dist/learning/auto-router.js +301 -96
- package/dist/learning/auto-router.js.map +1 -1
- package/dist/learning/autonomy-policy.d.ts +12 -16
- package/dist/learning/autonomy-policy.d.ts.map +1 -1
- package/dist/learning/autonomy-policy.js +50 -48
- package/dist/learning/autonomy-policy.js.map +1 -1
- package/dist/learning/behavioural-labels.d.ts +86 -0
- package/dist/learning/behavioural-labels.d.ts.map +1 -0
- package/dist/learning/behavioural-labels.js +166 -0
- package/dist/learning/behavioural-labels.js.map +1 -0
- package/dist/learning/capability-evidence.d.ts +167 -0
- package/dist/learning/capability-evidence.d.ts.map +1 -0
- package/dist/learning/capability-evidence.js +210 -0
- package/dist/learning/capability-evidence.js.map +1 -0
- package/dist/learning/capability-readiness.d.ts +64 -0
- package/dist/learning/capability-readiness.d.ts.map +1 -0
- package/dist/learning/capability-readiness.js +74 -0
- package/dist/learning/capability-readiness.js.map +1 -0
- package/dist/learning/capability-types.d.ts +169 -0
- package/dist/learning/capability-types.d.ts.map +1 -0
- package/dist/learning/capability-types.js +20 -0
- package/dist/learning/capability-types.js.map +1 -0
- package/dist/learning/catalog-feed.d.ts +89 -0
- package/dist/learning/catalog-feed.d.ts.map +1 -0
- package/dist/learning/catalog-feed.js +211 -0
- package/dist/learning/catalog-feed.js.map +1 -0
- package/dist/learning/cli-intent-effects.d.ts +60 -0
- package/dist/learning/cli-intent-effects.d.ts.map +1 -0
- package/dist/learning/cli-intent-effects.js +153 -0
- package/dist/learning/cli-intent-effects.js.map +1 -0
- package/dist/learning/command-adaptation.d.ts +41 -0
- package/dist/learning/command-adaptation.d.ts.map +1 -0
- package/dist/learning/command-adaptation.js +122 -0
- package/dist/learning/command-adaptation.js.map +1 -0
- package/dist/learning/consent-picture.d.ts +42 -0
- package/dist/learning/consent-picture.d.ts.map +1 -0
- package/dist/learning/consent-picture.js +53 -0
- package/dist/learning/consent-picture.js.map +1 -0
- package/dist/learning/context-budget.d.ts +37 -6
- package/dist/learning/context-budget.d.ts.map +1 -1
- package/dist/learning/context-budget.js +38 -9
- package/dist/learning/context-budget.js.map +1 -1
- package/dist/learning/decision-log.d.ts +114 -0
- package/dist/learning/decision-log.d.ts.map +1 -0
- package/dist/learning/decision-log.js +296 -0
- package/dist/learning/decision-log.js.map +1 -0
- package/dist/learning/deliverable-class.d.ts.map +1 -1
- package/dist/learning/deliverable-class.js +19 -0
- package/dist/learning/deliverable-class.js.map +1 -1
- package/dist/learning/deliverable-corpus.d.ts +117 -0
- package/dist/learning/deliverable-corpus.d.ts.map +1 -0
- package/dist/learning/deliverable-corpus.js +176 -0
- package/dist/learning/deliverable-corpus.js.map +1 -0
- package/dist/learning/error-repair.d.ts +22 -1
- package/dist/learning/error-repair.d.ts.map +1 -1
- package/dist/learning/error-repair.js +37 -0
- package/dist/learning/error-repair.js.map +1 -1
- package/dist/learning/exhaustion-report.d.ts +136 -0
- package/dist/learning/exhaustion-report.d.ts.map +1 -0
- package/dist/learning/exhaustion-report.js +239 -0
- package/dist/learning/exhaustion-report.js.map +1 -0
- package/dist/learning/failure-bookkeeping.d.ts +16 -0
- package/dist/learning/failure-bookkeeping.d.ts.map +1 -1
- package/dist/learning/failure-bookkeeping.js +51 -5
- package/dist/learning/failure-bookkeeping.js.map +1 -1
- package/dist/learning/gate-friction.d.ts +39 -0
- package/dist/learning/gate-friction.d.ts.map +1 -0
- package/dist/learning/gate-friction.js +91 -0
- package/dist/learning/gate-friction.js.map +1 -0
- package/dist/learning/harness-narration.d.ts +34 -0
- package/dist/learning/harness-narration.d.ts.map +1 -0
- package/dist/learning/harness-narration.js +58 -0
- package/dist/learning/harness-narration.js.map +1 -0
- package/dist/learning/hub-skill-catalog.d.ts.map +1 -1
- package/dist/learning/hub-skill-catalog.js +1 -2
- package/dist/learning/hub-skill-catalog.js.map +1 -1
- package/dist/learning/hybrid-router.d.ts +65 -0
- package/dist/learning/hybrid-router.d.ts.map +1 -1
- package/dist/learning/hybrid-router.js +186 -0
- package/dist/learning/hybrid-router.js.map +1 -1
- package/dist/learning/knowledge-base.d.ts +229 -3
- package/dist/learning/knowledge-base.d.ts.map +1 -1
- package/dist/learning/knowledge-base.js +603 -25
- package/dist/learning/knowledge-base.js.map +1 -1
- package/dist/learning/knowledge-eval.d.ts +171 -0
- package/dist/learning/knowledge-eval.d.ts.map +1 -0
- package/dist/learning/knowledge-eval.js +196 -0
- package/dist/learning/knowledge-eval.js.map +1 -0
- package/dist/learning/knowledge-turn.d.ts +92 -0
- package/dist/learning/knowledge-turn.d.ts.map +1 -0
- package/dist/learning/knowledge-turn.js +190 -0
- package/dist/learning/knowledge-turn.js.map +1 -0
- package/dist/learning/learned-commands.d.ts +64 -0
- package/dist/learning/learned-commands.d.ts.map +1 -0
- package/dist/learning/learned-commands.js +108 -0
- package/dist/learning/learned-commands.js.map +1 -0
- package/dist/learning/lexical-search.d.ts +50 -0
- package/dist/learning/lexical-search.d.ts.map +1 -0
- package/dist/learning/lexical-search.js +111 -0
- package/dist/learning/lexical-search.js.map +1 -0
- package/dist/learning/machine-facts.d.ts +71 -0
- package/dist/learning/machine-facts.d.ts.map +1 -0
- package/dist/learning/machine-facts.js +164 -0
- package/dist/learning/machine-facts.js.map +1 -0
- package/dist/learning/markdown-outline.d.ts +73 -0
- package/dist/learning/markdown-outline.d.ts.map +1 -0
- package/dist/learning/markdown-outline.js +136 -0
- package/dist/learning/markdown-outline.js.map +1 -0
- package/dist/learning/model-first-router.d.ts +33 -1
- package/dist/learning/model-first-router.d.ts.map +1 -1
- package/dist/learning/model-first-router.js +123 -9
- package/dist/learning/model-first-router.js.map +1 -1
- package/dist/learning/model-identity.d.ts +80 -0
- package/dist/learning/model-identity.d.ts.map +1 -0
- package/dist/learning/model-identity.js +115 -0
- package/dist/learning/model-identity.js.map +1 -0
- package/dist/learning/model-registry.d.ts +141 -2
- package/dist/learning/model-registry.d.ts.map +1 -1
- package/dist/learning/model-registry.js +324 -38
- package/dist/learning/model-registry.js.map +1 -1
- package/dist/learning/model-scoring.d.ts.map +1 -1
- package/dist/learning/model-scoring.js +8 -1
- package/dist/learning/model-scoring.js.map +1 -1
- package/dist/learning/model-selection.d.ts.map +1 -1
- package/dist/learning/model-selection.js +41 -0
- package/dist/learning/model-selection.js.map +1 -1
- package/dist/learning/outcome-observation.d.ts +49 -0
- package/dist/learning/outcome-observation.d.ts.map +1 -0
- package/dist/learning/outcome-observation.js +95 -0
- package/dist/learning/outcome-observation.js.map +1 -0
- package/dist/learning/pair-entitlement.d.ts +184 -0
- package/dist/learning/pair-entitlement.d.ts.map +1 -0
- package/dist/learning/pair-entitlement.js +214 -0
- package/dist/learning/pair-entitlement.js.map +1 -0
- package/dist/learning/provider-fallback.d.ts +23 -1
- package/dist/learning/provider-fallback.d.ts.map +1 -1
- package/dist/learning/provider-fallback.js +24 -0
- package/dist/learning/provider-fallback.js.map +1 -1
- package/dist/learning/reasoning-trace.d.ts +65 -1
- package/dist/learning/reasoning-trace.d.ts.map +1 -1
- package/dist/learning/reasoning-trace.js +123 -1
- package/dist/learning/reasoning-trace.js.map +1 -1
- package/dist/learning/requirement-probe.d.ts +55 -0
- package/dist/learning/requirement-probe.d.ts.map +1 -0
- package/dist/learning/requirement-probe.js +77 -0
- package/dist/learning/requirement-probe.js.map +1 -0
- package/dist/learning/resilient-call.d.ts +20 -1
- package/dist/learning/resilient-call.d.ts.map +1 -1
- package/dist/learning/resilient-call.js +42 -4
- package/dist/learning/resilient-call.js.map +1 -1
- package/dist/learning/response-usability.d.ts +85 -0
- package/dist/learning/response-usability.d.ts.map +1 -0
- package/dist/learning/response-usability.js +135 -0
- package/dist/learning/response-usability.js.map +1 -0
- package/dist/learning/router-bandit.d.ts +132 -0
- package/dist/learning/router-bandit.d.ts.map +1 -1
- package/dist/learning/router-bandit.js +253 -0
- package/dist/learning/router-bandit.js.map +1 -1
- package/dist/learning/routing-history.d.ts +41 -2
- package/dist/learning/routing-history.d.ts.map +1 -1
- package/dist/learning/routing-history.js.map +1 -1
- package/dist/learning/run-trace.d.ts +21 -0
- package/dist/learning/run-trace.d.ts.map +1 -1
- package/dist/learning/run-trace.js +38 -0
- package/dist/learning/run-trace.js.map +1 -1
- package/dist/learning/session-grant.d.ts +75 -0
- package/dist/learning/session-grant.d.ts.map +1 -0
- package/dist/learning/session-grant.js +112 -0
- package/dist/learning/session-grant.js.map +1 -0
- package/dist/learning/task-model-continuity.d.ts +73 -0
- package/dist/learning/task-model-continuity.d.ts.map +1 -0
- package/dist/learning/task-model-continuity.js +87 -0
- package/dist/learning/task-model-continuity.js.map +1 -0
- package/dist/learning/turn-feedback.d.ts +93 -0
- package/dist/learning/turn-feedback.d.ts.map +1 -0
- package/dist/learning/turn-feedback.js +127 -0
- package/dist/learning/turn-feedback.js.map +1 -0
- package/dist/learning/turn-report.d.ts +104 -2
- package/dist/learning/turn-report.d.ts.map +1 -1
- package/dist/learning/turn-report.js +161 -6
- package/dist/learning/turn-report.js.map +1 -1
- package/dist/learning/verdict-routing.d.ts +51 -0
- package/dist/learning/verdict-routing.d.ts.map +1 -0
- package/dist/learning/verdict-routing.js +122 -0
- package/dist/learning/verdict-routing.js.map +1 -0
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +5 -0
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/manager.d.ts +10 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +20 -0
- package/dist/mcp/manager.js.map +1 -1
- package/dist/mcp/mcp-discovery.d.ts +34 -0
- package/dist/mcp/mcp-discovery.d.ts.map +1 -0
- package/dist/mcp/mcp-discovery.js +71 -0
- package/dist/mcp/mcp-discovery.js.map +1 -0
- package/dist/mcp/mcp-schema-cache.d.ts +17 -0
- package/dist/mcp/mcp-schema-cache.d.ts.map +1 -1
- package/dist/mcp/mcp-schema-cache.js +47 -3
- package/dist/mcp/mcp-schema-cache.js.map +1 -1
- package/dist/mcp/types.d.ts +28 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js.map +1 -1
- package/dist/parity/drivers.d.ts.map +1 -1
- package/dist/parity/drivers.js +3 -0
- package/dist/parity/drivers.js.map +1 -1
- package/dist/parity/observation.d.ts +12 -0
- package/dist/parity/observation.d.ts.map +1 -1
- package/dist/parity/observation.js +14 -0
- package/dist/parity/observation.js.map +1 -1
- package/dist/tools/ask-user.d.ts.map +1 -1
- package/dist/tools/ask-user.js +4 -0
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/capability-registry.d.ts +150 -0
- package/dist/tools/capability-registry.d.ts.map +1 -0
- package/dist/tools/capability-registry.js +400 -0
- package/dist/tools/capability-registry.js.map +1 -0
- package/dist/tools/child-agent-runtime.d.ts.map +1 -1
- package/dist/tools/child-agent-runtime.js +19 -5
- package/dist/tools/child-agent-runtime.js.map +1 -1
- package/dist/tools/coding-tools.d.ts +17 -5
- package/dist/tools/coding-tools.d.ts.map +1 -1
- package/dist/tools/coding-tools.js +80 -11
- package/dist/tools/coding-tools.js.map +1 -1
- package/dist/tools/command-memo.d.ts +116 -0
- package/dist/tools/command-memo.d.ts.map +1 -0
- package/dist/tools/command-memo.js +202 -0
- package/dist/tools/command-memo.js.map +1 -0
- package/dist/tools/git-tool.d.ts.map +1 -1
- package/dist/tools/git-tool.js +13 -3
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/tools/harness-directive.d.ts +42 -0
- package/dist/tools/harness-directive.d.ts.map +1 -0
- package/dist/tools/harness-directive.js +45 -0
- package/dist/tools/harness-directive.js.map +1 -0
- package/dist/tools/loop-skill-hint.d.ts +74 -174
- package/dist/tools/loop-skill-hint.d.ts.map +1 -1
- package/dist/tools/loop-skill-hint.js +110 -536
- package/dist/tools/loop-skill-hint.js.map +1 -1
- package/dist/tools/mcp-client-tool.d.ts +2 -0
- package/dist/tools/mcp-client-tool.d.ts.map +1 -1
- package/dist/tools/mcp-client-tool.js +3 -0
- package/dist/tools/mcp-client-tool.js.map +1 -1
- package/dist/tools/modality/shared.d.ts +1 -4
- package/dist/tools/modality/shared.d.ts.map +1 -1
- package/dist/tools/modality/shared.js +7 -22
- package/dist/tools/modality/shared.js.map +1 -1
- package/dist/tools/plan-store.d.ts +20 -2
- package/dist/tools/plan-store.d.ts.map +1 -1
- package/dist/tools/plan-store.js +51 -7
- package/dist/tools/plan-store.js.map +1 -1
- package/dist/tools/registry.d.ts +76 -3
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +486 -26
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/remediation-ladder.d.ts.map +1 -1
- package/dist/tools/remediation-ladder.js +8 -0
- package/dist/tools/remediation-ladder.js.map +1 -1
- package/dist/tools/run-cli.d.ts.map +1 -1
- package/dist/tools/run-cli.js +29 -4
- package/dist/tools/run-cli.js.map +1 -1
- package/dist/tools/run-terminal.d.ts +11 -0
- package/dist/tools/run-terminal.d.ts.map +1 -1
- package/dist/tools/run-terminal.js +265 -10
- package/dist/tools/run-terminal.js.map +1 -1
- package/dist/tools/tool-loop.d.ts +321 -13
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +867 -66
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/utils/atomic-store.d.ts +53 -0
- package/dist/utils/atomic-store.d.ts.map +1 -0
- package/dist/utils/atomic-store.js +178 -0
- package/dist/utils/atomic-store.js.map +1 -0
- package/dist/utils/binary-probe.d.ts +25 -0
- package/dist/utils/binary-probe.d.ts.map +1 -0
- package/dist/utils/binary-probe.js +48 -0
- package/dist/utils/binary-probe.js.map +1 -0
- package/dist/utils/workspace-path.d.ts +50 -0
- package/dist/utils/workspace-path.d.ts.map +1 -0
- package/dist/utils/workspace-path.js +86 -0
- package/dist/utils/workspace-path.js.map +1 -0
- package/dist/web-dashboard/chat-console.d.ts +24 -0
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js +38 -0
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/project-context.d.ts +27 -2
- package/dist/web-dashboard/project-context.d.ts.map +1 -1
- package/dist/web-dashboard/project-context.js +32 -2
- package/dist/web-dashboard/project-context.js.map +1 -1
- package/dist/web-dashboard/server.d.ts +11 -0
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +362 -11
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +170 -1
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/dist/web-dashboard/workspace-guard.d.ts +11 -2
- package/dist/web-dashboard/workspace-guard.d.ts.map +1 -1
- package/dist/web-dashboard/workspace-guard.js +24 -12
- package/dist/web-dashboard/workspace-guard.js.map +1 -1
- package/dist/web-dashboard/workspace-resolution.d.ts +87 -0
- package/dist/web-dashboard/workspace-resolution.d.ts.map +1 -0
- package/dist/web-dashboard/workspace-resolution.js +105 -0
- package/dist/web-dashboard/workspace-resolution.js.map +1 -0
- package/package.json +1 -1
- package/src/web-dashboard/public/assets/index-zjbdJnO-.js +210 -0
- package/src/web-dashboard/public/assets/index-zjbdJnO-.js.map +1 -0
- package/src/web-dashboard/public/index.html +1 -1
- package/dist/agents/nvda-addon.d.ts +0 -14
- package/dist/agents/nvda-addon.js +0 -52
- package/dist/forwarded.d.ts +0 -2
- package/dist/forwarded.js +0 -2
- package/src/web-dashboard/public/assets/index-DhiuR4S2.js +0 -210
- package/src/web-dashboard/public/assets/index-DhiuR4S2.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-feed.js","sourceRoot":"","sources":["../../src/learning/catalog-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,0B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EAAE,CAAC;QAC9E,MAAM,KAAK,GAAG,gBAAgB,CAAC,YAAY,EAAE;YAC3C,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,WAAW,EAAE,GAAG,CAAC,WAAW;SAC7B,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC;YACV,GAAG,IAAI;YACP,SAAS,EAAE,MAAM;YACjB,KAAK;YACL,KAAK,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;SACpF,CAAC,CAAC;IACL,CAAC;IAED,qGAAqG;IACrG,sGAAsG;IACtG,gEAAgE;IAChE,IAAI,GAAG,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvC,MAAM,QAAQ,GAAG,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,aAAa,CAAC,CAAC;QAC3F,MAAM,CAAC,IAAI,CAAC;YACV,GAAG,IAAI;YACP,SAAS,EAAE,WAAW;YACtB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,6BAA6B;YAC5E,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,sCAAsC;SAC/F,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effect declarations for nuvira's OWN confirmation-gated CLI intents.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS REPLACES THREE SETS. `autonomy-policy.ts` carried
|
|
5
|
+
* `IRREVERSIBLE_CLI_INTENTS`, `RECOVERABLE_CLI_INTENTS` and
|
|
6
|
+
* `EXTERNAL_CLI_INTENTS`. Membership was the ONLY fact each set carried, so "is it
|
|
7
|
+
* reversible", "does its effect leave the machine" and "may a grant cover it" all
|
|
8
|
+
* had to be re-derived by whoever read the call site.
|
|
9
|
+
*
|
|
10
|
+
* The two halves now agree BY CONSTRUCTION: this table declares each intent, and a
|
|
11
|
+
* test asserts the declarations and the manifest's confirmation-gated intents are
|
|
12
|
+
* the SAME set — so a newly gated command cannot ship without an effect, and a
|
|
13
|
+
* removed one cannot leave a ghost.
|
|
14
|
+
*
|
|
15
|
+
* THE TRAP THE GUARD EXISTS FOR. `command-manifest.json` expresses gating in TWO
|
|
16
|
+
* places: an intent's own `confirmation`, and `resolutions[].confirmation` for a
|
|
17
|
+
* specific resolution of an intent. `contacts.remove` is gated ONLY through the
|
|
18
|
+
* second, so a reader (or a parity check) that looks at the top-level flag alone
|
|
19
|
+
* concludes it is a ghost and deletes it — which is what nearly happened while
|
|
20
|
+
* building this table. The guard checks both forms.
|
|
21
|
+
*
|
|
22
|
+
* NOT A POLICY CHANGE. This moves an existing decision into one table; every
|
|
23
|
+
* `grantCategory` and `reversible` below is what `run_cli` already computed
|
|
24
|
+
* (external for publish, terminal for the recoverable system intents, nothing for
|
|
25
|
+
* the irreversible local ones). Anything that would genuinely change gating
|
|
26
|
+
* belongs in its own commit, not folded into a refactor.
|
|
27
|
+
*/
|
|
28
|
+
import type { EffectClass, GrantCategory } from './capability-types.js';
|
|
29
|
+
export interface CliIntentEffect {
|
|
30
|
+
/** Matches an intent in `command-manifest.json` exactly. */
|
|
31
|
+
intent: string;
|
|
32
|
+
effectClass: EffectClass;
|
|
33
|
+
/** Can re-running the agent undo it? */
|
|
34
|
+
reversible: boolean;
|
|
35
|
+
/** The session grant that may cover it (absent = NO grant can). */
|
|
36
|
+
grantCategory?: GrantCategory;
|
|
37
|
+
/** One sentence for a reader: why this verdict is what it is. */
|
|
38
|
+
why: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const CLI_INTENT_EFFECTS: readonly CliIntentEffect[];
|
|
41
|
+
/** The declaration for an intent, or undefined when it is not declared. */
|
|
42
|
+
export declare function cliIntentEffect(intent: string): CliIntentEffect | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* The derived gate facts for an intent — computed in ONE place so `run_cli`, the
|
|
45
|
+
* policy and the consent picture cannot each derive them differently.
|
|
46
|
+
*/
|
|
47
|
+
export interface CliIntentGateFacts {
|
|
48
|
+
/** The declaration, when the intent has one. */
|
|
49
|
+
effect?: CliIntentEffect;
|
|
50
|
+
/** A local-state change the envelope may cover and a `terminal` grant may cover. */
|
|
51
|
+
recoverable: boolean;
|
|
52
|
+
/** An off-machine effect, coverable only by the `external` grant. */
|
|
53
|
+
external: boolean;
|
|
54
|
+
/** The grant category that may cover it, when one can. */
|
|
55
|
+
grantCategory?: GrantCategory;
|
|
56
|
+
}
|
|
57
|
+
export declare function cliIntentGateFacts(intent: string): CliIntentGateFacts;
|
|
58
|
+
/** The declared intents, for the manifest parity guard and the consent picture. */
|
|
59
|
+
export declare function declaredCliIntents(): string[];
|
|
60
|
+
//# sourceMappingURL=cli-intent-effects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-intent-effects.d.ts","sourceRoot":"","sources":["../../src/learning/cli-intent-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,wCAAwC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;CACb;AAID,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAoGxD,CAAC;AAIF,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAE3E;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,oFAAoF;IACpF,WAAW,EAAE,OAAO,CAAC;IACrB,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB,CAarE;AAED,mFAAmF;AACnF,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effect declarations for nuvira's OWN confirmation-gated CLI intents.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS REPLACES THREE SETS. `autonomy-policy.ts` carried
|
|
5
|
+
* `IRREVERSIBLE_CLI_INTENTS`, `RECOVERABLE_CLI_INTENTS` and
|
|
6
|
+
* `EXTERNAL_CLI_INTENTS`. Membership was the ONLY fact each set carried, so "is it
|
|
7
|
+
* reversible", "does its effect leave the machine" and "may a grant cover it" all
|
|
8
|
+
* had to be re-derived by whoever read the call site.
|
|
9
|
+
*
|
|
10
|
+
* The two halves now agree BY CONSTRUCTION: this table declares each intent, and a
|
|
11
|
+
* test asserts the declarations and the manifest's confirmation-gated intents are
|
|
12
|
+
* the SAME set — so a newly gated command cannot ship without an effect, and a
|
|
13
|
+
* removed one cannot leave a ghost.
|
|
14
|
+
*
|
|
15
|
+
* THE TRAP THE GUARD EXISTS FOR. `command-manifest.json` expresses gating in TWO
|
|
16
|
+
* places: an intent's own `confirmation`, and `resolutions[].confirmation` for a
|
|
17
|
+
* specific resolution of an intent. `contacts.remove` is gated ONLY through the
|
|
18
|
+
* second, so a reader (or a parity check) that looks at the top-level flag alone
|
|
19
|
+
* concludes it is a ghost and deletes it — which is what nearly happened while
|
|
20
|
+
* building this table. The guard checks both forms.
|
|
21
|
+
*
|
|
22
|
+
* NOT A POLICY CHANGE. This moves an existing decision into one table; every
|
|
23
|
+
* `grantCategory` and `reversible` below is what `run_cli` already computed
|
|
24
|
+
* (external for publish, terminal for the recoverable system intents, nothing for
|
|
25
|
+
* the irreversible local ones). Anything that would genuinely change gating
|
|
26
|
+
* belongs in its own commit, not folded into a refactor.
|
|
27
|
+
*/
|
|
28
|
+
const T = 'terminal';
|
|
29
|
+
export const CLI_INTENT_EFFECTS = [
|
|
30
|
+
// ── irreversible local: no grant may cover these, ever ──
|
|
31
|
+
{
|
|
32
|
+
intent: 'history.clear',
|
|
33
|
+
effectClass: 'local-state',
|
|
34
|
+
reversible: false,
|
|
35
|
+
why: 'the conversation history is discarded; nothing re-runs it back',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
intent: 'memory.prune',
|
|
39
|
+
effectClass: 'local-state',
|
|
40
|
+
reversible: false,
|
|
41
|
+
why: 'memories below the threshold are gone, and re-running cannot know which they were',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
intent: 'stats.cost.clear',
|
|
45
|
+
effectClass: 'local-state',
|
|
46
|
+
reversible: false,
|
|
47
|
+
why: 'cost history is zeroed; the spends are not re-derivable',
|
|
48
|
+
},
|
|
49
|
+
// ── off-machine: grantable ONLY by an explicit off-machine grant ──
|
|
50
|
+
{
|
|
51
|
+
intent: 'publish',
|
|
52
|
+
effectClass: 'external',
|
|
53
|
+
reversible: false,
|
|
54
|
+
grantCategory: 'external',
|
|
55
|
+
why: 'a registry release leaves this machine and cannot be un-published',
|
|
56
|
+
},
|
|
57
|
+
// ── recoverable system intents: re-running the agent can put them back ──
|
|
58
|
+
{
|
|
59
|
+
intent: 'dashboard.stop',
|
|
60
|
+
effectClass: 'local-state',
|
|
61
|
+
reversible: true,
|
|
62
|
+
grantCategory: T,
|
|
63
|
+
why: 'a stopped service starts again',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
intent: 'gateway.stop',
|
|
67
|
+
effectClass: 'local-state',
|
|
68
|
+
reversible: true,
|
|
69
|
+
grantCategory: T,
|
|
70
|
+
why: 'a stopped gateway starts again',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
intent: 'permissions.disallow',
|
|
74
|
+
effectClass: 'local-state',
|
|
75
|
+
reversible: true,
|
|
76
|
+
grantCategory: T,
|
|
77
|
+
why: 'a removed RBAC grant is re-added by the matching allow',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
intent: 'platform.remove',
|
|
81
|
+
effectClass: 'local-state',
|
|
82
|
+
reversible: true,
|
|
83
|
+
grantCategory: T,
|
|
84
|
+
why: 'a removed platform is re-added from the same config',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
intent: 'health.selfheal',
|
|
88
|
+
effectClass: 'local-state',
|
|
89
|
+
reversible: true,
|
|
90
|
+
grantCategory: T,
|
|
91
|
+
why: 'it applies fixes the doctor already diagnosed, and re-running is idempotent',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
intent: 'memory.optimize',
|
|
95
|
+
effectClass: 'local-state',
|
|
96
|
+
reversible: true,
|
|
97
|
+
grantCategory: T,
|
|
98
|
+
why: 'it re-ranks and compacts memory; running it again converges',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
intent: 'cache.clear',
|
|
102
|
+
effectClass: 'local-state',
|
|
103
|
+
reversible: true,
|
|
104
|
+
grantCategory: T,
|
|
105
|
+
why: 'a cache rebuilds itself on the next use',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
intent: 'cron.remove',
|
|
109
|
+
effectClass: 'local-state',
|
|
110
|
+
reversible: true,
|
|
111
|
+
grantCategory: T,
|
|
112
|
+
why: 'a removed job is re-added with the same schedule',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
intent: 'skills.uninstall',
|
|
116
|
+
effectClass: 'local-state',
|
|
117
|
+
reversible: true,
|
|
118
|
+
grantCategory: T,
|
|
119
|
+
why: 'an uninstalled skill reinstalls from the hub',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
// Gated through a RESOLUTION, not the intent's own flag — see the header.
|
|
123
|
+
intent: 'contacts.remove',
|
|
124
|
+
effectClass: 'local-state',
|
|
125
|
+
reversible: true,
|
|
126
|
+
grantCategory: T,
|
|
127
|
+
why: 'a removed contact is re-added from the same config',
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
const BY_INTENT = new Map(CLI_INTENT_EFFECTS.map((e) => [e.intent, e]));
|
|
131
|
+
/** The declaration for an intent, or undefined when it is not declared. */
|
|
132
|
+
export function cliIntentEffect(intent) {
|
|
133
|
+
return BY_INTENT.get(intent);
|
|
134
|
+
}
|
|
135
|
+
export function cliIntentGateFacts(intent) {
|
|
136
|
+
const effect = BY_INTENT.get(intent);
|
|
137
|
+
const external = effect?.grantCategory === 'external';
|
|
138
|
+
// NOTE the order: an external intent is NEVER "recoverable", even though
|
|
139
|
+
// `publish` is the one declaration that is both irreversible and off-machine.
|
|
140
|
+
// That is what keeps a blanket request from ever reaching it.
|
|
141
|
+
const recoverable = effect?.reversible === true && !external;
|
|
142
|
+
return {
|
|
143
|
+
...(effect ? { effect } : {}),
|
|
144
|
+
recoverable,
|
|
145
|
+
external,
|
|
146
|
+
...(effect?.grantCategory ? { grantCategory: effect.grantCategory } : {}),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** The declared intents, for the manifest parity guard and the consent picture. */
|
|
150
|
+
export function declaredCliIntents() {
|
|
151
|
+
return CLI_INTENT_EFFECTS.map((e) => e.intent);
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=cli-intent-effects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-intent-effects.js","sourceRoot":"","sources":["../../src/learning/cli-intent-effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAgBH,MAAM,CA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AAM,WAAW,GAAG,MAAM,EAAE,UAAU,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC;IAC7D,OAAO;QACL,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,WAAW;QACX,QAAQ;QACR,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,kBAAkB;IAChC,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command adaptation — the "run → adapt" half of the long-tail loop.
|
|
3
|
+
*
|
|
4
|
+
* When a command fails because an executable is not on this machine, the failure
|
|
5
|
+
* is not the end of the turn: it is the point at which the model should CHOOSE a
|
|
6
|
+
* command for this machine (or check one against it) instead of assuming. These
|
|
7
|
+
* helpers turn that OS signal into a bounded, factual note appended to the tool
|
|
8
|
+
* result.
|
|
9
|
+
*
|
|
10
|
+
* KEYED ON THE SHELL'S OWN SIGNAL, not on wording in the model's prose: a missing
|
|
11
|
+
* command is exit 127 (POSIX) or 9009 (cmd.exe), and the stderr text is used only
|
|
12
|
+
* as a secondary signal. That is why this is not a phrase list — it is the shell
|
|
13
|
+
* reporting the one thing it already knows.
|
|
14
|
+
*/
|
|
15
|
+
import { type MachineFacts } from './machine-facts.js';
|
|
16
|
+
/**
|
|
17
|
+
* The first executable-looking token of a command line, skipping env assignments
|
|
18
|
+
* (`FOO=bar`) and leading flags. Returns null when the line does not start with a
|
|
19
|
+
* plain executable (e.g. a shell builtin chain or a quoted blob).
|
|
20
|
+
*/
|
|
21
|
+
export declare function leadingBinary(command: string): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Did this tool output describe a MISSING COMMAND? The primary signals are the
|
|
24
|
+
* shell's own exit codes (127 = POSIX "command not found", 9009 = cmd.exe); the
|
|
25
|
+
* stderr wordings are a fallback for shells that exit otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isMissingBinaryFailure(output: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The install command to suggest for `tool`, using the FIRST package manager
|
|
30
|
+
* that is ACTUALLY PRESENT here (machine facts lists only present managers, in
|
|
31
|
+
* OS-native-first order). Returns null when nothing present can install it.
|
|
32
|
+
*
|
|
33
|
+
* This is why `resolve` prefers a present manager rather than naming a manager
|
|
34
|
+
* the machine does not have: the suggestion is buildable from what exists.
|
|
35
|
+
*/
|
|
36
|
+
export declare function suggestInstallCommand(facts: MachineFacts, tool: string): {
|
|
37
|
+
manager: string;
|
|
38
|
+
command: string;
|
|
39
|
+
} | null;
|
|
40
|
+
export declare function buildMissingBinaryNote(command?: string): string;
|
|
41
|
+
//# sourceMappingURL=command-adaptation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-adaptation.d.ts","sourceRoot":"","sources":["../../src/learning/command-adaptation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS5D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAO9D;AA2CD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,MAAM,GACX;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQ7C;AAED,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAY/D"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command adaptation — the "run → adapt" half of the long-tail loop.
|
|
3
|
+
*
|
|
4
|
+
* When a command fails because an executable is not on this machine, the failure
|
|
5
|
+
* is not the end of the turn: it is the point at which the model should CHOOSE a
|
|
6
|
+
* command for this machine (or check one against it) instead of assuming. These
|
|
7
|
+
* helpers turn that OS signal into a bounded, factual note appended to the tool
|
|
8
|
+
* result.
|
|
9
|
+
*
|
|
10
|
+
* KEYED ON THE SHELL'S OWN SIGNAL, not on wording in the model's prose: a missing
|
|
11
|
+
* command is exit 127 (POSIX) or 9009 (cmd.exe), and the stderr text is used only
|
|
12
|
+
* as a secondary signal. That is why this is not a phrase list — it is the shell
|
|
13
|
+
* reporting the one thing it already knows.
|
|
14
|
+
*/
|
|
15
|
+
import { detectMachineFacts } from './machine-facts.js';
|
|
16
|
+
/**
|
|
17
|
+
* The first executable-looking token of a command line, skipping env assignments
|
|
18
|
+
* (`FOO=bar`) and leading flags. Returns null when the line does not start with a
|
|
19
|
+
* plain executable (e.g. a shell builtin chain or a quoted blob).
|
|
20
|
+
*/
|
|
21
|
+
export function leadingBinary(command) {
|
|
22
|
+
const tokens = String(command ?? '').trim().split(/\s+/);
|
|
23
|
+
for (const token of tokens) {
|
|
24
|
+
if (/^[A-Za-z_][A-Za-z0-9_]*=/.test(token))
|
|
25
|
+
continue; // FOO=bar
|
|
26
|
+
if (token.startsWith('-'))
|
|
27
|
+
continue;
|
|
28
|
+
const name = token.replace(/^["']|["']$/g, '');
|
|
29
|
+
return /^[A-Za-z0-9._/\\-]+$/.test(name) ? name : null;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Did this tool output describe a MISSING COMMAND? The primary signals are the
|
|
35
|
+
* shell's own exit codes (127 = POSIX "command not found", 9009 = cmd.exe); the
|
|
36
|
+
* stderr wordings are a fallback for shells that exit otherwise.
|
|
37
|
+
*/
|
|
38
|
+
export function isMissingBinaryFailure(output) {
|
|
39
|
+
const text = String(output ?? '');
|
|
40
|
+
if (/\(exit 127\)/.test(text))
|
|
41
|
+
return true;
|
|
42
|
+
if (/\(exit 9009\)/.test(text))
|
|
43
|
+
return true;
|
|
44
|
+
if (/command not found/i.test(text))
|
|
45
|
+
return true;
|
|
46
|
+
if (/is not recognized as an internal or external command/i.test(text))
|
|
47
|
+
return true;
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A bounded note telling the model WHERE it is and what is present, so it can
|
|
52
|
+
* adapt the command itself. Names the likely executable when the command line
|
|
53
|
+
* makes it obvious; otherwise stays general, because guessing the wrong token
|
|
54
|
+
* would be its own false claim.
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* How each package manager INSTALLS a tool. This is a fact about the manager
|
|
58
|
+
* (like `npm install` being the same everywhere), not an OS mapping — which is
|
|
59
|
+
* why it lives here and not in the per-OS table.
|
|
60
|
+
*/
|
|
61
|
+
const INSTALL_TEMPLATE = {
|
|
62
|
+
winget: 'winget install <tool>',
|
|
63
|
+
choco: 'choco install <tool>',
|
|
64
|
+
scoop: 'scoop install <tool>',
|
|
65
|
+
brew: 'brew install <tool>',
|
|
66
|
+
port: 'port install <tool>',
|
|
67
|
+
apt: 'apt-get install -y <tool>',
|
|
68
|
+
'apt-get': 'apt-get install -y <tool>',
|
|
69
|
+
dnf: 'dnf install -y <tool>',
|
|
70
|
+
yum: 'yum install -y <tool>',
|
|
71
|
+
pacman: 'pacman -S <tool>',
|
|
72
|
+
zypper: 'zypper install -y <tool>',
|
|
73
|
+
apk: 'apk add <tool>',
|
|
74
|
+
snap: 'snap install <tool>',
|
|
75
|
+
flatpak: 'flatpak install <tool>',
|
|
76
|
+
uv: 'uv tool install <tool>',
|
|
77
|
+
poetry: 'poetry add <tool>',
|
|
78
|
+
pip: 'pip install <tool>',
|
|
79
|
+
pip3: 'pip3 install <tool>',
|
|
80
|
+
npm: 'npm install -g <tool>',
|
|
81
|
+
pnpm: 'pnpm add -g <tool>',
|
|
82
|
+
yarn: 'yarn global add <tool>',
|
|
83
|
+
bun: 'bun add -g <tool>',
|
|
84
|
+
cargo: 'cargo install <tool>',
|
|
85
|
+
go: 'go install <tool>@latest',
|
|
86
|
+
gem: 'gem install <tool>',
|
|
87
|
+
composer: 'composer require <tool>',
|
|
88
|
+
dotnet: 'dotnet tool install -g <tool>',
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The install command to suggest for `tool`, using the FIRST package manager
|
|
92
|
+
* that is ACTUALLY PRESENT here (machine facts lists only present managers, in
|
|
93
|
+
* OS-native-first order). Returns null when nothing present can install it.
|
|
94
|
+
*
|
|
95
|
+
* This is why `resolve` prefers a present manager rather than naming a manager
|
|
96
|
+
* the machine does not have: the suggestion is buildable from what exists.
|
|
97
|
+
*/
|
|
98
|
+
export function suggestInstallCommand(facts, tool) {
|
|
99
|
+
const name = String(tool ?? '').trim();
|
|
100
|
+
if (!name)
|
|
101
|
+
return null;
|
|
102
|
+
for (const manager of facts.packageManagers) {
|
|
103
|
+
const template = INSTALL_TEMPLATE[manager];
|
|
104
|
+
if (template)
|
|
105
|
+
return { manager, command: template.replace('<tool>', name) };
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
export function buildMissingBinaryNote(command) {
|
|
110
|
+
const facts = detectMachineFacts();
|
|
111
|
+
const bin = command ? leadingBinary(command) : null;
|
|
112
|
+
const managers = facts.packageManagers.length > 0 ? facts.packageManagers.join(', ') : '(none detected)';
|
|
113
|
+
return [
|
|
114
|
+
'',
|
|
115
|
+
'⚠️ A command here was not found on this machine.',
|
|
116
|
+
...(bin ? [`\`${bin}\` is not on PATH.`] : []),
|
|
117
|
+
`This machine: ${facts.osName} · shell ${facts.shellName ?? 'unknown'}.`,
|
|
118
|
+
`Package managers present: ${managers}.`,
|
|
119
|
+
'Choose the command for THIS machine from these facts. Check one against the machine with tool_search (action "resolve") before re-running, and record a working one with action "record" so it is known next time.',
|
|
120
|
+
].join('\n');
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=command-adaptation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-adaptation.js","sourceRoot":"","sources":["../../src/learning/command-adaptation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAqB,MAAM,oBAAoB,CAAC;AAE3E;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,SAAS,CAAC,UAAU;QAChE,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QACpC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QAC/C,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACzD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;IAClC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,oBAAoB,CAAC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5C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,QAAQ;YAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC;IAC9E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAC;IACnC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpD,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;IACzG,OAAO;QACL,EAAE;QACF,kDAAkD;QAClD,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,iBAAiB,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,SAAS,IAAI,SAAS,GAAG;QACxE,6BAA6B,QAAQ,GAAG;QACxC,oNAAoN;KACrN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The consent picture — ONE place that says, for every state-changing action,
|
|
3
|
+
* whether it is denied, grantable, or decided by evidence.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS. The rules are already enforced (`autonomy-policy.ts`,
|
|
6
|
+
* `run-terminal.ts`, `intent-envelope.ts`, `session-grant.ts`), but they lived
|
|
7
|
+
* in six files and several refusal messages, so neither the user nor the model
|
|
8
|
+
* had a single view of them. When the user asks "why is this asking / why won't
|
|
9
|
+
* this run", the answer should be one table, not an archaeology of gates.
|
|
10
|
+
*
|
|
11
|
+
* The categories are stable and code-owned — this module DERIVES nothing and
|
|
12
|
+
* changes nothing; it renders the policy that is already in force. A rule that
|
|
13
|
+
* moves in the policy should move here in the same change (the dashboard shows
|
|
14
|
+
* this, so drift is visible).
|
|
15
|
+
*/
|
|
16
|
+
export interface ConsentExample {
|
|
17
|
+
action: string;
|
|
18
|
+
/** The evidence the gate actually consults, in one line. */
|
|
19
|
+
evidence: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ConsentPicture {
|
|
22
|
+
/** Never runs, grant or no grant. The hard floor. */
|
|
23
|
+
denied: {
|
|
24
|
+
title: string;
|
|
25
|
+
note: string;
|
|
26
|
+
examples: ConsentExample[];
|
|
27
|
+
};
|
|
28
|
+
/** Runs after ONE explicit, session-scoped grant the user picks. */
|
|
29
|
+
grantable: {
|
|
30
|
+
title: string;
|
|
31
|
+
note: string;
|
|
32
|
+
examples: ConsentExample[];
|
|
33
|
+
};
|
|
34
|
+
/** Runs on its own when the user's OWN request names it (or it is recoverable). */
|
|
35
|
+
decided: {
|
|
36
|
+
title: string;
|
|
37
|
+
note: string;
|
|
38
|
+
examples: ConsentExample[];
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare function consentPicture(): ConsentPicture;
|
|
42
|
+
//# sourceMappingURL=consent-picture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent-picture.d.ts","sourceRoot":"","sources":["../../src/learning/consent-picture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;IACpE,oEAAoE;IACpE,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;IACvE,mFAAmF;IACnF,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;CACtE;AAED,wBAAgB,cAAc,IAAI,cAAc,CAoC/C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The consent picture — ONE place that says, for every state-changing action,
|
|
3
|
+
* whether it is denied, grantable, or decided by evidence.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS. The rules are already enforced (`autonomy-policy.ts`,
|
|
6
|
+
* `run-terminal.ts`, `intent-envelope.ts`, `session-grant.ts`), but they lived
|
|
7
|
+
* in six files and several refusal messages, so neither the user nor the model
|
|
8
|
+
* had a single view of them. When the user asks "why is this asking / why won't
|
|
9
|
+
* this run", the answer should be one table, not an archaeology of gates.
|
|
10
|
+
*
|
|
11
|
+
* The categories are stable and code-owned — this module DERIVES nothing and
|
|
12
|
+
* changes nothing; it renders the policy that is already in force. A rule that
|
|
13
|
+
* moves in the policy should move here in the same change (the dashboard shows
|
|
14
|
+
* this, so drift is visible).
|
|
15
|
+
*/
|
|
16
|
+
export function consentPicture() {
|
|
17
|
+
return {
|
|
18
|
+
denied: {
|
|
19
|
+
title: 'Denied — never runs',
|
|
20
|
+
note: 'The hard floor. No session grant and no request phrasing unlocks these; the DENY patterns are checked before any grant is consulted.',
|
|
21
|
+
examples: [
|
|
22
|
+
{ action: 'sudo / privilege escalation', evidence: 'absolute deny pattern' },
|
|
23
|
+
{ action: 'rm -rf / (roots, home, system dirs, globs)', evidence: 'absolute deny pattern' },
|
|
24
|
+
{ action: 'mkfs, fdisk, dd, shutdown, kill -9, fork bombs', evidence: 'absolute deny pattern' },
|
|
25
|
+
{ action: 'git reset --hard / git clean / checkout -- (working-tree destruction)', evidence: 'absolute deny pattern' },
|
|
26
|
+
{ action: 'raw `git push` as a shell string', evidence: 'use the structured git tool (gated by evidence)' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
grantable: {
|
|
30
|
+
title: 'Grantable — one explicit "allow for this session"',
|
|
31
|
+
note: 'Offered as one extra choice at the confirmation a tool demanded. Never inferred from prose; recorded as a revisable decision; ends with the conversation.',
|
|
32
|
+
examples: [
|
|
33
|
+
{ action: 'file writes + whole-file overwrites', evidence: 'the `write` session grant' },
|
|
34
|
+
{ action: 'recoverable workspace commands (install, mkdir, cp/mv, git add)', evidence: 'the `terminal` session grant' },
|
|
35
|
+
{ action: 'off-machine actions: network fetches, global/system installs, publish, push', evidence: 'the `external` session grant' },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
decided: {
|
|
39
|
+
title: 'Decided on its own — evidence, not a round trip',
|
|
40
|
+
note: 'The user’s own request is the authorization. These proceed and REPORT what happened instead of asking again.',
|
|
41
|
+
examples: [
|
|
42
|
+
{ action: 'creating a file the request asked for', evidence: 'the request names the work' },
|
|
43
|
+
{ action: 'a surgical edit (small relative to the file) or a file the request names', evidence: 'requestNamesPath / isSurgicalEdit' },
|
|
44
|
+
{ action: 'a command the request itself names', evidence: 'namedByRequest' },
|
|
45
|
+
{ action: 'git commit / git push the request names', evidence: 'requestRequestsCommit / requestRequestsPush' },
|
|
46
|
+
{ action: 'publish the request resolves to', evidence: 'the request resolves to the publish CLI intent' },
|
|
47
|
+
{ action: 'recoverable CLI intents the user asked for (stop dashboard, clear cache…)', evidence: 'the intent is declared reversible in cli-intent-effects.ts + namedByRequest' },
|
|
48
|
+
{ action: 'a workspace command the request authorized', evidence: 'authorizedByRequest + recoverable' },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|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E;gBAC5E,EAAE,MAAM,EAAE,yCAAyC,EAAE,QAAQ,EAAE,6CAA6C,EAAE;gBAC9G,EAAE,MAAM,EAAE,iCAAiC,EAAE,QAAQ,EAAE,gDAAgD,EAAE;gBACzG,EAAE,MAAM,EAAE,2EAA2E,EAAE,QAAQ,EAAE,6EAA6E,EAAE;gBAChL,EAAE,MAAM,EAAE,4CAA4C,EAAE,QAAQ,EAAE,mCAAmC,EAAE;aACxG;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -57,12 +57,38 @@ export declare const CHARS_PER_TOKEN = 4.5;
|
|
|
57
57
|
*/
|
|
58
58
|
export declare const MAX_THREAD_BUDGET_CHARS = 4000000;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
60
|
+
* THERE IS NO UNIVERSAL NEVER-SHRINK FLOOR (C1/C5, decided with the user).
|
|
61
|
+
*
|
|
62
|
+
* This module used to export `THREAD_BUDGET_FLOOR_CHARS = 200_000` and apply it
|
|
63
|
+
* as `Math.max(FLOOR, windowDerivedChars)`, so the resolver could only ever
|
|
64
|
+
* RAISE a budget. A model whose REAL window was 32,768 tokens was therefore
|
|
65
|
+
* handed 200,000 chars (~44K tokens) of thread — **1.4× its own window**, from
|
|
66
|
+
* the very lookup that had just established that window. That is C5: the floor
|
|
67
|
+
* made a KNOWN window unenforceable, so a mid-turn handoff to a smaller model
|
|
68
|
+
* could overflow the window we already knew about. (Measured against the old
|
|
69
|
+
* rule: a 32K window returned 200,000.)
|
|
70
|
+
*
|
|
71
|
+
* The user's decision, and the reason no floor may sit above the window: the
|
|
72
|
+
* thread is fitted to the model that is ANSWERING, because what makes a model
|
|
73
|
+
* hallucinate is losing the ask. The protections that preserve perspective are
|
|
74
|
+
* RULES in `trimThreadBudget`, not a budget number — the system prompt, the
|
|
75
|
+
* FIRST user message, the last `RECENT_KEEP` messages and the work digest are
|
|
76
|
+
* never touched, and only OLD TOOL OUTPUT is ever shrunk. So a large-window
|
|
77
|
+
* model is deliberately left to use its window, and a small-window model gets a
|
|
78
|
+
* thread that fits it.
|
|
79
|
+
*
|
|
80
|
+
* The UNKNOWN case is unchanged and is still the dominant one: no window → this
|
|
81
|
+
* resolver returns `undefined` and the caller keeps its own default
|
|
82
|
+
* (`DEFAULT_THREAD_BUDGET_CHARS` in `tools/tool-loop.ts`, also 200,000).
|
|
64
83
|
*/
|
|
65
|
-
|
|
84
|
+
/**
|
|
85
|
+
* The smallest thread we will ask a model to work in (~4.4K tokens at 4.5
|
|
86
|
+
* chars/token). A window recorded BELOW this is a registry error rather than a
|
|
87
|
+
* real model, and trimming a thread to near-zero would destroy the turn — so
|
|
88
|
+
* this is the one floor that survives, and it is deliberately far below the
|
|
89
|
+
* 200,000 it replaces.
|
|
90
|
+
*/
|
|
91
|
+
export declare const MIN_THREAD_BUDGET_CHARS = 20000;
|
|
66
92
|
/** Default per-prompt file-context caps (today's constants) for unknown models. */
|
|
67
93
|
export declare const DEFAULT_CONTEXT_FILES = 10;
|
|
68
94
|
export declare const DEFAULT_CONTEXT_FILE_CHARS = 16000;
|
|
@@ -116,7 +142,12 @@ export declare function resolveMaxOutputTokens(input?: BudgetInput): number;
|
|
|
116
142
|
* model. Returns `undefined` when the window is UNKNOWN so the caller keeps
|
|
117
143
|
* `DEFAULT_THREAD_BUDGET_CHARS` untouched ("unknown → unchanged", the same
|
|
118
144
|
* discipline as `resolveContextBudget`); a known window converts its token
|
|
119
|
-
* budget to characters so a 1M-token model is not trimmed to a 128K keyhole
|
|
145
|
+
* budget to characters so a 1M-token model is not trimmed to a 128K keyhole —
|
|
146
|
+
* and, since C1/C5, so a 32K-token model is not handed a 44K-token thread.
|
|
147
|
+
*
|
|
148
|
+
* The WINDOW decides in BOTH directions. The old `Math.max(FLOOR, chars)` is
|
|
149
|
+
* what made a known small window unenforceable; see the note on
|
|
150
|
+
* `MIN_THREAD_BUDGET_CHARS` above.
|
|
120
151
|
*/
|
|
121
152
|
export declare function resolveThreadBudgetChars(input?: BudgetInput): number | undefined;
|
|
122
153
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-budget.d.ts","sourceRoot":"","sources":["../../src/learning/context-budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH;;;GAGG;AACH,eAAO,MAAM,sBAAsB,SAAU,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AAExC,wEAAwE;AACxE,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAGjD;;;;GAIG;AACH,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,UAAY,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"context-budget.d.ts","sourceRoot":"","sources":["../../src/learning/context-budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH;;;GAGG;AACH,eAAO,MAAM,sBAAsB,SAAU,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AAExC,wEAAwE;AACxE,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAGjD;;;;GAIG;AACH,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,UAAY,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,KAAK,C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