@open-agent-toolkit/cli 0.2.51 → 0.2.53
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/assets/bundle-metadata.json +1 -1
- package/assets/docs/cli-utilities/bootstrap.md +6 -2
- package/assets/docs/cli-utilities/tool-packs.md +87 -33
- package/assets/docs/provider-sync/commands.md +30 -2
- package/assets/docs/provider-sync/config.md +19 -0
- package/assets/docs/provider-sync/manifest-and-drift.md +37 -0
- package/assets/docs/provider-sync/providers.md +69 -2
- package/assets/docs/provider-sync/scope-and-surface.md +44 -0
- package/assets/docs/reference/cli-reference.md +1 -0
- package/assets/docs/reference/oat-directory-structure.md +11 -4
- package/assets/docs/workflows/projects/evidence-layers.md +110 -1
- package/assets/docs/workflows/projects/implementation-execution.md +13 -0
- package/assets/docs/workflows/projects/orchestration-model.md +18 -0
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-dispatch-subagents/SKILL.md +57 -1
- package/assets/skills/oat-dispatch-subagents/references/record-schema.md +77 -1
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +1 -1
- package/assets/skills/oat-project-dispatch-subagents/SKILL.md +24 -1
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-implement/references/dispatch-and-dry-run.md +11 -0
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-plan-writing/SKILL.md +12 -1
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-review-provide/SKILL.md +12 -1
- package/assets/skills/oat-project-review-provide-remote/SKILL.md +12 -1
- package/dist/agents/canonical/index.d.ts +2 -0
- package/dist/agents/canonical/index.d.ts.map +1 -1
- package/dist/agents/canonical/index.js +1 -0
- package/dist/agents/canonical/resolve.d.ts +45 -0
- package/dist/agents/canonical/resolve.d.ts.map +1 -0
- package/dist/agents/canonical/resolve.js +175 -0
- package/dist/commands/decision/agents-guidance.d.ts +2 -2
- package/dist/commands/decision/agents-guidance.d.ts.map +1 -1
- package/dist/commands/decision/agents-guidance.js +1 -4
- package/dist/commands/decision/index.d.ts.map +1 -1
- package/dist/commands/decision/index.js +25 -6
- package/dist/commands/docs/init/index.d.ts +7 -1
- package/dist/commands/docs/init/index.d.ts.map +1 -1
- package/dist/commands/docs/init/index.js +53 -20
- package/dist/commands/doctor/index.d.ts +8 -2
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +157 -46
- package/dist/commands/init/index.d.ts +8 -3
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +66 -28
- package/dist/commands/init/tools/index.d.ts +12 -12
- package/dist/commands/init/tools/index.d.ts.map +1 -1
- package/dist/commands/init/tools/index.js +430 -99
- package/dist/commands/init/tools/install-state.d.ts +2 -0
- package/dist/commands/init/tools/install-state.d.ts.map +1 -1
- package/dist/commands/init/tools/install-state.js +11 -0
- package/dist/commands/init/tools/project-guidance.d.ts +49 -0
- package/dist/commands/init/tools/project-guidance.d.ts.map +1 -0
- package/dist/commands/init/tools/project-guidance.js +144 -0
- package/dist/commands/init/tools/workflows/index.d.ts +7 -0
- package/dist/commands/init/tools/workflows/index.d.ts.map +1 -1
- package/dist/commands/init/tools/workflows/index.js +160 -7
- package/dist/commands/pjm/index.d.ts.map +1 -1
- package/dist/commands/pjm/index.js +28 -3
- package/dist/commands/pjm/init.d.ts +5 -0
- package/dist/commands/pjm/init.d.ts.map +1 -1
- package/dist/commands/pjm/init.js +19 -3
- package/dist/commands/project/dispatch/index.d.ts +10 -0
- package/dist/commands/project/dispatch/index.d.ts.map +1 -0
- package/dist/commands/project/dispatch/index.js +137 -0
- package/dist/commands/project/dispatch/record.d.ts +91 -0
- package/dist/commands/project/dispatch/record.d.ts.map +1 -0
- package/dist/commands/project/dispatch/record.js +402 -0
- package/dist/commands/project/index.d.ts.map +1 -1
- package/dist/commands/project/index.js +2 -0
- package/dist/commands/providers/inspect/inspect.d.ts +8 -1
- package/dist/commands/providers/inspect/inspect.d.ts.map +1 -1
- package/dist/commands/providers/inspect/inspect.js +146 -26
- package/dist/commands/providers/list/list.d.ts +8 -1
- package/dist/commands/providers/list/list.d.ts.map +1 -1
- package/dist/commands/providers/list/list.js +139 -23
- package/dist/commands/providers/providers.types.d.ts +25 -1
- package/dist/commands/providers/providers.types.d.ts.map +1 -1
- package/dist/commands/providers/set/index.d.ts +9 -1
- package/dist/commands/providers/set/index.d.ts.map +1 -1
- package/dist/commands/providers/set/index.js +43 -33
- package/dist/commands/remove/skill/remove-skill.d.ts.map +1 -1
- package/dist/commands/remove/skill/remove-skill.js +11 -0
- package/dist/commands/shared/agents-md.d.ts +42 -14
- package/dist/commands/shared/agents-md.d.ts.map +1 -1
- package/dist/commands/shared/agents-md.js +364 -70
- package/dist/commands/status/index.d.ts +8 -3
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +149 -37
- package/dist/commands/sync/apply.d.ts.map +1 -1
- package/dist/commands/sync/apply.js +220 -29
- package/dist/commands/sync/dry-run.d.ts.map +1 -1
- package/dist/commands/sync/dry-run.js +30 -6
- package/dist/commands/sync/index.d.ts +17 -2
- package/dist/commands/sync/index.d.ts.map +1 -1
- package/dist/commands/sync/index.js +108 -43
- package/dist/commands/sync/sync.types.d.ts +39 -2
- package/dist/commands/sync/sync.types.d.ts.map +1 -1
- package/dist/commands/sync/sync.utils.d.ts +5 -1
- package/dist/commands/sync/sync.utils.d.ts.map +1 -1
- package/dist/commands/sync/sync.utils.js +73 -0
- package/dist/commands/tools/info/info-tool.d.ts +2 -0
- package/dist/commands/tools/info/info-tool.d.ts.map +1 -1
- package/dist/commands/tools/info/info-tool.js +34 -12
- package/dist/commands/tools/install/index.d.ts.map +1 -1
- package/dist/commands/tools/install/index.js +19 -3
- package/dist/commands/tools/list/list-tools.d.ts +2 -0
- package/dist/commands/tools/list/list-tools.d.ts.map +1 -1
- package/dist/commands/tools/list/list-tools.js +36 -7
- package/dist/commands/tools/remove/index.d.ts.map +1 -1
- package/dist/commands/tools/remove/index.js +150 -21
- package/dist/commands/tools/remove/remove-tools.d.ts +20 -0
- package/dist/commands/tools/remove/remove-tools.d.ts.map +1 -1
- package/dist/commands/tools/remove/remove-tools.js +122 -1
- package/dist/commands/tools/shared/format-pack-inventory.d.ts +19 -0
- package/dist/commands/tools/shared/format-pack-inventory.d.ts.map +1 -1
- package/dist/commands/tools/shared/format-pack-inventory.js +109 -0
- package/dist/commands/tools/shared/pack-evidence.d.ts +66 -0
- package/dist/commands/tools/shared/pack-evidence.d.ts.map +1 -0
- package/dist/commands/tools/shared/pack-evidence.js +132 -0
- package/dist/commands/tools/shared/pack-inventory.d.ts +1 -0
- package/dist/commands/tools/shared/pack-inventory.d.ts.map +1 -1
- package/dist/commands/tools/shared/pack-lifecycle-outcome.d.ts +44 -0
- package/dist/commands/tools/shared/pack-lifecycle-outcome.d.ts.map +1 -0
- package/dist/commands/tools/shared/pack-lifecycle-outcome.js +91 -0
- package/dist/commands/tools/update/index.d.ts.map +1 -1
- package/dist/commands/tools/update/index.js +74 -4
- package/dist/commands/tools/update/update-tools.d.ts +5 -0
- package/dist/commands/tools/update/update-tools.d.ts.map +1 -1
- package/dist/commands/tools/update/update-tools.js +64 -2
- package/dist/config/oat-config.d.ts +5 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +17 -5
- package/dist/config/user-sync-config.d.ts +1 -0
- package/dist/config/user-sync-config.d.ts.map +1 -1
- package/dist/config/user-sync-config.js +8 -0
- package/dist/drift/detector.d.ts +2 -2
- package/dist/drift/detector.d.ts.map +1 -1
- package/dist/drift/detector.js +18 -0
- package/dist/drift/strays.d.ts.map +1 -1
- package/dist/drift/strays.js +5 -0
- package/dist/engine/collection-sync.d.ts +14 -0
- package/dist/engine/collection-sync.d.ts.map +1 -0
- package/dist/engine/collection-sync.js +282 -0
- package/dist/engine/compute-plan.d.ts +8 -1
- package/dist/engine/compute-plan.d.ts.map +1 -1
- package/dist/engine/compute-plan.js +303 -12
- package/dist/engine/engine.types.d.ts +61 -0
- package/dist/engine/engine.types.d.ts.map +1 -1
- package/dist/engine/execute-plan.d.ts +22 -2
- package/dist/engine/execute-plan.d.ts.map +1 -1
- package/dist/engine/execute-plan.js +459 -27
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/engine/provider-path-safety.d.ts +1 -0
- package/dist/engine/provider-path-safety.d.ts.map +1 -1
- package/dist/engine/provider-path-safety.js +15 -0
- package/dist/engine/scanner.d.ts +9 -2
- package/dist/engine/scanner.d.ts.map +1 -1
- package/dist/engine/scanner.js +58 -4
- package/dist/fs/io.d.ts +67 -0
- package/dist/fs/io.d.ts.map +1 -1
- package/dist/fs/io.js +536 -3
- package/dist/manifest/index.d.ts +2 -2
- package/dist/manifest/index.d.ts.map +1 -1
- package/dist/manifest/index.js +1 -1
- package/dist/manifest/manager.d.ts +2 -2
- package/dist/manifest/manager.d.ts.map +1 -1
- package/dist/manifest/manager.js +20 -3
- package/dist/manifest/manifest.types.d.ts +704 -13
- package/dist/manifest/manifest.types.d.ts.map +1 -1
- package/dist/manifest/manifest.types.js +131 -15
- package/dist/providers/codex/codec/sync-extension.d.ts +1 -1
- package/dist/providers/codex/codec/sync-extension.d.ts.map +1 -1
- package/dist/providers/codex/codec/sync-extension.js +48 -17
- package/dist/providers/cursor/codec/sync-extension.d.ts +1 -1
- package/dist/providers/cursor/codec/sync-extension.d.ts.map +1 -1
- package/dist/providers/cursor/codec/sync-extension.js +52 -23
- package/dist/providers/identity/absolute-paths.d.ts +68 -0
- package/dist/providers/identity/absolute-paths.d.ts.map +1 -0
- package/dist/providers/identity/absolute-paths.js +144 -0
- package/dist/providers/identity/claude-runtime-observation.d.ts +105 -0
- package/dist/providers/identity/claude-runtime-observation.d.ts.map +1 -0
- package/dist/providers/identity/claude-runtime-observation.fixtures.d.ts +40 -0
- package/dist/providers/identity/claude-runtime-observation.fixtures.d.ts.map +1 -0
- package/dist/providers/identity/claude-runtime-observation.fixtures.js +146 -0
- package/dist/providers/identity/claude-runtime-observation.js +229 -0
- package/dist/providers/identity/codex-runtime-observation.d.ts +75 -0
- package/dist/providers/identity/codex-runtime-observation.d.ts.map +1 -0
- package/dist/providers/identity/codex-runtime-observation.fixtures.d.ts +37 -0
- package/dist/providers/identity/codex-runtime-observation.fixtures.d.ts.map +1 -0
- package/dist/providers/identity/codex-runtime-observation.fixtures.js +539 -0
- package/dist/providers/identity/codex-runtime-observation.js +255 -0
- package/dist/providers/identity/generic-dispatch-record.d.ts +313 -0
- package/dist/providers/identity/generic-dispatch-record.d.ts.map +1 -0
- package/dist/providers/identity/generic-dispatch-record.js +539 -0
- package/dist/providers/identity/oat-dispatch-record.d.ts +1964 -0
- package/dist/providers/identity/oat-dispatch-record.d.ts.map +1 -0
- package/dist/providers/identity/oat-dispatch-record.js +691 -0
- package/dist/providers/identity/runtime-observation.d.ts +100 -0
- package/dist/providers/identity/runtime-observation.d.ts.map +1 -0
- package/dist/providers/identity/runtime-observation.js +169 -0
- package/dist/providers/shared/index.d.ts +2 -0
- package/dist/providers/shared/index.d.ts.map +1 -1
- package/dist/providers/shared/index.js +1 -0
- package/dist/providers/shared/materialization-extension.d.ts +12 -0
- package/dist/providers/shared/materialization-extension.d.ts.map +1 -1
- package/dist/providers/shared/registry.d.ts +69 -0
- package/dist/providers/shared/registry.d.ts.map +1 -0
- package/dist/providers/shared/registry.js +252 -0
- package/dist/providers/shared/restart-adviser.d.ts +26 -0
- package/dist/providers/shared/restart-adviser.d.ts.map +1 -0
- package/dist/providers/shared/restart-adviser.js +96 -0
- package/dist/shared/types.d.ts +4 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-plan-writing
|
|
3
|
-
version: 1.2.
|
|
3
|
+
version: 1.2.21
|
|
4
4
|
description: Use when authoring or mutating plan.md in any OAT workflow. Defines canonical format invariants — stable task IDs, required sections, review table rules, and resume guardrails.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: false
|
|
@@ -259,6 +259,17 @@ unavailable in the current session. Base Codex roles are allowed only for
|
|
|
259
259
|
explicit inherit/default behavior and the documented managed-uncapped reviewer
|
|
260
260
|
fallback.
|
|
261
261
|
|
|
262
|
+
Artifact-review launches preserve native dispatch lineage. Construct and
|
|
263
|
+
redact the complete generic record plus OAT role event before the native call.
|
|
264
|
+
Immediately after the call returns `accepted` or `blocked-before-start`, the
|
|
265
|
+
calling project workflow runs `oat project dispatch record --project
|
|
266
|
+
"$PROJECT_PATH" --event-file - --json`. Only a rejection attesting
|
|
267
|
+
`provesNoChildStarted: true` permits one exact-target approximation with a
|
|
268
|
+
fresh request ID. Preserve exact model, effort, route, authority, and provider
|
|
269
|
+
controls. Timeout, `BLOCKED`, refusal after acceptance, runtime mismatch,
|
|
270
|
+
missing telemetry, interruption, and malformed output never authorize fallback
|
|
271
|
+
or replacement.
|
|
272
|
+
|
|
262
273
|
Inline review of a concrete managed exception target is permitted only with
|
|
263
274
|
verified equivalent current-host model and effort controls. The default
|
|
264
275
|
inheritance route may review inline because the planning parent is the selected
|
|
@@ -256,7 +256,7 @@ remains immutable baseline evidence for the original p01-t01 verification.
|
|
|
256
256
|
| `oat-dispatch-subagents/references/provider-claude.md` | `fbe3a21e9533 -> NG` |
|
|
257
257
|
| `oat-dispatch-subagents/references/provider-codex.md` | `95b0f82018c7 -> NG` |
|
|
258
258
|
| `oat-dispatch-subagents/references/provider-cursor.md` | `f781555295a9 -> NG`; `55ccfef14fd6 -> NG` |
|
|
259
|
-
| `oat-dispatch-subagents/references/record-schema.md` | `78f8069274a8 -> NG`; `1c9a84c4d1e0 -> NG`
|
|
259
|
+
| `oat-dispatch-subagents/references/record-schema.md` | `78f8069274a8 -> NG`; `1c9a84c4d1e0 -> NG`; `2a63da6e3a96 -> NG`; `30762d53b043 -> NG` |
|
|
260
260
|
| `oat-project-dispatch-subagents/SKILL.md` | `eca03ad1ca12 -> PDISPATCH-01`; `59fbcdc79cea -> PDISPATCH-01` |
|
|
261
261
|
| `oat-project-plan/SKILL.md` | `f99e44b39932 -> PLAN-12`; `7e6a9854504b -> NG` |
|
|
262
262
|
| `oat-project-implement/references/completion-and-closeout.md` | `6909a5a5a1fa -> IMPLEMENT-19`; `a7c02ef670fd -> IMPLEMENT-19`; `9dde56d89a71 -> IMPLEMENT-16`; `13c41b2b2590 -> IMPLEMENT-16` |
|
|
@@ -256,7 +256,7 @@ remains immutable baseline evidence for the original p01-t01 verification.
|
|
|
256
256
|
| `oat-dispatch-subagents/references/provider-claude.md` | `fbe3a21e9533 -> NG` |
|
|
257
257
|
| `oat-dispatch-subagents/references/provider-codex.md` | `95b0f82018c7 -> NG` |
|
|
258
258
|
| `oat-dispatch-subagents/references/provider-cursor.md` | `f781555295a9 -> NG`; `55ccfef14fd6 -> NG` |
|
|
259
|
-
| `oat-dispatch-subagents/references/record-schema.md` | `78f8069274a8 -> NG`; `1c9a84c4d1e0 -> NG`
|
|
259
|
+
| `oat-dispatch-subagents/references/record-schema.md` | `78f8069274a8 -> NG`; `1c9a84c4d1e0 -> NG`; `2a63da6e3a96 -> NG`; `30762d53b043 -> NG` |
|
|
260
260
|
| `oat-project-dispatch-subagents/SKILL.md` | `eca03ad1ca12 -> PDISPATCH-01`; `59fbcdc79cea -> PDISPATCH-01` |
|
|
261
261
|
| `oat-project-plan/SKILL.md` | `f99e44b39932 -> PLAN-12`; `7e6a9854504b -> NG` |
|
|
262
262
|
| `oat-project-implement/references/completion-and-closeout.md` | `6909a5a5a1fa -> IMPLEMENT-19`; `a7c02ef670fd -> IMPLEMENT-19`; `9dde56d89a71 -> IMPLEMENT-16`; `13c41b2b2590 -> IMPLEMENT-16` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-review-provide
|
|
3
|
-
version: 1.5.
|
|
3
|
+
version: 1.5.3
|
|
4
4
|
description: Use when the user explicitly asks to review an OAT project — e.g. "review project", "review the project", "run project review", or confirms a previously offered review. Do NOT auto-invoke on completed work alone. Resolves a project review scope and offers before running.
|
|
5
5
|
disable-model-invocation: false
|
|
6
6
|
user-invocable: true
|
|
@@ -724,6 +724,17 @@ After constructing the complete provider payload, record the launcher-owned
|
|
|
724
724
|
missing telemetry, missing reviewer self-report, or contradictory self-report
|
|
725
725
|
must not populate, replace, or overwrite them and must not trigger fallback.
|
|
726
726
|
|
|
727
|
+
Persist native dispatch lineage around the host-owned review launch. Construct
|
|
728
|
+
and redact the complete generic record plus OAT role event before the native
|
|
729
|
+
call. Immediately after the call returns `accepted` or
|
|
730
|
+
`blocked-before-start`, run `oat project dispatch record --project
|
|
731
|
+
"$PROJECT_PATH" --event-file - --json`. The rejected form must attest
|
|
732
|
+
`provesNoChildStarted: true`; only it permits one exact-target approximation
|
|
733
|
+
with a fresh request ID. Preserve the exact model, effort, route, authority,
|
|
734
|
+
and provider controls. Timeout, `BLOCKED`, refusal after acceptance, runtime
|
|
735
|
+
mismatch, missing telemetry, interruption, and malformed output never
|
|
736
|
+
authorize fallback or replacement.
|
|
737
|
+
|
|
727
738
|
Once the native host accepts a reviewer, every terminal result is an
|
|
728
739
|
authoritative review outcome. An accepted reviewer returning `BLOCKED` is a
|
|
729
740
|
terminal blocking review outcome: it blocks the review and does not invoke or
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-review-provide-remote
|
|
3
|
-
version: 1.1.
|
|
3
|
+
version: 1.1.2
|
|
4
4
|
description: Use when reviewing a GitHub PR opened on another machine for an active OAT project and posting findings back as a single PR review. Resolves the project from the PR diff, reads project artifacts for mode-aware review, and posts via gh api.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -311,6 +311,17 @@ route. After acceptance, continue only through the existing reviewer handle;
|
|
|
311
311
|
timeout, interruption, malformed output, or `BLOCKED` never authorizes a
|
|
312
312
|
replacement launch.
|
|
313
313
|
|
|
314
|
+
Persist native dispatch lineage around the host-owned remote-review launch.
|
|
315
|
+
Construct and redact the complete generic record plus OAT role event before the
|
|
316
|
+
native call. Immediately after the call returns `accepted` or
|
|
317
|
+
`blocked-before-start`, run `oat project dispatch record --project
|
|
318
|
+
"$PROJECT_PATH" --event-file - --json`. The rejected form must attest
|
|
319
|
+
`provesNoChildStarted: true`; only it permits one exact-target approximation
|
|
320
|
+
with a fresh request ID. Preserve exact model, effort, route, authority, and
|
|
321
|
+
provider controls. Timeout, `BLOCKED`, refusal after acceptance, runtime
|
|
322
|
+
mismatch, malformed output, interruption, and missing telemetry never
|
|
323
|
+
authorize fallback or replacement.
|
|
324
|
+
|
|
314
325
|
This resolver command is independent of lifecycle gates. Reusable `oat gate
|
|
315
326
|
review` commands must remain provider-neutral and must not contain or add a
|
|
316
327
|
provider/model `--target` argument.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { parseCanonicalAgentFile, parseCanonicalAgentMarkdown } from './parse.js';
|
|
2
|
+
export { resolveCanonicalRole } from './resolve.js';
|
|
2
3
|
export { renderCanonicalAgentMarkdown } from './render.js';
|
|
4
|
+
export type { CandidateMiss, CanonicalRoleCandidateOutcome, CanonicalRoleEvidence, CanonicalRoleTier, CanonicalRoleValidation, RecoveryAction, RedactedPath, ResolveCanonicalRoleInput, } from './resolve.js';
|
|
3
5
|
export type { CanonicalAgentDocument, CanonicalAgentFrontmatter, CanonicalAgentTools, } from './types.js';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/canonical/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/canonical/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EACV,aAAa,EACb,6BAA6B,EAC7B,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type CanonicalRoleTier = 'loaded' | 'user' | 'project';
|
|
2
|
+
export type CanonicalRoleValidation = 'direct-canonical' | 'exact-canonical-symlink';
|
|
3
|
+
export type CanonicalRoleCandidateOutcome = 'missing' | 'broken-symlink' | 'escaping-symlink' | 'noncanonical-copy' | 'wrong-target' | 'invalid-role';
|
|
4
|
+
export type RedactedPath = string;
|
|
5
|
+
export interface CandidateMiss {
|
|
6
|
+
tier: CanonicalRoleTier;
|
|
7
|
+
candidate: RedactedPath;
|
|
8
|
+
outcome: CanonicalRoleCandidateOutcome;
|
|
9
|
+
}
|
|
10
|
+
export interface RecoveryAction {
|
|
11
|
+
command: string;
|
|
12
|
+
}
|
|
13
|
+
export type CanonicalRoleEvidence = {
|
|
14
|
+
status: 'resolved';
|
|
15
|
+
dependency: string;
|
|
16
|
+
canonicalRole: string;
|
|
17
|
+
tier: CanonicalRoleTier;
|
|
18
|
+
validation: CanonicalRoleValidation;
|
|
19
|
+
canonicalPath: RedactedPath;
|
|
20
|
+
selectedPath: RedactedPath;
|
|
21
|
+
roleVersion: string;
|
|
22
|
+
contentDigest: string;
|
|
23
|
+
candidateMisses: readonly CandidateMiss[];
|
|
24
|
+
} | {
|
|
25
|
+
status: 'missing';
|
|
26
|
+
dependency: string;
|
|
27
|
+
canonicalRole: string;
|
|
28
|
+
candidateMisses: readonly CandidateMiss[];
|
|
29
|
+
recovery: readonly RecoveryAction[];
|
|
30
|
+
};
|
|
31
|
+
export interface ResolveCanonicalRoleInput {
|
|
32
|
+
dependency: string;
|
|
33
|
+
canonicalRole: string;
|
|
34
|
+
skillDir: string;
|
|
35
|
+
userCanonicalRoot: string;
|
|
36
|
+
projectCanonicalRoot: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Deliberately a library for skill-side callers: dispatch protocols resolve
|
|
40
|
+
* role identity before the native launch and hand the resulting evidence to
|
|
41
|
+
* `oat project dispatch record`, which validates it. There is intentionally no
|
|
42
|
+
* production call site inside the CLI.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveCanonicalRole(input: ResolveCanonicalRoleInput): CanonicalRoleEvidence;
|
|
45
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/agents/canonical/resolve.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,MAAM,MAAM,uBAAuB,GAC/B,kBAAkB,GAClB,yBAAyB,CAAC;AAC9B,MAAM,MAAM,6BAA6B,GACrC,SAAS,GACT,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,cAAc,GACd,cAAc,CAAC;AAEnB,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,6BAA6B,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,qBAAqB,GAC7B;IACE,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,uBAAuB,CAAC;IACpC,aAAa,EAAE,YAAY,CAAC;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,SAAS,aAAa,EAAE,CAAC;CAC3C,GACD;IACE,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;CACrC,CAAC;AAEN,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AA2JD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,GAC/B,qBAAqB,CA0DvB"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { lstatSync, readFileSync, realpathSync } from 'node:fs';
|
|
3
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { parseCanonicalAgentMarkdown } from './parse.js';
|
|
5
|
+
function redactedCandidate(tier, role) {
|
|
6
|
+
return `<${tier}>/agents/${role}.md`;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolve symlinks before comparing roots.
|
|
10
|
+
*
|
|
11
|
+
* `path.resolve` normalizes a path but does not follow symlinks, so the same
|
|
12
|
+
* canonical file was labelled `<loaded>` or `<user>` depending on whether the
|
|
13
|
+
* caller happened to pass a realpath'd `skillDir`. On macOS a tmpdir root
|
|
14
|
+
* realpaths from `/var/...` to `/private/var/...`, which broke the string
|
|
15
|
+
* match; on Linux it did not. A provenance label must not depend on an
|
|
16
|
+
* incidental property of the caller's argument.
|
|
17
|
+
*/
|
|
18
|
+
function sameRoot(left, right) {
|
|
19
|
+
const normalize = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
return realpathSync(value);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return resolve(value);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return normalize(left) === normalize(right);
|
|
28
|
+
}
|
|
29
|
+
function canonicalTier(candidate, userCanonicalRoot, projectCanonicalRoot) {
|
|
30
|
+
if (sameRoot(candidate.canonicalRoot, userCanonicalRoot)) {
|
|
31
|
+
return 'user';
|
|
32
|
+
}
|
|
33
|
+
if (sameRoot(candidate.canonicalRoot, projectCanonicalRoot)) {
|
|
34
|
+
return 'project';
|
|
35
|
+
}
|
|
36
|
+
return candidate.tier;
|
|
37
|
+
}
|
|
38
|
+
function inspectCandidate(candidate, role) {
|
|
39
|
+
const selectedFile = join(candidate.providerRoot, 'agents', `${role}.md`);
|
|
40
|
+
const canonicalFile = join(candidate.canonicalRoot, 'agents', `${role}.md`);
|
|
41
|
+
const miss = (outcome) => ({
|
|
42
|
+
tier: candidate.tier,
|
|
43
|
+
candidate: redactedCandidate(candidate.tier, role),
|
|
44
|
+
outcome,
|
|
45
|
+
});
|
|
46
|
+
let selectedStat;
|
|
47
|
+
try {
|
|
48
|
+
selectedStat = lstatSync(selectedFile);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return miss('missing');
|
|
52
|
+
}
|
|
53
|
+
if (selectedStat.isSymbolicLink()) {
|
|
54
|
+
let selectedRealpath;
|
|
55
|
+
try {
|
|
56
|
+
selectedRealpath = realpathSync(selectedFile);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return miss('broken-symlink');
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
if (!lstatSync(canonicalFile).isFile()) {
|
|
63
|
+
return miss('escaping-symlink');
|
|
64
|
+
}
|
|
65
|
+
if (selectedFile !== canonicalFile &&
|
|
66
|
+
selectedRealpath === realpathSync(canonicalFile)) {
|
|
67
|
+
return {
|
|
68
|
+
validation: 'exact-canonical-symlink',
|
|
69
|
+
selectedFile,
|
|
70
|
+
canonicalFile,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return miss('escaping-symlink');
|
|
76
|
+
}
|
|
77
|
+
return miss('escaping-symlink');
|
|
78
|
+
}
|
|
79
|
+
if (!selectedStat.isFile()) {
|
|
80
|
+
return miss('wrong-target');
|
|
81
|
+
}
|
|
82
|
+
if (selectedFile !== canonicalFile) {
|
|
83
|
+
return miss('noncanonical-copy');
|
|
84
|
+
}
|
|
85
|
+
return { validation: 'direct-canonical', selectedFile, canonicalFile };
|
|
86
|
+
}
|
|
87
|
+
function resolveRoleIdentity(resolved, candidate, input, candidateMisses) {
|
|
88
|
+
try {
|
|
89
|
+
const content = readFileSync(resolved.canonicalFile, 'utf8');
|
|
90
|
+
const document = parseCanonicalAgentMarkdown(content, '<canonical-role>');
|
|
91
|
+
const version = document.frontmatter.version;
|
|
92
|
+
if (document.name !== input.canonicalRole ||
|
|
93
|
+
typeof version !== 'string' ||
|
|
94
|
+
version.trim() === '') {
|
|
95
|
+
throw new Error('Canonical role identity is invalid');
|
|
96
|
+
}
|
|
97
|
+
const canonicalPath = redactedCandidate(canonicalTier(candidate, input.userCanonicalRoot, input.projectCanonicalRoot), input.canonicalRole);
|
|
98
|
+
return {
|
|
99
|
+
status: 'resolved',
|
|
100
|
+
dependency: input.dependency,
|
|
101
|
+
canonicalRole: input.canonicalRole,
|
|
102
|
+
tier: candidate.tier,
|
|
103
|
+
validation: resolved.validation,
|
|
104
|
+
canonicalPath,
|
|
105
|
+
selectedPath: redactedCandidate(candidate.tier, input.canonicalRole),
|
|
106
|
+
roleVersion: version.trim(),
|
|
107
|
+
contentDigest: `sha256:${createHash('sha256').update(content).digest('hex')}`,
|
|
108
|
+
candidateMisses,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return {
|
|
113
|
+
tier: candidate.tier,
|
|
114
|
+
candidate: redactedCandidate(candidate.tier, input.canonicalRole),
|
|
115
|
+
outcome: 'invalid-role',
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Deliberately a library for skill-side callers: dispatch protocols resolve
|
|
121
|
+
* role identity before the native launch and hand the resulting evidence to
|
|
122
|
+
* `oat project dispatch record`, which validates it. There is intentionally no
|
|
123
|
+
* production call site inside the CLI.
|
|
124
|
+
*/
|
|
125
|
+
export function resolveCanonicalRole(input) {
|
|
126
|
+
const loadedRoot = resolve(input.skillDir, '..', '..');
|
|
127
|
+
const loadedCanonicalRoot = basename(loadedRoot) === '.agents'
|
|
128
|
+
? loadedRoot
|
|
129
|
+
: join(dirname(loadedRoot), '.agents');
|
|
130
|
+
const candidates = [
|
|
131
|
+
{
|
|
132
|
+
tier: 'loaded',
|
|
133
|
+
providerRoot: loadedRoot,
|
|
134
|
+
canonicalRoot: loadedCanonicalRoot,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
tier: 'user',
|
|
138
|
+
providerRoot: input.userCanonicalRoot,
|
|
139
|
+
canonicalRoot: input.userCanonicalRoot,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
tier: 'project',
|
|
143
|
+
providerRoot: input.projectCanonicalRoot,
|
|
144
|
+
canonicalRoot: input.projectCanonicalRoot,
|
|
145
|
+
},
|
|
146
|
+
];
|
|
147
|
+
const candidateMisses = [];
|
|
148
|
+
for (const candidate of candidates) {
|
|
149
|
+
const inspected = inspectCandidate(candidate, input.canonicalRole);
|
|
150
|
+
if ('outcome' in inspected) {
|
|
151
|
+
candidateMisses.push(inspected);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const evidence = resolveRoleIdentity(inspected, candidate, input, candidateMisses);
|
|
155
|
+
if ('outcome' in evidence) {
|
|
156
|
+
candidateMisses.push(evidence);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
return evidence;
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
status: 'missing',
|
|
163
|
+
dependency: input.dependency,
|
|
164
|
+
canonicalRole: input.canonicalRole,
|
|
165
|
+
candidateMisses,
|
|
166
|
+
recovery: [
|
|
167
|
+
{
|
|
168
|
+
command: `oat tools install ${input.dependency} --scope <user|project>`,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
command: `oat tools update --pack ${input.dependency} --scope <user|project>`,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
};
|
|
175
|
+
}
|
|
@@ -7,8 +7,8 @@ export interface InitializeDecisionAgentsGuidanceOptions {
|
|
|
7
7
|
decisionsRoot: string;
|
|
8
8
|
}
|
|
9
9
|
export interface DecisionAgentsGuidanceResult {
|
|
10
|
-
root: UpsertSectionResult
|
|
11
|
-
scoped: UpsertSectionResult
|
|
10
|
+
root: UpsertSectionResult;
|
|
11
|
+
scoped: UpsertSectionResult;
|
|
12
12
|
}
|
|
13
13
|
export declare function initializeScopedDecisionAgentsGuidance(decisionsRoot: string): Promise<UpsertSectionResult>;
|
|
14
14
|
export declare function initializeDecisionAgentsGuidance(options: InitializeDecisionAgentsGuidanceOptions): Promise<DecisionAgentsGuidanceResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-guidance.d.ts","sourceRoot":"","sources":["../../../src/commands/decision/agents-guidance.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAwBvD,wBAAgB,8BAA8B,CAC5C,aAAa,SAAyB,GACrC,MAAM,CAWR;AAED,wBAAgB,oCAAoC,IAAI,MAAM,CAU7D;AAED,MAAM,WAAW,uCAAuC;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,mBAAmB,CAAC
|
|
1
|
+
{"version":3,"file":"agents-guidance.d.ts","sourceRoot":"","sources":["../../../src/commands/decision/agents-guidance.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAwBvD,wBAAgB,8BAA8B,CAC5C,aAAa,SAAyB,GACrC,MAAM,CAWR;AAED,wBAAgB,oCAAoC,IAAI,MAAM,CAU7D;AAED,MAAM,WAAW,uCAAuC;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED,wBAAsB,sCAAsC,CAC1D,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAO9B;AAED,wBAAsB,gCAAgC,CACpD,OAAO,EAAE,uCAAuC,GAC/C,OAAO,CAAC,4BAA4B,CAAC,CAavC"}
|
|
@@ -45,8 +45,5 @@ export async function initializeScopedDecisionAgentsGuidance(decisionsRoot) {
|
|
|
45
45
|
export async function initializeDecisionAgentsGuidance(options) {
|
|
46
46
|
const scoped = await initializeScopedDecisionAgentsGuidance(options.decisionsRoot);
|
|
47
47
|
const root = await upsertAgentsMdSection(options.projectRoot, DECISION_AGENTS_SECTION_KEY, buildDecisionAgentsSectionBody(displayDecisionsPath(options.projectRoot, options.decisionsRoot)));
|
|
48
|
-
return {
|
|
49
|
-
root: root.action,
|
|
50
|
-
scoped: scoped.action,
|
|
51
|
-
};
|
|
48
|
+
return { root, scoped };
|
|
52
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/decision/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/decision/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAO5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAyB7D,UAAU,2BAA2B;IACnC,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,gCAAgC,EAAE,OAAO,gCAAgC,CAAC;IAC1E,yBAAyB,EAAE,OAAO,yBAAyB,CAAC;IAC5D,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;CACvD;AAmED,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACnD,OAAO,CA6OT"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { buildCommandContext } from '../../app/command-context.js';
|
|
3
3
|
import { resolvePjmAdoption } from '../pjm/adoption.js';
|
|
4
|
+
import { formatAgentsMdGuidanceResult, formatAgentsMdMutationFailure, } from '../shared/agents-md.js';
|
|
4
5
|
import { readGlobalOptions } from '../shared/shared.utils.js';
|
|
5
6
|
import { CliError } from '../../errors/index.js';
|
|
6
7
|
import { resolveAssetsRoot } from '../../fs/assets.js';
|
|
@@ -80,23 +81,41 @@ export function createDecisionCommand(overrides = {}) {
|
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
catch (error) {
|
|
83
|
-
|
|
84
|
-
throw new Error(`Decision index initialized at ${result.decisionsRoot}, but AGENTS.md guidance could not be written: ${message}. Fix the guidance write error and rerun \`oat decision init\`.`, { cause: error });
|
|
84
|
+
throw new Error(`Decision scaffold completed, but AGENTS.md guidance could not be written: ${formatAgentsMdMutationFailure(error)} Fix the guidance write error and rerun \`oat decision init\`.`, { cause: error });
|
|
85
85
|
}
|
|
86
|
+
const guidanceIncomplete = [guidance.root, guidance.scoped].some(({ action }) => action === 'manual-required' || action === 'blocked');
|
|
86
87
|
if (context.json) {
|
|
87
|
-
context.logger.json(
|
|
88
|
+
context.logger.json(guidanceIncomplete
|
|
89
|
+
? {
|
|
90
|
+
status: 'partial',
|
|
91
|
+
scaffold: { status: 'complete' },
|
|
92
|
+
created: result.created,
|
|
93
|
+
skipped: result.skipped,
|
|
94
|
+
guidance,
|
|
95
|
+
}
|
|
96
|
+
: { status: 'ok', ...result, guidance });
|
|
88
97
|
}
|
|
89
98
|
else {
|
|
90
|
-
context.logger.info(
|
|
99
|
+
context.logger.info(guidanceIncomplete
|
|
100
|
+
? 'Initialized decision scaffold.'
|
|
101
|
+
: `Initialized decision scaffold at ${result.decisionsRoot}`);
|
|
91
102
|
if (result.created.length > 0) {
|
|
92
103
|
context.logger.info(`Created: ${result.created.join(', ')}`);
|
|
93
104
|
}
|
|
94
105
|
if (result.skipped.length > 0) {
|
|
95
106
|
context.logger.info(`Skipped existing: ${result.skipped.join(', ')}`);
|
|
96
107
|
}
|
|
97
|
-
context.logger.info(`AGENTS.md guidance: root=${guidance.root}, decisions=${guidance.scoped}`);
|
|
108
|
+
context.logger.info(`AGENTS.md guidance: root=${guidance.root.action}, decisions=${guidance.scoped.action}`);
|
|
109
|
+
if (guidanceIncomplete) {
|
|
110
|
+
context.logger.warn('Decision scaffold completed; AGENTS.md guidance requires manual action.');
|
|
111
|
+
for (const guidanceResult of [guidance.root, guidance.scoped]) {
|
|
112
|
+
for (const line of formatAgentsMdGuidanceResult(guidanceResult)) {
|
|
113
|
+
context.logger.info(line);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
98
117
|
}
|
|
99
|
-
process.exitCode = 0;
|
|
118
|
+
process.exitCode = guidanceIncomplete ? 1 : 0;
|
|
100
119
|
}
|
|
101
120
|
catch (error) {
|
|
102
121
|
reportError(context, error);
|
|
@@ -4,13 +4,19 @@ import { type PromptContext, type SelectChoice } from '../../shared/shared.promp
|
|
|
4
4
|
import { type OatConfig } from '../../../config/oat-config.js';
|
|
5
5
|
import { Command } from 'commander';
|
|
6
6
|
import { type DocsInitResolvedOptions } from './resolve-options.js';
|
|
7
|
+
import { type RootPackagePatchResult } from './root-package.js';
|
|
8
|
+
interface DocsInitExecutionResult {
|
|
9
|
+
createdFiles: string[];
|
|
10
|
+
appRoot: string;
|
|
11
|
+
rootPackagePatch: RootPackagePatchResult;
|
|
12
|
+
}
|
|
7
13
|
interface DocsInitDependencies {
|
|
8
14
|
buildCommandContext: (options: GlobalOptions) => CommandContext;
|
|
9
15
|
resolveAssetsRoot: () => Promise<string>;
|
|
10
16
|
detectRepoShape: (repoRoot: string) => Promise<'monorepo' | 'single-package'>;
|
|
11
17
|
inputWithDefault: (message: string, defaultValue: string, ctx: PromptContext) => Promise<string | null>;
|
|
12
18
|
selectWithAbort: <T extends string>(message: string, choices: SelectChoice<T>[], ctx: PromptContext) => Promise<T | null>;
|
|
13
|
-
runDocsInit: (context: CommandContext, options: DocsInitResolvedOptions, assetsRoot: string) => Promise<void>;
|
|
19
|
+
runDocsInit: (context: CommandContext, options: DocsInitResolvedOptions, assetsRoot: string) => Promise<DocsInitExecutionResult | void>;
|
|
14
20
|
upsertAgentsMdSection: (repoRoot: string, key: string, body: string) => Promise<UpsertSectionResult>;
|
|
15
21
|
readOatConfig: (repoRoot: string) => Promise<OatConfig>;
|
|
16
22
|
confirmAction: (message: string, ctx: PromptContext) => Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,mBAAmB,EAIzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAG5C,OAAO,EAIL,KAAK,uBAAuB,EAK7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;AAexB,UAAU,uBAAuB;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,sBAAsB,CAAC;CAC1C;AAED,UAAU,oBAAoB;IAC5B,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC;IAC9E,gBAAgB,EAAE,CAChB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5B,eAAe,EAAE,CAAC,CAAC,SAAS,MAAM,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,EAC1B,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,WAAW,EAAE,CACX,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,uBAAuB,EAChC,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAC;IAC7C,qBAAqB,EAAE,CACrB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClC,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1E;AAqGD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAc7E;AA6JD,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAC5C,OAAO,CA6CT"}
|