@gajae-code/coding-agent 0.21.0 → 0.21.1

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 (111) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/types/config/autorouting-contract.d.ts +4 -4
  3. package/dist/types/config/autorouting-tier-map.d.ts +1 -1
  4. package/dist/types/config/keybindings.d.ts +1 -5
  5. package/dist/types/config/model-profile-activation.d.ts +30 -3
  6. package/dist/types/config/model-registry.d.ts +2 -0
  7. package/dist/types/config/models-config-schema.d.ts +8 -0
  8. package/dist/types/config/settings-schema.d.ts +7 -3
  9. package/dist/types/coordinator-mcp/canonical-json.d.ts +7 -0
  10. package/dist/types/extensibility/gjc-plugins/metadata.d.ts +1 -1
  11. package/dist/types/harness-control-plane/receipts.d.ts +1 -1
  12. package/dist/types/modes/components/settings-selector.d.ts +5 -2
  13. package/dist/types/modes/controllers/command-controller.d.ts +1 -1
  14. package/dist/types/modes/controllers/input-controller.d.ts +12 -0
  15. package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
  16. package/dist/types/modes/interactive-mode.d.ts +1 -1
  17. package/dist/types/modes/shared/agent-wire/workflow-gate-schema.d.ts +1 -1
  18. package/dist/types/modes/types.d.ts +1 -1
  19. package/dist/types/session/agent-session.d.ts +101 -6
  20. package/dist/types/session/session-manager.d.ts +124 -9
  21. package/dist/types/setup/provider-onboarding.d.ts +55 -2
  22. package/dist/types/slash-commands/builtin-registry.d.ts +11 -0
  23. package/dist/types/utils/clipboard.d.ts +18 -0
  24. package/dist/types/utils/pasted-image-path.d.ts +2 -0
  25. package/dist/types/web/search/providers/keenable.d.ts +30 -0
  26. package/dist/types/web/search/types.d.ts +2 -2
  27. package/package.json +7 -7
  28. package/scripts/generate-sdk-operation-inventory.ts +28 -0
  29. package/src/cli/doctor/config-repairs.ts +1 -4
  30. package/src/cli/local-provider-smoke.ts +1 -4
  31. package/src/cli/public-command-help.ts +1 -1
  32. package/src/config/autorouting-contract.ts +5 -8
  33. package/src/config/autorouting-tier-map.ts +1 -1
  34. package/src/config/keybindings.ts +1 -2
  35. package/src/config/model-profile-activation.ts +332 -28
  36. package/src/config/model-registry.ts +156 -8
  37. package/src/config/models-config-schema.ts +27 -0
  38. package/src/config/settings-schema.ts +6 -0
  39. package/src/coordinator-mcp/canonical-json.ts +15 -0
  40. package/src/coordinator-mcp/policy.ts +1 -0
  41. package/src/coordinator-mcp/question-gate-codec.ts +1 -2
  42. package/src/coordinator-mcp/question-state.ts +2 -12
  43. package/src/coordinator-mcp/server.ts +1 -10
  44. package/src/customization/import.ts +1 -5
  45. package/src/discovery/mcp-compat.ts +1 -5
  46. package/src/discovery/mcp-json.ts +1 -4
  47. package/src/edit/notebook.ts +1 -5
  48. package/src/extensibility/gjc-plugins/lifecycle.ts +1 -3
  49. package/src/extensibility/gjc-plugins/metadata.ts +2 -5
  50. package/src/extensibility/gjc-plugins/schema.ts +1 -4
  51. package/src/gjc-runtime/deep-interview-crystallize.ts +1 -4
  52. package/src/gjc-runtime/deep-interview-runtime.ts +1 -4
  53. package/src/gjc-runtime/state-renderer.ts +1 -5
  54. package/src/gjc-runtime/tmux-owner-isolation.ts +1 -3
  55. package/src/gjc-runtime/ultragoal-owner-loss-recovery.ts +1 -4
  56. package/src/gjc-runtime/ultragoal-succession.ts +1 -4
  57. package/src/goals/continuation-timeout-guard.ts +1 -4
  58. package/src/harness-control-plane/receipts.ts +1 -1
  59. package/src/internal-urls/docs-index.generated.ts +4 -4
  60. package/src/migrate/mcp-mapper.ts +2 -4
  61. package/src/modes/components/hook-editor.ts +4 -8
  62. package/src/modes/components/hook-selector.ts +3 -1
  63. package/src/modes/components/settings-selector.ts +26 -2
  64. package/src/modes/controllers/command-controller.ts +4 -98
  65. package/src/modes/controllers/extension-ui-controller.ts +6 -14
  66. package/src/modes/controllers/goal-mode-controller.ts +4 -4
  67. package/src/modes/controllers/input-controller.ts +110 -46
  68. package/src/modes/controllers/plan-mode-controller.ts +6 -10
  69. package/src/modes/controllers/selector-controller.ts +66 -23
  70. package/src/modes/controllers/todo-command-controller.ts +2 -2
  71. package/src/modes/interactive-mode.ts +2 -2
  72. package/src/modes/prompt-action-autocomplete.ts +1 -1
  73. package/src/modes/runtime-init.ts +4 -4
  74. package/src/modes/shared/agent-wire/workflow-gate-schema.ts +1 -1
  75. package/src/modes/types.ts +1 -1
  76. package/src/modes/utils/hotkeys-markdown.ts +1 -1
  77. package/src/runtime-mcp/client.ts +1 -4
  78. package/src/runtime-mcp/elicitation.ts +1 -5
  79. package/src/runtime-mcp/protocol.ts +2 -4
  80. package/src/sdk/broker/lifecycle-ledger.ts +1 -0
  81. package/src/sdk/broker/lifecycle.ts +1 -0
  82. package/src/sdk/cli/rows.ts +2 -3
  83. package/src/sdk/cli/session-cli.ts +2 -8
  84. package/src/sdk/host/query/cursor.ts +1 -0
  85. package/src/sdk/host/reverse-leases.ts +1 -0
  86. package/src/sdk/lifecycle/service.ts +1 -0
  87. package/src/sdk/protocol/operation-inventory.generated.json +154 -0
  88. package/src/session/agent-session.ts +1877 -224
  89. package/src/session/btw-prefix-ledger.ts +1 -4
  90. package/src/session/internal/managed-gc-retirement-codec.ts +1 -4
  91. package/src/session/session-manager.ts +732 -224
  92. package/src/session/task-artifact-owner-codec.ts +1 -4
  93. package/src/session-import/claude.ts +1 -4
  94. package/src/session-import/detect.ts +1 -6
  95. package/src/session-import/provider-codex.ts +1 -6
  96. package/src/session-import/provider-service.ts +4 -0
  97. package/src/setup/hermes-setup.ts +1 -4
  98. package/src/setup/provider-onboarding.ts +514 -26
  99. package/src/slash-commands/builtin-registry.ts +26 -13
  100. package/src/slash-commands/helpers/todo.ts +3 -1
  101. package/src/task/delegation-hint.ts +1 -4
  102. package/src/task/executor.ts +4 -2
  103. package/src/task/provider-retry-status.ts +1 -4
  104. package/src/tools/json-tree.ts +1 -4
  105. package/src/tools/recipe/runners/pkg.ts +1 -5
  106. package/src/utils/clipboard.ts +155 -2
  107. package/src/utils/mac-file-urls.applescript +37 -0
  108. package/src/utils/pasted-image-path.ts +5 -0
  109. package/src/web/search/provider.ts +6 -0
  110. package/src/web/search/providers/keenable.ts +207 -0
  111. package/src/web/search/types.ts +2 -0
