@gajae-code/coding-agent 0.16.4 → 0.16.6
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 +54 -0
- package/dist/types/capability/types.d.ts +4 -0
- package/dist/types/cli/customize-doctor.d.ts +22 -0
- package/dist/types/config/file-lock.d.ts +31 -3
- package/dist/types/coordinator-mcp/question-state.d.ts +7 -0
- package/dist/types/coordinator-mcp/server.d.ts +7 -0
- package/dist/types/discovery/helpers.d.ts +33 -0
- package/dist/types/exec/bash-executor.d.ts +17 -1
- package/dist/types/exec/bash-shell-guardian.d.ts +15 -0
- package/dist/types/exec/bash-shell-runtime-entry.d.ts +2 -0
- package/dist/types/exec/bash-shell-signals.d.ts +2 -0
- package/dist/types/exec/bash-shell-supervisor-entry.d.ts +1 -0
- package/dist/types/exec/bash-shell-supervisor.d.ts +10 -0
- package/dist/types/exec/bash-shell-worker-entry.d.ts +2 -0
- package/dist/types/exec/bash-shell-worker-protocol.d.ts +63 -0
- package/dist/types/exec/bash-shell-worker.d.ts +1 -0
- package/dist/types/exec/isolated-shell.d.ts +19 -0
- package/dist/types/extensibility/extensions/function-hooks-internal.d.ts +9 -0
- package/dist/types/extensibility/extensions/function-hooks.d.ts +169 -0
- package/dist/types/extensibility/extensions/index.d.ts +1 -0
- package/dist/types/extensibility/extensions/runner.d.ts +46 -6
- package/dist/types/extensibility/extensions/types.d.ts +16 -0
- package/dist/types/extensibility/extensions/wrapper.d.ts +3 -1
- package/dist/types/extensibility/gjc-plugins/constrained-hooks.d.ts +35 -2
- package/dist/types/extensibility/gjc-plugins/types.d.ts +25 -0
- package/dist/types/extensibility/hooks/types.d.ts +4 -0
- package/dist/types/extensibility/runtime-skill-discovery.d.ts +4 -1
- package/dist/types/extensibility/skill-management.d.ts +9 -4
- package/dist/types/extensibility/skills.d.ts +2 -0
- package/dist/types/gjc-runtime/empty-delete-gc.d.ts +4 -1
- package/dist/types/gjc-runtime/linux-proc.d.ts +2 -0
- package/dist/types/gjc-runtime/session-state-lock.d.ts +12 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +41 -3
- package/dist/types/gjc-runtime/ultragoal-succession.d.ts +251 -0
- package/dist/types/modes/components/bash-execution.d.ts +1 -0
- package/dist/types/modes/components/execution-shared.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +2 -0
- package/dist/types/modes/types.d.ts +6 -0
- package/dist/types/sdk/broker/ensure.d.ts +32 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +0 -1
- package/dist/types/sdk/broker/lifecycle.d.ts +6 -0
- package/dist/types/sdk/broker/startup-failure.d.ts +4 -1
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -0
- package/dist/types/sdk/bus/chat-effect-journal.d.ts +17 -2
- package/dist/types/sdk/bus/conversation-store.d.ts +11 -0
- package/dist/types/sdk/bus/lifecycle-commands.d.ts +8 -8
- package/dist/types/sdk/bus/slack-daemon.d.ts +1 -1
- package/dist/types/sdk/bus/topic-registry.d.ts +8 -0
- package/dist/types/sdk/client/client.d.ts +6 -0
- package/dist/types/sdk/host/host.d.ts +3 -1
- package/dist/types/sdk/host/session-runtime.d.ts +4 -2
- package/dist/types/sdk/lifecycle/service.d.ts +1 -0
- package/dist/types/sdk/router/session-router.d.ts +10 -2
- package/dist/types/sdk/session.d.ts +5 -1
- package/dist/types/session/agent-session.d.ts +2 -0
- package/dist/types/session/fallback-chain-controller.d.ts +15 -0
- package/dist/types/session/internal/managed-session-storage.d.ts +7 -0
- package/dist/types/session/messages.d.ts +1 -0
- package/dist/types/session/session-manager.d.ts +3 -1
- package/dist/types/setup/paseo/announce.d.ts +4 -3
- package/dist/types/skill-state/canonical-skills.d.ts +4 -0
- package/dist/types/system-prompt.d.ts +8 -0
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/tools/bash.d.ts +1 -0
- package/dist/types/tools/github-cache.d.ts +2 -1
- package/dist/types/tools/index.d.ts +2 -0
- package/package.json +9 -7
- package/scripts/generate-sdk-operation-inventory.ts +2 -0
- package/src/capability/index.ts +14 -2
- package/src/capability/types.ts +4 -0
- package/src/cli/customize-doctor.ts +155 -12
- package/src/cli.ts +22 -0
- package/src/commands/sdk.ts +74 -31
- package/src/config/file-lock-gc.ts +40 -2
- package/src/config/file-lock.ts +198 -14
- package/src/config/model-preset-registry.ts +115 -16
- package/src/config/model-registry.ts +16 -12
- package/src/coordinator-mcp/question-state.ts +33 -2
- package/src/coordinator-mcp/server.ts +477 -101
- package/src/crash/sanitize.ts +1 -1
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +22 -0
- package/src/discovery/builtin.ts +50 -62
- package/src/discovery/helpers.ts +297 -32
- package/src/exec/bash-executor.ts +330 -50
- package/src/exec/bash-shell-guardian.ts +388 -0
- package/src/exec/bash-shell-runtime-entry.ts +5 -0
- package/src/exec/bash-shell-signals.ts +29 -0
- package/src/exec/bash-shell-supervisor-entry.ts +3 -0
- package/src/exec/bash-shell-supervisor.ts +359 -0
- package/src/exec/bash-shell-worker-entry.ts +5 -0
- package/src/exec/bash-shell-worker-protocol.ts +36 -0
- package/src/exec/bash-shell-worker.ts +116 -0
- package/src/exec/isolated-shell.ts +393 -0
- package/src/extensibility/extensions/function-hooks-internal.ts +73 -0
- package/src/extensibility/extensions/function-hooks.ts +959 -0
- package/src/extensibility/extensions/index.ts +22 -0
- package/src/extensibility/extensions/loader.ts +53 -2
- package/src/extensibility/extensions/runner.ts +895 -264
- package/src/extensibility/extensions/types.ts +42 -0
- package/src/extensibility/extensions/wrapper.ts +56 -15
- package/src/extensibility/gjc-plugins/compiler.ts +20 -2
- package/src/extensibility/gjc-plugins/constrained-hooks.ts +321 -23
- package/src/extensibility/gjc-plugins/registry.ts +113 -1
- package/src/extensibility/gjc-plugins/runtime-quarantine.ts +20 -2
- package/src/extensibility/gjc-plugins/schema.ts +121 -4
- package/src/extensibility/gjc-plugins/types.ts +25 -0
- package/src/extensibility/hooks/loader.ts +133 -16
- package/src/extensibility/hooks/types.ts +28 -0
- package/src/extensibility/runtime-skill-discovery.ts +80 -47
- package/src/extensibility/skill-management.ts +200 -52
- package/src/extensibility/skills.ts +29 -9
- package/src/gjc-runtime/empty-delete-gc.ts +94 -4
- package/src/gjc-runtime/gc-runtime.ts +29 -0
- package/src/gjc-runtime/linux-proc.ts +14 -0
- package/src/gjc-runtime/session-state-lock.ts +51 -8
- package/src/gjc-runtime/session-state-sidecar.ts +27 -11
- package/src/gjc-runtime/state-writer.ts +30 -29
- package/src/gjc-runtime/ultragoal-runtime.ts +189 -47
- package/src/gjc-runtime/ultragoal-succession.ts +1667 -0
- package/src/gjc-runtime/workflow-manifest.generated.json +52 -1
- package/src/gjc-runtime/workflow-manifest.ts +16 -0
- package/src/harness-control-plane/session-lease.ts +2 -2
- package/src/internal-urls/docs-index.generated.ts +6 -6
- package/src/lsp/config.ts +10 -3
- package/src/lsp/index.ts +1 -1
- package/src/lsp/path-trust.ts +69 -14
- package/src/main.ts +6 -1
- package/src/modes/acp/acp-agent.ts +16 -3
- package/src/modes/components/bash-execution.ts +4 -1
- package/src/modes/components/execution-shared.ts +4 -1
- package/src/modes/components/session-observer-overlay.ts +1 -1
- package/src/modes/components/tool-status-header.ts +3 -1
- package/src/modes/controllers/command-controller.ts +1 -0
- package/src/modes/controllers/event-controller.ts +3 -2
- package/src/modes/controllers/extension-ui-controller.ts +1 -0
- package/src/modes/controllers/input-controller.ts +6 -3
- package/src/modes/interactive-mode.ts +6 -5
- package/src/modes/print-mode.ts +5 -1
- package/src/modes/prompt-action-autocomplete.ts +54 -27
- package/src/modes/runtime-init.ts +2 -0
- package/src/modes/types.ts +16 -3
- package/src/modes/utils/ui-helpers.ts +1 -0
- package/src/prompts/tools/subagent.md +1 -0
- package/src/runtime-mcp/manager.ts +20 -2
- package/src/runtime-mcp/pool.test.ts +20 -11
- package/src/sdk/broker/broker.ts +119 -28
- package/src/sdk/broker/ensure.ts +248 -41
- package/src/sdk/broker/lifecycle-ledger.ts +7 -17
- package/src/sdk/broker/lifecycle.ts +56 -6
- package/src/sdk/broker/startup-failure.ts +15 -6
- package/src/sdk/bus/chat-daemon-control.ts +3 -1
- package/src/sdk/bus/chat-daemon-runtime.ts +35 -5
- package/src/sdk/bus/chat-effect-journal.ts +132 -7
- package/src/sdk/bus/conversation-store.ts +29 -0
- package/src/sdk/bus/lifecycle-commands.ts +17 -11
- package/src/sdk/bus/slack-conversation.ts +1 -0
- package/src/sdk/bus/slack-daemon.ts +387 -48
- package/src/sdk/bus/telegram-daemon.ts +16 -2
- package/src/sdk/bus/topic-registry.ts +19 -0
- package/src/sdk/cli/master-cli.ts +1 -1
- package/src/sdk/cli/session-cli.ts +2 -2
- package/src/sdk/client/client.ts +66 -17
- package/src/sdk/host/host.ts +29 -9
- package/src/sdk/host/query/revision-store.ts +19 -13
- package/src/sdk/host/reverse-leases.ts +7 -4
- package/src/sdk/host/session-runtime.test.ts +50 -8
- package/src/sdk/host/session-runtime.ts +158 -51
- package/src/sdk/lifecycle/service.ts +4 -0
- package/src/sdk/protocol/operation-inventory.generated.json +11 -0
- package/src/sdk/router/session-router.ts +89 -38
- package/src/sdk/session.ts +155 -26
- package/src/sdk/transport/relay.ts +35 -13
- package/src/session/agent-session.ts +117 -52
- package/src/session/fallback-chain-controller.ts +38 -0
- package/src/session/internal/managed-session-storage.ts +19 -5
- package/src/session/messages.ts +5 -0
- package/src/session/session-manager.ts +29 -5
- package/src/session-import/redact.ts +5 -1
- package/src/setup/paseo/announce.ts +49 -43
- package/src/setup/paseo/setup-deps.ts +1 -1
- package/src/skill-state/canonical-skills.ts +12 -0
- package/src/skills/skills.test.ts +41 -21
- package/src/system-prompt.ts +25 -3
- package/src/task/executor.ts +5 -0
- package/src/task/index.ts +4 -0
- package/src/tools/bash.ts +28 -11
- package/src/tools/gh.ts +26 -3
- package/src/tools/github-cache.ts +68 -16
- package/src/tools/index.ts +2 -0
- package/src/tools/job.ts +13 -2
- package/src/tools/read.ts +14 -2
- package/src/tools/render-utils.ts +1 -3
- package/src/tools/resource-gc.ts +28 -8
- package/src/tools/skill-discovery.ts +5 -0
- package/src/tools/skill.ts +15 -0
- package/src/tools/subagent.ts +3 -2
- package/src/tools/tool-catalog.generated.ts +2 -2
- package/src/tools/ultragoal-ask-guard.ts +2 -2
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export type { SlashCommandInfo, SlashCommandLocation, SlashCommandSource } from "../slash-commands";
|
|
6
|
+
export {
|
|
7
|
+
attenuateFunctionHookGrant,
|
|
8
|
+
cloneFunctionHookData,
|
|
9
|
+
compatibilityFunctionHookGrant,
|
|
10
|
+
createFunctionHookCapabilities,
|
|
11
|
+
DEFAULT_EXTENSION_FUNCTION_HOOK_GRANT,
|
|
12
|
+
FUNCTION_HOOK_CAPABILITIES,
|
|
13
|
+
functionHookDenyAllowed,
|
|
14
|
+
functionHookEventIdentityMatches,
|
|
15
|
+
functionHookGrantHash,
|
|
16
|
+
functionHookGrantOperations,
|
|
17
|
+
functionHookPayloadHash,
|
|
18
|
+
functionHookTransformAllowed,
|
|
19
|
+
intersectFunctionHookGrants,
|
|
20
|
+
isPlainFunctionHookData,
|
|
21
|
+
isSafeFunctionHookValue,
|
|
22
|
+
isValidFunctionHookEventValue,
|
|
23
|
+
normalizeFunctionHookGrant,
|
|
24
|
+
redactFunctionHookValue,
|
|
25
|
+
sanitizeFunctionHookReason,
|
|
26
|
+
validateFunctionHookTarget,
|
|
27
|
+
} from "./function-hooks";
|
|
6
28
|
export {
|
|
7
29
|
discoverAndLoadExtensions,
|
|
8
30
|
ExtensionRuntimeNotInitializedError,
|
|
@@ -19,8 +19,22 @@ import { EventBus } from "../../utils/event-bus";
|
|
|
19
19
|
import { installLegacyPiSpecifierShim, loadLegacyPiModule } from "../plugins/legacy-pi-compat";
|
|
20
20
|
import { getAllPluginExtensionPaths } from "../plugins/loader";
|
|
21
21
|
import * as TypeBox from "../typebox";
|
|
22
|
-
|
|
23
22
|
import { resolvePath } from "../utils";
|
|
23
|
+
import {
|
|
24
|
+
DEFAULT_EXTENSION_FUNCTION_HOOK_GRANT,
|
|
25
|
+
type FunctionHook,
|
|
26
|
+
type FunctionHookEventType,
|
|
27
|
+
type FunctionHookPayloadFor,
|
|
28
|
+
type FunctionHookRegistrationOptions,
|
|
29
|
+
intersectFunctionHookGrants,
|
|
30
|
+
normalizeFunctionHookGrant,
|
|
31
|
+
validateFunctionHookTarget,
|
|
32
|
+
} from "./function-hooks";
|
|
33
|
+
import {
|
|
34
|
+
tagExtensionHandlerRegistrationOrder,
|
|
35
|
+
tagFunctionHookHandler,
|
|
36
|
+
wrapExtensionHandlerRegistration,
|
|
37
|
+
} from "./function-hooks-internal";
|
|
24
38
|
import type {
|
|
25
39
|
Extension,
|
|
26
40
|
ExtensionAPI,
|
|
@@ -260,10 +274,46 @@ class ConcreteExtensionAPI implements ExtensionAPI {
|
|
|
260
274
|
private readonly cwd: string,
|
|
261
275
|
public readonly events: EventBus,
|
|
262
276
|
) {}
|
|
277
|
+
#handlerRegistrationOrder = 0;
|
|
263
278
|
|
|
264
279
|
on<F extends HandlerFn>(event: string, handler: F): void {
|
|
265
280
|
const list = this.extension.handlers.get(event) ?? [];
|
|
266
|
-
list.push(handler);
|
|
281
|
+
list.push(wrapExtensionHandlerRegistration(handler, this.#handlerRegistrationOrder++));
|
|
282
|
+
this.extension.handlers.set(event, list);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
registerFunctionHook<T extends FunctionHookEventType>(
|
|
286
|
+
event: T,
|
|
287
|
+
handler: FunctionHook<FunctionHookPayloadFor<T>>,
|
|
288
|
+
options: FunctionHookRegistrationOptions = {},
|
|
289
|
+
): void {
|
|
290
|
+
if (event === "*") {
|
|
291
|
+
if (options.target !== undefined) throw new Error("Wildcard function hooks cannot declare a target");
|
|
292
|
+
} else if (options.target !== undefined) {
|
|
293
|
+
if (event !== "tool_call" && event !== "tool_result")
|
|
294
|
+
throw new Error("Function hook targets are only valid for tool_call and tool_result events");
|
|
295
|
+
validateFunctionHookTarget(options.target);
|
|
296
|
+
}
|
|
297
|
+
const grant = intersectFunctionHookGrants(
|
|
298
|
+
normalizeFunctionHookGrant(options),
|
|
299
|
+
DEFAULT_EXTENSION_FUNCTION_HOOK_GRANT,
|
|
300
|
+
);
|
|
301
|
+
const registrationOrder = this.#handlerRegistrationOrder++;
|
|
302
|
+
const registration = {
|
|
303
|
+
event,
|
|
304
|
+
...(options.target === undefined ? {} : { target: options.target }),
|
|
305
|
+
...(options.registrationId === undefined ? {} : { registrationId: options.registrationId }),
|
|
306
|
+
registrationOrder,
|
|
307
|
+
handler: handler as unknown as FunctionHook,
|
|
308
|
+
grant,
|
|
309
|
+
provenance: {
|
|
310
|
+
source: "extension" as const,
|
|
311
|
+
extensionId: this.extension.path,
|
|
312
|
+
path: this.extension.path,
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
const list = this.extension.handlers.get(event) ?? [];
|
|
316
|
+
list.push(tagExtensionHandlerRegistrationOrder(tagFunctionHookHandler(registration), registrationOrder));
|
|
267
317
|
this.extension.handlers.set(event, list);
|
|
268
318
|
}
|
|
269
319
|
|
|
@@ -658,6 +708,7 @@ async function discoverExtensionsInDir(dir: string): Promise<string[]> {
|
|
|
658
708
|
logger.warn("Failed to discover extensions in directory", { path: dir, error: String(err) });
|
|
659
709
|
return [];
|
|
660
710
|
}
|
|
711
|
+
entries.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
661
712
|
|
|
662
713
|
for (const entry of entries) {
|
|
663
714
|
const entryPath = path.join(dir, entry.name);
|