@gajae-code/coding-agent 0.3.1 → 0.4.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 (166) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +1 -1
  3. package/dist/types/cli/args.d.ts +2 -0
  4. package/dist/types/commands/launch.d.ts +6 -0
  5. package/dist/types/config/model-profile-activation.d.ts +30 -0
  6. package/dist/types/config/model-profiles.d.ts +19 -0
  7. package/dist/types/config/model-registry.d.ts +25 -10
  8. package/dist/types/config/model-resolver.d.ts +1 -1
  9. package/dist/types/config/models-config-schema.d.ts +84 -0
  10. package/dist/types/config/settings-schema.d.ts +15 -0
  11. package/dist/types/edit/diff.d.ts +16 -0
  12. package/dist/types/edit/modes/replace.d.ts +7 -0
  13. package/dist/types/extensibility/gjc-plugins/activation.d.ts +14 -0
  14. package/dist/types/extensibility/gjc-plugins/index.d.ts +9 -0
  15. package/dist/types/extensibility/gjc-plugins/injection.d.ts +31 -0
  16. package/dist/types/extensibility/gjc-plugins/loader.d.ts +3 -0
  17. package/dist/types/extensibility/gjc-plugins/paths.d.ts +8 -0
  18. package/dist/types/extensibility/gjc-plugins/schema.d.ts +3 -0
  19. package/dist/types/extensibility/gjc-plugins/state.d.ts +9 -0
  20. package/dist/types/extensibility/gjc-plugins/tools.d.ts +8 -0
  21. package/dist/types/extensibility/gjc-plugins/types.d.ts +64 -0
  22. package/dist/types/extensibility/gjc-plugins/validation.d.ts +4 -0
  23. package/dist/types/extensibility/skills.d.ts +9 -1
  24. package/dist/types/gjc-runtime/state-runtime.d.ts +22 -0
  25. package/dist/types/harness-control-plane/storage.d.ts +7 -0
  26. package/dist/types/lsp/client.d.ts +1 -0
  27. package/dist/types/main.d.ts +10 -1
  28. package/dist/types/modes/bridge/bridge-mode.d.ts +2 -0
  29. package/dist/types/modes/components/custom-provider-wizard.d.ts +10 -0
  30. package/dist/types/modes/components/model-selector.d.ts +6 -1
  31. package/dist/types/modes/components/provider-onboarding-selector.d.ts +1 -1
  32. package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
  33. package/dist/types/modes/prompt-action-autocomplete.d.ts +2 -2
  34. package/dist/types/modes/rpc/rpc-client.d.ts +9 -1
  35. package/dist/types/modes/rpc/rpc-types.d.ts +179 -2
  36. package/dist/types/modes/shared/agent-wire/approval-gate.d.ts +57 -0
  37. package/dist/types/modes/shared/agent-wire/command-dispatch.d.ts +16 -1
  38. package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +47 -0
  39. package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +7 -0
  40. package/dist/types/modes/shared/agent-wire/handshake.d.ts +11 -1
  41. package/dist/types/modes/shared/agent-wire/protocol.d.ts +3 -1
  42. package/dist/types/modes/shared/agent-wire/responses.d.ts +1 -1
  43. package/dist/types/modes/shared/agent-wire/unattended-action-policy.d.ts +27 -0
  44. package/dist/types/modes/shared/agent-wire/unattended-audit.d.ts +68 -0
  45. package/dist/types/modes/shared/agent-wire/unattended-run-controller.d.ts +161 -0
  46. package/dist/types/modes/shared/agent-wire/unattended-session.d.ts +61 -0
  47. package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +114 -0
  48. package/dist/types/modes/shared/agent-wire/workflow-gate-schema.d.ts +39 -0
  49. package/dist/types/modes/theme/theme.d.ts +2 -1
  50. package/dist/types/modes/types.d.ts +1 -0
  51. package/dist/types/runtime-mcp/transports/stdio.d.ts +0 -4
  52. package/dist/types/sdk.d.ts +8 -1
  53. package/dist/types/session/agent-session.d.ts +10 -0
  54. package/dist/types/session/blob-store.d.ts +17 -0
  55. package/dist/types/session/messages.d.ts +3 -0
  56. package/dist/types/session/session-storage.d.ts +6 -0
  57. package/dist/types/skill-state/active-state.d.ts +13 -0
  58. package/dist/types/task/executor.d.ts +1 -0
  59. package/dist/types/thinking.d.ts +3 -2
  60. package/dist/types/tools/hindsight-recall.d.ts +0 -2
  61. package/dist/types/tools/hindsight-reflect.d.ts +0 -2
  62. package/dist/types/tools/hindsight-retain.d.ts +0 -2
  63. package/dist/types/tools/index.d.ts +7 -4
  64. package/package.json +9 -7
  65. package/src/cli/args.ts +10 -0
  66. package/src/cli.ts +14 -0
  67. package/src/commands/harness.ts +192 -7
  68. package/src/commands/launch.ts +8 -0
  69. package/src/commands/ultragoal.ts +1 -21
  70. package/src/config/model-equivalence.ts +1 -1
  71. package/src/config/model-profile-activation.ts +157 -0
  72. package/src/config/model-profiles.ts +155 -0
  73. package/src/config/model-registry.ts +51 -5
  74. package/src/config/model-resolver.ts +3 -2
  75. package/src/config/models-config-schema.ts +42 -1
  76. package/src/config/settings-schema.ts +14 -1
  77. package/src/defaults/gjc/skills/ultragoal/SKILL.md +11 -1
  78. package/src/defaults/gjc/skills/ultragoal/ai-slop-cleaner.md +61 -0
  79. package/src/defaults/gjc-defaults.ts +7 -0
  80. package/src/discovery/claude-plugins.ts +25 -5
  81. package/src/edit/diff.ts +64 -1
  82. package/src/edit/modes/replace.ts +60 -2
  83. package/src/extensibility/gjc-plugins/activation.ts +87 -0
  84. package/src/extensibility/gjc-plugins/index.ts +9 -0
  85. package/src/extensibility/gjc-plugins/injection.ts +114 -0
  86. package/src/extensibility/gjc-plugins/loader.ts +131 -0
  87. package/src/extensibility/gjc-plugins/paths.ts +66 -0
  88. package/src/extensibility/gjc-plugins/schema.ts +79 -0
  89. package/src/extensibility/gjc-plugins/state.ts +29 -0
  90. package/src/extensibility/gjc-plugins/tools.ts +47 -0
  91. package/src/extensibility/gjc-plugins/types.ts +97 -0
  92. package/src/extensibility/gjc-plugins/validation.ts +76 -0
  93. package/src/extensibility/skills.ts +39 -7
  94. package/src/gjc-runtime/state-runtime.ts +93 -2
  95. package/src/gjc-runtime/state-writer.ts +17 -1
  96. package/src/gjc-runtime/ultragoal-runtime.ts +62 -2
  97. package/src/gjc-runtime/workflow-manifest.generated.json +5 -0
  98. package/src/gjc-runtime/workflow-manifest.ts +2 -2
  99. package/src/harness-control-plane/storage.ts +144 -2
  100. package/src/hashline/hash.ts +23 -0
  101. package/src/hooks/skill-state.ts +2 -0
  102. package/src/internal-urls/docs-index.generated.ts +8 -11
  103. package/src/lsp/client.ts +7 -0
  104. package/src/main.ts +67 -1
  105. package/src/modes/acp/acp-agent.ts +25 -2
  106. package/src/modes/bridge/bridge-mode.ts +124 -2
  107. package/src/modes/components/custom-provider-wizard.ts +318 -0
  108. package/src/modes/components/model-selector.ts +108 -18
  109. package/src/modes/components/provider-onboarding-selector.ts +6 -1
  110. package/src/modes/controllers/input-controller.ts +14 -2
  111. package/src/modes/controllers/selector-controller.ts +57 -1
  112. package/src/modes/prompt-action-autocomplete.ts +49 -10
  113. package/src/modes/rpc/rpc-client.ts +57 -3
  114. package/src/modes/rpc/rpc-mode.ts +67 -0
  115. package/src/modes/rpc/rpc-types.ts +224 -2
  116. package/src/modes/shared/agent-wire/approval-gate.ts +151 -0
  117. package/src/modes/shared/agent-wire/command-dispatch.ts +97 -4
  118. package/src/modes/shared/agent-wire/command-validation.ts +25 -1
  119. package/src/modes/shared/agent-wire/deep-interview-gate.ts +222 -0
  120. package/src/modes/shared/agent-wire/event-envelope.ts +13 -0
  121. package/src/modes/shared/agent-wire/handshake.ts +43 -3
  122. package/src/modes/shared/agent-wire/protocol.ts +7 -0
  123. package/src/modes/shared/agent-wire/responses.ts +2 -2
  124. package/src/modes/shared/agent-wire/scopes.ts +2 -0
  125. package/src/modes/shared/agent-wire/unattended-action-policy.ts +341 -0
  126. package/src/modes/shared/agent-wire/unattended-audit.ts +175 -0
  127. package/src/modes/shared/agent-wire/unattended-run-controller.ts +406 -0
  128. package/src/modes/shared/agent-wire/unattended-session.ts +180 -0
  129. package/src/modes/shared/agent-wire/workflow-gate-broker.ts +324 -0
  130. package/src/modes/shared/agent-wire/workflow-gate-schema.ts +331 -0
  131. package/src/modes/theme/theme.ts +6 -0
  132. package/src/modes/types.ts +1 -0
  133. package/src/prompts/memories/consolidation.md +1 -1
  134. package/src/prompts/memories/read-path.md +6 -7
  135. package/src/prompts/memories/unavailable.md +2 -2
  136. package/src/prompts/tools/bash.md +1 -1
  137. package/src/prompts/tools/irc.md +1 -1
  138. package/src/prompts/tools/read.md +2 -2
  139. package/src/prompts/tools/recall.md +1 -0
  140. package/src/prompts/tools/reflect.md +1 -0
  141. package/src/prompts/tools/retain.md +1 -0
  142. package/src/runtime-mcp/client.ts +7 -4
  143. package/src/runtime-mcp/manager.ts +45 -13
  144. package/src/runtime-mcp/transports/http.ts +40 -14
  145. package/src/runtime-mcp/transports/stdio.ts +11 -10
  146. package/src/sdk.ts +48 -1
  147. package/src/session/agent-session.ts +211 -2
  148. package/src/session/blob-store.ts +84 -0
  149. package/src/session/messages.ts +3 -0
  150. package/src/session/session-manager.ts +390 -33
  151. package/src/session/session-storage.ts +26 -0
  152. package/src/setup/provider-onboarding.ts +2 -2
  153. package/src/skill-state/active-state.ts +89 -1
  154. package/src/slash-commands/builtin-registry.ts +1 -1
  155. package/src/task/discovery.ts +7 -1
  156. package/src/task/executor.ts +18 -2
  157. package/src/task/index.ts +2 -0
  158. package/src/thinking.ts +8 -2
  159. package/src/tools/ask.ts +39 -9
  160. package/src/tools/hindsight-recall.ts +0 -2
  161. package/src/tools/hindsight-reflect.ts +0 -2
  162. package/src/tools/hindsight-retain.ts +0 -2
  163. package/src/tools/index.ts +7 -18
  164. package/src/tools/read.ts +3 -3
  165. package/src/tools/skill.ts +15 -3
  166. package/src/utils/edit-mode.ts +1 -1
