@gajae-code/coding-agent 0.12.5 → 0.12.6

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 (127) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +4 -1
  3. package/dist/types/eval/backend.d.ts +2 -2
  4. package/dist/types/exec/bash-executor.d.ts +10 -8
  5. package/dist/types/extensibility/extensions/runner.d.ts +9 -7
  6. package/dist/types/gjc-runtime/launch-tmux.d.ts +22 -3
  7. package/dist/types/gjc-runtime/psmux-detect.d.ts +3 -0
  8. package/dist/types/gjc-runtime/team-launch.d.ts +3 -1
  9. package/dist/types/gjc-runtime/team-runtime.d.ts +14 -2
  10. package/dist/types/gjc-runtime/team-store.d.ts +0 -4
  11. package/dist/types/gjc-runtime/team-workers.d.ts +5 -0
  12. package/dist/types/gjc-runtime/tmux-common.d.ts +1 -0
  13. package/dist/types/gjc-runtime/tmux-provider-context.d.ts +57 -0
  14. package/dist/types/gjc-runtime/tmux-sessions.d.ts +8 -1
  15. package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +3 -0
  16. package/dist/types/gjc-runtime/ultragoal-review-source.d.ts +83 -0
  17. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +57 -4
  18. package/dist/types/internal-urls/registry-helpers.d.ts +18 -0
  19. package/dist/types/modes/components/gjc-bundle-settings.d.ts +1 -0
  20. package/dist/types/modes/components/plugin-settings.d.ts +2 -0
  21. package/dist/types/modes/components/settings-selector.d.ts +2 -0
  22. package/dist/types/sdk/broker/broker.d.ts +18 -0
  23. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +13 -0
  24. package/dist/types/sdk/broker/lifecycle.d.ts +1 -0
  25. package/dist/types/sdk/bus/chat-daemon-control.d.ts +4 -3
  26. package/dist/types/sdk/bus/index.d.ts +4 -0
  27. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +4 -2
  28. package/dist/types/sdk/bus/telegram-daemon.d.ts +25 -3
  29. package/dist/types/sdk/bus/topic-registry.d.ts +63 -3
  30. package/dist/types/sdk/host/host.d.ts +23 -2
  31. package/dist/types/sdk/host/reverse-leases.d.ts +7 -4
  32. package/dist/types/session/agent-session.d.ts +5 -4
  33. package/dist/types/session/artifacts.d.ts +8 -5
  34. package/dist/types/session/attempt-record-store.d.ts +19 -0
  35. package/dist/types/session/client-bridge.d.ts +14 -0
  36. package/dist/types/session/internal/managed-session-storage.d.ts +5 -2
  37. package/dist/types/session/messages.d.ts +4 -1
  38. package/dist/types/session/session-manager.d.ts +6 -4
  39. package/dist/types/session/session-storage.d.ts +8 -0
  40. package/dist/types/session/streaming-output.d.ts +32 -0
  41. package/dist/types/task/receipt.d.ts +2 -0
  42. package/dist/types/task/types.d.ts +178 -0
  43. package/dist/types/tools/bash.d.ts +1 -1
  44. package/dist/types/tools/fetch.d.ts +3 -0
  45. package/dist/types/tools/output-meta.d.ts +37 -5
  46. package/dist/types/tools/tool-result.d.ts +1 -0
  47. package/dist/types/utils/artifact-id.d.ts +2 -0
  48. package/package.json +8 -8
  49. package/scripts/capture-sticky-viewport-showcase.ts +131 -5
  50. package/scripts/verify-gjc-sdk-canonicalization.ts +128 -183
  51. package/scripts/verify-sticky-viewport-showcase.ts +620 -93
  52. package/src/config/model-profiles.ts +8 -0
  53. package/src/config/settings-schema.ts +17 -3
  54. package/src/cursor.ts +20 -13
  55. package/src/defaults/gjc/skills/ultragoal/SKILL.md +5 -2
  56. package/src/eval/backend.ts +2 -2
  57. package/src/exec/bash-executor.ts +425 -151
  58. package/src/extensibility/extensions/runner.ts +80 -6
  59. package/src/extensibility/extensions/wrapper.ts +22 -15
  60. package/src/extensibility/runtime-skill-discovery.ts +4 -6
  61. package/src/gjc-runtime/launch-tmux.ts +309 -293
  62. package/src/gjc-runtime/managed-owner-supervisor.ts +6 -2
  63. package/src/gjc-runtime/psmux-detect.ts +52 -6
  64. package/src/gjc-runtime/team-launch.ts +50 -2
  65. package/src/gjc-runtime/team-runtime.ts +716 -251
  66. package/src/gjc-runtime/team-store.ts +25 -7
  67. package/src/gjc-runtime/team-workers.ts +161 -1
  68. package/src/gjc-runtime/tmux-common.ts +16 -4
  69. package/src/gjc-runtime/tmux-gc.ts +37 -5
  70. package/src/gjc-runtime/tmux-owner-isolation.ts +2 -0
  71. package/src/gjc-runtime/tmux-provider-context.ts +451 -0
  72. package/src/gjc-runtime/tmux-sessions.ts +409 -156
  73. package/src/gjc-runtime/ultragoal-change-set.ts +90 -44
  74. package/src/gjc-runtime/ultragoal-receipt-freshness.ts +7 -0
  75. package/src/gjc-runtime/ultragoal-review-source.ts +378 -0
  76. package/src/gjc-runtime/ultragoal-runtime.ts +640 -159
  77. package/src/gjc-runtime/workflow-manifest.generated.json +40 -1
  78. package/src/gjc-runtime/workflow-manifest.ts +12 -0
  79. package/src/internal-urls/agent-protocol.ts +98 -38
  80. package/src/internal-urls/artifact-protocol.ts +28 -17
  81. package/src/internal-urls/docs-index.generated.ts +5 -5
  82. package/src/internal-urls/local-protocol.ts +39 -18
  83. package/src/internal-urls/registry-helpers.ts +62 -0
  84. package/src/modes/acp/acp-agent.ts +51 -13
  85. package/src/modes/acp/acp-client-bridge.ts +154 -11
  86. package/src/modes/components/gjc-bundle-settings.ts +2 -0
  87. package/src/modes/components/plugin-settings.ts +5 -0
  88. package/src/modes/components/settings-selector.ts +4 -0
  89. package/src/modes/controllers/selector-controller.ts +1 -0
  90. package/src/prompts/tools/bash.md +2 -2
  91. package/src/prompts/tools/monitor.md +4 -4
  92. package/src/sdk/acp/adapter.ts +200 -9
  93. package/src/sdk/broker/broker.ts +93 -10
  94. package/src/sdk/broker/lifecycle-ledger.ts +227 -11
  95. package/src/sdk/broker/lifecycle.ts +691 -92
  96. package/src/sdk/bus/chat-daemon-control.ts +32 -6
  97. package/src/sdk/bus/index.ts +347 -14
  98. package/src/sdk/bus/telegram-daemon-contract.ts +4 -2
  99. package/src/sdk/bus/telegram-daemon.ts +283 -44
  100. package/src/sdk/bus/topic-registry.ts +133 -10
  101. package/src/sdk/host/host.ts +187 -9
  102. package/src/sdk/host/reverse-leases.ts +249 -42
  103. package/src/sdk/session.ts +7 -6
  104. package/src/session/agent-session.ts +930 -354
  105. package/src/session/artifacts.ts +211 -74
  106. package/src/session/attempt-record-store.ts +106 -0
  107. package/src/session/client-bridge.ts +15 -0
  108. package/src/session/internal/managed-session-scope.ts +252 -67
  109. package/src/session/internal/managed-session-storage.ts +105 -5
  110. package/src/session/messages.ts +32 -7
  111. package/src/session/session-manager.ts +19 -21
  112. package/src/session/session-storage.ts +146 -24
  113. package/src/session/streaming-output.ts +198 -40
  114. package/src/task/index.ts +45 -0
  115. package/src/task/provider-retry-status.ts +4 -1
  116. package/src/task/receipt.ts +4 -0
  117. package/src/task/render.ts +30 -0
  118. package/src/task/types.ts +34 -0
  119. package/src/tools/bash.ts +818 -239
  120. package/src/tools/eval.ts +99 -4
  121. package/src/tools/fetch.ts +77 -15
  122. package/src/tools/find.ts +7 -3
  123. package/src/tools/monitor.ts +7 -1
  124. package/src/tools/output-meta.ts +706 -116
  125. package/src/tools/search.ts +9 -4
  126. package/src/tools/tool-result.ts +1 -0
  127. package/src/utils/artifact-id.ts +6 -0
