@gajae-code/coding-agent 0.12.6 → 0.12.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/dist/types/async/job-manager.d.ts +36 -1
  3. package/dist/types/commands/notify.d.ts +4 -0
  4. package/dist/types/config/file-lock.d.ts +3 -0
  5. package/dist/types/config/model-discovery-manager.d.ts +6 -1
  6. package/dist/types/config/model-registry.d.ts +2 -0
  7. package/dist/types/config/resolve-config-value.d.ts +2 -1
  8. package/dist/types/config/settings-schema.d.ts +17 -1
  9. package/dist/types/eval/backend.d.ts +2 -2
  10. package/dist/types/exec/bash-executor.d.ts +8 -10
  11. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +0 -36
  12. package/dist/types/internal-urls/registry-helpers.d.ts +0 -18
  13. package/dist/types/main.d.ts +1 -0
  14. package/dist/types/modes/components/hook-selector.d.ts +20 -0
  15. package/dist/types/modes/components/notifications-settings-editor.d.ts +53 -4
  16. package/dist/types/modes/controllers/extension-ui-controller.d.ts +1 -1
  17. package/dist/types/modes/controllers/selector-controller.d.ts +4 -2
  18. package/dist/types/sdk/broker/broker.d.ts +5 -1
  19. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +1 -0
  20. package/dist/types/sdk/bus/chat-daemon-control.d.ts +11 -3
  21. package/dist/types/sdk/bus/config.d.ts +75 -113
  22. package/dist/types/sdk/bus/discord-live-provider.d.ts +8 -2
  23. package/dist/types/sdk/bus/discord-provider.d.ts +19 -0
  24. package/dist/types/sdk/bus/index.d.ts +1 -1
  25. package/dist/types/sdk/bus/notification-orchestration.d.ts +127 -18
  26. package/dist/types/sdk/bus/notification-service.d.ts +31 -4
  27. package/dist/types/sdk/bus/session-control.d.ts +8 -3
  28. package/dist/types/sdk/bus/slack-live-provider.d.ts +9 -2
  29. package/dist/types/sdk/bus/slack-provider.d.ts +22 -0
  30. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +9 -4
  31. package/dist/types/sdk/client/discovery.d.ts +2 -1
  32. package/dist/types/sdk/host/host.d.ts +2 -23
  33. package/dist/types/sdk/host/query/handlers.d.ts +2 -0
  34. package/dist/types/sdk/host/reverse-leases.d.ts +4 -7
  35. package/dist/types/sdk/index.d.ts +1 -0
  36. package/dist/types/sdk/providers.d.ts +22 -0
  37. package/dist/types/sdk/session-directory.d.ts +1 -1
  38. package/dist/types/session/artifacts.d.ts +5 -8
  39. package/dist/types/session/client-bridge.d.ts +0 -14
  40. package/dist/types/session/internal/managed-session-scope.d.ts +17 -1
  41. package/dist/types/session/internal/managed-session-storage.d.ts +11 -4
  42. package/dist/types/session/internal/native-publish-outcome.d.ts +1 -0
  43. package/dist/types/session/internal/session-open-errors.d.ts +5 -0
  44. package/dist/types/session/messages.d.ts +1 -4
  45. package/dist/types/session/session-manager.d.ts +7 -6
  46. package/dist/types/session/session-storage.d.ts +2 -0
  47. package/dist/types/session/streaming-output.d.ts +0 -32
  48. package/dist/types/task/receipt.d.ts +1 -2
  49. package/dist/types/task/types.d.ts +43 -178
  50. package/dist/types/tools/bash.d.ts +1 -1
  51. package/dist/types/tools/fetch.d.ts +0 -3
  52. package/dist/types/tools/output-meta.d.ts +5 -37
  53. package/dist/types/tools/subagent.d.ts +15 -0
  54. package/dist/types/tools/todo-write.d.ts +3 -0
  55. package/dist/types/tools/tool-result.d.ts +0 -1
  56. package/package.json +10 -8
  57. package/scripts/build-sdk-package-smoke.ts +51 -0
  58. package/scripts/capture-notifications-settings-showcase.ts +1 -1
  59. package/src/async/job-manager.ts +430 -46
  60. package/src/cli/notify-cli.ts +204 -94
  61. package/src/commands/notify.ts +19 -8
  62. package/src/config/file-lock.ts +6 -0
  63. package/src/config/model-discovery-manager.ts +50 -8
  64. package/src/config/model-registry.ts +862 -75
  65. package/src/config/resolve-config-value.ts +10 -8
  66. package/src/config/settings-schema.ts +25 -15
  67. package/src/config/settings.ts +15 -15
  68. package/src/cursor.ts +13 -20
  69. package/src/defaults/gjc/skills/ultragoal/SKILL.md +2 -3
  70. package/src/eval/backend.ts +2 -2
  71. package/src/exec/bash-executor.ts +151 -425
  72. package/src/gjc-runtime/session-state-sidecar.ts +12 -2
  73. package/src/gjc-runtime/ultragoal-runtime.ts +3 -280
  74. package/src/gjc-runtime/workflow-manifest.generated.json +1 -40
  75. package/src/gjc-runtime/workflow-manifest.ts +0 -12
  76. package/src/internal-urls/agent-protocol.ts +38 -98
  77. package/src/internal-urls/artifact-protocol.ts +17 -28
  78. package/src/internal-urls/docs-index.generated.ts +7 -7
  79. package/src/internal-urls/registry-helpers.ts +0 -62
  80. package/src/main.ts +43 -7
  81. package/src/modes/DESIGN.md +11 -11
  82. package/src/modes/acp/acp-agent.ts +0 -24
  83. package/src/modes/acp/acp-client-bridge.ts +11 -154
  84. package/src/modes/components/hook-selector.ts +155 -44
  85. package/src/modes/components/model-selector.ts +242 -49
  86. package/src/modes/components/notifications-settings-editor.ts +631 -85
  87. package/src/modes/controllers/extension-ui-controller.ts +114 -15
  88. package/src/modes/controllers/selector-controller.ts +464 -50
  89. package/src/prompts/tools/bash.md +2 -2
  90. package/src/sdk/acp/adapter.ts +9 -200
  91. package/src/sdk/broker/broker.ts +54 -10
  92. package/src/sdk/broker/lifecycle-ledger.ts +34 -1
  93. package/src/sdk/broker/lifecycle.ts +47 -50
  94. package/src/sdk/bus/chat-daemon-cli.ts +12 -5
  95. package/src/sdk/bus/chat-daemon-control.ts +35 -8
  96. package/src/sdk/bus/chat-daemon-runtime.ts +16 -2
  97. package/src/sdk/bus/config.ts +534 -286
  98. package/src/sdk/bus/discord-live-provider.ts +57 -2
  99. package/src/sdk/bus/discord-provider.ts +21 -0
  100. package/src/sdk/bus/index.ts +105 -359
  101. package/src/sdk/bus/notification-orchestration.ts +371 -68
  102. package/src/sdk/bus/notification-service.ts +431 -130
  103. package/src/sdk/bus/session-control.ts +119 -44
  104. package/src/sdk/bus/slack-live-provider.ts +78 -2
  105. package/src/sdk/bus/slack-provider.ts +24 -0
  106. package/src/sdk/bus/telegram-daemon-cli.ts +9 -2
  107. package/src/sdk/bus/telegram-daemon-contract.ts +9 -4
  108. package/src/sdk/bus/telegram-daemon-control.ts +3 -3
  109. package/src/sdk/bus/telegram-daemon.ts +23 -15
  110. package/src/sdk/client/discovery.ts +10 -4
  111. package/src/sdk/host/host.ts +9 -187
  112. package/src/sdk/host/query/handlers.ts +20 -1
  113. package/src/sdk/host/reverse-leases.ts +42 -249
  114. package/src/sdk/index.ts +1 -0
  115. package/src/sdk/protocol/operation-inventory.generated.json +18 -0
  116. package/src/sdk/protocol/operation-registry.ts +5 -2
  117. package/src/sdk/providers.ts +51 -0
  118. package/src/sdk/session-directory.ts +1 -0
  119. package/src/sdk/session.ts +10 -7
  120. package/src/session/agent-session.ts +59 -202
  121. package/src/session/artifacts.ts +74 -211
  122. package/src/session/client-bridge.ts +0 -15
  123. package/src/session/internal/managed-session-scope.ts +981 -450
  124. package/src/session/internal/managed-session-storage.ts +362 -124
  125. package/src/session/internal/native-publish-outcome.ts +3 -1
  126. package/src/session/internal/session-open-errors.ts +11 -0
  127. package/src/session/messages.ts +7 -32
  128. package/src/session/session-manager.ts +48 -15
  129. package/src/session/session-storage.ts +72 -5
  130. package/src/session/streaming-output.ts +40 -198
  131. package/src/slash-commands/builtin-registry.ts +82 -4
  132. package/src/task/index.ts +237 -65
  133. package/src/task/receipt.ts +2 -4
  134. package/src/task/render.ts +0 -30
  135. package/src/task/types.ts +10 -34
  136. package/src/tools/ask.ts +1 -1
  137. package/src/tools/bash.ts +239 -818
  138. package/src/tools/eval.ts +4 -99
  139. package/src/tools/fetch.ts +15 -77
  140. package/src/tools/find.ts +3 -7
  141. package/src/tools/output-meta.ts +114 -696
  142. package/src/tools/search.ts +4 -9
  143. package/src/tools/subagent.ts +97 -75
  144. package/src/tools/telegram-send.ts +4 -2
  145. package/src/tools/todo-write.ts +47 -0
  146. package/src/tools/tool-result.ts +0 -1
  147. package/dist/types/gjc-runtime/ultragoal-review-source.d.ts +0 -83
  148. package/dist/types/utils/artifact-id.d.ts +0 -2
  149. package/src/gjc-runtime/ultragoal-review-source.ts +0 -378
  150. package/src/utils/artifact-id.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.12.8] - 2026-08-02