@@ -256,6 +256,62 @@ export interface ModelChangeEntry extends SessionEntryBase {
256
256
  /** Persisted configured fallback chain for one model role. */
257
257
  export type ConfiguredModelChainEntry = SharedConfiguredModelChainEntry;
258
258
  export type ConfiguredModelChain = Pick<ConfiguredModelChainEntry, "role" | "entries" | "origin" | "identity" | "explicitHead" | "cleared">;
259
+ /**
260
+ * One entry of an admitted shared control publication
261
+ * ({@link SessionManager.appendControlEntriesSharingSession}). Controls describe
262
+ * their transcript effect as data so every control shares one admission path.
263
+ */
264
+ export type SharedControlEntry = {
265
+ readonly type: "configured_model_chain";
266
+ readonly chain: ConfiguredModelChain;
267
+ } | {
268
+ readonly type: "model_change";
269
+ readonly model: string;
270
+ readonly role: string;
271
+ readonly metadata?: {
272
+ previousModel?: string;
273
+ reason?: string;
274
+ thinkingLevel?: string | null;
275
+ };
276
+ } | {
277
+ readonly type: "model_role_clear";
278
+ readonly role: string;
279
+ } | {
280
+ readonly type: "thinking_level_change";
281
+ readonly level: string | undefined;
282
+ readonly operatorIntent: boolean;
283
+ } | {
284
+ readonly type: "service_tier_change";
285
+ readonly serviceTier: ServiceTier | null;
286
+ } | {
287
+ readonly type: "custom";
288
+ readonly customType: string;
289
+ readonly data: unknown;
290
+ }
291
+ /**
292
+ * A parentless `context_clear` root: it starts this opener's fresh active branch. Only
293
+ * valid as the first entry of a publication; later entries descend from it.
294
+ */
295
+ | {
296
+ readonly type: "context_clear";
297
+ readonly data: Record<string, unknown> | undefined;
298
+ };
299
+ export interface DefaultModelSelectionEntriesOptions {
300
+ readonly appendThinkingLevel: boolean;
301
+ readonly appendTemporaryModelChange?: boolean;
302
+ readonly configuredDefaultChain?: readonly string[];
303
+ readonly selectionRole?: string;
304
+ }
305
+ export type ModelProfileTranscriptPlan = {
306
+ configuredDefaultChain?: ConfiguredModelChain;
307
+ temporaryModel?: string;
308
+ thinking?: {
309
+ readonly level: string | undefined;
310
+ };
311
+ resumeDefault?: {
312
+ readonly selector: string | undefined;
313
+ };
314
+ };
259
315
  export interface ServiceTierChangeEntry extends SessionEntryBase {
260
316
  type: "service_tier_change";
261
317
  serviceTier: ServiceTier | null;
@@ -622,7 +678,7 @@ export type SharedTitleOutcome = {
622
678
  * failures; reconcile it against the transcript before retrying. `rejected` proves
623
679
  * no append was committed. Lock acquisition failures before staging still throw.
624
680
  */
625
- export type SharedTemporaryModelAppendOutcome = {
681
+ export type SharedEntriesAppendOutcome = {
626
682
  readonly kind: "committed";
627
683
  readonly ids: readonly string[];
628
684
  } | {
@@ -1590,12 +1646,12 @@ export declare class SessionManager {
1590
1646
  */
1591
1647
  registerManagedTranscriptRelocationResolver(resolver: () => ArtifactManager): () => void;
1592
1648
  isPersisted(): boolean;
1593
- stageDefaultModelSelection(model: string, thinkingLevel: string | undefined, options?: {
1594
- readonly appendThinkingLevel: boolean;
1595
- readonly appendTemporaryModelChange?: boolean;
1596
- readonly configuredDefaultChain?: readonly string[];
1597
- readonly selectionRole?: string;
1598
- }): Promise<DefaultModelSelectionStage>;
1649
+ /**
1650
+ * The additive entries of a concrete default model selection, in the same order
1651
+ * {@link stageDefaultModelSelection} stages them, for admitted shared publication.
1652
+ */
1653
+ defaultModelSelectionControlEntries(model: string, thinkingLevel: string | undefined, options?: DefaultModelSelectionEntriesOptions): SharedControlEntry[];
1654
+ stageDefaultModelSelection(model: string, thinkingLevel: string | undefined, options?: DefaultModelSelectionEntriesOptions): Promise<DefaultModelSelectionStage>;
1599
1655
  promoteDefaultModelSelection(stage: DefaultModelSelectionStage): DefaultModelSelectionPromotion;
1600
1656
  discardDefaultModelSelectionStage(stage: DefaultModelSelectionStage): Promise<void>;
1601
1657
  /**
@@ -1799,8 +1855,12 @@ export declare class SessionManager {
1799
1855
  withDurableThinkingControl<T>(body: () => Promise<T>): Promise<T>;
1800
1856
  /** Scope only an explicitly opted-in root control's own thinking publication. */
1801
1857
  withSharedThinkingControl<T>(body: () => Promise<T>): Promise<T>;
1858
+ /** Whether this logical session must keep using shared mutation admission. */
1859
+ requiresSharedMutationAdmission(): boolean;
1802
1860
  /** Refuse before caller-side agent, UI, settings, or external effects. */
1803
1861
  assertLegacyMutationAllowed(operation: string): void;
1862
+ /** Additive legacy appends are safe once a control publication's transaction has settled. */
1863
+ assertLegacyAppendAllowed(operation: string): void;
1804
1864
  /**
1805
1865
  * Append this process's next entry into a transcript other openers may also be writing.
1806
1866
  *
@@ -1825,7 +1885,25 @@ export declare class SessionManager {
1825
1885
  /** A bounded temporary model operation shares one lease and preserves both attempted IDs. */
1826
1886
  appendTemporaryModelChangeSharingSession(model: string, thinking: {
1827
1887
  readonly level: string | undefined;
1828
- } | undefined, isCurrent: () => boolean): Promise<SharedTemporaryModelAppendOutcome>;
1888
+ } | undefined, isCurrent: () => boolean): Promise<SharedEntriesAppendOutcome>;
1889
+ /** Publish ordered profile entries under one managed lease at this opener's branch cursor. */
1890
+ appendModelProfileActivationSharingSession(plan: ModelProfileTranscriptPlan, isCurrent: () => boolean): Promise<SharedEntriesAppendOutcome>;
1891
+ /** Publish changed service-tier intent, or validate admission for an unchanged-tier rearm. */
1892
+ appendServiceTierChangeSharingSession(serviceTier: ServiceTier | null, appendEntry: boolean, isCurrent: () => boolean): Promise<SharedEntriesAppendOutcome>;
1893
+ /**
1894
+ * The common admitted publication for session controls once a session publishes
1895
+ * through the shared transaction (#7823, #7824).
1896
+ *
1897
+ * Every entry is a child of this opener's validated cursor and is written in order
1898
+ * under one managed lease; the transcript is never rewritten and an unseen sibling
1899
+ * branch is never followed. An empty list validates admission and currentness without
1900
+ * writing. Inside {@link withSharedThinkingControl} the active owner is consumed, so
1901
+ * one owned control scope admits exactly one publication.
1902
+ *
1903
+ * Control appends latch only rewrite authority (see {@link #enterSharedPublication}):
1904
+ * their additive entries are safe to continue from, the adopted identity is not.
1905
+ */
1906
+ appendControlEntriesSharingSession(entries: readonly SharedControlEntry[], isCurrent: () => boolean): Promise<SharedEntriesAppendOutcome>;
1829
1907
  /** Publish a compaction at this opener's branch cursor without rewriting peer history. */
1830
1908
  appendCompactionSharingSession<T = unknown>(payload: Omit<CompactionEntry<T>, "type" | "id" | "parentId" | "timestamp">, isCurrent: () => boolean): Promise<SharedAppendOutcome>;
1831
1909
  /** Only the active owner may publish one thinking entry inside the existing shared transaction. */
@@ -1855,6 +1933,8 @@ export declare class SessionManager {
1855
1933
  appendServiceTierChange(serviceTier: ServiceTier | null): string;
1856
1934
  /** Append a mode change as child of current leaf, then advance leaf. Returns entry id. */
1857
1935
  appendModeChange(mode: string, data?: Record<string, unknown>): string;
1936
+ /** Publish a mode change at this opener's admitted branch cursor under a shared lease. */
1937
+ appendModeChangeSharingSession(mode: string, data?: Record<string, unknown>): Promise<SharedAppendOutcome>;
1858
1938
  /**
1859
1939
  * Append a model change as child of current leaf, then advance leaf. Returns entry id.
1860
1940
  * @param model Model in "provider/modelId" format
@@ -1892,6 +1972,15 @@ export declare class SessionManager {
1892
1972
  * happen in one synchronous step, so no turn can interleave.
1893
1973
  */
1894
1974
  appendSessionRecap(input: SessionRecapInput): SessionRecapAppendResult;
1975
+ /**
1976
+ * Publish a recap at this opener's admitted branch cursor under a shared lease.
1977
+ *
1978
+ * The plan is computed against this manager's own graph before the lease is taken: a
1979
+ * concurrent sibling append can only make the recap's freshness claim stale, and
1980
+ * {@link getSessionRecap} re-validates provenance on every read, so the entry itself
1981
+ * is always additive-safe.
1982
+ */
1983
+ appendSessionRecapSharingSession(input: SessionRecapInput): Promise<SessionRecapAppendResult>;
1895
1984
  /**
1896
1985
  * Recap of the active branch's last turn, or undefined when there is none or it
1897
1986
  * is stale (the conversation advanced past its source entry, the leaf moved to a
@@ -1907,6 +1996,13 @@ export declare class SessionManager {
1907
1996
  * available for diagnostics/export.
1908
1997
  */
1909
1998
  appendContextClearEntry(data?: Record<string, unknown>): string;
1999
+ /**
2000
+ * The admitted shared form of {@link appendContextClearEntry}: the parentless root and
2001
+ * the carried-over profile ownership marker, as entries for
2002
+ * {@link appendControlEntriesSharingSession}. The root is appended, never rewritten, so
2003
+ * earlier history and any unseen sibling branch stay in the transcript.
2004
+ */
2005
+ contextClearControlEntries(data: Record<string, unknown> | undefined): SharedControlEntry[];
1910
2006
  /**
1911
2007
  * Write mutated message entries back into the canonical entry store by id.
1912
2008
  *
@@ -1945,8 +2041,15 @@ export declare class SessionManager {
1945
2041
  * @returns Entry id
1946
2042
  */
1947
2043
  appendCustomMessageEntry<T = unknown>(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details?: T, attribution?: MessageAttribution, observationId?: string): string;
2044
+ /**
2045
+ * Publish a custom message at the managed branch cursor under a shared lease.
2046
+ * Sessions that publish canonical messages through the shared path must use this
2047
+ * for custom messages too: once shared admission is armed, the legacy append is
2048
+ * refused.
2049
+ */
2050
+ appendCustomMessageEntrySharingSession<T = unknown>(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details?: T, attribution?: MessageAttribution, observationId?: string): Promise<SharedAppendOutcome>;
1948
2051
  /** Publish one or both discovered-tool authorities at this opener's branch cursor. */
1949
- appendToolSelectionsSharingSession(mcpToolNames: string[] | undefined, builtinToolNames: string[] | undefined, isCurrent: () => boolean): Promise<SharedTemporaryModelAppendOutcome>;
2052
+ appendToolSelectionsSharingSession(mcpToolNames: string[] | undefined, builtinToolNames: string[] | undefined, isCurrent: () => boolean): Promise<SharedEntriesAppendOutcome>;
1950
2053
  /** Append MCP discovery selection authority without altering discovered built-in authority. */
1951
2054
  appendMCPToolSelection(selectedToolNames: string[], mutationCorrelationId?: string): string;
1952
2055
  /** Append discovered built-in selection authority without altering MCP authority. */
@@ -1957,6 +2060,12 @@ export declare class SessionManager {
1957
2060
  * @returns Entry id
1958
2061
  */
1959
2062
  appendTtsrInjection(ruleNames: string[], records?: TtsrInjectionRecord[], ttsrMessageCount?: number): string;
2063
+ /**
2064
+ * Publish a TTSR injection marker at this opener's admitted branch cursor.
2065
+ * Sessions that publish canonical messages through the shared path must use this for
2066
+ * injection markers too: once shared admission is armed, the legacy append is refused.
2067
+ */
2068
+ appendTtsrInjectionSharingSession(ruleNames: string[], records?: TtsrInjectionRecord[], ttsrMessageCount?: number): Promise<SharedAppendOutcome>;
1960
2069
  /**
1961
2070
  * Get all unique TTSR rule names that have been injected in the current branch.
1962
2071
  * Scans from root to current leaf for ttsr_injection entries.
@@ -2017,6 +2126,12 @@ export declare class SessionManager {
2017
2126
  * Pass undefined or empty string to clear the label.
2018
2127
  */
2019
2128
  appendLabelChange(targetId: string, label: string | undefined): string;
2129
+ /**
2130
+ * Publish a label change at this opener's admitted branch cursor under a shared lease.
2131
+ * Sessions that publish canonical messages through the shared path must use this for
2132
+ * labels too: once shared admission is armed, the legacy append is refused.
2133
+ */
2134
+ appendLabelChangeSharingSession(targetId: string, label: string | undefined): Promise<SharedAppendOutcome>;
2020
2135
  /**
2021
2136
  * Walk from entry to root, returning all entries in path order.
2022
2137
  * Includes all entry types (messages, compaction, model changes, etc.).
@@ -59,11 +59,47 @@ export interface ProviderSetupResult {
59
59
  discoveryType?: string;
60
60
  preset?: string;
61
61
  presetName?: string;
62
+ /**
63
+ * Set only when a forced env replacement disabled stored API-key rows the
64
+ * replaced entry declared via `credential: store`. Present so setup can
65
+ * report the destructive half instead of silently dropping a credential.
66
+ * Rows are soft-disabled, not deleted: `gjc accounts list` shows them as
67
+ * `disabled` and `gjc accounts logout <provider> --all` removes them.
68
+ */
69
+ credentialCleanup?: {
70
+ disabledApiKeys: number;
71
+ envName: string;
72
+ };
73
+ /**
74
+ * Set when an env-source add succeeds while stored api_key rows for the
75
+ * provider remain. They outrank `apiKeyEnv` at runtime and are not removed
76
+ * by setup (the replaced entry never declared `credential: store`), so the
77
+ * success output must say the environment variable is being shadowed.
78
+ */
79
+ storedCredentialShadow?: {
80
+ storedApiKeys: number;
81
+ envName: string;
82
+ };
83
+ /**
84
+ * Set when an env-source add succeeds but the credential store could not be
85
+ * inspected, so setup cannot say whether stored api_key rows shadow the env
86
+ * var. Present so the success output discloses the unverified risk instead
87
+ * of reporting unconditional success.
88
+ */
89
+ storedCredentialShadowUnverified?: {
90
+ envName: string;
91
+ };
62
92
  }
63
93
  type ProviderConfig = NonNullable<NonNullable<ModelsConfig["providers"]>[string]>;
64
94
  type ProviderCompatConfig = NonNullable<ProviderConfig["compat"]>;
65
- type ProviderSetupCredentialStore = Pick<AuthStorage, "set" | "remove" | "exportSnapshot"> & {
66
- peekApiKey?: (provider: string) => Promise<string | undefined>;
95
+ type ProviderSetupCredentialStore = Pick<AuthStorage, "set" | "remove" | "exportSnapshot" | "disableCredentialById" | "reload"> & {
96
+ /**
97
+ * Resolves a stored api_key value the way the runtime does: a
98
+ * `!<command>` value is executed and an env-name value is read from the
99
+ * environment. Optional so test doubles can omit it; the probe then uses
100
+ * the raw stored value, refusing a command-backed reference it cannot run.
101
+ */
102
+ peekApiKey?: AuthStorage["peekApiKey"];
67
103
  };
68
104
  interface ProviderPreset {
69
105
  id: string;
@@ -96,6 +132,17 @@ export declare function parseModelList(values: readonly string[]): string[];
96
132
  export declare function redactSecret(_secret: string): string;
97
133
  export declare function validateModelApi(modelApi: Readonly<Record<string, string>> | undefined, models: readonly string[], presetId: string): void;
98
134
  export declare function addApiCompatibleProvider(input: ProviderSetupInput): Promise<ProviderSetupResult>;
135
+ /**
136
+ * Post-refresh guard for setup callers that reload through a live registry.
137
+ * `refresh` re-reads the written config, so a loader error there means the
138
+ * provider is unusable even though setup wrote it.
139
+ */
140
+ export declare function assertProviderConfigLoaded(registry: {
141
+ getError(): {
142
+ id: string;
143
+ message: string;
144
+ } | undefined;
145
+ }, providerId: string, modelsPath: string, credentialSource: ProviderSetupResult["credentialSource"]): void;
99
146
  export interface ProviderDiscoveryProbeInput {
100
147
  baseUrl: string;
101
148
  apiKeyEnv?: string;
@@ -137,5 +184,11 @@ export interface DiscoveryCatalogRefresher {
137
184
  * (wait for the next refresh, or re-add with explicit `--model` ids).
138
185
  */
139
186
  export declare function reloadAndRefreshDiscoveryCatalog(registry: DiscoveryCatalogRefresher, providerId: string, credentialSessionId?: string): Promise<string | null>;
187
+ /**
188
+ * Render the success banner. Only call this after the written config has been
189
+ * verified to load: `addApiCompatibleProvider` re-reads the file it wrote, and
190
+ * registry-backed callers re-check `modelRegistry.getError()` after their
191
+ * post-write refresh. On any load failure the setup path must throw instead.
192
+ */
140
193
  export declare function formatProviderSetupResult(result: ProviderSetupResult): string;
141
194
  export {};
@@ -5,6 +5,17 @@ export type { BuiltinSlashCommand, SubcommandDef } from "./types";
5
5
  export type BuiltinSlashCommandRuntime = TuiSlashCommandRuntime & {
6
6
  composer?: ComposerSubmissionOptions;
7
7
  };
8
+ export declare function parseProviderSetupSlashArgs(args: string): {
9
+ preset?: string;
10
+ compat?: string;
11
+ provider?: string;
12
+ baseUrl?: string;
13
+ apiKeyEnv?: string;
14
+ rejectedRawApiKey: boolean;
15
+ force: boolean;
16
+ discover: boolean;
17
+ models: string[];
18
+ };
8
19
  /**
9
20
  * Resolve a `/model <selector>` argument against the merged model-profile
10
21
  * registry. Returns the canonical profile name when `selector` is either a
@@ -51,6 +51,24 @@ export declare function copyToClipboard(text: string): Promise<ClipboardDelivery
51
51
  * @throws ClipboardTransportError on ssh failure — never returns stale/empty text silently.
52
52
  */
53
53
  export declare function pasteFromClipboard(): Promise<string | null>;
54
+ /**
55
+ * Read file paths from the macOS pasteboard's `public.file-url` representation.
56
+ *
57
+ * A Finder Cmd+C on an image file puts only file URLs plus a generated file-icon bitmap on the
58
+ * pasteboard; reading the bitmap first would attach the generic icon instead of the file.
59
+ * Returns an empty list off Darwin, under the `ssh` clipboard transport (the local pasteboard is
60
+ * not the configured clipboard), when AppleScript is unavailable, or when no file URL is present.
61
+ */
62
+ export declare function readMacFileUrlsFromClipboard(): Promise<string[]>;
63
+ /**
64
+ * Read plain text from the system clipboard for the smart-paste fallback.
65
+ *
66
+ * Under the `ssh` clipboard transport this reads the configured host's clipboard and throws
67
+ * {@link ClipboardTransportError} on failure; it never falls back to the local clipboard.
68
+ * Otherwise it uses `pbpaste` on macOS, PowerShell on Windows/WSL, `termux-clipboard-get`, or
69
+ * wl-paste/xclip/xsel on Linux. Returns an empty string when no text can be read.
70
+ */
71
+ export declare function readTextFromClipboard(): Promise<string>;
54
72
  /**
55
73
  * Read an image from the system clipboard.
56
74
  *
@@ -44,3 +44,5 @@ export interface PastedImageReferenceRange {
44
44
  */
45
45
  export declare function imageReferenceNumbers(text: string): number[];
46
46
  export declare function locatePastedImageReferenceAroundCursor(line: string, cursorCol: number): PastedImageReferenceRange | null;
47
+ /** Image files among absolute paths (macOS pasteboard file list), in order. */
48
+ export declare function imageFilePathsFromList(paths: readonly string[]): string[];
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Keenable Web Search Provider
3
+ *
4
+ * Uses the Keenable search API. Works without an API key through the public
5
+ * endpoint (rate-limited per IP); a KEENABLE_API_KEY or stored "keenable"
6
+ * credential switches to the keyed endpoint for higher limits.
7
+ */
8
+ import type { AuthStorage } from "@gajae-code/ai/core";
9
+ import type { SearchResponse } from "../../../web/search/types";
10
+ import type { SearchParams } from "./base";
11
+ import { SearchProvider } from "./base";
12
+ export interface KeenableSearchParams {
13
+ query: string;
14
+ num_results?: number;
15
+ recency?: "day" | "week" | "month" | "year";
16
+ signal?: AbortSignal;
17
+ }
18
+ /** Find an optional Keenable API key through AuthStorage's unified refresh pipeline. */
19
+ export declare function findApiKey(authStorage: AuthStorage, sessionId: string | undefined, signal: AbortSignal | undefined): Promise<string | null>;
20
+ /** Exported for testing. Builds the Keenable request body from unified params. */
21
+ export declare function buildRequestBody(params: KeenableSearchParams, now?: Date): Record<string, unknown>;
22
+ /** Execute Keenable web search. */
23
+ export declare function searchKeenable(params: SearchParams): Promise<SearchResponse>;
24
+ /** Search provider for Keenable web search. Keyless, so always available once selected. */
25
+ export declare class KeenableProvider extends SearchProvider {
26
+ readonly id = "keenable";
27
+ readonly label = "Keenable";
28
+ isAvailable(_authStorage: AuthStorage): boolean;
29
+ search(params: SearchParams): Promise<SearchResponse>;
30
+ }
@@ -4,7 +4,7 @@
4
4
  * Unified types for web search responses across supported providers.
5
5
  */
6
6
  /** Supported web search providers */
7
- export type SearchProviderId = "duckduckgo" | "insane" | "exa" | "brave" | "jina" | "kimi" | "zai" | "anthropic" | "perplexity" | "gemini" | "codex" | "xai" | "tavily" | "parallel" | "kagi" | "synthetic" | "searxng" | "openai-compatible";
7
+ export type SearchProviderId = "duckduckgo" | "insane" | "exa" | "brave" | "jina" | "kimi" | "zai" | "anthropic" | "perplexity" | "gemini" | "codex" | "xai" | "tavily" | "parallel" | "kagi" | "synthetic" | "searxng" | "keenable" | "openai-compatible";
8
8
  export type WebSearchMode = "on" | "off" | "auto";
9
9
  /** Credentials and request headers resolved for the active model. */
10
10
  export interface ActiveSearchModelCredentials {
@@ -29,7 +29,7 @@ export interface ActiveSearchModelContext {
29
29
  ownerAuthOverride?: boolean;
30
30
  webSearch?: WebSearchMode;
31
31
  }
32
- export declare const CONFIGURABLE_SEARCH_PROVIDER_IDS: readonly ["duckduckgo", "insane", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "xai", "tavily", "parallel", "kagi", "synthetic", "searxng"];
32
+ export declare const CONFIGURABLE_SEARCH_PROVIDER_IDS: readonly ["duckduckgo", "insane", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "xai", "tavily", "parallel", "kagi", "synthetic", "searxng", "keenable"];
33
33
  export declare function isSearchProviderId(value: string): value is SearchProviderId;
34
34
  export declare function isConfigurableSearchProviderId(value: string): value is (typeof CONFIGURABLE_SEARCH_PROVIDER_IDS)[number];
35
35
  export declare function isSearchProviderPreference(value: string): value is (typeof CONFIGURABLE_SEARCH_PROVIDER_IDS)[number] | "auto";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/coding-agent",
4
- "version": "0.21.0",
4
+ "version": "0.21.1",
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",
@@ -57,12 +57,12 @@
57
57
  "@agentclientprotocol/sdk": "1.3.0",
58
58
  "@babel/parser": "^7.29.3",
59
59
  "@mozilla/readability": "^0.6.0",
60
- "@gajae-code/stats": "0.21.0",
61
- "@gajae-code/agent-core": "0.21.0",
62
- "@gajae-code/ai": "0.21.0",
63
- "@gajae-code/natives": "0.21.0",
64
- "@gajae-code/tui": "0.21.0",
65
- "@gajae-code/utils": "0.21.0",
60
+ "@gajae-code/stats": "0.21.1",
61
+ "@gajae-code/agent-core": "0.21.1",
62
+ "@gajae-code/ai": "0.21.1",
63
+ "@gajae-code/natives": "0.21.1",
64
+ "@gajae-code/tui": "0.21.1",
65
+ "@gajae-code/utils": "0.21.1",
66
66
  "@puppeteer/browsers": "^2.13.0",
67
67
  "@types/turndown": "5.0.6",
68
68
  "@xterm/headless": "^6.0.0",
@@ -401,6 +401,34 @@ const LOCKED_EXCLUSIONS: Readonly<Record<string, string>> = {
401
401
  "agent_session:getAgentModelOverrides": "internal accessor/plumbing, not a user-facing control seam",
402
402
  "agent_session:setSessionAgentModelSelection":
403
403
  "internal agent-model selection plumbing behind the reviewed model selection seams, not an independent public SDK operation",
404
+ "agent_session:appendCustomEntryForSession":
405
+ "internal shared-session transcript publication for in-process extension and controller writers, not a user-facing SDK control seam",
406
+ "agent_session:appendCustomEntryInBackground":
407
+ "internal shared-session transcript publication from synchronous in-process call sites, not a user-facing SDK control seam",
408
+ "agent_session:appendMessageInBackground":
409
+ "internal shared-session transcript publication from synchronous in-process call sites, not a user-facing SDK control seam",
410
+ "agent_session:appendMessageForSession":
411
+ "internal shared-session transcript publication for in-process writers, not a user-facing SDK control seam",
412
+ "agent_session:appendSessionRecapForSession":
413
+ "internal shared-session recap publication behind the reviewed session recap surfaces, not an independent public SDK operation",
414
+ "agent_session:appendLabelChangeInBackground":
415
+ "internal shared-session label publication for the local TUI tree navigator, not a user-facing SDK control seam",
416
+ "agent_session:appendModeChangeInBackground":
417
+ "internal shared-session mode-change publication for plan/goal mode persistence, not a user-facing SDK control seam",
418
+ "agent_session:assertConfiguredModelChainWritable":
419
+ "internal fail-closed guard before profile/fallback-chain writes on adopted shared sessions, not a user-facing SDK control seam",
420
+ "agent_session:usesSharedControlPublication":
421
+ "internal shared-publication eligibility query for in-process control paths, not a user-facing SDK control seam",
422
+ "agent_session:withModelProfilePublication":
423
+ "internal shared publication scope behind the reviewed model.profile.set seam, not an independent public SDK operation",
424
+ "agent_session:appendModelProfileActivationForControl":
425
+ "internal shared transcript append behind the reviewed model.profile.set seam, not an independent public SDK operation",
426
+ "agent_session:publishCommittedModelProfileSessionState":
427
+ "internal receipt-bound live-state publication behind the reviewed model.profile.set seam, not an independent public SDK operation",
428
+ "agent_session:setThinkingLevelForSession":
429
+ "internal non-operator session-only thinking follow (plan mode, model assignment) over the reviewed thinking.set seam, not an independent public SDK operation",
430
+ "agent_session:setConfiguredModelChainForControl":
431
+ "internal shared-publication wrapper over profile and fallback-chain state for controls that already committed settings, not a user-facing SDK control seam",
404
432
  };
405
433
  /** Maps reviewed source seams to registry SDK operation IDs. */
406
434
  const SEAM_TO_SDK: Readonly<Record<string, string>> = {
@@ -1,5 +1,6 @@
1
1
  import * as path from "node:path";
2
2
  import type { NativeExactFileIdentity } from "@gajae-code/natives";
3
+ import { isRecord } from "@gajae-code/utils";
3
4
  import { YAML } from "bun";
4
5
  import { applyAtomicYamlPatchesWithCurrent, atomicYamlPathHash, type CasReceipt } from "../../config/atomic-yaml-patch";
5
6
  import {
@@ -51,10 +52,6 @@ export interface DoctorConfigRepairResult {
51
52
  readonly afterChecks?: readonly DoctorCheck[];
52
53
  }
53
54
 
54
- function isRecord(value: unknown): value is Record<string, unknown> {
55
- return !!value && typeof value === "object" && !Array.isArray(value);
56
- }
57
-
58
55
  function getAt(root: Record<string, unknown>, dotted: string): unknown {
59
56
  let current: unknown = root;
60
57
  for (const segment of dotted.split(".")) {
@@ -1,3 +1,4 @@
1
+ import { isRecord } from "@gajae-code/utils";
1
2
  import chalk from "chalk";
2
3
  import { ModelsConfigFile } from "../config/model-registry";
3
4
  import type { ModelsConfig } from "../config/models-config-schema";
@@ -80,10 +81,6 @@ interface ClassifiedFailure {
80
81
  const DEFAULT_TIMEOUT_MS = 3000;
81
82
  const DEFAULT_SMOKE_PROMPT = "Reply with ok.";
82
83
 
83
- function isRecord(value: unknown): value is Record<string, unknown> {
84
- return typeof value === "object" && value !== null;
85
- }
86
-
87
84
  function resolveApiKey(apiKey: string | undefined, apiKeyEnv: string | undefined): string | undefined {
88
85
  if (apiKeyEnv) return Bun.env[apiKeyEnv];
89
86
  if (!apiKey) return undefined;
@@ -85,7 +85,7 @@ export interface PublicHelpRenderResult {
85
85
  document: PublicHelpDocument;
86
86
  }
87
87
 
88
- /** Sorted object keys; array ordering is semantic. JSON escaping preserves lone surrogates. */
88
+ /** Sorted object keys; array ordering is semantic. JSON escaping preserves lone surrogates. Normalizes to JSON first: undefined array entries become null, undefined object keys are dropped, and non-JSON values throw invalid_registry. */
89
89
  function canonicalJson(value: unknown): string {
90
90
  const normalize = (item: unknown): unknown => {
91
91
  if (item === null || typeof item === "string" || typeof item === "boolean") return item;
@@ -1,11 +1,12 @@
1
1
  import { createHash } from "node:crypto";
2
+ import { isRecord } from "@gajae-code/utils";
2
3
 
3
4
  /**
4
- * Dependency-free autorouting vocabulary and settings validators.
5
+ * Autorouting vocabulary and settings validators.
5
6
  *
6
- * This module deliberately does not import Settings, task code, or model
7
- * profiles. It is the shared contract used by settings and (later) routing
8
- * policy code.
7
+ * Apart from the shared @gajae-code/utils type guards, this module deliberately
8
+ * does not import Settings, task code, or model profiles. It is the shared
9
+ * contract used by settings and (later) routing policy code.
9
10
  */
10
11
 
11
12
  export const AUTOROUTING_TIERS = ["fast", "balanced", "strong"] as const;
@@ -100,10 +101,6 @@ function effectiveIssue(
100
101
  return { code, reason: code, detail };
101
102
  }
102
103
 
103
- function isRecord(value: unknown): value is Record<string, unknown> {
104
- return value !== null && typeof value === "object" && !Array.isArray(value);
105
- }
106
-
107
104
  /**
108
105
  * Validate one provider-qualified selector. A selector has one provider
109
106
  * segment, a non-empty model remainder, and may carry one supported thinking
@@ -6695,7 +6695,7 @@ export const CURATED_TIER_MAP: AutoroutingCuratedTierMap = {
6695
6695
  version: TIER_MAP_VERSION,
6696
6696
  };
6697
6697
 
6698
- /** Canonical JSON uses sorted object keys and preserves array order. */
6698
+ /** Canonical JSON uses sorted object keys and preserves array order. `undefined`/function/symbol encode as the literal `undefined`; explicit undefined array entries become null, while sparse holes are skipped and produce invalid JSON. */
6699
6699
  export function canonicalJson(value: unknown): string {
6700
6700
  if (value === null) return "null";
6701
6701
  if (value === undefined) return "undefined";
@@ -175,7 +175,7 @@ export const KEYBINDINGS = {
175
175
  },
176
176
  "app.clipboard.pasteImage": {
177
177
  defaultKeys: defaultClipboardPasteImageKeysForPlatform(),
178
- description: "Paste image from clipboard",
178
+ description: "Paste image or text from clipboard",
179
179
  },
180
180
  "app.clipboard.pasteText": {
181
181
  defaultKeys: [],
@@ -359,7 +359,6 @@ const KEYBINDING_NAME_MIGRATIONS = {
359
359
  newLine: "tui.input.newLine",
360
360
  submit: "tui.input.submit",
361
361
  tab: "tui.input.tab",
362
- copy: "tui.input.copy",
363
362
  // TUI select (old names for backward compatibility)
364
363
  selectUp: "tui.select.up",
365
364
  selectDown: "tui.select.down",