@geminixiang/mikan 1.3.0 → 1.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.
- package/CHANGELOG.md +48 -0
- package/README.md +7 -8
- package/dist/adapters/commands/login.js +1 -1
- package/dist/adapters/commands/login.js.map +1 -1
- package/dist/adapters/commands/sandbox.js +2 -2
- package/dist/adapters/commands/sandbox.js.map +1 -1
- package/dist/cli/boot.js +1 -1
- package/dist/cli/boot.js.map +1 -1
- package/dist/cli/migrate.d.ts.map +1 -1
- package/dist/cli/migrate.js +3 -2
- package/dist/cli/migrate.js.map +1 -1
- package/dist/cli/onboard.d.ts.map +1 -1
- package/dist/cli/onboard.js +15 -13
- package/dist/cli/onboard.js.map +1 -1
- package/dist/cli/pm2-ecosystem.d.ts +1 -2
- package/dist/cli/pm2-ecosystem.d.ts.map +1 -1
- package/dist/cli/pm2-ecosystem.js +2 -3
- package/dist/cli/pm2-ecosystem.js.map +1 -1
- package/dist/env-manifest.d.ts.map +1 -1
- package/dist/env-manifest.js +11 -0
- package/dist/env-manifest.js.map +1 -1
- package/dist/harness/execution-resolver.d.ts +3 -2
- package/dist/harness/execution-resolver.d.ts.map +1 -1
- package/dist/harness/execution-resolver.js +12 -10
- package/dist/harness/execution-resolver.js.map +1 -1
- package/dist/harness/prompt.d.ts.map +1 -1
- package/dist/harness/prompt.js +3 -2
- package/dist/harness/prompt.js.map +1 -1
- package/dist/harness/runner.d.ts.map +1 -1
- package/dist/harness/runner.js +37 -62
- package/dist/harness/runner.js.map +1 -1
- package/dist/harness/session.js +1 -1
- package/dist/harness/session.js.map +1 -1
- package/dist/harness/tools/attach.d.ts +3 -2
- package/dist/harness/tools/attach.d.ts.map +1 -1
- package/dist/harness/tools/attach.js +9 -2
- package/dist/harness/tools/attach.js.map +1 -1
- package/dist/harness/tools/index.d.ts +3 -2
- package/dist/harness/tools/index.d.ts.map +1 -1
- package/dist/harness/tools/index.js +6 -4
- package/dist/harness/tools/index.js.map +1 -1
- package/dist/harness/tools/jev-browser.d.ts +2 -2
- package/dist/harness/tools/jev-browser.d.ts.map +1 -1
- package/dist/harness/tools/jev-browser.js +41 -33
- package/dist/harness/tools/jev-browser.js.map +1 -1
- package/dist/harness/tools/sandbox.js +2 -2
- package/dist/harness/tools/sandbox.js.map +1 -1
- package/dist/harness/tools/types.d.ts +4 -0
- package/dist/harness/tools/types.d.ts.map +1 -1
- package/dist/harness/tools/types.js.map +1 -1
- package/dist/harness/tools/web-fetch.d.ts +6 -0
- package/dist/harness/tools/web-fetch.d.ts.map +1 -0
- package/dist/harness/tools/web-fetch.js +136 -0
- package/dist/harness/tools/web-fetch.js.map +1 -0
- package/dist/harness/types.d.ts +4 -3
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js.map +1 -1
- package/dist/main.js +10 -24
- package/dist/main.js.map +1 -1
- package/dist/migrations/index.js +2 -2
- package/dist/migrations/index.js.map +1 -1
- package/dist/package-version.d.ts +2 -0
- package/dist/package-version.d.ts.map +1 -0
- package/dist/package-version.js +19 -0
- package/dist/package-version.js.map +1 -0
- package/dist/sandbox/container.d.ts +3 -17
- package/dist/sandbox/container.d.ts.map +1 -1
- package/dist/sandbox/container.js +108 -129
- package/dist/sandbox/container.js.map +1 -1
- package/dist/sandbox/engine.d.ts +4 -0
- package/dist/sandbox/engine.d.ts.map +1 -0
- package/dist/sandbox/engine.js +30 -0
- package/dist/sandbox/engine.js.map +1 -0
- package/dist/sandbox/host.d.ts +1 -10
- package/dist/sandbox/host.d.ts.map +1 -1
- package/dist/sandbox/host.js +2 -79
- package/dist/sandbox/host.js.map +1 -1
- package/dist/sandbox/provisioner.d.ts +16 -1
- package/dist/sandbox/provisioner.d.ts.map +1 -1
- package/dist/sandbox/provisioner.js +173 -111
- package/dist/sandbox/provisioner.js.map +1 -1
- package/dist/sandbox/published-image.d.ts +3 -0
- package/dist/sandbox/published-image.d.ts.map +1 -0
- package/dist/sandbox/published-image.js +9 -0
- package/dist/sandbox/published-image.js.map +1 -0
- package/dist/sandbox/registry.d.ts +5 -3
- package/dist/sandbox/registry.d.ts.map +1 -1
- package/dist/sandbox/registry.js +36 -27
- package/dist/sandbox/registry.js.map +1 -1
- package/dist/sandbox/types.d.ts +14 -22
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/sandbox/types.js.map +1 -1
- package/dist/sandbox/utils.d.ts +0 -15
- package/dist/sandbox/utils.d.ts.map +1 -1
- package/dist/sandbox/utils.js +0 -72
- package/dist/sandbox/utils.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/vault/index.js +1 -1
- package/dist/vault/index.js.map +1 -1
- package/package.json +3 -1
- package/dist/harness/execution-env.d.ts +0 -4
- package/dist/harness/execution-env.d.ts.map +0 -1
- package/dist/harness/execution-env.js +0 -322
- package/dist/harness/execution-env.js.map +0 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { lookup } from "node:dns";
|
|
2
|
+
import { BlockList, isIP } from "node:net";
|
|
3
|
+
import { htmlToMarkdown } from "@mdream/js";
|
|
4
|
+
import { withMinimalPreset } from "@mdream/js/preset/minimal";
|
|
5
|
+
import { Agent, buildConnector, fetch } from "undici";
|
|
6
|
+
import { Type } from "typebox";
|
|
7
|
+
import { guardMcpToolResult } from "../mcp-result.js";
|
|
8
|
+
import { errorMessage, isRecord } from "../../unknown-values.js";
|
|
9
|
+
import { LABEL_PARAMETER } from "./host-fn-tool.js";
|
|
10
|
+
import { tagHarnessTool } from "./pi-tools.js";
|
|
11
|
+
export const WEB_FETCH_TOOL = "web_fetch";
|
|
12
|
+
const MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
|
|
13
|
+
const TIMEOUT_MS = 20_000;
|
|
14
|
+
const USER_AGENT = "Mozilla/5.0 (compatible; mikan-web-fetch)";
|
|
15
|
+
const TEXT_CONTENT_TYPE = /^text\/|[/+](json|xml|javascript)\b/;
|
|
16
|
+
function nonPublicAddresses() {
|
|
17
|
+
const list = new BlockList();
|
|
18
|
+
for (const [network, prefix] of [
|
|
19
|
+
["0.0.0.0", 8],
|
|
20
|
+
["10.0.0.0", 8],
|
|
21
|
+
["100.64.0.0", 10],
|
|
22
|
+
["127.0.0.0", 8],
|
|
23
|
+
["169.254.0.0", 16],
|
|
24
|
+
["172.16.0.0", 12],
|
|
25
|
+
["192.168.0.0", 16],
|
|
26
|
+
["224.0.0.0", 3],
|
|
27
|
+
]) {
|
|
28
|
+
list.addSubnet(network, prefix, "ipv4");
|
|
29
|
+
}
|
|
30
|
+
for (const [network, prefix] of [
|
|
31
|
+
["::", 127],
|
|
32
|
+
["fc00::", 7],
|
|
33
|
+
["fe80::", 10],
|
|
34
|
+
["ff00::", 8],
|
|
35
|
+
]) {
|
|
36
|
+
list.addSubnet(network, prefix, "ipv6");
|
|
37
|
+
}
|
|
38
|
+
return list;
|
|
39
|
+
}
|
|
40
|
+
const NON_PUBLIC = nonPublicAddresses();
|
|
41
|
+
export function isNonPublicAddress(address) {
|
|
42
|
+
return isBlocked(NON_PUBLIC, address);
|
|
43
|
+
}
|
|
44
|
+
function isBlocked(blocked, address) {
|
|
45
|
+
const family = isIP(address);
|
|
46
|
+
return family === 0 || blocked.check(address, family === 4 ? "ipv4" : "ipv6");
|
|
47
|
+
}
|
|
48
|
+
function refusal(address, host) {
|
|
49
|
+
return new Error(`web_fetch refuses non-public address ${address} for ${host}`);
|
|
50
|
+
}
|
|
51
|
+
function publicOnlyLookup(blocked) {
|
|
52
|
+
return (hostname, options, callback) => lookup(hostname, { ...options, all: true }, (error, addresses) => {
|
|
53
|
+
if (error)
|
|
54
|
+
return callback(error, "", 0);
|
|
55
|
+
const refused = addresses.find(({ address }) => isBlocked(blocked, address));
|
|
56
|
+
if (refused)
|
|
57
|
+
return callback(refusal(refused.address, hostname), "", 0);
|
|
58
|
+
if (options.all)
|
|
59
|
+
return callback(null, addresses);
|
|
60
|
+
return callback(null, addresses[0].address, addresses[0].family);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function publicOnlyDispatcher(blocked) {
|
|
64
|
+
const connect = buildConnector({ lookup: publicOnlyLookup(blocked) });
|
|
65
|
+
return new Agent({
|
|
66
|
+
maxResponseSize: MAX_RESPONSE_BYTES,
|
|
67
|
+
connect: (options, callback) => {
|
|
68
|
+
const host = options.hostname.replace(/^\[|\]$/g, "");
|
|
69
|
+
if (isIP(host) && isBlocked(blocked, host))
|
|
70
|
+
return callback(refusal(host, host), null);
|
|
71
|
+
return connect(options, callback);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const webFetchSchema = Type.Object({
|
|
76
|
+
label: LABEL_PARAMETER,
|
|
77
|
+
url: Type.String({ description: "Absolute http or https URL of a public page or API" }),
|
|
78
|
+
});
|
|
79
|
+
function requestedUrl(args) {
|
|
80
|
+
const raw = isRecord(args) && typeof args.url === "string" ? args.url : "";
|
|
81
|
+
if (!URL.canParse(raw))
|
|
82
|
+
throw new Error(`web_fetch needs an absolute http or https URL: ${raw}`);
|
|
83
|
+
const url = new URL(raw);
|
|
84
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
85
|
+
throw new Error(`web_fetch supports only http and https URLs, not ${url.protocol}`);
|
|
86
|
+
}
|
|
87
|
+
return url;
|
|
88
|
+
}
|
|
89
|
+
export function createWebFetchTool(options = {}) {
|
|
90
|
+
let dispatcher;
|
|
91
|
+
return tagHarnessTool({
|
|
92
|
+
name: WEB_FETCH_TOOL,
|
|
93
|
+
description: [
|
|
94
|
+
"Read a public web page or API URL from the mikan host. HTML is returned as Markdown with navigation and other page chrome removed; JSON and plain text are returned as they are.",
|
|
95
|
+
"Use it to verify current facts such as versions, releases, and dates against the official page, registry, or API, and cite the URL.",
|
|
96
|
+
"Private, loopback, and link-local addresses are refused.",
|
|
97
|
+
].join(" "),
|
|
98
|
+
parameters: webFetchSchema,
|
|
99
|
+
execute: async (args, api, context) => {
|
|
100
|
+
const url = requestedUrl(args);
|
|
101
|
+
dispatcher ??= publicOnlyDispatcher(options.blocked ?? NON_PUBLIC);
|
|
102
|
+
const timeout = AbortSignal.timeout(TIMEOUT_MS);
|
|
103
|
+
const response = await fetch(url, {
|
|
104
|
+
dispatcher,
|
|
105
|
+
signal: context.abortSignal ? AbortSignal.any([context.abortSignal, timeout]) : timeout,
|
|
106
|
+
headers: { "user-agent": USER_AGENT },
|
|
107
|
+
}).catch((error) => {
|
|
108
|
+
const reason = error instanceof Error && error.cause instanceof Error ? error.cause : error;
|
|
109
|
+
throw new Error(`web_fetch failed for ${url.href}: ${errorMessage(reason)}`, {
|
|
110
|
+
cause: error,
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
const finalUrl = response.url || url.href;
|
|
114
|
+
if (!response.ok)
|
|
115
|
+
throw new Error(`web_fetch got HTTP ${response.status} for ${finalUrl}`);
|
|
116
|
+
const contentType = (response.headers.get("content-type") ?? "").toLowerCase();
|
|
117
|
+
if (contentType && !TEXT_CONTENT_TYPE.test(contentType)) {
|
|
118
|
+
await response.body?.cancel();
|
|
119
|
+
throw new Error(`Unsupported content type ${contentType.split(";")[0]} for ${finalUrl}`);
|
|
120
|
+
}
|
|
121
|
+
const body = await response.text();
|
|
122
|
+
const text = contentType.includes("html")
|
|
123
|
+
? htmlToMarkdown(body, withMinimalPreset({ origin: new URL(finalUrl).origin }))
|
|
124
|
+
: body;
|
|
125
|
+
return guardMcpToolResult({
|
|
126
|
+
content: [
|
|
127
|
+
{
|
|
128
|
+
type: "text",
|
|
129
|
+
text: finalUrl === url.href ? text : `Redirected to ${finalUrl}\n\n${text}`,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
}, api.env, context);
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=web-fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-fetch.js","sourceRoot":"","sources":["../../../src/harness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,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;gBACvC,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC/E,CAAC,CAAC,IAAI,CAAC;YACT,OAAO,kBAAkB,CACvB;gBACE,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,QAAQ,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,QAAQ,OAAO,IAAI,EAAE;qBAC5E;iBACF;aACF,EACD,GAAG,CAAC,GAAG,EACP,OAAO,CACR,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { lookup } from \"node:dns\";\nimport { BlockList, isIP, type LookupFunction } from \"node:net\";\nimport { htmlToMarkdown } from \"@mdream/js\";\nimport { withMinimalPreset } from \"@mdream/js/preset/minimal\";\nimport { Agent, buildConnector, fetch } from \"undici\";\nimport { Type } from \"typebox\";\nimport { guardMcpToolResult } from \"../mcp-result.js\";\nimport { errorMessage, isRecord } from \"../../unknown-values.js\";\nimport { LABEL_PARAMETER } from \"./host-fn-tool.js\";\nimport { tagHarnessTool, type MikanHarnessTool } from \"./pi-tools.js\";\nimport type { WebFetchToolOptions } from \"./types.js\";\n\nexport const WEB_FETCH_TOOL = \"web_fetch\";\n\nconst MAX_RESPONSE_BYTES = 5 * 1024 * 1024;\nconst TIMEOUT_MS = 20_000;\nconst USER_AGENT = \"Mozilla/5.0 (compatible; mikan-web-fetch)\";\nconst TEXT_CONTENT_TYPE = /^text\\/|[/+](json|xml|javascript)\\b/;\n\nfunction nonPublicAddresses(): BlockList {\n const list = new BlockList();\n for (const [network, prefix] of [\n [\"0.0.0.0\", 8],\n [\"10.0.0.0\", 8],\n [\"100.64.0.0\", 10],\n [\"127.0.0.0\", 8],\n [\"169.254.0.0\", 16],\n [\"172.16.0.0\", 12],\n [\"192.168.0.0\", 16],\n [\"224.0.0.0\", 3],\n ] as const) {\n list.addSubnet(network, prefix, \"ipv4\");\n }\n for (const [network, prefix] of [\n [\"::\", 127],\n [\"fc00::\", 7],\n [\"fe80::\", 10],\n [\"ff00::\", 8],\n ] as const) {\n list.addSubnet(network, prefix, \"ipv6\");\n }\n return list;\n}\n\nconst NON_PUBLIC = nonPublicAddresses();\n\nexport function isNonPublicAddress(address: string): boolean {\n return isBlocked(NON_PUBLIC, address);\n}\n\nfunction isBlocked(blocked: BlockList, address: string): boolean {\n const family = isIP(address);\n return family === 0 || blocked.check(address, family === 4 ? \"ipv4\" : \"ipv6\");\n}\n\nfunction refusal(address: string, host: string): Error {\n return new Error(`web_fetch refuses non-public address ${address} for ${host}`);\n}\n\nfunction publicOnlyLookup(blocked: BlockList): LookupFunction {\n return (hostname, options, callback) =>\n lookup(hostname, { ...options, all: true }, (error, addresses) => {\n if (error) return callback(error, \"\", 0);\n const refused = addresses.find(({ address }) => isBlocked(blocked, address));\n if (refused) return callback(refusal(refused.address, hostname), \"\", 0);\n if (options.all) return callback(null, addresses);\n return callback(null, addresses[0]!.address, addresses[0]!.family);\n });\n}\n\nfunction publicOnlyDispatcher(blocked: BlockList): Agent {\n const connect = buildConnector({ lookup: publicOnlyLookup(blocked) });\n return new Agent({\n maxResponseSize: MAX_RESPONSE_BYTES,\n connect: (options, callback) => {\n const host = options.hostname.replace(/^\\[|\\]$/g, \"\");\n if (isIP(host) && isBlocked(blocked, host)) return callback(refusal(host, host), null);\n return connect(options, callback);\n },\n });\n}\n\nconst webFetchSchema = Type.Object({\n label: LABEL_PARAMETER,\n url: Type.String({ description: \"Absolute http or https URL of a public page or API\" }),\n});\n\nfunction requestedUrl(args: unknown): URL {\n const raw = isRecord(args) && typeof args.url === \"string\" ? args.url : \"\";\n if (!URL.canParse(raw)) throw new Error(`web_fetch needs an absolute http or https URL: ${raw}`);\n const url = new URL(raw);\n if (url.protocol !== \"http:\" && url.protocol !== \"https:\") {\n throw new Error(`web_fetch supports only http and https URLs, not ${url.protocol}`);\n }\n return url;\n}\n\nexport function createWebFetchTool(options: WebFetchToolOptions = {}): MikanHarnessTool {\n let dispatcher: Agent | undefined;\n return tagHarnessTool({\n name: WEB_FETCH_TOOL,\n description: [\n \"Read a public web page or API URL from the mikan host. HTML is returned as Markdown with navigation and other page chrome removed; JSON and plain text are returned as they are.\",\n \"Use it to verify current facts such as versions, releases, and dates against the official page, registry, or API, and cite the URL.\",\n \"Private, loopback, and link-local addresses are refused.\",\n ].join(\" \"),\n parameters: webFetchSchema,\n execute: async (args, api, context) => {\n const url = requestedUrl(args);\n dispatcher ??= publicOnlyDispatcher(options.blocked ?? NON_PUBLIC);\n const timeout = AbortSignal.timeout(TIMEOUT_MS);\n const response = await fetch(url, {\n dispatcher,\n signal: context.abortSignal ? AbortSignal.any([context.abortSignal, timeout]) : timeout,\n headers: { \"user-agent\": USER_AGENT },\n }).catch((error: unknown) => {\n const reason = error instanceof Error && error.cause instanceof Error ? error.cause : error;\n throw new Error(`web_fetch failed for ${url.href}: ${errorMessage(reason)}`, {\n cause: error,\n });\n });\n const finalUrl = response.url || url.href;\n if (!response.ok) throw new Error(`web_fetch got HTTP ${response.status} for ${finalUrl}`);\n const contentType = (response.headers.get(\"content-type\") ?? \"\").toLowerCase();\n if (contentType && !TEXT_CONTENT_TYPE.test(contentType)) {\n await response.body?.cancel();\n throw new Error(`Unsupported content type ${contentType.split(\";\")[0]} for ${finalUrl}`);\n }\n const body = await response.text();\n const text = contentType.includes(\"html\")\n ? htmlToMarkdown(body, withMinimalPreset({ origin: new URL(finalUrl).origin }))\n : body;\n return guardMcpToolResult(\n {\n content: [\n {\n type: \"text\",\n text: finalUrl === url.href ? text : `Redirected to ${finalUrl}\\n\\n${text}`,\n },\n ],\n },\n api.env,\n context,\n );\n },\n });\n}\n"]}
|
package/dist/harness/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { MikanAgentSession } from "./session.js";
|
|
|
3
3
|
import type { Api, ImageContent, Model, RetryPolicy, Usage } from "@earendil-works/pi-ai";
|
|
4
4
|
import type { ConversationResponder, MessagingInfo, SubagentProgressSnapshot } from "../types.js";
|
|
5
5
|
import type { resolveConversationSettings } from "../settings/index.js";
|
|
6
|
-
import type {
|
|
6
|
+
import type { RuntimePathContext, SandboxConfig } from "../sandbox/types.js";
|
|
7
7
|
import type { WorkspaceProjection, Office } from "../office/types.js";
|
|
8
8
|
import type { AgentMessage, AgentTool, ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
9
9
|
import type { Context, JsonValue } from "@earendil-works/chord";
|
|
@@ -97,7 +97,8 @@ export interface UsageReportContext {
|
|
|
97
97
|
waitForQueue: () => Promise<void>;
|
|
98
98
|
}
|
|
99
99
|
export interface RunnerExecutionContext {
|
|
100
|
-
|
|
100
|
+
env(): ExecutionEnv | undefined;
|
|
101
|
+
sandboxConfig(): SandboxConfig;
|
|
101
102
|
resolveForRun(context: {
|
|
102
103
|
address: OfficeAddress;
|
|
103
104
|
userId: string;
|
|
@@ -379,7 +380,7 @@ export interface RunEventPublisher {
|
|
|
379
380
|
publish(address: OfficeAddress, sessionKey: string, event: RunEvent): void;
|
|
380
381
|
}
|
|
381
382
|
export interface MikanToolContext {
|
|
382
|
-
env: ExecutionEnv;
|
|
383
|
+
env(): ExecutionEnv | undefined;
|
|
383
384
|
}
|
|
384
385
|
export interface MikanToolResult {
|
|
385
386
|
content?: (TextContent | ImageContent)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK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,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,UAAU,EAAE,CAAC;IACjC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { OfficeAddress, PlatformTrustModel } from \"../types.js\";\nimport type { MikanAgentSession } from \"./session.js\";\nimport type { Api, ImageContent, Model, RetryPolicy, Usage } from \"@earendil-works/pi-ai\";\nimport type { ConversationResponder, MessagingInfo, SubagentProgressSnapshot } from \"../types.js\";\nimport type { resolveConversationSettings } from \"../settings/index.js\";\nimport type { Executor, RuntimePathContext, SandboxConfig } from \"../sandbox/types.js\";\nimport type { WorkspaceProjection, Office } from \"../office/types.js\";\n\nimport type { AgentMessage, AgentTool, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Context, JsonValue } from \"@earendil-works/chord\";\nimport type {\n CompactionPolicy,\n ToolControl,\n ToolExecutionApi,\n ToolRegistration,\n} from \"@earendil-works/pi-durable\";\nimport type { ExecutionEnv } from \"@earendil-works/pi-durable/env\";\nimport type { JsonValue as ModelJsonValue, TextContent } from \"@earendil-works/pi-ai\";\nimport type { MikanModels } from \"./models.js\";\nimport type { SessionStore } from \"../sessions/session-store.js\";\nimport type { Static, TSchema } from \"typebox\";\n\nexport interface EnsureDefaultOpenConnectorOptions {\n office: Office;\n platformWorkspaceId?: string;\n defaultServer?: McpServerConfig;\n signal?: AbortSignal;\n fetch?: typeof globalThis.fetch;\n}\n\nexport interface ScratchListing {\n folders: string[];\n omitted: number;\n}\n\nexport interface BuildSystemPromptOptions {\n workspacePath: string;\n office: Office;\n memory: string;\n sandboxConfig: SandboxConfig;\n platform: MessagingInfo;\n skills: MikanSkill[];\n projection: WorkspaceProjection;\n skippedSkillLinks?: string[];\n scratch: ScratchListing;\n}\n\nexport interface RunnerSessionState {\n responder: ConversationResponder | null;\n logCtx: {\n conversationId: string;\n userName?: string;\n conversationName?: string;\n sessionId?: string;\n } | null;\n queue: {\n enqueue(fn: () => Promise<void>, errorContext: string): void;\n } | null;\n pendingTools: Map<string, { toolName: string; args: unknown; startTime: number }>;\n completedTools: ToolTiming[];\n toolProgress: Map<string, { label: string; status: \"running\" | \"done\" | \"error\" }>;\n subagentProgress: Map<string, SubagentProgressSnapshot>;\n completedSubagentProgress: SubagentProgressSnapshot[];\n subagentToolCalls: Set<string>;\n subagentProgressShown: boolean;\n suppressResponseDeltas: boolean;\n answerStreamStarted: boolean;\n answerText: string;\n notice: string;\n workAcknowledged: boolean;\n publishRunEvent: RunEventListener | undefined;\n lastSubagentProgressAt: number;\n toolProgressTimer: ReturnType<typeof setTimeout> | undefined;\n llmCallCount: number;\n toolCallCount: number;\n toolErrorCount: number;\n toolInputCharacters: number;\n toolOutputCharacters: number;\n assistantMessageCount: number;\n outputCharacters: number;\n retryCount: number;\n compactionCount: number;\n budgetExceeded: boolean;\n firstTokenLatencyMs?: number;\n responseModel?: string;\n stopReason: string;\n errorMessage: string | undefined;\n reportedLlmError: boolean;\n finalResponseHandledByTool: boolean;\n triggerAttribution?: string;\n}\n\nexport interface UsageReportContext {\n session: MikanAgentSession;\n runState: RunnerSessionState;\n responder: ConversationResponder;\n platform: MessagingInfo;\n model: Model<Api>;\n sessionConversation: string;\n sessionUuid: string;\n waitForQueue: () => Promise<void>;\n}\n\nexport interface RunnerExecutionContext {\n executor: Executor;\n resolveForRun(context: {\n address: OfficeAddress;\n userId: string;\n trustModel?: PlatformTrustModel;\n }): Promise<{\n pathContext: RuntimePathContext;\n projection: WorkspaceProjection;\n }>;\n}\n\nexport interface RunPresentation {\n wait(): Promise<void>;\n dispose(): void;\n}\n\nexport interface RunPresentationContext {\n responder: ConversationResponder;\n sessionConversation: string;\n userName: string | undefined;\n sessionUuid: string;\n triggerAttribution: string | undefined;\n publishRunEvent?: RunEventListener;\n}\n\nexport interface PlatformToolRoles {\n platformTools: ReadonlySet<string>;\n finalResponseTools: ReadonlySet<string>;\n}\n\nexport interface SessionEventHandlerParams {\n session: MikanAgentSession;\n runState: RunnerSessionState;\n model: Model<Api>;\n agentConfig: ReturnType<typeof resolveConversationSettings>;\n platformToolRoles: PlatformToolRoles;\n}\n\nexport interface FinalizeRunResponseOptions {\n triggerSessionLink?: string;\n createOverflowLink?: () => string;\n platform?: string;\n model?: Model<Api>;\n sessionConversation?: string;\n sessionUuid?: string;\n initialTask?: boolean;\n}\n\nexport interface PreparedRunContext {\n sessionConversation: string;\n userMessage: string;\n imageAttachments: ImageContent[];\n triggerAttribution?: string;\n}\n\nexport interface SubagentModelSpec {\n provider: string;\n id: string;\n}\n\nexport interface SubagentProfile {\n name: string;\n description: string;\n systemPrompt: string;\n tools: string[];\n model?: SubagentModelSpec;\n thinkingLevel?: ThinkingLevel;\n maxTurns?: number;\n maxTokens?: number;\n maxCostUsd?: number;\n maxDurationMs?: number;\n}\n\ninterface SubagentRunBudget {\n maxTurns?: number;\n maxTokens?: number;\n maxCostUsd?: number;\n maxDurationMs?: number;\n}\n\nexport type SubagentRunStatus =\n | \"completed\"\n | \"failed\"\n | \"cancelled\"\n | \"timeout\"\n | \"budget_exceeded\"\n | \"invalid_output\";\n\ninterface SubagentParentContext {\n mode: \"normalized\";\n recentTurns?: number;\n}\n\nexport type SubagentUsage = Usage;\n\nexport type SubagentUsageSink = (usage: SubagentUsage) => void | Promise<void>;\n\nexport interface SubagentRunRequest<TOutputSchema extends TSchema | undefined = undefined> {\n task: string;\n profile?: string;\n parentContext?: SubagentParentContext;\n systemPrompt?: string;\n input?: unknown;\n model?: SubagentModelSpec;\n tools?: string[];\n thinkingLevel?: ThinkingLevel;\n outputSchema?: TOutputSchema;\n budget?: SubagentRunBudget;\n signal?: AbortSignal;\n}\n\nexport type SubagentRunOutput<TSchemaOrUndefined extends TSchema | undefined> =\n TSchemaOrUndefined extends TSchema ? Static<TSchemaOrUndefined> : string;\n\ninterface SubagentRunMetadata {\n runId: string;\n text?: string;\n model: SubagentModelSpec;\n turns: number;\n toolCalls: number;\n toolCallCounts: Record<string, number>;\n usage: SubagentUsage;\n tokens: number;\n costUsd: number;\n durationMs: number;\n cleanupPending?: boolean;\n}\n\ninterface SubagentRunCompletedResult<TOutput> extends SubagentRunMetadata {\n status: \"completed\";\n output: TOutput;\n error?: never;\n}\n\ninterface SubagentRunIncompleteResult extends SubagentRunMetadata {\n status: Exclude<SubagentRunStatus, \"completed\">;\n output?: never;\n error?: string;\n}\n\nexport type SubagentRunResult<TOutput = string> =\n | SubagentRunCompletedResult<TOutput>\n | SubagentRunIncompleteResult;\n\nexport interface CreateMikanModelsOptions {\n modelsJsonPath: string;\n}\n\nexport interface MikanSkill {\n name: string;\n description: string;\n content: string;\n filePath: string;\n disableModelInvocation?: boolean;\n baseDir: string;\n source: string;\n inline?: boolean;\n directory?: string;\n enabled?: boolean;\n}\n\nexport type SkillScope = \"global\" | \"conversation\";\n\nexport interface SkillPatterns {\n global: readonly string[];\n conversation: readonly string[];\n}\n\nexport interface SkillDiagnostic {\n type: \"warning\";\n message: string;\n path: string;\n code?: \"symlink\";\n}\n\nexport interface LoadSkillsResult {\n skills: MikanSkill[];\n diagnostics: SkillDiagnostic[];\n}\n\nexport type RetrySettings = RetryPolicy;\n\nexport interface BudgetSettings {\n maxTokens?: number;\n maxCostUsd?: number;\n maxDurationMs?: number;\n maxLlmCalls?: number;\n}\n\nexport type CompactionSettings = CompactionPolicy;\n\nexport interface HarnessSettings {\n compaction: CompactionSettings;\n retry: RetrySettings;\n budget: BudgetSettings;\n}\n\nexport type ToolLoopVerdict =\n | { kind: \"allow\" }\n | { kind: \"notice\"; text: string }\n | { kind: \"block\"; reason: string }\n | { kind: \"stop\"; reason: string };\n\nexport interface SubagentProfileDiagnostic {\n type: \"warning\";\n message: string;\n path: string;\n}\n\nexport interface LoadSubagentProfilesResult {\n profiles: Map<string, SubagentProfile>;\n diagnostics: SubagentProfileDiagnostic[];\n}\n\ntype CompactionReason = \"threshold\" | \"overflow\" | \"manual\";\n\nexport type HarnessEvent =\n | { type: \"message_start\"; message: AgentMessage }\n | { type: \"text_delta\"; delta: string }\n | { type: \"message_end\"; message: AgentMessage }\n | { type: \"tool_execution_start\"; toolCallId: string; toolName: string; args: unknown }\n | { type: \"tool_execution_update\"; toolCallId: string; toolName: string; details: JsonValue }\n | {\n type: \"tool_execution_end\";\n toolCallId: string;\n toolName: string;\n result: { content: (TextContent | ImageContent)[]; details?: unknown };\n isError: boolean;\n }\n | { type: \"compaction_start\"; reason: CompactionReason }\n | {\n type: \"compaction_end\";\n reason: CompactionReason;\n aborted: boolean;\n errorMessage?: string;\n }\n | {\n type: \"auto_retry_start\";\n attempt: number;\n maxAttempts: number;\n delayMs: number;\n errorMessage: string;\n }\n | { type: \"auto_retry_end\"; success: boolean; attempt: number; finalError?: string }\n | {\n type: \"budget_exceeded\";\n reason: string;\n tokens: number;\n costUsd: number;\n llmCalls: number;\n durationMs: number;\n };\n\nexport type HarnessEventListener = (event: HarnessEvent) => void | Promise<void>;\n\nexport type RunEvent =\n | { type: \"tool_started\"; toolCallId: string; toolName: string; label: string }\n | { type: \"subagent_progress\"; toolCallId: string; snapshot: SubagentProgressSnapshot }\n | {\n type: \"tool_ended\";\n toolCallId: string;\n toolName: string;\n isError: boolean;\n resultText: string;\n }\n | { type: \"assistant_delta\"; delta: string }\n | { type: \"assistant_message\"; thinking: string[]; text: string; callsTools: boolean }\n | { type: \"compaction_started\" }\n | { type: \"retry_started\"; attempt: number; maxAttempts: number }\n | { type: \"budget_exceeded\"; reason: string; llmCalls: number; durationMs: number }\n | { type: \"run_started\"; userName: string; text: string }\n | { type: \"run_ended\" };\n\nexport type RunEventListener = (event: RunEvent) => void;\n\nexport interface RunEventPublisher {\n publish(address: OfficeAddress, sessionKey: string, event: RunEvent): void;\n}\n\nexport interface MikanToolContext {\n env: ExecutionEnv;\n}\n\nexport interface MikanToolResult {\n content?: (TextContent | ImageContent)[];\n details?: JsonValue;\n isError?: boolean;\n structuredContent?: ModelJsonValue;\n usage?: Usage;\n control?: ToolControl;\n}\n\nexport type MikanHarnessTool = Omit<ToolRegistration, \"execute\"> & {\n outputSchema?: TSchema;\n exposure?: McpExposure;\n namespace?: string;\n execute(args: unknown, api: ToolExecutionApi, context: Context): Promise<MikanToolResult>;\n};\n\nexport interface ToolSearchOptions {\n tools: readonly MikanHarnessTool[];\n query: string;\n limit?: number;\n namespace?: string;\n}\n\nexport interface ToolSearchToolOptions {\n tools: readonly MikanHarnessTool[];\n loaded: ReadonlySet<string>;\n load: (names: string[], context: Context) => Promise<void>;\n}\n\nexport interface CodemodeToolOptions {\n tools: readonly MikanHarnessTool[];\n servers?: readonly McpServerSummary[];\n executeNested: (\n tool: MikanHarnessTool,\n args: Parameters<MikanHarnessTool[\"execute\"]>,\n ) => Promise<MikanToolResult>;\n}\n\nexport type MikanToolInput = AgentTool | MikanHarnessTool;\n\nexport interface MikanAgentSessionOptions {\n systemPrompt: string;\n model: Model<Api>;\n thinkingLevel: ThinkingLevel;\n tools: MikanToolInput[];\n toolContext?: MikanToolContext;\n models: MikanModels;\n sessionStore: SessionStore;\n settings?: {\n compaction?: Partial<CompactionSettings>;\n retry?: Partial<RetrySettings>;\n budget?: Partial<BudgetSettings>;\n };\n}\n\nexport interface McpServerConfig {\n command?: string;\n args?: string[];\n env?: Record<string, string>;\n url?: string;\n headers?: Record<string, string>;\n disabled?: boolean;\n exposure?: McpExposure;\n description?: string;\n}\n\nexport type McpExposure = \"codemode\" | \"deferred\";\n\nexport interface McpServerSummary {\n name: string;\n exposure: McpExposure;\n description?: string;\n instructions?: string;\n}\n\ntype McpPresetCredentialTarget = \"env\" | \"header\" | \"url\";\n\ninterface McpPresetCredential {\n key: string;\n label: string;\n description: string;\n target: McpPresetCredentialTarget;\n required: boolean;\n secret: boolean;\n valuePrefix?: string;\n}\n\nexport interface McpPreset {\n id: string;\n name: string;\n description: string;\n category: string;\n serverName: string;\n sourceUrl: string;\n setupUrl: string;\n server: McpServerConfig;\n credentials: McpPresetCredential[];\n}\n\nexport interface McpLoadError {\n server: string;\n error: string;\n}\n\nexport interface McpToolsResult {\n tools: MikanHarnessTool[];\n errors: McpLoadError[];\n servers: McpServerSummary[];\n dispose: () => Promise<void>;\n}\n\nexport interface ToolTiming {\n label: string;\n toolName: string;\n durationMs: number;\n isError: boolean;\n}\n\nexport interface BudgetStopReport {\n reason: string;\n llmCalls: number;\n durationMs: number;\n completed: readonly ToolTiming[];\n running: readonly ToolTiming[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { OfficeAddress, PlatformTrustModel } from \"../types.js\";\nimport type { MikanAgentSession } from \"./session.js\";\nimport type { Api, ImageContent, Model, RetryPolicy, Usage } from \"@earendil-works/pi-ai\";\nimport type { ConversationResponder, MessagingInfo, SubagentProgressSnapshot } from \"../types.js\";\nimport type { resolveConversationSettings } from \"../settings/index.js\";\nimport type { RuntimePathContext, SandboxConfig } from \"../sandbox/types.js\";\nimport type { WorkspaceProjection, Office } from \"../office/types.js\";\n\nimport type { AgentMessage, AgentTool, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Context, JsonValue } from \"@earendil-works/chord\";\nimport type {\n CompactionPolicy,\n ToolControl,\n ToolExecutionApi,\n ToolRegistration,\n} from \"@earendil-works/pi-durable\";\nimport type { ExecutionEnv } from \"@earendil-works/pi-durable/env\";\nimport type { JsonValue as ModelJsonValue, TextContent } from \"@earendil-works/pi-ai\";\nimport type { MikanModels } from \"./models.js\";\nimport type { SessionStore } from \"../sessions/session-store.js\";\nimport type { Static, TSchema } from \"typebox\";\n\nexport interface EnsureDefaultOpenConnectorOptions {\n office: Office;\n platformWorkspaceId?: string;\n defaultServer?: McpServerConfig;\n signal?: AbortSignal;\n fetch?: typeof globalThis.fetch;\n}\n\nexport interface ScratchListing {\n folders: string[];\n omitted: number;\n}\n\nexport interface BuildSystemPromptOptions {\n workspacePath: string;\n office: Office;\n memory: string;\n sandboxConfig: SandboxConfig;\n platform: MessagingInfo;\n skills: MikanSkill[];\n projection: WorkspaceProjection;\n skippedSkillLinks?: string[];\n scratch: ScratchListing;\n}\n\nexport interface RunnerSessionState {\n responder: ConversationResponder | null;\n logCtx: {\n conversationId: string;\n userName?: string;\n conversationName?: string;\n sessionId?: string;\n } | null;\n queue: {\n enqueue(fn: () => Promise<void>, errorContext: string): void;\n } | null;\n pendingTools: Map<string, { toolName: string; args: unknown; startTime: number }>;\n completedTools: ToolTiming[];\n toolProgress: Map<string, { label: string; status: \"running\" | \"done\" | \"error\" }>;\n subagentProgress: Map<string, SubagentProgressSnapshot>;\n completedSubagentProgress: SubagentProgressSnapshot[];\n subagentToolCalls: Set<string>;\n subagentProgressShown: boolean;\n suppressResponseDeltas: boolean;\n answerStreamStarted: boolean;\n answerText: string;\n notice: string;\n workAcknowledged: boolean;\n publishRunEvent: RunEventListener | undefined;\n lastSubagentProgressAt: number;\n toolProgressTimer: ReturnType<typeof setTimeout> | undefined;\n llmCallCount: number;\n toolCallCount: number;\n toolErrorCount: number;\n toolInputCharacters: number;\n toolOutputCharacters: number;\n assistantMessageCount: number;\n outputCharacters: number;\n retryCount: number;\n compactionCount: number;\n budgetExceeded: boolean;\n firstTokenLatencyMs?: number;\n responseModel?: string;\n stopReason: string;\n errorMessage: string | undefined;\n reportedLlmError: boolean;\n finalResponseHandledByTool: boolean;\n triggerAttribution?: string;\n}\n\nexport interface UsageReportContext {\n session: MikanAgentSession;\n runState: RunnerSessionState;\n responder: ConversationResponder;\n platform: MessagingInfo;\n model: Model<Api>;\n sessionConversation: string;\n sessionUuid: string;\n waitForQueue: () => Promise<void>;\n}\n\nexport interface RunnerExecutionContext {\n env(): ExecutionEnv | undefined;\n sandboxConfig(): SandboxConfig;\n resolveForRun(context: {\n address: OfficeAddress;\n userId: string;\n trustModel?: PlatformTrustModel;\n }): Promise<{\n pathContext: RuntimePathContext;\n projection: WorkspaceProjection;\n }>;\n}\n\nexport interface RunPresentation {\n wait(): Promise<void>;\n dispose(): void;\n}\n\nexport interface RunPresentationContext {\n responder: ConversationResponder;\n sessionConversation: string;\n userName: string | undefined;\n sessionUuid: string;\n triggerAttribution: string | undefined;\n publishRunEvent?: RunEventListener;\n}\n\nexport interface PlatformToolRoles {\n platformTools: ReadonlySet<string>;\n finalResponseTools: ReadonlySet<string>;\n}\n\nexport interface SessionEventHandlerParams {\n session: MikanAgentSession;\n runState: RunnerSessionState;\n model: Model<Api>;\n agentConfig: ReturnType<typeof resolveConversationSettings>;\n platformToolRoles: PlatformToolRoles;\n}\n\nexport interface FinalizeRunResponseOptions {\n triggerSessionLink?: string;\n createOverflowLink?: () => string;\n platform?: string;\n model?: Model<Api>;\n sessionConversation?: string;\n sessionUuid?: string;\n initialTask?: boolean;\n}\n\nexport interface PreparedRunContext {\n sessionConversation: string;\n userMessage: string;\n imageAttachments: ImageContent[];\n triggerAttribution?: string;\n}\n\nexport interface SubagentModelSpec {\n provider: string;\n id: string;\n}\n\nexport interface SubagentProfile {\n name: string;\n description: string;\n systemPrompt: string;\n tools: string[];\n model?: SubagentModelSpec;\n thinkingLevel?: ThinkingLevel;\n maxTurns?: number;\n maxTokens?: number;\n maxCostUsd?: number;\n maxDurationMs?: number;\n}\n\ninterface SubagentRunBudget {\n maxTurns?: number;\n maxTokens?: number;\n maxCostUsd?: number;\n maxDurationMs?: number;\n}\n\nexport type SubagentRunStatus =\n | \"completed\"\n | \"failed\"\n | \"cancelled\"\n | \"timeout\"\n | \"budget_exceeded\"\n | \"invalid_output\";\n\ninterface SubagentParentContext {\n mode: \"normalized\";\n recentTurns?: number;\n}\n\nexport type SubagentUsage = Usage;\n\nexport type SubagentUsageSink = (usage: SubagentUsage) => void | Promise<void>;\n\nexport interface SubagentRunRequest<TOutputSchema extends TSchema | undefined = undefined> {\n task: string;\n profile?: string;\n parentContext?: SubagentParentContext;\n systemPrompt?: string;\n input?: unknown;\n model?: SubagentModelSpec;\n tools?: string[];\n thinkingLevel?: ThinkingLevel;\n outputSchema?: TOutputSchema;\n budget?: SubagentRunBudget;\n signal?: AbortSignal;\n}\n\nexport type SubagentRunOutput<TSchemaOrUndefined extends TSchema | undefined> =\n TSchemaOrUndefined extends TSchema ? Static<TSchemaOrUndefined> : string;\n\ninterface SubagentRunMetadata {\n runId: string;\n text?: string;\n model: SubagentModelSpec;\n turns: number;\n toolCalls: number;\n toolCallCounts: Record<string, number>;\n usage: SubagentUsage;\n tokens: number;\n costUsd: number;\n durationMs: number;\n cleanupPending?: boolean;\n}\n\ninterface SubagentRunCompletedResult<TOutput> extends SubagentRunMetadata {\n status: \"completed\";\n output: TOutput;\n error?: never;\n}\n\ninterface SubagentRunIncompleteResult extends SubagentRunMetadata {\n status: Exclude<SubagentRunStatus, \"completed\">;\n output?: never;\n error?: string;\n}\n\nexport type SubagentRunResult<TOutput = string> =\n | SubagentRunCompletedResult<TOutput>\n | SubagentRunIncompleteResult;\n\nexport interface CreateMikanModelsOptions {\n modelsJsonPath: string;\n}\n\nexport interface MikanSkill {\n name: string;\n description: string;\n content: string;\n filePath: string;\n disableModelInvocation?: boolean;\n baseDir: string;\n source: string;\n inline?: boolean;\n directory?: string;\n enabled?: boolean;\n}\n\nexport type SkillScope = \"global\" | \"conversation\";\n\nexport interface SkillPatterns {\n global: readonly string[];\n conversation: readonly string[];\n}\n\nexport interface SkillDiagnostic {\n type: \"warning\";\n message: string;\n path: string;\n code?: \"symlink\";\n}\n\nexport interface LoadSkillsResult {\n skills: MikanSkill[];\n diagnostics: SkillDiagnostic[];\n}\n\nexport type RetrySettings = RetryPolicy;\n\nexport interface BudgetSettings {\n maxTokens?: number;\n maxCostUsd?: number;\n maxDurationMs?: number;\n maxLlmCalls?: number;\n}\n\nexport type CompactionSettings = CompactionPolicy;\n\nexport interface HarnessSettings {\n compaction: CompactionSettings;\n retry: RetrySettings;\n budget: BudgetSettings;\n}\n\nexport type ToolLoopVerdict =\n | { kind: \"allow\" }\n | { kind: \"notice\"; text: string }\n | { kind: \"block\"; reason: string }\n | { kind: \"stop\"; reason: string };\n\nexport interface SubagentProfileDiagnostic {\n type: \"warning\";\n message: string;\n path: string;\n}\n\nexport interface LoadSubagentProfilesResult {\n profiles: Map<string, SubagentProfile>;\n diagnostics: SubagentProfileDiagnostic[];\n}\n\ntype CompactionReason = \"threshold\" | \"overflow\" | \"manual\";\n\nexport type HarnessEvent =\n | { type: \"message_start\"; message: AgentMessage }\n | { type: \"text_delta\"; delta: string }\n | { type: \"message_end\"; message: AgentMessage }\n | { type: \"tool_execution_start\"; toolCallId: string; toolName: string; args: unknown }\n | { type: \"tool_execution_update\"; toolCallId: string; toolName: string; details: JsonValue }\n | {\n type: \"tool_execution_end\";\n toolCallId: string;\n toolName: string;\n result: { content: (TextContent | ImageContent)[]; details?: unknown };\n isError: boolean;\n }\n | { type: \"compaction_start\"; reason: CompactionReason }\n | {\n type: \"compaction_end\";\n reason: CompactionReason;\n aborted: boolean;\n errorMessage?: string;\n }\n | {\n type: \"auto_retry_start\";\n attempt: number;\n maxAttempts: number;\n delayMs: number;\n errorMessage: string;\n }\n | { type: \"auto_retry_end\"; success: boolean; attempt: number; finalError?: string }\n | {\n type: \"budget_exceeded\";\n reason: string;\n tokens: number;\n costUsd: number;\n llmCalls: number;\n durationMs: number;\n };\n\nexport type HarnessEventListener = (event: HarnessEvent) => void | Promise<void>;\n\nexport type RunEvent =\n | { type: \"tool_started\"; toolCallId: string; toolName: string; label: string }\n | { type: \"subagent_progress\"; toolCallId: string; snapshot: SubagentProgressSnapshot }\n | {\n type: \"tool_ended\";\n toolCallId: string;\n toolName: string;\n isError: boolean;\n resultText: string;\n }\n | { type: \"assistant_delta\"; delta: string }\n | { type: \"assistant_message\"; thinking: string[]; text: string; callsTools: boolean }\n | { type: \"compaction_started\" }\n | { type: \"retry_started\"; attempt: number; maxAttempts: number }\n | { type: \"budget_exceeded\"; reason: string; llmCalls: number; durationMs: number }\n | { type: \"run_started\"; userName: string; text: string }\n | { type: \"run_ended\" };\n\nexport type RunEventListener = (event: RunEvent) => void;\n\nexport interface RunEventPublisher {\n publish(address: OfficeAddress, sessionKey: string, event: RunEvent): void;\n}\n\nexport interface MikanToolContext {\n env(): ExecutionEnv | undefined;\n}\n\nexport interface MikanToolResult {\n content?: (TextContent | ImageContent)[];\n details?: JsonValue;\n isError?: boolean;\n structuredContent?: ModelJsonValue;\n usage?: Usage;\n control?: ToolControl;\n}\n\nexport type MikanHarnessTool = Omit<ToolRegistration, \"execute\"> & {\n outputSchema?: TSchema;\n exposure?: McpExposure;\n namespace?: string;\n execute(args: unknown, api: ToolExecutionApi, context: Context): Promise<MikanToolResult>;\n};\n\nexport interface ToolSearchOptions {\n tools: readonly MikanHarnessTool[];\n query: string;\n limit?: number;\n namespace?: string;\n}\n\nexport interface ToolSearchToolOptions {\n tools: readonly MikanHarnessTool[];\n loaded: ReadonlySet<string>;\n load: (names: string[], context: Context) => Promise<void>;\n}\n\nexport interface CodemodeToolOptions {\n tools: readonly MikanHarnessTool[];\n servers?: readonly McpServerSummary[];\n executeNested: (\n tool: MikanHarnessTool,\n args: Parameters<MikanHarnessTool[\"execute\"]>,\n ) => Promise<MikanToolResult>;\n}\n\nexport type MikanToolInput = AgentTool | MikanHarnessTool;\n\nexport interface MikanAgentSessionOptions {\n systemPrompt: string;\n model: Model<Api>;\n thinkingLevel: ThinkingLevel;\n tools: MikanToolInput[];\n toolContext?: MikanToolContext;\n models: MikanModels;\n sessionStore: SessionStore;\n settings?: {\n compaction?: Partial<CompactionSettings>;\n retry?: Partial<RetrySettings>;\n budget?: Partial<BudgetSettings>;\n };\n}\n\nexport interface McpServerConfig {\n command?: string;\n args?: string[];\n env?: Record<string, string>;\n url?: string;\n headers?: Record<string, string>;\n disabled?: boolean;\n exposure?: McpExposure;\n description?: string;\n}\n\nexport type McpExposure = \"codemode\" | \"deferred\";\n\nexport interface McpServerSummary {\n name: string;\n exposure: McpExposure;\n description?: string;\n instructions?: string;\n}\n\ntype McpPresetCredentialTarget = \"env\" | \"header\" | \"url\";\n\ninterface McpPresetCredential {\n key: string;\n label: string;\n description: string;\n target: McpPresetCredentialTarget;\n required: boolean;\n secret: boolean;\n valuePrefix?: string;\n}\n\nexport interface McpPreset {\n id: string;\n name: string;\n description: string;\n category: string;\n serverName: string;\n sourceUrl: string;\n setupUrl: string;\n server: McpServerConfig;\n credentials: McpPresetCredential[];\n}\n\nexport interface McpLoadError {\n server: string;\n error: string;\n}\n\nexport interface McpToolsResult {\n tools: MikanHarnessTool[];\n errors: McpLoadError[];\n servers: McpServerSummary[];\n dispose: () => Promise<void>;\n}\n\nexport interface ToolTiming {\n label: string;\n toolName: string;\n durationMs: number;\n isError: boolean;\n}\n\nexport interface BudgetStopReport {\n reason: string;\n llmCalls: number;\n durationMs: number;\n completed: readonly ToolTiming[];\n running: readonly ToolTiming[];\n}\n"]}
|
package/dist/main.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./observability/instrument.js";
|
|
3
3
|
import { existsSync, mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { dirname, join } from "node:path";
|
|
5
|
-
import { fileURLToPath } from "node:url";
|
|
6
4
|
import { GithubMessagingBot } from "./adapters/github/bot.js";
|
|
7
5
|
import { createGithubToolPack } from "./adapters/github/tool-pack.js";
|
|
8
6
|
import { parseGithubPolicy } from "./adapters/github/policy.js";
|
|
@@ -31,7 +29,8 @@ import { useJevModels } from "./harness/jev.js";
|
|
|
31
29
|
import { defaultModelsJsonPath, MikanModels } from "./harness/models.js";
|
|
32
30
|
import { RunEventHub } from "./harness/run-events.js";
|
|
33
31
|
import { readEnv } from "./env-manifest.js";
|
|
34
|
-
import { ensureDirExists
|
|
32
|
+
import { ensureDirExists } from "./file-guards.js";
|
|
33
|
+
import { packageVersion } from "./package-version.js";
|
|
35
34
|
import { SandboxError } from "./sandbox/utils.js";
|
|
36
35
|
import { validateSandbox } from "./sandbox/registry.js";
|
|
37
36
|
import { helpText, resolveBoot } from "./cli/boot.js";
|
|
@@ -45,21 +44,7 @@ import { createOfficeAddress, createWorkspace, listRegisteredOffices } from "./o
|
|
|
45
44
|
import { createConversationRuntime } from "./runtime/conversation-runtime.js";
|
|
46
45
|
import { captureError, shutdownObservability } from "./observability/index.js";
|
|
47
46
|
import { MemoryCapture } from "./memory-capture/index.js";
|
|
48
|
-
import { errorMessage
|
|
49
|
-
function getVersion() {
|
|
50
|
-
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
51
|
-
const possiblePaths = [
|
|
52
|
-
join(moduleDir, "package.json"),
|
|
53
|
-
join(dirname(moduleDir), "package.json"),
|
|
54
|
-
join(process.cwd(), "package.json"),
|
|
55
|
-
];
|
|
56
|
-
for (const pkgPath of possiblePaths) {
|
|
57
|
-
const pkg = readJsonFileIfExists(pkgPath, (value) => isRecord(value), () => "Ignoring package.json while resolving version");
|
|
58
|
-
if (typeof pkg?.version === "string" && pkg.version)
|
|
59
|
-
return pkg.version;
|
|
60
|
-
}
|
|
61
|
-
return "unknown";
|
|
62
|
-
}
|
|
47
|
+
import { errorMessage } from "./unknown-values.js";
|
|
63
48
|
const SLACK_APP_TOKEN = readEnv("SLACK_APP_TOKEN");
|
|
64
49
|
const SLACK_BOT_TOKEN = readEnv("SLACK_BOT_TOKEN");
|
|
65
50
|
const TELEGRAM_BOT_TOKEN = readEnv("TELEGRAM_BOT_TOKEN");
|
|
@@ -152,7 +137,7 @@ if (plan.mode === "env") {
|
|
|
152
137
|
process.exit(0);
|
|
153
138
|
}
|
|
154
139
|
if (plan.mode === "version") {
|
|
155
|
-
console.log(
|
|
140
|
+
console.log(packageVersion());
|
|
156
141
|
process.exit(0);
|
|
157
142
|
}
|
|
158
143
|
if (plan.mode === "onboard") {
|
|
@@ -213,7 +198,7 @@ const vaultManager = new FileVaultManager(stateDir);
|
|
|
213
198
|
if (vaultManager.isEnabled()) {
|
|
214
199
|
console.log(sandbox.type === "container"
|
|
215
200
|
? " Vault system enabled. Container vault active."
|
|
216
|
-
: sandbox.type === "
|
|
201
|
+
: sandbox.type === "oci"
|
|
217
202
|
? " Vault system enabled. Conversation-scoped credential routing active."
|
|
218
203
|
: " Vault system enabled. Host mode will not inject vault env.");
|
|
219
204
|
}
|
|
@@ -239,14 +224,15 @@ const sandboxLimits = sandboxSettings?.cpus || sandboxSettings?.memory
|
|
|
239
224
|
const sandboxBoostLimits = sandboxSettings?.boost?.cpus || sandboxSettings?.boost?.memory
|
|
240
225
|
? { cpus: sandboxSettings?.boost?.cpus, memory: sandboxSettings?.boost?.memory }
|
|
241
226
|
: undefined;
|
|
242
|
-
const provisioner = sandbox.type === "
|
|
227
|
+
const provisioner = sandbox.type === "oci"
|
|
243
228
|
? new DockerContainerManager(sandbox.image, {
|
|
244
229
|
limits: sandboxLimits,
|
|
245
230
|
boostLimits: sandboxBoostLimits,
|
|
246
231
|
})
|
|
247
232
|
: undefined;
|
|
248
|
-
const resourceController = sandbox.type === "
|
|
249
|
-
|
|
233
|
+
const resourceController = sandbox.type === "oci" ? provisioner : undefined;
|
|
234
|
+
void provisioner?.prepareImage();
|
|
235
|
+
if (sandbox.type === "oci") {
|
|
250
236
|
ensureDirExists(workspace.skillsDir);
|
|
251
237
|
ensureDirExists(workspace.agentsDir);
|
|
252
238
|
try {
|
|
@@ -351,7 +337,7 @@ const sandboxDesc = sandbox.type === "host"
|
|
|
351
337
|
? "host"
|
|
352
338
|
: sandbox.type === "container"
|
|
353
339
|
? `container:${sandbox.container}`
|
|
354
|
-
: `
|
|
340
|
+
: `oci:${sandbox.image}`;
|
|
355
341
|
log.logStartup(workingDir, sandboxDesc);
|
|
356
342
|
logHarnessStartupSummary();
|
|
357
343
|
function logHarnessStartupSummary() {
|