agents 0.23.0 → 0.25.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/dist/{agent-routing-DE5zmCQ8.d.ts → agent-routing-0DR0Tk2v.d.ts} +270 -190
- package/dist/agent-routing.d.ts +1 -1
- package/dist/agent-routing.js.map +1 -1
- package/dist/agent-tool-types.d.ts +13 -7
- package/dist/agent-tool-types.js +23 -1
- package/dist/agent-tool-types.js.map +1 -1
- package/dist/{agent-tools-y7zLfw4Q.js → agent-tools-CdJC-8Dc.js} +72 -9
- package/dist/agent-tools-CdJC-8Dc.js.map +1 -0
- package/dist/{agent-tools-DtXMTDGM.d.ts → agent-tools-YrATZJu2.d.ts} +29 -15
- package/dist/agent-tools.d.ts +6 -4
- package/dist/agent-tools.js.map +1 -1
- package/dist/ai-fm7xx1BK.js +312 -0
- package/dist/ai-fm7xx1BK.js.map +1 -0
- package/dist/base64-redaction-C1Uu29t5.js +59 -0
- package/dist/base64-redaction-C1Uu29t5.js.map +1 -0
- package/dist/browser/ai-sdk.d.ts +90 -0
- package/dist/browser/ai-sdk.js +51 -0
- package/dist/browser/ai-sdk.js.map +1 -0
- package/dist/browser/ai.d.ts +4 -4
- package/dist/browser/ai.js +1 -347
- package/dist/browser/index.d.ts +81 -79
- package/dist/browser/index.js +361 -2
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/tanstack-ai.d.ts +96 -1
- package/dist/browser/tanstack-ai.js +62 -2
- package/dist/browser/tanstack-ai.js.map +1 -1
- package/dist/browser-DE3d-RLk.d.ts +275 -0
- package/dist/browser-tool-CQ10e6Kj.js +480 -0
- package/dist/browser-tool-CQ10e6Kj.js.map +1 -0
- package/dist/browser-tool-DuNdlwZ9.d.ts +73 -0
- package/dist/{capability-BjSKYpzg.js → capability-B4WbF81e.js} +2 -1
- package/dist/capability-B4WbF81e.js.map +1 -0
- package/dist/{capability-runner-Be_-PLR1.d.ts → capability-runner-DBAnGr6L.d.ts} +45 -15
- package/dist/chat/index.d.ts +341 -232
- package/dist/chat/index.js +602 -72
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/react.d.ts +42 -2
- package/dist/chat/react.js +191 -35
- package/dist/chat/react.js.map +1 -1
- package/dist/chat/transport.d.ts +1 -1
- package/dist/chat/transport.js +1 -1
- package/dist/chat-sdk/index.d.ts +17 -3
- package/dist/chat-sdk/index.js +28 -2
- package/dist/chat-sdk/index.js.map +1 -1
- package/dist/client-4OlMIJx-.js +591 -0
- package/dist/client-4OlMIJx-.js.map +1 -0
- package/dist/{client-jagG8a9_.js → client-fyQrLGkD.js} +2 -2
- package/dist/{client-jagG8a9_.js.map → client-fyQrLGkD.js.map} +1 -1
- package/dist/client-je3koD9Z.d.ts +446 -0
- package/dist/client.d.ts +29 -283
- package/dist/client.js +2 -274
- package/dist/{connector-CptFKzRh.js → connector-58XDGvc3.js} +251 -120
- package/dist/connector-58XDGvc3.js.map +1 -0
- package/dist/{connector-CkQD4MK3.d.ts → connector-Cl-VqPmA.d.ts} +244 -146
- package/dist/context/index.d.ts +29 -0
- package/dist/context/index.js +64 -17
- package/dist/context/index.js.map +1 -1
- package/dist/current-agent-DhoDkSnH.js.map +1 -1
- package/dist/current-agent-vAk_5JMt.d.ts +93 -0
- package/dist/{current-agent-Da_C9a3b.d.ts → durable-object-lifecycle-HhgOMWq9.d.ts} +26 -127
- package/dist/harnesses/pi/index.d.ts +348 -0
- package/dist/harnesses/pi/index.js +754 -0
- package/dist/harnesses/pi/index.js.map +1 -0
- package/dist/images-iiTDSyRu.js +1631 -0
- package/dist/images-iiTDSyRu.js.map +1 -0
- package/dist/index-BreL0YrQ.d.ts +78 -0
- package/dist/index-kbSUIer3.d.ts +343 -0
- package/dist/index.d.ts +43 -41
- package/dist/index.js +2 -2
- package/dist/internal_context.d.ts +1 -1
- package/dist/lifecycle/index.d.ts +19 -17
- package/dist/lifecycle/index.js +2 -2
- package/dist/{lifecycle-CMRGjZdw.js → lifecycle-CFu6OV03.js} +73 -29
- package/dist/lifecycle-CFu6OV03.js.map +1 -0
- package/dist/mcp/client/index.d.ts +20 -20
- package/dist/mcp/client/index.js +1 -1
- package/dist/mcp/client/x402.js +21 -19
- package/dist/mcp/client/x402.js.map +1 -1
- package/dist/mcp/index.d.ts +35 -35
- package/dist/mcp/index.js +2 -2
- package/dist/{message-builder-BymO4N_D.js → message-builder-DAl9AhHH.js} +89 -4
- package/dist/message-builder-DAl9AhHH.js.map +1 -0
- package/dist/models/ai-sdk/index.d.ts +353 -0
- package/dist/models/ai-sdk/index.js +2443 -0
- package/dist/models/ai-sdk/index.js.map +1 -0
- package/dist/models/pi-ai/index.d.ts +313 -0
- package/dist/models/pi-ai/index.js +1795 -0
- package/dist/models/pi-ai/index.js.map +1 -0
- package/dist/observability/ai/index.js +20 -4
- package/dist/observability/ai/index.js.map +1 -1
- package/dist/{protocol-B0nh6KNf.js → protocol-kHsr-f0X.js} +26 -12
- package/dist/{protocol-B0nh6KNf.js.map → protocol-kHsr-f0X.js.map} +1 -1
- package/dist/queue/index.d.ts +123 -0
- package/dist/queue/index.js +2 -0
- package/dist/queue-BB-zfIYF.js +406 -0
- package/dist/queue-BB-zfIYF.js.map +1 -0
- package/dist/react.d.ts +31 -13
- package/dist/react.js +190 -71
- package/dist/react.js.map +1 -1
- package/dist/{retries-D9Ds-1lz.d.ts → retries-CV6AkXmQ.d.ts} +23 -8
- package/dist/retries.d.ts +12 -8
- package/dist/retries.js +19 -1
- package/dist/retries.js.map +1 -1
- package/dist/routing/index.d.ts +2 -2
- package/dist/routing/index.js +1 -1
- package/dist/{scheduler-DD9NdYbF.js → scheduler-DZ3xQfeK.js} +4 -11
- package/dist/scheduler-DZ3xQfeK.js.map +1 -0
- package/dist/{scheduler-Dwh85ZGl.d.ts → scheduler-RdACNXDP.d.ts} +6 -6
- package/dist/schedules/index.d.ts +1 -1
- package/dist/schedules/index.js +1 -1
- package/dist/serializable.d.ts +1 -1
- package/dist/sessions/index.d.ts +70 -3
- package/dist/sessions/index.js +276 -67
- package/dist/sessions/index.js.map +1 -1
- package/dist/skills/index.d.ts +29 -314
- package/dist/socket-address.d.ts +16 -0
- package/dist/socket-address.js +19 -0
- package/dist/socket-address.js.map +1 -0
- package/dist/{src-DlSHshb2.js → src-BZeu-SCD.js} +541 -500
- package/dist/src-BZeu-SCD.js.map +1 -0
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.js +137 -0
- package/dist/state/index.js.map +1 -0
- package/dist/streams/index.d.ts +1 -1
- package/dist/streams/index.js +1 -1
- package/dist/{streams-D6tJ0NN9.d.ts → streams-Cmkj9QfW.d.ts} +4 -2
- package/dist/{streams-DZKgAj9b.js → streams-DW-UCOUc.js} +9 -2
- package/dist/streams-DW-UCOUc.js.map +1 -0
- package/dist/sub-routing.d.ts +12 -12
- package/dist/tasks/index.d.ts +1 -1
- package/dist/tasks/index.js +1 -1
- package/dist/{tasks-ylZgBjhj.js → tasks-68DESxf0.js} +3 -3
- package/dist/{tasks-ylZgBjhj.js.map → tasks-68DESxf0.js.map} +1 -1
- package/dist/{tasks-BRJ5zgya.d.ts → tasks-9YxYtByh.d.ts} +5 -5
- package/dist/transport-PfFnt-Ld.d.ts +525 -0
- package/dist/transport-protocol-BxyngQ_R.js +25 -0
- package/dist/transport-protocol-BxyngQ_R.js.map +1 -0
- package/dist/transport-protocol-ZTew5Wso.d.ts +27 -0
- package/dist/types-BA4anrjI.d.ts +70 -0
- package/dist/voice/index.d.ts +2 -2
- package/dist/websockets/index.d.ts +195 -69
- package/dist/websockets/index.js +3 -2
- package/dist/websockets-Ci-LZFHH.js +1030 -0
- package/dist/websockets-Ci-LZFHH.js.map +1 -0
- package/dist/wire-types-CnMt6_HR.js.map +1 -1
- package/dist/wire-types-CrjKvDyi.d.ts +300 -0
- package/dist/workflow-types.d.ts +25 -25
- package/dist/workflows.d.ts +21 -21
- package/dist/workflows.js +1 -1
- package/dist/{ws-chat-transport-UNRIS2xl.d.ts → ws-chat-transport-BbT1A5Lc.d.ts} +51 -2
- package/dist/{ws-chat-transport-rWwta645.js → ws-chat-transport-cqMKq3IY.js} +143 -16
- package/dist/ws-chat-transport-cqMKq3IY.js.map +1 -0
- package/docs/agent-class.md +2 -2
- package/docs/agent-tools.md +29 -4
- package/docs/browse-the-web.md +87 -5
- package/docs/chat-agents.md +124 -16
- package/docs/client-sdk.md +30 -0
- package/docs/context.md +27 -0
- package/docs/durable-execution.md +2 -0
- package/docs/harnesses/pi.md +91 -0
- package/docs/human-in-the-loop.md +4 -0
- package/docs/index.md +4 -1
- package/docs/lifecycle.md +114 -23
- package/docs/models-pi-ai.md +325 -0
- package/docs/models.md +504 -0
- package/docs/queue.md +135 -241
- package/docs/resumable-streaming.md +2 -0
- package/docs/retries.md +1 -1
- package/docs/routing.md +13 -13
- package/docs/sessions.md +36 -1
- package/docs/state.md +1 -0
- package/docs/sub-agents.md +12 -3
- package/package.json +51 -3
- package/dist/agent-tools-y7zLfw4Q.js.map +0 -1
- package/dist/browser/ai.js.map +0 -1
- package/dist/capability-BjSKYpzg.js.map +0 -1
- package/dist/client-tools-aIBO0Fk7.d.ts +0 -53
- package/dist/client.js.map +0 -1
- package/dist/connector-CptFKzRh.js.map +0 -1
- package/dist/lifecycle-CMRGjZdw.js.map +0 -1
- package/dist/message-builder-BymO4N_D.js.map +0 -1
- package/dist/scheduler-DD9NdYbF.js.map +0 -1
- package/dist/src-DlSHshb2.js.map +0 -1
- package/dist/streams-DZKgAj9b.js.map +0 -1
- package/dist/websockets-DUfRHPRq.js +0 -502
- package/dist/websockets-DUfRHPRq.js.map +0 -1
- package/dist/ws-chat-transport-rWwta645.js.map +0 -1
package/dist/skills/index.d.ts
CHANGED
|
@@ -1,316 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
interface SkillContent extends SkillDescriptor {
|
|
31
|
-
body: string;
|
|
32
|
-
rawContent?: string;
|
|
33
|
-
resources?: SkillResourceDescriptor[];
|
|
34
|
-
}
|
|
35
|
-
interface SkillResourceDescriptor {
|
|
36
|
-
path: string;
|
|
37
|
-
kind: "reference" | "script" | "asset" | "file";
|
|
38
|
-
size?: number;
|
|
39
|
-
encoding?: "text" | "base64";
|
|
40
|
-
mimeType?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Set when a script resource was compiled to a self-contained JavaScript
|
|
43
|
-
* module ahead of time — by the Agents Vite plugin for bundled skills, or via
|
|
44
|
-
* `compileSkillScript` from `agents/skills/compile` for R2/dynamic skills. The
|
|
45
|
-
* runtime runs precompiled scripts directly; the runtime ships no in-Worker
|
|
46
|
-
* bundler, so non-precompiled TypeScript or multi-file scripts cannot run.
|
|
47
|
-
*/
|
|
48
|
-
precompiled?: boolean;
|
|
49
|
-
}
|
|
50
|
-
interface SkillResource extends SkillResourceDescriptor {
|
|
51
|
-
content: string;
|
|
52
|
-
}
|
|
53
|
-
interface SkillScriptContext {
|
|
54
|
-
skill: SkillDescriptor;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* The `ctx` object passed as the second argument to function-style JS/TS
|
|
58
|
-
* skill scripts (`export default async function run(input, ctx)`).
|
|
59
|
-
*
|
|
60
|
-
* Capabilities are gated by the runner: `workspace` throws unless workspace
|
|
61
|
-
* access is enabled, and `tools` only resolves tools the runner was given.
|
|
62
|
-
*/
|
|
63
|
-
interface SkillRunContext {
|
|
64
|
-
/** Metadata for the skill that owns this script. */
|
|
65
|
-
skill: SkillDescriptor;
|
|
66
|
-
/** Text bundled resources by relative path (e.g. `references/style-guide.md`). */
|
|
67
|
-
files: Record<string, string>;
|
|
68
|
-
/** Workspace access, gated by the runner's `workspace` permission. */
|
|
69
|
-
workspace: {
|
|
70
|
-
readFile(path: string): Promise<string | null>;
|
|
71
|
-
listFiles(path?: string): Promise<unknown>;
|
|
72
|
-
glob(pattern: string): Promise<unknown>;
|
|
73
|
-
stat(path: string): Promise<{
|
|
74
|
-
type: string;
|
|
75
|
-
size: number;
|
|
76
|
-
} | null>;
|
|
77
|
-
writeFile(path: string, content: string): Promise<void>;
|
|
78
|
-
};
|
|
79
|
-
/** Explicitly granted tools: `tools.call(name, input)` or `tools.<name>(input)`. */
|
|
80
|
-
tools: {
|
|
81
|
-
call(name: string, input?: unknown): Promise<unknown>;
|
|
82
|
-
} & Record<string, (input?: unknown) => Promise<unknown>>;
|
|
83
|
-
/** Scratch artifacts returned to the model as `outputFiles`. */
|
|
84
|
-
output: {
|
|
85
|
-
writeFile(name: string, content: string): Promise<void>;
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
interface SkillScriptRequest {
|
|
89
|
-
skill: SkillContent;
|
|
90
|
-
path: string;
|
|
91
|
-
source: string;
|
|
92
|
-
input: unknown;
|
|
93
|
-
resources?: SkillResource[];
|
|
94
|
-
}
|
|
95
|
-
interface SkillScriptRunner {
|
|
96
|
-
run(request: SkillScriptRequest): Promise<unknown>;
|
|
97
|
-
}
|
|
98
|
-
interface SkillSource {
|
|
99
|
-
id: string;
|
|
100
|
-
fingerprint: string;
|
|
101
|
-
list(): Promise<SkillDescriptor[]>;
|
|
102
|
-
load(name: string): Promise<SkillContent | null>;
|
|
103
|
-
readResource?(name: string, path: string): Promise<SkillResource | null>;
|
|
104
|
-
refresh?(): Promise<void>;
|
|
105
|
-
}
|
|
106
|
-
interface SkillManifestResource extends SkillResourceDescriptor {
|
|
107
|
-
content: string;
|
|
108
|
-
}
|
|
109
|
-
interface SkillManifestEntry {
|
|
110
|
-
name: string;
|
|
111
|
-
description: string;
|
|
112
|
-
body: string;
|
|
113
|
-
rawContent?: string;
|
|
114
|
-
compatibility?: string;
|
|
115
|
-
license?: string;
|
|
116
|
-
allowedTools?: string;
|
|
117
|
-
metadata?: Record<string, unknown>;
|
|
118
|
-
version?: string;
|
|
119
|
-
resources?: SkillManifestResource[];
|
|
120
|
-
}
|
|
121
|
-
interface SkillManifest {
|
|
122
|
-
id: string;
|
|
123
|
-
fingerprint: string;
|
|
124
|
-
skills: SkillManifestEntry[];
|
|
125
|
-
}
|
|
126
|
-
interface SkillRegistrySnapshot {
|
|
127
|
-
fingerprint: string;
|
|
128
|
-
catalogPrompt: string | null;
|
|
129
|
-
}
|
|
130
|
-
//#endregion
|
|
131
|
-
//#region src/skills/manifest.d.ts
|
|
132
|
-
declare function fromManifest(manifest: SkillManifest): SkillSource;
|
|
133
|
-
//#endregion
|
|
134
|
-
//#region src/skills/r2.d.ts
|
|
135
|
-
interface R2SkillSourceOptions {
|
|
136
|
-
prefix?: string;
|
|
137
|
-
skills?: string[];
|
|
138
|
-
id?: string;
|
|
139
|
-
fingerprint?: "metadata" | "content";
|
|
140
|
-
refreshIntervalMs?: number;
|
|
141
|
-
}
|
|
142
|
-
declare function r2(
|
|
143
|
-
bucket: R2Bucket,
|
|
144
|
-
options?: R2SkillSourceOptions
|
|
145
|
-
): SkillSource;
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region src/skills/runner.d.ts
|
|
148
|
-
/**
|
|
149
|
-
* Minimal workspace surface the skill runner needs. A concrete `Workspace`
|
|
150
|
-
* from `@cloudflare/shell` (or Think's `WorkspaceLike`) satisfies this
|
|
151
|
-
* structurally, so the runner does not depend on a filesystem package.
|
|
152
|
-
*/
|
|
153
|
-
interface SkillWorkspace {
|
|
154
|
-
readFile(path: string): Promise<string | null>;
|
|
155
|
-
writeFile(path: string, content: string): Promise<void>;
|
|
156
|
-
readDir(path: string): Promise<unknown>;
|
|
157
|
-
glob(pattern: string): Promise<unknown>;
|
|
158
|
-
stat(path: string): Promise<{
|
|
159
|
-
type: string;
|
|
160
|
-
size?: number;
|
|
161
|
-
} | null>;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Options for {@link runner}.
|
|
165
|
-
*
|
|
166
|
-
* @experimental Skill script execution is experimental and the option shape
|
|
167
|
-
* may change before stabilizing.
|
|
168
|
-
*/
|
|
169
|
-
interface WorkerSkillScriptRunnerOptions {
|
|
170
|
-
loader: WorkerLoader;
|
|
171
|
-
timeout?: number;
|
|
172
|
-
network?: boolean;
|
|
173
|
-
workspace?: "none" | "read" | "read-write";
|
|
174
|
-
workspaceInstance?: SkillWorkspace;
|
|
175
|
-
tools?: ToolSet | (() => ToolSet | Promise<ToolSet>);
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Create a skill script runner backed by a Worker Loader.
|
|
179
|
-
*
|
|
180
|
-
* Capabilities are opt-in and enforced by a single host bridge: no network and
|
|
181
|
-
* no tools by default, read-only workspace access when `workspaceInstance` is
|
|
182
|
-
* provided. JS/TS scripts are function-style (`export default run(input, ctx)`)
|
|
183
|
-
* and receive `ctx = { skill, files, workspace, tools, output }`. Python and
|
|
184
|
-
* Bash use the path-based `/skill`, `/input.json`, `/output` contract.
|
|
185
|
-
*
|
|
186
|
-
* @experimental Skill script execution is experimental and may change before
|
|
187
|
-
* stabilizing.
|
|
188
|
-
*/
|
|
189
|
-
declare function runner(
|
|
190
|
-
options: WorkerSkillScriptRunnerOptions
|
|
191
|
-
): SkillScriptRunner;
|
|
192
|
-
//#endregion
|
|
193
|
-
//#region src/skills/workspace.d.ts
|
|
194
|
-
/**
|
|
195
|
-
* Computer-style Workspace shape used for Agent Skills projection.
|
|
196
|
-
* `@cloudflare/computer.Workspace` satisfies this through `workspace.fs`.
|
|
197
|
-
*/
|
|
198
|
-
interface ComputerSkillWorkspace {
|
|
199
|
-
readonly fs: {
|
|
200
|
-
stat(path: string): Promise<unknown>;
|
|
201
|
-
readFile(
|
|
202
|
-
path: string,
|
|
203
|
-
options?: {
|
|
204
|
-
byteOffset?: number;
|
|
205
|
-
byteLength?: number;
|
|
206
|
-
}
|
|
207
|
-
): Promise<ReadableStream<Uint8Array>>;
|
|
208
|
-
readFile(path: string, encoding: "utf8"): Promise<string>;
|
|
209
|
-
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
210
|
-
mkdir(
|
|
211
|
-
path: string,
|
|
212
|
-
options?: {
|
|
213
|
-
recursive?: boolean;
|
|
214
|
-
}
|
|
215
|
-
): Promise<void>;
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Legacy direct filesystem shape used for Agent Skills projection.
|
|
220
|
-
* `@cloudflare/shell.Workspace` and Think `WorkspaceLike` satisfy this shape.
|
|
221
|
-
*/
|
|
222
|
-
interface LegacySkillWorkspace {
|
|
223
|
-
stat(path: string): Promise<unknown | null>;
|
|
224
|
-
readFile(path: string): Promise<string | null>;
|
|
225
|
-
readFileBytes(path: string): Promise<Uint8Array | null>;
|
|
226
|
-
writeFile(path: string, content: string): Promise<void>;
|
|
227
|
-
writeFileBytes(
|
|
228
|
-
path: string,
|
|
229
|
-
content: Uint8Array | ArrayBuffer,
|
|
230
|
-
mediaType?: string
|
|
231
|
-
): Promise<void>;
|
|
232
|
-
mkdir(
|
|
233
|
-
path: string,
|
|
234
|
-
options?: {
|
|
235
|
-
recursive?: boolean;
|
|
236
|
-
}
|
|
237
|
-
): Promise<void>;
|
|
238
|
-
}
|
|
239
|
-
/** Workspace accepted by `SkillRegistry.seedWorkspace()`. */
|
|
240
|
-
type SkillProjectionWorkspace = ComputerSkillWorkspace | LegacySkillWorkspace;
|
|
241
|
-
/** Options for projecting Agent Skills into a Workspace. */
|
|
242
|
-
interface SkillWorkspaceSeedOptions {
|
|
243
|
-
/**
|
|
244
|
-
* Destination directory. Defaults to `/workspace/.agents/skills` for a
|
|
245
|
-
* Computer Workspace and `/.agents/skills` for a legacy Shell Workspace.
|
|
246
|
-
*/
|
|
247
|
-
readonly root?: string;
|
|
248
|
-
/** Existing-file policy. Default `"preserve"` keeps Workspace edits. */
|
|
249
|
-
readonly onConflict?: "preserve" | "replace";
|
|
250
|
-
}
|
|
251
|
-
/** Summary returned after projecting Agent Skills into a Workspace. */
|
|
252
|
-
interface SkillWorkspaceSeedResult {
|
|
253
|
-
/** Files written from source content. */
|
|
254
|
-
readonly written: number;
|
|
255
|
-
/** Existing files preserved without a write. */
|
|
256
|
-
readonly preserved: number;
|
|
257
|
-
/** Files skipped because their source content could not be read or written. */
|
|
258
|
-
readonly skipped: number;
|
|
259
|
-
/** Non-fatal per-file diagnostics. */
|
|
260
|
-
readonly warnings: readonly string[];
|
|
261
|
-
/** Absolute Workspace directory containing the projected skills. */
|
|
262
|
-
readonly root: string;
|
|
263
|
-
}
|
|
264
|
-
//#endregion
|
|
265
|
-
//#region src/skills/registry.d.ts
|
|
266
|
-
declare class SkillRegistry {
|
|
267
|
-
readonly contextLabel = "think_skills";
|
|
268
|
-
/**
|
|
269
|
-
* Non-fatal diagnostics collected during the most recent {@link load} or
|
|
270
|
-
* {@link refresh} (duplicate skill names, sources that failed to list).
|
|
271
|
-
* Reset on every load so it never grows unbounded across refreshes.
|
|
272
|
-
*/
|
|
273
|
-
readonly warnings: string[];
|
|
274
|
-
private sources;
|
|
275
|
-
private scriptRunner;
|
|
276
|
-
private descriptors;
|
|
277
|
-
private sourceBySkill;
|
|
278
|
-
private loaded;
|
|
279
|
-
private workspaceFiles;
|
|
280
|
-
private workspaceSkillNames;
|
|
281
|
-
private workspaceResources;
|
|
282
|
-
constructor(sources: SkillSource[], scriptRunner?: SkillScriptRunner | null);
|
|
283
|
-
get fingerprint(): string;
|
|
284
|
-
load(): Promise<void>;
|
|
285
|
-
refresh(): Promise<void>;
|
|
286
|
-
/**
|
|
287
|
-
* Seed resolved Agent Skills into Computer or legacy Shell storage.
|
|
288
|
-
* Existing files are preserved by default, and become authoritative for
|
|
289
|
-
* activation, resource reads, and script execution.
|
|
290
|
-
*/
|
|
291
|
-
seedWorkspace(
|
|
292
|
-
workspace: SkillProjectionWorkspace,
|
|
293
|
-
options?: SkillWorkspaceSeedOptions
|
|
294
|
-
): Promise<SkillWorkspaceSeedResult>;
|
|
295
|
-
/**
|
|
296
|
-
* Route skill reads through an already-seeded Workspace without probing or
|
|
297
|
-
* rewriting its files. Hosts use this when the durable source fingerprint
|
|
298
|
-
* matches the recorded projection fingerprint.
|
|
299
|
-
*/
|
|
300
|
-
useWorkspace(
|
|
301
|
-
workspace: SkillProjectionWorkspace,
|
|
302
|
-
options?: SkillWorkspaceSeedOptions
|
|
303
|
-
): Promise<void>;
|
|
304
|
-
private writeSeedFile;
|
|
305
|
-
snapshot(): Promise<SkillRegistrySnapshot>;
|
|
306
|
-
systemPrompt(): Promise<string | null>;
|
|
307
|
-
loadSkill(name: string): Promise<SkillContent | null>;
|
|
308
|
-
private resolveResourceTarget;
|
|
309
|
-
private readResource;
|
|
310
|
-
private readSkillResources;
|
|
311
|
-
tools(): ToolSet;
|
|
312
|
-
}
|
|
313
|
-
//#endregion
|
|
1
|
+
import {
|
|
2
|
+
C as SkillScriptRequest,
|
|
3
|
+
D as parseSkillMarkdown,
|
|
4
|
+
E as parseSkillFrontmatter,
|
|
5
|
+
S as SkillScriptContext,
|
|
6
|
+
T as SkillSource,
|
|
7
|
+
_ as SkillManifestResource,
|
|
8
|
+
a as SkillWorkspaceSeedOptions,
|
|
9
|
+
b as SkillResourceDescriptor,
|
|
10
|
+
c as WorkerSkillScriptRunnerOptions,
|
|
11
|
+
d as r2,
|
|
12
|
+
f as fromManifest,
|
|
13
|
+
g as SkillManifestEntry,
|
|
14
|
+
h as SkillManifest,
|
|
15
|
+
i as SkillProjectionWorkspace,
|
|
16
|
+
l as runner,
|
|
17
|
+
m as SkillDescriptor,
|
|
18
|
+
n as ComputerSkillWorkspace,
|
|
19
|
+
o as SkillWorkspaceSeedResult,
|
|
20
|
+
p as SkillContent,
|
|
21
|
+
r as LegacySkillWorkspace,
|
|
22
|
+
s as SkillWorkspace,
|
|
23
|
+
t as SkillRegistry,
|
|
24
|
+
u as R2SkillSourceOptions,
|
|
25
|
+
v as SkillRegistrySnapshot,
|
|
26
|
+
w as SkillScriptRunner,
|
|
27
|
+
x as SkillRunContext,
|
|
28
|
+
y as SkillResource
|
|
29
|
+
} from "../index-kbSUIer3.js";
|
|
314
30
|
export {
|
|
315
31
|
type ComputerSkillWorkspace,
|
|
316
32
|
type LegacySkillWorkspace,
|
|
@@ -340,4 +56,3 @@ export {
|
|
|
340
56
|
r2,
|
|
341
57
|
runner
|
|
342
58
|
};
|
|
343
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/socket-address.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Set by `useAgent` on the socket it returns: `true` while the hook's options
|
|
4
|
+
* address a different agent than the socket it is still holding.
|
|
5
|
+
* `usePartySocket` replaces the socket in an effect, so for at least one
|
|
6
|
+
* render after `name` (or the host, path, or sub-agent chain) changes the
|
|
7
|
+
* returned socket still points at the previous agent, with the previous
|
|
8
|
+
* credentials in its URL.
|
|
9
|
+
*
|
|
10
|
+
* A registered symbol, so a separately bundled `useAgentChat` still sees it.
|
|
11
|
+
*/
|
|
12
|
+
declare const SOCKET_ADDRESS_PENDING: unique symbol;
|
|
13
|
+
declare function isSocketAddressPending(socket: object): boolean;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { SOCKET_ADDRESS_PENDING, isSocketAddressPending };
|
|
16
|
+
//# sourceMappingURL=socket-address.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/socket-address.ts
|
|
2
|
+
/**
|
|
3
|
+
* Set by `useAgent` on the socket it returns: `true` while the hook's options
|
|
4
|
+
* address a different agent than the socket it is still holding.
|
|
5
|
+
* `usePartySocket` replaces the socket in an effect, so for at least one
|
|
6
|
+
* render after `name` (or the host, path, or sub-agent chain) changes the
|
|
7
|
+
* returned socket still points at the previous agent, with the previous
|
|
8
|
+
* credentials in its URL.
|
|
9
|
+
*
|
|
10
|
+
* A registered symbol, so a separately bundled `useAgentChat` still sees it.
|
|
11
|
+
*/
|
|
12
|
+
const SOCKET_ADDRESS_PENDING = Symbol.for("cloudflare.agents.socketAddressPending");
|
|
13
|
+
function isSocketAddressPending(socket) {
|
|
14
|
+
return socket[SOCKET_ADDRESS_PENDING] === true;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { SOCKET_ADDRESS_PENDING, isSocketAddressPending };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=socket-address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socket-address.js","names":[],"sources":["../src/socket-address.ts"],"sourcesContent":["/**\n * Set by `useAgent` on the socket it returns: `true` while the hook's options\n * address a different agent than the socket it is still holding.\n * `usePartySocket` replaces the socket in an effect, so for at least one\n * render after `name` (or the host, path, or sub-agent chain) changes the\n * returned socket still points at the previous agent, with the previous\n * credentials in its URL.\n *\n * A registered symbol, so a separately bundled `useAgentChat` still sees it.\n */\nexport const SOCKET_ADDRESS_PENDING: unique symbol = Symbol.for(\n \"cloudflare.agents.socketAddressPending\"\n);\n\nexport function isSocketAddressPending(socket: object): boolean {\n return (\n (socket as { [SOCKET_ADDRESS_PENDING]?: boolean })[\n SOCKET_ADDRESS_PENDING\n ] === true\n );\n}\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,yBAAwC,OAAO,IAC1D,wCACF;AAEA,SAAgB,uBAAuB,QAAyB;CAC9D,OACG,OACC,4BACI;AAEV"}
|