@open-agent-toolkit/cli 0.3.16 → 0.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agents/oat-phase-implementer.md +26 -6
- package/assets/agents/oat-reviewer.md +51 -1
- package/assets/bundle-metadata.json +1 -1
- package/assets/docs/contributing/documentation.md +4 -0
- package/assets/docs/contributing/skills.md +3 -1
- package/assets/docs/getting-started/bootstrap.md +1 -1
- package/assets/docs/getting-started/index.md +0 -4
- package/assets/docs/getting-started/tool-packs.md +0 -7
- package/assets/docs/reference/cli-reference.md +42 -1
- package/assets/docs/reference/config-and-local-state.md +11 -2
- package/assets/docs/reference/project-artifacts.md +43 -8
- package/assets/docs/skills/repo-improve.md +9 -7
- package/assets/docs/workflows/advanced/autonomy.md +40 -0
- package/assets/docs/workflows/backlog-and-planning/backlog-lifecycle.md +25 -24
- package/assets/docs/workflows/backlog-and-planning/remote-project-management.md +0 -7
- package/assets/docs/workflows/ideas/lifecycle.md +2 -7
- package/assets/docs/workflows/projects/execution/project-log.md +22 -0
- package/assets/docs/workflows/projects/reviews/review-flavors.md +8 -0
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-agent-instructions-apply/SKILL.md +14 -4
- package/assets/skills/oat-brainstorm/SKILL.md +17 -13
- package/assets/skills/oat-docs-apply/SKILL.md +13 -3
- package/assets/skills/oat-doctor/SKILL.md +11 -1
- package/assets/skills/oat-explainer-kit/SKILL.md +1 -1
- package/assets/skills/oat-explainer-kit/references/lifecycle-contract.md +6 -3
- package/assets/skills/oat-pjm-review-backlog/SKILL.md +2 -2
- package/assets/skills/oat-pjm-update-repo-reference/SKILL.md +28 -3
- package/assets/skills/oat-project-autonomous/SKILL.md +60 -5
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +44 -6
- package/assets/skills/oat-project-capture/SKILL.md +7 -3
- package/assets/skills/oat-project-complete/SKILL.md +39 -34
- package/assets/skills/oat-project-complete/scripts/execute-synced-archive-entry.mjs +106 -28
- package/assets/skills/oat-project-complete/scripts/parse-synced-archive-resume-fields.mjs +30 -3
- package/assets/skills/oat-project-design/SKILL.md +12 -9
- package/assets/skills/oat-project-discover/SKILL.md +8 -4
- package/assets/skills/oat-project-document/SKILL.md +14 -5
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +44 -6
- package/assets/skills/oat-project-implement/SKILL.md +1 -1
- package/assets/skills/oat-project-implement/references/completion-and-closeout.md +6 -6
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +44 -6
- package/assets/skills/oat-project-implement/references/phase-execution.md +20 -6
- package/assets/skills/oat-project-import-plan/SKILL.md +20 -6
- package/assets/skills/oat-project-lite/SKILL.md +7 -5
- package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +44 -6
- package/assets/skills/oat-project-new/SKILL.md +6 -2
- package/assets/skills/oat-project-plan/SKILL.md +14 -6
- package/assets/skills/oat-project-pr-final/SKILL.md +1 -1
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +44 -6
- package/assets/skills/oat-project-progress/SKILL.md +13 -1
- package/assets/skills/oat-project-promote-spec-driven/SKILL.md +7 -3
- package/assets/skills/oat-project-quick-start/SKILL.md +17 -12
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +44 -6
- package/assets/skills/oat-project-reconcile/SKILL.md +8 -4
- package/assets/skills/oat-project-retro/SKILL.md +1 -1
- package/assets/skills/oat-project-retro/references/apply-procedure.md +6 -6
- package/assets/skills/oat-project-retro-file/SKILL.md +7 -3
- package/assets/skills/oat-project-review-provide/SKILL.md +23 -4
- package/assets/skills/oat-project-review-provide-remote/SKILL.md +19 -1
- package/assets/skills/oat-project-review-receive/SKILL.md +37 -12
- package/assets/skills/oat-project-review-receive-remote/SKILL.md +7 -3
- package/assets/skills/oat-project-revise/SKILL.md +13 -5
- package/assets/skills/oat-project-spec/SKILL.md +8 -4
- package/assets/skills/oat-project-summary/SKILL.md +11 -7
- package/assets/skills/oat-repo-knowledge-index/SKILL.md +54 -20
- package/assets/skills/oat-repo-knowledge-index/scripts/refresh-owned.mjs +118 -0
- package/assets/skills/oat-review-provide/SKILL.md +7 -3
- package/assets/skills/oat-review-receive-remote/SKILL.md +14 -4
- package/assets/skills/oat-wave-execute/SKILL.md +24 -11
- package/assets/skills/oat-wave-execute/assets/wrapper-plan-template.md +16 -2
- package/assets/skills/oat-worktree-bootstrap-auto/SKILL.md +45 -17
- package/assets/templates/pjm-agents.md +38 -8
- package/assets/templates/repo-agents.md +5 -0
- package/assets/templates/repo-readme.md +5 -0
- package/dist/commands/backlog/archive.d.ts +3 -0
- package/dist/commands/backlog/archive.d.ts.map +1 -1
- package/dist/commands/backlog/archive.js +63 -26
- package/dist/commands/backlog/index.d.ts.map +1 -1
- package/dist/commands/backlog/index.js +3 -0
- package/dist/commands/backlog/rewrite-references.d.ts +5 -0
- package/dist/commands/backlog/rewrite-references.d.ts.map +1 -1
- package/dist/commands/backlog/rewrite-references.js +39 -1
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +1 -0
- package/dist/commands/init/tools/shared/skill-script-references.d.ts.map +1 -1
- package/dist/commands/init/tools/shared/skill-script-references.js +8 -1
- package/dist/commands/internal/commit-paths.d.ts +3 -0
- package/dist/commands/internal/commit-paths.d.ts.map +1 -0
- package/dist/commands/internal/commit-paths.js +31 -0
- package/dist/commands/internal/index.d.ts.map +1 -1
- package/dist/commands/internal/index.js +2 -0
- package/dist/commands/pjm/init.d.ts.map +1 -1
- package/dist/commands/pjm/init.js +37 -8
- package/dist/commands/project/archive/archive-utils.d.ts +6 -3
- package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
- package/dist/commands/project/archive/archive-utils.js +510 -104
- package/dist/commands/project/archive/push-runner.d.ts.map +1 -1
- package/dist/commands/project/archive/push-runner.js +1 -0
- package/dist/commands/project/log/append.d.ts +2 -3
- package/dist/commands/project/log/append.d.ts.map +1 -1
- package/dist/commands/project/log/append.js +125 -111
- package/dist/commands/project/migrate/index.d.ts +1 -2
- package/dist/commands/project/migrate/index.d.ts.map +1 -1
- package/dist/commands/project/migrate/index.js +8 -2
- package/dist/commands/project/new/scaffold.d.ts.map +1 -1
- package/dist/commands/project/new/scaffold.js +4 -4
- package/dist/commands/project/promote/promote.d.ts +8 -0
- package/dist/commands/project/promote/promote.d.ts.map +1 -1
- package/dist/commands/project/promote/promote.js +37 -6
- package/dist/commands/project/status.d.ts.map +1 -1
- package/dist/commands/project/status.js +3 -0
- package/dist/commands/project/sync/ref-sync.d.ts +12 -1
- package/dist/commands/project/sync/ref-sync.d.ts.map +1 -1
- package/dist/commands/project/sync/ref-sync.js +347 -23
- package/dist/commands/shared/agents-md-lock.d.ts +3 -0
- package/dist/commands/shared/agents-md-lock.d.ts.map +1 -0
- package/dist/commands/shared/agents-md-lock.js +130 -0
- package/dist/commands/shared/agents-md.d.ts.map +1 -1
- package/dist/commands/shared/agents-md.js +26 -8
- package/dist/commands/shared/exact-path-commit.d.ts +32 -0
- package/dist/commands/shared/exact-path-commit.d.ts.map +1 -0
- package/dist/commands/shared/exact-path-commit.js +691 -0
- package/dist/validation/skills.d.ts.map +1 -1
- package/dist/validation/skills.js +138 -11
- package/package.json +3 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { constants } from 'node:fs';
|
|
2
2
|
import { lstat, open, readFile, readlink, realpath, writeFile, } from 'node:fs/promises';
|
|
3
3
|
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
4
|
+
import { acquireAgentsMdAppendLock } from './agents-md-lock.js';
|
|
4
5
|
const defaultFileSystem = {
|
|
5
6
|
lstat,
|
|
6
7
|
open,
|
|
@@ -496,7 +497,7 @@ function classifySections(plan, desired, content, removeSectionKeys, appendRefus
|
|
|
496
497
|
};
|
|
497
498
|
}
|
|
498
499
|
/** Inspect current bytes and identity without opening a write handle. */
|
|
499
|
-
async function inspectSections(plan, sections, removeSectionKeys, fileSystem) {
|
|
500
|
+
async function inspectSections(plan, sections, removeSectionKeys, fileSystem, validateContent = true) {
|
|
500
501
|
const desired = sections.map(({ key, body }) => ({
|
|
501
502
|
key,
|
|
502
503
|
block: buildSection(key, body),
|
|
@@ -505,7 +506,7 @@ async function inspectSections(plan, sections, removeSectionKeys, fileSystem) {
|
|
|
505
506
|
? ''
|
|
506
507
|
: await fileSystem.readFile(plan.targetPath, 'utf8');
|
|
507
508
|
const classification = classifySections(plan, desired, content, removeSectionKeys);
|
|
508
|
-
await assertPlanUnchanged(plan, fileSystem, plan.kind === 'missing' ? undefined : content);
|
|
509
|
+
await assertPlanUnchanged(plan, fileSystem, plan.kind === 'missing' || !validateContent ? undefined : content);
|
|
509
510
|
return { content, desired, classification };
|
|
510
511
|
}
|
|
511
512
|
async function upsertSectionsInternal(repoRoot, sections, removeSectionKeys, fileSystem, allowReplan) {
|
|
@@ -518,7 +519,7 @@ async function upsertSectionsInternal(repoRoot, sections, removeSectionKeys, fil
|
|
|
518
519
|
return Object.fromEntries(sections.map(({ key }) => [key, blocked]));
|
|
519
520
|
}
|
|
520
521
|
try {
|
|
521
|
-
|
|
522
|
+
let { desired, content, classification } = await inspectSections(plan, sections, removeSectionKeys, fileSystem, false);
|
|
522
523
|
if (plan.kind === 'missing') {
|
|
523
524
|
const creation = await createMissingFile(plan, `${desired.map(({ block }) => block).join('\n\n')}\n`, fileSystem);
|
|
524
525
|
if (creation === 'created')
|
|
@@ -528,12 +529,29 @@ async function upsertSectionsInternal(repoRoot, sections, removeSectionKeys, fil
|
|
|
528
529
|
}
|
|
529
530
|
throw new Error(IDENTITY_CHANGED);
|
|
530
531
|
}
|
|
532
|
+
if (classification.absentBlocks.length === 0) {
|
|
533
|
+
// Non-appending outcomes retain their original content-stability check
|
|
534
|
+
// without creating a lock; only append candidates use the locked re-read.
|
|
535
|
+
await assertPlanUnchanged(plan, fileSystem, content);
|
|
536
|
+
return classification.results;
|
|
537
|
+
}
|
|
531
538
|
if (classification.absentBlocks.length > 0) {
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
539
|
+
const release = await acquireAgentsMdAppendLock(plan.repoRoot, plan.targetPath);
|
|
540
|
+
try {
|
|
541
|
+
// Revalidate the original identity and classify fresh bytes under the lock.
|
|
542
|
+
({ desired, content, classification } = await inspectSections(plan, sections, removeSectionKeys, fileSystem));
|
|
543
|
+
if (classification.absentBlocks.length > 0) {
|
|
544
|
+
const appended = await appendAbsentSections(plan, classification.absentBlocks, fileSystem);
|
|
545
|
+
if (appended.kind === 'blocked')
|
|
546
|
+
throw new Error(appended.reason);
|
|
547
|
+
if (appended.kind === 'refused') {
|
|
548
|
+
return classifySections(plan, desired, content, removeSectionKeys, appended.cause).results;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
return classification.results;
|
|
552
|
+
}
|
|
553
|
+
finally {
|
|
554
|
+
await release();
|
|
537
555
|
}
|
|
538
556
|
}
|
|
539
557
|
return classification.results;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ExactPathCommitInput {
|
|
2
|
+
repoRoot: string;
|
|
3
|
+
paths: readonly string[];
|
|
4
|
+
message: string;
|
|
5
|
+
identity: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ExactPathCommitResult {
|
|
8
|
+
outcome: 'committed' | 'already-matching' | 'nothing' | 'blocked' | 'failed';
|
|
9
|
+
committed: boolean;
|
|
10
|
+
attempts: number;
|
|
11
|
+
commit?: string;
|
|
12
|
+
/** A fully verified resumed receipt whose owned real-index entries remain
|
|
13
|
+
* published, or whose later generation is published at current HEAD. Failed
|
|
14
|
+
* outcome stays failed; only the marker owner may retire that reservation. */
|
|
15
|
+
settledCommit?: string;
|
|
16
|
+
receipt?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
lockClass?: 'transient-index-lock' | 'persistent-index-lock' | 'other';
|
|
19
|
+
resumable?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ExactPathCommitDependencies {
|
|
22
|
+
attempts: number;
|
|
23
|
+
retryDelaysMs: readonly number[];
|
|
24
|
+
sleep: (ms: number) => Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
/** Use an isolated index for enabled hooks; publish only owned entries under Git's lock.
|
|
27
|
+
* The real lock is held during hooks, so ordinary competing Git writers cannot lose
|
|
28
|
+
* their changes. A byte comparison also detects writers bypassing that protocol.
|
|
29
|
+
* Never restore a snapshot over current user data, and never remove a foreign lock.
|
|
30
|
+
*/
|
|
31
|
+
export declare function commitExactPaths(input: ExactPathCommitInput, overrides?: Partial<ExactPathCommitDependencies>): Promise<ExactPathCommitResult>;
|
|
32
|
+
//# sourceMappingURL=exact-path-commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exact-path-commit.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/exact-path-commit.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,WAAW,GAAG,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC7E,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;kFAE8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,sBAAsB,GAAG,uBAAuB,GAAG,OAAO,CAAC;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AACD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAuSD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,oBAAoB,EAC3B,SAAS,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACnD,OAAO,CAAC,qBAAqB,CAAC,CA8iBhC"}
|