@gajae-code/coding-agent 0.11.4 → 0.11.5
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.
- package/CHANGELOG.md +23 -0
- package/dist/types/cli/notify-cli.d.ts +5 -1
- package/dist/types/config/settings-schema.d.ts +20 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/gjc-runtime/deep-interview-state.d.ts +28 -0
- package/dist/types/gjc-runtime/launch-tmux.d.ts +3 -0
- package/dist/types/gjc-runtime/managed-owner-admission.d.ts +42 -0
- package/dist/types/gjc-runtime/managed-owner-supervisor.d.ts +41 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +9 -0
- package/dist/types/gjc-runtime/ultragoal-owner-loss-recovery.d.ts +94 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +1 -0
- package/dist/types/harness-control-plane/owner.d.ts +3 -1
- package/dist/types/internal-urls/local-protocol.d.ts +18 -0
- package/dist/types/main.d.ts +2 -2
- package/dist/types/modes/components/ansi-display-validator.d.ts +2 -0
- package/dist/types/modes/components/notifications-settings-editor.d.ts +4 -0
- package/dist/types/modes/components/session-observer-overlay.d.ts +3 -1
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/tool-transcript-format.d.ts +58 -0
- package/dist/types/modes/components/transcript-viewer-overlay.d.ts +3 -0
- package/dist/types/modes/controllers/goal-mode-controller.d.ts +8 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +15 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +3 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +16 -0
- package/dist/types/plan-mode/approved-plan.d.ts +1 -0
- package/dist/types/runtime-mcp/manager.d.ts +2 -0
- package/dist/types/runtime-mcp/oauth-discovery.d.ts +12 -1
- package/dist/types/sdk/bus/chat-daemon-cli.d.ts +3 -1
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +39 -4
- package/dist/types/sdk/bus/config-commands.d.ts +8 -0
- package/dist/types/sdk/bus/config.d.ts +22 -0
- package/dist/types/sdk/bus/index.d.ts +162 -2
- package/dist/types/sdk/bus/notification-service.d.ts +71 -8
- package/dist/types/sdk/bus/session-control.d.ts +11 -8
- package/dist/types/sdk/bus/telegram-daemon-cli.d.ts +5 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +6 -3
- package/dist/types/sdk/bus/telegram-daemon-control.d.ts +23 -4
- package/dist/types/sdk/bus/telegram-daemon.d.ts +214 -20
- package/dist/types/sdk/session.d.ts +16 -1
- package/dist/types/secrets/index.d.ts +4 -2
- package/dist/types/secrets/obfuscator.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +31 -2
- package/dist/types/session/artifacts.d.ts +30 -8
- package/dist/types/session/internal/managed-session-scope.d.ts +7 -0
- package/dist/types/session/internal/managed-session-storage.d.ts +63 -6
- package/dist/types/session/session-manager.d.ts +88 -18
- package/dist/types/session/session-storage.d.ts +27 -0
- package/dist/types/session/streaming-output.d.ts +4 -0
- package/dist/types/task/executor.d.ts +9 -0
- package/dist/types/tool-discovery/tool-index.d.ts +2 -0
- package/dist/types/tools/ask.d.ts +48 -0
- package/dist/types/tools/bash-skill-urls.d.ts +2 -2
- package/dist/types/tools/index.d.ts +4 -0
- package/package.json +9 -9
- package/scripts/generate-sdk-operation-inventory.ts +2 -0
- package/src/cli/notify-cli.ts +40 -18
- package/src/commands/sdk.ts +7 -2
- package/src/config/settings-schema.ts +17 -0
- package/src/daemon/runtime.ts +2 -2
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +70 -49
- package/src/defaults/gjc/skills/ralplan/SKILL.md +0 -6
- package/src/defaults/gjc/skills/team/SKILL.md +7 -9
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +0 -2
- package/src/eval/py/index.ts +2 -2
- package/src/export/html/template.generated.ts +1 -1
- package/src/extensibility/plugins/marketplace/manager.ts +94 -10
- package/src/gjc-runtime/deep-interview-recorder.ts +7 -0
- package/src/gjc-runtime/deep-interview-runtime.ts +10 -0
- package/src/gjc-runtime/deep-interview-state.ts +127 -3
- package/src/gjc-runtime/launch-tmux.ts +61 -6
- package/src/gjc-runtime/managed-owner-admission.ts +352 -0
- package/src/gjc-runtime/managed-owner-supervisor.ts +162 -0
- package/src/gjc-runtime/state-runtime.ts +38 -12
- package/src/gjc-runtime/team-runtime.ts +1 -1
- package/src/gjc-runtime/tmux-owner-isolation.ts +117 -0
- package/src/gjc-runtime/ultragoal-owner-loss-recovery.ts +328 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +14 -0
- package/src/harness-control-plane/owner.ts +59 -3
- package/src/hindsight/client.ts +65 -2
- package/src/internal-urls/agent-protocol.ts +76 -5
- package/src/internal-urls/docs-index.generated.ts +7 -6
- package/src/internal-urls/local-protocol.ts +416 -18
- package/src/lsp/index.ts +4 -88
- package/src/main.ts +37 -13
- package/src/modes/acp/acp-agent.ts +8 -0
- package/src/modes/components/ansi-display-validator.ts +54 -0
- package/src/modes/components/notifications-settings-editor.ts +26 -2
- package/src/modes/components/session-observer-overlay.ts +40 -24
- package/src/modes/components/settings-selector.ts +3 -1
- package/src/modes/components/tool-transcript-format.ts +321 -0
- package/src/modes/components/transcript-viewer-overlay.ts +39 -17
- package/src/modes/controllers/goal-mode-controller.ts +20 -1
- package/src/modes/controllers/plan-mode-controller.ts +2 -0
- package/src/modes/controllers/runtime-mcp-command-controller.ts +3 -0
- package/src/modes/controllers/selector-controller.ts +70 -8
- package/src/modes/interactive-mode.ts +1 -0
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +31 -1
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +17 -1
- package/src/modes/shared/agent-wire/workflow-gate-schema.ts +4 -2
- package/src/modes/shared/agent-wire/workflow-gate-types.ts +120 -3
- package/src/plan-mode/approved-plan.ts +3 -1
- package/src/prompts/agents/architect.md +1 -0
- package/src/prompts/agents/critic.md +1 -0
- package/src/prompts/system/custom-system-prompt.md +1 -1
- package/src/prompts/system/system-prompt.md +2 -1
- package/src/prompts/tools/lsp.md +3 -3
- package/src/runtime-mcp/manager.ts +16 -1
- package/src/runtime-mcp/oauth-discovery.ts +116 -26
- package/src/sdk/broker/session-index.ts +122 -64
- package/src/sdk/bus/chat-daemon-cli.ts +72 -10
- package/src/sdk/bus/chat-daemon-control.ts +526 -130
- package/src/sdk/bus/chat-daemon-runtime.ts +1 -0
- package/src/sdk/bus/config-commands.ts +22 -0
- package/src/sdk/bus/config.ts +37 -0
- package/src/sdk/bus/index.ts +384 -92
- package/src/sdk/bus/lifecycle-control-runtime.ts +53 -3
- package/src/sdk/bus/notification-service.ts +284 -62
- package/src/sdk/bus/recent-activity.ts +14 -5
- package/src/sdk/bus/session-control.ts +150 -44
- package/src/sdk/bus/telegram-daemon-cli.ts +20 -14
- package/src/sdk/bus/telegram-daemon-contract.ts +6 -3
- package/src/sdk/bus/telegram-daemon-control.ts +294 -76
- package/src/sdk/bus/telegram-daemon.ts +1788 -267
- package/src/sdk/protocol/operation-inventory.generated.json +11 -0
- package/src/sdk/session.ts +155 -27
- package/src/secrets/index.ts +53 -10
- package/src/secrets/obfuscator.ts +21 -18
- package/src/secrets/regex.ts +2 -0
- package/src/session/agent-session.ts +495 -253
- package/src/session/artifacts.ts +188 -23
- package/src/session/context-estimation.ts +7 -2
- package/src/session/internal/managed-session-scope.ts +200 -38
- package/src/session/internal/managed-session-storage.ts +1152 -46
- package/src/session/session-manager.ts +1055 -148
- package/src/session/session-storage.ts +109 -11
- package/src/session/streaming-output.ts +6 -0
- package/src/task/executor.ts +71 -26
- package/src/task/index.ts +63 -20
- package/src/tool-discovery/tool-index.ts +18 -0
- package/src/tools/ask.ts +129 -32
- package/src/tools/bash-skill-urls.ts +14 -3
- package/src/tools/bash.ts +2 -2
- package/src/tools/index.ts +4 -0
- package/src/tools/plan-mode-guard.ts +1 -0
- package/src/tools/sqlite-reader.ts +3 -2
- package/src/tools/subagent.ts +2 -0
|
@@ -27,6 +27,56 @@ interface AgentOutputMetadata {
|
|
|
27
27
|
createdAt: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
interface ManagedOutputSelector {
|
|
31
|
+
outputFilename: string;
|
|
32
|
+
metadataFilename: string;
|
|
33
|
+
outputSizeBytes: number;
|
|
34
|
+
outputSha256: string;
|
|
35
|
+
metadataSizeBytes: number;
|
|
36
|
+
metadataSha256: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isSafeGenerationFilename(filename: unknown): filename is string {
|
|
40
|
+
return typeof filename === "string" && /^[a-zA-Z0-9_.-]+$/.test(filename);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isManagedOutputSelector(value: unknown, outputId: string): value is ManagedOutputSelector {
|
|
44
|
+
if (!value || typeof value !== "object") return false;
|
|
45
|
+
const selector = value as Record<string, unknown>;
|
|
46
|
+
return (
|
|
47
|
+
isSafeGenerationFilename(selector.outputFilename) &&
|
|
48
|
+
isSafeGenerationFilename(selector.metadataFilename) &&
|
|
49
|
+
selector.outputFilename.startsWith(`${outputId}.md.`) &&
|
|
50
|
+
selector.outputFilename.endsWith(".output") &&
|
|
51
|
+
selector.metadataFilename === `${selector.outputFilename}.meta.json` &&
|
|
52
|
+
typeof selector.outputSizeBytes === "number" &&
|
|
53
|
+
typeof selector.outputSha256 === "string" &&
|
|
54
|
+
typeof selector.metadataSizeBytes === "number" &&
|
|
55
|
+
typeof selector.metadataSha256 === "string"
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function readManagedOutputSelector(
|
|
60
|
+
outputId: string,
|
|
61
|
+
selectorPath: string,
|
|
62
|
+
): Promise<ManagedOutputSelector | null> {
|
|
63
|
+
let raw: string;
|
|
64
|
+
try {
|
|
65
|
+
raw = await Bun.file(selectorPath).text();
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (isEnoent(error)) return null;
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
let parsed: unknown;
|
|
71
|
+
try {
|
|
72
|
+
parsed = JSON.parse(raw);
|
|
73
|
+
} catch {
|
|
74
|
+
throw new Error(`agent://${outputId} malformed output selector`);
|
|
75
|
+
}
|
|
76
|
+
if (!isManagedOutputSelector(parsed, outputId)) throw new Error(`agent://${outputId} malformed output selector`);
|
|
77
|
+
return parsed;
|
|
78
|
+
}
|
|
79
|
+
|
|
30
80
|
function isAgentOutputMetadata(value: unknown, outputId: string): value is AgentOutputMetadata {
|
|
31
81
|
if (!value || typeof value !== "object") return false;
|
|
32
82
|
const meta = value as Record<string, unknown>;
|
|
@@ -40,11 +90,16 @@ function isAgentOutputMetadata(value: unknown, outputId: string): value is Agent
|
|
|
40
90
|
);
|
|
41
91
|
}
|
|
42
92
|
|
|
43
|
-
async function verifyAgentOutputMetadata(
|
|
44
|
-
|
|
93
|
+
async function verifyAgentOutputMetadata(
|
|
94
|
+
outputId: string,
|
|
95
|
+
foundPath: string,
|
|
96
|
+
metadataPath: string,
|
|
97
|
+
bytes: Buffer,
|
|
98
|
+
selector?: ManagedOutputSelector,
|
|
99
|
+
): Promise<void> {
|
|
45
100
|
let metaRaw: string;
|
|
46
101
|
try {
|
|
47
|
-
metaRaw = await Bun.file(
|
|
102
|
+
metaRaw = await Bun.file(metadataPath).text();
|
|
48
103
|
} catch (err) {
|
|
49
104
|
if (isEnoent(err)) throw new Error(`agent://${outputId} missing metadata`);
|
|
50
105
|
throw err;
|
|
@@ -58,6 +113,7 @@ async function verifyAgentOutputMetadata(outputId: string, foundPath: string, by
|
|
|
58
113
|
if (!isAgentOutputMetadata(parsed, outputId)) {
|
|
59
114
|
throw new Error(`agent://${outputId} malformed metadata`);
|
|
60
115
|
}
|
|
116
|
+
const metadataBytes = Buffer.from(metaRaw, "utf8");
|
|
61
117
|
const stat = await fs.stat(foundPath);
|
|
62
118
|
if (stat.size !== parsed.sizeBytes || bytes.byteLength !== parsed.sizeBytes) {
|
|
63
119
|
throw new Error(`agent://${outputId} size mismatch`);
|
|
@@ -66,6 +122,15 @@ async function verifyAgentOutputMetadata(outputId: string, foundPath: string, by
|
|
|
66
122
|
if (sha256 !== parsed.sha256) {
|
|
67
123
|
throw new Error(`agent://${outputId} hash mismatch`);
|
|
68
124
|
}
|
|
125
|
+
if (
|
|
126
|
+
selector &&
|
|
127
|
+
(selector.outputSizeBytes !== bytes.byteLength ||
|
|
128
|
+
selector.outputSha256 !== sha256 ||
|
|
129
|
+
selector.metadataSizeBytes !== metadataBytes.byteLength ||
|
|
130
|
+
selector.metadataSha256 !== createHash("sha256").update(metadataBytes).digest("hex"))
|
|
131
|
+
) {
|
|
132
|
+
throw new Error(`agent://${outputId} selected generation mismatch`);
|
|
133
|
+
}
|
|
69
134
|
}
|
|
70
135
|
/**
|
|
71
136
|
* Handler for agent:// URLs.
|
|
@@ -105,6 +170,8 @@ export class AgentProtocolHandler implements ProtocolHandler {
|
|
|
105
170
|
}
|
|
106
171
|
|
|
107
172
|
let foundPath: string | undefined;
|
|
173
|
+
let foundMetadataPath: string | undefined;
|
|
174
|
+
let foundSelector: ManagedOutputSelector | undefined;
|
|
108
175
|
let anyDirExists = false;
|
|
109
176
|
|
|
110
177
|
for (const dir of dirs) {
|
|
@@ -115,11 +182,15 @@ export class AgentProtocolHandler implements ProtocolHandler {
|
|
|
115
182
|
if (isEnoent(err)) continue;
|
|
116
183
|
throw err;
|
|
117
184
|
}
|
|
118
|
-
const
|
|
185
|
+
const selector = await readManagedOutputSelector(outputId, path.join(dir, `${outputId}.md.selector.json`));
|
|
186
|
+
const candidate = selector ? path.join(dir, selector.outputFilename) : path.join(dir, `${outputId}.md`);
|
|
187
|
+
const metadataPath = selector ? path.join(dir, selector.metadataFilename) : `${candidate}.meta.json`;
|
|
119
188
|
try {
|
|
120
189
|
await fs.stat(candidate);
|
|
121
190
|
if (foundPath) throw new Error(`agent://${outputId} ambiguous id in authorized artifacts`);
|
|
122
191
|
foundPath = candidate;
|
|
192
|
+
foundMetadataPath = metadataPath;
|
|
193
|
+
foundSelector = selector ?? undefined;
|
|
123
194
|
} catch (err) {
|
|
124
195
|
if (!isEnoent(err)) throw err;
|
|
125
196
|
}
|
|
@@ -134,7 +205,7 @@ export class AgentProtocolHandler implements ProtocolHandler {
|
|
|
134
205
|
}
|
|
135
206
|
|
|
136
207
|
const rawBytes = Buffer.from(await Bun.file(foundPath).arrayBuffer());
|
|
137
|
-
await verifyAgentOutputMetadata(outputId, foundPath, rawBytes);
|
|
208
|
+
await verifyAgentOutputMetadata(outputId, foundPath, foundMetadataPath!, rawBytes, foundSelector);
|
|
138
209
|
const rawContent = rawBytes.toString("utf8");
|
|
139
210
|
const notes: string[] = [];
|
|
140
211
|
let content = rawContent;
|