openpond-sdk 0.0.4 → 0.0.6
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 +54 -0
- package/dist/actions-local.js +15184 -0
- package/dist/actions-local.js.map +7 -0
- package/dist/actions.js +14615 -0
- package/dist/actions.js.map +7 -0
- package/dist/index.js +682 -965
- package/dist/index.js.map +3 -3
- package/dist/project-actions.js +247 -0
- package/dist/project-actions.js.map +7 -0
- package/dist/types/packages/actions/src/build.d.ts +9 -0
- package/dist/types/packages/actions/src/build.d.ts.map +1 -0
- package/dist/types/packages/actions/src/catalog.d.ts +4 -0
- package/dist/types/packages/actions/src/catalog.d.ts.map +1 -0
- package/dist/types/packages/actions/src/configuration.d.ts +20 -0
- package/dist/types/packages/actions/src/configuration.d.ts.map +1 -0
- package/dist/types/packages/actions/src/define-action.d.ts +4 -0
- package/dist/types/packages/actions/src/define-action.d.ts.map +1 -0
- package/dist/types/packages/actions/src/discovery.d.ts +9 -0
- package/dist/types/packages/actions/src/discovery.d.ts.map +1 -0
- package/dist/types/packages/actions/src/hash.d.ts +3 -0
- package/dist/types/packages/actions/src/hash.d.ts.map +1 -0
- package/dist/types/packages/actions/src/index.d.ts +4 -0
- package/dist/types/packages/actions/src/index.d.ts.map +1 -0
- package/dist/types/packages/actions/src/local.d.ts +6 -0
- package/dist/types/packages/actions/src/local.d.ts.map +1 -0
- package/dist/types/packages/actions/src/schema.d.ts +4 -0
- package/dist/types/packages/actions/src/schema.d.ts.map +1 -0
- package/dist/types/packages/actions/src/setup.d.ts +4 -0
- package/dist/types/packages/actions/src/setup.d.ts.map +1 -0
- package/dist/types/packages/actions/src/types.d.ts +161 -0
- package/dist/types/packages/actions/src/types.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/actions-local.d.ts +3 -0
- package/dist/types/packages/sdk/src/actions-local.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/actions.d.ts +3 -0
- package/dist/types/packages/sdk/src/actions.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/index.d.ts +10 -6
- package/dist/types/packages/sdk/src/index.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/project-actions.d.ts +66 -0
- package/dist/types/packages/sdk/src/project-actions.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/work.d.ts +2 -2
- package/dist/types/packages/sdk/src/work.d.ts.map +1 -1
- package/package.json +24 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// src/project-actions.ts
|
|
2
|
+
import { promises as fs } from "node:fs";
|
|
3
|
+
|
|
4
|
+
// ../cloud/dist/api/vercel-protection.js
|
|
5
|
+
var VERCEL_PROTECTION_BYPASS_HEADER = "x-vercel-protection-bypass";
|
|
6
|
+
function withVercelProtectionBypass(requestUrl, inputHeaders, env = typeof process === "undefined" ? {} : process.env) {
|
|
7
|
+
const headers = new Headers(inputHeaders);
|
|
8
|
+
const secret = env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();
|
|
9
|
+
if (!secret || !isOpenPondStagingUrl(requestUrl))
|
|
10
|
+
return headers;
|
|
11
|
+
headers.set(VERCEL_PROTECTION_BYPASS_HEADER, secret);
|
|
12
|
+
return headers;
|
|
13
|
+
}
|
|
14
|
+
function isOpenPondStagingUrl(requestUrl) {
|
|
15
|
+
try {
|
|
16
|
+
const hostname = new URL(requestUrl).hostname.toLowerCase();
|
|
17
|
+
return hostname === "staging.openpond.ai" || hostname === "staging-api.openpond.ai" || hostname.endsWith(".staging-api.openpond.ai");
|
|
18
|
+
} catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// ../cloud/dist/api/core.js
|
|
24
|
+
var DEFAULT_API_TIMEOUT_MS = 3e4;
|
|
25
|
+
var DEFAULT_API_RESPONSE_BYTES = 8 * 1024 * 1024;
|
|
26
|
+
var LONG_STREAM_API_OPTIONS = { timeoutMs: 15 * 60 * 1e3, maxResponseBytes: 64 * 1024 * 1024 };
|
|
27
|
+
var ApiTimeoutError = class extends Error {
|
|
28
|
+
timeoutMs;
|
|
29
|
+
requestUrl;
|
|
30
|
+
code = "OPENPOND_API_TIMEOUT";
|
|
31
|
+
constructor(timeoutMs, requestUrl) {
|
|
32
|
+
super(`API request timed out after ${timeoutMs}ms: ${requestUrl}`);
|
|
33
|
+
this.timeoutMs = timeoutMs;
|
|
34
|
+
this.requestUrl = requestUrl;
|
|
35
|
+
this.name = "ApiTimeoutError";
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var ApiResponseTooLargeError = class extends Error {
|
|
39
|
+
maximumBytes;
|
|
40
|
+
requestUrl;
|
|
41
|
+
code = "OPENPOND_API_RESPONSE_TOO_LARGE";
|
|
42
|
+
constructor(maximumBytes, requestUrl) {
|
|
43
|
+
super(`API response exceeded ${maximumBytes} bytes: ${requestUrl}`);
|
|
44
|
+
this.maximumBytes = maximumBytes;
|
|
45
|
+
this.requestUrl = requestUrl;
|
|
46
|
+
this.name = "ApiResponseTooLargeError";
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var OpenPondApiError = class extends Error {
|
|
50
|
+
status;
|
|
51
|
+
apiMessage;
|
|
52
|
+
code;
|
|
53
|
+
constructor(status, errorCode, label, apiMessage = null) {
|
|
54
|
+
const detail = apiMessage || errorCode;
|
|
55
|
+
super(`${label} failed: ${status}${detail ? ` ${detail}` : ""}`);
|
|
56
|
+
this.status = status;
|
|
57
|
+
this.apiMessage = apiMessage;
|
|
58
|
+
this.name = "OpenPondApiError";
|
|
59
|
+
this.code = errorCode || "OPENPOND_API_ERROR";
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
async function apiFetch(baseUrl, token, requestPath, options = {}) {
|
|
63
|
+
const { timeoutMs = DEFAULT_API_TIMEOUT_MS, maxResponseBytes = DEFAULT_API_RESPONSE_BYTES, ...init } = options;
|
|
64
|
+
const requestUrl = `${baseUrl}${requestPath}`;
|
|
65
|
+
const headers = withVercelProtectionBypass(requestUrl, init.headers);
|
|
66
|
+
headers.set("Content-Type", "application/json");
|
|
67
|
+
const apiKey = process.env.OPENPOND_API_KEY;
|
|
68
|
+
const trimmedToken = token?.trim() || "";
|
|
69
|
+
const tokenIsApiKey = trimmedToken.startsWith("opk_");
|
|
70
|
+
const effectiveApiKey = apiKey || (tokenIsApiKey ? trimmedToken : null);
|
|
71
|
+
if (effectiveApiKey && !headers.has("openpond-api-key"))
|
|
72
|
+
headers.set("openpond-api-key", effectiveApiKey);
|
|
73
|
+
if (token) {
|
|
74
|
+
headers.set("Authorization", tokenIsApiKey ? `ApiKey ${trimmedToken}` : `Bearer ${token}`);
|
|
75
|
+
} else if (apiKey && !headers.has("Authorization")) {
|
|
76
|
+
headers.set("Authorization", `ApiKey ${apiKey}`);
|
|
77
|
+
}
|
|
78
|
+
const timeoutController = new AbortController();
|
|
79
|
+
const timeoutError = new ApiTimeoutError(timeoutMs, requestUrl);
|
|
80
|
+
const timer = timeoutMs > 0 ? setTimeout(() => timeoutController.abort(timeoutError), timeoutMs) : null;
|
|
81
|
+
timer?.unref?.();
|
|
82
|
+
const signal = composedSignal(init.signal, timeoutController.signal, timeoutMs);
|
|
83
|
+
const cleanup = () => {
|
|
84
|
+
if (timer)
|
|
85
|
+
clearTimeout(timer);
|
|
86
|
+
};
|
|
87
|
+
try {
|
|
88
|
+
const response = await fetch(requestUrl, { ...init, headers, signal });
|
|
89
|
+
return boundedResponse(response, {
|
|
90
|
+
cleanup,
|
|
91
|
+
maximumBytes: maxResponseBytes,
|
|
92
|
+
requestUrl,
|
|
93
|
+
timeoutController,
|
|
94
|
+
timeoutError
|
|
95
|
+
});
|
|
96
|
+
} catch (error) {
|
|
97
|
+
cleanup();
|
|
98
|
+
if (timeoutController.signal.aborted)
|
|
99
|
+
throw timeoutError;
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function readApiJson(response, label) {
|
|
104
|
+
let payload;
|
|
105
|
+
try {
|
|
106
|
+
const text = await response.text();
|
|
107
|
+
payload = text ? JSON.parse(text) : {};
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (error instanceof ApiTimeoutError || error instanceof ApiResponseTooLargeError)
|
|
110
|
+
throw error;
|
|
111
|
+
payload = {};
|
|
112
|
+
}
|
|
113
|
+
if (!response.ok) {
|
|
114
|
+
const errorCode = typeof payload.error === "string" ? payload.error : null;
|
|
115
|
+
const apiMessage = typeof payload.message === "string" ? payload.message : null;
|
|
116
|
+
throw new OpenPondApiError(response.status, errorCode, label, apiMessage);
|
|
117
|
+
}
|
|
118
|
+
return payload;
|
|
119
|
+
}
|
|
120
|
+
function boundedResponse(response, input) {
|
|
121
|
+
if (!response.body) {
|
|
122
|
+
input.cleanup();
|
|
123
|
+
return response;
|
|
124
|
+
}
|
|
125
|
+
const contentLength = Number(response.headers.get("content-length"));
|
|
126
|
+
if (input.maximumBytes > 0 && Number.isFinite(contentLength) && contentLength > input.maximumBytes) {
|
|
127
|
+
input.cleanup();
|
|
128
|
+
void response.body.cancel();
|
|
129
|
+
throw new ApiResponseTooLargeError(input.maximumBytes, input.requestUrl);
|
|
130
|
+
}
|
|
131
|
+
const reader = response.body.getReader();
|
|
132
|
+
let receivedBytes = 0;
|
|
133
|
+
const body = new ReadableStream({
|
|
134
|
+
async pull(controller) {
|
|
135
|
+
try {
|
|
136
|
+
const result = await reader.read();
|
|
137
|
+
if (result.done) {
|
|
138
|
+
input.cleanup();
|
|
139
|
+
controller.close();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
receivedBytes += result.value.byteLength;
|
|
143
|
+
if (input.maximumBytes > 0 && receivedBytes > input.maximumBytes) {
|
|
144
|
+
input.cleanup();
|
|
145
|
+
await reader.cancel();
|
|
146
|
+
controller.error(new ApiResponseTooLargeError(input.maximumBytes, input.requestUrl));
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
controller.enqueue(result.value);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
input.cleanup();
|
|
152
|
+
controller.error(input.timeoutController.signal.aborted ? input.timeoutError : error);
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
async cancel(reason) {
|
|
156
|
+
input.cleanup();
|
|
157
|
+
await reader.cancel(reason);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
return new Response(body, {
|
|
161
|
+
headers: response.headers,
|
|
162
|
+
status: response.status,
|
|
163
|
+
statusText: response.statusText
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function composedSignal(callerSignal, timeoutSignal, timeoutMs) {
|
|
167
|
+
if (timeoutMs <= 0)
|
|
168
|
+
return callerSignal ?? void 0;
|
|
169
|
+
return callerSignal ? AbortSignal.any([callerSignal, timeoutSignal]) : timeoutSignal;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// src/project-actions.ts
|
|
173
|
+
var OpenPondProjectActionsClient = class {
|
|
174
|
+
#apiKey;
|
|
175
|
+
#apiBaseUrl;
|
|
176
|
+
constructor(input) {
|
|
177
|
+
this.#apiKey = input.apiKey;
|
|
178
|
+
this.#apiBaseUrl = input.apiBaseUrl.replace(/\/+$/, "");
|
|
179
|
+
}
|
|
180
|
+
async list(input) {
|
|
181
|
+
const response = await apiFetch(
|
|
182
|
+
this.#apiBaseUrl,
|
|
183
|
+
this.#apiKey,
|
|
184
|
+
projectActionPath(input.projectId, "releases", input.teamId)
|
|
185
|
+
);
|
|
186
|
+
return (await readApiJson(response, "List Project Action releases")).releases;
|
|
187
|
+
}
|
|
188
|
+
async catalog(input) {
|
|
189
|
+
const response = await apiFetch(
|
|
190
|
+
this.#apiBaseUrl,
|
|
191
|
+
this.#apiKey,
|
|
192
|
+
projectActionPath(input.projectId, "catalog", input.teamId)
|
|
193
|
+
);
|
|
194
|
+
return (await readApiJson(response, "Get Project Action catalog")).catalog;
|
|
195
|
+
}
|
|
196
|
+
async publish(input) {
|
|
197
|
+
const [bundle, runner] = await Promise.all([
|
|
198
|
+
fs.readFile(input.build.bundlePath),
|
|
199
|
+
fs.readFile(input.build.runnerPath)
|
|
200
|
+
]);
|
|
201
|
+
const response = await apiFetch(
|
|
202
|
+
this.#apiBaseUrl,
|
|
203
|
+
this.#apiKey,
|
|
204
|
+
projectActionPath(input.projectId, "releases", input.teamId),
|
|
205
|
+
{
|
|
206
|
+
method: "POST",
|
|
207
|
+
body: JSON.stringify({
|
|
208
|
+
sourceRef: input.sourceRef,
|
|
209
|
+
sourceCommitSha: input.sourceCommitSha,
|
|
210
|
+
bundleBase64: bundle.toString("base64"),
|
|
211
|
+
runnerBase64: runner.toString("base64"),
|
|
212
|
+
registry: input.build.registry,
|
|
213
|
+
manifest: input.build.manifest,
|
|
214
|
+
metadata: input.metadata
|
|
215
|
+
})
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
return (await readApiJson(response, "Publish Project Actions")).release;
|
|
219
|
+
}
|
|
220
|
+
async run(input) {
|
|
221
|
+
const response = await apiFetch(
|
|
222
|
+
this.#apiBaseUrl,
|
|
223
|
+
this.#apiKey,
|
|
224
|
+
projectActionPath(input.projectId, `actions/${encodeURIComponent(input.actionId)}`, input.teamId),
|
|
225
|
+
{
|
|
226
|
+
method: "POST",
|
|
227
|
+
body: JSON.stringify({
|
|
228
|
+
input: input.value ?? {},
|
|
229
|
+
releaseId: input.releaseId,
|
|
230
|
+
idempotencyKey: input.idempotencyKey,
|
|
231
|
+
callerType: input.callerType ?? "sdk",
|
|
232
|
+
callerId: input.callerId
|
|
233
|
+
}),
|
|
234
|
+
signal: input.signal,
|
|
235
|
+
timeoutMs: 15 * 60 * 1e3
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
return (await readApiJson(response, "Run Project Action")).invocation;
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
function projectActionPath(projectId, suffix, teamId) {
|
|
242
|
+
return `/v1/project-actions/${encodeURIComponent(projectId)}/${suffix}?teamId=${encodeURIComponent(teamId)}`;
|
|
243
|
+
}
|
|
244
|
+
export {
|
|
245
|
+
OpenPondProjectActionsClient
|
|
246
|
+
};
|
|
247
|
+
//# sourceMappingURL=project-actions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/project-actions.ts", "../../cloud/src/api/vercel-protection.ts", "../../cloud/src/api/core.ts"],
|
|
4
|
+
"sourcesContent": ["import { promises as fs } from \"node:fs\";\n\nimport { apiFetch, readApiJson } from \"@openpond/cloud/api/core\";\n\nimport type { ProjectActionBuildResult, ProjectActionRegistry } from \"../../actions/src/types.js\";\n\nexport type ProjectActionRelease = {\n id: string;\n projectId: string;\n sourceCommitSha: string;\n bundleHash: string;\n registryHash: string;\n status: string;\n createdAt: string;\n};\n\nexport type HostedProjectActionCatalog = {\n releaseId: string;\n sourceCommitSha: string;\n bundleHash: string;\n registryHash: string;\n registry: ProjectActionRegistry;\n};\n\nexport type ProjectActionInvocation<TOutput = Record<string, unknown>> = {\n id: string;\n releaseId: string;\n projectId: string;\n actionId: string;\n status: \"running\" | \"succeeded\" | \"failed\";\n resultJson: TOutput;\n traceJson: Record<string, unknown>[];\n outputJson: Record<string, unknown>[];\n failureCode?: string | null;\n failureMessage?: string | null;\n};\n\ntype ProjectActionClientInput = {\n apiKey: string;\n apiBaseUrl: string;\n};\n\nexport class OpenPondProjectActionsClient {\n readonly #apiKey: string;\n readonly #apiBaseUrl: string;\n\n constructor(input: ProjectActionClientInput) {\n this.#apiKey = input.apiKey;\n this.#apiBaseUrl = input.apiBaseUrl.replace(/\\/+$/, \"\");\n }\n\n async list(input: { projectId: string; teamId: string }): Promise<ProjectActionRelease[]> {\n const response = await apiFetch(\n this.#apiBaseUrl,\n this.#apiKey,\n projectActionPath(input.projectId, \"releases\", input.teamId),\n );\n return (await readApiJson<{ releases: ProjectActionRelease[] }>(response, \"List Project Action releases\")).releases;\n }\n\n async catalog(input: { projectId: string; teamId: string }): Promise<HostedProjectActionCatalog> {\n const response = await apiFetch(\n this.#apiBaseUrl,\n this.#apiKey,\n projectActionPath(input.projectId, \"catalog\", input.teamId),\n );\n return (await readApiJson<{ catalog: HostedProjectActionCatalog }>(response, \"Get Project Action catalog\")).catalog;\n }\n\n async publish(input: {\n projectId: string;\n teamId: string;\n sourceRef: string;\n sourceCommitSha: string;\n build: ProjectActionBuildResult;\n metadata?: Record<string, unknown>;\n }): Promise<ProjectActionRelease> {\n const [bundle, runner] = await Promise.all([\n fs.readFile(input.build.bundlePath),\n fs.readFile(input.build.runnerPath),\n ]);\n const response = await apiFetch(\n this.#apiBaseUrl,\n this.#apiKey,\n projectActionPath(input.projectId, \"releases\", input.teamId),\n {\n method: \"POST\",\n body: JSON.stringify({\n sourceRef: input.sourceRef,\n sourceCommitSha: input.sourceCommitSha,\n bundleBase64: bundle.toString(\"base64\"),\n runnerBase64: runner.toString(\"base64\"),\n registry: input.build.registry,\n manifest: input.build.manifest,\n metadata: input.metadata,\n }),\n },\n );\n return (await readApiJson<{ release: ProjectActionRelease }>(response, \"Publish Project Actions\")).release;\n }\n\n async run<TOutput = Record<string, unknown>>(input: {\n projectId: string;\n teamId: string;\n actionId: string;\n value?: Record<string, unknown>;\n releaseId?: string;\n idempotencyKey?: string;\n callerType?: \"sdk\" | \"work\" | \"scheduled_work\" | \"website\" | \"internal\";\n callerId?: string;\n signal?: AbortSignal;\n }): Promise<ProjectActionInvocation<TOutput>> {\n const response = await apiFetch(\n this.#apiBaseUrl,\n this.#apiKey,\n projectActionPath(input.projectId, `actions/${encodeURIComponent(input.actionId)}`, input.teamId),\n {\n method: \"POST\",\n body: JSON.stringify({\n input: input.value ?? {},\n releaseId: input.releaseId,\n idempotencyKey: input.idempotencyKey,\n callerType: input.callerType ?? \"sdk\",\n callerId: input.callerId,\n }),\n signal: input.signal,\n timeoutMs: 15 * 60 * 1000,\n },\n );\n return (await readApiJson<{ invocation: ProjectActionInvocation<TOutput> }>(response, \"Run Project Action\")).invocation;\n }\n}\n\nfunction projectActionPath(projectId: string, suffix: string, teamId: string): string {\n return `/v1/project-actions/${encodeURIComponent(projectId)}/${suffix}?teamId=${encodeURIComponent(teamId)}`;\n}\n", "const VERCEL_PROTECTION_BYPASS_HEADER = \"x-vercel-protection-bypass\";\n\nexport function withVercelProtectionBypass(\n requestUrl: string,\n inputHeaders?: HeadersInit,\n env: Record<string, string | undefined> =\n typeof process === \"undefined\" ? {} : process.env,\n): Headers {\n const headers = new Headers(inputHeaders);\n const secret = env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();\n if (!secret || !isOpenPondStagingUrl(requestUrl)) return headers;\n headers.set(VERCEL_PROTECTION_BYPASS_HEADER, secret);\n return headers;\n}\n\nfunction isOpenPondStagingUrl(requestUrl: string): boolean {\n try {\n const hostname = new URL(requestUrl).hostname.toLowerCase();\n return (\n hostname === \"staging.openpond.ai\" ||\n hostname === \"staging-api.openpond.ai\" ||\n hostname.endsWith(\".staging-api.openpond.ai\")\n );\n } catch {\n return false;\n }\n}\n", "import { withVercelProtectionBypass } from \"./vercel-protection.js\";\n\nconst DEFAULT_API_TIMEOUT_MS = 30_000;\nconst DEFAULT_API_RESPONSE_BYTES = 8 * 1024 * 1024;\nexport const LONG_STREAM_API_OPTIONS = { timeoutMs: 15 * 60 * 1000, maxResponseBytes: 64 * 1024 * 1024 } as const;\n\nexport type ApiFetchOptions = RequestInit & {\n timeoutMs?: number;\n maxResponseBytes?: number;\n};\n\nexport class ApiTimeoutError extends Error {\n readonly code = \"OPENPOND_API_TIMEOUT\";\n\n constructor(readonly timeoutMs: number, readonly requestUrl: string) {\n super(`API request timed out after ${timeoutMs}ms: ${requestUrl}`);\n this.name = \"ApiTimeoutError\";\n }\n}\n\nexport class ApiResponseTooLargeError extends Error {\n readonly code = \"OPENPOND_API_RESPONSE_TOO_LARGE\";\n\n constructor(readonly maximumBytes: number, readonly requestUrl: string) {\n super(`API response exceeded ${maximumBytes} bytes: ${requestUrl}`);\n this.name = \"ApiResponseTooLargeError\";\n }\n}\n\nexport class OpenPondApiError extends Error {\n readonly code: string;\n\n constructor(\n readonly status: number,\n errorCode: string | null,\n label: string,\n readonly apiMessage: string | null = null,\n ) {\n const detail = apiMessage || errorCode;\n super(`${label} failed: ${status}${detail ? ` ${detail}` : \"\"}`);\n this.name = \"OpenPondApiError\";\n this.code = errorCode || \"OPENPOND_API_ERROR\";\n }\n}\n\nexport async function apiFetch(\n baseUrl: string,\n token: string | null,\n requestPath: string,\n options: ApiFetchOptions = {},\n): Promise<Response> {\n const { timeoutMs = DEFAULT_API_TIMEOUT_MS, maxResponseBytes = DEFAULT_API_RESPONSE_BYTES, ...init } = options;\n const requestUrl = `${baseUrl}${requestPath}`;\n const headers = withVercelProtectionBypass(requestUrl, init.headers);\n headers.set(\"Content-Type\", \"application/json\");\n const apiKey = process.env.OPENPOND_API_KEY;\n const trimmedToken = token?.trim() || \"\";\n const tokenIsApiKey = trimmedToken.startsWith(\"opk_\");\n const effectiveApiKey = apiKey || (tokenIsApiKey ? trimmedToken : null);\n if (effectiveApiKey && !headers.has(\"openpond-api-key\")) headers.set(\"openpond-api-key\", effectiveApiKey);\n if (token) {\n headers.set(\"Authorization\", tokenIsApiKey ? `ApiKey ${trimmedToken}` : `Bearer ${token}`);\n } else if (apiKey && !headers.has(\"Authorization\")) {\n headers.set(\"Authorization\", `ApiKey ${apiKey}`);\n }\n\n const timeoutController = new AbortController();\n const timeoutError = new ApiTimeoutError(timeoutMs, requestUrl);\n const timer = timeoutMs > 0\n ? setTimeout(() => timeoutController.abort(timeoutError), timeoutMs)\n : null;\n timer?.unref?.();\n const signal = composedSignal(init.signal, timeoutController.signal, timeoutMs);\n const cleanup = () => {\n if (timer) clearTimeout(timer);\n };\n\n try {\n const response = await fetch(requestUrl, { ...init, headers, signal });\n return boundedResponse(response, {\n cleanup,\n maximumBytes: maxResponseBytes,\n requestUrl,\n timeoutController,\n timeoutError,\n });\n } catch (error) {\n cleanup();\n if (timeoutController.signal.aborted) throw timeoutError;\n throw error;\n }\n}\n\nexport async function readApiJson<T>(response: Response, label: string): Promise<T> {\n let payload: T & { error?: unknown; message?: unknown };\n try {\n const text = await response.text();\n payload = (text ? JSON.parse(text) : {}) as T & { error?: unknown; message?: unknown };\n } catch (error) {\n if (error instanceof ApiTimeoutError || error instanceof ApiResponseTooLargeError) throw error;\n payload = {} as T & { error?: unknown; message?: unknown };\n }\n if (!response.ok) {\n const errorCode = typeof payload.error === \"string\" ? payload.error : null;\n const apiMessage =\n typeof payload.message === \"string\" ? payload.message : null;\n throw new OpenPondApiError(response.status, errorCode, label, apiMessage);\n }\n return payload as T;\n}\n\nfunction boundedResponse(\n response: Response,\n input: {\n cleanup: () => void;\n maximumBytes: number;\n requestUrl: string;\n timeoutController: AbortController;\n timeoutError: ApiTimeoutError;\n },\n): Response {\n if (!response.body) {\n input.cleanup();\n return response;\n }\n const contentLength = Number(response.headers.get(\"content-length\"));\n if (input.maximumBytes > 0 && Number.isFinite(contentLength) && contentLength > input.maximumBytes) {\n input.cleanup();\n void response.body.cancel();\n throw new ApiResponseTooLargeError(input.maximumBytes, input.requestUrl);\n }\n\n const reader = response.body.getReader();\n let receivedBytes = 0;\n const body = new ReadableStream<Uint8Array>({\n async pull(controller) {\n try {\n const result = await reader.read();\n if (result.done) {\n input.cleanup();\n controller.close();\n return;\n }\n receivedBytes += result.value.byteLength;\n if (input.maximumBytes > 0 && receivedBytes > input.maximumBytes) {\n input.cleanup();\n await reader.cancel();\n controller.error(new ApiResponseTooLargeError(input.maximumBytes, input.requestUrl));\n return;\n }\n controller.enqueue(result.value);\n } catch (error) {\n input.cleanup();\n controller.error(input.timeoutController.signal.aborted ? input.timeoutError : error);\n }\n },\n async cancel(reason) {\n input.cleanup();\n await reader.cancel(reason);\n },\n });\n return new Response(body, {\n headers: response.headers,\n status: response.status,\n statusText: response.statusText,\n });\n}\n\nfunction composedSignal(\n callerSignal: AbortSignal | null | undefined,\n timeoutSignal: AbortSignal,\n timeoutMs: number,\n): AbortSignal | undefined {\n if (timeoutMs <= 0) return callerSignal ?? undefined;\n return callerS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C5G;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ProjectActionBuildResult, ProjectActionDefinition } from "./types.js";
|
|
2
|
+
export declare const DEFAULT_PROJECT_ACTION_OUTPUT_DIRECTORY = ".openpond/actions";
|
|
3
|
+
export declare function buildProjectActions(input: {
|
|
4
|
+
projectRoot: string;
|
|
5
|
+
sourceDirectory?: string;
|
|
6
|
+
outputDirectory?: string;
|
|
7
|
+
}): Promise<ProjectActionBuildResult>;
|
|
8
|
+
export declare function loadBuiltProjectActions(bundlePath: string): Promise<ProjectActionDefinition[]>;
|
|
9
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/build.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,uCAAuC,sBAAsB,CAAC;AAE3E,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAmFpC;AAeD,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAQpC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProjectActionDefinition, ProjectActionRegistry } from "./types.js";
|
|
2
|
+
export declare function collectProjectActions(modules: unknown[]): ProjectActionDefinition[];
|
|
3
|
+
export declare function createProjectActionRegistry(actions: readonly ProjectActionDefinition[]): ProjectActionRegistry;
|
|
4
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/catalog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,uBAAuB,EAAE,CAuBnF;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,SAAS,uBAAuB,EAAE,GAC1C,qBAAqB,CAKvB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PROJECT_ACTION_CONFIG_PATH = "openpond/project-actions.json";
|
|
3
|
+
declare const configSchema: z.ZodObject<{
|
|
4
|
+
sourceDirectory: z.ZodOptional<z.ZodString>;
|
|
5
|
+
outputDirectory: z.ZodOptional<z.ZodString>;
|
|
6
|
+
environment: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
7
|
+
connections: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8
|
+
values: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
9
|
+
environment: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
10
|
+
}, z.core.$strict>>>>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type ProjectActionConfiguration = z.infer<typeof configSchema>;
|
|
13
|
+
export type ResolvedProjectActionRuntime = {
|
|
14
|
+
environment: Record<string, string>;
|
|
15
|
+
connections: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
export declare function loadProjectActionConfiguration(projectRoot: string): Promise<ProjectActionConfiguration>;
|
|
18
|
+
export declare function resolveProjectActionRuntime(config: ProjectActionConfiguration, hostEnvironment?: NodeJS.ProcessEnv): ResolvedProjectActionRuntime;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/configuration.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0BAA0B,kCAAkC,CAAC;AAO1E,QAAA,MAAM,YAAY;;;;;;;;kBAKP,CAAC;AAEZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtE,MAAM,MAAM,4BAA4B,GAAG;IACzC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,wBAAsB,8BAA8B,CAClD,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,0BAA0B,CAAC,CAgBrC;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,0BAA0B,EAClC,eAAe,GAAE,MAAM,CAAC,UAAwB,GAC/C,4BAA4B,CAgB9B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DefineProjectActionOptions, ProjectActionDefinition } from "./types.js";
|
|
2
|
+
export declare function defineAction<TInput, TOutput>(id: string, options: DefineProjectActionOptions<TInput, TOutput>): ProjectActionDefinition<TInput, TOutput>;
|
|
3
|
+
export declare function isProjectActionDefinition(value: unknown): value is ProjectActionDefinition;
|
|
4
|
+
//# sourceMappingURL=define-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-action.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/define-action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAKpB,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,EAC1C,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAC,GACnD,uBAAuB,CAAC,MAAM,EAAE,OAAO,CAAC,CAmE1C;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,uBAAuB,CAQ1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/discovery.ts"],"names":[],"mappings":"AAMA,wBAAsB,0BAA0B,CAAC,KAAK,EAAE;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAmBxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/hash.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAEzD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { defineAction, isProjectActionDefinition } from "./define-action.js";
|
|
2
|
+
export { PROJECT_ACTION_CONFIG_PATH } from "./configuration.js";
|
|
3
|
+
export type { DefineProjectActionOptions, ProjectActionApprovalMode, ProjectActionApprovalPolicy, ProjectActionBehavior, ProjectActionContext, ProjectActionDefinition, ProjectActionOutput, ProjectActionSchema, ProjectActionSetupRequirement, ProjectActionTraceEvent, } from "./types.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LocalProjectActionRunner, ProjectActionRunnerOptions } from "./types.js";
|
|
2
|
+
export declare function createLocalActionRunner(options: ProjectActionRunnerOptions): LocalProjectActionRunner;
|
|
3
|
+
export { buildProjectActions } from "./build.js";
|
|
4
|
+
export { loadProjectActionConfiguration, PROJECT_ACTION_CONFIG_PATH, resolveProjectActionRuntime, } from "./configuration.js";
|
|
5
|
+
export type { LocalProjectActionRunner, ProjectActionBuildManifest, ProjectActionBuildResult, ProjectActionCatalogEntry, ProjectActionRegistry, ProjectActionRunRequest, ProjectActionRunResult, ProjectActionRunnerOptions, } from "./types.js";
|
|
6
|
+
//# sourceMappingURL=local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/local.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,wBAAwB,EAKxB,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAKpB,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,0BAA0B,GAClC,wBAAwB,CAmH1B;AA6JD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProjectActionSchema } from "./types.js";
|
|
2
|
+
export declare function projectActionJsonSchema(schema: ProjectActionSchema): Record<string, unknown>;
|
|
3
|
+
export declare function parseProjectActionValue(schema: ProjectActionSchema, value: unknown): unknown;
|
|
4
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE5F;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAE5F"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProjectActionRunRequest, ProjectActionSetupRequirement } from "./types.js";
|
|
2
|
+
export declare function validateProjectActionStaticSetup(projectRoot: string, requirements: readonly ProjectActionSetupRequirement[]): Promise<void>;
|
|
3
|
+
export declare function validateProjectActionRunSetup(projectRoot: string, requirements: readonly ProjectActionSetupRequirement[], request: ProjectActionRunRequest): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/setup.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AAEpB,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,SAAS,6BAA6B,EAAE,GACrD,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,6BAA6B,CACjD,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,SAAS,6BAA6B,EAAE,EACtD,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
export type ProjectActionApprovalMode = "never" | "always" | "writes" | "sensitive";
|
|
3
|
+
export type ProjectActionBehavior = "read" | "write";
|
|
4
|
+
export type ProjectActionApprovalPolicy = {
|
|
5
|
+
mode: ProjectActionApprovalMode;
|
|
6
|
+
reason?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
risk?: ProjectActionBehavior;
|
|
9
|
+
};
|
|
10
|
+
export type ProjectActionSetupRequirement = {
|
|
11
|
+
kind: "connection" | "env" | "package" | "native_tool";
|
|
12
|
+
name: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
description?: string;
|
|
15
|
+
};
|
|
16
|
+
export type ProjectActionSchema = z.ZodType<unknown>;
|
|
17
|
+
export type ProjectActionTraceEvent = {
|
|
18
|
+
name: string;
|
|
19
|
+
payload?: Record<string, unknown>;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
};
|
|
22
|
+
export type ProjectActionOutput = {
|
|
23
|
+
path: string;
|
|
24
|
+
mimeType?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
};
|
|
27
|
+
export interface ProjectActionContext {
|
|
28
|
+
readonly runId: string;
|
|
29
|
+
readonly actionId: string;
|
|
30
|
+
readonly idempotencyKey: string | null;
|
|
31
|
+
readonly projectRoot: string;
|
|
32
|
+
readonly outputDirectory: string;
|
|
33
|
+
readonly signal: AbortSignal;
|
|
34
|
+
env(name: string): string | undefined;
|
|
35
|
+
connection<T = unknown>(name: string): T;
|
|
36
|
+
trace(name: string, payload?: Record<string, unknown>): void;
|
|
37
|
+
output(output: ProjectActionOutput): void;
|
|
38
|
+
}
|
|
39
|
+
export type ProjectActionDefinition<TInput = unknown, TOutput = unknown> = {
|
|
40
|
+
readonly kind: "openpond-project-action";
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly label: string;
|
|
43
|
+
readonly description: string;
|
|
44
|
+
readonly behavior: ProjectActionBehavior;
|
|
45
|
+
readonly inputSchema: ProjectActionSchema;
|
|
46
|
+
readonly outputSchema: ProjectActionSchema;
|
|
47
|
+
readonly approval: ProjectActionApprovalPolicy;
|
|
48
|
+
readonly setup: readonly ProjectActionSetupRequirement[];
|
|
49
|
+
readonly invokesModel: boolean;
|
|
50
|
+
readonly timeoutMs: number;
|
|
51
|
+
readonly concurrency: number | null;
|
|
52
|
+
readonly run: (context: ProjectActionContext, input: TInput) => Promise<TOutput> | TOutput;
|
|
53
|
+
};
|
|
54
|
+
export type DefineProjectActionOptions<TInput, TOutput> = {
|
|
55
|
+
label?: string;
|
|
56
|
+
description: string;
|
|
57
|
+
behavior?: ProjectActionBehavior;
|
|
58
|
+
input: z.ZodType<TInput>;
|
|
59
|
+
output: z.ZodType<TOutput>;
|
|
60
|
+
approval?: ProjectActionApprovalPolicy;
|
|
61
|
+
setup?: readonly ProjectActionSetupRequirement[];
|
|
62
|
+
invokesModel?: boolean;
|
|
63
|
+
timeoutMs?: number;
|
|
64
|
+
concurrency?: number | null;
|
|
65
|
+
run: (context: ProjectActionContext, input: TInput) => Promise<TOutput> | TOutput;
|
|
66
|
+
};
|
|
67
|
+
export type ProjectActionCatalogEntry = {
|
|
68
|
+
id: string;
|
|
69
|
+
sourceActionId: string;
|
|
70
|
+
name: string;
|
|
71
|
+
label: string;
|
|
72
|
+
description: string;
|
|
73
|
+
visibility: "default";
|
|
74
|
+
inputSchema: Record<string, unknown>;
|
|
75
|
+
outputSchema: Record<string, unknown>;
|
|
76
|
+
approvalPolicy: ProjectActionApprovalPolicy;
|
|
77
|
+
artifactPolicy: {
|
|
78
|
+
outputArtifacts: string[];
|
|
79
|
+
persistRunSummary: boolean;
|
|
80
|
+
persistTrace: boolean;
|
|
81
|
+
};
|
|
82
|
+
setupRequirements: ProjectActionSetupRequirement[];
|
|
83
|
+
mcp: {
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
};
|
|
86
|
+
schedulePolicy: {
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
allowAdHoc: boolean;
|
|
89
|
+
};
|
|
90
|
+
trace: {
|
|
91
|
+
name: string;
|
|
92
|
+
namespace: "project-actions";
|
|
93
|
+
};
|
|
94
|
+
implementation: {
|
|
95
|
+
type: "openpond-project-action";
|
|
96
|
+
actionId: string;
|
|
97
|
+
behavior: ProjectActionBehavior;
|
|
98
|
+
timeoutMs: number;
|
|
99
|
+
concurrency: number | null;
|
|
100
|
+
};
|
|
101
|
+
invokesModel: boolean;
|
|
102
|
+
};
|
|
103
|
+
export type ProjectActionRegistry = {
|
|
104
|
+
schemaVersion: "openpond.projectActionRegistry.v1";
|
|
105
|
+
actions: ProjectActionCatalogEntry[];
|
|
106
|
+
};
|
|
107
|
+
export type ProjectActionBuildManifest = {
|
|
108
|
+
schemaVersion: "openpond.projectActionBuild.v1";
|
|
109
|
+
sourceDirectory: string;
|
|
110
|
+
sourceFiles: string[];
|
|
111
|
+
bundleFile: string;
|
|
112
|
+
runnerFile: string;
|
|
113
|
+
registryFile: string;
|
|
114
|
+
bundleHash: string;
|
|
115
|
+
registryHash: string;
|
|
116
|
+
};
|
|
117
|
+
export type ProjectActionBuildResult = {
|
|
118
|
+
projectRoot: string;
|
|
119
|
+
outputDirectory: string;
|
|
120
|
+
bundlePath: string;
|
|
121
|
+
runnerPath: string;
|
|
122
|
+
registryPath: string;
|
|
123
|
+
manifestPath: string;
|
|
124
|
+
registry: ProjectActionRegistry;
|
|
125
|
+
manifest: ProjectActionBuildManifest;
|
|
126
|
+
};
|
|
127
|
+
export type ProjectActionRunRequest = {
|
|
128
|
+
actionId: string;
|
|
129
|
+
input?: unknown;
|
|
130
|
+
runId?: string;
|
|
131
|
+
idempotencyKey?: string | null;
|
|
132
|
+
timeoutMs?: number;
|
|
133
|
+
signal?: AbortSignal;
|
|
134
|
+
environment?: Record<string, string>;
|
|
135
|
+
connections?: Record<string, unknown>;
|
|
136
|
+
outputDirectory?: string;
|
|
137
|
+
};
|
|
138
|
+
export type ProjectActionRunResult<TOutput = unknown> = {
|
|
139
|
+
runId: string;
|
|
140
|
+
actionId: string;
|
|
141
|
+
status: "succeeded";
|
|
142
|
+
output: TOutput;
|
|
143
|
+
stdout: string;
|
|
144
|
+
stderr: string;
|
|
145
|
+
traces: ProjectActionTraceEvent[];
|
|
146
|
+
outputs: ProjectActionOutput[];
|
|
147
|
+
outputDirectory: string;
|
|
148
|
+
durationMs: number;
|
|
149
|
+
};
|
|
150
|
+
export type ProjectActionRunnerOptions = {
|
|
151
|
+
projectRoot: string;
|
|
152
|
+
sourceDirectory?: string;
|
|
153
|
+
outputDirectory?: string;
|
|
154
|
+
build?: "always" | "if-missing" | "never";
|
|
155
|
+
};
|
|
156
|
+
export interface LocalProjectActionRunner {
|
|
157
|
+
catalog(): Promise<ProjectActionRegistry>;
|
|
158
|
+
build(): Promise<ProjectActionBuildResult>;
|
|
159
|
+
run<TOutput = unknown>(request: ProjectActionRunRequest): Promise<ProjectActionRunResult<TOutput>>;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../actions/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AACpF,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,CAAC;AAErD,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,yBAAyB,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,C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IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,uBAAuB,EAAE,CAAC;IAClC,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC;CAC3C,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,OAAO,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC1C,KAAK,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC3C,GAAG,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC;CACpG"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { buildProjectActions, createLocalActionRunner, loadProjectActionConfiguration, PROJECT_ACTION_CONFIG_PATH, resolveProjectActionRuntime, } from "../../actions/src/local.js";
|
|
2
|
+
export type { LocalProjectActionRunner, ProjectActionBuildManifest, ProjectActionBuildResult, ProjectActionCatalogEntry, ProjectActionRegistry, ProjectActionRunRequest, ProjectActionRunResult, ProjectActionRunnerOptions, } from "../../actions/src/local.js";
|
|
3
|
+
//# sourceMappingURL=actions-local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-local.d.ts","sourceRoot":"","sources":["../../../../../src/actions-local.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { defineAction, isProjectActionDefinition } from "../../actions/src/index.js";
|
|
2
|
+
export type { DefineProjectActionOptions, ProjectActionApprovalMode, ProjectActionApprovalPolicy, ProjectActionBehavior, ProjectActionContext, ProjectActionDefinition, ProjectActionOutput, ProjectActionSchema, ProjectActionSetupRequirement, ProjectActionTraceEvent, } from "../../actions/src/index.js";
|
|
3
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACrF,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { type OpenPondSandboxClient } from "
|
|
1
|
+
import { type OpenPondSandboxClient } from "@openpond/cloud/sandbox/client";
|
|
2
2
|
import { OpenPondWorkClient } from "./work.js";
|
|
3
|
+
import { OpenPondProjectActionsClient } from "./project-actions.js";
|
|
3
4
|
import type { OpenPondClientOptions } from "./types.js";
|
|
4
5
|
export declare class OpenPondClient {
|
|
5
6
|
readonly sandboxes: OpenPondSandboxClient;
|
|
6
7
|
readonly work: OpenPondWorkClient;
|
|
8
|
+
readonly actions: OpenPondProjectActionsClient;
|
|
7
9
|
constructor(options: OpenPondClientOptions);
|
|
8
10
|
}
|
|
9
11
|
export declare function createOpenPondClient(options: OpenPondClientOptions): OpenPondClient;
|
|
10
12
|
export type { OpenPondClientOptions } from "./types.js";
|
|
11
13
|
export { OpenPondWorkClient } from "./work.js";
|
|
12
|
-
export {
|
|
14
|
+
export { OpenPondProjectActionsClient } from "./project-actions.js";
|
|
15
|
+
export type { HostedProjectActionCatalog, ProjectActionInvocation, ProjectActionRelease, } from "./project-actions.js";
|
|
16
|
+
export { OpenPondApiError } from "@openpond/cloud/api/core";
|
|
13
17
|
export type { OpenPondWorkEvent, OpenPondWorkCleanup, OpenPondWorkHistoryMessage, OpenPondWorkInputFile, OpenPondWorkLifecycle, OpenPondWorkOutput, OpenPondWorkOutputPersistenceContext, OpenPondWorkRunInput, OpenPondWorkRunResult, } from "./work.js";
|
|
14
|
-
export * from "
|
|
15
|
-
export * from "
|
|
16
|
-
export { getOpChatModel, getOpChatProvider, listOpChatModels, listOpChatProviders, resolveOpChatApiBaseUrl, sendHostedChatTurn, streamHostedChatTurn, } from "
|
|
17
|
-
export type { HostedChatCompletion, HostedChatMessage, HostedChatStreamDelta, HostedChatTool, HostedChatToolCall, HostedChatUsage, HostedModel, HostedModelsResponse, HostedProvider, HostedProvidersResponse, } from "
|
|
18
|
+
export * from "@openpond/cloud/sandbox/client";
|
|
19
|
+
export * from "@openpond/cloud/sandbox/types";
|
|
20
|
+
export { getOpChatModel, getOpChatProvider, listOpChatModels, listOpChatProviders, resolveOpChatApiBaseUrl, sendHostedChatTurn, streamHostedChatTurn, } from "@openpond/cloud/hosted-chat";
|
|
21
|
+
export type { HostedChatCompletion, HostedChatMessage, HostedChatStreamDelta, HostedChatTool, HostedChatToolCall, HostedChatUsage, HostedModel, HostedModelsResponse, HostedProvider, HostedProvidersResponse, } from "@openpond/cloud/hosted-chat";
|
|
18
22
|
//# sourceMappingURL=index.d.ts.map
|