@geminixiang/mikan 1.0.0-beta.12 → 1.0.0-beta.13
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 +26 -0
- package/dist/adapter.d.ts +1 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js.map +1 -1
- package/dist/adapters/discord/bot.d.ts.map +1 -1
- package/dist/adapters/discord/bot.js +1 -0
- package/dist/adapters/discord/bot.js.map +1 -1
- package/dist/adapters/discord/context.d.ts.map +1 -1
- package/dist/adapters/discord/context.js +1 -0
- package/dist/adapters/discord/context.js.map +1 -1
- package/dist/adapters/github/bot.d.ts +6 -2
- package/dist/adapters/github/bot.d.ts.map +1 -1
- package/dist/adapters/github/bot.js +23 -2
- package/dist/adapters/github/bot.js.map +1 -1
- package/dist/adapters/github/context.d.ts.map +1 -1
- package/dist/adapters/github/context.js +1 -0
- package/dist/adapters/github/context.js.map +1 -1
- package/dist/adapters/github/tool-pack.d.ts +12 -0
- package/dist/adapters/github/tool-pack.d.ts.map +1 -0
- package/dist/adapters/github/tool-pack.js +30 -0
- package/dist/adapters/github/tool-pack.js.map +1 -0
- package/dist/adapters/github/types.d.ts +52 -0
- package/dist/adapters/github/types.d.ts.map +1 -1
- package/dist/adapters/github/types.js.map +1 -1
- package/dist/adapters/slack/bot.d.ts.map +1 -1
- package/dist/adapters/slack/bot.js +1 -0
- package/dist/adapters/slack/bot.js.map +1 -1
- package/dist/adapters/slack/context.d.ts.map +1 -1
- package/dist/adapters/slack/context.js +1 -0
- package/dist/adapters/slack/context.js.map +1 -1
- package/dist/adapters/telegram/bot.d.ts.map +1 -1
- package/dist/adapters/telegram/bot.js +1 -0
- package/dist/adapters/telegram/bot.js.map +1 -1
- package/dist/adapters/telegram/context.d.ts.map +1 -1
- package/dist/adapters/telegram/context.js +1 -0
- package/dist/adapters/telegram/context.js.map +1 -1
- package/dist/agent.d.ts +16 -11
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +220 -230
- package/dist/agent.js.map +1 -1
- package/dist/cli/download.d.ts.map +1 -0
- package/dist/cli/download.js.map +1 -0
- package/dist/commands/model.d.ts.map +1 -1
- package/dist/commands/model.js +1 -0
- package/dist/commands/model.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/execution-resolver.d.ts.map +1 -1
- package/dist/execution-resolver.js +8 -12
- package/dist/execution-resolver.js.map +1 -1
- package/dist/harness/models.d.ts +5 -0
- package/dist/harness/models.d.ts.map +1 -1
- package/dist/harness/models.js +10 -0
- package/dist/harness/models.js.map +1 -1
- package/dist/main.js +18 -7
- package/dist/main.js.map +1 -1
- package/dist/runtime/conversation-runtime.js +1 -1
- package/dist/runtime/conversation-runtime.js.map +1 -1
- package/dist/runtime/types.d.ts +9 -3
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/types.js.map +1 -1
- package/dist/tools/github-checks.d.ts +1 -1
- package/dist/tools/github-checks.d.ts.map +1 -1
- package/dist/tools/github-checks.js +15 -4
- package/dist/tools/github-checks.js.map +1 -1
- package/dist/tools/github-pr.d.ts +1 -1
- package/dist/tools/github-pr.d.ts.map +1 -1
- package/dist/tools/github-pr.js.map +1 -1
- package/dist/tools/index.d.ts +10 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +12 -9
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.d.ts +28 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/trigger.d.ts.map +1 -1
- package/dist/trigger.js +1 -2
- package/dist/trigger.js.map +1 -1
- package/dist/types.d.ts +18 -39
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/vault/policy.d.ts +20 -0
- package/dist/vault/policy.d.ts.map +1 -0
- package/dist/vault/policy.js +20 -0
- package/dist/vault/policy.js.map +1 -0
- package/dist/web/admin/portal.js +4 -4
- package/dist/web/admin/portal.js.map +1 -1
- package/dist/web/login/portal.js +1 -1
- package/dist/web/login/portal.js.map +1 -1
- package/dist/web/portal-shell.d.ts +4 -0
- package/dist/web/portal-shell.d.ts.map +1 -0
- package/dist/{portal-shell.js → web/portal-shell.js} +2 -2
- package/dist/web/portal-shell.js.map +1 -0
- package/dist/web/session-view/portal.js +1 -1
- package/dist/web/session-view/portal.js.map +1 -1
- package/package.json +4 -4
- package/dist/download.d.ts.map +0 -1
- package/dist/download.js.map +0 -1
- package/dist/model-registry.d.ts +0 -4
- package/dist/model-registry.d.ts.map +0 -1
- package/dist/model-registry.js +0 -7
- package/dist/model-registry.js.map +0 -1
- package/dist/portal-shell.d.ts +0 -4
- package/dist/portal-shell.d.ts.map +0 -1
- package/dist/portal-shell.js.map +0 -1
- /package/dist/{download.d.ts → cli/download.d.ts} +0 -0
- /package/dist/{download.js → cli/download.js} +0 -0
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,eAAe,EAA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AC7B,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;gBACrC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QACD,eAAe;QACf,iBAAiB;KAClB,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport type { TSchema } from \"@sinclair/typebox\";\nimport type { ConversationKind } from \"../adapter.js\";\nimport { createAttachTool } from \"../adapters/slack/tools/attach.js\";\nimport type { DockerContainerManager } from \"../provisioner.js\";\nimport type { Executor, SandboxConfig } from \"../sandbox/index.js\";\nimport { createBashTool } from \"./bash.js\";\nimport { createEditTool } from \"./edit.js\";\nimport { createEventTool, HostEventStore } from \"./event.js\";\nimport { createReactTool } from \"./react.js\";\nimport { createReadTool } from \"./read.js\";\nimport { createSandboxTool } from \"./sandbox.js\";\nimport type { PlatformToolPackFactory } from \"./types.js\";\nimport { createWriteTool } from \"./write.js\";\n\nexport function createMikanTools(\n executor: Executor,\n workspaceDir: string,\n sandboxController?: {\n sandbox: SandboxConfig;\n provisioner?: Pick<DockerContainerManager, \"getLimitStatus\" | \"setLimits\">;\n },\n /** Platform capability pack factories (e.g. GitHub PR/CI); instantiated\n * here so each runner owns its packs' bind state. Not core tools. */\n platformToolPackFactories: readonly PlatformToolPackFactory[] = [],\n): {\n tools: AgentTool<TSchema>[];\n setUploadFunction: (fn: (filePath: string, title?: string) => Promise<void>) => void;\n setReactFunction: (fn: ((emoji: string) => Promise<void>) | null) => void;\n bindPlatformToolPacks: (ctx: { conversationId: string; platformName: string }) => void;\n setEventContext: (context: {\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n userId: string;\n }) => void;\n setSandboxContext: (context: { conversationId: string; userId: string }) => void;\n} {\n const { tool: attachTool, setUploadFunction } = createAttachTool();\n const { tool: reactTool, setReactFunction } = createReactTool();\n const { tool: eventTool, setEventContext } = createEventTool(\n HostEventStore.fromWorkspaceDir(workspaceDir),\n );\n const { tool: sandboxTool, setSandboxContext } = createSandboxTool(\n sandboxController ?? { sandbox: executor.getSandboxConfig() },\n );\n const platformToolPacks = platformToolPackFactories.map((createPack) => createPack());\n const packTools = platformToolPacks.flatMap((pack) => pack.tools);\n return {\n tools: [\n createReadTool(executor),\n createBashTool(executor),\n createEditTool(executor),\n createWriteTool(executor),\n eventTool,\n sandboxTool,\n attachTool,\n reactTool,\n ...packTools,\n ],\n setUploadFunction,\n setReactFunction,\n bindPlatformToolPacks: (ctx) => {\n for (const pack of platformToolPacks) {\n pack.bindRun(ctx);\n }\n },\n setEventContext,\n setSandboxContext,\n };\n}\n"]}
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
|
+
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import type { TSchema } from "@sinclair/typebox";
|
|
1
3
|
import type { MikanEvent } from "../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Per-run context for optional platform-contributed tools (e.g. GitHub PR/CI).
|
|
6
|
+
* Core agent code binds packs without knowing which platform owns them.
|
|
7
|
+
*/
|
|
8
|
+
interface PlatformToolRunContext {
|
|
9
|
+
conversationId: string;
|
|
10
|
+
platformName: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A platform capability pack: extra tools plus a bind hook that enables or
|
|
14
|
+
* disables them for the current run. Packs are assembled at process start
|
|
15
|
+
* (main.ts) and injected into runners; they must not be hardcoded in the
|
|
16
|
+
* core tool list.
|
|
17
|
+
*/
|
|
18
|
+
export interface PlatformToolPack {
|
|
19
|
+
tools: AgentTool<TSchema>[];
|
|
20
|
+
bindRun(ctx: PlatformToolRunContext): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Injected as factories, not instances: bindRun mutates closure state inside
|
|
24
|
+
* the pack's tools, so a pack must be private to one runner (whose runs are
|
|
25
|
+
* serialized). A single shared instance would let concurrent conversations
|
|
26
|
+
* rebind each other mid-run — routing github_pr to the wrong conversation.
|
|
27
|
+
*/
|
|
28
|
+
export type PlatformToolPackFactory = () => PlatformToolPack;
|
|
2
29
|
export type EventPayload = MikanEvent;
|
|
3
30
|
export interface EventStore {
|
|
4
31
|
write(filename: string, payload: MikanEvent): Promise<{
|
|
@@ -51,4 +78,5 @@ export interface TruncationOptions {
|
|
|
51
78
|
/** Maximum number of bytes (default: 50KB) */
|
|
52
79
|
maxBytes?: number;
|
|
53
80
|
}
|
|
81
|
+
export {};
|
|
54
82
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC;AAEtC,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtF,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IACjG,IAAI,CACF,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrF,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAA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;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,eAAe,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/tools/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MikanEvent } from \"../types.js\";\n\n// ── event tool ───────────────────────────────────────────────────────────────\n\nexport type EventPayload = MikanEvent;\n\nexport interface EventStore {\n write(filename: string, payload: MikanEvent): Promise<{ path: string; size: number }>;\n list(): Promise<Array<{ filename: string; payload: MikanEvent; size: number; mtimeMs: number }>>;\n read(\n filename: string,\n ): Promise<{ filename: string; payload: MikanEvent; size: number; mtimeMs: number }>;\n update(filename: string, payload: MikanEvent): Promise<{ path: string; size: number }>;\n delete(filename: string): Promise<{ deleted: boolean }>;\n}\n\n// ── truncation ───────────────────────────────────────────────────────────────\n\nexport interface TruncationResult {\n /** The truncated content */\n content: string;\n /** Whether truncation occurred */\n truncated: boolean;\n /** Which limit was hit: \"lines\", \"bytes\", or null if not truncated */\n truncatedBy: \"lines\" | \"bytes\" | null;\n /** Total number of lines in the original content */\n totalLines: number;\n /** Total number of bytes in the original content */\n totalBytes: number;\n /** Number of complete lines in the truncated output */\n outputLines: number;\n /** Number of bytes in the truncated output */\n outputBytes: number;\n /** Whether the last line was partially truncated (only for tail truncation edge case) */\n lastLinePartial: boolean;\n /** Whether the first line exceeded the byte limit (for head truncation) */\n firstLineExceedsLimit: boolean;\n}\n\nexport interface TruncationOptions {\n /** Maximum number of lines (default: 2000) */\n maxLines?: number;\n /** Maximum number of bytes (default: 50KB) */\n maxBytes?: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport type { TSchema } from \"@sinclair/typebox\";\nimport type { MikanEvent } from \"../types.js\";\n\n// ── platform tool packs ───────────────────────────────────────────────────────\n\n/**\n * Per-run context for optional platform-contributed tools (e.g. GitHub PR/CI).\n * Core agent code binds packs without knowing which platform owns them.\n */\ninterface PlatformToolRunContext {\n conversationId: string;\n platformName: string;\n}\n\n/**\n * A platform capability pack: extra tools plus a bind hook that enables or\n * disables them for the current run. Packs are assembled at process start\n * (main.ts) and injected into runners; they must not be hardcoded in the\n * core tool list.\n */\nexport interface PlatformToolPack {\n tools: AgentTool<TSchema>[];\n bindRun(ctx: PlatformToolRunContext): void;\n}\n\n/**\n * Injected as factories, not instances: bindRun mutates closure state inside\n * the pack's tools, so a pack must be private to one runner (whose runs are\n * serialized). A single shared instance would let concurrent conversations\n * rebind each other mid-run — routing github_pr to the wrong conversation.\n */\nexport type PlatformToolPackFactory = () => PlatformToolPack;\n\n// ── event tool ───────────────────────────────────────────────────────────────\n\nexport type EventPayload = MikanEvent;\n\nexport interface EventStore {\n write(filename: string, payload: MikanEvent): Promise<{ path: string; size: number }>;\n list(): Promise<Array<{ filename: string; payload: MikanEvent; size: number; mtimeMs: number }>>;\n read(\n filename: string,\n ): Promise<{ filename: string; payload: MikanEvent; size: number; mtimeMs: number }>;\n update(filename: string, payload: MikanEvent): Promise<{ path: string; size: number }>;\n delete(filename: string): Promise<{ deleted: boolean }>;\n}\n\n// ── truncation ───────────────────────────────────────────────────────────────\n\nexport interface TruncationResult {\n /** The truncated content */\n content: string;\n /** Whether truncation occurred */\n truncated: boolean;\n /** Which limit was hit: \"lines\", \"bytes\", or null if not truncated */\n truncatedBy: \"lines\" | \"bytes\" | null;\n /** Total number of lines in the original content */\n totalLines: number;\n /** Total number of bytes in the original content */\n totalBytes: number;\n /** Number of complete lines in the truncated output */\n outputLines: number;\n /** Number of bytes in the truncated output */\n outputBytes: number;\n /** Whether the last line was partially truncated (only for tail truncation edge case) */\n lastLinePartial: boolean;\n /** Whether the first line exceeded the byte limit (for head truncation) */\n firstLineExceedsLimit: boolean;\n}\n\nexport interface TruncationOptions {\n /** Maximum number of lines (default: 2000) */\n maxLines?: number;\n /** Maximum number of bytes (default: 50KB) */\n maxBytes?: number;\n}\n"]}
|
package/dist/trigger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../src/trigger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../src/trigger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMtD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE/E;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,OAAO,CAAC,aAAa,EAAE,sBAAsB,CAAC,GACrD,aAAa,CAEf;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IACnD,KAAK,EAAE,iBAAiB,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,aAAa,CAAC,CA4BzB"}
|
package/dist/trigger.js
CHANGED
|
@@ -2,7 +2,6 @@ import { join } from "path";
|
|
|
2
2
|
import { MikanModels } from "./harness/index.js";
|
|
3
3
|
import { loadAutoReplyJudgeModel, loadConversationAutoReplyConfig } from "./config.js";
|
|
4
4
|
import * as log from "./log.js";
|
|
5
|
-
import { resolveConfiguredModel } from "./model-registry.js";
|
|
6
5
|
const JUDGE_TIMEOUT_MS = 10_000;
|
|
7
6
|
/**
|
|
8
7
|
* Trivially decide non-auto-reply intents synchronously. For "auto-reply-candidate"
|
|
@@ -65,7 +64,7 @@ function withTimeout(promise, ms) {
|
|
|
65
64
|
async function judgeAutoReplyWithLlm(input) {
|
|
66
65
|
const judgeConfig = loadAutoReplyJudgeModel(input.conversationDir);
|
|
67
66
|
const models = MikanModels.create();
|
|
68
|
-
const model =
|
|
67
|
+
const model = models.resolve(judgeConfig.provider, judgeConfig.model);
|
|
69
68
|
const answer = await models.models.completeSimple(model, {
|
|
70
69
|
systemPrompt: "You decide whether a bot should reply to a group/channel message. " +
|
|
71
70
|
"Use only the rules provided by the user. Answer exactly YES or NO.",
|
package/dist/trigger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../src/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../src/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,MAAM,gBAAgB,GAA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MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAEtE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,cAAc,CAC/C,KAAK,EACL;QACE,YAAY,EACV,oEAAoE;YACpE,oEAAoE;QACtE,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gBACrB,OAAO,EAAE;oBACP,QAAQ;oBACR,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC5D,EAAE;oBACF,UAAU;oBACV,KAAK,CAAC,KAAK,CAAC,IAAI;oBAChB,EAAE;oBACF,iDAAiD;iBAClD,CAAC,IAAI,CAAC,IAAI,CAAC;aACb;SACF;KACF,EACD;QACE,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,SAAS;KACrB,CACF,CAAC;IACF,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO;SACxB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;SACtC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,IAAI,CAAC,EAAE,CAAC;SACR,IAAI,EAAE;SACN,WAAW,EAAE,CAAC;IACjB,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import { join } from \"path\";\nimport { MikanModels } from \"./harness/index.js\";\nimport type { ConversationEvent } from \"./adapter.js\";\nimport { loadAutoReplyJudgeModel, loadConversationAutoReplyConfig } from \"./config.js\";\nimport * as log from \"./log.js\";\n\nconst JUDGE_TIMEOUT_MS = 10_000;\n\nexport type { AutoReplyJudge, TriggerIntent, TriggerResult } from \"./types.js\";\nimport type { AutoReplyJudge, TriggerIntent, TriggerResult } from \"./types.js\";\n\n/**\n * Trivially decide non-auto-reply intents synchronously. For \"auto-reply-candidate\"\n * callers must use {@link evaluateAutoReplyPolicy}.\n */\nexport function decideTrigger(\n intent: Exclude<TriggerIntent, \"auto-reply-candidate\">,\n): TriggerResult {\n return { trigger: true, reason: intent };\n}\n\n/**\n * Decide whether to auto-reply. Never throws — judge errors and timeouts are\n * folded into a `trigger: false` result with a distinct reason, so adapters\n * can apply a single uniform \"do not trigger, but still log\" policy.\n *\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport async function evaluateAutoReplyPolicy(input: {\n event: ConversationEvent;\n workingDir: string | undefined;\n judge?: AutoReplyJudge;\n timeoutMs?: number;\n}): Promise<TriggerResult> {\n const { event, workingDir, judge = judgeAutoReplyWithLlm, timeoutMs = JUDGE_TIMEOUT_MS } = input;\n if (!workingDir) return { trigger: false, reason: \"auto-reply-unconfigured\" };\n\n const conversationDir = join(workingDir, event.conversationId);\n\n try {\n const config = loadConversationAutoReplyConfig(conversationDir);\n if (!config.enabled) return { trigger: false, reason: \"auto-reply-disabled\" };\n if (config.rules.length === 0) {\n return { trigger: true, reason: \"auto-reply-enabled\" };\n }\n\n const shouldReply = await withTimeout(\n judge({ event, rules: config.rules, conversationDir }),\n timeoutMs,\n );\n return shouldReply\n ? { trigger: true, reason: \"auto-reply-rule-match\" }\n : { trigger: false, reason: \"auto-reply-rule-no-match\" };\n } catch (err) {\n if (err instanceof JudgeTimeoutError) {\n log.logWarning(\"Auto-reply judge timed out\", String(err));\n return { trigger: false, reason: \"auto-reply-judge-timeout\" };\n }\n log.logWarning(\"Auto-reply policy evaluation failed\", String(err));\n return { trigger: false, reason: \"auto-reply-judge-failed\" };\n }\n}\n\nclass JudgeTimeoutError extends Error {\n constructor(ms: number) {\n super(`auto-reply judge exceeded ${ms}ms`);\n this.name = \"JudgeTimeoutError\";\n }\n}\n\nfunction withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => reject(new JudgeTimeoutError(ms)), ms);\n promise.then(\n (value) => {\n clearTimeout(timer);\n resolve(value);\n },\n (err) => {\n clearTimeout(timer);\n reject(err);\n },\n );\n });\n}\n\nasync function judgeAutoReplyWithLlm(input: {\n event: ConversationEvent;\n rules: string[];\n conversationDir: string;\n}): Promise<boolean> {\n const judgeConfig = loadAutoReplyJudgeModel(input.conversationDir);\n const models = MikanModels.create();\n const model = models.resolve(judgeConfig.provider, judgeConfig.model);\n\n const answer = await models.models.completeSimple(\n model,\n {\n systemPrompt:\n \"You decide whether a bot should reply to a group/channel message. \" +\n \"Use only the rules provided by the user. Answer exactly YES or NO.\",\n messages: [\n {\n role: \"user\",\n timestamp: Date.now(),\n content: [\n \"Rules:\",\n ...input.rules.map((rule, index) => `${index + 1}. ${rule}`),\n \"\",\n \"Message:\",\n input.event.text,\n \"\",\n \"Should the bot reply? Answer exactly YES or NO.\",\n ].join(\"\\n\"),\n },\n ],\n },\n {\n temperature: 0,\n maxTokens: 4,\n reasoning: \"minimal\",\n },\n );\n const text = answer.content\n .filter((part) => part.type === \"text\")\n .map((part) => part.text)\n .join(\"\")\n .trim()\n .toUpperCase();\n return /^YES\\b/.test(text);\n}\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -4,6 +4,16 @@ declare const execFileAsync: typeof execFile.__promisify__;
|
|
|
4
4
|
type ExecFileAsync = typeof execFileAsync;
|
|
5
5
|
export type ConversationKind = "direct" | "shared";
|
|
6
6
|
export type PlatformName = "slack" | "discord" | "telegram" | "github";
|
|
7
|
+
/**
|
|
8
|
+
* Who can drive conversations on a platform — gates ambient credential policy.
|
|
9
|
+
*
|
|
10
|
+
* - `membership`: only invited workspace/server members (Slack/Discord/Telegram).
|
|
11
|
+
* Safe to copy `sandbox.defaultSharedVault` into new conversation vaults.
|
|
12
|
+
* - `open-trigger`: broader trigger surface (e.g. GitHub repo writers on public
|
|
13
|
+
* issues/PRs). Ambient shared vault must not apply; use host-side platform
|
|
14
|
+
* identity or an explicitly provisioned vault.
|
|
15
|
+
*/
|
|
16
|
+
export type PlatformTrustModel = "membership" | "open-trigger";
|
|
7
17
|
export interface ConversationMessage {
|
|
8
18
|
id: string;
|
|
9
19
|
sessionKey: string;
|
|
@@ -59,6 +69,12 @@ export interface MessagingInfo {
|
|
|
59
69
|
userName: string;
|
|
60
70
|
displayName: string;
|
|
61
71
|
}[];
|
|
72
|
+
/**
|
|
73
|
+
* Trust boundary for ambient credentials. Defaults to `membership` when
|
|
74
|
+
* omitted (closed chat platforms). Open-trigger platforms must set this
|
|
75
|
+
* explicitly so vault policy does not key off platform name strings.
|
|
76
|
+
*/
|
|
77
|
+
trustModel?: PlatformTrustModel;
|
|
62
78
|
diagnostics?: {
|
|
63
79
|
showUsageSummary?: boolean;
|
|
64
80
|
};
|
|
@@ -159,45 +175,6 @@ export type PlatformNotifier = (conversationId: string, text: string, platform?:
|
|
|
159
175
|
* extension `api.react`; implemented in main.ts over the platform bots.
|
|
160
176
|
*/
|
|
161
177
|
export type PlatformReactor = (conversationId: string, messageTs: string, emoji: string, platform?: string) => Promise<void>;
|
|
162
|
-
export interface GithubPrRequest {
|
|
163
|
-
/** Local branch in the conversation's ./repo clone; must match pi/<name>. */
|
|
164
|
-
branch: string;
|
|
165
|
-
title: string;
|
|
166
|
-
body?: string;
|
|
167
|
-
/** Target branch; defaults to the repository's default branch. */
|
|
168
|
-
base?: string;
|
|
169
|
-
draft?: boolean;
|
|
170
|
-
}
|
|
171
|
-
export interface GithubPrResult {
|
|
172
|
-
number: number;
|
|
173
|
-
url: string;
|
|
174
|
-
/** True when the branch already had an open PR that this push updated. */
|
|
175
|
-
updatedExisting?: boolean;
|
|
176
|
-
}
|
|
177
|
-
export interface GithubCheckSummary {
|
|
178
|
-
/** Check-run id; for GitHub Actions checks it is also the job id for log fetch. */
|
|
179
|
-
id: number;
|
|
180
|
-
name: string;
|
|
181
|
-
/** queued | in_progress | completed */
|
|
182
|
-
status: string;
|
|
183
|
-
/** success | failure | … ; null while the run is still in progress */
|
|
184
|
-
conclusion: string | null;
|
|
185
|
-
url: string | null;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Host-side GitHub operations backing the github_* tools; implemented in
|
|
189
|
-
* main.ts over the GitHub bot so tokens stay host-side. One object rather
|
|
190
|
-
* than one callback per capability, so growing the tool surface doesn't grow
|
|
191
|
-
* the injection plumbing.
|
|
192
|
-
*/
|
|
193
|
-
export interface PlatformGithubOps {
|
|
194
|
-
/** Push a prepared pi/* branch and open (or update) a pull request. */
|
|
195
|
-
pushAndCreatePr(conversationId: string, request: GithubPrRequest): Promise<GithubPrResult>;
|
|
196
|
-
/** CI check runs for a branch, or for the conversation's PR head when omitted. */
|
|
197
|
-
getChecks(conversationId: string, branch?: string): Promise<GithubCheckSummary[]>;
|
|
198
|
-
/** Log text of one CI job (an Actions check-run id), tail-truncated. */
|
|
199
|
-
getJobLog(conversationId: string, jobId: number): Promise<string>;
|
|
200
|
-
}
|
|
201
178
|
/** Normalized platform data and reply hook for one event. */
|
|
202
179
|
export interface ConversationContext {
|
|
203
180
|
message: ConversationMessage;
|
|
@@ -310,6 +287,8 @@ export interface ActorContext {
|
|
|
310
287
|
platform: string;
|
|
311
288
|
userId: string;
|
|
312
289
|
conversationId: string;
|
|
290
|
+
/** From MessagingInfo.trustModel; vault policy uses this, not platform name. */
|
|
291
|
+
trustModel?: PlatformTrustModel;
|
|
313
292
|
}
|
|
314
293
|
export type ImageWorkspaceMountMode = "private" | "full";
|
|
315
294
|
export interface LogContext {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,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E,iBAAiB,CAAC;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { execFile } from \"child_process\";\nimport { promisify } from \"util\";\n\nconst execFileAsync = promisify(execFile);\ntype ExecFileAsync = typeof execFileAsync;\n\n// ── adapter ───────────────────────────────────────────────────────────────────\n\nexport type ConversationKind = \"direct\" | \"shared\";\n\nexport type PlatformName = \"slack\" | \"discord\" | \"telegram\" | \"github\";\n\nexport interface ConversationMessage {\n id: string;\n sessionKey: string;\n conversationKind: ConversationKind;\n userId: string;\n userName?: string;\n text: string;\n attachments?: { name: string; localPath: string }[];\n threadTs?: string;\n}\n\nexport interface ChatToolResult {\n toolName: string;\n label?: string;\n args?: Record<string, unknown>;\n result: string;\n isError: boolean;\n durationMs: number;\n}\n\nexport interface ConversationResponder {\n respond(text: string): Promise<void>;\n appendResponseDelta?(delta: string): Promise<void>;\n finishResponse?(finalText?: string): Promise<void>;\n replaceResponse(text: string, options?: { createOverflowLink?: () => string }): Promise<void>;\n respondDiagnostic(text: string, options?: { style?: \"muted\" | \"error\" }): Promise<void>;\n respondToolResult(result: ChatToolResult): Promise<void>;\n setTyping(isTyping: boolean): Promise<void>;\n setWorking(working: boolean): Promise<void>;\n uploadFile(filePath: string, title?: string): Promise<void>;\n /**\n * React to the message that triggered this run with an emoji short name\n * (no colons). Optional: platforms/contexts without reaction support omit\n * it, and callers must handle its absence.\n */\n react?(emoji: string): Promise<void>;\n deleteResponse(): Promise<void>;\n}\n\nexport interface MessagingInfo {\n name: string;\n formattingGuide: string;\n channels: { id: string; name: string }[];\n users: { id: string; userName: string; displayName: string }[];\n diagnostics?: {\n showUsageSummary?: boolean;\n };\n}\n\nexport interface ChatAdapter {\n start(): Promise<void>;\n stop(): Promise<void>;\n getMessagingInfo(): MessagingInfo;\n}\n\nexport type AgentEventPayload =\n | { kind: \"sessionStart\" }\n | { kind: \"responseDelta\"; delta: string }\n | { kind: \"responseFinal\"; text: string }\n | { kind: \"diagnostic\"; text: string }\n | { kind: \"toolStart\"; toolId: string; toolName: string; input?: unknown }\n | { kind: \"toolEnd\"; toolId: string }\n | { kind: \"turnEnd\"; awaitingInput?: boolean }\n | { kind: \"sessionEnd\"; reason?: string };\n\nexport interface AgentEventEnvelope {\n source: \"mikan\";\n sessionId: string;\n actorName: string;\n event: AgentEventPayload;\n}\n\n/**\n * A platform-agnostic event (message/mention) that triggers the agent.\n */\nexport interface ConversationEvent {\n type: string;\n /** Platform-specific raw conversation/channel/chat identifier */\n conversationId: string;\n /** Optional alternate conversation identity used for vault routing. */\n vaultConversationId?: string;\n /** Cross-platform conversation shape: direct message vs shared space */\n conversationKind: ConversationKind;\n /** Message timestamp or ID as string */\n ts: string;\n /** Parent message ID for threaded replies (optional) */\n thread_ts?: string;\n /** User ID */\n user: string;\n /** Message text (already stripped of bot mentions) */\n text: string;\n /** Downloaded attachments */\n attachments?: { name: string; localPath: string }[];\n /** Platform-computed session key; overrides default conversationId:thread_ts computation */\n sessionKey?: string;\n}\n\n/**\n * Minimum interface that every platform bot must implement,\n * used by the central handler in main.ts and by EventsWatcher.\n */\nexport interface MessagingBot {\n start(): Promise<void>;\n postMessage(channel: string, text: string): Promise<string>;\n updateMessage(channel: string, ts: string, text: string): Promise<void>;\n /**\n * Add an emoji reaction to a message. `emoji` is a platform-agnostic short\n * name without colons (e.g. \"eyes\", \"white_check_mark\"). Optional so\n * adapters adopt it incrementally; callers must handle its absence.\n */\n addReaction?(channel: string, messageTs: string, emoji: string): Promise<void>;\n enqueueEvent(event: ConversationEvent): boolean;\n getMessagingInfo(): MessagingInfo;\n postPrivate?(conversationId: string, userId: string, text: string): Promise<void>;\n postPrivateDiagnostic?(\n conversationId: string,\n userId: string,\n text: string,\n options?: { style?: \"muted\" | \"error\" },\n ): Promise<void>;\n}\n\n/**\n * Post a plain message to a conversation without triggering an agent run.\n * Backs extension `api.notify`; implemented in main.ts over the platform bots.\n * `platform` is required only when more than one platform is running.\n */\nexport type PlatformNotifier = (\n conversationId: string,\n text: string,\n platform?: string,\n) => Promise<void>;\n\n/**\n * Add an emoji reaction to a message without triggering an agent run. Backs\n * extension `api.react`; implemented in main.ts over the platform bots.\n */\nexport type PlatformReactor = (\n conversationId: string,\n messageTs: string,\n emoji: string,\n platform?: string,\n) => Promise<void>;\n\nexport interface GithubPrRequest {\n /** Local branch in the conversation's ./repo clone; must match pi/<name>. */\n branch: string;\n title: string;\n body?: string;\n /** Target branch; defaults to the repository's default branch. */\n base?: string;\n draft?: boolean;\n}\n\nexport interface GithubPrResult {\n number: number;\n url: string;\n /** True when the branch already had an open PR that this push updated. */\n updatedExisting?: boolean;\n}\n\nexport interface GithubCheckSummary {\n /** Check-run id; for GitHub Actions checks it is also the job id for log fetch. */\n id: number;\n name: string;\n /** queued | in_progress | completed */\n status: string;\n /** success | failure | … ; null while the run is still in progress */\n conclusion: string | null;\n url: string | null;\n}\n\n/**\n * Host-side GitHub operations backing the github_* tools; implemented in\n * main.ts over the GitHub bot so tokens stay host-side. One object rather\n * than one callback per capability, so growing the tool surface doesn't grow\n * the injection plumbing.\n */\nexport interface PlatformGithubOps {\n /** Push a prepared pi/* branch and open (or update) a pull request. */\n pushAndCreatePr(conversationId: string, request: GithubPrRequest): Promise<GithubPrResult>;\n /** CI check runs for a branch, or for the conversation's PR head when omitted. */\n getChecks(conversationId: string, branch?: string): Promise<GithubCheckSummary[]>;\n /** Log text of one CI job (an Actions check-run id), tail-truncated. */\n getJobLog(conversationId: string, jobId: number): Promise<string>;\n}\n\n/** Normalized platform data and reply hook for one event. */\nexport interface ConversationContext {\n message: ConversationMessage;\n responder: ConversationResponder;\n platform: MessagingInfo;\n}\n\nexport interface RunningSession {\n sessionKey: string;\n startedAt: number;\n lastActivityAt?: number;\n currentTool?: string;\n}\n\nexport interface MessagingEventHandler {\n isRunning(sessionKey: string): boolean;\n getRunningSessions(): RunningSession[];\n handleEvent(\n event: ConversationEvent,\n bot: MessagingBot,\n context: ConversationContext,\n ): Promise<void>;\n handleStop(sessionKey: string, conversationId: string, bot: MessagingBot): Promise<void>;\n forceStop(sessionKey: string): void;\n handleNewCommand(sessionKey: string, conversationId: string, bot: MessagingBot): Promise<void>;\n}\n\n// ── agent ─────────────────────────────────────────────────────────────────────\n\nexport interface PiAgentWrapper {\n syncChatHistory(currentMessageId?: string): void;\n run(\n message: ConversationMessage,\n responder: ConversationResponder,\n platform: MessagingInfo,\n ): Promise<{ stopReason: string; errorMessage?: string }>;\n abort(): void;\n getCurrentStep(): { toolName?: string; label?: string } | undefined;\n}\n\n// ── config ────────────────────────────────────────────────────────────────────\n\nexport interface AgentConfig {\n provider: string;\n model: string;\n thinkingLevel: ThinkingLevel;\n sentryDsn?: string;\n sandboxCpus?: string;\n sandboxMemory?: string;\n sandboxBoostCpus?: string;\n sandboxBoostMemory?: string;\n sandboxImageWorkspaceMount?: \"private\" | \"full\";\n defaultSharedVault?: string;\n slack?: {\n replyMode?: \"top-level\" | \"thread\";\n };\n}\n\n/**\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport interface AutoReplyConfig {\n enabled: boolean;\n rules: string[];\n}\n\nexport interface JudgeModelConfig {\n provider: string;\n model: string;\n}\n\n// ── context ───────────────────────────────────────────────────────────────────\n\n/**\n * Platform conversation history entry from log.jsonl.\n */\nexport interface ConversationLogMessage {\n date?: string;\n ts?: string;\n threadTs?: string;\n user?: string;\n userName?: string;\n text?: string;\n isMessagingBot?: boolean;\n}\n\n// ── events ────────────────────────────────────────────────────────────────────\n\nexport interface ImmediateEvent {\n type: \"immediate\";\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n userId?: string;\n text: string;\n}\n\nexport interface OneShotEvent {\n type: \"one-shot\";\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n userId?: string;\n text: string;\n at: string;\n}\n\nexport interface PeriodicEvent {\n type: \"periodic\";\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n userId?: string;\n text: string;\n schedule: string;\n timezone: string;\n}\n\nexport type MikanEvent = ImmediateEvent | OneShotEvent | PeriodicEvent;\n\nexport interface PeriodicEventInfo {\n filename: string;\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n text: string;\n schedule: string;\n timezone: string;\n nextRun: string | null;\n}\n\n// ── execution-resolver ────────────────────────────────────────────────────────\n\nexport interface ActorContext {\n platform: string;\n userId: string;\n conversationId: string;\n}\n\nexport type ImageWorkspaceMountMode = \"private\" | \"full\";\n\n// ── log ───────────────────────────────────────────────────────────────────────\n\nexport interface LogContext {\n conversationId: string;\n userName?: string;\n conversationName?: string;\n sessionId?: string;\n}\n\n// ── portal-shell ──────────────────────────────────────────────────────────────\n\ntype PortalView = \"admin\" | \"session\" | \"vault\";\n\nexport interface PortalShellOptions {\n activeView: PortalView;\n pageTitle: string;\n identity?: {\n primary: string;\n secondary?: string;\n };\n conversationSwitcher?: {\n currentId: string;\n options?: Array<{ id: string; label: string; running?: boolean }>;\n };\n navLinks?: Partial<Record<PortalView, string>>;\n body: string;\n extraStyles?: string;\n inlineScript?: string;\n extraHead?: string;\n bodyAttributes?: Record<string, string>;\n}\n\n// ── provisioner ───────────────────────────────────────────────────────────────\n\nexport interface ContainerMount {\n source: string;\n target: string;\n}\n\nexport interface ResourceLimits {\n cpus?: string;\n memory?: string;\n}\n\nexport interface SandboxLimitStatus {\n limits?: ResourceLimits;\n boosted: boolean;\n}\n\nexport interface ProvisionOptions {\n containerName?: string;\n mounts?: ContainerMount[];\n conversationId?: string;\n}\n\nexport interface DockerContainerManagerOptions {\n limits?: ResourceLimits;\n boostLimits?: ResourceLimits;\n execFileImpl?: ExecFileAsync;\n}\n\n// ── store ─────────────────────────────────────────────────────────────────────\n\nexport interface Attachment {\n original: string;\n localPath: string;\n}\n\nexport interface LoggedMessage {\n date: string;\n ts: string;\n user: string;\n userName?: string;\n displayName?: string;\n text: string;\n attachments: Attachment[];\n isMessagingBot: boolean;\n threadTs?: string;\n}\n\nexport interface ChannelStoreConfig {\n workingDir: string;\n botToken: string;\n}\n\n// ── trigger ───────────────────────────────────────────────────────────────────\n\nexport type TriggerIntent = \"mention\" | \"direct\" | \"thread-continuation\" | \"auto-reply-candidate\";\n\nexport type TriggerResult = { trigger: true; reason: string } | { trigger: false; reason: string };\n\n/**\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport type AutoReplyJudge = (input: {\n event: ConversationEvent;\n rules: string[];\n conversationDir: string;\n}) => Promise<boolean>;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { execFile } from \"child_process\";\nimport { promisify } from \"util\";\n\nconst execFileAsync = promisify(execFile);\ntype ExecFileAsync = typeof execFileAsync;\n\n// ── adapter ───────────────────────────────────────────────────────────────────\n\nexport type ConversationKind = \"direct\" | \"shared\";\n\nexport type PlatformName = \"slack\" | \"discord\" | \"telegram\" | \"github\";\n\n/**\n * Who can drive conversations on a platform — gates ambient credential policy.\n *\n * - `membership`: only invited workspace/server members (Slack/Discord/Telegram).\n * Safe to copy `sandbox.defaultSharedVault` into new conversation vaults.\n * - `open-trigger`: broader trigger surface (e.g. GitHub repo writers on public\n * issues/PRs). Ambient shared vault must not apply; use host-side platform\n * identity or an explicitly provisioned vault.\n */\nexport type PlatformTrustModel = \"membership\" | \"open-trigger\";\n\nexport interface ConversationMessage {\n id: string;\n sessionKey: string;\n conversationKind: ConversationKind;\n userId: string;\n userName?: string;\n text: string;\n attachments?: { name: string; localPath: string }[];\n threadTs?: string;\n}\n\nexport interface ChatToolResult {\n toolName: string;\n label?: string;\n args?: Record<string, unknown>;\n result: string;\n isError: boolean;\n durationMs: number;\n}\n\nexport interface ConversationResponder {\n respond(text: string): Promise<void>;\n appendResponseDelta?(delta: string): Promise<void>;\n finishResponse?(finalText?: string): Promise<void>;\n replaceResponse(text: string, options?: { createOverflowLink?: () => string }): Promise<void>;\n respondDiagnostic(text: string, options?: { style?: \"muted\" | \"error\" }): Promise<void>;\n respondToolResult(result: ChatToolResult): Promise<void>;\n setTyping(isTyping: boolean): Promise<void>;\n setWorking(working: boolean): Promise<void>;\n uploadFile(filePath: string, title?: string): Promise<void>;\n /**\n * React to the message that triggered this run with an emoji short name\n * (no colons). Optional: platforms/contexts without reaction support omit\n * it, and callers must handle its absence.\n */\n react?(emoji: string): Promise<void>;\n deleteResponse(): Promise<void>;\n}\n\nexport interface MessagingInfo {\n name: string;\n formattingGuide: string;\n channels: { id: string; name: string }[];\n users: { id: string; userName: string; displayName: string }[];\n /**\n * Trust boundary for ambient credentials. Defaults to `membership` when\n * omitted (closed chat platforms). Open-trigger platforms must set this\n * explicitly so vault policy does not key off platform name strings.\n */\n trustModel?: PlatformTrustModel;\n diagnostics?: {\n showUsageSummary?: boolean;\n };\n}\n\nexport interface ChatAdapter {\n start(): Promise<void>;\n stop(): Promise<void>;\n getMessagingInfo(): MessagingInfo;\n}\n\nexport type AgentEventPayload =\n | { kind: \"sessionStart\" }\n | { kind: \"responseDelta\"; delta: string }\n | { kind: \"responseFinal\"; text: string }\n | { kind: \"diagnostic\"; text: string }\n | { kind: \"toolStart\"; toolId: string; toolName: string; input?: unknown }\n | { kind: \"toolEnd\"; toolId: string }\n | { kind: \"turnEnd\"; awaitingInput?: boolean }\n | { kind: \"sessionEnd\"; reason?: string };\n\nexport interface AgentEventEnvelope {\n source: \"mikan\";\n sessionId: string;\n actorName: string;\n event: AgentEventPayload;\n}\n\n/**\n * A platform-agnostic event (message/mention) that triggers the agent.\n */\nexport interface ConversationEvent {\n type: string;\n /** Platform-specific raw conversation/channel/chat identifier */\n conversationId: string;\n /** Optional alternate conversation identity used for vault routing. */\n vaultConversationId?: string;\n /** Cross-platform conversation shape: direct message vs shared space */\n conversationKind: ConversationKind;\n /** Message timestamp or ID as string */\n ts: string;\n /** Parent message ID for threaded replies (optional) */\n thread_ts?: string;\n /** User ID */\n user: string;\n /** Message text (already stripped of bot mentions) */\n text: string;\n /** Downloaded attachments */\n attachments?: { name: string; localPath: string }[];\n /** Platform-computed session key; overrides default conversationId:thread_ts computation */\n sessionKey?: string;\n}\n\n/**\n * Minimum interface that every platform bot must implement,\n * used by the central handler in main.ts and by EventsWatcher.\n */\nexport interface MessagingBot {\n start(): Promise<void>;\n postMessage(channel: string, text: string): Promise<string>;\n updateMessage(channel: string, ts: string, text: string): Promise<void>;\n /**\n * Add an emoji reaction to a message. `emoji` is a platform-agnostic short\n * name without colons (e.g. \"eyes\", \"white_check_mark\"). Optional so\n * adapters adopt it incrementally; callers must handle its absence.\n */\n addReaction?(channel: string, messageTs: string, emoji: string): Promise<void>;\n enqueueEvent(event: ConversationEvent): boolean;\n getMessagingInfo(): MessagingInfo;\n postPrivate?(conversationId: string, userId: string, text: string): Promise<void>;\n postPrivateDiagnostic?(\n conversationId: string,\n userId: string,\n text: string,\n options?: { style?: \"muted\" | \"error\" },\n ): Promise<void>;\n}\n\n/**\n * Post a plain message to a conversation without triggering an agent run.\n * Backs extension `api.notify`; implemented in main.ts over the platform bots.\n * `platform` is required only when more than one platform is running.\n */\nexport type PlatformNotifier = (\n conversationId: string,\n text: string,\n platform?: string,\n) => Promise<void>;\n\n/**\n * Add an emoji reaction to a message without triggering an agent run. Backs\n * extension `api.react`; implemented in main.ts over the platform bots.\n */\nexport type PlatformReactor = (\n conversationId: string,\n messageTs: string,\n emoji: string,\n platform?: string,\n) => Promise<void>;\n\n/** Normalized platform data and reply hook for one event. */\nexport interface ConversationContext {\n message: ConversationMessage;\n responder: ConversationResponder;\n platform: MessagingInfo;\n}\n\nexport interface RunningSession {\n sessionKey: string;\n startedAt: number;\n lastActivityAt?: number;\n currentTool?: string;\n}\n\nexport interface MessagingEventHandler {\n isRunning(sessionKey: string): boolean;\n getRunningSessions(): RunningSession[];\n handleEvent(\n event: ConversationEvent,\n bot: MessagingBot,\n context: ConversationContext,\n ): Promise<void>;\n handleStop(sessionKey: string, conversationId: string, bot: MessagingBot): Promise<void>;\n forceStop(sessionKey: string): void;\n handleNewCommand(sessionKey: string, conversationId: string, bot: MessagingBot): Promise<void>;\n}\n\n// ── agent ─────────────────────────────────────────────────────────────────────\n\nexport interface PiAgentWrapper {\n syncChatHistory(currentMessageId?: string): void;\n run(\n message: ConversationMessage,\n responder: ConversationResponder,\n platform: MessagingInfo,\n ): Promise<{ stopReason: string; errorMessage?: string }>;\n abort(): void;\n getCurrentStep(): { toolName?: string; label?: string } | undefined;\n}\n\n// ── config ────────────────────────────────────────────────────────────────────\n\nexport interface AgentConfig {\n provider: string;\n model: string;\n thinkingLevel: ThinkingLevel;\n sentryDsn?: string;\n sandboxCpus?: string;\n sandboxMemory?: string;\n sandboxBoostCpus?: string;\n sandboxBoostMemory?: string;\n sandboxImageWorkspaceMount?: \"private\" | \"full\";\n defaultSharedVault?: string;\n slack?: {\n replyMode?: \"top-level\" | \"thread\";\n };\n}\n\n/**\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport interface AutoReplyConfig {\n enabled: boolean;\n rules: string[];\n}\n\nexport interface JudgeModelConfig {\n provider: string;\n model: string;\n}\n\n// ── context ───────────────────────────────────────────────────────────────────\n\n/**\n * Platform conversation history entry from log.jsonl.\n */\nexport interface ConversationLogMessage {\n date?: string;\n ts?: string;\n threadTs?: string;\n user?: string;\n userName?: string;\n text?: string;\n isMessagingBot?: boolean;\n}\n\n// ── events ────────────────────────────────────────────────────────────────────\n\nexport interface ImmediateEvent {\n type: \"immediate\";\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n userId?: string;\n text: string;\n}\n\nexport interface OneShotEvent {\n type: \"one-shot\";\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n userId?: string;\n text: string;\n at: string;\n}\n\nexport interface PeriodicEvent {\n type: \"periodic\";\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n userId?: string;\n text: string;\n schedule: string;\n timezone: string;\n}\n\nexport type MikanEvent = ImmediateEvent | OneShotEvent | PeriodicEvent;\n\nexport interface PeriodicEventInfo {\n filename: string;\n platform: string;\n conversationId: string;\n conversationKind: ConversationKind;\n text: string;\n schedule: string;\n timezone: string;\n nextRun: string | null;\n}\n\n// ── execution-resolver ────────────────────────────────────────────────────────\n\nexport interface ActorContext {\n platform: string;\n userId: string;\n conversationId: string;\n /** From MessagingInfo.trustModel; vault policy uses this, not platform name. */\n trustModel?: PlatformTrustModel;\n}\n\nexport type ImageWorkspaceMountMode = \"private\" | \"full\";\n\n// ── log ───────────────────────────────────────────────────────────────────────\n\nexport interface LogContext {\n conversationId: string;\n userName?: string;\n conversationName?: string;\n sessionId?: string;\n}\n\n// ── portal shell (src/web/portal-shell.ts) ────────────────────────────────────\n\ntype PortalView = \"admin\" | \"session\" | \"vault\";\n\nexport interface PortalShellOptions {\n activeView: PortalView;\n pageTitle: string;\n identity?: {\n primary: string;\n secondary?: string;\n };\n conversationSwitcher?: {\n currentId: string;\n options?: Array<{ id: string; label: string; running?: boolean }>;\n };\n navLinks?: Partial<Record<PortalView, string>>;\n body: string;\n extraStyles?: string;\n inlineScript?: string;\n extraHead?: string;\n bodyAttributes?: Record<string, string>;\n}\n\n// ── provisioner ───────────────────────────────────────────────────────────────\n\nexport interface ContainerMount {\n source: string;\n target: string;\n}\n\nexport interface ResourceLimits {\n cpus?: string;\n memory?: string;\n}\n\nexport interface SandboxLimitStatus {\n limits?: ResourceLimits;\n boosted: boolean;\n}\n\nexport interface ProvisionOptions {\n containerName?: string;\n mounts?: ContainerMount[];\n conversationId?: string;\n}\n\nexport interface DockerContainerManagerOptions {\n limits?: ResourceLimits;\n boostLimits?: ResourceLimits;\n execFileImpl?: ExecFileAsync;\n}\n\n// ── store ─────────────────────────────────────────────────────────────────────\n\nexport interface Attachment {\n original: string;\n localPath: string;\n}\n\nexport interface LoggedMessage {\n date: string;\n ts: string;\n user: string;\n userName?: string;\n displayName?: string;\n text: string;\n attachments: Attachment[];\n isMessagingBot: boolean;\n threadTs?: string;\n}\n\nexport interface ChannelStoreConfig {\n workingDir: string;\n botToken: string;\n}\n\n// ── trigger ───────────────────────────────────────────────────────────────────\n\nexport type TriggerIntent = \"mention\" | \"direct\" | \"thread-continuation\" | \"auto-reply-candidate\";\n\nexport type TriggerResult = { trigger: true; reason: string } | { trigger: false; reason: string };\n\n/**\n * @deprecated Auto-reply is kept for compatibility while its future is undecided.\n */\nexport type AutoReplyJudge = (input: {\n event: ConversationEvent;\n rules: string[];\n conversationDir: string;\n}) => Promise<boolean>;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PlatformTrustModel } from "../types.js";
|
|
2
|
+
import type { SandboxConfig } from "../sandbox/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Decide whether a new conversation vault may inherit `sandbox.defaultSharedVault`.
|
|
5
|
+
*
|
|
6
|
+
* Ambient copy is a membership-trust convenience: only appropriate when the
|
|
7
|
+
* people who can drive the agent are already gated by platform membership
|
|
8
|
+
* (Slack/Discord/Telegram). Open-trigger surfaces (GitHub issue/PR comments)
|
|
9
|
+
* must not inherit ambient credentials — host-side platform identity or an
|
|
10
|
+
* explicitly provisioned vault only.
|
|
11
|
+
*
|
|
12
|
+
* Topology: only isolated sandboxes (`image` / `cloudflare`) auto-provision
|
|
13
|
+
* per-conversation vaults that receive the copy. `host` / `container` /
|
|
14
|
+
* `firecracker` do not use this ambient path.
|
|
15
|
+
*/
|
|
16
|
+
export declare function allowsAmbientDefaultSharedVault(options: {
|
|
17
|
+
trustModel?: PlatformTrustModel;
|
|
18
|
+
sandboxType: SandboxConfig["type"];
|
|
19
|
+
}): boolean;
|
|
20
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/vault/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE;IACvD,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACpC,GAAG,OAAO,CAIV"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decide whether a new conversation vault may inherit `sandbox.defaultSharedVault`.
|
|
3
|
+
*
|
|
4
|
+
* Ambient copy is a membership-trust convenience: only appropriate when the
|
|
5
|
+
* people who can drive the agent are already gated by platform membership
|
|
6
|
+
* (Slack/Discord/Telegram). Open-trigger surfaces (GitHub issue/PR comments)
|
|
7
|
+
* must not inherit ambient credentials — host-side platform identity or an
|
|
8
|
+
* explicitly provisioned vault only.
|
|
9
|
+
*
|
|
10
|
+
* Topology: only isolated sandboxes (`image` / `cloudflare`) auto-provision
|
|
11
|
+
* per-conversation vaults that receive the copy. `host` / `container` /
|
|
12
|
+
* `firecracker` do not use this ambient path.
|
|
13
|
+
*/
|
|
14
|
+
export function allowsAmbientDefaultSharedVault(options) {
|
|
15
|
+
const trustModel = options.trustModel ?? "membership";
|
|
16
|
+
if (trustModel === "open-trigger")
|
|
17
|
+
return false;
|
|
18
|
+
return options.sandboxType === "image" || options.sandboxType === "cloudflare";
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/vault/policy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAG/C;IACC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACtD,IAAI,UAAU,KAAK,cAAc;QAAE,OAAO,KAAK,CAAC;IAChD,OAAO,OAAO,CAAC,WAAW,KAAK,OAAO,IAAI,OAAO,CAAC,WAAW,KAAK,YAAY,CAAC;AACjF,CAAC","sourcesContent":["import type { PlatformTrustModel } from \"../types.js\";\nimport type { SandboxConfig } from \"../sandbox/index.js\";\n\n/**\n * Decide whether a new conversation vault may inherit `sandbox.defaultSharedVault`.\n *\n * Ambient copy is a membership-trust convenience: only appropriate when the\n * people who can drive the agent are already gated by platform membership\n * (Slack/Discord/Telegram). Open-trigger surfaces (GitHub issue/PR comments)\n * must not inherit ambient credentials — host-side platform identity or an\n * explicitly provisioned vault only.\n *\n * Topology: only isolated sandboxes (`image` / `cloudflare`) auto-provision\n * per-conversation vaults that receive the copy. `host` / `container` /\n * `firecracker` do not use this ambient path.\n */\nexport function allowsAmbientDefaultSharedVault(options: {\n trustModel?: PlatformTrustModel;\n sandboxType: SandboxConfig[\"type\"];\n}): boolean {\n const trustModel = options.trustModel ?? \"membership\";\n if (trustModel === \"open-trigger\") return false;\n return options.sandboxType === \"image\" || options.sandboxType === \"cloudflare\";\n}\n"]}
|
package/dist/web/admin/portal.js
CHANGED
|
@@ -4,7 +4,7 @@ import { MikanModels, SessionStore } from "../../harness/index.js";
|
|
|
4
4
|
import { loadConversationAutoReplyConfig, loadGlobalSettings, resolveConversationSettings, saveConversationAutoReplyConfig, updateConversationSettings, updateGlobalSettings, } from "../../config.js";
|
|
5
5
|
import { escapeHtml } from "../../utils/html.js";
|
|
6
6
|
import { readRawBody } from "../../utils/http-body.js";
|
|
7
|
-
import { renderPortalShell } from "
|
|
7
|
+
import { renderPortalShell } from "../portal-shell.js";
|
|
8
8
|
import { resolveExistingSessionFile } from "../session-view/service.js";
|
|
9
9
|
import { PRODUCT_NAME } from "../../platform-messages.js";
|
|
10
10
|
import { resolveActorVaultKey } from "../../vault/routing.js";
|
|
@@ -518,7 +518,7 @@ async function serveModelsList(res) {
|
|
|
518
518
|
jsonRes(res, 500, { error: err instanceof Error ? err.message : String(err) });
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
const VALID_THINKING_LEVELS = new Set(["off", "minimal", "low", "medium", "high", "xhigh"]);
|
|
521
|
+
const VALID_THINKING_LEVELS = new Set(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
|
|
522
522
|
function serveConversationModelUpdate(res, body, services, token) {
|
|
523
523
|
const provider = typeof body.provider === "string" ? body.provider.trim() : "";
|
|
524
524
|
const model = typeof body.model === "string" ? body.model.trim() : "";
|
|
@@ -1578,7 +1578,7 @@ function renderAdminPage(token) {
|
|
|
1578
1578
|
}
|
|
1579
1579
|
|
|
1580
1580
|
function renderSettings(data) {
|
|
1581
|
-
const thinking = ['off','minimal','low','medium','high','xhigh'];
|
|
1581
|
+
const thinking = ['off','minimal','low','medium','high','xhigh','max'];
|
|
1582
1582
|
const thinkingOpts = thinking.map((t) =>
|
|
1583
1583
|
'<option value="' + t + '"' + (data.thinkingLevel === t ? ' selected' : '') + '>' + t + '</option>'
|
|
1584
1584
|
).join('');
|
|
@@ -2130,7 +2130,7 @@ function renderAdminPage(token) {
|
|
|
2130
2130
|
}
|
|
2131
2131
|
|
|
2132
2132
|
function renderGlobalSettings(data) {
|
|
2133
|
-
const thinking = ['off','minimal','low','medium','high','xhigh'];
|
|
2133
|
+
const thinking = ['off','minimal','low','medium','high','xhigh','max'];
|
|
2134
2134
|
const thinkingOpts = thinking.map((t) =>
|
|
2135
2135
|
'<option value="' + t + '"' + (data.thinkingLevel === t ? ' selected' : '') + '>' + t + '</option>'
|
|
2136
2136
|
).join('');
|