@open-agent-toolkit/cli 0.3.7 → 0.3.8
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/configuration.md +15 -1
- package/assets/docs/cli-utilities/workflow-gates.md +37 -0
- package/assets/docs/provider-sync/commands.md +6 -0
- package/assets/docs/provider-sync/providers.md +20 -0
- package/assets/docs/provider-sync/scope-and-surface.md +2 -0
- package/assets/docs/reference/cli-reference.md +2 -1
- package/assets/docs/workflows/projects/evidence-layers.md +5 -1
- package/assets/docs/workflows/projects/retro.md +7 -0
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-agent-instructions-analyze/SKILL.md +1 -1
- package/assets/skills/oat-agent-instructions-analyze/scripts/resolve-providers.sh +17 -6
- package/assets/skills/oat-dispatch-subagents/SKILL.md +1 -1
- package/assets/skills/oat-dispatch-subagents/references/managed-claude-example.json +387 -0
- package/assets/skills/oat-dispatch-subagents/references/record-schema.md +75 -0
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +1 -1
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-implement/SKILL.md +1 -1
- package/assets/skills/oat-project-implement/references/dispatch-and-dry-run.md +24 -22
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +1 -1
- package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +1 -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-retro/SKILL.md +70 -6
- package/assets/skills/oat-project-review-provide/SKILL.md +3 -1
- package/assets/skills/oat-project-review-provide-remote/SKILL.md +3 -1
- package/dist/agents/canonical/resolve.d.ts +6 -4
- package/dist/agents/canonical/resolve.d.ts.map +1 -1
- package/dist/agents/canonical/resolve.js +6 -4
- package/dist/commands/gate/index.d.ts.map +1 -1
- package/dist/commands/gate/index.js +51 -2
- package/dist/commands/gate/review-verdict.d.ts +22 -0
- package/dist/commands/gate/review-verdict.d.ts.map +1 -1
- package/dist/commands/gate/review-verdict.js +111 -0
- package/dist/commands/project/dispatch/canonical-role.d.ts +33 -0
- package/dist/commands/project/dispatch/canonical-role.d.ts.map +1 -0
- package/dist/commands/project/dispatch/canonical-role.js +114 -0
- package/dist/commands/project/dispatch/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch/index.js +3 -1
- package/dist/commands/project/dispatch/record.d.ts.map +1 -1
- package/dist/commands/project/dispatch/record.js +146 -4
- package/dist/commands/sync/apply.d.ts.map +1 -1
- package/dist/commands/sync/apply.js +28 -21
- package/dist/commands/tools/shared/sync-evidence.d.ts.map +1 -1
- package/dist/commands/tools/shared/sync-evidence.js +32 -5
- package/dist/config/oat-config.d.ts +8 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +116 -1
- package/dist/engine/compute-plan.d.ts.map +1 -1
- package/dist/engine/compute-plan.js +31 -3
- package/dist/providers/claude/dispatch-envelope.d.ts +53 -0
- package/dist/providers/claude/dispatch-envelope.d.ts.map +1 -1
- package/dist/providers/claude/dispatch-envelope.js +324 -48
- package/dist/providers/claude/rule-transform.js +1 -1
- package/dist/providers/copilot/rule-transform.js +1 -1
- package/dist/providers/cursor/rule-transform.js +1 -1
- package/dist/providers/identity/absolute-paths.d.ts +13 -0
- package/dist/providers/identity/absolute-paths.d.ts.map +1 -1
- package/dist/providers/identity/absolute-paths.js +27 -14
- package/dist/providers/identity/generic-dispatch-record.d.ts +212 -0
- package/dist/providers/identity/generic-dispatch-record.d.ts.map +1 -1
- package/dist/providers/identity/generic-dispatch-record.js +78 -19
- package/dist/providers/identity/oat-dispatch-record.d.ts +5 -0
- package/dist/providers/identity/oat-dispatch-record.d.ts.map +1 -1
- package/dist/providers/identity/oat-dispatch-record.js +11 -2
- package/dist/providers/shared/registry.d.ts +6 -0
- package/dist/providers/shared/registry.d.ts.map +1 -1
- package/dist/providers/shared/registry.js +30 -0
- package/dist/rules/canonical/parse.d.ts.map +1 -1
- package/dist/rules/canonical/parse.js +38 -3
- package/package.json +2 -2
|
@@ -635,13 +635,18 @@ function normalizePjmRemoteSharedConfig(value, configPath) {
|
|
|
635
635
|
function assertClosedPjmRemoteSharedConfig(value, configPath) {
|
|
636
636
|
const findings = [];
|
|
637
637
|
collectUnknownPjmRemoteKeys(value, ['schemaVersion', 'storage', 'policy'], 'pjm.remote', findings);
|
|
638
|
+
if ('schemaVersion' in value && typeof value.schemaVersion !== 'number') {
|
|
639
|
+
findings.push(`pjm.remote.schemaVersion (expected number, received ${describePjmRemoteStructure(value.schemaVersion)})`);
|
|
640
|
+
}
|
|
638
641
|
if ('storage' in value &&
|
|
639
642
|
collectPjmRemoteExpectedObject(value.storage, 'pjm.remote.storage', findings)) {
|
|
640
643
|
collectUnknownPjmRemoteKeys(value.storage, ['state'], 'pjm.remote.storage', findings);
|
|
644
|
+
collectPjmRemoteStringLeaf(value.storage, 'state', 'pjm.remote.storage', findings);
|
|
641
645
|
}
|
|
642
646
|
if ('policy' in value &&
|
|
643
647
|
collectPjmRemoteExpectedObject(value.policy, 'pjm.remote.policy', findings)) {
|
|
644
648
|
collectUnknownPjmRemoteKeys(value.policy, ['description', 'authority', 'providers'], 'pjm.remote.policy', findings);
|
|
649
|
+
collectPjmRemoteStringLeaf(value.policy, 'description', 'pjm.remote.policy', findings);
|
|
645
650
|
if ('authority' in value.policy) {
|
|
646
651
|
collectPjmRemoteAuthorityFindings(value.policy.authority, 'pjm.remote.policy.authority', findings);
|
|
647
652
|
}
|
|
@@ -656,6 +661,7 @@ function assertClosedPjmRemoteSharedConfig(value, configPath) {
|
|
|
656
661
|
continue;
|
|
657
662
|
}
|
|
658
663
|
collectUnknownPjmRemoteKeys(providerPolicy, ['description', 'authority'], `pjm.remote.policy.providers.${provider}`, findings);
|
|
664
|
+
collectPjmRemoteStringLeaf(providerPolicy, 'description', `pjm.remote.policy.providers.${provider}`, findings);
|
|
659
665
|
if ('authority' in providerPolicy) {
|
|
660
666
|
collectPjmRemoteAuthorityFindings(providerPolicy.authority, `pjm.remote.policy.providers.${provider}.authority`, findings);
|
|
661
667
|
}
|
|
@@ -670,11 +676,27 @@ function collectPjmRemoteAuthorityFindings(value, path, findings) {
|
|
|
670
676
|
if (!collectPjmRemoteExpectedObject(value, path, findings))
|
|
671
677
|
return;
|
|
672
678
|
collectUnknownPjmRemoteKeys(value, ['default', 'operations'], path, findings);
|
|
679
|
+
collectPjmRemoteStringLeaf(value, 'default', path, findings);
|
|
673
680
|
if ('operations' in value &&
|
|
674
681
|
collectPjmRemoteExpectedObject(value.operations, `${path}.operations`, findings)) {
|
|
675
682
|
collectUnknownPjmRemoteKeys(value.operations, PJM_REMOTE_OPERATION_CLASSES, `${path}.operations`, findings);
|
|
683
|
+
for (const operation of PJM_REMOTE_OPERATION_CLASSES) {
|
|
684
|
+
collectPjmRemoteStringLeaf(value.operations, operation, `${path}.operations`, findings);
|
|
685
|
+
}
|
|
676
686
|
}
|
|
677
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* Records a present leaf whose value is not a string.
|
|
690
|
+
*
|
|
691
|
+
* Only the *type* is checked: an unrecognized string keeps its documented
|
|
692
|
+
* coercion in the normalizer. The finding names the structure type, never the
|
|
693
|
+
* value, so a secret pasted into the wrong field cannot leak into the error.
|
|
694
|
+
*/
|
|
695
|
+
function collectPjmRemoteStringLeaf(value, key, path, findings) {
|
|
696
|
+
if (!(key in value) || typeof value[key] === 'string')
|
|
697
|
+
return;
|
|
698
|
+
findings.push(`${path}.${key} (expected string, received ${describePjmRemoteStructure(value[key])})`);
|
|
699
|
+
}
|
|
678
700
|
function collectPjmRemoteExpectedObject(value, path, findings) {
|
|
679
701
|
if (isRecord(value) && !Array.isArray(value))
|
|
680
702
|
return true;
|
|
@@ -1219,10 +1241,103 @@ export async function readOatLocalConfig(repoRoot) {
|
|
|
1219
1241
|
throw error;
|
|
1220
1242
|
}
|
|
1221
1243
|
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Reads the existing config file as raw JSON for ordering and no-op checks.
|
|
1246
|
+
*
|
|
1247
|
+
* Parses through `parseJsonConfig`, the same tolerant parser every config
|
|
1248
|
+
* reader uses (trailing commas accepted, `__proto__` kept as data), so a file
|
|
1249
|
+
* the readers accept is never treated as unparsable here. Deliberately
|
|
1250
|
+
* bypasses the normalizer, which throws on the malformed values repair flows
|
|
1251
|
+
* exist to remove. A missing or unparsable file yields `undefined`, so the
|
|
1252
|
+
* caller always writes it.
|
|
1253
|
+
*/
|
|
1254
|
+
async function readRawJsonForWrite(filePath) {
|
|
1255
|
+
let raw;
|
|
1256
|
+
try {
|
|
1257
|
+
raw = await readFile(filePath, 'utf8');
|
|
1258
|
+
}
|
|
1259
|
+
catch {
|
|
1260
|
+
return undefined;
|
|
1261
|
+
}
|
|
1262
|
+
try {
|
|
1263
|
+
return parseJsonConfig(raw, filePath);
|
|
1264
|
+
}
|
|
1265
|
+
catch {
|
|
1266
|
+
return undefined;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
function isPlainJsonObject(value) {
|
|
1270
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
1271
|
+
}
|
|
1272
|
+
/**
|
|
1273
|
+
* Orders `value` like `template`, recursively: keys already present in the
|
|
1274
|
+
* template keep their existing position, and new keys follow in the
|
|
1275
|
+
* normalizer's order. Arrays keep their own element order.
|
|
1276
|
+
*/
|
|
1277
|
+
function orderLike(value, template) {
|
|
1278
|
+
if (Array.isArray(value)) {
|
|
1279
|
+
return value.map((element, index) => orderLike(element, Array.isArray(template) ? template[index] : undefined));
|
|
1280
|
+
}
|
|
1281
|
+
if (!isPlainJsonObject(value))
|
|
1282
|
+
return value;
|
|
1283
|
+
const templateObject = isPlainJsonObject(template) ? template : {};
|
|
1284
|
+
const ordered = {};
|
|
1285
|
+
// Define rather than assign: a config key named `__proto__` is data and must
|
|
1286
|
+
// never replace the output object's prototype.
|
|
1287
|
+
const place = (key, next) => {
|
|
1288
|
+
Object.defineProperty(ordered, key, {
|
|
1289
|
+
value: next,
|
|
1290
|
+
enumerable: true,
|
|
1291
|
+
writable: true,
|
|
1292
|
+
configurable: true,
|
|
1293
|
+
});
|
|
1294
|
+
};
|
|
1295
|
+
for (const key of Object.keys(templateObject)) {
|
|
1296
|
+
if (Object.hasOwn(value, key) && value[key] !== undefined) {
|
|
1297
|
+
place(key, orderLike(value[key], templateObject[key]));
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
for (const key of Object.keys(value)) {
|
|
1301
|
+
if (!Object.hasOwn(ordered, key) && value[key] !== undefined) {
|
|
1302
|
+
place(key, orderLike(value[key], undefined));
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
return ordered;
|
|
1306
|
+
}
|
|
1307
|
+
function jsonDeepEqual(left, right) {
|
|
1308
|
+
if (Array.isArray(left) || Array.isArray(right)) {
|
|
1309
|
+
return (Array.isArray(left) &&
|
|
1310
|
+
Array.isArray(right) &&
|
|
1311
|
+
left.length === right.length &&
|
|
1312
|
+
left.every((element, index) => jsonDeepEqual(element, right[index])));
|
|
1313
|
+
}
|
|
1314
|
+
if (isPlainJsonObject(left) || isPlainJsonObject(right)) {
|
|
1315
|
+
if (!isPlainJsonObject(left) || !isPlainJsonObject(right))
|
|
1316
|
+
return false;
|
|
1317
|
+
const leftKeys = Object.keys(left);
|
|
1318
|
+
return (leftKeys.length === Object.keys(right).length &&
|
|
1319
|
+
leftKeys.every((key) => Object.hasOwn(right, key) && jsonDeepEqual(left[key], right[key])));
|
|
1320
|
+
}
|
|
1321
|
+
return Object.is(left, right);
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Writes the shared config, preserving the existing file's key order and
|
|
1325
|
+
* skipping writes that would not change its JSON value (GitHub #329, #311).
|
|
1326
|
+
*
|
|
1327
|
+
* Formatting-only differences (indentation, trailing newline) therefore leave
|
|
1328
|
+
* the file byte-identical, while repairs, raw-disk removals, and rewrites of a
|
|
1329
|
+
* malformed or unparsable file always land.
|
|
1330
|
+
*/
|
|
1222
1331
|
export async function writeOatConfig(repoRoot, config) {
|
|
1223
1332
|
const configPath = getConfigPath(repoRoot);
|
|
1224
1333
|
const normalized = normalizeOatConfig(config, configPath);
|
|
1225
|
-
await
|
|
1334
|
+
const existing = await readRawJsonForWrite(configPath);
|
|
1335
|
+
// Round-trip through JSON so the comparison sees exactly what would be
|
|
1336
|
+
// serialized (undefined-valued keys dropped).
|
|
1337
|
+
const output = JSON.parse(JSON.stringify(existing === undefined ? normalized : orderLike(normalized, existing)));
|
|
1338
|
+
if (existing !== undefined && jsonDeepEqual(existing, output))
|
|
1339
|
+
return;
|
|
1340
|
+
await atomicWriteJson(configPath, output);
|
|
1226
1341
|
}
|
|
1227
1342
|
export async function writeOatLocalConfig(repoRoot, config) {
|
|
1228
1343
|
const configPath = getLocalConfigPath(repoRoot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-plan.d.ts","sourceRoot":"","sources":["../../src/engine/compute-plan.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"compute-plan.d.ts","sourceRoot":"","sources":["../../src/engine/compute-plan.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAItD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EAGd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAEV,WAAW,EACX,oBAAoB,EACpB,QAAQ,EAET,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,UAAU,mBAAmB;IAC3B,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,sCAAsC,CAAC,EAAE,QAAQ,CAC/C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAClC,CAAC;IACF,+BAA+B,CAAC,EAAE,SAAS;QACzC,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,WAAW,CAAC;KAC1B,EAAE,CAAC;IACJ,gCAAgC,CAAC,EAAE,OAAO,CAAC;CAC5C;AAiOD,wBAAsB,iCAAiC,CACrD,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,oBAAoB,CAAC,CAqG/B;AAyJD,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EAAE,iBAAiB,EAC5B,qBAAqB,EACrB,sCAAsC,EACtC,+BAAoC,EACpC,gCAAwC,GACzC,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CA6dzC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { access, lstat, readFile, readlink, stat } from 'node:fs/promises';
|
|
2
2
|
import { basename, dirname, join, normalize, relative, resolve, } from 'node:path';
|
|
3
|
+
import { CliError } from '../errors/index.js';
|
|
3
4
|
import { computeContentHash, computeStringHash } from '../manifest/hash.js';
|
|
4
5
|
import { findEntry } from '../manifest/manager.js';
|
|
5
6
|
import { getSyncMappings } from '../providers/shared/adapter.utils.js';
|
|
@@ -315,6 +316,7 @@ export async function computeSyncPlan({ canonical, adapters, manifest, scope, co
|
|
|
315
316
|
const collections = [];
|
|
316
317
|
const scopeRoot = resolveScopeRoot(canonical, explicitScopeRoot);
|
|
317
318
|
const seenCanonicalKeys = new Set();
|
|
319
|
+
const transformFailures = new Map();
|
|
318
320
|
const activeProviderNames = new Set();
|
|
319
321
|
const activeMappingsByProvider = new Map();
|
|
320
322
|
const manifestV2 = manifest;
|
|
@@ -538,9 +540,27 @@ export async function computeSyncPlan({ canonical, adapters, manifest, scope, co
|
|
|
538
540
|
if (!entryInsideMapping(canonicalEntry, mapping.canonicalDir)) {
|
|
539
541
|
continue;
|
|
540
542
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
543
|
+
let renderedContent;
|
|
544
|
+
if (mapping.transformCanonical && canonicalEntry.isFile) {
|
|
545
|
+
const displayPath = relativeCanonicalPath.replaceAll('\\', '/');
|
|
546
|
+
try {
|
|
547
|
+
renderedContent = mapping.transformCanonical(await readFile(canonicalEntry.canonicalPath, 'utf8'), displayPath);
|
|
548
|
+
}
|
|
549
|
+
catch (error) {
|
|
550
|
+
if (!(error instanceof CliError)) {
|
|
551
|
+
throw error;
|
|
552
|
+
}
|
|
553
|
+
// Every provider transform parses the same canonical file, so key
|
|
554
|
+
// the failure by path and report each invalid file exactly once.
|
|
555
|
+
const failureKey = normalize(relativeCanonicalPath);
|
|
556
|
+
if (!transformFailures.has(failureKey)) {
|
|
557
|
+
transformFailures.set(failureKey, error.message.includes(displayPath)
|
|
558
|
+
? error.message
|
|
559
|
+
: `${displayPath}: ${error.message}`);
|
|
560
|
+
}
|
|
561
|
+
continue;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
544
564
|
const entryScopeRoot = scopeRoot
|
|
545
565
|
? scopeRoot
|
|
546
566
|
: resolveScopeRootFromCanonical(canonicalEntry, relativeCanonicalPath);
|
|
@@ -579,6 +599,14 @@ export async function computeSyncPlan({ canonical, adapters, manifest, scope, co
|
|
|
579
599
|
}
|
|
580
600
|
}
|
|
581
601
|
}
|
|
602
|
+
if (transformFailures.size > 0) {
|
|
603
|
+
const count = transformFailures.size;
|
|
604
|
+
throw new CliError(`Sync stopped: ${count} invalid canonical ${count === 1 ? 'rule' : 'rules'}. Fix ${count === 1 ? 'it' : 'them'} and re-run oat sync:\n${[
|
|
605
|
+
...transformFailures.values(),
|
|
606
|
+
]
|
|
607
|
+
.map((message) => ` - ${message}`)
|
|
608
|
+
.join('\n')}`);
|
|
609
|
+
}
|
|
582
610
|
if (!scopeRoot) {
|
|
583
611
|
return { scope, entries, removals, collections };
|
|
584
612
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type GenericDispatchRecord } from '../identity/generic-dispatch-record.js';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
import { type ClaudeCapabilityEvidence } from './targets.js';
|
|
3
4
|
export interface AcceptedClaudeLaunchEnvelope {
|
|
4
5
|
schemaVersion: 1;
|
|
@@ -16,19 +17,71 @@ export interface AcceptedClaudeLaunchEnvelope {
|
|
|
16
17
|
model?: string;
|
|
17
18
|
};
|
|
18
19
|
}
|
|
20
|
+
type ResolverRole = AcceptedClaudeLaunchEnvelope['resolverRole'];
|
|
21
|
+
/**
|
|
22
|
+
* One violation found while validating a managed Claude dispatch input.
|
|
23
|
+
* `stage` is the top-level input key it belongs to (`claudeLaunch`,
|
|
24
|
+
* `recordBase`, or `event`); `path` locates it inside that stage.
|
|
25
|
+
* Messages name fields and expected forms; they are still routed through the
|
|
26
|
+
* command's redaction boundary because a few echo caller-supplied selectors.
|
|
27
|
+
*/
|
|
28
|
+
export interface ManagedClaudeViolation {
|
|
29
|
+
stage: string;
|
|
30
|
+
path: string;
|
|
31
|
+
message: string;
|
|
32
|
+
}
|
|
33
|
+
/** Render a Zod issue path as `a.b[0].c`, or `<root>` when empty. */
|
|
34
|
+
export declare function formatIssuePath(prefix: string | null, path: readonly (string | number)[]): string;
|
|
35
|
+
export declare function zodIssueViolations(stage: string, prefix: string | null, error: z.ZodError): ManagedClaudeViolation[];
|
|
19
36
|
/**
|
|
20
37
|
* Validate the managed resolver result against the generated provider role and
|
|
21
38
|
* the exact payload that will be launched. This is the production boundary
|
|
22
39
|
* used by the project dispatch-record producer for managed Claude dispatches.
|
|
40
|
+
* It stops at the first failure; {@link collectClaudeLaunchViolations} reports
|
|
41
|
+
* every failure for a caller building its input.
|
|
23
42
|
*/
|
|
24
43
|
export declare function acceptClaudeLaunchEnvelope(input: {
|
|
25
44
|
resolution: unknown;
|
|
26
45
|
definition: string;
|
|
27
46
|
launch: unknown;
|
|
28
47
|
}): AcceptedClaudeLaunchEnvelope;
|
|
48
|
+
/**
|
|
49
|
+
* Report every `claudeLaunch` violation in one pass: each schema issue in the
|
|
50
|
+
* resolution and the payload, then every consistency check the parsed inputs
|
|
51
|
+
* allow. Consistency checks depend on a parsed resolution, and the two payload
|
|
52
|
+
* checks on a parsed payload; those are skipped and named in `skipped` rather
|
|
53
|
+
* than reported against a value that failed to parse.
|
|
54
|
+
*/
|
|
55
|
+
export declare function collectClaudeLaunchViolations(claudeLaunch: unknown): {
|
|
56
|
+
resolverRole: ResolverRole | null;
|
|
57
|
+
violations: ManagedClaudeViolation[];
|
|
58
|
+
skipped: string[];
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Report every `recordBase` violation in one pass: each derived field that is
|
|
62
|
+
* present, the action/role check, every missing, mistyped, or unknown field,
|
|
63
|
+
* every absolute path in an identity or control field, and every sensitive key
|
|
64
|
+
* or value. The action/role check needs a parsed resolution and is skipped
|
|
65
|
+
* without one.
|
|
66
|
+
*/
|
|
67
|
+
export declare function collectClaudeRecordBaseViolations(candidate: unknown, resolverRole: ResolverRole | null): {
|
|
68
|
+
violations: ManagedClaudeViolation[];
|
|
69
|
+
skipped: string[];
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* One error for a whole validation run: a header, then one
|
|
73
|
+
* `stage path: message` line per violation, then the checks that were skipped
|
|
74
|
+
* because they depend on a stage that failed to parse.
|
|
75
|
+
*/
|
|
76
|
+
export declare class ManagedClaudeDispatchValidationError extends Error {
|
|
77
|
+
readonly violations: readonly ManagedClaudeViolation[];
|
|
78
|
+
readonly skipped: readonly string[];
|
|
79
|
+
constructor(violations: readonly ManagedClaudeViolation[], skipped?: readonly string[]);
|
|
80
|
+
}
|
|
29
81
|
/** Build configured invocation evidence only from an accepted launch envelope. */
|
|
30
82
|
export declare function buildClaudeDispatchRecord(input: {
|
|
31
83
|
envelope: AcceptedClaudeLaunchEnvelope;
|
|
32
84
|
recordBase: unknown;
|
|
33
85
|
}): GenericDispatchRecord;
|
|
86
|
+
export {};
|
|
34
87
|
//# sourceMappingURL=dispatch-envelope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-envelope.d.ts","sourceRoot":"","sources":["../../../src/providers/claude/dispatch-envelope.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dispatch-envelope.d.ts","sourceRoot":"","sources":["../../../src/providers/claude/dispatch-envelope.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,qBAAqB,EAC3B,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAEL,KAAK,wBAAwB,EAE9B,MAAM,WAAW,CAAC;AA4FnB,MAAM,WAAW,4BAA4B;IAC3C,aAAa,EAAE,CAAC,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,aAAa,GAAG,UAAU,CAAC;IACzC,QAAQ,EAAE,uBAAuB,GAAG,cAAc,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,wBAAwB,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAgBD,KAAK,YAAY,GAAG,4BAA4B,CAAC,cAAc,CAAC,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAOD,qEAAqE;AACrE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GACjC,MAAM,CAWR;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,KAAK,EAAE,CAAC,CAAC,QAAQ,GAChB,sBAAsB,EAAE,CAM1B;AAsID;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB,GAAG,4BAA4B,CAgC/B;AASD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,OAAO,GAAG;IACpE,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAqDA;AAuDD;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,YAAY,GAAG,IAAI,GAChC;IAAE,UAAU,EAAE,sBAAsB,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAkE7D;AAMD;;;;GAIG;AACH,qBAAa,oCAAqC,SAAQ,KAAK;IAC7D,QAAQ,CAAC,UAAU,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAEpC,YACE,UAAU,EAAE,SAAS,sBAAsB,EAAE,EAC7C,OAAO,GAAE,SAAS,MAAM,EAAO,EAyBhC;CACF;AAmBD,kFAAkF;AAClF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,QAAQ,EAAE,4BAA4B,CAAC;IACvC,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,qBAAqB,CA2CxB"}
|