@difflab/pi 0.4.0 → 0.5.0-rc.202609231313.eaf7fa0

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.
Files changed (128) hide show
  1. package/README.md +9 -9
  2. package/agents/diffpi-copilot.md +6 -3
  3. package/agents/diffpi-orchestrator.md +1 -1
  4. package/agents/diffpi-planner.md +3 -3
  5. package/agents/diffpi-reviewer.md +3 -3
  6. package/agents/diffpi-worker.md +2 -2
  7. package/dist/assets.d.ts +1 -0
  8. package/dist/assets.d.ts.map +1 -1
  9. package/dist/cli/plan.d.ts +7 -3
  10. package/dist/cli/plan.d.ts.map +1 -1
  11. package/dist/cli.js +306 -811
  12. package/dist/commands/plan.d.ts +0 -1
  13. package/dist/commands/plan.d.ts.map +1 -1
  14. package/dist/commands/review.d.ts +0 -1
  15. package/dist/commands/review.d.ts.map +1 -1
  16. package/dist/commands.d.ts +22 -0
  17. package/dist/commands.d.ts.map +1 -0
  18. package/dist/config.d.ts.map +1 -1
  19. package/dist/environment.d.ts +2 -1
  20. package/dist/environment.d.ts.map +1 -1
  21. package/dist/extensions/cmdtsx.d.ts +2 -0
  22. package/dist/extensions/cmdtsx.d.ts.map +1 -0
  23. package/dist/extensions/fsx.d.ts +8 -0
  24. package/dist/extensions/fsx.d.ts.map +1 -0
  25. package/dist/extensions/index.js +5057 -3069
  26. package/dist/extensions/processx.d.ts +1 -0
  27. package/dist/extensions/processx.d.ts.map +1 -1
  28. package/dist/extensions/subagentx.d.ts +1 -1
  29. package/dist/extensions/subagentx.d.ts.map +1 -1
  30. package/dist/extensions/tuicrx.d.ts +1 -8
  31. package/dist/extensions/tuicrx.d.ts.map +1 -1
  32. package/dist/extensions/zodx.d.ts +8 -0
  33. package/dist/extensions/zodx.d.ts.map +1 -0
  34. package/dist/index.d.ts +10 -11
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +352 -1149
  37. package/dist/plan/index.d.ts +2 -5
  38. package/dist/plan/index.d.ts.map +1 -1
  39. package/dist/plan/markdown.d.ts.map +1 -1
  40. package/dist/plan/operations.d.ts +43 -0
  41. package/dist/plan/operations.d.ts.map +1 -0
  42. package/dist/plan/reviews.d.ts +28 -0
  43. package/dist/plan/reviews.d.ts.map +1 -0
  44. package/dist/plan/store.d.ts +6 -3
  45. package/dist/plan/store.d.ts.map +1 -1
  46. package/dist/plan/types.d.ts +3 -22
  47. package/dist/plan/types.d.ts.map +1 -1
  48. package/dist/review/github-review-backend.d.ts.map +1 -1
  49. package/dist/review/gitlab-review-backend.d.ts.map +1 -1
  50. package/dist/review/index.d.ts +6 -6
  51. package/dist/review/index.d.ts.map +1 -1
  52. package/dist/review/local-reviews.d.ts +31 -0
  53. package/dist/review/local-reviews.d.ts.map +1 -0
  54. package/dist/review/review-backend.d.ts +2 -3
  55. package/dist/review/review-backend.d.ts.map +1 -1
  56. package/dist/review/review-markdown.d.ts +1 -4
  57. package/dist/review/review-markdown.d.ts.map +1 -1
  58. package/dist/review/types.d.ts +0 -28
  59. package/dist/review/types.d.ts.map +1 -1
  60. package/dist/store.d.ts +0 -2
  61. package/dist/store.d.ts.map +1 -1
  62. package/dist/tools/ci.d.ts +6 -0
  63. package/dist/tools/ci.d.ts.map +1 -0
  64. package/dist/tools/index.d.ts +1 -0
  65. package/dist/tools/index.d.ts.map +1 -1
  66. package/dist/tools/index.js +1887 -2805
  67. package/dist/tools/log.d.ts.map +1 -1
  68. package/dist/tools/modes.d.ts.map +1 -1
  69. package/dist/tools/plan-schema.d.ts +211 -0
  70. package/dist/tools/plan-schema.d.ts.map +1 -0
  71. package/dist/tools/plan.d.ts +2 -2
  72. package/dist/tools/plan.d.ts.map +1 -1
  73. package/dist/tools/review.d.ts +0 -30
  74. package/dist/tools/review.d.ts.map +1 -1
  75. package/dist/workflow.d.ts +80 -0
  76. package/dist/workflow.d.ts.map +1 -0
  77. package/package.json +4 -2
  78. package/skills/plan/SKILL.md +15 -7
  79. package/skills/review/SKILL.md +6 -8
  80. package/templates/plan/PLAN.md +2 -0
  81. package/workflows/plan/annotate.md +13 -0
  82. package/workflows/plan/finalize.md +15 -0
  83. package/workflows/plan/go.md +20 -0
  84. package/{skills/plan/references/workflows → workflows/plan}/help.md +11 -4
  85. package/workflows/plan/init.md +13 -0
  86. package/workflows/plan/new.md +20 -0
  87. package/workflows/plan/update.md +18 -0
  88. package/workflows/review/address.md +8 -0
  89. package/workflows/review/auto.md +8 -0
  90. package/workflows/review/complete.md +7 -0
  91. package/workflows/review/edit.md +7 -0
  92. package/workflows/review/help.md +14 -0
  93. package/workflows/review/merge.md +6 -0
  94. package/workflows/review/new.md +7 -0
  95. package/workflows/review/publish.md +6 -0
  96. package/dist/plan/annotations.d.ts +0 -25
  97. package/dist/plan/annotations.d.ts.map +0 -1
  98. package/dist/plan/controller.d.ts +0 -65
  99. package/dist/plan/controller.d.ts.map +0 -1
  100. package/dist/plan/execution.d.ts +0 -13
  101. package/dist/plan/execution.d.ts.map +0 -1
  102. package/dist/plan/ids.d.ts +0 -5
  103. package/dist/plan/ids.d.ts.map +0 -1
  104. package/dist/plan/lock.d.ts +0 -11
  105. package/dist/plan/lock.d.ts.map +0 -1
  106. package/dist/plan/log.d.ts +0 -6
  107. package/dist/plan/log.d.ts.map +0 -1
  108. package/dist/plan/parser.d.ts +0 -18
  109. package/dist/plan/parser.d.ts.map +0 -1
  110. package/dist/review/local-review-backend.d.ts +0 -3
  111. package/dist/review/local-review-backend.d.ts.map +0 -1
  112. package/dist/review/review-state.d.ts +0 -20
  113. package/dist/review/review-state.d.ts.map +0 -1
  114. package/skills/plan/references/workflows/annotate.md +0 -6
  115. package/skills/plan/references/workflows/finalize.md +0 -7
  116. package/skills/plan/references/workflows/go.md +0 -8
  117. package/skills/plan/references/workflows/init.md +0 -6
  118. package/skills/plan/references/workflows/new.md +0 -8
  119. package/skills/plan/references/workflows/update.md +0 -7
  120. package/skills/review/references/workflows/address.md +0 -11
  121. package/skills/review/references/workflows/auto.md +0 -18
  122. package/skills/review/references/workflows/complete.md +0 -7
  123. package/skills/review/references/workflows/edit.md +0 -7
  124. package/skills/review/references/workflows/help.md +0 -30
  125. package/skills/review/references/workflows/merge.md +0 -6
  126. package/skills/review/references/workflows/new.md +0 -19
  127. package/skills/review/references/workflows/open.md +0 -3
  128. package/skills/review/references/workflows/publish.md +0 -8
