@gajae-code/coding-agent 0.11.6 → 0.11.7
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 +37 -0
- package/dist/types/capability/index.d.ts +10 -20
- package/dist/types/capability/types.d.ts +3 -0
- package/dist/types/commands/daemon.d.ts +2 -2
- package/dist/types/commands/sdk.d.ts +20 -2
- package/dist/types/config/keybindings.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +56 -6
- package/dist/types/eval/py/runner-artifact.d.ts +8 -0
- package/dist/types/gjc-runtime/ultragoal-guard.d.ts +5 -5
- package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +20 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +19 -5
- package/dist/types/main.d.ts +24 -1
- package/dist/types/modes/components/btw-panel.d.ts +1 -0
- package/dist/types/modes/components/model-selector.d.ts +2 -0
- package/dist/types/modes/components/tool-status-header.d.ts +1 -0
- package/dist/types/modes/controllers/btw-controller.d.ts +5 -0
- package/dist/types/modes/interactive-mode.d.ts +2 -0
- package/dist/types/modes/types.d.ts +1 -0
- package/dist/types/runtime-mcp/content-limits.d.ts +7 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -1
- package/dist/types/sdk/bus/index.d.ts +1 -1
- package/dist/types/sdk/bus/lifecycle-commands.d.ts +5 -4
- package/dist/types/sdk/bus/notification-service.d.ts +34 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +8 -3
- package/dist/types/sdk/bus/telegram-daemon.d.ts +61 -3
- package/dist/types/sdk/bus/topic-registry.d.ts +88 -2
- package/dist/types/sdk/client/discovery.d.ts +2 -0
- package/dist/types/sdk/client/liveness.d.ts +7 -0
- package/dist/types/sdk/transport/auth-preface.d.ts +9 -0
- package/dist/types/sdk/transport/index.d.ts +12 -0
- package/dist/types/sdk/transport/relay.d.ts +43 -0
- package/dist/types/sdk/transport/serve-cli.d.ts +4 -0
- package/dist/types/sdk/transport/socket.d.ts +7 -0
- package/dist/types/sdk/transport/stdio.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +28 -5
- package/dist/types/session/btw-contract.d.ts +16 -0
- package/dist/types/session/internal/managed-session-scope.d.ts +21 -7
- package/dist/types/session/internal/managed-session-storage.d.ts +10 -8
- package/dist/types/session/session-manager.d.ts +25 -4
- package/dist/types/setup/credential-import.d.ts +5 -1
- package/dist/types/setup/provider-onboarding.d.ts +2 -0
- package/dist/types/ssh/utils.d.ts +1 -0
- package/dist/types/task/discovery.d.ts +3 -1
- package/dist/types/tools/fetch.d.ts +5 -8
- package/dist/types/tools/image-gen.d.ts +16 -0
- package/dist/types/tools/skill-discovery.d.ts +7 -0
- package/dist/types/tools/sqlite-reader.d.ts +7 -0
- package/dist/types/utils/shell-snapshot.d.ts +12 -0
- package/dist/types/web/insane/bridge.d.ts +1 -0
- package/dist/types/web/insane/url-guard.d.ts +17 -0
- package/package.json +8 -8
- package/scripts/generate-sdk-operation-inventory.ts +2 -0
- package/src/capability/index.ts +50 -42
- package/src/capability/types.ts +3 -0
- package/src/cli/setup-cli.ts +10 -4
- package/src/cli.ts +34 -9
- package/src/commands/daemon.ts +22 -5
- package/src/commands/sdk.ts +42 -9
- package/src/config/keybindings.ts +1 -1
- package/src/config/model-profiles.ts +18 -0
- package/src/config/settings-schema.ts +57 -6
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +42 -1
- package/src/discovery/ssh.ts +12 -1
- package/src/eval/py/kernel.ts +1 -21
- package/src/eval/py/runner-artifact.ts +84 -0
- package/src/extensibility/plugins/marketplace/fetcher.ts +191 -7
- package/src/gjc-runtime/ultragoal-guard.ts +88 -10
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +103 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +275 -12
- package/src/gjc-runtime/workflow-manifest.generated.json +58 -0
- package/src/gjc-runtime/workflow-manifest.ts +23 -0
- package/src/internal-urls/docs-index.generated.ts +8 -7
- package/src/internal-urls/local-protocol.ts +32 -6
- package/src/main.ts +86 -27
- package/src/modes/action-registry.ts +1 -1
- package/src/modes/components/btw-panel.ts +82 -16
- package/src/modes/components/model-selector.ts +31 -3
- package/src/modes/components/tool-status-header.ts +6 -1
- package/src/modes/controllers/btw-controller.ts +119 -36
- package/src/modes/controllers/input-controller.ts +31 -0
- package/src/modes/controllers/selector-controller.ts +106 -12
- package/src/modes/interactive-mode.ts +16 -7
- package/src/modes/types.ts +1 -0
- package/src/prompts/system/btw-user.md +3 -8
- package/src/prompts/tools/skill-discovery.md +1 -0
- package/src/runtime-mcp/client.ts +41 -55
- package/src/runtime-mcp/content-limits.ts +71 -0
- package/src/runtime-mcp/json-rpc.ts +23 -9
- package/src/runtime-mcp/transports/http.ts +50 -16
- package/src/sdk/bus/chat-daemon-control.ts +4 -3
- package/src/sdk/bus/index.ts +4 -5
- package/src/sdk/bus/lifecycle-commands.ts +16 -7
- package/src/sdk/bus/notification-service.ts +41 -18
- package/src/sdk/bus/telegram-daemon-contract.ts +8 -3
- package/src/sdk/bus/telegram-daemon-control.ts +2 -2
- package/src/sdk/bus/telegram-daemon.ts +1663 -375
- package/src/sdk/bus/topic-registry.ts +451 -12
- package/src/sdk/client/discovery.ts +19 -3
- package/src/sdk/client/liveness.ts +49 -0
- package/src/sdk/protocol/operation-inventory.generated.json +11 -0
- package/src/sdk/session.ts +29 -5
- package/src/sdk/transport/auth-preface.ts +82 -0
- package/src/sdk/transport/index.ts +18 -0
- package/src/sdk/transport/relay.ts +252 -0
- package/src/sdk/transport/serve-cli.ts +105 -0
- package/src/sdk/transport/socket.ts +197 -0
- package/src/sdk/transport/stdio.ts +17 -0
- package/src/session/agent-session.ts +240 -149
- package/src/session/blob-store.ts +19 -6
- package/src/session/btw-contract.ts +59 -0
- package/src/session/internal/managed-session-scope.ts +313 -57
- package/src/session/internal/managed-session-storage.ts +146 -35
- package/src/session/session-manager.ts +319 -85
- package/src/setup/credential-import.ts +28 -3
- package/src/setup/provider-onboarding.ts +30 -1
- package/src/setup/provider-presets.json +2 -1
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/ssh/utils.ts +14 -0
- package/src/task/discovery.ts +8 -2
- package/src/tools/ask.ts +1 -1
- package/src/tools/fetch.ts +13 -131
- package/src/tools/image-gen.ts +301 -20
- package/src/tools/read.ts +2 -0
- package/src/tools/skill-discovery.ts +39 -3
- package/src/tools/sqlite-reader.ts +63 -5
- package/src/utils/pasted-image-path.ts +15 -6
- package/src/utils/shell-snapshot.ts +173 -63
- package/src/web/insane/bridge.ts +5 -1
- package/src/web/insane/url-guard.ts +138 -27
- package/src/web/scrapers/types.ts +19 -49
- package/src/web/scrapers/utils.ts +12 -26
|
@@ -5,7 +5,7 @@ export { isRecord };
|
|
|
5
5
|
import { ToolAbortError } from "../../tools/tool-errors";
|
|
6
6
|
import { convertBufferWithMarkit } from "../../utils/markit";
|
|
7
7
|
import type { AddressResolver } from "../insane/url-guard";
|
|
8
|
-
import {
|
|
8
|
+
import { guardedPublicFetch } from "../insane/url-guard";
|
|
9
9
|
import { MAX_BYTES } from "./types";
|
|
10
10
|
|
|
11
11
|
export function asRecord(value: unknown): Record<string, unknown> | null {
|
|
@@ -70,16 +70,6 @@ async function readResponseWithLimit(response: Response, maxBytes: number, signa
|
|
|
70
70
|
return new Uint8Array(Buffer.concat(chunks, totalBytes));
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
async function guardPublicBinaryUrl(
|
|
74
|
-
rawUrl: string,
|
|
75
|
-
resolver: AddressResolver | undefined,
|
|
76
|
-
context: string,
|
|
77
|
-
): Promise<{ ok: true; url: string } | { ok: false; error: string }> {
|
|
78
|
-
const guard = await validatePublicHttpUrl(rawUrl, { resolver });
|
|
79
|
-
if (guard.ok) return { ok: true, url: guard.url.toString() };
|
|
80
|
-
return { ok: false, error: `${context}: target URL is not public HTTP(S): ${guard.reason}` };
|
|
81
|
-
}
|
|
82
|
-
|
|
83
73
|
/**
|
|
84
74
|
* Fetch binary content from a URL
|
|
85
75
|
*/
|
|
@@ -93,32 +83,28 @@ export async function fetchBinary(
|
|
|
93
83
|
const { publicUrlGuard = true, resolver, maxRedirects = 10 } = options;
|
|
94
84
|
try {
|
|
95
85
|
let currentUrl = url;
|
|
96
|
-
if (publicUrlGuard) {
|
|
97
|
-
const guarded = await guardPublicBinaryUrl(url, resolver, "Blocked binary fetch");
|
|
98
|
-
if (!guarded.ok) return { ok: false, error: guarded.error };
|
|
99
|
-
currentUrl = guarded.url;
|
|
100
|
-
}
|
|
101
86
|
|
|
102
87
|
for (let redirectCount = 0; redirectCount <= maxRedirects; redirectCount++) {
|
|
103
|
-
const
|
|
88
|
+
const requestInit: BunFetchRequestInit = {
|
|
104
89
|
signal: requestSignal,
|
|
105
90
|
headers: {
|
|
106
91
|
"User-Agent": "Mozilla/5.0 (compatible; TextBot/1.0)",
|
|
107
92
|
},
|
|
108
93
|
redirect: "manual",
|
|
109
|
-
}
|
|
94
|
+
};
|
|
95
|
+
const dial = publicUrlGuard
|
|
96
|
+
? await guardedPublicFetch(currentUrl, requestInit, { resolver })
|
|
97
|
+
: { ok: true as const, response: await fetch(currentUrl, requestInit), logicalUrl: new URL(currentUrl) };
|
|
98
|
+
if (!dial.ok) {
|
|
99
|
+
return { ok: false, error: `Blocked binary fetch: target URL is not public HTTP(S): ${dial.reason}` };
|
|
100
|
+
}
|
|
101
|
+
const { response } = dial;
|
|
102
|
+
const logicalUrl = dial.logicalUrl.toString();
|
|
110
103
|
|
|
111
104
|
if (REDIRECT_STATUSES.has(response.status)) {
|
|
112
105
|
const location = response.headers.get("location");
|
|
113
106
|
if (!location) return { ok: false, error: "Redirect response missing Location header" };
|
|
114
|
-
|
|
115
|
-
if (publicUrlGuard) {
|
|
116
|
-
const guarded = await guardPublicBinaryUrl(redirectUrl, resolver, "Blocked binary redirect");
|
|
117
|
-
if (!guarded.ok) return { ok: false, error: guarded.error };
|
|
118
|
-
currentUrl = guarded.url;
|
|
119
|
-
} else {
|
|
120
|
-
currentUrl = redirectUrl;
|
|
121
|
-
}
|
|
107
|
+
currentUrl = new URL(location, logicalUrl).toString();
|
|
122
108
|
continue;
|
|
123
109
|
}
|
|
124
110
|
|