6
+ ### Added
7
+
8
+ - Added the paginated public SDK query `providers.list/active` (Q29), returning deterministic, deduplicated `{ provider, connectionKind }` descriptors for locally eligible providers without exposing credentials or performing remote health probes.
9
+
10
+ ### Added
11
+
12
+ - Notification settings now expose first-class Telegram, Discord, and Slack configuration, desired-intent toggles, provider-local quarantine and repair guidance, explicit `keep | replace | remove` secret actions, provider-specific health/test diagnostics, and truthful saved-but-runtime-degraded outcomes. The global master preserves provider credentials and intent, `GJC_NOTIFICATIONS=0` suppresses only automatic generic-session admission, and blocked Telegram ownership uses an isolated chat-only endpoint so verified Discord or Slack siblings can continue without exposing the shared endpoint.
13
+
14
+ ### Fixed
15
+
16
+ - Ordinary `ask` selectors now bound long question premises and page through every premise row without skipping rows hidden by overflow indicators (#3675).
17
+ - First-event timeout retries now require a typed, content-free failure from the current clean attempt scope, preventing prior or stale extension activity from suppressing or admitting a later request (#3553).
18
+ - The issue-1979 Korean prose wrap test now cleans up inherited multiplexer env vars (`TMUX`, `TMUX_PANE`, etc.) so it deterministically exercises the plain-terminal render path regardless of the CI runner's terminal session (#1979).
19
+ - The model selector's assignment menu now shows the model each role currently resolves to (`Set as EXECUTOR (Executor) — now: anthropic/claude-haiku-4-5`), distinguishing an unset default, a role that inherits the default, and a configured-but-unresolvable selector. Previously the role rows were unlabeled, so the only way to learn a role's model was to scan the whole 800+ entry model list for role badges.
20
+ ## [0.12.7] - 2026-07-31
21
+
5
22
  ## [0.12.6] - 2026-07-31
6
23
  ### Added
7
24
 
@@ -10,6 +27,7 @@
10
27
  ### Fixed
11
28
 
12
29
  - Settings now requests a repaint after asynchronous GJC bundle and plugin views rebuild, so loaded content and mutation results appear without an extra keypress (#3643).
30
+ - `todo_write` now rejects unsupported operation keys and treats a bare `done` or `drop` as an error instead of completing or abandoning every task (#3640).
13
31
  - Deferred `agent_end` publication again settles public session readiness before slow extension handlers finish, while retaining exact cancellation leases through queued extension delivery and draining that delivery before session shutdown.
14
32
  - Ultragoal validation-batch hydration now fails closed unless deferred and final-close evidence exactly matches a complete authoritative cumulative Git/CI inventory and durable batch tuple. Explicit malformed, partial, unknown, reordered, or stale receipt data is rejected; Git path capture is byte-safe, NUL-delimited, and includes untracked files; incomplete capture conservatively requires computer-control QA; shared settings and tool registries cannot use partial diffs to bypass that suite; validate/checkpoint replacement hydration is identical; and current/replacement receipts are byte-bound to ledger payloads (#3541).
15
33
  - Fixture quality gates that complete intermediate Ultragoal stories now write file-backed adversarial artifact proof; skill-state hooks and computer red-team fixtures match the unconditional adversarial path check so #3543 CI stays fail-closed without weakening hydration exactness (#3543).
@@ -25,6 +43,10 @@
25
43
 
26
44
  - Canonical wrapped first-event timeouts now continue the same clean turn through bounded retries and configured fallback rotation, while preserving replay-safety, cancellation, provider-terminal policies, exact attempt diagnostics, and task/subagent retry-status truth (#3553).
27
45
  - Runtime skill discovery now preserves a candidate when its exact skill name appears as a query token, so additional task-specific terms no longer discard an explicitly named skill.
46
+ ### Fixed
47
+
48
+ - Managed-session deletion now immediately continues a descriptor-authorized POSIX artifact detach through exact payload scrubbing before retiring the transcript. Durable direct and replay cleanup preserve substituted successors, while fork regressions use an explicit snapshot barrier instead of scheduler timing.
49
+ - Managed-session migration keeps a definitely live holder exclusive beyond the 60-second lease without timer-dependent self-fencing, permits immediate successor acquisition only after explicit release or proven process death, and surfaces capacity/busy startup failures through fixed path/content-redacted guidance (#3508).
28
50
 
29
51
  ## [0.12.5] - 2026-07-30
30
52
  ### Fixed
@@ -68,7 +90,6 @@
68
90
  - The interactive `Working…` indicator now remains visible and explicitly labels owner-scoped detached background work across foreground completion, provider errors, pending-submission aborts, and job completion, without resurrecting after TUI disposal (#3479).
69
91
  - Activity-indicator suspension now detaches and restores the exact owned loader instead of stopping foreign transition UI; optimistic pre-init prompts still show and clear their spinner, context clear retains its eager teardown contract, and resume cancellation preserves transient state until session mutation actually begins.
70
92
  - Activity-indicator stop and suspension helpers now fail safely for lightweight controller contexts with absent or partial status rails, while full interactive contexts retain exact loader detach/restore ownership.
71
- - Bash now uses bounded core-to-native and N-API callback backpressure plus a 64 KiB terminal tail after the core 8 MiB stream budget, emits at most one typed aggregate loss marker, carries source-loss evidence through merged and raw stream cancellation/error paths, bounds ACP terminal lifecycle/output RPC settlement, cleans settled native sessions, labels every combined omission honestly through inline backstops and failure paths, omits false source ranges, and rejects malformed artifact IDs/counts.
72
93
 
73
94
  ## [0.12.1] - 2026-07-29
74
95
 
@@ -1,6 +1,7 @@
1
1
  import type { AgentProgress, AgentSource } from "../task/types";
2
2
  export interface AsyncJob {
3
3
  id: string;
4
+ readonly generation: string;
4
5
  type: "bash" | "task";
5
6
  status: "running" | "completed" | "failed" | "cancelled" | "paused";
6
7
  startTime: number;
@@ -41,6 +42,8 @@ export interface AsyncJobMetadata {
41
42
  agentSource: AgentSource;
42
43
  description?: string;
43
44
  assignment?: string;
45
+ duplicateIdentity?: string;
46
+ duplicateDisposition?: "warned" | "superseded";
44
47
  };
45
48
  /** True when this bash job was started by the `monitor` tool (vs plain async bash). */
46
49
  monitor?: boolean;
@@ -136,6 +139,11 @@ export interface SubagentRecord {
136
139
  modelFellBack?: boolean;
137
140
  /** True when the effective subagent provider is in fast mode. */
138
141
  fastMode?: boolean;
142
+ duplicateIdentity?: string;
143
+ duplicateDisposition?: "warned" | "superseded";
144
+ terminalGeneration?: string;
145
+ /** Generation of currentJobId, preventing stale ID reuse from mutating this record. */
146
+ currentJobGeneration?: string;
139
147
  }
140
148
  /** Lightweight, manager-owned resume payload. The async layer treats `data` as opaque. */
141
149
  export interface ResumeDescriptor {
@@ -200,6 +208,31 @@ export interface AsyncJobRegisterOptions {
200
208
  export interface AsyncJobFilter {
201
209
  ownerId?: string;
202
210
  }
211
+ export type AsyncJobWaitCondition = "all_terminal" | "any_terminal";
212
+ export type AsyncJobWaitOutcome = "completed" | "timed_out_wait" | "interrupted";
213
+ export interface AsyncJobWaitTarget {
214
+ targetId: string;
215
+ jobId: string | null;
216
+ subagentId?: string;
217
+ generation: string;
218
+ ownerId?: string;
219
+ initialStatus: AsyncJob["status"] | "queued" | "not_found";
220
+ }
221
+ export interface AsyncJobWaitResult {
222
+ outcome: AsyncJobWaitOutcome;
223
+ condition: AsyncJobWaitCondition;
224
+ terminalJobIds: string[];
225
+ pendingJobIds: string[];
226
+ }
227
+ export interface AsyncJobWaitHandle {
228
+ readonly token: string;
229
+ readonly result: Promise<AsyncJobWaitResult>;
230
+ acknowledge(targetIds?: readonly string[]): {
231
+ acknowledged: boolean;
232
+ jobIds: string[];
233
+ };
234
+ close(): void;
235
+ }
203
236
  /**
204
237
  * A slice of process-stream output for a background job, as recorded by
205
238
  * `appendOutput` / read by `readOutputSince`.
@@ -229,6 +262,8 @@ export declare class AsyncJobManager {
229
262
  static setInstance(value: AsyncJobManager | undefined): void;
230
263
  /** Reset the process-global instance. Test-only. */
231
264
  static resetForTests(): void;
265
+ resolveSubagentWaitTarget(id: string, filter?: AsyncJobFilter): AsyncJobWaitTarget | undefined;
266
+ subscribeTerminalWait(targets: readonly AsyncJobWaitTarget[], condition?: AsyncJobWaitCondition): AsyncJobWaitHandle;
232
267
  constructor(options: AsyncJobManagerOptions);
233
268
  /**
234
269
  * Subscribe to live-job-set change events. Returns an unsubscribe function.
@@ -385,5 +420,5 @@ export declare class AsyncJobManager {
385
420
  dispose(options?: {
386
421
  timeoutMs?: number;
387
422
  }): Promise<boolean>;
388
- isDeliverySuppressed(jobId: string): boolean;
423
+ isDeliverySuppressed(jobId: string, generation?: string): boolean;
389
424
  }
@@ -55,6 +55,10 @@ export default class Notify extends Command {
55
55
  redact: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
56
56
  description: string;
57
57
  };
58
+ provider: import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
59
+ description: string;
60
+ options: string[];
61
+ };
58
62
  probe: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
59
63
  description: string;
60
64
  };
@@ -3,6 +3,9 @@ export interface FileLockOptions {
3
3
  retries?: number;
4
4
  retryDelayMs?: number;
5
5
  }
6
+ export declare const FileLockTestHooks: {
7
+ afterParentMkdir?: (lockPath: string) => void | Promise<void>;
8
+ };
6
9
  /**
7
10
  * Returns the OS-provided process start timestamp for PID-reuse detection.
8
11
  * `ps` is available on the supported Unix hosts (macOS and Linux), unlike
@@ -25,13 +25,17 @@ export interface DiscoveryMergeInput {
25
25
  models: readonly Model<Api>[];
26
26
  state: ProviderDiscoveryState;
27
27
  warning?: string;
28
+ authGeneration?: string;
29
+ fetched?: boolean;
28
30
  }
29
31
  export interface ProviderDiscoveryCallbacks<TProvider extends DiscoveryProvider> {
30
32
  cacheDbPath?: string;
31
33
  requiresAuth: (provider: TProvider) => boolean;
32
34
  peekApiKey: (provider: TProvider) => Promise<string | undefined>;
33
35
  isAuthenticated: (apiKey: string | undefined) => boolean;
34
- fetchModels: (provider: TProvider) => Promise<Model<Api>[]>;
36
+ fetchModels: (provider: TProvider, apiKey: string | undefined) => Promise<Model<Api>[]>;
37
+ getEvidenceGeneration?: (provider: TProvider) => string;
38
+ canPublishCache?: (provider: TProvider) => boolean;
35
39
  }
36
40
  /** Owns configured discovery inputs, status, cache lifecycle, and refresh generations. */
37
41
  export declare class ModelDiscoveryManager<TProvider extends DiscoveryProvider> {
@@ -42,6 +46,7 @@ export declare class ModelDiscoveryManager<TProvider extends DiscoveryProvider>
42
46
  get providers(): readonly TProvider[];
43
47
  providerIds(): Set<string>;
44
48
  getState(provider: string): ProviderDiscoveryState | undefined;
49
+ invalidate(provider: string): void;
45
50
  loadCached(provider: TProvider, cacheDbPath?: string): readonly Model<Api>[];
46
51
  beginRefresh(provider: string): DiscoveryRefreshToken;
47
52
  isCurrent(token: DiscoveryRefreshToken): boolean;
@@ -1,6 +1,7 @@
1
1
  import { type Api, type AssistantMessageEventStream, type AuthCredentialSelector, type CacheRetention, type Context, type Model, type ModelRefreshStrategy, type ModelRequestTransform, type SimpleStreamOptions, type ThinkingConfig } from "@gajae-code/ai";
2
2
  import type { OAuthCredentials, OAuthLoginCallbacks } from "@gajae-code/ai/utils/oauth/types";
3
3
  import { type ThemeColor } from "../modes/theme/theme";
4
+ import { type ActiveProviderDescriptor } from "../sdk/providers";
4
5
  import type { AuthStorage } from "../session/auth-storage";
5
6
  import type { ActiveSearchModelContext, WebSearchMode } from "../web/search/types";
6
7
  import { type ConfigError, ConfigFile } from "./config-file";
@@ -360,6 +361,7 @@ export declare class ModelRegistry {
360
361
  * This is a fast check that doesn't refresh OAuth tokens.
361
362
  */
362
363
  getAvailable(): Model<Api>[];
364
+ getActiveProviders(): ActiveProviderDescriptor[];
363
365
  /**
364
366
  * Check whether auth is configured for a model's provider.
365
367
  *
@@ -7,8 +7,9 @@
7
7
  * Resolve a config value (API key, header value, etc.) to an actual value.
8
8
  * - If starts with "!", executes the rest as a shell command and uses stdout (cached)
9
9
  * - Otherwise checks environment variable first, then treats as literal (not cached)
10
+ * - `cacheScope` isolates command-cache entries when a caller rotates its config
10
11
  */
11
- export declare function resolveConfigValue(config: string): Promise<string | undefined>;
12
+ export declare function resolveConfigValue(config: string, cacheScope?: string): Promise<string | undefined>;
12
13
  /**
13
14
  * Resolve all header values using the same resolution logic as API keys.
14
15
  */
@@ -69,7 +69,7 @@ export type AnyUiMetadata = UiBase & {
69
69
  };
70
70
  interface BooleanDef {
71
71
  type: "boolean";
72
- default: boolean;
72
+ default?: boolean;
73
73
  ui?: UiBoolean;
74
74
  }
75
75
  interface StringDef {
@@ -143,6 +143,9 @@ export declare const SETTINGS_SCHEMA: {
143
143
  readonly type: "boolean";
144
144
  readonly default: false;
145
145
  };
146
+ readonly "notifications.telegram.enabled": {
147
+ readonly type: "boolean";
148
+ };
146
149
  readonly "notifications.telegram.botToken": {
147
150
  readonly type: "string";
148
151
  readonly default: undefined;
@@ -209,6 +212,9 @@ export declare const SETTINGS_SCHEMA: {
209
212
  readonly type: "string";
210
213
  readonly default: undefined;
211
214
  };
215
+ readonly "notifications.discord.enabled": {
216
+ readonly type: "boolean";
217
+ };
212
218
  readonly "notifications.discord.botToken": {
213
219
  readonly type: "string";
214
220
  readonly default: undefined;
@@ -225,6 +231,9 @@ export declare const SETTINGS_SCHEMA: {
225
231
  readonly type: "string";
226
232
  readonly default: undefined;
227
233
  };
234
+ readonly "notifications.slack.enabled": {
235
+ readonly type: "boolean";
236
+ };
228
237
  readonly "notifications.slack.botToken": {
229
238
  readonly type: "string";
230
239
  readonly default: undefined;
@@ -4186,7 +4195,10 @@ export type SettingPath = keyof Schema;
4186
4195
  /** Infer the value type for a setting path */
4187
4196
  export type SettingValue<P extends SettingPath> = Schema[P] extends {
4188
4197
  type: "boolean";
4198
+ default: boolean;
4189
4199
  } ? boolean : Schema[P] extends {
4200
+ type: "boolean";
4201
+ } ? boolean | undefined : Schema[P] extends {
4190
4202
  type: "string";
4191
4203
  } ? string | undefined : Schema[P] extends {
4192
4204
  type: "number";
@@ -4365,6 +4377,7 @@ export interface MemoryGuardSettings {
4365
4377
  export interface NotificationsSettings {
4366
4378
  enabled: boolean;
4367
4379
  telegram: {
4380
+ enabled?: boolean;
4368
4381
  botToken: string | undefined;
4369
4382
  chatId: string | undefined;
4370
4383
  sound: "all" | "important" | "none";
@@ -4388,16 +4401,19 @@ export interface NotificationsSettings {
4388
4401
  };
4389
4402
  };
4390
4403
  discord: {
4404
+ enabled?: boolean;
4391
4405
  botToken: string | undefined;
4392
4406
  applicationId: string | undefined;
4393
4407
  guildId: string | undefined;
4394
4408
  parentChannelId: string | undefined;
4395
4409
  };
4396
4410
  slack: {
4411
+ enabled?: boolean;
4397
4412
  botToken: string | undefined;
4398
4413
  appToken: string | undefined;
4399
4414
  workspaceId: string | undefined;
4400
4415
  channelId: string | undefined;
4416
+ authorizedUserId: string | undefined;
4401
4417
  };
4402
4418
  redact: boolean;
4403
4419
  verbosity: "lean" | "verbose";
@@ -10,8 +10,8 @@ export interface ExecutorBackendExecOptions {
10
10
  session: ToolSession;
11
11
  deadlineMs: number;
12
12
  reset: boolean;
13
- artifactPath?: string;
14
- artifactId?: string;
13
+ artifactPath: string | undefined;
14
+ artifactId: string | undefined;
15
15
  onChunk: (chunk: string) => void;
16
16
  }
17
17
  /** Result returned by a backend's execute(). */
@@ -6,7 +6,7 @@ export interface BashArtifactSaveSummary {
6
6
  complete: boolean;
7
7
  omittedBytes?: number;
8
8
  }
9
- export type BashMinimizedSaveReturn = BashArtifactSaveResult | BashArtifactSaveSummary | undefined;
9
+ export type BashMinimizedSaveReturn = BashArtifactSaveResult | BashArtifactSaveSummary | string | undefined;
10
10
  export type BashArtifactSaveResult = {
11
11
  status: "saved";
12
12
  artifactId: string;
@@ -23,7 +23,7 @@ export type BashArtifactSaveResult = {
23
23
  status: "failed";
24
24
  diagnostic: string;
25
25
  };
26
- export declare function normalizeMinimizedSaveResultForTests(value: unknown, _originalText?: string): BashArtifactSaveResult;
26
+ export declare function normalizeMinimizedSaveResultForTests(value: BashMinimizedSaveReturn, originalText: string): BashArtifactSaveResult;
27
27
  export interface BashExecutorOptions {
28
28
  /**
29
29
  * Invoked when the native minimizer rewrote the command's output, giving
@@ -80,18 +80,16 @@ export interface BashResult {
80
80
  outputBytes: number;
81
81
  artifactId?: string;
82
82
  artifactTruncatedBytes?: number;
83
- /** Bytes dropped before the Bash executor received the native output stream. */
84
- sourceTruncatedBytes?: number;
85
- /** Exact source capture completeness could not be proven. */
86
- sourceCaptureIncomplete?: boolean;
87
83
  artifactFailureDiagnostic?: string;
88
84
  }
89
- /** Number of persistent and retiring shell sessions currently retained (owner gauge). */
85
+ /** Number of persistent shell sessions currently retained (owner gauge). */
90
86
  export declare function getShellSessionCount(): number;
91
87
  /**
92
- * Dispose all persistent shell sessions without waiting forever on a native
93
- * abort that failed to settle. Quarantine entries are owner-scoped so a late
94
- * finalizer cannot erase a successor shell's quarantine.
88
+ * Dispose all persistent shell sessions: abort in-flight work and drop the
89
+ * strong references so the native shells can be finalized. Healthy persistent
90
+ * sessions are otherwise retained for the whole process lifetime (MEM-7). This
91
+ * is registered as a postmortem cleanup so shutdown/signals release native
92
+ * shell resources, and is also callable directly (e.g. on owner teardown).
95
93
  */
96
94
  export declare function disposeAllShellSessions(): Promise<void>;
97
95
  /** Translate `ShellMinimizerSettings` into native `MinimizerOptions`, or `undefined` when disabled. */
@@ -3,7 +3,6 @@ import { type RepositoryBinding } from "./repository-binding";
3
3
  import { type CriticVerdict } from "./ultragoal-receipt-freshness";
4
4
  export { CRITIC_GATE_HARD_STOP_EVENT, CRITIC_GATE_OVERRIDE_EVENT, CRITIC_VERDICT_EVENT, type CriticVerdict, computeUltragoalPlanGeneration, countTerminalCriticVerdicts, receiptRelevantGoals, TERMINAL_CRITIC_CEILING, terminalCriticCeilingReached, terminalCriticGateOverridden, } from "./ultragoal-receipt-freshness";
5
5
  export { captureUltragoalRecoverySnapshot, parseStrictTerminalTranscript, persistUltragoalRecoveryDecision, planUltragoalOwnerLossRecovery, type UltragoalOwnerLossReceipt, type UltragoalRecoveryBinding, type UltragoalRecoveryDecision, type UltragoalRecoverySnapshot, validateOwnerLossBinding, validateRawUltragoalEvidence, validateRecoveryAdmission, validateRecoveryPath, } from "./ultragoal-owner-loss-recovery";
6
- import { createReviewSourceDispatch, type ReviewDeliveryDisposition, type ReviewSourceCohort, type ReviewSourceLane } from "./ultragoal-review-source";
7
6
  export type UltragoalGjcGoalMode = "aggregate" | "per-story";
8
7
  export type UltragoalGoalStatus = "pending" | "active" | "complete" | "failed" | "blocked" | "review_blocked" | "superseded";
9
8
  export interface UltragoalValidationBatchMetadata extends JsonObject {
@@ -43,7 +42,6 @@ export interface UltragoalPlan {
43
42
  goals: UltragoalGoal[];
44
43
  /** Authoritative repository identity for multi-repo fail-closed spawn (#2901). */
45
44
  repositoryBinding?: RepositoryBinding;
46
- reviewCohorts?: ReviewSourceCohort[];
47
45
  createdAt: string;
48
46
  updatedAt: string;
49
47
  [key: string]: unknown;
@@ -377,40 +375,6 @@ export declare function addUltragoalSubgoal(input: {
377
375
  evidence: string;
378
376
  rationale: string;
379
377
  }): Promise<UltragoalPlan>;
380
- export declare function validateUltragoalReviewDispatch(input: {
381
- cwd: string;
382
- dispatchId: string;
383
- cohortId: string;
384
- taskId: string;
385
- lane: ReviewSourceLane;
386
- snapshotId: string;
387
- generation: number;
388
- repositoryBindingDigest: string;
389
- stateRevision: number;
390
- rerunCommand: string;
391
- taskSourceTaskId: string;
392
- createdAt: string;
393
- }): Promise<void>;
394
- export declare function freezeUltragoalReviewCohort(input: {
395
- cwd: string;
396
- workflow?: "ultragoal" | "ralplan";
397
- }): Promise<ReviewSourceCohort>;
398
- export declare function dispatchUltragoalReviewLane(input: {
399
- cwd: string;
400
- cohortId: string;
401
- taskId: string;
402
- lane: ReviewSourceLane;
403
- rerunCommand: string;
404
- }): Promise<ReturnType<typeof createReviewSourceDispatch>>;
405
- export declare function classifyUltragoalReviewDelivery(input: {
406
- cwd: string;
407
- cohortId: string;
408
- dispatchId: string;
409
- observedDisposition: ReviewDeliveryDisposition;
410
- }): Promise<{
411
- disposition: ReviewDeliveryDisposition;
412
- deliveryId: string;
413
- }>;
414
378
  export declare function recordUltragoalReviewBlockers(input: {
415
379
  cwd: string;
416
380
  goalId: string;
@@ -1,8 +1,3 @@
1
- /**
2
- * Shared helpers for internal-url protocol handlers that resolve session-scoped
3
- * artifact IDs.
4
- */
5
- import { type RecoveryFsRoot } from "@gajae-code/natives";
6
1
  import type { ResolveContext } from "./types";
7
2
  /**
8
3
  * Snapshot of artifacts dirs explicitly authorized for the calling session.
@@ -14,16 +9,3 @@ import type { ResolveContext } from "./types";
14
9
  * not an authorization source.
15
10
  */
16
11
  export declare function authorizedArtifactsDirsFromContext(context?: ResolveContext): string[];
17
- export interface AuthorizedArtifactsRoot {
18
- readonly directory: string;
19
- readonly dev: bigint;
20
- readonly ino: bigint;
21
- readonly authority: RecoveryFsRoot;
22
- }
23
- export interface AuthorizedArtifactSnapshot {
24
- bytes: Buffer;
25
- size: number;
26
- }
27
- export declare function openAuthorizedArtifactsRoot(directory: string): AuthorizedArtifactsRoot;
28
- export declare function closeAuthorizedArtifactsRoot(root: AuthorizedArtifactsRoot): void;
29
- export declare function readAuthorizedArtifactFile(root: AuthorizedArtifactsRoot, filename: string, maxBytes: number): AuthorizedArtifactSnapshot | null;
@@ -110,6 +110,7 @@ export interface RlmPreset {
110
110
  type RunPrintMode = (session: AgentSession, options: PrintModeOptions) => Promise<void>;
111
111
  export interface RunRootCommandDependencies {
112
112
  createAgentSession?: typeof createAgentSession;
113
+ createSessionManager?: typeof createSessionManager;
113
114
  discoverAuthStorage?: typeof discoverAuthStorage;
114
115
  runAcpMode?: (options?: {
115
116
  agentDir?: string;
@@ -22,6 +22,21 @@ export interface HookSelectorOptions {
22
22
  */
23
23
  wrapFocused?: boolean;
24
24
  scrollTitleRows?: number;
25
+ /**
26
+ * Maximum visible rows for the inline editor in bounded scroll-title selectors.
27
+ * The editor keeps the full draft and scrolls within this height.
28
+ */
29
+ inlineEditorMaxHeight?: number;
30
+ /**
31
+ * Maximum visible autocomplete rows for the inline editor in a bounded selector.
32
+ * The Editor retains its normal minimum and scroll indicator behavior.
33
+ */
34
+ inlineAutocompleteMaxVisible?: number;
35
+ /**
36
+ * Compact bounded-selector chrome while the inline editor is active.
37
+ * Used only when the terminal cannot fit the normal editor and dropdown rows.
38
+ */
39
+ compactInlineInput?: boolean;
25
40
  /**
26
41
  * Inline free-text entry for the option with this label (e.g. the ask
27
42
  * tool's "Other (type your own)"). Selecting it keeps the title and option
@@ -54,6 +69,11 @@ export declare class HookSelectorComponent extends Container {
54
69
  #private;
55
70
  constructor(title: string, options: string[], onSelect: (option: string) => void, onCancel: () => void, opts?: HookSelectorOptions);
56
71
  hasActiveInlineInput(): boolean;
72
+ /**
73
+ * Update the bounded selector's title/list row budgets after a terminal resize.
74
+ * The existing title scroll offset, option focus, and inline editor remain intact.
75
+ */
76
+ setLayoutBudget(maxVisible: number, scrollTitleRows: number, inlineEditorMaxHeight?: number | undefined, inlineAutocompleteMaxVisible?: number | undefined, compactInlineInput?: boolean): void;
57
77
  handleInput(keyData: string): void;
58
78
  dispose(): void;
59
79
  }
@@ -1,5 +1,6 @@
1
1
  import { type Component, type Focusable, type SecretValue } from "@gajae-code/tui";
2
2
  import type { CasReceipt } from "../../config/atomic-yaml-patch";
3
+ import type { NotificationProvider, ProviderSecretDisposition } from "../../sdk/bus/config";
3
4
  import type { BlockedTelegramRestoreResult, ProposedTelegramIdentity, TelegramDaemonReconnectOutcome } from "../../sdk/bus/notification-orchestration";
4
5
  import type { NotificationHealthReport, NotificationRecoveryReport, NotificationStatusReport, NotificationTestResult } from "../../sdk/bus/notification-service";
5
6
  import type { NotificationSessionReconcileResult, NotificationSessionStatus } from "../../sdk/bus/session-control";
@@ -45,6 +46,40 @@ export interface PreparedTelegramConfiguration {
45
46
  richDraftEnabled: boolean;
46
47
  streamingEnabled: boolean;
47
48
  }
49
+ export interface ProviderSecretActionInput {
50
+ action: ProviderSecretDisposition;
51
+ value?: SecretValue;
52
+ }
53
+ export interface NotificationsProviderSetupInput {
54
+ provider: "discord" | "slack";
55
+ botToken: ProviderSecretActionInput;
56
+ appToken?: ProviderSecretActionInput;
57
+ applicationId?: string;
58
+ guildId?: string;
59
+ parentChannelId?: string;
60
+ workspaceId?: string;
61
+ channelId?: string;
62
+ authorizedUserId?: string;
63
+ }
64
+ export interface PreparedNotificationProviderConfiguration {
65
+ provider: "discord" | "slack";
66
+ botTokenDisposition: ProviderSecretDisposition;
67
+ botTokenMask: string;
68
+ appTokenDisposition?: ProviderSecretDisposition;
69
+ appTokenMask?: string;
70
+ applicationId?: string;
71
+ guildId?: string;
72
+ parentChannelId?: string;
73
+ workspaceId?: string;
74
+ channelId?: string;
75
+ authorizedUserId?: string;
76
+ applicationIdDisplay?: string;
77
+ guildIdDisplay?: string;
78
+ parentChannelIdDisplay?: string;
79
+ workspaceIdDisplay?: string;
80
+ channelIdDisplay?: string;
81
+ authorizedUserIdDisplay?: string;
82
+ }
48
83
  export interface NotificationsPreflightResult {
49
84
  status: "ready" | "aborted" | "cancelled" | "error";
50
85
  identity: ProposedTelegramIdentity;
@@ -57,6 +92,10 @@ export type NotificationsConfigureCommitResult = {
57
92
  status: "saved";
58
93
  receipt: CasReceipt;
59
94
  message: string;
95
+ } | {
96
+ status: "activation_failed" | "observer_failed";
97
+ receipt: CasReceipt;
98
+ message: string;
60
99
  } | {
61
100
  status: "blocked_identity";
62
101
  receipt: CasReceipt;
@@ -67,11 +106,16 @@ export type NotificationsConfigureCommitResult = {
67
106
  export interface NotificationsMutationResult {
68
107
  message: string;
69
108
  receipt?: CasReceipt;
109
+ outcome?: "success" | "degraded" | "failed";
70
110
  }
71
111
  export type NotificationsSaveInactiveResult = {
72
112
  status: "saved_inactive";
73
113
  receipt: CasReceipt;
74
114
  message: string;
115
+ } | {
116
+ status: "observer_failed";
117
+ receipt: CasReceipt;
118
+ message: string;
75
119
  } | {
76
120
  status: "unavailable";
77
121
  guidance: string;
@@ -85,12 +129,13 @@ export type NotificationsSaveInactiveResult = {
85
129
  export interface NotificationsEditorOperations {
86
130
  /** Combines a buildNotificationStatusReport-shaped status snapshot with the current session-control query. */
87
131
  loadState(): Promise<NotificationsEditorState>;
88
- /** Performs offline health refreshes and a non-cancellable reachability probe when requested. */
132
+ /** Performs offline or selected REST-only health refresh. */
89
133
  refreshHealth(input: {
90
134
  probe: boolean;
135
+ provider?: NotificationProvider;
91
136
  signal?: AbortSignal;
92
137
  }): Promise<NotificationHealthReport>;
93
- sendTest(): Promise<NotificationTestResult>;
138
+ sendTest(provider?: NotificationProvider): Promise<NotificationTestResult>;
94
139
  recover(): Promise<NotificationRecoveryReport>;
95
140
  reconnect(): Promise<TelegramDaemonReconnectOutcome>;
96
141
  /** Validates/discovers a Telegram destination and returns a secret-safe prepared draft. */
@@ -101,6 +146,11 @@ export interface NotificationsEditorOperations {
101
146
  saveInactive(draft: PreparedTelegramConfiguration): Promise<NotificationsSaveInactiveResult>;
102
147
  /** Clears adapter-local ephemeral credential material for a prepared setup draft. Idempotent. */
103
148
  discardConfigureDraft(draft: PreparedTelegramConfiguration): void;
149
+ prepareProviderConfiguration(input: NotificationsProviderSetupInput): Promise<PreparedNotificationProviderConfiguration>;
150
+ commitProviderConfiguration(draft: PreparedNotificationProviderConfiguration): Promise<NotificationsMutationResult>;
151
+ discardProviderConfiguration(draft: PreparedNotificationProviderConfiguration): void;
152
+ setProviderDesired(provider: NotificationProvider, enabled: boolean): Promise<NotificationsMutationResult>;
153
+ removeProvider(provider: NotificationProvider): Promise<NotificationsMutationResult>;
104
154
  /** Enables globally without requesting or exposing a credential. */
105
155
  enableGlobally(): Promise<NotificationsMutationResult>;
106
156
  disableGlobally(): Promise<NotificationsMutationResult>;
@@ -117,7 +167,7 @@ export interface NotificationsEditorOperations {
117
167
  export interface NotificationsSettingsEditorCallbacks {
118
168
  onCancel?: () => void;
119
169
  }
120
- type EditorMode = "home" | "provider-selection" | "chat-entry" | "token-entry" | "pairing" | "review" | "preferences" | "confirmation";
170
+ export type EditorMode = "home" | "provider-selection" | "provider-actions" | "provider-form" | "provider-review" | "chat-entry" | "token-entry" | "pairing" | "review" | "preferences" | "confirmation";
121
171
  /**
122
172
  * Direct tab content for notification setup and operations. It is deliberately
123
173
  * independent of Settings and notification services; WI7b injects the adapter.
@@ -137,4 +187,3 @@ export declare class NotificationsSettingsEditorComponent implements Component,
137
187
  render(width: number): string[];
138
188
  handleInput(data: string): void;
139
189
  }
140
- export {};
@@ -1,4 +1,4 @@
1
- import type { Component, TUI } from "@gajae-code/tui";
1
+ import { type Component, type TUI } from "@gajae-code/tui";
2
2
  import { KeybindingsManager } from "../../config/keybindings";
3
3
  import type { ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetContent, ExtensionWidgetOptions, TerminalInputHandler } from "../../extensibility/extensions";
4
4
  import { type Theme } from "../../modes/theme/theme";
@@ -2,8 +2,8 @@ import type { Component, SlashCommand } from "@gajae-code/tui";
2
2
  import type { ModelProfileConfig } from "../../config/models-config-schema";
3
3
  import { type Settings } from "../../config/settings";
4
4
  import { type InteractiveModeContext, type OAuthSelectorOptions } from "../../modes/types";
5
- import { getNotificationConfig, maskToken } from "../../sdk/bus/config";
6
- import { proposedTelegramIdentity, reconcileCommittedTelegramConfiguration, removeTelegramConfiguration, saveTelegramInactive } from "../../sdk/bus/notification-orchestration";
5
+ import { getCurrentTelegramActivationMarker, getNotificationConfig, maskToken } from "../../sdk/bus/config";
6
+ import { type NotificationProviderRuntimeAuthority, proposedTelegramIdentity, reconcileCommittedTelegramConfiguration, removeTelegramConfiguration, saveTelegramInactive } from "../../sdk/bus/notification-orchestration";
7
7
  import { buildNotificationStatusReport, checkNotificationHealth, recoverNotifications, sanitizeDiagnostic, sendNotificationTest } from "../../sdk/bus/notification-service";
8
8
  import { ensureTelegramDaemonRunningDetailed, readNotificationRootRegistration, resolveTelegramSetupPreflight, unregisterNotificationRoot } from "../../sdk/bus/telegram-daemon";
9
9
  import { runTelegramSetup } from "../../sdk/bus/telegram-setup";
@@ -37,6 +37,7 @@ type TelegramDaemonStopResult = {
37
37
  };
38
38
  export interface NotificationsEditorOperationDependencies {
39
39
  getNotificationConfig: typeof getNotificationConfig;
40
+ getCurrentTelegramActivationMarker: typeof getCurrentTelegramActivationMarker;
40
41
  maskToken: typeof maskToken;
41
42
  buildNotificationStatusReport: typeof buildNotificationStatusReport;
42
43
  checkNotificationHealth: typeof checkNotificationHealth;
@@ -66,6 +67,7 @@ export interface NotificationsEditorOperationDependencies {
66
67
  message: string;
67
68
  }>;
68
69
  stopTelegramDaemon(settings: Settings): Promise<TelegramDaemonStopResult>;
70
+ providerRuntime?: NotificationProviderRuntimeAuthority;
69
71
  }
70
72
  /**
71
73
  * Concrete service adapter for the direct Notifications settings tab. Secrets remain in this closure's
@@ -1,7 +1,7 @@
1
1
  import type { NativeDirectoryTreeSnapshot } from "@gajae-code/natives";
2
2
  import type { ModelProfileErrorDetails } from "../../config/model-profile-contract";
3
3
  import { type DirectoryMigrationPolicy } from "../session-directory";
4
- import { type BrokerDiscovery, type RedactedBrokerDiscovery } from "./discovery";
4
+ import { type BrokerDiscovery, type BrokerPublicationObservation, type RedactedBrokerDiscovery } from "./discovery";
5
5
  import { type LifecycleDurableEffectsReceipt, LifecycleLedger, type LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
6
6
  import { SessionIndex } from "./session-index";
7
7
  export interface BrokerSettings {
@@ -137,4 +137,8 @@ export declare class Broker {
137
137
  }
138
138
  /** Test-only hook for simulating a process crash after terminal persistence verification. */
139
139
  export declare function setTerminalPersistenceHookForTest(broker: Broker, hook: (() => void) | undefined): void;
140
+ /** Test-only hook for shortening the bounded ambiguity deadline. */
141
+ export declare function setAmbiguityGraceForTest(broker: Broker, graceMs: number | undefined): void;
142
+ /** Test-only hook for forcing the observation the publication watchdog sees. */
143
+ export declare function setPublicationObservationForTest(broker: Broker, observation: BrokerPublicationObservation | undefined): void;
140
144
  export {};
@@ -119,4 +119,5 @@ export declare class LifecycleLedger {
119
119
  findCleanupPendingBySessionId(sessionId: string, excludingIdentity: string): LifecycleLedgerEntry | undefined;
120
120
  hasUncertainCleanupForSession(sessionId: string, excludingIdentity: string): boolean;
121
121
  get(identity: string): LifecycleLedgerEntry | undefined;
122
+ findPendingCleanupByTarget(sessionId: string, cwd: string, transcriptPath: string): LifecycleLedgerEntry | undefined;
122
123
  }