@@ -49,6 +49,13 @@ export interface CreateAgentSessionOptions {
49
49
  providerSessionId?: string;
50
50
  /** Custom tools to register (in addition to built-in tools). Accepts both CustomTool and ToolDefinition. */
51
51
  customTools?: (CustomTool | ToolDefinition)[];
52
+ /** Explicit parent/phase used to load active GJC sub-skill tools for this session. */
53
+ gjcSubskillToolContext?: {
54
+ parent: string;
55
+ phase: string;
56
+ sessionId?: string;
57
+ cwd?: string;
58
+ };
52
59
  /** Inline extensions (merged with discovery). */
53
60
  extensions?: ExtensionFactory[];
54
61
  /** Additional extension paths to load (merged with discovery). */
@@ -95,7 +102,7 @@ export interface CreateAgentSessionOptions {
95
102
  taskDepth?: number;
96
103
  /** Current role-agent type/name for nested task sessions. */
97
104
  currentAgentType?: string;
98
- /** Parent Hindsight state to alias for subagent memory tools. */
105
+ /** Parent Hindsight state to alias for subagent private memory backend compatibility. */
99
106
  parentHindsightSessionState?: HindsightSessionState;
100
107
  /** Pre-allocated agent identity for IRC routing. Default: "0-Main" for top-level, parentTaskPrefix-derived for sub. */
101
108
  agentId?: string;
@@ -57,11 +57,13 @@ import { type FileSlashCommand } from "../extensibility/slash-commands";
57
57
  import { GoalRuntime } from "../goals/runtime";
58
58
  import type { Goal, GoalModeState } from "../goals/state";
59
59
  import type { HindsightSessionState } from "../hindsight/state";
60
+ import type { WorkflowGateEmitter } from "../modes/shared/agent-wire/unattended-session";
60
61
  import type { PlanModeState } from "../plan-mode/state";
61
62
  import { type AgentRegistry } from "../registry/agent-registry";
62
63
  import { type DiscoverableMCPSearchIndex, type DiscoverableMCPTool } from "../runtime-mcp/discoverable-tool-metadata";
63
64
  import { type SecretObfuscator } from "../secrets/obfuscator";
64
65
  import { type DiscoverableTool, type DiscoverableToolSearchIndex } from "../tool-discovery/tool-index";
66
+ import type { ToolSession } from "../tools";
65
67
  import type { CheckpointState } from "../tools/checkpoint";
66
68
  import { type TodoItem, type TodoPhase } from "../tools/todo-write";
67
69
  import type { ClientBridge } from "./client-bridge";
@@ -166,6 +168,8 @@ export interface AgentSessionConfig {
166
168
  taskDepth?: number;
167
169
  /** Tool registry for LSP and settings */
168
170
  toolRegistry?: Map<string, AgentTool>;
171
+ /** Tool-session factory context used to lazily attach workflow-gate-only tools. */
172
+ workflowGateToolSession?: ToolSession;
169
173
  /** Current session pre-LLM message transform pipeline */
170
174
  transformContext?: (messages: AgentMessage[], signal?: AbortSignal) => AgentMessage[] | Promise<AgentMessage[]>;
171
175
  /** Provider payload hook used by the active session request path */
@@ -459,6 +463,10 @@ export declare class AgentSession {
459
463
  * Replace RPC host-owned tools and refresh the active tool set before the next model call.
460
464
  */
461
465
  refreshRpcHostTools(rpcTools: AgentTool[]): Promise<void>;
466
+ /**
467
+ * Refresh plugin sub-skill tools after workflow/sub-skill activation or phase changes.
468
+ */
469
+ refreshGjcSubskillTools(): Promise<void>;
462
470
  /** Whether auto-compaction is currently running */
463
471
  get isCompacting(): boolean;
464
472
  /**
@@ -496,6 +504,8 @@ export declare class AgentSession {
496
504
  setPlanModeState(state: PlanModeState | undefined): void;
497
505
  getGoalModeState(): GoalModeState | undefined;
498
506
  setGoalModeState(state: GoalModeState | undefined): void;
507
+ getWorkflowGateEmitter(): WorkflowGateEmitter | undefined;
508
+ setWorkflowGateEmitter(emitter: WorkflowGateEmitter | undefined): void;
499
509
  get goalRuntime(): GoalRuntime;
500
510
  markPlanReferenceSent(): void;
501
511
  setPlanReferencePath(path: string): void;
@@ -26,9 +26,20 @@ export declare class BlobStore {
26
26
  putSync(data: Buffer): BlobPutResult;
27
27
  /** Read blob by hash, returns Buffer or null if not found. */
28
28
  get(hash: string): Promise<Buffer | null>;
29
+ /** Synchronously read blob by hash, returns Buffer or null if not found. */
30
+ getSync(hash: string): Buffer | null;
29
31
  /** Check if a blob exists. */
30
32
  has(hash: string): Promise<boolean>;
31
33
  }
34
+ export declare class MemoryBlobStore extends BlobStore {
35
+ #private;
36
+ constructor();
37
+ put(data: Buffer): Promise<BlobPutResult>;
38
+ putSync(data: Buffer): BlobPutResult;
39
+ get(hash: string): Promise<Buffer | null>;
40
+ getSync(hash: string): Buffer | null;
41
+ has(hash: string): Promise<boolean>;
42
+ }
32
43
  /** Check if a data string is a blob reference. */
33
44
  export declare function isBlobRef(data: string): boolean;
34
45
  /** Extract the SHA-256 hash from a blob reference string. */
@@ -61,3 +72,9 @@ export declare function resolveImageDataUrl(blobStore: BlobStore, data: string):
61
72
  * If the blob is missing, logs a warning and returns a placeholder.
62
73
  */
63
74
  export declare function resolveImageData(blobStore: BlobStore, data: string): Promise<string>;
75
+ /** Synchronously resolve an externalized provider image data URL back to its original string. */
76
+ export declare function resolveImageDataUrlSync(blobStore: BlobStore, data: string): string;
77
+ /** Synchronously resolve a blob reference back to base64 data. */
78
+ export declare function resolveImageDataSync(blobStore: BlobStore, data: string): string;
79
+ /** Synchronously resolve a blob reference back to utf8 text. */
80
+ export declare function resolveTextBlobSync(blobStore: BlobStore, data: string): string;
@@ -8,6 +8,7 @@ import type { AgentMessage } from "@gajae-code/agent-core";
8
8
  import { type BranchSummaryMessage, type CompactionSummaryMessage } from "@gajae-code/agent-core/compaction/messages";
9
9
  import type { AssistantMessage, ImageContent, Message, MessageAttribution, TextContent } from "@gajae-code/ai";
10
10
  export { type BranchSummaryMessage, type CompactionSummaryMessage, createBranchSummaryMessage, createCompactionSummaryMessage, } from "@gajae-code/agent-core/compaction/messages";
11
+ import type { LoadedSubskillActivation } from "../extensibility/gjc-plugins";
11
12
  import type { OutputMeta } from "../tools/output-meta";
12
13
  export declare const SKILL_PROMPT_MESSAGE_TYPE = "skill-prompt";
13
14
  export interface SkillPromptDetails {
@@ -15,6 +16,8 @@ export interface SkillPromptDetails {
15
16
  path: string;
16
17
  args?: string;
17
18
  lineCount: number;
19
+ subskillActivation?: LoadedSubskillActivation;
20
+ subskillActivationSet?: LoadedSubskillActivation[];
18
21
  /** Internal: tag used by AgentSession to remove the pending-display chip
19
22
  * from `#steeringMessages` / `#followUpMessages` when the agent consumes
20
23
  * this message. Not surfaced to renderers; the `__` prefix signals
@@ -30,7 +30,9 @@ export interface SessionStorage {
30
30
  readTextPrefix(path: string, maxBytes: number): Promise<string>;
31
31
  writeText(path: string, content: string): Promise<void>;
32
32
  rename(path: string, nextPath: string): Promise<void>;
33
+ renameSync(path: string, nextPath: string): void;
33
34
  unlink(path: string): Promise<void>;
35
+ unlinkSync(path: string): void;
34
36
  deleteSessionWithArtifacts(sessionPath: string): Promise<void>;
35
37
  openWriter(path: string, options?: {
36
38
  flags?: "a" | "w";
@@ -49,7 +51,9 @@ export declare class FileSessionStorage implements SessionStorage {
49
51
  readTextPrefix(path: string, maxBytes: number): Promise<string>;
50
52
  writeText(path: string, content: string): Promise<void>;
51
53
  rename(path: string, nextPath: string): Promise<void>;
54
+ renameSync(path: string, nextPath: string): void;
52
55
  unlink(path: string): Promise<void>;
56
+ unlinkSync(path: string): void;
53
57
  openWriter(path: string, options?: {
54
58
  flags?: "a" | "w";
55
59
  onError?: (err: Error) => void;
@@ -73,7 +77,9 @@ export declare class MemorySessionStorage implements SessionStorage {
73
77
  readTextPrefix(path: string, maxBytes: number): Promise<string>;
74
78
  writeText(path: string, content: string): Promise<void>;
75
79
  rename(path: string, nextPath: string): Promise<void>;
80
+ renameSync(path: string, nextPath: string): void;
76
81
  unlink(path: string): Promise<void>;
82
+ unlinkSync(path: string): void;
77
83
  deleteSessionWithArtifacts(_sessionPath: string): Promise<void>;
78
84
  openWriter(path: string, options?: {
79
85
  flags?: "a" | "w";
@@ -18,6 +18,16 @@ export interface WorkflowHudSummary {
18
18
  updated_at?: string;
19
19
  }
20
20
  export type { WorkflowStateReceipt } from "./workflow-state-contract";
21
+ export interface ActiveSubskillEntry {
22
+ plugin: string;
23
+ subskillName: string;
24
+ parent: string;
25
+ bindsTo: string;
26
+ phase: string;
27
+ activationArg: string;
28
+ filePath: string;
29
+ toolPaths: string[];
30
+ }
21
31
  export interface SkillActiveEntry {
22
32
  skill: string;
23
33
  phase?: string;
@@ -33,6 +43,7 @@ export interface SkillActiveEntry {
33
43
  handoff_from?: string;
34
44
  handoff_to?: string;
35
45
  handoff_at?: string;
46
+ active_subskills?: ActiveSubskillEntry[];
36
47
  }
37
48
  export interface SkillActiveState {
38
49
  version?: number;
@@ -49,6 +60,7 @@ export interface SkillActiveState {
49
60
  initialized_mode?: CanonicalGjcWorkflowSkill;
50
61
  initialized_state_path?: string;
51
62
  active_skills?: SkillActiveEntry[];
63
+ active_subskills?: ActiveSubskillEntry[];
52
64
  [key: string]: unknown;
53
65
  }
54
66
  export interface SkillActiveStatePaths {
@@ -70,6 +82,7 @@ export interface SyncSkillActiveStateOptions {
70
82
  handoff_from?: string;
71
83
  handoff_to?: string;
72
84
  handoff_at?: string;
85
+ active_subskills?: ActiveSubskillEntry[];
73
86
  }
74
87
  export declare function normalizeWorkflowHudSummary(raw: unknown): WorkflowHudSummary | undefined;
75
88
  export declare function isCanonicalGjcWorkflowSkill(skill: string): skill is CanonicalGjcWorkflowSkill;
@@ -37,6 +37,7 @@ export interface ExecutorOptions {
37
37
  * if the resolved subagent model has no working credentials. See #985.
38
38
  */
39
39
  parentActiveModelPattern?: string;
40
+ parentSessionId?: string;
40
41
  thinkingLevel?: ThinkingLevel;
41
42
  outputSchema?: unknown;
42
43
  /** Parent task recursion depth (0 = top-level, 1 = first child, etc.) */
@@ -1,5 +1,6 @@
1
- import { type ResolvedThinkingLevel, ThinkingLevel } from "@gajae-code/agent-core";
2
- import { type Effort, type Model } from "@gajae-code/ai";
1
+ import { type ResolvedThinkingLevel, ThinkingLevel } from "@gajae-code/agent-core/thinking";
2
+ import { type Effort } from "@gajae-code/ai/model-thinking";
3
+ import type { Model } from "@gajae-code/ai/types";
3
4
  /**
4
5
  * Metadata used to render thinking selector values in the coding-agent UI.
5
6
  */
@@ -14,8 +14,6 @@ export declare class HindsightRecallTool implements AgentTool<typeof hindsightRe
14
14
  query: z.ZodString;
15
15
  }, z.core.$strip>;
16
16
  readonly strict = true;
17
- readonly loadMode = "discoverable";
18
- readonly summary = "Search hindsight memory for relevant prior context";
19
17
  constructor(session: ToolSession);
20
18
  static createIf(session: ToolSession): HindsightRecallTool | null;
21
19
  execute(_id: string, params: HindsightRecallParams, signal?: AbortSignal): Promise<AgentToolResult>;
@@ -16,8 +16,6 @@ export declare class HindsightReflectTool implements AgentTool<typeof hindsightR
16
16
  context: z.ZodOptional<z.ZodString>;
17
17
  }, z.core.$strip>;
18
18
  readonly strict = true;
19
- readonly loadMode = "discoverable";
20
- readonly summary = "Reflect on recent work and write hindsight memory";
21
19
  constructor(session: ToolSession);
22
20
  static createIf(session: ToolSession): HindsightReflectTool | null;
23
21
  execute(_id: string, params: HindsightReflectParams, signal?: AbortSignal): Promise<AgentToolResult>;
@@ -20,8 +20,6 @@ export declare class HindsightRetainTool implements AgentTool<typeof hindsightRe
20
20
  }, z.core.$strip>>;
21
21
  }, z.core.$strip>;
22
22
  readonly strict = true;
23
- readonly loadMode = "discoverable";
24
- readonly summary = "Store important facts in hindsight memory";
25
23
  constructor(session: ToolSession);
26
24
  static createIf(session: ToolSession): HindsightRetainTool | null;
27
25
  execute(_id: string, params: HindsightRetainParams): Promise<AgentToolResult>;
@@ -5,6 +5,7 @@ import type { Settings } from "../config/settings";
5
5
  import type { Skill } from "../extensibility/skills";
6
6
  import type { GoalModeState, GoalRuntime } from "../goals";
7
7
  import type { HindsightSessionState } from "../hindsight/state";
8
+ import type { WorkflowGateEmitter } from "../modes/shared/agent-wire/unattended-session";
8
9
  import type { PlanModeState } from "../plan-mode/state";
9
10
  import type { AgentRegistry } from "../registry/agent-registry";
10
11
  import type { ForkContextSeed, ForkContextSeedOptions } from "../session/agent-session";
@@ -37,9 +38,6 @@ export * from "./debug";
37
38
  export * from "./eval";
38
39
  export * from "./find";
39
40
  export * from "./gh";
40
- export * from "./hindsight-recall";
41
- export * from "./hindsight-reflect";
42
- export * from "./hindsight-retain";
43
41
  export * from "./image-gen";
44
42
  export * from "./inspect-image";
45
43
  export * from "./irc";
@@ -153,6 +151,8 @@ export interface ToolSession {
153
151
  getPlanModeState?: () => PlanModeState | undefined;
154
152
  /** Goal mode state (if active or paused) */
155
153
  getGoalModeState?: () => GoalModeState | undefined;
154
+ /** Unattended workflow-gate emitter (present only when unattended mode is negotiated). */
155
+ getWorkflowGateEmitter?: () => WorkflowGateEmitter | undefined;
156
156
  /** Goal runtime for the active agent session. */
157
157
  getGoalRuntime?: () => GoalRuntime | undefined;
158
158
  /** Bridge to the connected client (e.g. ACP editor host). Tools should route fs/terminal/permission requests through this when available. */
@@ -245,7 +245,10 @@ export declare const DEFAULT_ESSENTIAL_TOOL_NAMES: readonly string[];
245
245
  export declare function computeEssentialBuiltinNames(settings: Settings): string[];
246
246
  /**
247
247
  * Public callable factory map. External callers may invoke `BUILTIN_TOOLS.read(session)` or
248
- * `BUILTIN_TOOLS[name](session)` to construct a tool directly.
248
+ * `BUILTIN_TOOLS[name](session)` to construct a public coding-harness tool directly.
249
+ *
250
+ * Hindsight memory helpers are intentionally excluded: memory is a private backend
251
+ * integration, not a public gajae-code tool surface.
249
252
  */
250
253
  export declare const BUILTIN_TOOLS: Record<string, ToolFactory>;
251
254
  export declare const HIDDEN_TOOLS: Record<string, ToolFactory>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/coding-agent",
4
- "version": "0.3.1",
4
+ "version": "0.4.0",
5
5
  "description": "Gajae Code CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://gaebal-gajae.dev",
7
7
  "author": "Yeachan-Heo",
@@ -36,6 +36,8 @@
36
36
  "check:types": "tsgo -p tsconfig.json --noEmit",
37
37
  "lint": "biome lint .",
38
38
  "test": "bun test",
39
+ "generate-schemas": "bun ../../scripts/generate-json-schemas.ts",
40
+ "check:schemas": "bun ../../scripts/generate-json-schemas.ts --check",
39
41
  "fix": "biome check --write --unsafe . && bun run format-prompts && bun run generate-docs-index",
40
42
  "fmt": "biome format --write . && bun run format-prompts",
41
43
  "format-prompts": "bun scripts/format-prompts.ts",
@@ -48,12 +50,12 @@
48
50
  "@agentclientprotocol/sdk": "0.21.0",
49
51
  "@babel/parser": "^7.29.3",
50
52
  "@mozilla/readability": "^0.6.0",
51
- "@gajae-code/stats": "0.3.1",
52
- "@gajae-code/agent-core": "0.3.1",
53
- "@gajae-code/ai": "0.3.1",
54
- "@gajae-code/natives": "0.3.1",
55
- "@gajae-code/tui": "0.3.1",
56
- "@gajae-code/utils": "0.3.1",
53
+ "@gajae-code/stats": "0.4.0",
54
+ "@gajae-code/agent-core": "0.4.0",
55
+ "@gajae-code/ai": "0.4.0",
56
+ "@gajae-code/natives": "0.4.0",
57
+ "@gajae-code/tui": "0.4.0",
58
+ "@gajae-code/utils": "0.4.0",
57
59
  "@puppeteer/browsers": "^2.13.0",
58
60
  "@types/turndown": "5.0.6",
59
61
  "@xterm/headless": "^6.0.0",
package/src/cli/args.ts CHANGED
@@ -17,6 +17,8 @@ export interface Args {
17
17
  smol?: string;
18
18
  slow?: string;
19
19
  plan?: string;
20
+ mpreset?: string;
21
+ default?: boolean;
20
22
  apiKey?: string;
21
23
  systemPrompt?: string;
22
24
  appendSystemPrompt?: string;
@@ -127,6 +129,10 @@ export function parseArgs(args: string[]): Args {
127
129
  result.slow = args[++i];
128
130
  } else if (arg === "--plan" && i + 1 < args.length) {
129
131
  result.plan = args[++i];
132
+ } else if (arg === "--mpreset" && i + 1 < args.length) {
133
+ result.mpreset = args[++i];
134
+ } else if (arg === "--default") {
135
+ result.default = true;
130
136
  } else if (arg === "--api-key" && i + 1 < args.length) {
131
137
  result.apiKey = args[++i];
132
138
  } else if (arg === "--system-prompt" && i + 1 < args.length) {
@@ -199,6 +205,10 @@ export function parseArgs(args: string[]): Args {
199
205
  }
200
206
  }
201
207
 
208
+ if (result.default && !result.mpreset) {
209
+ throw new Error("--default requires --mpreset <name>");
210
+ }
211
+
202
212
  return result;
203
213
  }
204
214
 
package/src/cli.ts CHANGED
@@ -84,6 +84,20 @@ function isSubcommand(first: string | undefined): boolean {
84
84
  async function runSmokeTest(): Promise<void> {
85
85
  const { smokeTestSyncWorker } = await import("@gajae-code/stats");
86
86
  await smokeTestSyncWorker();
87
+ // Prove the embedded native addon extracts and the new perf exports resolve in
88
+ // the COMPILED single binary (dev runs only load the on-disk .node). Loading the
89
+ // natives module triggers loadNative()/embedded extraction; calling each new
90
+ // export confirms the symbols are present in the shipped binary.
91
+ const { h06FormatHashLines, h02ScoreSequenceFuzzy, h01FindBestFuzzyMatch } = await import(
92
+ "../../natives/native/index.js"
93
+ );
94
+ const hashed = h06FormatHashLines("a\nb", 1);
95
+ if (hashed.split("\n").length !== 2) {
96
+ throw new Error(`smoke-test: h06FormatHashLines returned unexpected output: ${JSON.stringify(hashed)}`);
97
+ }
98
+ if (typeof h02ScoreSequenceFuzzy !== "function" || typeof h01FindBestFuzzyMatch !== "function") {
99
+ throw new Error("smoke-test: native fuzzy exports missing from embedded addon");
100
+ }
87
101
  process.stdout.write("smoke-test: ok\n");
88
102
  }
89
103