@open-agent-toolkit/cli 0.3.10 → 0.3.12
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 +2 -1
- package/assets/bundle-metadata.json +1 -1
- package/assets/docs/cli-utilities/meta.json +13 -0
- package/assets/docs/cli-utilities/tool-packs.md +8 -2
- package/assets/docs/cli-utilities/workflow-gates.md +13 -0
- package/assets/docs/contributing/code.md +8 -2
- package/assets/docs/contributing/documentation.md +7 -1
- package/assets/docs/contributing/meta.json +15 -0
- package/assets/docs/docs-tooling/add-docs-to-a-repo.md +14 -5
- package/assets/docs/docs-tooling/commands.md +26 -8
- package/assets/docs/docs-tooling/meta.json +4 -0
- package/assets/docs/docs-tooling/workflows.md +2 -2
- package/assets/docs/guide/meta.json +4 -0
- package/assets/docs/meta.json +14 -0
- package/assets/docs/provider-sync/instruction-sync.md +8 -0
- package/assets/docs/provider-sync/meta.json +11 -0
- package/assets/docs/provider-sync/scope-and-surface.md +3 -4
- package/assets/docs/reference/cli-reference.md +5 -2
- package/assets/docs/reference/docs-index-contract.md +23 -6
- package/assets/docs/reference/file-locations.md +7 -2
- package/assets/docs/reference/index.md +1 -1
- package/assets/docs/reference/meta.json +10 -0
- package/assets/docs/reference/troubleshooting.md +41 -6
- package/assets/docs/workflows/ideas/meta.json +4 -0
- package/assets/docs/workflows/meta.json +4 -0
- package/assets/docs/workflows/projects/cursor-cloud.md +8 -3
- package/assets/docs/workflows/projects/evidence-layers.md +6 -8
- package/assets/docs/workflows/projects/implementation-execution.md +30 -4
- package/assets/docs/workflows/projects/lifecycle.md +7 -1
- package/assets/docs/workflows/projects/meta.json +25 -0
- package/assets/docs/workflows/projects/orchestration-model.md +5 -6
- package/assets/docs/workflows/skills/meta.json +10 -0
- package/assets/docs/workflows/skills/recon.md +31 -3
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-cursor-cloud-projects/SKILL.md +30 -16
- package/assets/skills/oat-dispatch-subagents/SKILL.md +4 -12
- package/assets/skills/oat-dispatch-subagents/references/managed-claude-example.json +1 -1
- package/assets/skills/oat-dispatch-subagents/references/provider-codex.md +51 -0
- package/assets/skills/oat-dispatch-subagents/references/record-schema.md +8 -7
- package/assets/skills/oat-docs-analyze/SKILL.md +28 -3
- package/assets/skills/oat-docs-apply/SKILL.md +3 -3
- package/assets/skills/oat-docs-authoring/SKILL.md +1 -1
- package/assets/skills/oat-docs-authoring/references/oat-fumadocs-contract.md +5 -2
- package/assets/skills/oat-docs-bootstrap/SKILL.md +4 -3
- package/assets/skills/oat-docs-bootstrap/assets/AGENTS.md.template +3 -3
- package/assets/skills/oat-pjm-decision/SKILL.md +3 -2
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +4 -4
- package/assets/skills/oat-project-complete/SKILL.md +47 -2
- package/assets/skills/oat-project-design/SKILL.md +10 -6
- package/assets/skills/oat-project-discover/SKILL.md +3 -3
- package/assets/skills/oat-project-dispatch-subagents/SKILL.md +3 -10
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +4 -4
- package/assets/skills/oat-project-implement/SKILL.md +1 -1
- package/assets/skills/oat-project-implement/references/completion-and-closeout.md +135 -3
- package/assets/skills/oat-project-implement/references/dispatch-and-dry-run.md +7 -9
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +4 -4
- package/assets/skills/oat-project-implement/references/plan-and-resume.md +1 -1
- package/assets/skills/oat-project-import-plan/SKILL.md +3 -3
- package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +4 -4
- package/assets/skills/oat-project-new/SKILL.md +3 -3
- package/assets/skills/oat-project-next/SKILL.md +50 -7
- package/assets/skills/oat-project-plan/SKILL.md +4 -4
- package/assets/skills/oat-project-plan-writing/SKILL.md +2 -2
- package/assets/skills/oat-project-pr-final/SKILL.md +11 -1
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +4 -4
- package/assets/skills/oat-project-promote-spec-driven/SKILL.md +2 -2
- package/assets/skills/oat-project-quick-start/SKILL.md +12 -8
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +4 -4
- package/assets/skills/oat-project-retro/SKILL.md +6 -3
- package/assets/skills/oat-project-review-provide/SKILL.md +2 -2
- package/assets/skills/oat-project-review-provide-remote/SKILL.md +2 -2
- package/assets/skills/oat-project-spec/SKILL.md +3 -3
- package/assets/skills/oat-project-summary/SKILL.md +22 -3
- package/assets/skills/oat-repo-improve/SKILL.md +2 -2
- package/assets/skills/recon/SKILL.md +24 -3
- package/assets/skills/recon/references/packet-contract.md +36 -6
- package/assets/skills/recon/references/profiles.md +3 -0
- package/assets/skills/recon/references/worker-contract.md +16 -3
- package/assets/skills/recon/scripts/create-review-brief.mjs +17 -86
- package/assets/skills/recon/scripts/lib/contracts.mjs +158 -41
- package/assets/skills/recon/scripts/lib/review-binding.mjs +123 -0
- package/assets/skills/recon/scripts/lib/routing.mjs +5 -2
- package/assets/skills/recon/scripts/reconcile-ledger.mjs +18 -7
- package/assets/skills/recon/scripts/render-packet.mjs +120 -1
- package/assets/skills/recon/scripts/validate-packet.mjs +119 -88
- package/assets/templates/state.md +1 -0
- package/dist/commands/backlog/new.d.ts +2 -2
- package/dist/commands/backlog/new.d.ts.map +1 -1
- package/dist/commands/backlog/new.js +2 -2
- package/dist/commands/decision/new.d.ts +2 -2
- package/dist/commands/decision/new.d.ts.map +1 -1
- package/dist/commands/decision/new.js +2 -2
- package/dist/commands/docs/nav/contents.d.ts +9 -0
- package/dist/commands/docs/nav/contents.d.ts.map +1 -1
- package/dist/commands/docs/nav/contents.js +7 -2
- package/dist/commands/docs/nav/fumadocs.d.ts +58 -0
- package/dist/commands/docs/nav/fumadocs.d.ts.map +1 -0
- package/dist/commands/docs/nav/fumadocs.js +326 -0
- package/dist/commands/docs/nav/sync.d.ts +31 -1
- package/dist/commands/docs/nav/sync.d.ts.map +1 -1
- package/dist/commands/docs/nav/sync.js +163 -6
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/instructions/instructions.utils.d.ts +19 -0
- package/dist/commands/instructions/instructions.utils.d.ts.map +1 -1
- package/dist/commands/instructions/instructions.utils.js +89 -17
- package/dist/commands/instructions/sync/sync.d.ts.map +1 -1
- package/dist/commands/instructions/sync/sync.js +49 -2
- package/dist/commands/pjm/init.d.ts.map +1 -1
- package/dist/commands/pjm/init.js +2 -2
- package/dist/commands/project/closeout-check/closeout-invariant.d.ts +97 -0
- package/dist/commands/project/closeout-check/closeout-invariant.d.ts.map +1 -0
- package/dist/commands/project/closeout-check/closeout-invariant.js +301 -0
- package/dist/commands/project/closeout-check/index.d.ts +38 -0
- package/dist/commands/project/closeout-check/index.d.ts.map +1 -0
- package/dist/commands/project/closeout-check/index.js +117 -0
- package/dist/commands/project/complete-state/index.d.ts +4 -0
- package/dist/commands/project/complete-state/index.d.ts.map +1 -1
- package/dist/commands/project/complete-state/index.js +11 -13
- package/dist/commands/project/dispatch/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch/index.js +6 -30
- package/dist/commands/project/dispatch/record.d.ts +9 -18
- package/dist/commands/project/dispatch/record.d.ts.map +1 -1
- package/dist/commands/project/dispatch/record.js +15 -212
- package/dist/commands/project/index.d.ts.map +1 -1
- package/dist/commands/project/index.js +2 -0
- package/dist/commands/project/new/scaffold.d.ts +0 -1
- package/dist/commands/project/new/scaffold.d.ts.map +1 -1
- package/dist/commands/project/new/scaffold.js +19 -20
- package/dist/commands/project/promote/promote.d.ts +2 -2
- package/dist/commands/project/promote/promote.d.ts.map +1 -1
- package/dist/commands/project/promote/promote.js +13 -11
- package/dist/commands/shared/frontmatter.d.ts +21 -0
- package/dist/commands/shared/frontmatter.d.ts.map +1 -1
- package/dist/commands/shared/frontmatter.js +70 -4
- package/dist/commands/shared/template-source.d.ts +29 -0
- package/dist/commands/shared/template-source.d.ts.map +1 -0
- package/dist/commands/{pjm → shared}/template-source.js +24 -7
- package/dist/commands/state/generate.js +2 -2
- package/dist/commands/template/index.d.ts +10 -0
- package/dist/commands/template/index.d.ts.map +1 -0
- package/dist/commands/template/index.js +87 -0
- package/dist/commands/template/resolve.d.ts +31 -0
- package/dist/commands/template/resolve.d.ts.map +1 -0
- package/dist/commands/template/resolve.js +86 -0
- package/dist/fs/io.d.ts +0 -41
- package/dist/fs/io.d.ts.map +1 -1
- package/dist/fs/io.js +2 -414
- package/dist/providers/identity/absolute-paths.d.ts +4 -13
- package/dist/providers/identity/absolute-paths.d.ts.map +1 -1
- package/dist/providers/identity/absolute-paths.js +4 -17
- package/dist/providers/identity/generic-dispatch-record.d.ts +1 -1
- package/dist/providers/identity/generic-dispatch-record.js +2 -2
- package/dist/providers/identity/oat-dispatch-record.d.ts +4 -357
- package/dist/providers/identity/oat-dispatch-record.d.ts.map +1 -1
- package/dist/providers/identity/oat-dispatch-record.js +4 -236
- package/dist/release/public-package-contract.d.ts.map +1 -1
- package/dist/release/public-package-contract.js +12 -4
- package/dist/validation/skills.d.ts.map +1 -1
- package/dist/validation/skills.js +32 -6
- package/package.json +2 -2
- package/dist/commands/pjm/template-source.d.ts +0 -14
- package/dist/commands/pjm/template-source.d.ts.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
import { redactAbsolutePathsDeep } from './absolute-paths.js';
|
|
4
3
|
import { assertBoundedDispatchRecordSize, assertNoSensitiveDispatchContent, genericDispatchRecordSchema, normalizeDispatchKey, parseGenericDispatchRecord, } from './generic-dispatch-record.js';
|
|
@@ -62,136 +61,6 @@ const preStartRejectionCodeSchema = z
|
|
|
62
61
|
: `A ${prohibited} outcome is not a pre-start native-selection rejection and never authorizes fallback or replacement.`,
|
|
63
62
|
});
|
|
64
63
|
});
|
|
65
|
-
/**
|
|
66
|
-
* Immutable configured controls across a fallback link.
|
|
67
|
-
*
|
|
68
|
-
* The rule, so a newly added generic field has a default: a field is immutable
|
|
69
|
-
* when it describes the configured selection, the authorization for that
|
|
70
|
-
* selection, or the evidence that justified it. A field is mutable when it
|
|
71
|
-
* describes this record's own identity, how the work is briefed to its own
|
|
72
|
-
* child, its own launch lifecycle, or its own child's observed behaviour. When
|
|
73
|
-
* a new field is ambiguous, treat it as immutable — a false "controls
|
|
74
|
-
* preserved" claim is worse than a false mismatch.
|
|
75
|
-
*
|
|
76
|
-
* All 46 generic fields are accounted for. The 31 immutable ones are listed
|
|
77
|
-
* below. The 15 mutable ones, each with its reason:
|
|
78
|
-
* - `request_id`: the fallback is a distinct request and must have its own ID.
|
|
79
|
-
* - `caller`: the adapter layer that launches the fallback may differ.
|
|
80
|
-
* - `objective`: a canonical-instruction fallback necessarily rebriefs the work
|
|
81
|
-
* for a generic child rather than a resolved role.
|
|
82
|
-
* - `role_name`, `role_selector`: the fallback deliberately targets a generic
|
|
83
|
-
* worker; substituting the role is the whole point of the approximation, and
|
|
84
|
-
* the resolved role identity is bound separately through `roleInstructions`.
|
|
85
|
-
* - `candidates_considered`: the fallback evaluated a different candidate set.
|
|
86
|
-
* - `selection_reason`: constrained separately — a fallback must declare
|
|
87
|
-
* `pre-start-rejection`, which by definition differs from the trigger's.
|
|
88
|
-
* - `launch_status`, `child_outcome`: each record's own lifecycle state.
|
|
89
|
-
* - `runtime_confirmation`: observation of that record's own child. The
|
|
90
|
-
* fallback is a different child, so equality would be a false assertion.
|
|
91
|
-
* - `diagnostics`: per-record narration. A fallback legitimately explains why
|
|
92
|
-
* it exists.
|
|
93
|
-
* - `continuation_events`: continuation linkage belongs to the record that
|
|
94
|
-
* owns the handle.
|
|
95
|
-
* - `expected_output`, `verification_evidence`, `escalate_when`: the brief
|
|
96
|
-
* given to this record's own child, in the same class as `objective`.
|
|
97
|
-
*
|
|
98
|
-
* Included even though they are evidence rather than controls, because they
|
|
99
|
-
* record why the preserved selection was allowed:
|
|
100
|
-
* - `configured_invocation_evidence`: names the configuration that authorized
|
|
101
|
-
* the preserved route.
|
|
102
|
-
* - `catalog_snapshot`: names the catalog the selection was made against.
|
|
103
|
-
* - `guidance_reference`, `guidance_version`, `guidance_verified_at`,
|
|
104
|
-
* `guidance_status`: name the dated model guidance behind the selection and
|
|
105
|
-
* how fresh it was; a fallback restating `stale` as `fresh` would misstate
|
|
106
|
-
* provenance for a preserved target.
|
|
107
|
-
* - `classification_reason`: the rationale for `task_class`, which is itself a
|
|
108
|
-
* compared authorization control.
|
|
109
|
-
*/
|
|
110
|
-
export const IMMUTABLE_FALLBACK_CONTROL_FIELDS = [
|
|
111
|
-
'provider',
|
|
112
|
-
'selection_source',
|
|
113
|
-
'model_selector',
|
|
114
|
-
'model_selector_granularity',
|
|
115
|
-
'effort_selector',
|
|
116
|
-
'reasoning_mode_selector',
|
|
117
|
-
'service_tier_selector',
|
|
118
|
-
'selected_route',
|
|
119
|
-
'authority',
|
|
120
|
-
'authorization_scope',
|
|
121
|
-
'deadline_seconds',
|
|
122
|
-
'retry_limit',
|
|
123
|
-
'payload',
|
|
124
|
-
'fallback',
|
|
125
|
-
'catalog_snapshot',
|
|
126
|
-
'configured_invocation_evidence',
|
|
127
|
-
'guidance_reference',
|
|
128
|
-
'guidance_version',
|
|
129
|
-
'guidance_verified_at',
|
|
130
|
-
'guidance_status',
|
|
131
|
-
'dispatch_context',
|
|
132
|
-
'dispatch_policy',
|
|
133
|
-
'dispatch_ceiling',
|
|
134
|
-
'scope',
|
|
135
|
-
'action',
|
|
136
|
-
'role_class',
|
|
137
|
-
'task_class',
|
|
138
|
-
'model_class_floor',
|
|
139
|
-
'classification_source',
|
|
140
|
-
'classification_reason',
|
|
141
|
-
'floor_satisfaction',
|
|
142
|
-
];
|
|
143
|
-
/**
|
|
144
|
-
* The mutable complement, kept executable rather than only described above so a
|
|
145
|
-
* newly added generic field fails `covers every generic dispatch field` until
|
|
146
|
-
* somebody records a decision for it.
|
|
147
|
-
*/
|
|
148
|
-
export const MUTABLE_FALLBACK_CONTROL_FIELDS = [
|
|
149
|
-
'request_id',
|
|
150
|
-
'caller',
|
|
151
|
-
'objective',
|
|
152
|
-
'role_name',
|
|
153
|
-
'role_selector',
|
|
154
|
-
'candidates_considered',
|
|
155
|
-
'selection_reason',
|
|
156
|
-
'launch_status',
|
|
157
|
-
'child_outcome',
|
|
158
|
-
'runtime_confirmation',
|
|
159
|
-
'diagnostics',
|
|
160
|
-
'continuation_events',
|
|
161
|
-
'expected_output',
|
|
162
|
-
'verification_evidence',
|
|
163
|
-
'escalate_when',
|
|
164
|
-
];
|
|
165
|
-
export function canonicalEvidenceJson(value) {
|
|
166
|
-
if (Array.isArray(value)) {
|
|
167
|
-
return `[${value.map(canonicalEvidenceJson).join(',')}]`;
|
|
168
|
-
}
|
|
169
|
-
if (value !== null && typeof value === 'object') {
|
|
170
|
-
return `{${Object.entries(value)
|
|
171
|
-
.filter(([, entry]) => entry !== undefined)
|
|
172
|
-
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
|
173
|
-
.map(([key, entry]) => `${JSON.stringify(key)}:${canonicalEvidenceJson(entry)}`)
|
|
174
|
-
.join(',')}}`;
|
|
175
|
-
}
|
|
176
|
-
return JSON.stringify(value ?? null);
|
|
177
|
-
}
|
|
178
|
-
function controlProjection(record) {
|
|
179
|
-
return Object.fromEntries(IMMUTABLE_FALLBACK_CONTROL_FIELDS.map((field) => [
|
|
180
|
-
field,
|
|
181
|
-
record[field] ?? null,
|
|
182
|
-
]));
|
|
183
|
-
}
|
|
184
|
-
export function configuredControlDigest(record) {
|
|
185
|
-
return `sha256:${createHash('sha256')
|
|
186
|
-
.update(canonicalEvidenceJson(controlProjection(record)))
|
|
187
|
-
.digest('hex')}`;
|
|
188
|
-
}
|
|
189
|
-
function differingControlFields(left, right) {
|
|
190
|
-
const leftControls = controlProjection(left);
|
|
191
|
-
const rightControls = controlProjection(right);
|
|
192
|
-
return IMMUTABLE_FALLBACK_CONTROL_FIELDS.filter((field) => canonicalEvidenceJson(leftControls[field]) !==
|
|
193
|
-
canonicalEvidenceJson(rightControls[field]));
|
|
194
|
-
}
|
|
195
64
|
const redactedPathSchema = z
|
|
196
65
|
.string()
|
|
197
66
|
.regex(/^<(?:loaded|user|project)>\/agents\/[a-z0-9][a-z0-9_-]*\.md$/, 'expected <loaded|user|project>/agents/<name>.md');
|
|
@@ -449,9 +318,10 @@ export function buildRuntimeObservation(input) {
|
|
|
449
318
|
return parsed.success ? parsed.data : { status: 'not-reported' };
|
|
450
319
|
}
|
|
451
320
|
/**
|
|
452
|
-
* The
|
|
453
|
-
*
|
|
454
|
-
*
|
|
321
|
+
* Record shape only. The fallback claim and the fallback link were published
|
|
322
|
+
* through the removed dispatch journal; no event kind writes either now, so a
|
|
323
|
+
* validated record carries `fallbackClaim: null` and a `not-applicable`
|
|
324
|
+
* fallback. The fields stay so the validated output keeps its shape.
|
|
455
325
|
*/
|
|
456
326
|
const fallbackClaimSchema = z
|
|
457
327
|
.object({
|
|
@@ -499,22 +369,6 @@ const oatDispatchEvidenceEventSchema = z.discriminatedUnion('kind', [
|
|
|
499
369
|
rejection: rejectionSchema,
|
|
500
370
|
})
|
|
501
371
|
.strict(),
|
|
502
|
-
z
|
|
503
|
-
.object({
|
|
504
|
-
kind: z.literal('fallback-claim'),
|
|
505
|
-
requestId: z.string().min(1),
|
|
506
|
-
source: z.literal('provider-wrapper'),
|
|
507
|
-
claim: fallbackClaimSchema,
|
|
508
|
-
})
|
|
509
|
-
.strict(),
|
|
510
|
-
z
|
|
511
|
-
.object({
|
|
512
|
-
kind: z.literal('fallback-link'),
|
|
513
|
-
requestId: z.string().min(1),
|
|
514
|
-
source: z.literal('provider-wrapper'),
|
|
515
|
-
evidence: fallbackDispatchSchema,
|
|
516
|
-
})
|
|
517
|
-
.strict(),
|
|
518
372
|
z
|
|
519
373
|
.object({
|
|
520
374
|
kind: z.literal('runtime-observation'),
|
|
@@ -550,16 +404,6 @@ function oatPart(record) {
|
|
|
550
404
|
? oatRecordSchema.parse(record.oat)
|
|
551
405
|
: initialOatRecord();
|
|
552
406
|
}
|
|
553
|
-
function targetFor(record) {
|
|
554
|
-
return {
|
|
555
|
-
provider: record.provider,
|
|
556
|
-
modelSelector: record.model_selector,
|
|
557
|
-
effortSelector: record.effort_selector,
|
|
558
|
-
reasoningModeSelector: record.reasoning_mode_selector ?? null,
|
|
559
|
-
serviceTierSelector: record.service_tier_selector ?? null,
|
|
560
|
-
selectedRoute: record.selected_route,
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
407
|
function assertMatchingRequest(record, requestId) {
|
|
564
408
|
if (record.request_id !== requestId) {
|
|
565
409
|
throw new Error('OAT event request ID must match the generic record.');
|
|
@@ -611,82 +455,6 @@ export function augmentDispatchRecord(input) {
|
|
|
611
455
|
oat.preStartRejection = rejectionSchema.parse(event.rejection);
|
|
612
456
|
break;
|
|
613
457
|
}
|
|
614
|
-
case 'fallback-claim': {
|
|
615
|
-
const claim = event.claim;
|
|
616
|
-
if (record.launch_status !== 'blocked-before-start') {
|
|
617
|
-
throw new Error('Only a request blocked before start can claim a fallback.');
|
|
618
|
-
}
|
|
619
|
-
if (oat.preStartRejection === null) {
|
|
620
|
-
throw new Error('A fallback claim requires proven pre-start rejection evidence.');
|
|
621
|
-
}
|
|
622
|
-
if (oat.canonicalRole === null ||
|
|
623
|
-
oat.canonicalRole.status !== 'resolved') {
|
|
624
|
-
throw new Error('A fallback claim requires resolved canonical role evidence.');
|
|
625
|
-
}
|
|
626
|
-
if (oat.fallbackClaim !== null &&
|
|
627
|
-
oat.fallbackClaim.fallbackRequestId !== claim.fallbackRequestId) {
|
|
628
|
-
throw new Error('The rejected request already has a fallback.');
|
|
629
|
-
}
|
|
630
|
-
oat.fallbackClaim = claim;
|
|
631
|
-
break;
|
|
632
|
-
}
|
|
633
|
-
case 'fallback-link': {
|
|
634
|
-
const trigger = input.triggerRecord
|
|
635
|
-
? parsePersistedOatDispatchRecord(input.triggerRecord)
|
|
636
|
-
: null;
|
|
637
|
-
if (!trigger) {
|
|
638
|
-
throw new Error('Fallback requires the rejected trigger record.');
|
|
639
|
-
}
|
|
640
|
-
const evidence = fallbackDispatchSchema.parse(event.evidence);
|
|
641
|
-
if (evidence.triggerRequestId !== trigger.request_id ||
|
|
642
|
-
evidence.fallbackRequestId !== record.request_id ||
|
|
643
|
-
trigger.launch_status !== 'blocked-before-start' ||
|
|
644
|
-
trigger.oat.preStartRejection === null ||
|
|
645
|
-
evidence.rejection.source !== 'provider-wrapper' ||
|
|
646
|
-
evidence.rejection.code !== trigger.oat.preStartRejection.code ||
|
|
647
|
-
evidence.rejection.rejectedAt !==
|
|
648
|
-
trigger.oat.preStartRejection.rejectedAt ||
|
|
649
|
-
evidence.rejection.provesNoChildStarted !== true) {
|
|
650
|
-
throw new Error('Fallback lacks matching pre-start rejection evidence.');
|
|
651
|
-
}
|
|
652
|
-
if (record.selection_reason !== 'pre-start-rejection') {
|
|
653
|
-
throw new Error('A fallback record must state selection_reason pre-start-rejection.');
|
|
654
|
-
}
|
|
655
|
-
if (canonicalEvidenceJson(evidence.preservedTarget) !==
|
|
656
|
-
canonicalEvidenceJson(targetFor(record)) ||
|
|
657
|
-
canonicalEvidenceJson(targetFor(trigger)) !==
|
|
658
|
-
canonicalEvidenceJson(targetFor(record))) {
|
|
659
|
-
throw new Error('Fallback must preserve the exact target and controls.');
|
|
660
|
-
}
|
|
661
|
-
const changedControls = differingControlFields(trigger, record);
|
|
662
|
-
if (changedControls.length > 0) {
|
|
663
|
-
throw new Error(`Fallback must preserve the exact target and controls; ${changedControls.join(', ')} changed.`);
|
|
664
|
-
}
|
|
665
|
-
if (configuredControlDigest(trigger) !== configuredControlDigest(record)) {
|
|
666
|
-
throw new Error('Fallback must preserve the exact target and controls; the configured control digest changed.');
|
|
667
|
-
}
|
|
668
|
-
if (trigger.oat.fallbackClaim === null ||
|
|
669
|
-
trigger.oat.fallbackClaim.fallbackRequestId !== record.request_id) {
|
|
670
|
-
throw new Error('The rejected trigger must durably claim this fallback request before the fallback can publish.');
|
|
671
|
-
}
|
|
672
|
-
const triggerRole = trigger.oat.canonicalRole;
|
|
673
|
-
if (triggerRole === null || triggerRole.status !== 'resolved') {
|
|
674
|
-
throw new Error('Fallback requires resolved canonical role evidence on the rejected trigger.');
|
|
675
|
-
}
|
|
676
|
-
if (canonicalEvidenceJson(evidence.roleInstructions) !==
|
|
677
|
-
canonicalEvidenceJson(triggerRole)) {
|
|
678
|
-
throw new Error("Fallback role evidence must equal the trigger's resolved canonical role evidence exactly.");
|
|
679
|
-
}
|
|
680
|
-
if ((input.relatedRecords ?? [])
|
|
681
|
-
.map(parsePersistedOatDispatchRecord)
|
|
682
|
-
.some((related) => related.oat.fallback.status === 'fallback-dispatch' &&
|
|
683
|
-
related.oat.fallback.triggerRequestId === trigger.request_id) ||
|
|
684
|
-
oat.fallback.status === 'fallback-dispatch') {
|
|
685
|
-
throw new Error('The rejected request already has a fallback.');
|
|
686
|
-
}
|
|
687
|
-
oat.fallback = evidence;
|
|
688
|
-
break;
|
|
689
|
-
}
|
|
690
458
|
case 'runtime-observation':
|
|
691
459
|
if (oat.runtimeObservation.status === 'reported' &&
|
|
692
460
|
JSON.stringify(oat.runtimeObservation) !==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-package-contract.d.ts","sourceRoot":"","sources":["../../src/release/public-package-contract.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,KAAK,GAAG,cAAc,GAAG,iBAAiB,CAAC;IACjD,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,uBAAuB,EAAE,yBAAyB,EAAE,CAAC;IACrD,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,4BAA4B,EAAE,MAAM,EAAE,CAAC;IACvC,2BAA2B,EAAE,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"public-package-contract.d.ts","sourceRoot":"","sources":["../../src/release/public-package-contract.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,KAAK,GAAG,cAAc,GAAG,iBAAiB,CAAC;IACjD,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,uBAAuB,EAAE,yBAAyB,EAAE,CAAC;IACrD,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,4BAA4B,EAAE,MAAM,EAAE,CAAC;IACvC,2BAA2B,EAAE,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAkMD,wBAAgB,yBAAyB,IAAI,qBAAqB,EAAE,CAenE;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,QAAQ,EAAE,qBAAqB,GAC9B,MAAM,EAAE,CAIV;AAED,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,QAAQ,EAAE,qBAAqB,GAC9B,MAAM,EAAE,CAIV;AAED,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,QAAQ,EAAE,qBAAqB,GAC9B,MAAM,EAAE,CAMV;AAED,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACjD,QAAQ,EAAE,qBAAqB,GAC9B,MAAM,EAAE,CAoBV;AAED,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,MAAM,EAAE,CAmBV;AAED,wBAAgB,qCAAqC,CACnD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,kBAAkB,EAAE,SAAS,MAAM,EAAE,EACrC,qBAAqB,EAAE,SAAS,MAAM,EAAE,GACvC,MAAM,EAAE,CA0BV"}
|
|
@@ -108,7 +108,15 @@ const PUBLIC_PACKAGE_CONTRACTS = [
|
|
|
108
108
|
'.oat/scripts',
|
|
109
109
|
'apps/oat-docs/docs',
|
|
110
110
|
],
|
|
111
|
-
|
|
111
|
+
// Generated bundled assets, plus exactly the test paths this package's
|
|
112
|
+
// tsconfig leaves out of `dist` (DR-260927-test-only-paths-skip). Never
|
|
113
|
+
// broader than the compile exclusion: a test helper that compiles into
|
|
114
|
+
// `dist` still counts.
|
|
115
|
+
versionPolicyIgnorePatterns: [
|
|
116
|
+
'assets/**',
|
|
117
|
+
'src/**/*.test.ts',
|
|
118
|
+
'src/**/__tests__/**',
|
|
119
|
+
],
|
|
112
120
|
},
|
|
113
121
|
{
|
|
114
122
|
workspaceDir: 'packages/control-plane',
|
|
@@ -119,7 +127,7 @@ const PUBLIC_PACKAGE_CONTRACTS = [
|
|
|
119
127
|
requiredPackedTextFiles: [],
|
|
120
128
|
forbiddenPathPatterns: [...COMMON_FORBIDDEN_PATH_PATTERNS],
|
|
121
129
|
versionPolicyAdditionalRoots: [],
|
|
122
|
-
versionPolicyIgnorePatterns: [],
|
|
130
|
+
versionPolicyIgnorePatterns: ['**/*.test.ts', '**/*.spec.ts'],
|
|
123
131
|
},
|
|
124
132
|
{
|
|
125
133
|
workspaceDir: 'packages/docs-config',
|
|
@@ -130,7 +138,7 @@ const PUBLIC_PACKAGE_CONTRACTS = [
|
|
|
130
138
|
requiredPackedTextFiles: [],
|
|
131
139
|
forbiddenPathPatterns: [...COMMON_FORBIDDEN_PATH_PATTERNS],
|
|
132
140
|
versionPolicyAdditionalRoots: [],
|
|
133
|
-
versionPolicyIgnorePatterns: [],
|
|
141
|
+
versionPolicyIgnorePatterns: ['src/**/*.test.ts'],
|
|
134
142
|
},
|
|
135
143
|
{
|
|
136
144
|
workspaceDir: 'packages/docs-theme',
|
|
@@ -152,7 +160,7 @@ const PUBLIC_PACKAGE_CONTRACTS = [
|
|
|
152
160
|
requiredPackedTextFiles: [],
|
|
153
161
|
forbiddenPathPatterns: [...COMMON_FORBIDDEN_PATH_PATTERNS],
|
|
154
162
|
versionPolicyAdditionalRoots: [],
|
|
155
|
-
versionPolicyIgnorePatterns: [],
|
|
163
|
+
versionPolicyIgnorePatterns: ['src/**/*.test.ts'],
|
|
156
164
|
},
|
|
157
165
|
];
|
|
158
166
|
function getMetadataValue(packageJson, fieldPath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/validation/skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/validation/skills.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,uCAAuC;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sCAAsC;IACrD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAChD,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7B,UAAU,6BAA6B;IACrC,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAu1CD,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,uCAAuC,EAChD,YAAY,GAAE,6BAAkC,GAC/C,OAAO,CAAC,sCAAsC,CAAC,CAsBjD;AAsGD,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,wBAA6B,EACtC,YAAY,GAAE,6BAAkC,GAC/C,OAAO,CAAC,uBAAuB,CAAC,CAsJlC"}
|
|
@@ -2,7 +2,7 @@ import { execFile as execFileCallback } from 'node:child_process';
|
|
|
2
2
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { promisify } from 'node:util';
|
|
5
|
-
import { getFrontmatterBlock, parseSkillFrontmatter, resolveSkillVersion, } from '../commands/shared/frontmatter.js';
|
|
5
|
+
import { findSkillFrontmatterTypeProblems, getFrontmatterBlock, parseSkillFrontmatter, resolveSkillVersion, } from '../commands/shared/frontmatter.js';
|
|
6
6
|
const execFileAsync = promisify(execFileCallback);
|
|
7
7
|
async function isDirectory(path) {
|
|
8
8
|
try {
|
|
@@ -459,12 +459,26 @@ function hasTrueFrontmatterValue(frontmatter, key) {
|
|
|
459
459
|
return (frontmatterHasKey(frontmatter, key) &&
|
|
460
460
|
getFrontmatterScalar(frontmatter, key) === 'true');
|
|
461
461
|
}
|
|
462
|
-
|
|
462
|
+
/**
|
|
463
|
+
* A block-relative problem position as a SKILL.md line and column. The block
|
|
464
|
+
* starts on the line after the opening `---`, so block line N is file line
|
|
465
|
+
* N + 1.
|
|
466
|
+
*/
|
|
467
|
+
function fileLocation(problem) {
|
|
468
|
+
return problem.line === null
|
|
469
|
+
? null
|
|
470
|
+
: `line ${problem.line + 1}, column ${problem.column ?? 1}`;
|
|
471
|
+
}
|
|
472
|
+
function unreadableFrontmatterFinding(file, problem) {
|
|
473
|
+
const location = problem ? fileLocation(problem) : null;
|
|
474
|
+
const detail = problem
|
|
475
|
+
? `: ${location === null ? '' : `${location}: `}${problem.message}`
|
|
476
|
+
: '';
|
|
463
477
|
return {
|
|
464
478
|
file,
|
|
465
479
|
code: 'skill-frontmatter-unreadable',
|
|
466
480
|
severity: 'error',
|
|
467
|
-
message:
|
|
481
|
+
message: `Frontmatter must be a valid YAML mapping with unique keys (version could not be read)${detail}`,
|
|
468
482
|
};
|
|
469
483
|
}
|
|
470
484
|
function pushUniqueFinding(findings, finding) {
|
|
@@ -882,7 +896,7 @@ async function collectChangedSkillVersionBumpFindings(repoRoot, baseRef, changed
|
|
|
882
896
|
// `validateOatSkills` runs the structural version-source pass before this
|
|
883
897
|
// collector, so the same file can already carry the current-side finding.
|
|
884
898
|
if (parsedCurrent?.malformed) {
|
|
885
|
-
pushUniqueFinding(findings, unreadableFrontmatterFinding(skillPath));
|
|
899
|
+
pushUniqueFinding(findings, unreadableFrontmatterFinding(skillPath, parsedCurrent.problem));
|
|
886
900
|
continue;
|
|
887
901
|
}
|
|
888
902
|
if (parsedCurrent?.unusableVersionDeclaration) {
|
|
@@ -1024,8 +1038,8 @@ async function collectSkillVersionSourceFindings(skillsRoot, skillDirs, findings
|
|
|
1024
1038
|
if (parsed.malformed) {
|
|
1025
1039
|
// Reported for every skill, not just `oat-*` ones: unreadable
|
|
1026
1040
|
// frontmatter is exactly the state that would otherwise make a version
|
|
1027
|
-
// silently unreadable everywhere.
|
|
1028
|
-
findings.push(unreadableFrontmatterFinding(skillPath));
|
|
1041
|
+
// silently unreadable everywhere. The parser's position travels with it.
|
|
1042
|
+
findings.push(unreadableFrontmatterFinding(skillPath, parsed.problem));
|
|
1029
1043
|
continue;
|
|
1030
1044
|
}
|
|
1031
1045
|
// Declaration usability is checked here, before the unresolved bail, so it
|
|
@@ -1102,6 +1116,18 @@ export async function validateOatSkills(repoRoot, options = {}, dependencies = {
|
|
|
1102
1116
|
});
|
|
1103
1117
|
}
|
|
1104
1118
|
}
|
|
1119
|
+
// Typed after parsing, beside the semantic checks below rather than in
|
|
1120
|
+
// place of them; a block that does not parse is reported once, with its
|
|
1121
|
+
// location, by collectSkillVersionSourceFindings.
|
|
1122
|
+
for (const problem of findSkillFrontmatterTypeProblems(fm)) {
|
|
1123
|
+
const location = fileLocation(problem);
|
|
1124
|
+
findings.push({
|
|
1125
|
+
file: skillPath,
|
|
1126
|
+
code: 'skill-frontmatter-type',
|
|
1127
|
+
severity: 'error',
|
|
1128
|
+
message: `Frontmatter key ${problem.message}${location === null ? '' : ` (${location})`}`,
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1105
1131
|
const frontmatterName = getFrontmatterScalar(fm, 'name');
|
|
1106
1132
|
if (frontmatterName && frontmatterName !== dir) {
|
|
1107
1133
|
findings.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Open Agent Toolkit CLI",
|
|
6
6
|
"homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"ora": "^9.0.0",
|
|
35
35
|
"yaml": "2.8.2",
|
|
36
36
|
"zod": "^3.25.76",
|
|
37
|
-
"@open-agent-toolkit/control-plane": "0.3.
|
|
37
|
+
"@open-agent-toolkit/control-plane": "0.3.12"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.10.0",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type PjmTemplateTier = 'repository' | 'user' | 'bundle';
|
|
2
|
-
export interface ResolvePjmTemplateOptions {
|
|
3
|
-
name: string;
|
|
4
|
-
assetsRoot: string;
|
|
5
|
-
templatesRoot?: string;
|
|
6
|
-
home?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ResolvedPjmTemplate {
|
|
9
|
-
content: string;
|
|
10
|
-
path: string;
|
|
11
|
-
tier: PjmTemplateTier;
|
|
12
|
-
}
|
|
13
|
-
export declare function resolvePjmTemplate(options: ResolvePjmTemplateOptions): Promise<ResolvedPjmTemplate>;
|
|
14
|
-
//# sourceMappingURL=template-source.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-source.d.ts","sourceRoot":"","sources":["../../../src/commands/pjm/template-source.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/D,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;CACvB;AAkBD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CA2C9B"}
|