@@ -55,12 +55,23 @@ export interface ClientBridgeTerminalOutput {
55
55
  }
56
56
  export interface ClientBridgeTerminalHandle {
57
57
  terminalId: string;
58
+ /** Exact provider lease/session identity that owns this terminal. */
59
+ providerLeaseId: string;
58
60
  waitForExit(): Promise<ClientBridgeTerminalExitStatus>;
59
61
  currentOutput(): Promise<ClientBridgeTerminalOutput>;
60
62
  kill(): Promise<void>;
61
63
  release(): Promise<void>;
64
+ /** Full authenticated provider identity, when supplied by the transport. */
65
+ providerLeaseIdentity?: ClientBridgeProviderLeaseIdentity;
66
+ }
67
+ export interface ClientBridgeProviderLeaseIdentity {
68
+ leaseId: string;
69
+ connectionId: string;
70
+ connectionGeneration: number;
71
+ fence: string;
62
72
  }
63
73
  export interface ClientBridgeCreateTerminalParams {
74
+ toolCallId: string;
64
75
  command: string;
65
76
  args?: string[];
66
77
  env?: Array<{
@@ -69,6 +80,7 @@ export interface ClientBridgeCreateTerminalParams {
69
80
  }>;
70
81
  cwd?: string;
71
82
  outputByteLimit?: number;
83
+ signal?: AbortSignal;
72
84
  }
73
85
  export interface ClientBridge {
74
86
  readonly capabilities: ClientBridgeCapabilities;
@@ -84,5 +96,7 @@ export interface ClientBridge {
84
96
  content: string;
85
97
  }): Promise<void>;
86
98
  createTerminal?(params: ClientBridgeCreateTerminalParams): Promise<ClientBridgeTerminalHandle>;
99
+ /** Fence the exact provider identity after cleanup ownership becomes uncertain. */
100
+ quarantineProviderLease?(providerLease: string | ClientBridgeProviderLeaseIdentity, reason: string): Promise<void>;
87
101
  requestPermission?(toolCall: ClientBridgePermissionToolCall, options: ClientBridgePermissionOption[], signal?: AbortSignal): Promise<ClientBridgePermissionOutcome>;
88
102
  }
