maestro-agent-sdk 0.1.38 → 0.1.40
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 +30 -64
- package/dist/agents/rollout/shared.d.ts +0 -1
- package/dist/agents/rollout/shared.d.ts.map +1 -1
- package/dist/agents/rollout/shared.js +5 -3
- package/dist/agents/rollout/shared.js.map +1 -1
- package/dist/core/agent.d.ts +10 -1
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +1 -0
- package/dist/core/agent.js.map +1 -1
- package/dist/core/loop.d.ts.map +1 -1
- package/dist/core/loop.js +28 -43
- package/dist/core/loop.js.map +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +1 -1
- package/dist/memory/aux-model-map.d.ts +2 -43
- package/dist/memory/aux-model-map.d.ts.map +1 -1
- package/dist/memory/aux-model-map.js +3 -85
- package/dist/memory/aux-model-map.js.map +1 -1
- package/dist/platform/config.d.ts +0 -10
- package/dist/platform/config.d.ts.map +1 -1
- package/dist/platform/config.js +0 -21
- package/dist/platform/config.js.map +1 -1
- package/dist/platform/jsonl.d.ts +0 -3
- package/dist/platform/jsonl.d.ts.map +1 -1
- package/dist/platform/jsonl.js +1 -19
- package/dist/platform/jsonl.js.map +1 -1
- package/dist/platform/version.d.ts +1 -1
- package/dist/platform/version.js +1 -1
- package/dist/provider.d.ts +6 -57
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +87 -157
- package/dist/provider.js.map +1 -1
- package/dist/registry.d.ts +6 -39
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +9 -76
- package/dist/registry.js.map +1 -1
- package/dist/sub-agent/runner.d.ts.map +1 -1
- package/dist/sub-agent/runner.js +0 -3
- package/dist/sub-agent/runner.js.map +1 -1
- package/dist/tools/builtin/bash.d.ts +0 -36
- package/dist/tools/builtin/bash.d.ts.map +1 -1
- package/dist/tools/builtin/bash.js +0 -3
- package/dist/tools/builtin/bash.js.map +1 -1
- package/dist/types.d.ts +23 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/dist/types.js.map +1 -1
- package/package.json +2 -24
- package/dist/providers/anthropic.d.ts +0 -328
- package/dist/providers/anthropic.d.ts.map +0 -1
- package/dist/providers/anthropic.js +0 -857
- package/dist/providers/anthropic.js.map +0 -1
- package/dist/providers/codex-auth.d.ts +0 -149
- package/dist/providers/codex-auth.d.ts.map +0 -1
- package/dist/providers/codex-auth.js +0 -332
- package/dist/providers/codex-auth.js.map +0 -1
- package/dist/providers/codex-stream.d.ts +0 -42
- package/dist/providers/codex-stream.d.ts.map +0 -1
- package/dist/providers/codex-stream.js +0 -345
- package/dist/providers/codex-stream.js.map +0 -1
- package/dist/providers/codex-translators.d.ts +0 -105
- package/dist/providers/codex-translators.d.ts.map +0 -1
- package/dist/providers/codex-translators.js +0 -244
- package/dist/providers/codex-translators.js.map +0 -1
- package/dist/providers/codex.d.ts +0 -234
- package/dist/providers/codex.d.ts.map +0 -1
- package/dist/providers/codex.js +0 -461
- package/dist/providers/codex.js.map +0 -1
- package/dist/providers/fallback.d.ts +0 -71
- package/dist/providers/fallback.d.ts.map +0 -1
- package/dist/providers/fallback.js +0 -223
- package/dist/providers/fallback.js.map +0 -1
package/dist/sub-agent/runner.js
CHANGED
|
@@ -8,7 +8,6 @@ import { runConversation } from "../core/loop.js";
|
|
|
8
8
|
import { buildSystemReminder } from "../memory/reminder.js";
|
|
9
9
|
import { logger } from "../platform/logger.js";
|
|
10
10
|
import { providerForModel } from "../provider.js";
|
|
11
|
-
import { effortToThinkingBudget } from "../providers/anthropic.js";
|
|
12
11
|
import { getNativeMaxOutputTokens } from "../registry.js";
|
|
13
12
|
import { deleteMaestroSession } from "../session-store.js";
|
|
14
13
|
import { SUBAGENT_CAPABILITIES } from "../sub-agent/capabilities.js";
|
|
@@ -189,7 +188,6 @@ export async function runSubAgent(opts) {
|
|
|
189
188
|
const overlay = loadOverlay(opts.subagentType);
|
|
190
189
|
const systemPrompt = `${opts.parentSystemPrompt}\n\n${overlay}`;
|
|
191
190
|
const maxTokens = resolveMaxTokens(opts.parentModel);
|
|
192
|
-
const thinkingBudget = opts.parentEffort ? effortToThinkingBudget(opts.parentEffort) : undefined;
|
|
193
191
|
// Sub-agent's user message follows the parent contract: prompt + own
|
|
194
192
|
// system reminder. The reminder reflects the SUB-SESSION's state
|
|
195
193
|
// (its own session id), not the parent's.
|
|
@@ -203,7 +201,6 @@ export async function runSubAgent(opts) {
|
|
|
203
201
|
model: opts.parentModel,
|
|
204
202
|
systemPrompt,
|
|
205
203
|
maxTokens,
|
|
206
|
-
...(thinkingBudget ? { thinkingBudget } : {}),
|
|
207
204
|
...(opts.parentEffort ? { effort: opts.parentEffort } : {}),
|
|
208
205
|
...(opts.parentAbortSignal ? { abortSignal: opts.parentAbortSignal } : {}),
|
|
209
206
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/sub-agent/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"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CAAC;YACvE,CAAC;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CACT;YACE,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,YAAY;YACZ,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,OAAO;YACP,OAAO;YACP,OAAO,EAAE,SAAS,CAAC,MAAM;YACzB,KAAK;SACN,EACD,uBAAuB,CACxB,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -30,42 +30,6 @@ export declare function createBashTool(opts?: {
|
|
|
30
30
|
* agent switch, which is what permission UIs / audit logs want to render.
|
|
31
31
|
*/
|
|
32
32
|
export declare const bashTool: ToolHandler;
|
|
33
|
-
/** Named schema export so the provider can reference it
|
|
34
|
-
* without instantiating a full tool registry. */
|
|
35
|
-
export declare const bashToolSchema: {
|
|
36
|
-
readonly name: "Bash";
|
|
37
|
-
readonly description: string;
|
|
38
|
-
readonly input_schema: {
|
|
39
|
-
readonly type: "object";
|
|
40
|
-
readonly properties: {
|
|
41
|
-
readonly command: {
|
|
42
|
-
readonly type: "string";
|
|
43
|
-
readonly description: "Bash command to execute.";
|
|
44
|
-
};
|
|
45
|
-
readonly description: {
|
|
46
|
-
readonly type: "string";
|
|
47
|
-
readonly description: string;
|
|
48
|
-
};
|
|
49
|
-
readonly timeout: {
|
|
50
|
-
readonly type: "number";
|
|
51
|
-
readonly description: string;
|
|
52
|
-
};
|
|
53
|
-
readonly max_output_bytes: {
|
|
54
|
-
readonly type: "number";
|
|
55
|
-
readonly description: string;
|
|
56
|
-
};
|
|
57
|
-
readonly cwd: {
|
|
58
|
-
readonly type: "string";
|
|
59
|
-
readonly description: "Working directory (optional).";
|
|
60
|
-
};
|
|
61
|
-
readonly run_in_background: {
|
|
62
|
-
readonly type: "boolean";
|
|
63
|
-
readonly description: string;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
readonly required: readonly ["command"];
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
33
|
/**
|
|
70
34
|
* Two-ended output buffer that keeps the first `headCap` bytes and the last
|
|
71
35
|
* `tailCap` bytes of an unbounded stream. Bytes between those two windows
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/tools/builtin/bash.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgFpD,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC,GAAG,WAAW,CA0Dd;AAuGD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,QAAQ,EAAE,WAA8B,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/tools/builtin/bash.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgFpD,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC,GAAG,WAAW,CA0Dd;AAuGD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,QAAQ,EAAE,WAA8B,CAAC;AAEtD;;;;;;;;GAQG;AACH,UAAU,UAAU;IAClB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,IAAI,MAAM,CAAC;IACjB,SAAS,IAAI,OAAO,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CA8DxD;AAQD,eAAO,MAAM,yBAAyB,QAA0B,CAAC;AACjE,eAAO,MAAM,sBAAsB,SAAuB,CAAC;AAC3D,eAAO,MAAM,iBAAiB,QAAkB,CAAC;AACjD,eAAO,MAAM,qBAAqB,QAAsB,CAAC"}
|
|
@@ -240,9 +240,6 @@ const BASH_MAX_OUTPUT_HARD = 100_000;
|
|
|
240
240
|
* agent switch, which is what permission UIs / audit logs want to render.
|
|
241
241
|
*/
|
|
242
242
|
export const bashTool = createBashTool();
|
|
243
|
-
/** Named schema export so the provider can reference it
|
|
244
|
-
* without instantiating a full tool registry. */
|
|
245
|
-
export const bashToolSchema = bashSchema;
|
|
246
243
|
export function createOutputRing(cap) {
|
|
247
244
|
if (cap <= 0) {
|
|
248
245
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/tools/builtin/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAKlD;;uDAEuD;AACvD,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,uEAAuE;QACvE,6EAA6E;QAC7E,0EAA0E;QAC1E,2EAA2E;QAC3E,oEAAoE;QACpE,+DAA+D;IACjE,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,gEAAgE;oBAChE,gEAAgE;oBAChE,mCAAmC;aACtC;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,+DAA+D;oBAC/D,kEAAkE;oBAClE,s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IAAI,CAAC;YACb,IAAI,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,CAAC;gBAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;gBACnC,OAAO,IAAI,IAAI,CAAC;gBAChB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,MAAM;YACJ,IAAI,OAAO,KAAK,CAAC;gBAAE,OAAO,IAAI,GAAG,IAAI,CAAC;YACtC,sEAAsE;YACtE,kEAAkE;YAClE,kEAAkE;YAClE,iBAAiB;YACjB,OAAO,GAAG,IAAI,mBAAmB,OAAO,eAAe,IAAI,EAAE,CAAC;QAChE,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,GAAG,CAAC;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAAkB,EAAE,MAAkB;IAC3D,IAAI,MAAM,CAAC,SAAS,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE;QAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACzE,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,8BAA8B;AAC9B,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AACjE,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -80,10 +80,29 @@ export type EffortLevel = "minimal" | "low" | "medium" | "high" | "xhigh" | "max
|
|
|
80
80
|
* Identifier returned by the SDK's session-store. Hosts may map their own
|
|
81
81
|
* notion of "session" (e.g. a topic, a thread, a user) onto this.
|
|
82
82
|
*/
|
|
83
|
-
export type AgentKind = "
|
|
83
|
+
export type AgentKind = "maestro";
|
|
84
84
|
export declare const SUPPORTED_AGENTS: readonly AgentKind[];
|
|
85
85
|
export declare const FALLBACK_AGENT: AgentKind;
|
|
86
86
|
export declare function isAgentKind(value: unknown): value is AgentKind;
|
|
87
|
+
/**
|
|
88
|
+
* Wire-safe projection of a single task, emitted in the `tasks` UnifiedEvent.
|
|
89
|
+
*
|
|
90
|
+
* A compact subset of the internal `TaskEntry` (state/tasks.ts) — enough for a
|
|
91
|
+
* host to render a live task panel without learning the on-disk schema. Status
|
|
92
|
+
* is narrowed to the three non-terminal states because the snapshot is built
|
|
93
|
+
* from `TaskStore.list()`, which already filters out `deleted` entries.
|
|
94
|
+
*/
|
|
95
|
+
export interface TaskSnapshot {
|
|
96
|
+
id: string;
|
|
97
|
+
subject: string;
|
|
98
|
+
status: "pending" | "in_progress" | "completed";
|
|
99
|
+
/** Task ids this one is blocked by; omitted when empty. */
|
|
100
|
+
blockedBy?: string[];
|
|
101
|
+
/** Present-continuous label for spinners, when set. */
|
|
102
|
+
activeForm?: string;
|
|
103
|
+
/** Owner / agent name for multi-agent runs, when set. */
|
|
104
|
+
owner?: string;
|
|
105
|
+
}
|
|
87
106
|
/**
|
|
88
107
|
* Normalized event stream emitted by the agent loop. Hosts iterate this
|
|
89
108
|
* async generator and render / persist whichever variants they care about.
|
|
@@ -105,6 +124,9 @@ export type UnifiedEvent = {
|
|
|
105
124
|
} | {
|
|
106
125
|
type: "tool_use_summary";
|
|
107
126
|
summary: string;
|
|
127
|
+
} | {
|
|
128
|
+
type: "tasks";
|
|
129
|
+
tasks: TaskSnapshot[];
|
|
108
130
|
} | {
|
|
109
131
|
type: "tool_result";
|
|
110
132
|
toolUseId: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,gBAAgB,GAAG,UAA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G;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,OAAO,+BAA+B,EAAE,0BAA0B,CAAC;IAC1F;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B"}
|
package/dist/types.js
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* `reasoning_effort` directly. Hosts can pass either string form.
|
|
14
14
|
*/
|
|
15
15
|
export const MAESTRO_EFFORT_VALUES = ["low", "medium", "high", "xhigh", "max"];
|
|
16
|
-
export const SUPPORTED_AGENTS = ["
|
|
17
|
-
export const FALLBACK_AGENT = "
|
|
16
|
+
export const SUPPORTED_AGENTS = ["maestro"];
|
|
17
|
+
export const FALLBACK_AGENT = "maestro";
|
|
18
18
|
export function isAgentKind(value) {
|
|
19
19
|
return typeof value === "string" && SUPPORTED_AGENTS.includes(value);
|
|
20
20
|
}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4EH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAQxF,MAAM,CAAC,MAAM,gBAAgB,GAAyB,CAAC,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4EH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAQxF,MAAM,CAAC,MAAM,gBAAgB,GAAyB,CAAC,SAAS,CAAU,CAAC;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAc,SAAS,CAAC;AAEnD,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,gBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maestro-agent-sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Embeddable
|
|
3
|
+
"version": "0.1.40",
|
|
4
|
+
"description": "Embeddable TypeScript agent SDK for DeepSeek — built-in tools, skills, memory, and MCP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Yeonwoo Jeong <aadd4020@gmail.com>",
|
|
7
7
|
"repository": {
|
|
@@ -16,30 +16,10 @@
|
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js"
|
|
18
18
|
},
|
|
19
|
-
"./providers/anthropic": {
|
|
20
|
-
"types": "./dist/providers/anthropic.d.ts",
|
|
21
|
-
"import": "./dist/providers/anthropic.js"
|
|
22
|
-
},
|
|
23
19
|
"./providers/deepseek": {
|
|
24
20
|
"types": "./dist/providers/deepseek.d.ts",
|
|
25
21
|
"import": "./dist/providers/deepseek.js"
|
|
26
22
|
},
|
|
27
|
-
"./providers/codex": {
|
|
28
|
-
"types": "./dist/providers/codex.d.ts",
|
|
29
|
-
"import": "./dist/providers/codex.js"
|
|
30
|
-
},
|
|
31
|
-
"./providers/codex-auth": {
|
|
32
|
-
"types": "./dist/providers/codex-auth.d.ts",
|
|
33
|
-
"import": "./dist/providers/codex-auth.js"
|
|
34
|
-
},
|
|
35
|
-
"./providers/codex-stream": {
|
|
36
|
-
"types": "./dist/providers/codex-stream.d.ts",
|
|
37
|
-
"import": "./dist/providers/codex-stream.js"
|
|
38
|
-
},
|
|
39
|
-
"./providers/codex-translators": {
|
|
40
|
-
"types": "./dist/providers/codex-translators.d.ts",
|
|
41
|
-
"import": "./dist/providers/codex-translators.js"
|
|
42
|
-
},
|
|
43
23
|
"./tools": {
|
|
44
24
|
"types": "./dist/tools/index.d.ts",
|
|
45
25
|
"import": "./dist/tools/index.js"
|
|
@@ -66,8 +46,6 @@
|
|
|
66
46
|
"agent",
|
|
67
47
|
"ai-agent",
|
|
68
48
|
"llm",
|
|
69
|
-
"anthropic",
|
|
70
|
-
"claude",
|
|
71
49
|
"deepseek",
|
|
72
50
|
"mcp",
|
|
73
51
|
"tool-use",
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import type { Provider, ProviderCompleteOptions, ProviderMessage, ProviderResponse, ProviderStreamChunk, ProviderToolSchema } from "../providers/base.js";
|
|
2
|
-
/** Anthropic cache-control marker. Wire-only — the rest of the Maestro
|
|
3
|
-
* pipeline uses pure `ProviderContentBlock` without this field. */
|
|
4
|
-
type CacheControl = {
|
|
5
|
-
type: "ephemeral";
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Raw Anthropic Messages API adapter.
|
|
9
|
-
*
|
|
10
|
-
* Uses fetch directly (no `@anthropic-ai/sdk` dependency) — keeps the dep
|
|
11
|
-
* surface minimal and lets hosts that already pull in the official SDK (or
|
|
12
|
-
* the higher-level `@anthropic-ai/claude-agent-sdk` Claude-CLI wrapper) use
|
|
13
|
-
* either side-by-side without version conflicts.
|
|
14
|
-
*
|
|
15
|
-
* Auth: `ANTHROPIC_API_KEY` env var. Independent from any OAuth-based
|
|
16
|
-
* Claude Code session the host process may have — passing an explicit key
|
|
17
|
-
* to the constructor takes precedence.
|
|
18
|
-
*/
|
|
19
|
-
export declare class AnthropicProvider implements Provider {
|
|
20
|
-
private readonly apiKey;
|
|
21
|
-
private readonly idleTimeoutMs;
|
|
22
|
-
private readonly totalTimeoutMs;
|
|
23
|
-
/**
|
|
24
|
-
* @param idleTimeoutMs Socket inactivity timeout for the request/stream
|
|
25
|
-
* (default 600_000, matching Hermes' large-context stale floor). Routed
|
|
26
|
-
* through `node:http` so it actually applies — Bun's global `fetch` caps
|
|
27
|
-
* every request at a hard ~300 s that no signal can raise (see
|
|
28
|
-
* `node-fetch.ts`). Resets on every byte, so long streams are never cut; it
|
|
29
|
-
* only bounds time-to-first-byte and mid-stream stalls.
|
|
30
|
-
* @param totalTimeoutMs Absolute wall-clock ceiling (default 1_800_000).
|
|
31
|
-
*/
|
|
32
|
-
constructor(apiKey: string, idleTimeoutMs?: number, totalTimeoutMs?: number);
|
|
33
|
-
static fromEnv(): AnthropicProvider;
|
|
34
|
-
complete(opts: ProviderCompleteOptions): Promise<ProviderResponse>;
|
|
35
|
-
/**
|
|
36
|
-
* Streaming variant of `complete()`. Sends the same request body with
|
|
37
|
-
* `stream: true`, parses the resulting SSE event stream into the small
|
|
38
|
-
* set of chunks the agent loop consumes (text_delta, tool_use_start /
|
|
39
|
-
* input_delta / complete, message_complete).
|
|
40
|
-
*
|
|
41
|
-
* The model's network shape is Anthropic SSE — events like
|
|
42
|
-
* `message_start`, `content_block_start`, `content_block_delta`,
|
|
43
|
-
* `content_block_stop`, `message_delta`, `message_stop`, plus periodic
|
|
44
|
-
* `ping` keepalives. Most are housekeeping; the loop only needs the
|
|
45
|
-
* deltas + tool_use lifecycle + terminal stop_reason / usage. Everything
|
|
46
|
-
* else is consumed and dropped by this adapter.
|
|
47
|
-
*/
|
|
48
|
-
stream(opts: ProviderCompleteOptions): AsyncGenerator<ProviderStreamChunk>;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Defensive scrub for thinking blocks that arrive at the wire builder without
|
|
52
|
-
* a usable `signature`. Anthropic's API requires every replayed `thinking`
|
|
53
|
-
* block to carry the original signature it produced; sending one without it
|
|
54
|
-
* trips a 400 `messages.N.content.M.thinking.signature: Field required`.
|
|
55
|
-
*
|
|
56
|
-
* In normal operation the streaming code already refuses to emit
|
|
57
|
-
* thinking blocks lacking a signature (see `content_block_stop` in the SSE
|
|
58
|
-
* handler), so this filter is belt-and-suspenders for two recovery cases:
|
|
59
|
-
*
|
|
60
|
-
* 1. A session persisted by an older SDK build (pre-v0.1.20) that DID
|
|
61
|
-
* emit signatureless thinking blocks now loads from disk. Without this
|
|
62
|
-
* filter, the first wire call after upgrading would 400 on the bad
|
|
63
|
-
* block.
|
|
64
|
-
*
|
|
65
|
-
* 2. A future provider-side transformation (compaction, dedup) accidentally
|
|
66
|
-
* drops the field. Filtering here gives us a single chokepoint to lock.
|
|
67
|
-
*
|
|
68
|
-
* Two complications the filter has to handle:
|
|
69
|
-
*
|
|
70
|
-
* - **Anthropic forbids mixing `thinking` and `text` after `tool_use` /
|
|
71
|
-
* `tool_result` in the same message.** Simply removing the bad thinking
|
|
72
|
-
* block can leave a message starting with `text` + `tool_use`, which is
|
|
73
|
-
* still valid. So we only drop the thinking block itself, not surrounding
|
|
74
|
-
* blocks.
|
|
75
|
-
*
|
|
76
|
-
* - **An assistant message can become content-empty after the filter.** A
|
|
77
|
-
* turn like `[thinking(broken)]` reduces to `[]`. Anthropic rejects empty
|
|
78
|
-
* content arrays, so we substitute a single empty text block as a
|
|
79
|
-
* placeholder — same trick `loop.ts` already uses for the scrubber-drops-
|
|
80
|
-
* everything case.
|
|
81
|
-
*/
|
|
82
|
-
export declare function sanitizeThinkingBlocksForWire(messages: readonly ProviderMessage[]): ProviderMessage[];
|
|
83
|
-
/**
|
|
84
|
-
* Convert the user-supplied `system` (plain string) into the array shape
|
|
85
|
-
* Anthropic accepts when you need a cache_control marker. A string slot
|
|
86
|
-
* has no cache field, so we lift it into a single text block and tag it
|
|
87
|
-
* ephemeral. Returning the original string unchanged when it's empty keeps
|
|
88
|
-
* the request shape minimal for prompt-less calls.
|
|
89
|
-
*/
|
|
90
|
-
export declare function buildCacheableSystem(system: string): string | Array<{
|
|
91
|
-
type: "text";
|
|
92
|
-
text: string;
|
|
93
|
-
cache_control: CacheControl;
|
|
94
|
-
}>;
|
|
95
|
-
/**
|
|
96
|
-
* Tag the last tool with cache_control so the (usually large) tool schema
|
|
97
|
-
* block lands in the cache after the first turn. Other tools are passed
|
|
98
|
-
* through verbatim — Anthropic caches the entire tools array prefix up to
|
|
99
|
-
* the last marker, so one breakpoint covers every preceding entry.
|
|
100
|
-
*
|
|
101
|
-
* Returns a new array; the caller's `opts.tools` reference is untouched so
|
|
102
|
-
* subsequent calls don't accumulate markers.
|
|
103
|
-
*/
|
|
104
|
-
export declare function buildCacheableTools(tools: readonly ProviderToolSchema[]): Array<ProviderToolSchema & {
|
|
105
|
-
cache_control?: CacheControl;
|
|
106
|
-
}>;
|
|
107
|
-
/**
|
|
108
|
-
* Tag the last block of the last message with cache_control. This is the
|
|
109
|
-
* rolling breakpoint that moves forward each turn — the second-to-last
|
|
110
|
-
* marker (set on the previous call) ages out into a regular cache prefix,
|
|
111
|
-
* which Anthropic will hit on the new call's read.
|
|
112
|
-
*
|
|
113
|
-
* Three message-shape cases:
|
|
114
|
-
* - last message is `{role, content: string}` → lift to a single text
|
|
115
|
-
* block with cache_control.
|
|
116
|
-
* - last message has a block array → shallow-clone the array and replace
|
|
117
|
-
* just the final block with a copy carrying cache_control.
|
|
118
|
-
* - empty content (defensive) → leave unchanged, no marker.
|
|
119
|
-
*
|
|
120
|
-
* Anthropic allows max 4 cache_control markers per request. With system
|
|
121
|
-
* + tools + this rolling one we sit at 3, leaving headroom; we still cap
|
|
122
|
-
* defensively in case a future change adds another slot.
|
|
123
|
-
*/
|
|
124
|
-
export declare function buildCacheableMessages(messages: readonly ProviderMessage[]): ProviderMessage[];
|
|
125
|
-
export declare const __cacheBreakpointCap = 4;
|
|
126
|
-
/**
|
|
127
|
-
* Patch `body` with the Anthropic extended-thinking payload when a budget is
|
|
128
|
-
* supplied. No-op when `budget` is undefined / 0 — the model emits no
|
|
129
|
-
* reasoning chain, same as claude/codex with effort omitted.
|
|
130
|
-
*
|
|
131
|
-
* Anthropic requires `max_tokens > thinking.budget_tokens`; if the caller's
|
|
132
|
-
* max_tokens is too small we lift it past `budget + 1024` so the API doesn't
|
|
133
|
-
* reject the request. Caller's explicit ceiling wins when it's already
|
|
134
|
-
* larger — we never SHRINK max_tokens.
|
|
135
|
-
*
|
|
136
|
-
* Thinking is only valid on Claude Sonnet 4 / Opus 4 / Haiku 4.5 (and later).
|
|
137
|
-
* maestroRegistry currently only ships sonnet, so we don't gate on model id
|
|
138
|
-
* here; if Phase 5 multi-provider lands an older model, the provider for
|
|
139
|
-
* that model just ignores `thinkingBudget` (this helper is Anthropic-only).
|
|
140
|
-
*/
|
|
141
|
-
export declare function applyThinkingBudget(body: Record<string, unknown>, budget: number | undefined): void;
|
|
142
|
-
/**
|
|
143
|
-
* Map the SDK's shared `EffortLevel` to an Anthropic thinking budget in
|
|
144
|
-
* tokens. Maestro accepts `low|medium|high|xhigh|max` (see
|
|
145
|
-
* `MAESTRO_EFFORT_VALUES`); other values return undefined so the caller skips
|
|
146
|
-
* thinking entirely.
|
|
147
|
-
*
|
|
148
|
-
* Scale (v0.1.19+ — aligned with the prompt-keyword tier ladder):
|
|
149
|
-
* - low → undefined (thinking off — latency-priority working mode)
|
|
150
|
-
* - medium → undefined (thinking off — default; matches Claude Code's
|
|
151
|
-
* "off unless asked" behavior. Persona text still
|
|
152
|
-
* shapes the model's working style, but the API
|
|
153
|
-
* ships without a `thinking` payload.)
|
|
154
|
-
* - high → 4 096 (T1 — same as the `think` / `생각해줘` keyword)
|
|
155
|
-
* - xhigh → 10 000 (T2 — same as `think hard` / `깊이 생각`)
|
|
156
|
-
* - max → 31 999 (T3 — same as `ultrathink` / `끝까지 생각`)
|
|
157
|
-
*
|
|
158
|
-
* Why only high/xhigh/max grant thinking: the lower three rungs are the
|
|
159
|
-
* conversational defaults where fast tool dispatch beats deeper reasoning
|
|
160
|
-
* (Telegram bot, chat UI, simple file ops). Users who want extended
|
|
161
|
-
* thinking either escalate via the effort knob explicitly or type the
|
|
162
|
-
* keyword in the prompt — both routes land on the same three tier budgets,
|
|
163
|
-
* so behavior is predictable across surfaces.
|
|
164
|
-
*
|
|
165
|
-
* Symmetry with `detectThinkingKeyword`: the three "on" tiers here mirror
|
|
166
|
-
* the three keyword tiers exactly. Whichever path activates thinking, the
|
|
167
|
-
* model sees one of {4096, 10000, 31999} — no fourth budget exists.
|
|
168
|
-
* `resolveThinkingBudget` (provider.ts) picks the higher of the two if
|
|
169
|
-
* both fire, so an `effort: "high"` call that happens to contain
|
|
170
|
-
* "ultrathink" in the prompt still gets T3, not T1.
|
|
171
|
-
*
|
|
172
|
-
* Budgets are *ceilings*, not enforced spending: the model decides how
|
|
173
|
-
* much to actually emit inside the budget. A 31999 ceiling on a simple
|
|
174
|
-
* task still costs almost nothing — the savings come from latency
|
|
175
|
-
* (model returns sooner when it knows the budget is smaller).
|
|
176
|
-
*/
|
|
177
|
-
export declare function effortToThinkingBudget(e: string | undefined): number | undefined;
|
|
178
|
-
/**
|
|
179
|
-
* Claude Code-style think-keyword detection.
|
|
180
|
-
*
|
|
181
|
-
* Scans the caller's user prompt for an explicit "think harder" cue. When
|
|
182
|
-
* present, returns the matching thinking-budget tier; otherwise returns
|
|
183
|
-
* undefined (the loop then ships the call with thinking disabled — same
|
|
184
|
-
* default Claude Code uses).
|
|
185
|
-
*
|
|
186
|
-
* Why this exists alongside `effortToThinkingBudget`:
|
|
187
|
-
* - `effort` is a *programmatic* knob set by the SDK consumer (CLI flag,
|
|
188
|
-
* config file, server-side default). It's awkward to plumb through
|
|
189
|
-
* conversational surfaces like a Telegram bot or chat UI where the user
|
|
190
|
-
* just types text.
|
|
191
|
-
* - The keyword path lets end-users toggle thinking via the prompt itself
|
|
192
|
-
* ("think harder", "끝까지 생각해줘") without the host having to wire
|
|
193
|
-
* UI for an effort selector. This matches Claude Code's behavior and
|
|
194
|
-
* is what users coming from CC instinctively try.
|
|
195
|
-
*
|
|
196
|
-
* Tier mapping mirrors Claude Code's documented set:
|
|
197
|
-
* tier 3 (max) → 31999 tokens — "ultrathink", "think harder",
|
|
198
|
-
* "끝까지 생각", "심층 생각"
|
|
199
|
-
* tier 2 (deep) → 10000 tokens — "think hard", "think a lot",
|
|
200
|
-
* "깊이 생각", "깊게 생각"
|
|
201
|
-
* tier 1 (basic) → 4096 tokens — "think" (English), "생각해줘" /
|
|
202
|
-
* "생각해봐" / "잘 생각" (Korean)
|
|
203
|
-
*
|
|
204
|
-
* Why 31999 (not 32768): Anthropic requires `max_tokens > budget`, and
|
|
205
|
-
* 31999 + 1024 = 33023 stays under the 64K max_tokens ceiling on sonnet-4-6
|
|
206
|
-
* while leaving room for the final text response. Picking 32768 would force
|
|
207
|
-
* max_tokens to ≥ 33792 which loses headroom for long answers.
|
|
208
|
-
*
|
|
209
|
-
* Why "think" word-boundary on English but substring on Korean:
|
|
210
|
-
* English splits with whitespace so `\bthink\b` cleanly avoids false hits
|
|
211
|
-
* on "thinking" / "rethink". Korean morphology glues particles to verbs
|
|
212
|
-
* ("생각해줘" / "생각해봐"), so we substring-match the verb stem and accept
|
|
213
|
-
* the false-positive rate (a Korean user saying "그는 잘 생각해" in a code
|
|
214
|
-
* snippet would unintentionally trigger — same trade-off CC made in
|
|
215
|
-
* English).
|
|
216
|
-
*
|
|
217
|
-
* Highest tier wins: if both "think" and "ultrathink" appear (e.g. "think
|
|
218
|
-
* about this — actually ultrathink"), we honor the higher budget. Tier
|
|
219
|
-
* ordering matters because tier-3 substrings contain tier-1's pattern.
|
|
220
|
-
*
|
|
221
|
-
* Pure helper — no side effects, safe to call on every turn. Exposed for
|
|
222
|
-
* tests and for hosts that want to compose their own keyword surfaces
|
|
223
|
-
* (e.g. add Japanese keywords without forking).
|
|
224
|
-
*/
|
|
225
|
-
export declare function detectThinkingKeyword(prompt: string | undefined): number | undefined;
|
|
226
|
-
/**
|
|
227
|
-
* Resolve the actual thinking budget the loop should send on *this turn*,
|
|
228
|
-
* given the base budget (already derived from effort) and the turn's
|
|
229
|
-
* position within the iteration cap.
|
|
230
|
-
*
|
|
231
|
-
* Why turn-adaptive:
|
|
232
|
-
* - Turn 0 (first call) is where the model parses the prompt and lays
|
|
233
|
-
* out its plan. Thinking here is the highest-ROI use of budget —
|
|
234
|
-
* a careful plan saves tool calls later. We send the full base.
|
|
235
|
-
* - Mid turns are tool-dispatch territory: "this grep returned X,
|
|
236
|
-
* now read Y." Interleaved thinking still has value (short
|
|
237
|
-
* reasoning between tool calls is what Anthropic's interleaved
|
|
238
|
-
* beta is for), so we keep the full base here too. Cutting it
|
|
239
|
-
* mid-flow defeats the beta.
|
|
240
|
-
* - The last 3 turns are the *wrap-up zone*. The iteration reminder
|
|
241
|
-
* has already flipped to "finalize NOW, stop tooling and write the
|
|
242
|
-
* final answer." At that point spending another 16K thinking on a
|
|
243
|
-
* turn that mostly emits final text is pure latency waste. We trim
|
|
244
|
-
* to 1/4 of base — enough room for a short "what should this
|
|
245
|
-
* summary include" pass, no room for fresh exploration.
|
|
246
|
-
*
|
|
247
|
-
* Floor: the trimmed budget is clamped to >= 1024 because Anthropic
|
|
248
|
-
* requires `thinking.budget_tokens >= 1024` when thinking is enabled.
|
|
249
|
-
* Returning a value below that would 400 the API. If the caller passed
|
|
250
|
-
* a base smaller than 1024 (shouldn't happen with our effort map, but
|
|
251
|
-
* a host could override), we just return the base as-is — the original
|
|
252
|
-
* `applyThinkingBudget` no-ops zero / undefined, and the user explicitly
|
|
253
|
-
* asked for less.
|
|
254
|
-
*
|
|
255
|
-
* Pure helper — no allocation, no closure — so loop.ts can call it
|
|
256
|
-
* cheaply inside the hot iteration loop. Exported for tests and for
|
|
257
|
-
* hosts that want to compose their own per-turn budgeting.
|
|
258
|
-
*/
|
|
259
|
-
export declare function thinkingBudgetForTurn(base: number | undefined, iter: number, maxIter: number): number | undefined;
|
|
260
|
-
/**
|
|
261
|
-
* Single source of truth for "is this turn in the wrap-up zone?" Used by
|
|
262
|
-
* three call sites that must all fire on the same boundary:
|
|
263
|
-
* 1. `thinkingBudgetForTurn` — trims the per-turn thinking budget.
|
|
264
|
-
* 2. `loop.ts` callOpts assembly — empties the tools schema (v0.1.17+).
|
|
265
|
-
* 3. `wrapUpOverlayLine` (provider.ts) — emits the reminder cue.
|
|
266
|
-
*
|
|
267
|
-
* Threshold logic:
|
|
268
|
-
* - Tiny caps (`maxIter <= 3`) — return false unconditionally.
|
|
269
|
-
* At maxIter=3 every turn is already a wrap-up turn; gating tools
|
|
270
|
-
* would mean the model can't call any tools from turn 1, which
|
|
271
|
-
* defeats the cap's purpose. Tiny caps trust the model + the
|
|
272
|
-
* iter-line tone to wind things down on their own.
|
|
273
|
-
* - Turn 0 — never wrap-up. The first turn is planning and must
|
|
274
|
-
* keep full capability even when `maxIter` is small (e.g. maxIter=4
|
|
275
|
-
* would otherwise gate the planning turn, which is exactly when
|
|
276
|
-
* the model needs tools most).
|
|
277
|
-
* - Last 3 turns (`maxIter - iter <= 3`) — wrap-up active.
|
|
278
|
-
*
|
|
279
|
-
* Why "last 3" and not "last 1": the model needs at least one full
|
|
280
|
-
* turn after entering wrap-up to actually synthesize and emit the
|
|
281
|
-
* final answer. With a 3-turn lead-in: turn N-3 enters wrap-up (no
|
|
282
|
-
* more tools), turns N-2 / N-1 can iterate on the final text if the
|
|
283
|
-
* first attempt was incomplete, turn N-0 is the hard ceiling.
|
|
284
|
-
*/
|
|
285
|
-
export declare function isWrapUpZone(iter: number, maxIter: number): boolean;
|
|
286
|
-
/**
|
|
287
|
-
* Build a system-prompt persona block that names the active effort level
|
|
288
|
-
* AND prescribes concrete behavior the model should adopt this turn.
|
|
289
|
-
*
|
|
290
|
-
* Why a system-prompt block (not a system-reminder line):
|
|
291
|
-
* - First-turn visibility. The per-iteration reminder lives in the user
|
|
292
|
-
* message and is reread each turn, but its `Tool iterations remaining`
|
|
293
|
-
* tone only shifts as the budget drains — at the start of an `xhigh`
|
|
294
|
-
* vs `low` run the model sees nearly identical text. A system-prompt
|
|
295
|
-
* persona lets the model condition every token from turn 1 on the
|
|
296
|
-
* working mode, instead of inferring it indirectly from `maxIter`.
|
|
297
|
-
* - Cache stability. The block is a pure function of `effort`, so the
|
|
298
|
-
* same five strings cycle through every call at a given level. They
|
|
299
|
-
* sit between caller `systemPrompt` and the skills catalog, riding
|
|
300
|
-
* the same prefix-cache boundary that already covers both — no extra
|
|
301
|
-
* invalidations.
|
|
302
|
-
*
|
|
303
|
-
* Effort-shape rationale (terse imperatives win over hedged paragraphs —
|
|
304
|
-
* the model conditions hardest on action verbs, not adjectives):
|
|
305
|
-
* - `low` — answer fast, one Read max, no verification
|
|
306
|
-
* - `medium` — one focused exploration, light cross-check
|
|
307
|
-
* - `high` — multi-file exploration, verify on doubt
|
|
308
|
-
* - `xhigh` — broad survey, hold multiple hypotheses, name edge cases
|
|
309
|
-
* - `max` — exhaustive: every relevant file, tests, all failure modes
|
|
310
|
-
*
|
|
311
|
-
* All five levels emit exactly four bullets (v0.1.16+). Uniform shape
|
|
312
|
-
* keeps the prefix-cache boundary identical-length across levels and
|
|
313
|
-
* makes A/B telemetry honest — a longer level can't outperform a shorter
|
|
314
|
-
* one just because the model had more text to condition on.
|
|
315
|
-
*
|
|
316
|
-
* Returns `undefined` for an unknown / absent effort so callers can skip
|
|
317
|
-
* concatenation entirely; the model then sees only the caller's system
|
|
318
|
-
* prompt, preserving the historical no-effort baseline.
|
|
319
|
-
*
|
|
320
|
-
* Lives in anthropic.ts next to `effortToThinkingBudget` for grep affinity,
|
|
321
|
-
* but the string itself is provider-agnostic — DeepSeek receives the same
|
|
322
|
-
* block via the same caller (provider.ts), so the persona cue is consistent
|
|
323
|
-
* across providers even when `reasoning_effort` is the only native handle
|
|
324
|
-
* the API exposes.
|
|
325
|
-
*/
|
|
326
|
-
export declare function effortToPersonaPrompt(e: string | undefined): string | undefined;
|
|
327
|
-
export {};
|
|
328
|
-
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
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