@@ -0,0 +1,7 @@
1
+ # complete
2
+
3
+ 1. Read the typed target, local mode, and lifecycle action from `Arguments`.
4
+ 2. Call `review_context`.
5
+ 3. In local mode, call `review_dump` to save the final immutable revision and remove the completed tuicr session.
6
+ 4. In remote mode, ask for a missing action, then call `review_complete` with `approve`, `reject`, or `abandon`.
7
+ 5. Report the dump path or remote result. Do not merge.
@@ -0,0 +1,7 @@
1
+ # edit
2
+
3
+ 1. Read `Arguments.target` and `Arguments.local`.
4
+ 2. Call `review_context`, then `review_edit`.
5
+ 3. Local mode opens the current working-tree review revision. Remote mode opens the existing PR/MR in tuicr.
6
+ 4. If no review exists, direct the user to `/review new`.
7
+ 5. Report the launch result. Do not create findings or change lifecycle state.
@@ -0,0 +1,14 @@
1
+ # help
2
+
3
+ Show these commands:
4
+
5
+ - `/review auto [target] [--local] [--bg]` generates findings.
6
+ - `/review new [title] [--intent text] [--base branch] [--local] [--bg]` starts a review.
7
+ - `/review edit [target] [--local] [--bg]` opens an existing review.
8
+ - `/review address [target] [--local] [--bg]` applies feedback. Local mode dumps one revision and starts the next.
9
+ - `/review publish [target] [--comment|--approve|--request-changes|--close] [--bg]` publishes remote review work.
10
+ - `/review complete [target] [--local|--approve|--reject|--abandon] [--bg]` finishes without merging.
11
+ - `/review merge [target] [--bg]` merges a green remote review.
12
+ - `/review help` shows this reference.
13
+
14
+ `--local` selects the working-tree tuicr flow. Local reviews are immutable revision dumps with no replies, resolution state, or remote promotion. Remote reviews use GitHub or GitLab comments and lifecycle operations directly. `--bg` launches an Orchestrator without changing the foreground mode.
@@ -0,0 +1,6 @@
1
+ # merge
2
+
3
+ 1. Local mode is not accepted; only remote reviews can merge.
4
+ 2. Call `review_context` and confirm the PR is open, non-draft, mergeable, and green.
5
+ 3. Ask for a conventional squash subject only when it cannot be derived.
6
+ 4. Call `review_merge` and report the resulting merge.
@@ -0,0 +1,7 @@
1
+ # new
2
+
3
+ 1. Read `Arguments.title`, `Arguments.intent`, `Arguments.base`, and `Arguments.local`.
4
+ 2. Call `review_context` with the selected backend.
5
+ 3. Call `review_new`. Local mode opens a working-tree review in tuicr. Remote mode creates a draft PR/MR from a clean pushed branch and opens it in tuicr.
6
+ 4. If the target exists, direct the user to `/review edit` instead.
7
+ 5. Report the created target and launch instruction. Do not generate findings or publish it.
@@ -0,0 +1,6 @@
1
+ # publish
2
+
3
+ 1. Read the typed target and status flags from `Arguments`. The default is comment.
4
+ 2. Local mode is not accepted; local reviews use immutable revision dumps and have no publish step.
5
+ 3. Call `review_context`, then `review_publish` with the selected status.
6
+ 4. Report the public review status and final PR/MR state. Publishing never merges.
@@ -1,25 +0,0 @@
1
- import type { PlanAnnotationComment, PlanAnnotationState, PlanRecord } from './types';
2
- export interface AnnotationProcessResult {
3
- code: number;
4
- stdout: string;
5
- stderr: string;
6
- }
7
- export interface PlanAnnotationRuntime {
8
- execute?: (command: string, args: string[], cwd: string, interactive: boolean) => Promise<AnnotationProcessResult>;
9
- }
10
- export declare function annotatePlan(record: PlanRecord, runtime?: PlanAnnotationRuntime): Promise<{
11
- sessionSlug: string;
12
- code: number;
13
- state: PlanAnnotationState;
14
- }>;
15
- export declare function readPlanAnnotations(record: PlanRecord, options?: {
16
- includeApplied?: boolean;
17
- runtime?: PlanAnnotationRuntime;
18
- }): Promise<{
19
- state?: PlanAnnotationState;
20
- comments: PlanAnnotationComment[];
21
- pending: PlanAnnotationComment[];
22
- }>;
23
- export declare function acknowledgePlanAnnotations(record: PlanRecord, commentIds: readonly string[], summary: string): Promise<PlanAnnotationState>;
24
- export declare function annotationStatePath(record: PlanRecord): string;
25
- //# sourceMappingURL=annotations.d.ts.map
@@ -1 +0,0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ation } from '../extensions/subagentx';
2
- import { acknowledgePlanAnnotations, annotatePlan, readPlanAnnotations, type PlanAnnotationRuntime } from './annotations';
3
- import { type PlanExecutionPacket } from './execution';
4
- import { type PlanStore, type PlanStoreOptions } from './store';
5
- import type { PlanCiStatus, PlanCommit, PlanDocument, PlanPhaseStatus, PlanRecord, PlanStatus, PlanValidationIssue, PlanValidationOptions } from './types';
6
- export interface PlanStatusUpdate {
7
- target: {
8
- type: 'plan' | 'phase' | 'task';
9
- id?: string;
10
- };
11
- expectedStatus: PlanStatus | PlanPhaseStatus;
12
- status: PlanStatus | PlanPhaseStatus;
13
- actor: string;
14
- message: string;
15
- executionId?: string;
16
- evidence?: string[];
17
- blockedReason?: string;
18
- attempts?: string[];
19
- needsUserDecision?: boolean;
20
- commit?: PlanCommit;
21
- }
22
- export interface PlanStatusUpdateResult {
23
- record: PlanRecord;
24
- escalation?: SubagentEscalation;
25
- }
26
- export interface PlanCiUpdate {
27
- phaseId: string;
28
- sha: string;
29
- status: Exclude<PlanCiStatus, 'pending'>;
30
- actor: string;
31
- executionId: string;
32
- detail: string;
33
- }
34
- export interface PlanCiRetry {
35
- phaseId: string;
36
- sha: string;
37
- actor: string;
38
- executionId: string;
39
- reason: string;
40
- }
41
- export interface PlanController {
42
- context: PlanStore['context'];
43
- create: PlanStore['init'];
44
- read: PlanStore['read'];
45
- update: PlanStore['mutate'];
46
- appendLog: PlanStore['log'];
47
- updateStatus(cwd: string, query: string, input: PlanStatusUpdate): Promise<PlanStatusUpdateResult>;
48
- updateCi(cwd: string, query: string, input: PlanCiUpdate): Promise<PlanRecord>;
49
- retryCi(cwd: string, query: string, input: PlanCiRetry): Promise<PlanRecord>;
50
- assertPhasePushEligible(document: PlanDocument, phaseId: string, executionId: string): void;
51
- validate(document: PlanDocument, options?: PlanValidationOptions): PlanValidationIssue[];
52
- countDesignWords(document: PlanDocument): number;
53
- annotate(record: PlanRecord, runtime?: PlanAnnotationRuntime): ReturnType<typeof annotatePlan>;
54
- annotations(record: PlanRecord, options?: {
55
- includeApplied?: boolean;
56
- runtime?: PlanAnnotationRuntime;
57
- }): ReturnType<typeof readPlanAnnotations>;
58
- acknowledgeAnnotations(record: PlanRecord, commentIds: readonly string[], summary: string): ReturnType<typeof acknowledgePlanAnnotations>;
59
- executionPacket(document: PlanDocument, coordinator: PlanExecutionPacket['coordinator']): PlanExecutionPacket;
60
- executionPrompt(packet: PlanExecutionPacket): string;
61
- renderEscalation(escalation: SubagentEscalation): string;
62
- assertStableId(value: string, label?: string): void;
63
- }
64
- export declare function createPlanController(options?: PlanStoreOptions): PlanController;
65
- //# sourceMappingURL=controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/plan/controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,EACnB,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAgD,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAErG,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,KAAK,EAEV,YAAY,EACZ,UAAU,EACV,YAAY,EAEZ,eAAe,EACf,UAAU,EACV,UAAU,EAGV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,cAAc,EAAE,UAAU,GAAG,eAAe,CAAC;IAC7C,MAAM,EAAE,UAAU,GAAG,eAAe,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CA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F"}
@@ -1,13 +0,0 @@
1
- import type { PlanDocument, PlanExecutionPolicy } from './types';
2
- export interface PlanExecutionPacket {
3
- version: 1;
4
- planId: string;
5
- executionId: string;
6
- policy: PlanExecutionPolicy;
7
- cwd: string;
8
- branch: string;
9
- coordinator: 'worker' | 'orchestrator';
10
- }
11
- export declare function createExecutionPacket(plan: PlanDocument, coordinator: PlanExecutionPacket['coordinator']): PlanExecutionPacket;
12
- export declare function renderExecutionPrompt(packet: PlanExecutionPacket): string;
13
- //# sourceMappingURL=execution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/plan/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,QAAQ,GAAG,cAAc,CAAC;CACxC;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,EAClB,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,GAC9C,mBAAmB,CAWrB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CASzE"}
@@ -1,5 +0,0 @@
1
- export declare const STABLE_ID: RegExp;
2
- export declare function isStableId(value: string): boolean;
3
- export declare function assertStableId(value: string, label?: string): void;
4
- export declare function assertUniqueIds(ids: readonly string[], label: string): void;
5
- //# sourceMappingURL=ids.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/plan/ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,QAA+B,CAAC;AAEtD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAe,GAAG,IAAI,CAExE;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAO3E"}
@@ -1,11 +0,0 @@
1
- export interface PlanLockOptions {
2
- waitMs?: number;
3
- pollMs?: number;
4
- operation?: string;
5
- }
6
- /**
7
- * Serialize one plan's read-modify-write cycle. Worktrees still share the project
8
- * `.diffpi` store, so branch isolation does not prevent concurrent plan writes.
9
- */
10
- export declare function withPlanLock<T>(planDir: string, operation: () => Promise<T>, options?: PlanLockOptions): Promise<T>;
11
- //# sourceMappingURL=lock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/plan/lock.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,CAAC,CAAC,CA4CZ"}
@@ -1,6 +0,0 @@
1
- import { type DiffpiLogEntry, type NewLogEntry } from '../log';
2
- import type { PlanLogEntry } from './types';
3
- export type NewPlanLogEntry = NewLogEntry<PlanLogEntry & DiffpiLogEntry>;
4
- export declare function appendPlanLog(logPath: string, event: NewPlanLogEntry): Promise<PlanLogEntry>;
5
- export declare function readPlanLog(logPath: string): Promise<PlanLogEntry[]>;
6
- //# sourceMappingURL=log.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/plan/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,YAAY,GAAG,cAAc,CAAC,CAAC;AAEzE,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CAElG;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAE1E"}
@@ -1,18 +0,0 @@
1
- type AuthorVerb = 'init' | 'new' | 'update' | 'annotate' | 'finalize' | 'help';
2
- export type PlanCommandRequest = {
3
- verb: AuthorVerb;
4
- plan?: string;
5
- branch?: string;
6
- background: boolean;
7
- instructions: string;
8
- } | {
9
- verb: 'go';
10
- plan: string;
11
- background: boolean;
12
- policy?: 'commit-per-phase' | 'no-commit';
13
- instructions: '';
14
- };
15
- export declare function parsePlanArgs(raw: string): PlanCommandRequest;
16
- export declare function tokenizePlanArgs(raw: string): string[];
17
- export {};
18
- //# sourceMappingURL=parser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/plan/parser.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC/F;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,WAAW,CAAC;IAAC,YAAY,EAAE,EAAE,CAAA;CAAE,CAAC;AAEnH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAgD7D;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAwBtD"}
@@ -1,3 +0,0 @@
1
- import type { LocalReviewBackendOptions, ReviewBackend } from './types';
2
- export declare function LocalReviewBackend(options: LocalReviewBackendOptions): ReviewBackend;
3
- //# sourceMappingURL=local-review-backend.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"local-review-backend.d.ts","sourceRoot":"","sources":["../../src/review/local-review-backend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,aAAa,CAqCpF"}
@@ -1,20 +0,0 @@
1
- import type { VcsInfo } from '../environment';
2
- import type { ReviewComment } from './types';
3
- export interface ReviewPublicationState {
4
- target: string;
5
- bodies: string[];
6
- comments: string[];
7
- stagedComments: string[];
8
- replies: string[];
9
- overlayPath?: string;
10
- }
11
- export declare function reviewBodyFingerprint(body: string): string;
12
- export declare function reviewCommentFingerprint(comment: ReviewComment): string;
13
- export declare function reviewReplyFingerprint(threadId: string, body: string): string;
14
- export declare function unpublishedReviewComments(comments: readonly ReviewComment[], knownFingerprints: ReadonlySet<string>): ReviewComment[];
15
- export declare function loadReviewPublicationState(cwd: string, vcs: VcsInfo, number: number, homeDir?: string): Promise<{
16
- path: string;
17
- state: ReviewPublicationState;
18
- }>;
19
- export declare function saveReviewPublicationState(path: string, state: ReviewPublicationState): Promise<void>;
20
- //# sourceMappingURL=review-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review-state.d.ts","sourceRoot":"","sources":["../../src/review/review-state.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAY7C,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GACrC,aAAa,EAAE,CAEjB;AAED,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,sBAAsB,CAAA;CAAE,CAAC,CAe1D;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3G"}
@@ -1,6 +0,0 @@
1
- # annotate
2
-
3
- 1. Call `plan_context` and require an exact selection.
4
- 2. Call `plan_annotate`; it uses `tuicr --file PLAN.md`, never `-p` or `--path`.
5
- 3. Report the selected plan, session slug, launch result, and copyable fallback command.
6
- 4. Tell the user to run `/plan update <plan-id>` when comments are ready.
@@ -1,7 +0,0 @@
1
- # finalize
2
-
3
- 1. Call `plan_context` and use the current persisted plan, including changes authored through chat. Call `plan_annotations` only to check for optional annotation feedback. If `pending` is non-empty, run the update workflow to apply and acknowledge those comments. If no annotation session exists or no comments are pending, skip update and continue directly.
4
- 2. Call `plan_validate` with `strict: true`. Stop on errors, pending annotations, or Design above 800 words.
5
- 3. Mark the draft ready with `plan_update_status`.
6
- 4. Use one `ask_user_question` call to choose the next action and, when executing now, commit policy. Choices are inline execution, background execution, execute later, or continue planning; commit policy is commit per phase or no commits.
7
- 5. For execute later or continue planning, do not ask for or apply a commit policy. Call `diffpi_modes_unset` before returning so finalization exits to the default inline mode. Otherwise call `plan_start_execution` with the selected mode and policy.
@@ -1,8 +0,0 @@
1
- # go
2
-
3
- 1. Require a plan slug and call `plan_context`.
4
- 2. Read explicit `--bg`, `--commit`, and `--no-commit` choices already parsed by the command.
5
- 3. If mode or commit policy is missing in foreground mode, use one `ask_user_question` call for only the missing choices. Never silently default.
6
- 4. Background mode never asks. If a required preference is missing, return a blocker with the exact complete command.
7
- 5. Foreground execution runs in `WORKER` mode. Background execution uses Orchestrator and must preserve the foreground mode.
8
- 6. Call `plan_start_execution` with inline/background mode and commit-per-phase/no-commit policy. For `/plan go --bg`, the already-spawned orchestrator must pass `coordinator: current`; normal callers omit it (default `spawn`). Commit-per-phase execution pushes each phase commit, records pending CI, and launches a bounded background Worker to call `plan_watch_ci` while the next phase executes. Collect that monitor before the next push and collect all monitors before completion; failed or timed-out CI blocks execution. When an inline execution marks the plan completed, `plan_update_status` exits to the default mode automatically. Report the execution ID and whether the foreground mode changed.
@@ -1,6 +0,0 @@
1
- # init
2
-
3
- 1. Require one short slug and accept an optional `--branch`.
4
- 2. Call `plan_init` with the explicit intent and title when supplied. The tool creates only `PLAN.md` and `logs.txt`.
5
- 3. Call `plan_annotate` when the annotation launcher is available. Otherwise show its exact fallback command.
6
- 4. Report the plan ID and explain that `/plan update <id>` imports annotations and populates the draft.
@@ -1,8 +0,0 @@
1
- # new
2
-
3
- 1. Require a short slug. Call `plan_context`, then `plan_init` if the plan does not exist.
4
- 2. Ground the plan in repository files and the explicit prompt. If no prompt was supplied, use the inherited conversation context supplied by the named Planner RPC dispatch.
5
- 3. In foreground mode, use `ask_user_question` only for decisions that materially change scope. In background mode, never ask; record safe assumptions and stop with a blocker if ambiguity cannot be resolved.
6
- 4. Use `plan_update_overview`, `plan_add_phase`, and `plan_update_phase` to create the plan. Use the planning tools to enforce the declared requirements, references, phase dependencies, file scopes, steps, and acceptance criteria; do not write PLAN.md by hand when a tool can make the change.
7
- 5. Create one implementation file per phase at `.diffpi/plan/<plan-id>/implementation/phase-<phase-id>.md`. Fill in the implementation template with the phase summary, file tree, public APIs and data contracts, required libraries or algorithms, and implementation constraints. Keep each phase focused on one or two modules or libraries unless it is scaffolding.
8
- 6. Keep Design near 300 words and call `plan_validate`. Leave the result as a draft for annotation or finalization.
@@ -1,7 +0,0 @@
1
- # update
2
-
3
- 1. Call `plan_context`. Omit the slug only when exactly one candidate is selected.
4
- 2. Call `plan_annotations` before interpreting prompt instructions. A missing annotation session means there is no annotation work.
5
- 3. Apply each unambiguous pending comment, then the explicit instructions, through `plan_update_overview`, `plan_add_phase`, `plan_remove_phase`, or `plan_update_phase`. Preserve stable IDs and completed evidence.
6
- 4. In foreground mode, use `ask_user_question` for unresolved product decisions. In background mode, do not ask; persist and return a blocker.
7
- 5. Call `plan_validate`. Only after successful application, call `plan_ack_annotations` with exactly the applied comment IDs and a concise summary. Failed or partial updates leave unhandled IDs pending.
@@ -1,11 +0,0 @@
1
- # address
2
-
3
- 1. Parse an optional PR/MR id or URL and `--local`. The `/review` command has already removed `--bg`.
4
- 2. Run this workflow as the reviewer coordinator. Call `review_context` with the target and backend selection.
5
- 3. Call `review_comments`. With `--local`, it synchronizes every comment in the selected tuicr session to `.diffpi/review/<session-slug>.md`. Existing replies and statuses remain; source comments removed by the user become resolved ledger entries.
6
- 4. Classify every thread, group justified code changes into bounded non-overlapping tasks, and delegate those tasks to lightweight worker agents. Keep questions, outcome decisions, integration, and response text in the reviewer coordinator. With `--local`, workers modify the current working tree without committing. Without `--local`, apply a fix only when the comment requests a change.
7
- 5. Respond to every thread with its outcome. Answer questions and leave them open. For substantive requests, state what changed and whether it is resolved, but leave every thread open for the user to resolve. Do not resolve remote threads or delete local source comments in this workflow, including for trivial requests.
8
- 6. When a remote address flow changes code, invoke the upstream `/git commit --no-push` workflow after checks pass and before drafting responses. Use `--atomic` when the fixes form separate logical commits.
9
- 7. Call `review_respond` for each thread with `resolve: false`. With `--local`, every response is posted to tuicr and recorded in the session ledger. Without `--local`, replies post to the forge immediately. The user owns thread resolution.
10
- 8. With `--local`, call `review_launch_ui` with `local: true` after replies are recorded so the user can inspect the working-tree review in tuicr.
11
- 9. Report fixed, committed, answered, addressed, unresolved, and skipped counts. Resolved must always be zero in this workflow. Do not publish, complete, or merge.
@@ -1,18 +0,0 @@
1
- # auto
2
-
3
- 1. Parse an optional PR/MR id or URL and `--local`. The `/review` command has already removed `--bg`. `launch` is an alias for this workflow.
4
- 2. Call `review_context` with the same target and backend selection.
5
- 3. Call `review_new` to create the local tuicr review or remote draft PR/MR and open its tuicr UI. A remote branch must be clean and pushed. If the review already exists, use `review_edit` to open it.
6
- 4. Before reviewing, run `review_gates` so the project's discovered format-check and lint tasks run first, followed by its other gates. Preserve and report failures; do not substitute visual inspection for failed or skipped checks.
7
- 5. Run review judgment as the reviewer agent. Inline, the reviewer performs the workflow tool calls directly. In background execution, the orchestrator delegates judgment to the reviewer and retains lifecycle calls. The reviewer fetches the diff with `review_diff` and may launch parallel lightweight subagents for independent areas when useful.
8
- 6. Review the change for:
9
- - whether it accomplishes the stated intent;
10
- - whether the technical approach is the best practical way to accomplish that intent;
11
- - correctness, including failure paths and edge cases;
12
- - code quality, readability, and maintainability;
13
- - minimality and conciseness, including unnecessary agent-generated changes;
14
- - documentation accuracy and completeness; and
15
- - reviewer coordination, including keeping lifecycle ownership clear and avoiding duplicate or conflicting findings.
16
- Use parallel lightweight workers for independent review areas when useful, then reconcile their results before submission.
17
- 7. Produce only grounded findings, then call `review_submit`. Pass `local: true` for local findings; remote findings remain pending for `publish` or `complete`.
18
- 8. Report the artifact or pending-review state, finding count, gate results, backend, and any launch instruction. Do not complete or merge the review.
@@ -1,7 +0,0 @@
1
- # complete
2
-
3
- 1. Parse an optional PR/MR id or URL, `--local`, and exactly one remote action: `--approve`, `--reject`, or `--abandon`. `close` is an alias for this workflow. If the action is omitted, ask the user with `header: "Action"`; all question headers must be 16 characters or fewer.
4
- 2. Call `review_context` with the same target and backend selection.
5
- 3. With `--local`, call `review_complete` with `local: true`. It archives the reply overlay to `.diffpi/reviews/<session-slug>.md`, then deletes the exact persisted tuicr session. This is destructive and prevents its comments from appearing in future tuicr sessions.
6
- 4. Without `--local`, map `--approve`, `--reject`, or `--abandon` to the `review_complete` action `approve`, `reject`, or `abandon`. The tool applies the remote lifecycle action but does not merge.
7
- 5. Report the archive path or remote result. Do not call `review_merge`.
@@ -1,7 +0,0 @@
1
- # edit
2
-
3
- 1. Parse an optional PR/MR number, URL, or branch target and `--local`.
4
- 2. Call `review_context` with the same target and backend selection.
5
- 3. Call `review_edit`. With `--local`, it opens an existing local tuicr session. Without `--local`, it opens an existing PR/MR in tuicr, including a non-draft PR/MR for continued work on its comments.
6
- 4. If no matching local session or remote PR/MR exists, report the error and direct the user to `new`. Do not create a review, generate findings, publish, complete, or merge.
7
- 5. Report whether tuicr opened in a mux, prepared a Zed task, or returned a command.
@@ -1,30 +0,0 @@
1
- # help
2
-
3
- Print the following help text:
4
-
5
- ```text
6
- Workflows for PRs and local review. Use:
7
-
8
- Create a review and generate findings:
9
- /review auto [pr-or-branch] [--local] [--bg]
10
-
11
- Create a local review or remote draft PR/MR:
12
- /review new [title] [--intent text] [--base branch] [--local] [--bg]
13
-
14
- Open an existing review without generating findings:
15
- /review edit [pr-number|pr-url|branch] [--local] [--bg]
16
-
17
- Address review comments:
18
- /review address [pr-number|pr-url|branch] [--local] [--bg]
19
-
20
- Publish comments and a review status:
21
- /review publish [pr-number|pr-url|branch] [--local] [--comment|--approve|--request-changes|--close] [--bg]
22
-
23
- Complete a review without merging:
24
- /review complete [pr-number|pr-url|branch] [--local|--approve|--reject|--abandon] [--bg]
25
-
26
- Merge an approved remote review:
27
- /review merge [pr-number|pr-url|branch] [--bg]
28
- ```
29
-
30
- `--local` selects the working-tree tuicr backend. Otherwise, a target is a PR/MR number, URL, or branch; no target means the current branch. `--bg` launches a tracked background Orchestrator and leaves the current chat mode unchanged. `new` creates a review. `edit` only opens an existing local session or remote PR/MR. `auto` creates a review, then delegates findings to the reviewer agent. `open`, `create`, and `draft` alias `new`; `launch` aliases `auto`; `close` aliases `complete`. `publish` publishes remote draft PR/MR review comments and status or promotes local comments. `complete` makes a lifecycle decision without merging, or archives the local overlay and deletes its tuicr session.
@@ -1,6 +0,0 @@
1
- # merge
2
-
3
- 1. Call `review_context` and confirm the GitHub PR is open, non-draft, clean, and its checks are settled. Do not require an approval from the current user; authors cannot approve their own PRs. GitHub branch protection remains authoritative.
4
- 2. If a conventional squash subject is required and the subject is unclear, use `ask_user_question`.
5
- 3. Call `review_merge` with the chosen subject.
6
- 4. Report the merge result.
@@ -1,19 +0,0 @@
1
- # new
2
-
3
- ## Arguments
4
-
5
- ```text
6
- /review new [title] [--intent text] [--base branch] [--local]
7
- ```
8
-
9
- - `title` is the optional first positional argument; quote a title containing spaces.
10
- - `--intent` and `--base` each consume the following value. `--local` is a boolean flag.
11
- - Flags may appear in any order. Reject unknown or duplicate flags, missing flag values, and extra positional arguments. Stating this grammar before the procedure is intentional: an explicit argument contract is the best practice for making workflow behavior predictable and preventing ambiguous execution.
12
-
13
- ## Workflow
14
-
15
- 1. Parse the arguments using the grammar above. A remote target is the current branch; `new` creates a new review rather than opening an existing one.
16
- 2. Call `review_context` with the same backend selection.
17
- 3. Call `review_new` with the parsed title, intent, base branch, and backend selection. With `--local`, it creates and opens a local tuicr working-tree review. Without `--local`, it requires a clean, pushed branch, creates a draft PR/MR, and opens that PR/MR in tuicr.
18
- 4. If a local session or remote PR/MR already exists, direct the user to `edit` instead.
19
- 5. Report the PR/MR URL and whether tuicr opened in a mux, prepared a Zed task, or returned a command. Do not generate findings, publish, complete, or merge.
@@ -1,3 +0,0 @@
1
- # open
2
-
3
- `open` is an alias for `new`. Follow `new.md`.
@@ -1,8 +0,0 @@
1
- # publish
2
-
3
- 1. Parse an optional PR/MR id or URL, `--local`, and one status: `--comment`, `--approve`, `--request-changes`, or `--close`. The default is comment.
4
- 2. Call `review_context` with the target and `local: true` so the exact tuicr PR session can be inspected. If that session exists and has drafts, publish through the local promotion path even when the user omitted `--local`. Use `local: false` only when no matching tuicr session exists or when the target has forge-native pending review work.
5
- 3. The local promotion path reads the exact tuicr session. A local line comment on the same file and line as an existing remote thread is treated as a response, not a new comment. A leading `[REOPEN]`, `[RESOLVE]`, or `[DELETE]` changes the thread state; the marker is removed from the response body. `[DELETE]` deletes the matched remote thread when the forge supports it. Other unpublished line comments become new review comments. The tool follows the stored local overlay path, posts unpublished replies to their remote threads, and then publishes the selected status. Question replies remain open. The tool does not post an overall review comment.
6
- 4. For a forge-native review without a matching tuicr session, call `review_publish` without `local`. Existing pending forge comments already contain provenance, so the tool only publishes them with the selected status and no overall comment.
7
- 5. Comment, approve, and request-changes mark a draft PR/MR ready before publication. Close publishes pending work as comment status and then closes the PR/MR. GitLab rejects request-changes because it has no equivalent review state.
8
- 6. Report promoted comment and reply counts, the public status, and the final PR/MR state. Publishing never merges. If a response cannot be matched by file and line, report it as a new comment rather than silently attaching it to the wrong thread.