@@ -63,6 +63,8 @@ export declare class ManagedSessionDescendantStore {
63
63
  get rootAuthority(): ManagedDirectoryRoot;
64
64
  get subtreeRootAuthority(): ManagedDirectoryRoot;
65
65
  get securityPolicy(): ManagedSessionSecurityPolicy;
66
+ get hasRetainedAuthority(): boolean;
67
+ acquireMutationFence(name: string): Promise<ManagedStorageLock | undefined>;
66
68
  get profileAgentDir(): string;
67
69
  deriveSubtree(relativePath: string): ManagedSessionDescendantStore;
68
70
  retainAuthority(): RecoveryFsRoot | undefined;
@@ -77,6 +79,7 @@ export declare class ManagedSessionDescendantStore {
77
79
  publishNoReplace(relativePath: string, bytes: Uint8Array): Promise<void>;
78
80
  publishNoReplaceSync(relativePath: string, bytes: Uint8Array): void;
79
81
  replace(relativePath: string, bytes: Uint8Array): Promise<void>;
82
+ replaceExpected(relativePath: string, bytes: Uint8Array, expected: ManagedFileSnapshot): void;
80
83
  replaceSync(relativePath: string, bytes: Uint8Array): void;
81
84
  appendSync(relativePath: string, bytes: Uint8Array): void;
82
85
  /** Read an exact managed file without exposing its pathname as authority. */
@@ -104,9 +107,9 @@ export declare function captureManagedFilePrefixNoFollow(pathname: string, maxBy
104
107
  export declare function captureManagedFileNoFollow(pathname: string): ManagedFileSnapshot;
105
108
  /** Atomically publishes bytes without replacing an existing destination. */
106
109
  export declare function publishManagedFileNoReplace(destination: string, bytes: Uint8Array, assertOwned?: () => void, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): Promise<void>;
107
- export declare function publishManagedFileNoReplaceSync(destination: string, bytes: Uint8Array, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): void;
110
+ export declare function publishManagedFileNoReplaceSync(destination: string, bytes: Uint8Array, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy, assertOwned?: () => void): void;
108
111
  /** Replace one managed regular file while retaining the secured staging fd through publication. */
109
- export declare function replaceManagedFileSync(destination: string, bytes: Uint8Array, root: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): void;
112
+ export declare function replaceManagedFileSync(destination: string, bytes: Uint8Array, root: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy, assertFence?: () => void): void;
110
113
  export declare function replaceManagedFile(destination: string, bytes: Uint8Array, root: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): Promise<void>;
111
114
  /** Copy the exact bytes captured from one no-follow source descriptor. */
112
115
  export declare function copyManagedFileNoReplace(source: string, destination: string, snapshot?: ManagedFileSnapshot, root?: ManagedDirectoryRoot, policy?: ManagedSessionSecurityPolicy): Promise<void>;
@@ -73,7 +73,10 @@ export declare const PRE_ADMISSION_ARTIFACT_SPILL_TAIL_BYTES = 4096;
73
73
  * next provider context is constructed. Byte boundaries never split UTF-8
74
74
  * code points, so head/tail recovery remains readable for emoji and CJK text.
75
75
  */
76
- export declare function createPreAdmissionArtifactSpillPreview(fullText: string, artifactId: string, digest: string): string;
76
+ export declare function createPreAdmissionArtifactSpillPreview(fullText: string, artifactId: string, digest: string, options?: {
77
+ maxInlineBytes?: number;
78
+ fullOutput?: boolean;
79
+ }): string;
77
80
  /**
78
81
  * Message type for bash executions via the ! command.
79
82
  */
@@ -4,7 +4,7 @@ import type { ImageContent, Message, MessageAttribution, ServiceTier, TextConten
4
4
  import * as native from "@gajae-code/natives";
5
5
  import type { TtsrInjectionRecord } from "../export/ttsr";
6
6
  import type { ManagedLegacyLocalMigrationSource } from "../internal-urls/local-protocol";
7
- import { ArtifactManager } from "./artifacts";
7
+ import { ArtifactManager, type ArtifactSaveReceipt } from "./artifacts";
8
8
  import { type BlobPutResult, BlobStore } from "./blob-store";
9
9
  import { type ManagedMigrationPolicy } from "./internal/managed-session-scope";
10
10
  import { type ManagedDirectoryRoot, ManagedSessionDescendantStore } from "./internal/managed-session-storage";
@@ -329,6 +329,7 @@ export interface ResumeSessionIdentity {
329
329
  sessionId: string;
330
330
  dev: bigint;
331
331
  ino: bigint;
332
+ nlink?: bigint;
332
333
  size: number;
333
334
  mtimeMs: number;
334
335
  mtimeNs: bigint;
@@ -484,7 +485,7 @@ export interface ReadonlySessionManager {
484
485
  /** Creates an immutable facade that never exposes SessionManager mutation authority. */
485
486
  export declare function createReadonlySessionManager(manager: SessionManager): ReadonlySessionManager;
486
487
  /** Internal artifact-writing capability. Read-only facades expose it only through a private weak-map lookup. */
487
- export type SessionArtifactCapability = Readonly<Pick<SessionManager, "allocateArtifactPath" | "saveArtifact" | "putBlob">>;
488
+ export type SessionArtifactCapability = Readonly<Pick<SessionManager, "allocateArtifactPath" | "saveArtifact" | "getArtifactPath" | "putBlob">>;
488
489
  /**
489
490
  * Returns the artifact capability for a concrete persistence owner or one of its
490
491
  * immutable read-only facades. Structural lookalikes remain unauthorized.
@@ -756,10 +757,11 @@ export declare class SessionManager {
756
757
  path?: string;
757
758
  }>;
758
759
  /**
759
- * Save artifact content under the current session and return artifact ID.
760
- * Returns an artifact ID for all sessions (file-backed for persistent, in-memory fallback otherwise).
760
+ * Save artifact content under the current persisted session and return its artifact ID.
761
+ * In-memory sessions cannot produce protocol-resolvable artifact references.
761
762
  */
762
763
  saveArtifact(content: string, toolType: string): Promise<string | undefined>;
764
+ saveArtifactReceipt(content: string, toolType: string): Promise<ArtifactSaveReceipt | undefined>;
763
765
  /**
764
766
  * Resolve an artifact ID to an on-disk path for the current session.
765
767
  * Returns null when missing or when the session is not persisted.
@@ -3,6 +3,7 @@ import { type ManagedDirectoryRoot } from "./internal/managed-session-storage";
3
3
  export interface SessionStorageStat {
4
4
  dev: bigint;
5
5
  ino: bigint;
6
+ nlink?: bigint;
6
7
  size: number;
7
8
  mtimeMs: number;
8
9
  mtimeNs: bigint;
@@ -148,6 +149,7 @@ export interface SessionStorage {
148
149
  export interface SessionStorageFileIdentity {
149
150
  dev: bigint;
150
151
  ino: bigint;
152
+ nlink?: bigint;
151
153
  size: number;
152
154
  mtimeNs: bigint;
153
155
  sha256: string;
@@ -181,12 +183,17 @@ export interface VerifiedSessionDeleteTarget {
181
183
  cwd: string;
182
184
  /** Expected transcript file `(dev, ino)` captured at authorization. */
183
185
  transcriptIdentity: SessionStorageFileIdentity;
186
+ transcriptParentIdentity?: {
187
+ dev: bigint;
188
+ ino: bigint;
189
+ };
184
190
  /**
185
191
  * For retry after an `artifacts` `cleanup_pending`: the recorded artifact
186
192
  * directory identity to re-accept. A replacement/different artifact directory
187
193
  * fails closed. Omit on first attempt or to accept recorded absence.
188
194
  */
189
195
  expectedArtifactsIdentity?: SessionStorageFileIdentity;
196
+ artifactsAbsentAtAuthorization?: true;
190
197
  /** Stable native recursive-tree evidence captured before artifact detachment. */
191
198
  expectedArtifactsTree?: NativeDirectoryTreeSnapshot;
192
199
  /** Identity-bound quarantine path retained when recursive artifact cleanup failed. */
@@ -256,6 +263,7 @@ type NativeDirectoryTreeEntry = {
256
263
  kind: string;
257
264
  dev: string;
258
265
  ino: string;
266
+ nlink: string;
259
267
  size: string;
260
268
  mtimeNs: string;
261
269
  ctimeNs: string;
@@ -37,17 +37,40 @@ export interface OutputSummary {
37
37
  elidedBytes?: number;
38
38
  /** Lines elided from the middle when head-retain mode is active. */
39
39
  elidedLines?: number;
40
+ /** Exact source ranges retained by head/tail middle-elision windows. */
41
+ headRange?: {
42
+ start: number;
43
+ end: number;
44
+ };
45
+ tailRange?: {
46
+ start: number;
47
+ end: number;
48
+ };
49
+ /** The retained tail ends with only a byte fragment of its source line. */
50
+ lastLinePartial?: boolean;
51
+ /** The retained head ends with only a byte fragment of its source line. */
52
+ firstLinePartial?: boolean;
40
53
  /** Bytes dropped by the per-line column cap (sum across all lines). */
41
54
  columnDroppedBytes?: number;
42
55
  /** Number of distinct lines that hit the per-line column cap. */
43
56
  columnTruncatedLines?: number;
57
+ /** Configured per-line byte/column cap that caused visible omission. */
58
+ columnMax?: number;
44
59
  /** Artifact ID for internal URL access (artifact://<id>) when output was persisted. */
45
60
  artifactId?: string;
61
+ /** Artifact existence was proven by successful publication or file finalization. */
62
+ artifactVerified?: boolean;
46
63
  /** Bytes omitted from artifact storage after the artifact hard cap was reached. */
47
64
  artifactTruncatedBytes?: number;
65
+ /** Bytes dropped before the Bash executor received the native output stream. */
66
+ sourceTruncatedBytes?: number;
67
+ /** Exact source capture completeness could not be proven. */
68
+ sourceCaptureIncomplete?: boolean;
48
69
  /** Bounded diagnostic when artifact writer or terminal publisher creation, write, finalization, or publication failed. */
49
70
  artifactFailureDiagnostic?: string;
50
71
  }
72
+ /** Verify that this exact OutputSink summary came from a successful current-execution publication. */
73
+ export declare function hasCurrentExecutionArtifactProof(summary: OutputSummary, artifactId: string, payload?: string): boolean;
51
74
  export interface OutputSinkOptions {
52
75
  /**
53
76
  * Deprecated managed artifact pathname. Bare paths are deliberately ignored:
@@ -112,7 +135,16 @@ export interface TruncationResult {
112
135
  elidedBytes?: number;
113
136
  /** Lines elided from the middle (truncateMiddle only). */
114
137
  elidedLines?: number;
138
+ headRange?: {
139
+ start: number;
140
+ end: number;
141
+ };
142
+ tailRange?: {
143
+ start: number;
144
+ end: number;
145
+ };
115
146
  lastLinePartial?: boolean;
147
+ firstLinePartial?: boolean;
116
148
  firstLineExceedsLimit?: boolean;
117
149
  lastLineExceedsLimit?: boolean;
118
150
  }
@@ -70,6 +70,8 @@ export interface TaskResultReceipt {
70
70
  forkContextAdvisory?: SingleResult["forkContextAdvisory"];
71
71
  /** Resolved repository identity for this delegated lane (#2901). */
72
72
  repositoryBinding?: SingleResult["repositoryBinding"];
73
+ /** Runtime-derived review source disposition and rerun guidance (#3469). */
74
+ reviewSource?: SingleResult["reviewSource"];
73
75
  roi?: TaskRoi;
74
76
  }
75
77
  /**
@@ -1,6 +1,7 @@
1
1
  import type { ThinkingLevel } from "@gajae-code/agent-core";
2
2
  import type { Usage } from "@gajae-code/ai";
3
3
  import * as z from "zod/v4";
4
+ import type { ReviewDeliveryDisposition, ReviewSourceLane } from "../gjc-runtime/ultragoal-review-source";
4
5
  import type { TaskResultReceipt } from "./receipt";
5
6
  import type { SpawnRoiReconciliation } from "./roi-reconciliation";
6
7
  import { type TaskSimpleMode } from "./simple-mode";
@@ -65,6 +66,24 @@ export declare const taskItemSchema: z.ZodObject<{
65
66
  head: z.ZodOptional<z.ZodString>;
66
67
  branch: z.ZodOptional<z.ZodString>;
67
68
  }, z.core.$strict>>;
69
+ reviewSource: z.ZodOptional<z.ZodObject<{
70
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
71
+ cohortId: z.ZodString;
72
+ generation: z.ZodNumber;
73
+ lane: z.ZodEnum<{
74
+ architect: "architect";
75
+ cleaner: "cleaner";
76
+ critic: "critic";
77
+ qa: "qa";
78
+ }>;
79
+ snapshotId: z.ZodString;
80
+ repositoryBindingDigest: z.ZodString;
81
+ stateRevision: z.ZodNumber;
82
+ dispatchId: z.ZodString;
83
+ rerunCommand: z.ZodString;
84
+ taskId: z.ZodString;
85
+ createdAt: z.ZodString;
86
+ }, z.core.$strict>>;
68
87
  }, z.core.$strip>;
69
88
  export type TaskItem = z.infer<typeof taskItemSchema>;
70
89
  export declare const taskSchema: z.ZodObject<{
@@ -93,6 +112,24 @@ export declare const taskSchema: z.ZodObject<{
93
112
  head: z.ZodOptional<z.ZodString>;
94
113
  branch: z.ZodOptional<z.ZodString>;
95
114
  }, z.core.$strict>>;
115
+ reviewSource: z.ZodOptional<z.ZodObject<{
116
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
117
+ cohortId: z.ZodString;
118
+ generation: z.ZodNumber;
119
+ lane: z.ZodEnum<{
120
+ architect: "architect";
121
+ cleaner: "cleaner";
122
+ critic: "critic";
123
+ qa: "qa";
124
+ }>;
125
+ snapshotId: z.ZodString;
126
+ repositoryBindingDigest: z.ZodString;
127
+ stateRevision: z.ZodNumber;
128
+ dispatchId: z.ZodString;
129
+ rerunCommand: z.ZodString;
130
+ taskId: z.ZodString;
131
+ createdAt: z.ZodString;
132
+ }, z.core.$strict>>;
96
133
  }, z.core.$strip>>;
97
134
  spawnPlan: z.ZodOptional<z.ZodObject<{
98
135
  whyParallel: z.ZodString;
@@ -128,6 +165,24 @@ export declare const taskSchemaNoIsolation: z.ZodObject<{
128
165
  head: z.ZodOptional<z.ZodString>;
129
166
  branch: z.ZodOptional<z.ZodString>;
130
167
  }, z.core.$strict>>;
168
+ reviewSource: z.ZodOptional<z.ZodObject<{
169
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
170
+ cohortId: z.ZodString;
171
+ generation: z.ZodNumber;
172
+ lane: z.ZodEnum<{
173
+ architect: "architect";
174
+ cleaner: "cleaner";
175
+ critic: "critic";
176
+ qa: "qa";
177
+ }>;
178
+ snapshotId: z.ZodString;
179
+ repositoryBindingDigest: z.ZodString;
180
+ stateRevision: z.ZodNumber;
181
+ dispatchId: z.ZodString;
182
+ rerunCommand: z.ZodString;
183
+ taskId: z.ZodString;
184
+ createdAt: z.ZodString;
185
+ }, z.core.$strict>>;
131
186
  }, z.core.$strip>>;
132
187
  spawnPlan: z.ZodOptional<z.ZodObject<{
133
188
  whyParallel: z.ZodString;
@@ -163,6 +218,24 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
163
218
  head: z.ZodOptional<z.ZodString>;
164
219
  branch: z.ZodOptional<z.ZodString>;
165
220
  }, z.core.$strict>>;
221
+ reviewSource: z.ZodOptional<z.ZodObject<{
222
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
223
+ cohortId: z.ZodString;
224
+ generation: z.ZodNumber;
225
+ lane: z.ZodEnum<{
226
+ architect: "architect";
227
+ cleaner: "cleaner";
228
+ critic: "critic";
229
+ qa: "qa";
230
+ }>;
231
+ snapshotId: z.ZodString;
232
+ repositoryBindingDigest: z.ZodString;
233
+ stateRevision: z.ZodNumber;
234
+ dispatchId: z.ZodString;
235
+ rerunCommand: z.ZodString;
236
+ taskId: z.ZodString;
237
+ createdAt: z.ZodString;
238
+ }, z.core.$strict>>;
166
239
  }, z.core.$strip>>;
167
240
  spawnPlan: z.ZodOptional<z.ZodObject<{
168
241
  whyParallel: z.ZodString;
@@ -197,6 +270,24 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
197
270
  head: z.ZodOptional<z.ZodString>;
198
271
  branch: z.ZodOptional<z.ZodString>;
199
272
  }, z.core.$strict>>;
273
+ reviewSource: z.ZodOptional<z.ZodObject<{
274
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
275
+ cohortId: z.ZodString;
276
+ generation: z.ZodNumber;
277
+ lane: z.ZodEnum<{
278
+ architect: "architect";
279
+ cleaner: "cleaner";
280
+ critic: "critic";
281
+ qa: "qa";
282
+ }>;
283
+ snapshotId: z.ZodString;
284
+ repositoryBindingDigest: z.ZodString;
285
+ stateRevision: z.ZodNumber;
286
+ dispatchId: z.ZodString;
287
+ rerunCommand: z.ZodString;
288
+ taskId: z.ZodString;
289
+ createdAt: z.ZodString;
290
+ }, z.core.$strict>>;
200
291
  }, z.core.$strip>>;
201
292
  spawnPlan: z.ZodOptional<z.ZodObject<{
202
293
  whyParallel: z.ZodString;
@@ -231,6 +322,24 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
231
322
  head: z.ZodOptional<z.ZodString>;
232
323
  branch: z.ZodOptional<z.ZodString>;
233
324
  }, z.core.$strict>>;
325
+ reviewSource: z.ZodOptional<z.ZodObject<{
326
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
327
+ cohortId: z.ZodString;
328
+ generation: z.ZodNumber;
329
+ lane: z.ZodEnum<{
330
+ architect: "architect";
331
+ cleaner: "cleaner";
332
+ critic: "critic";
333
+ qa: "qa";
334
+ }>;
335
+ snapshotId: z.ZodString;
336
+ repositoryBindingDigest: z.ZodString;
337
+ stateRevision: z.ZodNumber;
338
+ dispatchId: z.ZodString;
339
+ rerunCommand: z.ZodString;
340
+ taskId: z.ZodString;
341
+ createdAt: z.ZodString;
342
+ }, z.core.$strict>>;
234
343
  }, z.core.$strip>>;
235
344
  spawnPlan: z.ZodOptional<z.ZodObject<{
236
345
  whyParallel: z.ZodString;
@@ -265,6 +374,24 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
265
374
  head: z.ZodOptional<z.ZodString>;
266
375
  branch: z.ZodOptional<z.ZodString>;
267
376
  }, z.core.$strict>>;
377
+ reviewSource: z.ZodOptional<z.ZodObject<{
378
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
379
+ cohortId: z.ZodString;
380
+ generation: z.ZodNumber;
381
+ lane: z.ZodEnum<{
382
+ architect: "architect";
383
+ cleaner: "cleaner";
384
+ critic: "critic";
385
+ qa: "qa";
386
+ }>;
387
+ snapshotId: z.ZodString;
388
+ repositoryBindingDigest: z.ZodString;
389
+ stateRevision: z.ZodNumber;
390
+ dispatchId: z.ZodString;
391
+ rerunCommand: z.ZodString;
392
+ taskId: z.ZodString;
393
+ createdAt: z.ZodString;
394
+ }, z.core.$strict>>;
268
395
  }, z.core.$strip>>;
269
396
  spawnPlan: z.ZodOptional<z.ZodObject<{
270
397
  whyParallel: z.ZodString;
@@ -299,6 +426,24 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
299
426
  head: z.ZodOptional<z.ZodString>;
300
427
  branch: z.ZodOptional<z.ZodString>;
301
428
  }, z.core.$strict>>;
429
+ reviewSource: z.ZodOptional<z.ZodObject<{
430
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
431
+ cohortId: z.ZodString;
432
+ generation: z.ZodNumber;
433
+ lane: z.ZodEnum<{
434
+ architect: "architect";
435
+ cleaner: "cleaner";
436
+ critic: "critic";
437
+ qa: "qa";
438
+ }>;
439
+ snapshotId: z.ZodString;
440
+ repositoryBindingDigest: z.ZodString;
441
+ stateRevision: z.ZodNumber;
442
+ dispatchId: z.ZodString;
443
+ rerunCommand: z.ZodString;
444
+ taskId: z.ZodString;
445
+ createdAt: z.ZodString;
446
+ }, z.core.$strict>>;
302
447
  }, z.core.$strip>>;
303
448
  spawnPlan: z.ZodOptional<z.ZodObject<{
304
449
  whyParallel: z.ZodString;
@@ -333,6 +478,24 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
333
478
  head: z.ZodOptional<z.ZodString>;
334
479
  branch: z.ZodOptional<z.ZodString>;
335
480
  }, z.core.$strict>>;
481
+ reviewSource: z.ZodOptional<z.ZodObject<{
482
+ schema: z.ZodLiteral<"gjc.review_source_dispatch.v1">;
483
+ cohortId: z.ZodString;
484
+ generation: z.ZodNumber;
485
+ lane: z.ZodEnum<{
486
+ architect: "architect";
487
+ cleaner: "cleaner";
488
+ critic: "critic";
489
+ qa: "qa";
490
+ }>;
491
+ snapshotId: z.ZodString;
492
+ repositoryBindingDigest: z.ZodString;
493
+ stateRevision: z.ZodNumber;
494
+ dispatchId: z.ZodString;
495
+ rerunCommand: z.ZodString;
496
+ taskId: z.ZodString;
497
+ createdAt: z.ZodString;
498
+ }, z.core.$strict>>;
336
499
  }, z.core.$strip>>;
337
500
  spawnPlan: z.ZodOptional<z.ZodObject<{
338
501
  whyParallel: z.ZodString;
@@ -603,6 +766,21 @@ export interface SingleResult {
603
766
  head?: string;
604
767
  branch?: string;
605
768
  };
769
+ /** Leader-issued immutable source identity for source-aware review lanes (#3469). */
770
+ reviewSource?: {
771
+ schema: "gjc.review_source_dispatch.v1";
772
+ cohortId: string;
773
+ generation: number;
774
+ lane: ReviewSourceLane;
775
+ snapshotId: string;
776
+ repositoryBindingDigest: string;
777
+ stateRevision: number;
778
+ dispatchId: string;
779
+ rerunCommand: string;
780
+ disposition: ReviewDeliveryDisposition;
781
+ currentSnapshotId?: string;
782
+ deliveryId?: string;
783
+ };
606
784
  }
607
785
  /** True only for complete, factual five-bucket cost accounting. */
608
786
  export declare function hasCompleteUsageCostBreakdown(usage: unknown): boolean;
@@ -91,7 +91,7 @@ export declare class BashTool implements AgentTool<BashToolSchema, BashToolDetai
91
91
  label: string;
92
92
  commandCwd: string;
93
93
  }>;
94
- execute(_toolCallId: string, { command: rawCommand, env: rawEnv, timeout: rawTimeout, cwd, async: asyncRequested, pty, }: BashToolInput, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<BashToolDetails>, ctx?: AgentToolContext): Promise<AgentToolResult<BashToolDetails>>;
94
+ execute(toolCallId: string, { command: rawCommand, env: rawEnv, timeout: rawTimeout, cwd, async: asyncRequested, pty, }: BashToolInput, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<BashToolDetails>, ctx?: AgentToolContext): Promise<AgentToolResult<BashToolDetails>>;
95
95
  }
96
96
  export interface BashRenderArgs {
97
97
  command?: string;
@@ -49,6 +49,9 @@ export interface ReadUrlToolDetails {
49
49
  }
50
50
  interface ReadUrlCacheEntry {
51
51
  artifactId?: string;
52
+ artifactVerified?: boolean;
53
+ artifactFailureDiagnostic?: string;
54
+ artifactStorageIncomplete?: boolean;
52
55
  details: ReadUrlToolDetails;
53
56
  image?: FetchImagePayload;
54
57
  /** Complete URL output, including its preamble and body. */
@@ -4,10 +4,11 @@
4
4
  * Tools populate details.meta using the fluent OutputMetaBuilder.
5
5
  * The tool wrapper automatically formats and appends notices at message boundary.
6
6
  */
7
- import type { AgentTool } from "@gajae-code/agent-core";
7
+ import type { AgentTool, AgentToolContext, AgentToolResult } from "@gajae-code/agent-core";
8
8
  import { type Settings } from "../config/settings";
9
9
  import type { Theme } from "../modes/theme/theme";
10
10
  import { type OutputSummary, type ReadWindow, type TruncationResult } from "../session/streaming-output";
11
+ export { isValidArtifactId } from "../utils/artifact-id";
11
12
  /**
12
13
  * Truncation metadata for the output notice.
13
14
  */
@@ -48,8 +49,16 @@ export interface TruncationMeta {
48
49
  elidedLines?: number;
49
50
  /** Artifact ID when output was persisted; completeness is tracked separately below. */
50
51
  artifactId?: string;
52
+ /** Artifact existence was proven by a successful save or publisher receipt. */
53
+ artifactVerified?: boolean;
51
54
  /** Bytes omitted from an artifact after its hard storage cap was reached. */
52
55
  artifactTruncatedBytes?: number;
56
+ /** Bytes dropped before Bash received the native output stream. */
57
+ sourceTruncatedBytes?: number;
58
+ /** Exact source capture completeness could not be proven. */
59
+ sourceCaptureIncomplete?: boolean;
60
+ /** Bytes omitted from the visible output by per-line column capping. */
61
+ columnDroppedBytes?: number;
53
62
  /** Bounded diagnostic when artifact writer creation, write, or finalization failed. */
54
63
  artifactFailureDiagnostic?: string;
55
64
  /** Next offset for pagination (head truncation only) */
@@ -103,12 +112,17 @@ export interface OutputMeta {
103
112
  source?: SourceMeta;
104
113
  diagnostics?: DiagnosticMeta;
105
114
  limits?: LimitsMeta;
115
+ /** Diagnostics were omitted to preserve the configured inline byte cap. */
116
+ diagnosticsOmitted?: boolean;
106
117
  }
107
118
  export interface TruncationOptions {
108
119
  direction: "head" | "tail" | "middle";
109
120
  startLine?: number;
110
121
  totalFileLines?: number;
111
122
  artifactId?: string;
123
+ artifactVerified?: boolean;
124
+ artifactFailureDiagnostic?: string;
125
+ sourceCaptureIncomplete?: boolean;
112
126
  maxBytes?: number;
113
127
  noticeOwner?: "body";
114
128
  }
@@ -124,6 +138,8 @@ export interface TruncationTextOptions {
124
138
  totalBytes?: number;
125
139
  maxBytes?: number;
126
140
  artifactId?: string;
141
+ artifactVerified?: boolean;
142
+ sourceCaptureIncomplete?: boolean;
127
143
  noticeOwner?: "body";
128
144
  }
129
145
  /**
@@ -145,6 +161,7 @@ export declare class OutputMetaBuilder {
145
161
  /** Add metadata from the actual head/tail windows retained by middle truncation. */
146
162
  truncationWindows(windows: ReadWindow, options?: {
147
163
  artifactId?: string;
164
+ artifactVerified?: boolean;
148
165
  noticeOwner?: "body";
149
166
  maxBytes?: number;
150
167
  rangeBase?: "file" | "window";
@@ -182,10 +199,24 @@ export declare class OutputMetaBuilder {
182
199
  /** Create a new OutputMetaBuilder. */
183
200
  export declare function outputMeta(): OutputMetaBuilder;
184
201
  export declare function formatFullOutputReference(artifactId: string): string;
185
- /**
186
- * Format an artifact reference without claiming completeness when storage was hard-capped.
187
- */
188
- export declare function formatArtifactReference(artifactId: string, artifactTruncatedBytes?: number): string;
202
+ export interface ArtifactFailurePreview {
203
+ text: string;
204
+ omittedBytes: number;
205
+ }
206
+ /** Build a bounded, UTF-8-safe preview when artifact storage cannot retain the full payload. */
207
+ export declare function createArtifactFailurePreview(fullText: string, maxInlineBytes: number | undefined, diagnostic: string): ArtifactFailurePreview;
208
+ /** Format an artifact reference without claiming completeness when capture or storage omitted bytes. */
209
+ export declare function formatArtifactReference(artifactId: string, artifactTruncatedBytes?: number, sourceTruncatedBytes?: number, sourceCaptureIncomplete?: boolean): string;
210
+ export interface ArtifactEvidence {
211
+ artifactId?: string;
212
+ artifactVerified?: boolean;
213
+ artifactTruncatedBytes?: number;
214
+ sourceTruncatedBytes?: number;
215
+ sourceCaptureIncomplete?: boolean;
216
+ artifactFailureDiagnostic?: string;
217
+ columnDroppedBytes?: number;
218
+ }
219
+ export declare function formatArtifactEvidenceNotice(evidence: ArtifactEvidence): string | undefined;
189
220
  export declare function formatTruncationMetaNotice(truncation: TruncationMeta): string;
190
221
  /**
191
222
  * Format styled artifact reference with warning color and brackets.
@@ -238,6 +269,7 @@ export declare function resolveBashOutputSinkHeadBytes(s: Settings): number;
238
269
  * line-buffer post-processing, so one setting controls both surfaces.
239
270
  */
240
271
  export declare function resolveOutputMaxColumns(s: Settings | undefined): number;
272
+ export declare function finalizeToolResultForDelivery(result: AgentToolResult, toolName: string, context: AgentToolContext | undefined): Promise<AgentToolResult>;
241
273
  /**
242
274
  * Wrap a tool to:
243
275
  * 1. Automatically append output notices based on details.meta
@@ -14,6 +14,7 @@ export declare class ToolResultBuilder<TDetails extends DetailsWithMeta> {
14
14
  truncation(result: TruncationResult, options: TruncationOptions): this;
15
15
  truncationWindows(windows: ReadWindow, options?: {
16
16
  artifactId?: string;
17
+ artifactVerified?: boolean;
17
18
  noticeOwner?: "body";
18
19
  maxBytes?: number;
19
20
  rangeBase?: "file" | "window";
@@ -0,0 +1,2 @@
1
+ /** Artifact protocol IDs are decimal numbers allocated by the session artifact store. */
2
+ export declare function isValidArtifactId(value: unknown): value is string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/coding-agent",
4
- "version": "0.12.5",
4
+ "version": "0.12.6",
5
5
  "description": "Gajae Code CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://gajae-code.com",
7
7
  "author": "Yeachan-Heo and Gajae Code Contributors",
@@ -53,13 +53,13 @@
53
53
  "@agentclientprotocol/sdk": "1.3.0",
54
54
  "@babel/parser": "^7.29.3",
55
55
  "@mozilla/readability": "^0.6.0",
56
- "@gajae-code/stats": "0.12.5",
57
- "@gajae-code/agent-core": "0.12.5",
58
- "@gajae-code/ai": "0.12.5",
59
- "@gajae-code/bridge-client": "0.12.5",
60
- "@gajae-code/natives": "0.12.5",
61
- "@gajae-code/tui": "0.12.5",
62
- "@gajae-code/utils": "0.12.5",
56
+ "@gajae-code/stats": "0.12.6",
57
+ "@gajae-code/agent-core": "0.12.6",
58
+ "@gajae-code/ai": "0.12.6",
59
+ "@gajae-code/bridge-client": "0.12.6",
60
+ "@gajae-code/natives": "0.12.6",
61
+ "@gajae-code/tui": "0.12.6",
62
+ "@gajae-code/utils": "0.12.6",
63
63
  "@puppeteer/browsers": "^2.13.0",
64
64
  "@types/turndown": "5.0.6",
65
65
  "@xterm/headless": "^6.0.0",