modkh 0.0.0-stage → 0.1.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/README.md +24 -2
- package/dist/agent/bundled-skills.d.ts +13 -0
- package/dist/agent/bundled-skills.js +95 -0
- package/dist/agent/images.d.ts +10 -0
- package/dist/agent/images.js +33 -0
- package/dist/agent/loop.d.ts +56 -0
- package/dist/agent/loop.js +155 -0
- package/dist/agent/skills.d.ts +20 -0
- package/dist/agent/skills.js +169 -0
- package/dist/agent/types.d.ts +132 -0
- package/dist/agent/types.js +12 -0
- package/dist/cli/agents.d.ts +8 -0
- package/dist/cli/agents.js +12 -0
- package/dist/cli/approval.d.ts +27 -0
- package/dist/cli/approval.js +62 -0
- package/dist/cli/catalog.d.ts +39 -0
- package/dist/cli/catalog.js +76 -0
- package/dist/cli/chat.d.ts +18 -0
- package/dist/cli/chat.js +733 -0
- package/dist/cli/clipboard.d.ts +9 -0
- package/dist/cli/clipboard.js +54 -0
- package/dist/cli/color.d.ts +42 -0
- package/dist/cli/color.js +176 -0
- package/dist/cli/config.d.ts +41 -0
- package/dist/cli/config.js +188 -0
- package/dist/cli/editor.d.ts +16 -0
- package/dist/cli/editor.js +77 -0
- package/dist/cli/keys.d.ts +18 -0
- package/dist/cli/keys.js +82 -0
- package/dist/cli/language.d.ts +1 -0
- package/dist/cli/language.js +105 -0
- package/dist/cli/limits.d.ts +13 -0
- package/dist/cli/limits.js +19 -0
- package/dist/cli/lines.d.ts +18 -0
- package/dist/cli/lines.js +80 -0
- package/dist/cli/models.d.ts +4 -0
- package/dist/cli/models.js +69 -0
- package/dist/cli/permissions.d.ts +25 -0
- package/dist/cli/permissions.js +30 -0
- package/dist/cli/plugins.d.ts +1 -0
- package/dist/cli/plugins.js +53 -0
- package/dist/cli/providers.d.ts +46 -0
- package/dist/cli/providers.js +76 -0
- package/dist/cli/terminal.d.ts +143 -0
- package/dist/cli/terminal.js +742 -0
- package/dist/cli/usage.d.ts +29 -0
- package/dist/cli/usage.js +75 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +164 -0
- package/dist/language/catalog.d.ts +44 -0
- package/dist/language/catalog.js +100 -0
- package/dist/language/commonlisp-bundled.d.ts +11 -0
- package/dist/language/commonlisp-bundled.js +22 -0
- package/dist/language/commonlisp-dependencies.d.ts +16 -0
- package/dist/language/commonlisp-dependencies.js +68 -0
- package/dist/language/commonlisp-install.d.ts +14 -0
- package/dist/language/commonlisp-install.js +213 -0
- package/dist/language/commonlisp-reader.d.ts +17 -0
- package/dist/language/commonlisp-reader.js +47 -0
- package/dist/language/commonlisp-systems.d.ts +3 -0
- package/dist/language/commonlisp-systems.js +32 -0
- package/dist/language/commonlisp-tls.d.ts +10 -0
- package/dist/language/commonlisp-tls.js +51 -0
- package/dist/language/detect.d.ts +29 -0
- package/dist/language/detect.js +103 -0
- package/dist/language/grammars/LICENSE +24 -0
- package/dist/language/grammars/manifest.json +76 -0
- package/dist/language/grammars/tree-sitter-c.wasm +0 -0
- package/dist/language/grammars/tree-sitter-cpp.wasm +0 -0
- package/dist/language/grammars/tree-sitter-css.wasm +0 -0
- package/dist/language/grammars/tree-sitter-html.wasm +0 -0
- package/dist/language/grammars/tree-sitter-javascript.wasm +0 -0
- package/dist/language/grammars/tree-sitter-php.wasm +0 -0
- package/dist/language/grammars/tree-sitter-python.wasm +0 -0
- package/dist/language/grammars/tree-sitter-ruby.wasm +0 -0
- package/dist/language/grammars/tree-sitter-rust.wasm +0 -0
- package/dist/language/grammars/tree-sitter-swift.wasm +0 -0
- package/dist/language/grammars/tree-sitter-tsx.wasm +0 -0
- package/dist/language/grammars/tree-sitter-typescript.wasm +0 -0
- package/dist/language/install.d.ts +50 -0
- package/dist/language/install.js +293 -0
- package/dist/language/lsp/client.d.ts +97 -0
- package/dist/language/lsp/client.js +337 -0
- package/dist/language/lsp/pool.d.ts +67 -0
- package/dist/language/lsp/pool.js +122 -0
- package/dist/language/lsp/service.d.ts +46 -0
- package/dist/language/lsp/service.js +138 -0
- package/dist/language/native.d.ts +8 -0
- package/dist/language/native.js +100 -0
- package/dist/language/platform.d.ts +14 -0
- package/dist/language/platform.js +20 -0
- package/dist/language/positions.d.ts +20 -0
- package/dist/language/positions.js +46 -0
- package/dist/language/syntax/assets.d.ts +9 -0
- package/dist/language/syntax/assets.js +73 -0
- package/dist/language/syntax/parser.d.ts +24 -0
- package/dist/language/syntax/parser.js +144 -0
- package/dist/language/typescript-capability.d.ts +6 -0
- package/dist/language/typescript-capability.js +42 -0
- package/dist/lisp/config.d.ts +16 -0
- package/dist/lisp/config.js +159 -0
- package/dist/lisp/routing.d.ts +5 -0
- package/dist/lisp/routing.js +24 -0
- package/dist/lisp/runtime.d.ts +21 -0
- package/dist/lisp/runtime.js +83 -0
- package/dist/memory/kiokuko.d.ts +32 -0
- package/dist/memory/kiokuko.js +102 -0
- package/dist/memory/mcp.d.ts +38 -0
- package/dist/memory/mcp.js +211 -0
- package/dist/model/ai-sdk.d.ts +27 -0
- package/dist/model/ai-sdk.js +180 -0
- package/dist/model/chatgpt/login.d.ts +42 -0
- package/dist/model/chatgpt/login.js +180 -0
- package/dist/model/chatgpt/responses.d.ts +41 -0
- package/dist/model/chatgpt/responses.js +202 -0
- package/dist/model/chatgpt/tokens.d.ts +11 -0
- package/dist/model/chatgpt/tokens.js +50 -0
- package/dist/model/connection.d.ts +6 -0
- package/dist/model/connection.js +65 -0
- package/dist/model/context.d.ts +9 -0
- package/dist/model/context.js +69 -0
- package/dist/model/factory.d.ts +25 -0
- package/dist/model/factory.js +88 -0
- package/dist/model/fixed.d.ts +17 -0
- package/dist/model/fixed.js +41 -0
- package/dist/model/reasoning.d.ts +16 -0
- package/dist/model/reasoning.js +62 -0
- package/dist/plugins/api.d.ts +60 -0
- package/dist/plugins/api.js +1 -0
- package/dist/plugins/manager.d.ts +34 -0
- package/dist/plugins/manager.js +261 -0
- package/dist/plugins/package.d.ts +13 -0
- package/dist/plugins/package.js +99 -0
- package/dist/plugins/registry.d.ts +8 -0
- package/dist/plugins/registry.js +14 -0
- package/dist/session/store.d.ts +82 -0
- package/dist/session/store.js +285 -0
- package/dist/session/workspace.d.ts +19 -0
- package/dist/session/workspace.js +73 -0
- package/dist/subagents/processes.d.ts +18 -0
- package/dist/subagents/processes.js +73 -0
- package/dist/subagents/request.d.ts +4 -0
- package/dist/subagents/request.js +21 -0
- package/dist/subagents/service.d.ts +39 -0
- package/dist/subagents/service.js +352 -0
- package/dist/subagents/settings.d.ts +10 -0
- package/dist/subagents/settings.js +32 -0
- package/dist/subagents/types.d.ts +43 -0
- package/dist/subagents/types.js +1 -0
- package/dist/subagents/verification.d.ts +31 -0
- package/dist/subagents/verification.js +178 -0
- package/dist/tools/diff.d.ts +6 -0
- package/dist/tools/diff.js +82 -0
- package/dist/tools/edit.d.ts +3 -0
- package/dist/tools/edit.js +152 -0
- package/dist/tools/files.d.ts +6 -0
- package/dist/tools/files.js +96 -0
- package/dist/tools/formal.d.ts +8 -0
- package/dist/tools/formal.js +77 -0
- package/dist/tools/guard.d.ts +7 -0
- package/dist/tools/guard.js +48 -0
- package/dist/tools/job-tools.d.ts +19 -0
- package/dist/tools/job-tools.js +148 -0
- package/dist/tools/jobs.d.ts +77 -0
- package/dist/tools/jobs.js +181 -0
- package/dist/tools/language.d.ts +6 -0
- package/dist/tools/language.js +174 -0
- package/dist/tools/registry.d.ts +28 -0
- package/dist/tools/registry.js +105 -0
- package/dist/tools/run.d.ts +13 -0
- package/dist/tools/run.js +159 -0
- package/dist/tools/search.d.ts +2 -0
- package/dist/tools/search.js +156 -0
- package/dist/tools/shell-process.d.ts +115 -0
- package/dist/tools/shell-process.js +286 -0
- package/dist/tools/skills.d.ts +2 -0
- package/dist/tools/skills.js +46 -0
- package/dist/tools/web.d.ts +24 -0
- package/dist/tools/web.js +386 -0
- package/docs/ci-repair-20261116.md +30 -0
- package/docs/commonlisp-provider-migration.md +22 -0
- package/docs/commonlisp-qlot-recovery.md +28 -0
- package/docs/commonlisp-tls-recovery.md +28 -0
- package/docs/context-efficiency.md +100 -0
- package/docs/input.md +66 -0
- package/docs/languages.md +117 -0
- package/docs/models.md +85 -0
- package/docs/modkh-evidence.json +641 -0
- package/docs/modkh-failure-comparison.json +675 -0
- package/docs/modkh-namespace.md +39 -0
- package/docs/modkh-qlot-evidence.json +37 -0
- package/docs/modkh-verification.md +173 -0
- package/docs/modkh.md +124 -0
- package/docs/presets.md +19 -0
- package/docs/setup.md +112 -0
- package/docs/subagents.md +134 -0
- package/docs/web.md +57 -0
- package/experiments/presets/common-lisp.lisp +38 -0
- package/experiments/presets/css.lisp +38 -0
- package/experiments/presets/formal.lisp +7 -0
- package/experiments/presets/html.lisp +38 -0
- package/experiments/presets/js.lisp +38 -0
- package/experiments/presets/php.lisp +38 -0
- package/experiments/presets/svelte.lisp +38 -0
- package/experiments/presets/tailwindcss.lisp +24 -0
- package/experiments/presets/ts.lisp +38 -0
- package/package.json +49 -4
- package/plugins/modkh-explorer/index.mjs +3 -0
- package/plugins/modkh-explorer/plugin.json +1 -0
- package/plugins/modkh-worker/index.mjs +3 -0
- package/plugins/modkh-worker/plugin.json +1 -0
- package/skills/kiokuko-dsh/LICENSE +21 -0
- package/skills/kiokuko-dsh/coding-ideal-routine-skill/SKILL.md +106 -0
- package/skills/kiokuko-dsh/japanese-translation-for-oss-models/SKILL.md +65 -0
- package/skills/kiokuko-dsh/kiokuko-architecture/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-architecture/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-benchmark/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-benchmark/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-investigate/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-investigate/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-lisp/SKILL.md +390 -0
- package/skills/kiokuko-dsh/kiokuko-review/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-review/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-simple-work/SKILL.md +70 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/SKILL.md +79 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/boundaries-and-ownership.md +52 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/domain-and-types.md +48 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/effects-and-data.md +43 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/kiokuko-patterns.md +314 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/problem-shaping-and-language.md +90 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/protocols-and-idempotency.md +42 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/review-checklist.md +92 -0
- package/skills/kiokuko-dsh/kiokuko-single-purpose-functions/references/verification.md +45 -0
- package/skills/kiokuko-dsh/kiokuko-skill-authoring/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-skill-authoring/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-soul/SKILL.md +25 -0
- package/skills/kiokuko-dsh/kiokuko-technical-writing/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-technical-writing/references/cases.md +11 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/SKILL.md +64 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/accessibility-and-navigation.md +31 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/async-recovery.md +49 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/forms-and-controls.md +35 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/interaction-feedback.md +34 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/responsive-and-platform.md +38 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/safety-and-review.md +43 -0
- package/skills/kiokuko-dsh/kiokuko-ui-design-soul/references/ui-checklist.md +75 -0
- package/skills/kiokuko-dsh/kiokuko-verification/SKILL.md +20 -0
- package/skills/kiokuko-dsh/kiokuko-verification/references/cases.md +11 -0
- package/skills/kiokuko-dsh/manifest.json +168 -0
- package/skills/kiokuko-dsh/memory-reasoning/SKILL.md +44 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/SKILL.md +113 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/references/boundaries-and-lifecycle.md +70 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/references/discovery-and-scope.md +71 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/references/failure-recovery.md +43 -0
- package/skills/kiokuko-dsh/one-shot-software-completion/references/verification-and-completion.md +73 -0
- package/skills/kiokuko-dsh/veteran-programmer-skill/SKILL.md +66 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { parseImages } from "../agent/images.js";
|
|
6
|
+
import { parseDelegation, delegationDigest } from "../subagents/request.js";
|
|
7
|
+
/** 既定の保存先。MODKH_HOME で差し替え可能(検証用)。 */
|
|
8
|
+
export function defaultSessionDir() {
|
|
9
|
+
if (process.env['MODKH_HOME']) {
|
|
10
|
+
return path.join(process.env['MODKH_HOME'], 'sessions');
|
|
11
|
+
}
|
|
12
|
+
const configBase = process.env['XDG_CONFIG_HOME'] ?? path.join(os.homedir(), '.config');
|
|
13
|
+
return path.join(configBase, 'modkh', 'sessions');
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* JSONL セッションストア。1行1イベント。append で追記し、読み込みで再構築する。
|
|
17
|
+
* ステータスはイベントとして追記し、最後のものが有効。完了と中断を区別する。
|
|
18
|
+
*/
|
|
19
|
+
export class SessionStore {
|
|
20
|
+
dir;
|
|
21
|
+
constructor(dir = defaultSessionDir()) {
|
|
22
|
+
this.dir = dir;
|
|
23
|
+
}
|
|
24
|
+
create(cwd, model, child) {
|
|
25
|
+
const createdAt = new Date().toISOString();
|
|
26
|
+
const id = child?.id ?? `${createdAt.slice(0, 10)}-${randomUUID().slice(0, 8)}`;
|
|
27
|
+
fs.mkdirSync(this.dir, { recursive: true });
|
|
28
|
+
const seq = fs.readdirSync(this.dir).filter((n) => n.endsWith('.jsonl')).length;
|
|
29
|
+
const file = this.fileOf(id);
|
|
30
|
+
const header = { type: 'session', version: 2, ...child, id, createdAt, cwd, model, seq };
|
|
31
|
+
fs.writeFileSync(file, `${JSON.stringify(header)}\n`, { encoding: 'utf8', flag: 'wx', flush: true });
|
|
32
|
+
return Session.fromText(id, file, `${JSON.stringify(header)}\n`);
|
|
33
|
+
}
|
|
34
|
+
load(id) {
|
|
35
|
+
const file = this.fileOf(id);
|
|
36
|
+
let text;
|
|
37
|
+
try {
|
|
38
|
+
text = fs.readFileSync(file, 'utf8');
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
throw new Error(`セッションが見つからない: ${id}(${file})`);
|
|
42
|
+
}
|
|
43
|
+
return Session.fromText(id, file, text);
|
|
44
|
+
}
|
|
45
|
+
list() {
|
|
46
|
+
fs.mkdirSync(this.dir, { recursive: true });
|
|
47
|
+
const out = [];
|
|
48
|
+
for (const name of fs.readdirSync(this.dir)) {
|
|
49
|
+
if (!name.endsWith('.jsonl'))
|
|
50
|
+
continue;
|
|
51
|
+
const file = path.join(this.dir, name);
|
|
52
|
+
try {
|
|
53
|
+
out.push(summarize(file, fs.readFileSync(file, 'utf8')));
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// 読めない・壊れたファイルは一覧に載せない(保存先の掃除はユーザーの判断に任せる)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
out.sort((a, b) => {
|
|
60
|
+
if (a.createdAt !== b.createdAt)
|
|
61
|
+
return a.createdAt < b.createdAt ? 1 : -1;
|
|
62
|
+
return b.seq - a.seq; // 同一時刻は作成順で決定的に
|
|
63
|
+
});
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
fileOf(id) {
|
|
67
|
+
if (!/^[A-Za-z0-9-]+$/.test(id)) {
|
|
68
|
+
throw new Error(`セッションIDが不正: ${id}`);
|
|
69
|
+
}
|
|
70
|
+
return path.join(this.dir, `${id}.jsonl`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export class Session {
|
|
74
|
+
messages = [];
|
|
75
|
+
status = 'active';
|
|
76
|
+
lastError;
|
|
77
|
+
id;
|
|
78
|
+
/** ヘッダの作成時刻(ワークスペース記録に使う)。古いファイルは作成時刻がない。 */
|
|
79
|
+
createdAt = '';
|
|
80
|
+
cwd;
|
|
81
|
+
model;
|
|
82
|
+
file;
|
|
83
|
+
modelBaseUrl;
|
|
84
|
+
persistedCount = 0;
|
|
85
|
+
version = 1;
|
|
86
|
+
parentSessionId;
|
|
87
|
+
rootSessionId;
|
|
88
|
+
delegationLog = new Map();
|
|
89
|
+
constructor(id, file, cwd, model) {
|
|
90
|
+
this.id = id;
|
|
91
|
+
this.file = file;
|
|
92
|
+
this.cwd = cwd;
|
|
93
|
+
this.model = model;
|
|
94
|
+
}
|
|
95
|
+
static fromText(id, file, text) {
|
|
96
|
+
const lines = text.split('\n').filter((l) => l.length > 0);
|
|
97
|
+
if (lines.length === 0)
|
|
98
|
+
throw new Error(`空のセッション: ${id}`);
|
|
99
|
+
let header;
|
|
100
|
+
const session = new Session(id, file, '', '');
|
|
101
|
+
lines.forEach((line, i) => {
|
|
102
|
+
let ev;
|
|
103
|
+
try {
|
|
104
|
+
ev = JSON.parse(line);
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
throw new Error(`壊れたセッション行(${i + 1}行目): ${id}`);
|
|
108
|
+
}
|
|
109
|
+
if (i === 0) {
|
|
110
|
+
if (ev.type !== 'session')
|
|
111
|
+
throw new Error(`ヘッダが先頭にない: ${id}`);
|
|
112
|
+
if (ev.version !== undefined && ev.version !== 2)
|
|
113
|
+
throw new Error('Unsupported session format');
|
|
114
|
+
header = ev;
|
|
115
|
+
session.version = ev.version ?? 1;
|
|
116
|
+
session.parentSessionId = ev.parentSessionId;
|
|
117
|
+
session.rootSessionId = ev.rootSessionId;
|
|
118
|
+
session.cwd = ev.cwd;
|
|
119
|
+
session.model = ev.model;
|
|
120
|
+
session.createdAt = typeof ev.createdAt === 'string' ? ev.createdAt : '';
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (ev.type === 'format') {
|
|
124
|
+
if (ev.version !== 2)
|
|
125
|
+
throw new Error('Unsupported session format');
|
|
126
|
+
session.version = 2;
|
|
127
|
+
}
|
|
128
|
+
else if (ev.type === 'connection') {
|
|
129
|
+
session.model = ev.model;
|
|
130
|
+
session.modelBaseUrl = ev.baseUrl;
|
|
131
|
+
}
|
|
132
|
+
else if (ev.type === 'delegation')
|
|
133
|
+
session.acceptDelegation(ev.record);
|
|
134
|
+
else if (ev.type === 'status') {
|
|
135
|
+
session.status = ev.status;
|
|
136
|
+
session.lastError = typeof ev.diagnostic === 'string' ? ev.diagnostic.slice(0, 2048) : undefined;
|
|
137
|
+
}
|
|
138
|
+
else if (ev.type === 'message') {
|
|
139
|
+
if (ev.message.role === 'user' && ev.message.images !== undefined)
|
|
140
|
+
ev.message.images = parseImages(ev.message.images);
|
|
141
|
+
session.messages.push(ev.message);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
if (header === undefined)
|
|
145
|
+
throw new Error(`ヘッダが先頭にない: ${id}`);
|
|
146
|
+
session.persistedCount = session.messages.length;
|
|
147
|
+
// A crash after the request journal but before a receipt is not proof of no effect.
|
|
148
|
+
const pending = new Map();
|
|
149
|
+
for (const message of session.messages) {
|
|
150
|
+
if (message.role === 'assistant') {
|
|
151
|
+
for (const call of message.toolCalls ?? [])
|
|
152
|
+
pending.set(call.id, call);
|
|
153
|
+
}
|
|
154
|
+
else if (message.role === 'tool') {
|
|
155
|
+
for (const result of message.results)
|
|
156
|
+
pending.delete(result.callId);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (pending.size) {
|
|
160
|
+
const results = [...pending.values()].map(call => session.recoverPending(call));
|
|
161
|
+
session.messages.push({ role: 'tool', results });
|
|
162
|
+
if (results.some(result => result.status === 'unknown'))
|
|
163
|
+
session.status = 'interrupted';
|
|
164
|
+
}
|
|
165
|
+
return session;
|
|
166
|
+
}
|
|
167
|
+
recoverPending(call) {
|
|
168
|
+
const base = { callId: call.id, name: call.name };
|
|
169
|
+
if (call.name === 'run_subagent') {
|
|
170
|
+
const record = [...this.delegationLog.values()].find(row => row.callId === call.id);
|
|
171
|
+
if (record?.state === 'finished' && record.result) {
|
|
172
|
+
try {
|
|
173
|
+
if (delegationDigest(parseDelegation(call.args)) === record.requestDigest) {
|
|
174
|
+
const result = record.result;
|
|
175
|
+
return { ...base, status: result.status === 'completed' ? 'ok' : result.status === 'unknown' ? 'unknown' : 'error', output: JSON.stringify(result) };
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
catch { /* Invalid or mismatched requests never inherit a completion receipt. */ }
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return { ...base, status: 'unknown', output: '保存された要求に結果がない。実行状態は不明。自動再実行せず状態を確認する' };
|
|
182
|
+
}
|
|
183
|
+
append(msg) {
|
|
184
|
+
if (msg.role === 'user' && msg.images !== undefined)
|
|
185
|
+
msg = { ...msg, images: parseImages(msg.images) };
|
|
186
|
+
this.messages.push(msg);
|
|
187
|
+
this.persistFrom(0);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* ループが配列へ直接追加したメッセージをファイルへ追記する(メモリには既にある)。
|
|
191
|
+
* 既存呼び出しのindex引数は互換用。保存済み位置はSession自身が追跡し、二重追記しない。
|
|
192
|
+
*/
|
|
193
|
+
persistFrom(_index) {
|
|
194
|
+
while (this.persistedCount < this.messages.length) {
|
|
195
|
+
this.write({ type: 'message', message: this.messages[this.persistedCount] });
|
|
196
|
+
this.persistedCount++;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
recordMemory(observation) {
|
|
200
|
+
this.write({ ...observation, type: 'memory', at: new Date().toISOString() });
|
|
201
|
+
}
|
|
202
|
+
setConnection(model, baseUrl) {
|
|
203
|
+
this.write({ type: 'connection', model, ...(baseUrl ? { baseUrl } : {}) });
|
|
204
|
+
this.model = model;
|
|
205
|
+
this.modelBaseUrl = baseUrl;
|
|
206
|
+
}
|
|
207
|
+
setStatus(status, diagnostic) {
|
|
208
|
+
this.persistFrom(0);
|
|
209
|
+
const detail = diagnostic?.slice(0, 2048);
|
|
210
|
+
this.write({ type: 'status', status, at: new Date().toISOString(), ...(detail ? { diagnostic: detail } : {}) });
|
|
211
|
+
this.status = status;
|
|
212
|
+
this.lastError = detail;
|
|
213
|
+
}
|
|
214
|
+
delegations() { return [...this.delegationLog.values()].map(record => structuredClone(record)); }
|
|
215
|
+
acceptDelegation(record) {
|
|
216
|
+
if (!record || record.parentSessionId !== this.id || typeof record.runId !== 'string' || typeof record.callId !== 'string'
|
|
217
|
+
|| !/^[a-f0-9]{64}$/.test(record.requestDigest) || !/^[a-f0-9]{64}$/.test(record.operationDigest)
|
|
218
|
+
|| !['starting', 'running', 'stopping', 'finished'].includes(record.state)
|
|
219
|
+
|| (record.state === 'finished') !== !!record.result
|
|
220
|
+
|| (record.result && (!['completed', 'error', 'cancelled', 'unknown'].includes(record.result.status) || typeof record.result.text !== 'string' || record.result.runId !== record.runId || record.result.agentId !== record.childSessionId || !['settled', 'unknown'].includes(record.result.cleanup) || (record.result.status === 'completed' && record.result.cleanup !== 'settled'))))
|
|
221
|
+
throw new Error('Invalid delegation journal');
|
|
222
|
+
if ([...this.delegationLog.values()].some(row => row.callId === record.callId && row.runId !== record.runId))
|
|
223
|
+
throw new Error('Conflicting delegation call ID');
|
|
224
|
+
const previous = this.delegationLog.get(record.runId);
|
|
225
|
+
if (previous && (previous.state === 'finished' || previous.requestDigest !== record.requestDigest || previous.operationDigest !== record.operationDigest || previous.callId !== record.callId))
|
|
226
|
+
throw new Error('Conflicting delegation journal');
|
|
227
|
+
this.delegationLog.set(record.runId, structuredClone(record));
|
|
228
|
+
}
|
|
229
|
+
recordDelegation(record) {
|
|
230
|
+
// Validate without changing the live projection until persistence succeeds.
|
|
231
|
+
const before = this.delegationLog;
|
|
232
|
+
this.delegationLog = new Map(before);
|
|
233
|
+
try {
|
|
234
|
+
this.acceptDelegation(record);
|
|
235
|
+
if (this.version === 1) {
|
|
236
|
+
this.write({ type: 'format', version: 2 });
|
|
237
|
+
this.version = 2;
|
|
238
|
+
}
|
|
239
|
+
this.write({ type: 'delegation', record });
|
|
240
|
+
}
|
|
241
|
+
catch (e) {
|
|
242
|
+
this.delegationLog = before;
|
|
243
|
+
throw e;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** 結果不明のツール呼び出し(中断の痕跡)。再開時の表示と再実行禁止の根拠に使う。 */
|
|
247
|
+
unknownToolResults() {
|
|
248
|
+
const out = [];
|
|
249
|
+
for (const m of this.messages) {
|
|
250
|
+
if (m.role === 'tool') {
|
|
251
|
+
for (const r of m.results) {
|
|
252
|
+
if (r.status === 'unknown')
|
|
253
|
+
out.push(r);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return out;
|
|
258
|
+
}
|
|
259
|
+
write(ev) {
|
|
260
|
+
fs.appendFileSync(this.file, `${JSON.stringify(ev)}\n`, { encoding: 'utf8', flush: true });
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function summarize(file, text) {
|
|
264
|
+
const lines = text.split('\n').filter((l) => l.length > 0);
|
|
265
|
+
const header = JSON.parse(lines[0] ?? '');
|
|
266
|
+
if (header.type !== 'session')
|
|
267
|
+
throw new Error(`ヘッダが先頭にない: ${file}`);
|
|
268
|
+
let status = 'active';
|
|
269
|
+
let model = header.model;
|
|
270
|
+
for (const line of lines.slice(1)) {
|
|
271
|
+
const ev = JSON.parse(line);
|
|
272
|
+
if (ev.type === 'status')
|
|
273
|
+
status = ev.status;
|
|
274
|
+
if (ev.type === 'connection')
|
|
275
|
+
model = ev.model;
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
id: header.id,
|
|
279
|
+
createdAt: header.createdAt,
|
|
280
|
+
cwd: header.cwd,
|
|
281
|
+
model,
|
|
282
|
+
status,
|
|
283
|
+
seq: header.seq ?? 0,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AgentMessage } from '../agent/types.ts';
|
|
2
|
+
export interface RecordableSession {
|
|
3
|
+
id: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
cwd: string;
|
|
6
|
+
model: string;
|
|
7
|
+
status: string;
|
|
8
|
+
messages: AgentMessage[];
|
|
9
|
+
}
|
|
10
|
+
/** ワークスペースに置く実行記録の保存先(.modkh/sessions/<id>.md)。 */
|
|
11
|
+
export declare function workspaceRecordDir(root: string): string;
|
|
12
|
+
export declare function workspaceRecordPath(root: string, id: string): string;
|
|
13
|
+
/** 人間が読める実行記録(逐次の会話・ツール実行)。内部の推論は含めない。 */
|
|
14
|
+
export declare function renderSessionRecord(session: RecordableSession, unknownToolNames?: string[]): string;
|
|
15
|
+
/**
|
|
16
|
+
* セッションをワークスペースに記録する(.modkh/sessions/<id>.md)。
|
|
17
|
+
* 失敗する理由(書き込み不可・ディスク満杯)は呼び出し元へ伝える。上書きは同一セッションのみが対象。
|
|
18
|
+
*/
|
|
19
|
+
export declare function recordSessionRecord(root: string, session: RecordableSession, unknownToolNames?: string[]): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/** 1メッセージあたりの記録上限。超過は末尾を省いて切る(全文はJSONLに残る)。 */
|
|
4
|
+
const MAX_OUTPUT_CHARS = 4000;
|
|
5
|
+
const MAX_RECORD_FILES = 50;
|
|
6
|
+
/** ワークスペースに置く実行記録の保存先(.modkh/sessions/<id>.md)。 */
|
|
7
|
+
export function workspaceRecordDir(root) {
|
|
8
|
+
return path.join(root, '.modkh', 'sessions');
|
|
9
|
+
}
|
|
10
|
+
export function workspaceRecordPath(root, id) {
|
|
11
|
+
return path.join(workspaceRecordDir(root), `${id}.md`);
|
|
12
|
+
}
|
|
13
|
+
function clip(text, limit = MAX_OUTPUT_CHARS) {
|
|
14
|
+
if (text.length <= limit)
|
|
15
|
+
return text;
|
|
16
|
+
return `${text.slice(0, limit)}\n…(省略 ${text.length - limit} 文字。全文はセッションJSONLを参照)`;
|
|
17
|
+
}
|
|
18
|
+
/** 人間が読める実行記録(逐次の会話・ツール実行)。内部の推論は含めない。 */
|
|
19
|
+
export function renderSessionRecord(session, unknownToolNames = []) {
|
|
20
|
+
const lines = [
|
|
21
|
+
`# modkh セッション ${session.id}`,
|
|
22
|
+
'',
|
|
23
|
+
`- 作成: ${session.createdAt}`,
|
|
24
|
+
`- モデル: ${session.model}`,
|
|
25
|
+
`- 状態: ${session.status}`,
|
|
26
|
+
...(unknownToolNames.length ? [`- 注意: 結果不明のツール: ${unknownToolNames.join(', ')}`] : []),
|
|
27
|
+
'',
|
|
28
|
+
];
|
|
29
|
+
for (const message of session.messages) {
|
|
30
|
+
if (message.role === 'user') {
|
|
31
|
+
lines.push('## You', '', clip(message.content), '');
|
|
32
|
+
}
|
|
33
|
+
else if (message.role === 'assistant') {
|
|
34
|
+
if (message.content.length > 0)
|
|
35
|
+
lines.push('## Assistant', '', clip(message.content), '');
|
|
36
|
+
for (const call of message.toolCalls ?? []) {
|
|
37
|
+
lines.push(`### ツール ${call.name}`, '', clip(JSON.stringify(call.args)), '');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
for (const result of message.results) {
|
|
42
|
+
lines.push(`### 結果 ${result.name} (${result.status})`, '', clip(result.output), '');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return `${lines.join('\n').trimEnd()}\n`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* セッションをワークスペースに記録する(.modkh/sessions/<id>.md)。
|
|
50
|
+
* 失敗する理由(書き込み不可・ディスク満杯)は呼び出し元へ伝える。上書きは同一セッションのみが対象。
|
|
51
|
+
*/
|
|
52
|
+
export function recordSessionRecord(root, session, unknownToolNames = []) {
|
|
53
|
+
const file = workspaceRecordPath(root, session.id);
|
|
54
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
55
|
+
// 同一セッションの追記/再書き込みは許し、他セッションの記録を消さない。
|
|
56
|
+
if (fs.existsSync(file))
|
|
57
|
+
fs.unlinkSync(file);
|
|
58
|
+
fs.writeFileSync(file, renderSessionRecord(session, unknownToolNames), { encoding: 'utf8' });
|
|
59
|
+
pruneOldRecords(path.dirname(file));
|
|
60
|
+
return file;
|
|
61
|
+
}
|
|
62
|
+
function pruneOldRecords(dir) {
|
|
63
|
+
const entries = fs.readdirSync(dir)
|
|
64
|
+
.filter((n) => n.endsWith('.md'))
|
|
65
|
+
.map((n) => ({ n, stat: fs.statSync(path.join(dir, n)) }))
|
|
66
|
+
.sort((a, b) => b.stat.mtimeMs - a.stat.mtimeMs);
|
|
67
|
+
// 新しい50件を残す(既定のワークスペース記録の上限)。削除は .modkh 配下だけを対象にする。
|
|
68
|
+
for (const entry of entries.slice(MAX_RECORD_FILES)) {
|
|
69
|
+
const target = path.join(dir, entry.n);
|
|
70
|
+
if (path.dirname(target) === dir)
|
|
71
|
+
fs.unlinkSync(target);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ApprovalGate } from '../agent/types.ts';
|
|
2
|
+
import type { ExternalHost, ProcessRequest, ProcessResult } from '../plugins/api.ts';
|
|
3
|
+
import type { Session } from '../session/store.ts';
|
|
4
|
+
/** Tracks every host-managed process even if a plugin forgets to await it. */
|
|
5
|
+
export declare class ExternalProcesses implements ExternalHost {
|
|
6
|
+
readonly signal: AbortSignal;
|
|
7
|
+
private controller;
|
|
8
|
+
private closed;
|
|
9
|
+
private jobs;
|
|
10
|
+
readonly outcomes: ProcessResult[];
|
|
11
|
+
private root;
|
|
12
|
+
private approval;
|
|
13
|
+
private session;
|
|
14
|
+
constructor(root: string, approval: ApprovalGate, session: Session, signal: AbortSignal);
|
|
15
|
+
run(request: ProcessRequest): Promise<ProcessResult>;
|
|
16
|
+
private execute;
|
|
17
|
+
close(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { ToolError } from "../agent/types.js";
|
|
4
|
+
import { object, fields, text } from "../plugins/package.js";
|
|
5
|
+
import { runShell } from "../tools/run.js";
|
|
6
|
+
function shellQuote(value) { return `'${value.replaceAll("'", "'\\''")}'`; }
|
|
7
|
+
/** Tracks every host-managed process even if a plugin forgets to await it. */
|
|
8
|
+
export class ExternalProcesses {
|
|
9
|
+
signal;
|
|
10
|
+
controller = new AbortController();
|
|
11
|
+
closed = false;
|
|
12
|
+
jobs = [];
|
|
13
|
+
outcomes = [];
|
|
14
|
+
root;
|
|
15
|
+
approval;
|
|
16
|
+
session;
|
|
17
|
+
constructor(root, approval, session, signal) {
|
|
18
|
+
this.root = root;
|
|
19
|
+
this.approval = approval;
|
|
20
|
+
this.session = session;
|
|
21
|
+
this.signal = AbortSignal.any([signal, this.controller.signal]);
|
|
22
|
+
}
|
|
23
|
+
run(request) {
|
|
24
|
+
if (this.closed || this.signal.aborted)
|
|
25
|
+
return Promise.reject(new ToolError('NOT_EXECUTED', 'External host is closed'));
|
|
26
|
+
const raw = object(request);
|
|
27
|
+
fields(raw, ['command', 'args']);
|
|
28
|
+
const command = text(raw.command, 'command', 4096);
|
|
29
|
+
if (!Array.isArray(raw.args) || raw.args.length > 256 || !raw.args.every(a => typeof a === 'string' && !a.includes('\0')) || Buffer.byteLength(JSON.stringify(raw.args)) > 131072)
|
|
30
|
+
throw new Error('Invalid process arguments');
|
|
31
|
+
const line = [command, ...raw.args].map(shellQuote).join(' ');
|
|
32
|
+
const job = this.execute(line);
|
|
33
|
+
this.jobs.push(job);
|
|
34
|
+
// Observe rejection without detaching its ownership; close() collects it again.
|
|
35
|
+
void job.catch(() => { });
|
|
36
|
+
return job;
|
|
37
|
+
}
|
|
38
|
+
async execute(command) {
|
|
39
|
+
const callId = randomUUID();
|
|
40
|
+
this.session.append({ role: 'assistant', content: '', toolCalls: [{ id: callId, name: 'external_process', args: { command, cwd: this.root } }] });
|
|
41
|
+
let result;
|
|
42
|
+
try {
|
|
43
|
+
if (this.signal.aborted)
|
|
44
|
+
throw new ToolError('NOT_EXECUTED', '中断済み');
|
|
45
|
+
const approved = await this.approval.approve({ signal: this.signal, kind: 'command', title: '外部プラグインのプロセス起動', detail: `${command}\n作業場所: ${this.root}\nOSサンドボックスではありません。リモート処理の停止は保証できません。` });
|
|
46
|
+
if (!approved)
|
|
47
|
+
throw new ToolError('DENIED', '実行は承認されませんでした');
|
|
48
|
+
if (this.signal.aborted || fs.realpathSync(this.root) !== this.root)
|
|
49
|
+
throw new ToolError('NOT_EXECUTED', '停止済み、または作業場所が変更されました');
|
|
50
|
+
// No inherited provider credentials. A trusted CLI can still access its own files.
|
|
51
|
+
const env = {};
|
|
52
|
+
for (const key of ['PATH', 'HOME', 'TMPDIR', 'LANG', 'LC_ALL'])
|
|
53
|
+
if (process.env[key] !== undefined)
|
|
54
|
+
env[key] = process.env[key];
|
|
55
|
+
result = { status: 'ok', output: await runShell(command, this.root, this.signal, env), cleanup: 'settled' };
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
const code = e instanceof ToolError ? e.code : 'RESULT_UNKNOWN';
|
|
59
|
+
result = { status: code === 'NOT_EXECUTED' || code === 'DENIED' ? 'not-executed' : code === 'RUN_FAILED' ? 'error' : 'unknown', output: String(e), cleanup: code === 'RESULT_UNKNOWN' ? 'unknown' : 'settled' };
|
|
60
|
+
}
|
|
61
|
+
this.outcomes.push(result);
|
|
62
|
+
this.session.append({ role: 'tool', results: [{ callId, name: 'external_process', status: result.status, output: result.output }] });
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
async close() {
|
|
66
|
+
this.closed = true;
|
|
67
|
+
this.controller.abort();
|
|
68
|
+
const settled = await Promise.allSettled(this.jobs);
|
|
69
|
+
const failures = settled.filter(r => r.status === 'rejected');
|
|
70
|
+
if (failures.length || this.outcomes.some(r => r.cleanup === 'unknown'))
|
|
71
|
+
throw new Error('External process cleanup or journaling is unconfirmed');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DelegationRequest } from './types.ts';
|
|
2
|
+
/** Canonical field order is shared by admission and durable receipt recovery. */
|
|
3
|
+
export declare function parseDelegation(value: unknown): DelegationRequest;
|
|
4
|
+
export declare function delegationDigest(request: DelegationRequest): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { fields, object, pluginId, text } from "../plugins/package.js";
|
|
3
|
+
/** Canonical field order is shared by admission and durable receipt recovery. */
|
|
4
|
+
export function parseDelegation(value) {
|
|
5
|
+
const raw = object(value);
|
|
6
|
+
fields(raw, ['pluginId', 'task', 'context', 'targetPaths']);
|
|
7
|
+
const request = { pluginId: pluginId(raw.pluginId), task: text(raw.task, 'task', 32768) };
|
|
8
|
+
if (raw.context !== undefined)
|
|
9
|
+
request.context = text(raw.context, 'context', 131072);
|
|
10
|
+
if (raw.targetPaths !== undefined) {
|
|
11
|
+
if (!Array.isArray(raw.targetPaths) || raw.targetPaths.length < 1 || raw.targetPaths.length > 8 ||
|
|
12
|
+
!raw.targetPaths.every(p => typeof p === 'string' && p.length < 1024 && !p.startsWith('/') && !p.includes('\\') && !p.split('/').some((s) => !s || s === '.' || s === '..')) ||
|
|
13
|
+
new Set(raw.targetPaths).size !== raw.targetPaths.length)
|
|
14
|
+
throw new Error('Invalid targetPaths: 1..8 unique relative file paths required');
|
|
15
|
+
request.targetPaths = [...raw.targetPaths].sort();
|
|
16
|
+
}
|
|
17
|
+
return request;
|
|
18
|
+
}
|
|
19
|
+
export function delegationDigest(request) {
|
|
20
|
+
return createHash('sha256').update(JSON.stringify(request)).digest('hex');
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ApprovalGate, Model, Tool } from '../agent/types.ts';
|
|
2
|
+
import { SessionStore } from '../session/store.ts';
|
|
3
|
+
import type { Session } from '../session/store.ts';
|
|
4
|
+
import { PluginManager } from '../plugins/manager.ts';
|
|
5
|
+
import type { PluginDescriptor } from '../plugins/api.ts';
|
|
6
|
+
import type { AgentSetting } from './settings.ts';
|
|
7
|
+
import type { SubagentHandle } from './types.ts';
|
|
8
|
+
export { parseDelegation } from './request.ts';
|
|
9
|
+
export interface Connection {
|
|
10
|
+
ref: string;
|
|
11
|
+
create(): Model;
|
|
12
|
+
}
|
|
13
|
+
export interface SubagentOptions {
|
|
14
|
+
manager: PluginManager;
|
|
15
|
+
store: SessionStore;
|
|
16
|
+
parent: Session;
|
|
17
|
+
root: string;
|
|
18
|
+
tools: Tool[];
|
|
19
|
+
approval: ApprovalGate;
|
|
20
|
+
connection(model?: string): Connection;
|
|
21
|
+
settings?: Record<string, AgentSetting>;
|
|
22
|
+
unavailable?: boolean;
|
|
23
|
+
/** Host policy only; neither plugin definitions nor child requests may downgrade it. */
|
|
24
|
+
verificationIsolation?: 'integrity-only' | 'required';
|
|
25
|
+
progress?(message: string): void;
|
|
26
|
+
}
|
|
27
|
+
/** The parent captures authority once. Plugins receive neither this owner nor its session. */
|
|
28
|
+
export declare class SubagentService {
|
|
29
|
+
private opts;
|
|
30
|
+
private handles;
|
|
31
|
+
constructor(options: SubagentOptions);
|
|
32
|
+
list(): PluginDescriptor[];
|
|
33
|
+
start(raw: unknown, owner: {
|
|
34
|
+
callId: string;
|
|
35
|
+
signal: AbortSignal;
|
|
36
|
+
}): Promise<SubagentHandle>;
|
|
37
|
+
private execute;
|
|
38
|
+
}
|
|
39
|
+
export declare function subagentTools(service: SubagentService): Tool[];
|