@openplaybooks/agentfn 0.2.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/LICENSE +21 -0
- package/dist/agent.d.ts +19 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +9 -0
- package/dist/agent.js.map +1 -0
- package/dist/agentfn.d.ts +16 -0
- package/dist/agentfn.d.ts.map +1 -0
- package/dist/agentfn.js +470 -0
- package/dist/agentfn.js.map +1 -0
- package/dist/compose.d.ts +23 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +217 -0
- package/dist/compose.js.map +1 -0
- package/dist/feedback.d.ts +78 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.js +160 -0
- package/dist/feedback.js.map +1 -0
- package/dist/find-converge-root.d.ts +6 -0
- package/dist/find-converge-root.d.ts.map +1 -0
- package/dist/find-converge-root.js +18 -0
- package/dist/find-converge-root.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/prompting.d.ts +32 -0
- package/dist/prompting.d.ts.map +1 -0
- package/dist/prompting.js +103 -0
- package/dist/prompting.js.map +1 -0
- package/dist/provider.d.ts +6 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +10 -0
- package/dist/provider.js.map +1 -0
- package/dist/skills.d.ts +132 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +354 -0
- package/dist/skills.js.map +1 -0
- package/dist/types.d.ts +275 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +81 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import type { ZodType } from "zod";
|
|
2
|
+
import type { PromptInput } from "@openplaybooks/claudefn";
|
|
3
|
+
export type { PromptInput, ExecutionMode, ClaudeFnOptions, ClaudeFnResult, ClaudeFn, } from "@openplaybooks/claudefn";
|
|
4
|
+
/** @deprecated SDK backend removed */
|
|
5
|
+
export type Backend = "cli";
|
|
6
|
+
/** @deprecated SDK backend removed */
|
|
7
|
+
export type PermissionMode = never;
|
|
8
|
+
/** @deprecated SDK backend removed */
|
|
9
|
+
export type McpServerConfig = never;
|
|
10
|
+
/** @deprecated SDK backend removed */
|
|
11
|
+
export type AgentDefinition = never;
|
|
12
|
+
/** @deprecated SDK backend removed */
|
|
13
|
+
export type SessionEvent = never;
|
|
14
|
+
/** @deprecated SDK backend removed */
|
|
15
|
+
export type Session = never;
|
|
16
|
+
/** @deprecated SDK backend removed */
|
|
17
|
+
export type StreamCallOptions = never;
|
|
18
|
+
/** @deprecated SDK backend removed */
|
|
19
|
+
export type AgentResult<T = string> = {
|
|
20
|
+
data: T;
|
|
21
|
+
raw: string;
|
|
22
|
+
durationMs: number;
|
|
23
|
+
sessionId?: string;
|
|
24
|
+
};
|
|
25
|
+
/** @deprecated SDK backend removed */
|
|
26
|
+
export type AgentHooks = never;
|
|
27
|
+
/** @deprecated SDK backend removed */
|
|
28
|
+
export type ClaudeAgentOptions<T = string> = Record<string, unknown> & {
|
|
29
|
+
schema?: unknown;
|
|
30
|
+
};
|
|
31
|
+
/** @deprecated SDK backend removed */
|
|
32
|
+
export type StreamFn = never;
|
|
33
|
+
export type { KimiFnOptions, KimiFnResult, KimiFn } from "@openplaybooks/kimifn";
|
|
34
|
+
export type { QwenFnOptions, QwenFnResult, QwenFn } from "@openplaybooks/qwenfn";
|
|
35
|
+
export type { GeminiFnOptions, GeminiFnResult, GeminiFn, } from "@openplaybooks/geminifn";
|
|
36
|
+
export type { AcpFnOptions, AcpFnResult, AcpFn } from "@openplaybooks/acpfn";
|
|
37
|
+
export type { OpenFnOptions, OpenFnResult, OpenFn } from "@openplaybooks/openfn";
|
|
38
|
+
export type { CodexFnOptions, CodexFnResult, CodexFn } from "@openplaybooks/codexfn";
|
|
39
|
+
export type { DeepCodeFnOptions, DeepCodeFnResult, DeepCodeFn, } from "@openplaybooks/deepcodefn";
|
|
40
|
+
export type { GlobalQueue, GlobalQueueOptions, SendFeedbackOptions, } from "@openplaybooks/claudefn";
|
|
41
|
+
/** Options for enhancing prompts with skill/agent references */
|
|
42
|
+
/** Supported LLM providers */
|
|
43
|
+
export type Provider = "claude" | "kimi" | "qwen" | "gemini" | "acp" | "openfn" | "codex" | "deepcode" | "stub";
|
|
44
|
+
/** Lifecycle hooks — superset of both providers */
|
|
45
|
+
export interface AgentFnHooks {
|
|
46
|
+
/** Called before the request is sent. Can modify the prompt. */
|
|
47
|
+
before?: (ctx: {
|
|
48
|
+
prompt: string;
|
|
49
|
+
}) => string | void | Promise<string | void>;
|
|
50
|
+
/** Called after the response completes. Receives raw text. */
|
|
51
|
+
after?: (ctx: {
|
|
52
|
+
result: string;
|
|
53
|
+
durationMs: number;
|
|
54
|
+
}) => void | Promise<void>;
|
|
55
|
+
/** Called with each chunk of streaming text data */
|
|
56
|
+
onStream?: (chunk: string) => void;
|
|
57
|
+
/** Called for each raw SDK message (Claude SDK backend only) */
|
|
58
|
+
onMessage?: (message: unknown) => void | Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Called after each response with the result and session ID.
|
|
61
|
+
* Return a string to automatically send it as a follow-up message.
|
|
62
|
+
* (Claude stream mode only)
|
|
63
|
+
*/
|
|
64
|
+
onFeedback?: (ctx: {
|
|
65
|
+
result: string;
|
|
66
|
+
sessionId: string;
|
|
67
|
+
}) => string | void | Promise<string | void>;
|
|
68
|
+
}
|
|
69
|
+
/** Result from an agentfn invocation */
|
|
70
|
+
export interface AgentFnResult<T = string> {
|
|
71
|
+
/** Parsed data (typed via schema) or raw string if no schema */
|
|
72
|
+
data: T;
|
|
73
|
+
/** Raw text output */
|
|
74
|
+
raw: string;
|
|
75
|
+
/** Duration in milliseconds */
|
|
76
|
+
durationMs: number;
|
|
77
|
+
/** Which provider produced this result */
|
|
78
|
+
provider: Provider;
|
|
79
|
+
/** Session ID (Claude SDK/ACP backend only) */
|
|
80
|
+
sessionId?: string;
|
|
81
|
+
/** Total cost in USD (Claude SDK backend only) */
|
|
82
|
+
costUsd?: number;
|
|
83
|
+
/** Number of turns (Claude SDK/ACP backend only) */
|
|
84
|
+
numTurns?: number;
|
|
85
|
+
/** Path to log file (ACP backend only) */
|
|
86
|
+
logPath?: string;
|
|
87
|
+
}
|
|
88
|
+
/** A callable function created by agentfn() */
|
|
89
|
+
export type AgentFn<T = string> = (input?: string) => Promise<AgentFnResult<T>>;
|
|
90
|
+
/** Options for agentfn() */
|
|
91
|
+
export interface AgentFnOptions<T = string> {
|
|
92
|
+
/** Which provider to use (default: from getDefaultProvider()) */
|
|
93
|
+
provider?: Provider;
|
|
94
|
+
/** Static string with {{input}} placeholder, or a function */
|
|
95
|
+
prompt?: PromptInput;
|
|
96
|
+
/** Zod schema to validate & parse the output */
|
|
97
|
+
schema?: ZodType<T>;
|
|
98
|
+
/** Lifecycle hooks */
|
|
99
|
+
hooks?: AgentFnHooks;
|
|
100
|
+
/** Max time in ms before aborting (default: 120_000) */
|
|
101
|
+
timeoutMs?: number;
|
|
102
|
+
/** Maximum retries on failure (default: 0) */
|
|
103
|
+
maxRetries?: number;
|
|
104
|
+
/** Working directory for the process */
|
|
105
|
+
cwd?: string;
|
|
106
|
+
/** Global queue for rate limiting */
|
|
107
|
+
queue?: import("@openplaybooks/claudefn").GlobalQueue | import("@openplaybooks/claudefn").GlobalQueueOptions | boolean;
|
|
108
|
+
/** Extra CLI flags */
|
|
109
|
+
cliFlags?: string[];
|
|
110
|
+
/** Execution mode — "call" (default) or "stream" (Claude only) */
|
|
111
|
+
mode?: import("@openplaybooks/claudefn").ExecutionMode;
|
|
112
|
+
/** Backend — "cli" only (sdk backend removed) */
|
|
113
|
+
backend?: Backend;
|
|
114
|
+
/** Restrict available tools */
|
|
115
|
+
allowedTools?: string[];
|
|
116
|
+
/** Model (Claude SDK backend — removed) */
|
|
117
|
+
model?: string;
|
|
118
|
+
/** Permission mode (Claude SDK backend — removed) */
|
|
119
|
+
permissionMode?: PermissionMode;
|
|
120
|
+
/** Max conversation turns (Claude SDK backend — removed) */
|
|
121
|
+
maxTurns?: number;
|
|
122
|
+
/** System prompt (Claude SDK backend — removed) */
|
|
123
|
+
systemPrompt?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Path to a .md file appended to the system prompt via --append-system-prompt-file.
|
|
126
|
+
* Use for large context that would exceed CLI arg limits.
|
|
127
|
+
*/
|
|
128
|
+
systemPromptFile?: string;
|
|
129
|
+
/** Tools to block (Claude SDK backend — removed) */
|
|
130
|
+
disallowedTools?: string[];
|
|
131
|
+
/** MCP servers (Claude SDK backend — removed) */
|
|
132
|
+
mcpServers?: Record<string, McpServerConfig>;
|
|
133
|
+
/** Subagent definitions (Claude SDK backend — removed) */
|
|
134
|
+
agents?: Record<string, AgentDefinition>;
|
|
135
|
+
/** Resume session (Claude SDK backend) */
|
|
136
|
+
resume?: string;
|
|
137
|
+
/** Reasoning effort (Claude SDK backend) */
|
|
138
|
+
effort?: "low" | "medium" | "high" | "max";
|
|
139
|
+
/** Max budget in USD (Claude SDK backend) */
|
|
140
|
+
maxBudgetUsd?: number;
|
|
141
|
+
/** Max feedback turns (Claude stream mode) */
|
|
142
|
+
maxFeedbackTurns?: number;
|
|
143
|
+
/**
|
|
144
|
+
* Custom API key for ACP provider.
|
|
145
|
+
* Use this to connect to Claude-compatible APIs (e.g., Kimi).
|
|
146
|
+
*/
|
|
147
|
+
apiKey?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Custom base URL for ACP provider.
|
|
150
|
+
* Use this to connect to Claude-compatible APIs (e.g., https://api.moonshot.cn/v1).
|
|
151
|
+
*/
|
|
152
|
+
baseUrl?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Multiple AI providers for Opencode.
|
|
155
|
+
* Each provider has its own API key.
|
|
156
|
+
*/
|
|
157
|
+
providers?: Record<string, {
|
|
158
|
+
apiKey: string;
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* AbortSignal to cancel the running process.
|
|
162
|
+
* When aborted, the spawned child process is killed.
|
|
163
|
+
*/
|
|
164
|
+
signal?: AbortSignal;
|
|
165
|
+
/**
|
|
166
|
+
* @deprecated Use skillsRoot + skills instead.
|
|
167
|
+
* Enable automatic skill/agent injection via /skill and @agent references.
|
|
168
|
+
* When enabled, prompts are enhanced with file paths to referenced skills/agents.
|
|
169
|
+
* Default: true
|
|
170
|
+
*/
|
|
171
|
+
enableSkills?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Absolute path to the skills directory (e.g. "/project/.converge/skills").
|
|
174
|
+
* When set, agentfn will create .claude/skills/ symlinks for Claude provider
|
|
175
|
+
* and clean them up after execution.
|
|
176
|
+
*/
|
|
177
|
+
skillsRoot?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Explicit list of skill names to activate.
|
|
180
|
+
* When set with skillsRoot, only these skills get symlinked.
|
|
181
|
+
* When omitted but skillsRoot is set, all discovered skills are symlinked.
|
|
182
|
+
*/
|
|
183
|
+
skills?: string[];
|
|
184
|
+
/**
|
|
185
|
+
* Direct skill name → absolute directory path mappings.
|
|
186
|
+
* Each entry creates an absolute symlink: .claude/skills/{name} → absPath.
|
|
187
|
+
* Takes precedence over skillsRoot for the named skills.
|
|
188
|
+
* Useful when skills live in different locations (e.g. task dir + shared skills dir).
|
|
189
|
+
*/
|
|
190
|
+
skillDirs?: Record<string, string>;
|
|
191
|
+
/**
|
|
192
|
+
* Directory to write claudefn execution logs.
|
|
193
|
+
* Passed through to claudefn when using the Claude provider.
|
|
194
|
+
*/
|
|
195
|
+
logDir?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Environment variables to set when spawning the AI process.
|
|
198
|
+
* These are merged with process.env, with these values taking precedence.
|
|
199
|
+
* Useful for configuring Claude CLI to use custom API endpoints (e.g., MiniMax).
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* env: {
|
|
203
|
+
* ANTHROPIC_BASE_URL: "https://api.minimax.io/anthropic",
|
|
204
|
+
* ANTHROPIC_AUTH_TOKEN: "<your-api-key>"
|
|
205
|
+
* }
|
|
206
|
+
*/
|
|
207
|
+
env?: Record<string, string>;
|
|
208
|
+
}
|
|
209
|
+
/** A tool usable in compose() */
|
|
210
|
+
export interface ToolDef {
|
|
211
|
+
/** The callable function to invoke */
|
|
212
|
+
fn: AgentFn<any>;
|
|
213
|
+
/** Description shown to the LLM */
|
|
214
|
+
description: string;
|
|
215
|
+
}
|
|
216
|
+
/** Extended hooks for composed functions */
|
|
217
|
+
export interface ComposeHooks extends AgentFnHooks {
|
|
218
|
+
/** Called after each tool invocation */
|
|
219
|
+
onToolCall?: (ctx: {
|
|
220
|
+
name: string;
|
|
221
|
+
input: string;
|
|
222
|
+
result: AgentFnResult<any>;
|
|
223
|
+
}) => void | Promise<void>;
|
|
224
|
+
}
|
|
225
|
+
/** Options for compose() */
|
|
226
|
+
export interface ComposeOptions<T = string> {
|
|
227
|
+
/** Which provider to use (default: from getDefaultProvider()) */
|
|
228
|
+
provider?: Provider;
|
|
229
|
+
/** Static string with {{input}} placeholder, or a function */
|
|
230
|
+
prompt: PromptInput;
|
|
231
|
+
/** Map of tool name to tool definition */
|
|
232
|
+
tools: Record<string, ToolDef>;
|
|
233
|
+
/** Composition mode — "code" (default) or "tool_call" */
|
|
234
|
+
composeMode?: "code" | "tool_call";
|
|
235
|
+
/** Zod schema to validate & parse the final output */
|
|
236
|
+
schema?: ZodType<T>;
|
|
237
|
+
/** Lifecycle hooks */
|
|
238
|
+
hooks?: ComposeHooks;
|
|
239
|
+
/** Max time per invocation in ms (default: 120_000) */
|
|
240
|
+
timeoutMs?: number;
|
|
241
|
+
/** Maximum retries on failure (default: 0) */
|
|
242
|
+
maxRetries?: number;
|
|
243
|
+
/** Maximum iterations (default: 10) */
|
|
244
|
+
maxIterations?: number;
|
|
245
|
+
/** Working directory */
|
|
246
|
+
cwd?: string;
|
|
247
|
+
/** Global queue for rate limiting */
|
|
248
|
+
queue?: import("@openplaybooks/claudefn").GlobalQueue | import("@openplaybooks/claudefn").GlobalQueueOptions | boolean;
|
|
249
|
+
/** Extra CLI flags */
|
|
250
|
+
cliFlags?: string[];
|
|
251
|
+
/** Backend — "cli" only (sdk backend removed) */
|
|
252
|
+
backend?: Backend;
|
|
253
|
+
/** Restrict available tools (Claude only) */
|
|
254
|
+
allowedTools?: string[];
|
|
255
|
+
/** Model (Claude SDK backend — removed) */
|
|
256
|
+
model?: string;
|
|
257
|
+
/** Permission mode (Claude SDK backend — removed) */
|
|
258
|
+
permissionMode?: PermissionMode;
|
|
259
|
+
/** System prompt (Claude SDK backend — removed) */
|
|
260
|
+
systemPrompt?: string;
|
|
261
|
+
/**
|
|
262
|
+
* @deprecated Use skillsRoot + skills instead.
|
|
263
|
+
*/
|
|
264
|
+
enableSkills?: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Absolute path to the skills directory.
|
|
267
|
+
* When set, creates .claude/skills/ symlinks for Claude provider.
|
|
268
|
+
*/
|
|
269
|
+
skillsRoot?: string;
|
|
270
|
+
/**
|
|
271
|
+
* Explicit list of skill names to activate.
|
|
272
|
+
*/
|
|
273
|
+
skills?: string[];
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAInC,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,yBAAyB,CAAC;AAIjC,YAAY,EACV,WAAW,EACX,aAAa,EACb,eAAe,EACf,cAAc,EACd,QAAQ,GACT,MAAM,yBAAyB,CAAC;AAIjC,sCAAsC;AACtC,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC;AAC5B,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC;AACnC,sCAAsC;AACtC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ACF,OAAO,yBAAyB,EAAE,WAAW,GAC7C,OAAO,yBAAyB,EAAE,kBAAkB,GACpD,OAAO,CAAC;IACZ,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAIpB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openplaybooks/agentfn",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Unified agent function — switch between Claude, Kimi, Qwen, and Gemini providers in a single interface",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Converge Framework Contributors",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/openplaybooks-dev/converge.git",
|
|
11
|
+
"directory": "packages/agentfn"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./skills": {
|
|
25
|
+
"types": "./dist/skills.d.ts",
|
|
26
|
+
"import": "./dist/skills.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"zod": "^3.24.0",
|
|
34
|
+
"@openplaybooks/acpfn": "0.1.0",
|
|
35
|
+
"@openplaybooks/codexfn": "0.1.0",
|
|
36
|
+
"@openplaybooks/deepcodefn": "0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@openplaybooks/claudefn": "0.1.0",
|
|
40
|
+
"@openplaybooks/kimifn": "0.1.0",
|
|
41
|
+
"@openplaybooks/qwenfn": "0.1.0",
|
|
42
|
+
"@openplaybooks/openfn": "0.1.0",
|
|
43
|
+
"@openplaybooks/geminifn": "0.1.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@openplaybooks/claudefn": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"@openplaybooks/kimifn": {
|
|
50
|
+
"optional": true
|
|
51
|
+
},
|
|
52
|
+
"@openplaybooks/qwenfn": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"@openplaybooks/geminifn": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"@openplaybooks/openfn": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"typescript": "^5.9.0",
|
|
64
|
+
"vitest": "^3.1.0",
|
|
65
|
+
"@types/node": "^22.0.0",
|
|
66
|
+
"@openplaybooks/kimifn": "0.1.0",
|
|
67
|
+
"@openplaybooks/geminifn": "0.1.0",
|
|
68
|
+
"@openplaybooks/openfn": "0.1.0",
|
|
69
|
+
"@openplaybooks/claudefn": "0.1.0",
|
|
70
|
+
"@openplaybooks/qwenfn": "0.1.0"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"prebuild": "rm -rf dist",
|
|
74
|
+
"build": "tsc -p tsconfig.build.json",
|
|
75
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
76
|
+
"test": "vitest run",
|
|
77
|
+
"test:watch": "vitest",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
79
|
+
"clean": "rm -rf dist"
|
|
80
|
+
}
|
|
81
|
+
}
|