@gajae-code/coding-agent 0.6.5 → 0.7.0

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 +29 -0
  2. package/dist/types/async/job-manager.d.ts +3 -1
  3. package/dist/types/cli/daemon-cli.d.ts +25 -0
  4. package/dist/types/cli/notify-cli.d.ts +23 -0
  5. package/dist/types/cli/setup-cli.d.ts +20 -1
  6. package/dist/types/commands/daemon.d.ts +41 -0
  7. package/dist/types/commands/notify.d.ts +41 -0
  8. package/dist/types/config/model-profile-activation.d.ts +12 -0
  9. package/dist/types/config/model-profiles.d.ts +2 -1
  10. package/dist/types/config/model-registry.d.ts +3 -3
  11. package/dist/types/config/models-config-schema.d.ts +5 -0
  12. package/dist/types/config/settings-schema.d.ts +38 -0
  13. package/dist/types/coordinator/contract.d.ts +1 -1
  14. package/dist/types/daemon/builtin.d.ts +20 -0
  15. package/dist/types/daemon/control-types.d.ts +57 -0
  16. package/dist/types/daemon/runtime.d.ts +25 -0
  17. package/dist/types/extensibility/extensions/types.d.ts +8 -0
  18. package/dist/types/gjc-runtime/state-writer.d.ts +2 -0
  19. package/dist/types/gjc-runtime/ultragoal-guard.d.ts +15 -0
  20. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +14 -0
  21. package/dist/types/modes/components/oauth-selector.d.ts +2 -0
  22. package/dist/types/modes/controllers/selector-controller.d.ts +2 -2
  23. package/dist/types/modes/interactive-mode.d.ts +1 -1
  24. package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +10 -0
  25. package/dist/types/modes/types.d.ts +7 -1
  26. package/dist/types/notifications/config-commands.d.ts +26 -0
  27. package/dist/types/notifications/config.d.ts +61 -0
  28. package/dist/types/notifications/helpers.d.ts +55 -0
  29. package/dist/types/notifications/html-format.d.ts +62 -0
  30. package/dist/types/notifications/index.d.ts +28 -0
  31. package/dist/types/notifications/rate-limit-pool.d.ts +93 -0
  32. package/dist/types/notifications/telegram-cli.d.ts +19 -0
  33. package/dist/types/notifications/telegram-daemon-cli.d.ts +11 -0
  34. package/dist/types/notifications/telegram-daemon-control.d.ts +56 -0
  35. package/dist/types/notifications/telegram-daemon.d.ts +276 -0
  36. package/dist/types/notifications/telegram-reference.d.ts +111 -0
  37. package/dist/types/notifications/threaded-inbound.d.ts +58 -0
  38. package/dist/types/notifications/threaded-render.d.ts +66 -0
  39. package/dist/types/notifications/topic-registry.d.ts +67 -0
  40. package/dist/types/rlm/index.d.ts +12 -0
  41. package/dist/types/session/agent-session.d.ts +39 -2
  42. package/dist/types/session/auth-storage.d.ts +1 -1
  43. package/dist/types/setup/credential-auto-import.d.ts +63 -0
  44. package/dist/types/setup/credential-import.d.ts +3 -0
  45. package/dist/types/setup/host-plugin-setup.d.ts +39 -0
  46. package/dist/types/tools/ask-answer-registry.d.ts +13 -0
  47. package/dist/types/tools/index.d.ts +18 -0
  48. package/dist/types/tools/subagent.d.ts +3 -0
  49. package/package.json +7 -7
  50. package/scripts/build-binary.ts +3 -0
  51. package/src/async/job-manager.ts +5 -1
  52. package/src/cli/daemon-cli.ts +122 -0
  53. package/src/cli/notify-cli.ts +274 -0
  54. package/src/cli/setup-cli.ts +173 -84
  55. package/src/cli.ts +2 -0
  56. package/src/commands/daemon.ts +47 -0
  57. package/src/commands/notify.ts +61 -0
  58. package/src/commands/setup.ts +11 -1
  59. package/src/config/model-profile-activation.ts +74 -5
  60. package/src/config/model-profiles.ts +7 -4
  61. package/src/config/model-registry.ts +6 -3
  62. package/src/config/models-config-schema.ts +1 -1
  63. package/src/config/settings-schema.ts +29 -0
  64. package/src/coordinator/contract.ts +3 -0
  65. package/src/coordinator-mcp/server.ts +270 -1
  66. package/src/daemon/builtin.ts +46 -0
  67. package/src/daemon/control-types.ts +65 -0
  68. package/src/daemon/runtime.ts +51 -0
  69. package/src/defaults/gjc/skills/ultragoal/SKILL.md +16 -0
  70. package/src/extensibility/extensions/runner.ts +4 -0
  71. package/src/extensibility/extensions/types.ts +8 -0
  72. package/src/gjc-runtime/deep-interview-recorder.ts +12 -4
  73. package/src/gjc-runtime/state-runtime.ts +18 -4
  74. package/src/gjc-runtime/state-writer.ts +8 -8
  75. package/src/gjc-runtime/ultragoal-guard.ts +57 -2
  76. package/src/gjc-runtime/ultragoal-runtime.ts +105 -19
  77. package/src/gjc-runtime/workflow-manifest.generated.json +27 -2
  78. package/src/gjc-runtime/workflow-manifest.ts +11 -1
  79. package/src/goals/tools/goal-tool.ts +11 -2
  80. package/src/internal-urls/docs-index.generated.ts +6 -5
  81. package/src/main.ts +30 -0
  82. package/src/modes/acp/acp-event-mapper.ts +1 -0
  83. package/src/modes/components/hook-editor.ts +7 -2
  84. package/src/modes/components/oauth-selector.ts +19 -0
  85. package/src/modes/controllers/event-controller.ts +20 -0
  86. package/src/modes/controllers/selector-controller.ts +80 -17
  87. package/src/modes/interactive-mode.ts +6 -2
  88. package/src/modes/runtime-init.ts +1 -0
  89. package/src/modes/shared/agent-wire/event-contract.ts +1 -0
  90. package/src/modes/shared/agent-wire/event-envelope.ts +1 -0
  91. package/src/modes/shared/agent-wire/event-observation.ts +16 -0
  92. package/src/modes/shared/agent-wire/unattended-session.ts +22 -0
  93. package/src/modes/types.ts +7 -1
  94. package/src/modes/utils/ui-helpers.ts +23 -0
  95. package/src/notifications/config-commands.ts +50 -0
  96. package/src/notifications/config.ts +107 -0
  97. package/src/notifications/helpers.ts +135 -0
  98. package/src/notifications/html-format.ts +389 -0
  99. package/src/notifications/index.ts +663 -0
  100. package/src/notifications/rate-limit-pool.ts +179 -0
  101. package/src/notifications/telegram-cli.ts +194 -0
  102. package/src/notifications/telegram-daemon-cli.ts +74 -0
  103. package/src/notifications/telegram-daemon-control.ts +370 -0
  104. package/src/notifications/telegram-daemon.ts +1370 -0
  105. package/src/notifications/telegram-reference.ts +335 -0
  106. package/src/notifications/threaded-inbound.ts +80 -0
  107. package/src/notifications/threaded-render.ts +155 -0
  108. package/src/notifications/topic-registry.ts +133 -0
  109. package/src/rlm/index.ts +19 -0
  110. package/src/sdk.ts +16 -0
  111. package/src/session/agent-session.ts +113 -3
  112. package/src/session/auth-storage.ts +3 -0
  113. package/src/session/session-dump-format.ts +43 -2
  114. package/src/session/session-manager.ts +39 -5
  115. package/src/setup/credential-auto-import.ts +258 -0
  116. package/src/setup/credential-import.ts +17 -0
  117. package/src/setup/hermes/templates/operator-instructions.v1.md +10 -0
  118. package/src/setup/host-plugin-setup.ts +142 -0
  119. package/src/slash-commands/builtin-registry.ts +4 -1
  120. package/src/task/executor.ts +5 -1
  121. package/src/tools/ask-answer-registry.ts +25 -0
  122. package/src/tools/ask.ts +74 -4
  123. package/src/tools/image-gen.ts +5 -8
  124. package/src/tools/index.ts +19 -0
  125. package/src/tools/inspect-image.ts +16 -11
  126. package/src/tools/subagent-render.ts +7 -0
  127. package/src/tools/subagent.ts +38 -7
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.7.0] - 2026-06-22
6
+
7
+ ### Added
8
+
9
+ - Notifications SDK with configure-once Telegram UX: each session exposes a loopback WebSocket endpoint with a discovery file and a generic `action_needed`/`reply` JSON protocol, so any client (Telegram, Discord, Slack, mobile) can see action-needed signals and answer pending asks without RPC or terminal scraping (#874).
10
+ - Managed Telegram reference daemon with a threaded per-session surface: one-time identity header, streamed `context_update` (last message, task, goal, token/model usage, diff), live/finalized turn output, and agent image streaming (`image_attachment` + multipart `sendPhoto`).
11
+ - Typing indicator and native double-check acknowledgements for Telegram inbound messages (#989).
12
+ - Scalable `gjc daemon` control plane with safe reload, enforcing one `getUpdates` poller per bot token so new sessions attach to the existing daemon instead of causing Telegram 409 conflicts (#993).
13
+
14
+ ### Changed
15
+
16
+ - Asks are exempt from redaction so remote prompts stay readable and answerable; idle summaries are stripped and streamed content frames (`turn_stream`, `context_update`, `image_attachment`) are suppressed when redaction is enabled (#998, #1001).
17
+ - Telegram replies are routed by their thread/topic; removed the legacy `/answer <session-tag>` command in favour of thread-native replies.
18
+ - Pretty HTML formatting and markdown-table rendering for Telegram daemon output (#986, #997).
19
+
20
+ ### Fixed
21
+
22
+ - Strip embedded option indexes from Telegram button labels and stop double-numbering inline buttons (#994, #996).
23
+ - Free-text answers resolve pending asks and ask choices remain unredacted (#998, #1001).
24
+ - Recover in-flight sessions after a connection drop and connect new sessions during the `getUpdates` long-poll (#988, #990).
25
+ - Daemon hardening: deliver ask buttons at invocation, fix the topic-reuse race, write daemon logs to file with resilient frame handling, and de-duplicate idle output (#985, #991, and related).
26
+
5
27
  ## [0.6.5] - 2026-06-21
6
28
 
7
29
  ### Changed
@@ -19,6 +41,7 @@
19
41
  - Rejected counterexample-only claims in research-plan regardless of `dropCondition` wording (#942).
20
42
  - Bounded computer-use screenshot inline images to avoid oversized payloads.
21
43
  - Tolerated missing session env in guard reads (#930).
44
+ - Fixed a session-scoped active-state staleness bug where a freshly written mode-state revision was not reflected in the in-memory envelope, so the active-state/HUD writer skipped the newer update as stale — dropping the deep-interview ambiguity HUD chip after scoring and leaving the active-skills phase mirror behind a `handoff` transition.
22
45
 
23
46
  ### Documentation
24
47
 
@@ -52,6 +75,11 @@
52
75
  - Documented lifecycle notification hooks (#903).
53
76
  - Added a routed GJC session guide for Clawhip/Hermes/OpenClaw visible routed sessions and linked it from the Hermes docs and operator instructions.
54
77
 
78
+ ### Fixed
79
+
80
+ - Fixed combo/cross-provider model presets flipping the main provider on resume. A profile's main model was applied through `setModelTemporary`, which records the session `model_change` with `role: "temporary"`; on resume the session restored `models.default` (the stale pre-profile base model), so an "Apply for this session" combo like `opus-codex` came back on the base default (e.g. `openai-codex/gpt-5.5`) instead of the profile's main model (`anthropic/claude-opus-4-8`). Profile activation now records its main model as the session default (without writing global settings), while transient retry/fallback/context-promotion/plan-mode switches keep `role: "temporary"` so the issue #849 protection is preserved.
81
+ - Hardened the model-profile activation rollback so a failed activation no longer poisons the resume default. The rollback previously restored the pre-activation *live* model as the session default (`role: "default"`); if the user was on a transient retry/fallback/context-promotion/plan switch when activation failed, that transient model was promoted to the resume default and weakened the issue #849 protection. Activation now snapshots the pre-activation resume default separately from the live model and re-asserts it on rollback, while the runtime live model still rolls back as a transient switch (`role: "temporary"`).
82
+
55
83
  ## [0.6.3] - 2026-06-19
56
84
 
57
85
  ### Fixed
@@ -128,6 +156,7 @@
128
156
 
129
157
  ### Fixed
130
158
 
159
+ - Rendered `/dump` tool-call parameters with readable structured bodies, XML-safe text, and decoded Unicode escape sequences so `ask`/`proxy_ask` deep-interview payloads no longer show dense `questions` JSON or literal Korean `\u...` escapes.
131
160
  - Prevented `gjc --tmux` partial-launch diagnostics from throwing when stderr is already closed during shutdown.
132
161
  - Fixed v0.5.1-style macOS/Linux standalone binaries crashing before the first model request with `Cannot find module '@gajae-code/natives' from '/$bunfs/root/gjc-*'` when pre-prompt context maintenance invokes the native tokenizer.
133
162
  - Mapped the retired `codex-standard` model profile name to `codex-medium` during profile activation, **as a fallback only** so a user-defined profile literally named `codex-standard` is never shadowed, letting stale `modelProfile.default: codex-standard` configs reach activation instead of blocking startup after the rebuilt profile catalog.
@@ -68,7 +68,9 @@ export interface SubagentLiveHandle {
68
68
  /** Request a cooperative safe-boundary pause (never aborts the in-flight tool). */
69
69
  requestPause(): void;
70
70
  /** Inject a steering message into the live session. */
71
- injectMessage(content: string, deliverAs: "steer" | "followUp" | "nextTurn"): Promise<void>;
71
+ injectMessage(content: string, deliverAs: "steer" | "followUp" | "nextTurn", opts?: {
72
+ fromAgentId?: string;
73
+ }): Promise<void>;
72
74
  }
73
75
  /**
74
76
  * Canonical, stable-id-keyed record for a subagent. Survives `AsyncJob`
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `gjc daemon` command handler.
3
+ *
4
+ * Generic over the static built-in daemon controller map: lists/inspects
5
+ * daemons and drives cooperative stop/reload. Telegram is the only kind today.
6
+ */
7
+ import { Settings } from "../config/settings";
8
+ import type { BuiltInDaemonController, DaemonKind } from "../daemon/control-types";
9
+ export type DaemonCliAction = "list" | "status" | "stop" | "reload";
10
+ export interface DaemonCommandArgs {
11
+ action: DaemonCliAction;
12
+ kinds: DaemonKind[];
13
+ all: boolean;
14
+ json: boolean;
15
+ force: boolean;
16
+ gracefulTimeoutMs?: number;
17
+ killTimeoutMs?: number;
18
+ spawnIfStopped?: boolean;
19
+ }
20
+ export interface DaemonCommandDeps {
21
+ settings?: Settings;
22
+ controllers?: BuiltInDaemonController[];
23
+ }
24
+ export declare function parseDaemonArgs(argv: string[]): DaemonCommandArgs | undefined;
25
+ export declare function runDaemonCommand(cmd: DaemonCommandArgs, deps?: DaemonCommandDeps): Promise<void>;
@@ -0,0 +1,23 @@
1
+ import { Settings } from "../config/settings";
2
+ export type NotifyAction = "setup" | "status" | "daemon-internal";
3
+ export interface NotifyCommandArgs {
4
+ action: NotifyAction;
5
+ smoke?: boolean;
6
+ rawArgs: string[];
7
+ token?: string;
8
+ chatId?: string;
9
+ redact?: boolean;
10
+ }
11
+ export interface NotifyCommandDeps {
12
+ fetchImpl?: typeof fetch;
13
+ apiBase?: string;
14
+ settings?: Settings;
15
+ setupToken?: string;
16
+ pollTimeoutMs?: number;
17
+ pollIntervalMs?: number;
18
+ setupChatId?: string;
19
+ setupRedact?: boolean;
20
+ }
21
+ export declare function parseNotifyArgs(args: string[]): NotifyCommandArgs | undefined;
22
+ export declare function runNotifyCommand(cmd: NotifyCommandArgs, deps?: NotifyCommandDeps): Promise<void>;
23
+ export declare function printNotifyHelp(): void;
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * Handles `gjc setup [component]` to install the normal defaults or optional feature dependencies.
5
5
  */
6
- export type SetupComponent = "credentials" | "defaults" | "hermes" | "hooks" | "provider" | "python" | "stt";
6
+ import { AuthStorage, SqliteAuthCredentialStore } from "@gajae-code/ai";
7
+ import { runExternalCredentialAutoImport } from "../setup/credential-auto-import";
8
+ export type SetupComponent = "claude" | "codex" | "credentials" | "defaults" | "hermes" | "hooks" | "provider" | "python" | "stt";
7
9
  export interface SetupCommandArgs {
8
10
  component: SetupComponent;
9
11
  flags: {
@@ -34,6 +36,7 @@ export interface SetupCommandArgs {
34
36
  profileDir?: string;
35
37
  yes?: boolean;
36
38
  dryRun?: boolean;
39
+ keychain?: boolean;
37
40
  };
38
41
  }
39
42
  /**
@@ -48,6 +51,22 @@ export declare function parseSetupArgs(args: string[]): SetupCommandArgs | undef
48
51
  * Run the setup command.
49
52
  */
50
53
  export declare function runSetupCommand(cmd: SetupCommandArgs): Promise<void>;
54
+ /**
55
+ * Discover existing Claude Code / Codex CLI credentials and import them into the
56
+ * gjc credential store after a redacted preview + confirmation. Falls back to
57
+ * manual-setup guidance when nothing importable is found.
58
+ */
59
+ export interface CredentialsSetupDependencies {
60
+ openStore?: typeof SqliteAuthCredentialStore.open;
61
+ createAuthStorage?: (store: Awaited<ReturnType<typeof SqliteAuthCredentialStore.open>>) => AuthStorage;
62
+ discover?: Parameters<typeof runExternalCredentialAutoImport>[0]["discover"];
63
+ }
64
+ export declare function handleCredentialsSetup(flags: {
65
+ json?: boolean;
66
+ yes?: boolean;
67
+ dryRun?: boolean;
68
+ keychain?: boolean;
69
+ }, deps?: CredentialsSetupDependencies): Promise<void>;
51
70
  /**
52
71
  * Print setup command help.
53
72
  */
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Manage GJC background daemons (status/list/stop/reload).
3
+ */
4
+ import { Command } from "@gajae-code/utils/cli";
5
+ import { type DaemonCliAction } from "../cli/daemon-cli";
6
+ export default class Daemon extends Command {
7
+ static description: string;
8
+ static args: {
9
+ action: import("@gajae-code/utils/cli").ArgDescriptor & {
10
+ description: string;
11
+ required: false;
12
+ options: DaemonCliAction[];
13
+ };
14
+ kind: import("@gajae-code/utils/cli").ArgDescriptor & {
15
+ description: string;
16
+ required: false;
17
+ multiple: true;
18
+ };
19
+ };
20
+ static flags: {
21
+ all: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
22
+ description: string;
23
+ };
24
+ json: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
25
+ description: string;
26
+ };
27
+ force: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
28
+ description: string;
29
+ };
30
+ "graceful-timeout-ms": import("@gajae-code/utils/cli").FlagDescriptor<"integer"> & {
31
+ description: string;
32
+ };
33
+ "kill-timeout-ms": import("@gajae-code/utils/cli").FlagDescriptor<"integer"> & {
34
+ description: string;
35
+ };
36
+ "spawn-if-stopped": import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
37
+ description: string;
38
+ };
39
+ };
40
+ run(): Promise<void>;
41
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Configure Telegram notifications.
3
+ */
4
+ import { Command } from "@gajae-code/utils/cli";
5
+ import { type NotifyAction } from "../cli/notify-cli";
6
+ export default class Notify extends Command {
7
+ static description: string;
8
+ static args: {
9
+ action: import("@gajae-code/utils/cli").ArgDescriptor & {
10
+ description: string;
11
+ required: false;
12
+ options: NotifyAction[];
13
+ };
14
+ extra: import("@gajae-code/utils/cli").ArgDescriptor & {
15
+ description: string;
16
+ required: false;
17
+ multiple: true;
18
+ };
19
+ };
20
+ static flags: {
21
+ smoke: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
22
+ description: string;
23
+ };
24
+ token: import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
25
+ description: string;
26
+ };
27
+ "chat-id": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
28
+ description: string;
29
+ };
30
+ redact: import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
31
+ description: string;
32
+ };
33
+ "owner-id": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
34
+ description: string;
35
+ };
36
+ "agent-dir": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
37
+ description: string;
38
+ };
39
+ };
40
+ run(): Promise<void>;
41
+ }
@@ -7,6 +7,8 @@ type ModelProfileActivationSession = Pick<AgentSession, "model" | "thinkingLevel
7
7
  setModelTemporary?: AgentSession["setModelTemporary"];
8
8
  setActiveModelProfile?: (name: string | undefined) => void;
9
9
  getActiveModelProfile?: () => string | undefined;
10
+ getSessionDefaultModelSelector?: () => string | undefined;
11
+ recordResumeDefaultModel?: (selector: string) => void;
10
12
  };
11
13
  export interface PrepareModelProfileActivationOptions {
12
14
  session: ModelProfileActivationSession;
@@ -23,10 +25,20 @@ export interface PreparedModelProfileActivation {
23
25
  previousModel: Model<Api> | undefined;
24
26
  previousThinkingLevel: ThinkingLevel | undefined;
25
27
  previousAgentModelOverrides: Record<string, string>;
28
+ previousModelRoles: Record<string, string>;
26
29
  defaultModel: Model<Api> | undefined;
27
30
  defaultThinkingLevel: ThinkingLevel | undefined;
31
+ modelRoles: Record<string, string>;
28
32
  agentModelOverrides: Record<string, string>;
29
33
  previousActiveModelProfile: string | undefined;
34
+ /**
35
+ * The session resume default ("provider/id") captured BEFORE activation —
36
+ * the model resume would restore prior to this profile. Snapshotted
37
+ * separately from `previousModel` (the live runtime model, which may be a
38
+ * transient switch) so a failed-activation rollback restores the correct
39
+ * resume default without promoting a transient model to it.
40
+ */
41
+ previousSessionDefaultModel: string | undefined;
30
42
  }
31
43
  export declare function formatModelProfileCredentialError(profileName: string, providers: readonly string[]): string;
32
44
  export declare function prepareModelProfileActivation(options: PrepareModelProfileActivationOptions): Promise<PreparedModelProfileActivation>;
@@ -20,7 +20,8 @@ export interface ModelProfileDefinition {
20
20
  }
21
21
  export interface ResolvedProfileBinding {
22
22
  defaultSelector?: string;
23
- agentModelOverrides: Partial<Record<Exclude<ModelProfileRole, "default">, string>>;
23
+ modelRoles: Partial<Record<"vision", string>>;
24
+ agentModelOverrides: Partial<Record<Exclude<ModelProfileRole, "default" | "vision">, string>>;
24
25
  }
25
26
  export declare function deriveModelProfileMappedProviders(definition: Pick<ModelProfileDefinition, "modelMapping">): string[];
26
27
  export declare function aggregateModelProfileRequiredProviders(requiredProviders: readonly string[], definition: Pick<ModelProfileDefinition, "modelMapping">): string[];
@@ -11,7 +11,7 @@ import { type Settings } from "./settings";
11
11
  export type { CanonicalModelIndex, CanonicalModelRecord, CanonicalModelVariant, ModelEquivalenceConfig };
12
12
  export declare const kNoAuth = "N/A";
13
13
  export declare function isAuthenticated(apiKey: string | undefined | null): apiKey is string;
14
- export type ModelRole = "default";
14
+ export type ModelRole = "default" | "vision";
15
15
  export interface ModelRoleInfo {
16
16
  tag?: string;
17
17
  name: string;
@@ -19,7 +19,7 @@ export interface ModelRoleInfo {
19
19
  }
20
20
  export declare const MODEL_ROLES: Record<ModelRole, ModelRoleInfo>;
21
21
  export declare const MODEL_ROLE_IDS: ModelRole[];
22
- export type GjcModelAssignmentTargetId = "default" | "executor" | "architect" | "planner" | "critic";
22
+ export type GjcModelAssignmentTargetId = "default" | "vision" | "executor" | "architect" | "planner" | "critic";
23
23
  export interface GjcModelAssignmentTargetInfo extends ModelRoleInfo {
24
24
  id: GjcModelAssignmentTargetId;
25
25
  settingsPath: "modelRoles" | "task.agentModelOverrides";
@@ -268,7 +268,7 @@ export declare const ModelsConfigFile: ConfigFile<{
268
268
  profiles?: Record<string, {
269
269
  required_providers: string[];
270
270
  display_name?: string | undefined;
271
- model_mapping: Partial<Record<"architect" | "critic" | "default" | "executor" | "planner", string>>;
271
+ model_mapping: Partial<Record<"architect" | "critic" | "default" | "executor" | "planner" | "vision", string>>;
272
272
  }> | undefined;
273
273
  }>;
274
274
  /** Provider override config (baseUrl, headers, apiKey, compat, transport) without custom models */
@@ -68,6 +68,7 @@ export declare const ProfileRoleSchema: z.ZodEnum<{
68
68
  default: "default";
69
69
  executor: "executor";
70
70
  planner: "planner";
71
+ vision: "vision";
71
72
  }>;
72
73
  export declare const ProfileModelSelectorSchema: z.ZodString;
73
74
  export declare const ProfileModelMappingSchema: z.ZodRecord<z.ZodEnum<{
@@ -76,6 +77,7 @@ export declare const ProfileModelMappingSchema: z.ZodRecord<z.ZodEnum<{
76
77
  default: "default";
77
78
  executor: "executor";
78
79
  planner: "planner";
80
+ vision: "vision";
79
81
  }> & z.core.$partial, z.ZodString>;
80
82
  export declare const ProfileDefinitionSchema: z.ZodObject<{
81
83
  required_providers: z.ZodArray<z.ZodString>;
@@ -86,6 +88,7 @@ export declare const ProfileDefinitionSchema: z.ZodObject<{
86
88
  default: "default";
87
89
  executor: "executor";
88
90
  planner: "planner";
91
+ vision: "vision";
89
92
  }> & z.core.$partial, z.ZodString>;
90
93
  }, z.core.$strict>;
91
94
  export declare const ProfilesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -97,6 +100,7 @@ export declare const ProfilesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
97
100
  default: "default";
98
101
  executor: "executor";
99
102
  planner: "planner";
103
+ vision: "vision";
100
104
  }> & z.core.$partial, z.ZodString>;
101
105
  }, z.core.$strict>>;
102
106
  export declare const ModelOverrideSchema: z.ZodObject<{
@@ -687,6 +691,7 @@ export declare const ModelsConfigSchema: z.ZodObject<{
687
691
  default: "default";
688
692
  executor: "executor";
689
693
  planner: "planner";
694
+ vision: "vision";
690
695
  }> & z.core.$partial, z.ZodString>;
691
696
  }, z.core.$strict>>>;
692
697
  }, z.core.$strict>;
@@ -118,6 +118,32 @@ export declare const SETTINGS_SCHEMA: {
118
118
  readonly type: "string";
119
119
  readonly default: undefined;
120
120
  };
121
+ readonly "notifications.enabled": {
122
+ readonly type: "boolean";
123
+ readonly default: false;
124
+ };
125
+ readonly "notifications.telegram.botToken": {
126
+ readonly type: "string";
127
+ readonly default: undefined;
128
+ };
129
+ readonly "notifications.telegram.chatId": {
130
+ readonly type: "string";
131
+ readonly default: undefined;
132
+ };
133
+ readonly "notifications.redact": {
134
+ readonly type: "boolean";
135
+ readonly default: false;
136
+ };
137
+ readonly "notifications.verbosity": {
138
+ readonly type: "string";
139
+ readonly default: "lean";
140
+ readonly validate: (value: string) => value is "lean" | "verbose";
141
+ };
142
+ readonly "notifications.daemon.idleTimeoutMs": {
143
+ readonly type: "number";
144
+ readonly default: 60000;
145
+ readonly validate: (value: number) => boolean;
146
+ };
121
147
  readonly autoResume: {
122
148
  readonly type: "boolean";
123
149
  readonly default: false;
@@ -3542,6 +3568,17 @@ export interface ShellMinimizerSettings {
3542
3568
  except: string[];
3543
3569
  maxCaptureBytes: number;
3544
3570
  }
3571
+ export interface NotificationsSettings {
3572
+ enabled: boolean;
3573
+ telegram: {
3574
+ botToken: string | undefined;
3575
+ chatId: string | undefined;
3576
+ };
3577
+ redact: boolean;
3578
+ daemon: {
3579
+ idleTimeoutMs: number;
3580
+ };
3581
+ }
3545
3582
  /** Map group prefix -> typed settings interface */
3546
3583
  export interface GroupTypeMap {
3547
3584
  compaction: CompactionSettings;
@@ -3560,6 +3597,7 @@ export interface GroupTypeMap {
3560
3597
  modelTags: ModelTagsSettings;
3561
3598
  cycleOrder: string[];
3562
3599
  shellMinimizer: ShellMinimizerSettings;
3600
+ notifications: NotificationsSettings;
3563
3601
  }
3564
3602
  export type GroupPrefix = keyof GroupTypeMap;
3565
3603
  export {};
@@ -1,4 +1,4 @@
1
1
  export declare const COORDINATOR_MCP_PROTOCOL_VERSION = "2024-11-05";
2
2
  export declare const COORDINATOR_MCP_SERVER_NAME = "gjc-coordinator-mcp";
3
- export declare const COORDINATOR_MCP_TOOL_NAMES: readonly ["gjc_coordinator_list_sessions", "gjc_coordinator_read_status", "gjc_coordinator_read_tail", "gjc_coordinator_list_questions", "gjc_coordinator_list_artifacts", "gjc_coordinator_read_artifact", "gjc_coordinator_read_coordination_status", "gjc_coordinator_watch_events", "gjc_coordinator_register_session", "gjc_coordinator_start_session", "gjc_coordinator_send_prompt", "gjc_coordinator_submit_question_answer", "gjc_coordinator_read_turn", "gjc_coordinator_await_turn", "gjc_coordinator_report_status"];
3
+ export declare const COORDINATOR_MCP_TOOL_NAMES: readonly ["gjc_coordinator_list_sessions", "gjc_coordinator_read_status", "gjc_coordinator_read_tail", "gjc_coordinator_list_questions", "gjc_coordinator_list_artifacts", "gjc_coordinator_read_artifact", "gjc_coordinator_read_coordination_status", "gjc_coordinator_watch_events", "gjc_coordinator_register_session", "gjc_coordinator_start_session", "gjc_coordinator_send_prompt", "gjc_coordinator_submit_question_answer", "gjc_coordinator_read_turn", "gjc_coordinator_await_turn", "gjc_coordinator_report_status", "gjc_delegate_plan", "gjc_delegate_execute", "gjc_delegate_team"];
4
4
  export type CoordinatorToolName = (typeof COORDINATOR_MCP_TOOL_NAMES)[number];
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Static built-in daemon controller map.
3
+ *
4
+ * Intentionally a static map keyed by daemon kind rather than a mutable plugin
5
+ * registry: there is exactly one kind today (`telegram`). Promote to a richer
6
+ * registry only when a second daemon kind exists.
7
+ */
8
+ import type { Settings } from "../config/settings";
9
+ import { type TelegramDaemonControlDeps } from "../notifications/telegram-daemon-control";
10
+ import type { BuiltInDaemonController, DaemonKind } from "./control-types";
11
+ export declare const BUILT_IN_DAEMON_KINDS: readonly ["telegram"];
12
+ export interface BuiltInDaemonControllerDeps {
13
+ telegram?: TelegramDaemonControlDeps;
14
+ }
15
+ export declare function createBuiltInDaemonControllers(settings: Settings, deps?: BuiltInDaemonControllerDeps): Record<DaemonKind, BuiltInDaemonController>;
16
+ /**
17
+ * Resolve the controllers a command should act on. `--all` selects every
18
+ * built-in kind; otherwise the explicit `kinds` (defaulting to `telegram`).
19
+ */
20
+ export declare function selectDaemonControllers(settings: Settings, kinds: DaemonKind[] | undefined, all: boolean, deps?: BuiltInDaemonControllerDeps): BuiltInDaemonController[];
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Public types for the `gjc daemon` control plane.
3
+ *
4
+ * Deliberately compact: a small result/status surface plus a built-in
5
+ * controller contract. There is exactly one daemon kind today (`telegram`);
6
+ * a richer registry is intentionally deferred until a second kind exists.
7
+ */
8
+ export type DaemonKind = "telegram";
9
+ export type DaemonAction = "list" | "status" | "stop" | "reload";
10
+ export type DaemonHealth = "not_configured" | "stopped" | "running" | "stale" | "stopping" | "error";
11
+ export interface DaemonRuntimeInfo {
12
+ /** `source` when respawn goes through bun/node + the entry script; `compiled` for a single-file binary. */
13
+ mode: "source" | "compiled";
14
+ execPath: string;
15
+ /** True only in source/dev mode, where a respawn loads amended TypeScript directly. */
16
+ reloadPicksUpSourceEdits: boolean;
17
+ /** Present when the runtime mode constrains what reload can achieve (e.g. compiled binary). */
18
+ warning?: string;
19
+ }
20
+ export interface DaemonStatus {
21
+ kind: DaemonKind;
22
+ configured: boolean;
23
+ health: DaemonHealth;
24
+ pid?: number;
25
+ ownerId?: string;
26
+ startedAt?: number;
27
+ heartbeatAt?: number;
28
+ roots?: string[];
29
+ rootCount?: number;
30
+ runtime: DaemonRuntimeInfo;
31
+ detail?: string;
32
+ }
33
+ export interface DaemonOperationOptions {
34
+ /** How long to wait for cooperative release before escalating. */
35
+ gracefulTimeoutMs?: number;
36
+ /** How long to wait for the old pid to die after SIGKILL. */
37
+ killTimeoutMs?: number;
38
+ /** Allow hard-kill escalation / acting on a still-live owner. */
39
+ force?: boolean;
40
+ /** For reload: spawn a fresh owner even when none is currently running. */
41
+ spawnIfStopped?: boolean;
42
+ }
43
+ export interface DaemonOperationResult {
44
+ kind: DaemonKind;
45
+ action: Exclude<DaemonAction, "list">;
46
+ ok: boolean;
47
+ before?: DaemonStatus;
48
+ after?: DaemonStatus;
49
+ warnings: string[];
50
+ message: string;
51
+ }
52
+ export interface BuiltInDaemonController {
53
+ readonly kind: DaemonKind;
54
+ status(): Promise<DaemonStatus>;
55
+ stop(opts?: DaemonOperationOptions): Promise<DaemonOperationResult>;
56
+ reload(opts?: DaemonOperationOptions): Promise<DaemonOperationResult>;
57
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Shared source-vs-compiled runtime detection for daemon spawning.
3
+ *
4
+ * Centralizes the logic previously embedded in `ensureTelegramDaemonRunning`
5
+ * so session autostart, reload, and status reporting agree on how a daemon
6
+ * process is launched and whether a reload can pick up amended source.
7
+ */
8
+ export interface GjcRuntimeSpawnInfo {
9
+ execPath: string;
10
+ mode: "source" | "compiled";
11
+ /** Prefix prepended before the gjc subcommand args; `[Bun.main]` in source mode, otherwise `[]`. */
12
+ argsPrefix: string[];
13
+ /** True only when respawn loads edited TypeScript directly (source/dev mode). */
14
+ reloadPicksUpSourceEdits: boolean;
15
+ /** Set in compiled mode to explain that a rebuild is required before reload picks up source edits. */
16
+ warning?: string;
17
+ }
18
+ /**
19
+ * Resolve how to spawn a detached gjc subcommand for the current runtime.
20
+ *
21
+ * Source/dev mode (bun/node) prepends the entry script (`Bun.main`) so the
22
+ * respawn loads edited source. A compiled single-file binary self-spawns its
23
+ * own subcommand directly and cannot pick up workspace source edits.
24
+ */
25
+ export declare function resolveGjcRuntimeSpawnInfo(execPath?: string): GjcRuntimeSpawnInfo;
@@ -20,6 +20,7 @@ import type { PythonResult } from "../../eval/py/executor";
20
20
  import type { BashResult } from "../../exec/bash-executor";
21
21
  import type { ExecOptions, ExecResult } from "../../exec/exec";
22
22
  import type { CustomEditor } from "../../modes/components/custom-editor";
23
+ import type { WorkflowGateEmitter } from "../../modes/shared/agent-wire/unattended-session";
23
24
  import type { Theme } from "../../modes/theme/theme";
24
25
  import type { CustomMessage } from "../../session/messages";
25
26
  import type { ReadonlySessionManager, SessionManager } from "../../session/session-manager";
@@ -206,6 +207,11 @@ export interface ExtensionContext {
206
207
  getSystemPrompt(): string[];
207
208
  /** @deprecated Use hasPendingMessages() instead */
208
209
  hasQueuedMessages(): boolean;
210
+ /**
211
+ * Unattended workflow-gate bridge. Present only when the session runs in
212
+ * unattended/RPC mode; `undefined` in interactive/TUI mode (notify-only).
213
+ */
214
+ workflowGate?: WorkflowGateEmitter;
209
215
  }
210
216
  /**
211
217
  * Extended context for command handlers.
@@ -834,6 +840,8 @@ export interface ExtensionContextActions {
834
840
  getContextUsage: () => ContextUsage | undefined;
835
841
  compact: (instructionsOrOptions?: string | CompactOptions) => Promise<void>;
836
842
  getSystemPrompt: () => string[];
843
+ /** Unattended workflow-gate bridge (present only in unattended/RPC mode). */
844
+ getWorkflowGate?: () => WorkflowGateEmitter | undefined;
837
845
  }
838
846
  /** Actions for ExtensionCommandContext (ctx.* in command handlers). */
839
847
  export interface ExtensionCommandContextActions {
@@ -66,10 +66,12 @@ export interface GuardedStateWriterOptions extends StateWriterOptions {
66
66
  export type GuardedWriteResult = {
67
67
  path: string;
68
68
  written: true;
69
+ revision: number;
69
70
  } | {
70
71
  path: string;
71
72
  written: false;
72
73
  reason: "stale-skip";
74
+ revision: number;
73
75
  };
74
76
  export interface StateWriterOptions {
75
77
  cwd?: string;
@@ -27,10 +27,25 @@ export declare function validateCompletionReceipt(input: {
27
27
  export declare function readUltragoalVerificationState(input: {
28
28
  cwd: string;
29
29
  currentGoal?: CurrentGoalLike | null;
30
+ sessionId?: string | null;
30
31
  }): Promise<UltragoalGuardDiagnostic>;
31
32
  export declare function isUltragoalAskBlocked(cwd: string): Promise<UltragoalAskBlockDiagnostic>;
32
33
  export declare function assertCanCompleteCurrentGoal(input: {
33
34
  cwd: string;
34
35
  currentGoal?: CurrentGoalLike | null;
36
+ sessionId?: string | null;
35
37
  }): Promise<void>;
36
38
  export declare function isUltragoalBypassPrompt(prompt: string): boolean;
39
+ export interface UltragoalPauseBlockDiagnostic {
40
+ blocked: boolean;
41
+ reason: string;
42
+ }
43
+ /**
44
+ * While an Ultragoal run is active, `goal({"op":"pause"})` is only allowed when the
45
+ * current durable Ultragoal state is readable and the latest durable ledger event
46
+ * classifies the current blocker as `human_blocked`. Resolvable blockers must be
47
+ * worked, not parked. Reads fail closed so unreadable durable state or ledger data
48
+ * blocks pause rather than silently allowing a give-up.
49
+ */
50
+ export declare function isUltragoalPauseBlocked(cwd: string): Promise<UltragoalPauseBlockDiagnostic>;
51
+ export declare function assertUltragoalPauseAllowed(cwd: string): Promise<void>;
@@ -193,6 +193,19 @@ export declare function recordUltragoalReviewBlockers(input: {
193
193
  evidence: string;
194
194
  gjcGoalJson?: string;
195
195
  }): Promise<UltragoalPlan>;
196
+ export type UltragoalBlockerClassification = "human_blocked" | "resolvable";
197
+ /**
198
+ * Record an audited blocker triage classification in the durable ledger. A
199
+ * `human_blocked` classification is the only thing that authorizes
200
+ * `goal({"op":"pause"})` while an Ultragoal run is active; `resolvable` is an
201
+ * audit note and never unblocks pause.
202
+ */
203
+ export declare function recordUltragoalBlockerClassification(input: {
204
+ cwd: string;
205
+ classification: UltragoalBlockerClassification;
206
+ evidence: string;
207
+ goalId?: string;
208
+ }): Promise<UltragoalLedgerEvent>;
196
209
  type UltragoalReviewContractStrength = "strong" | "thin-derived";
197
210
  interface UltragoalReviewFinding extends JsonObject {
198
211
  severity: "blocker";
@@ -208,6 +221,7 @@ interface UltragoalReviewResult extends JsonObject {
208
221
  weakContractCapApplied: boolean;
209
222
  blockerGoalIds?: string[];
210
223
  }
224
+ export declare function resolveGitBase(cwd: string, branch?: string): Promise<string>;
211
225
  export declare function runUltragoalReview(cwd: string, args: readonly string[]): Promise<UltragoalReviewResult>;
212
226
  export declare function runNativeUltragoalCommand(args: string[], cwd?: string): Promise<UltragoalCommandResult>;
213
227
  export {};
@@ -1,5 +1,6 @@
1
1
  import { Container } from "@gajae-code/tui";
2
2
  import type { AuthStorage } from "../../session/auth-storage";
3
+ import type { ImportableCredential } from "../../setup/credential-import";
3
4
  /**
4
5
  * Component that renders an OAuth provider selector.
5
6
  */
@@ -8,6 +9,7 @@ export declare class OAuthSelectorComponent extends Container {
8
9
  constructor(mode: "login" | "logout", authStorage: AuthStorage, onSelect: (providerId: string) => void, onCancel: () => void, options?: {
9
10
  validateAuth?: (providerId: string) => Promise<boolean>;
10
11
  requestRender?: () => void;
12
+ externalCredentialCandidates?: ImportableCredential[];
11
13
  });
12
14
  stopValidation(): void;
13
15
  dispose(): void;