openpond-sdk 0.0.10 → 0.0.11
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/index.js +31 -0
- package/dist/index.js.map +2 -2
- package/dist/profile-actions.js +31 -0
- package/dist/profile-actions.js.map +2 -2
- package/dist/types/packages/sdk/src/index.d.ts +1 -1
- package/dist/types/packages/sdk/src/index.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/profile-actions.d.ts +30 -0
- package/dist/types/packages/sdk/src/profile-actions.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/profile-actions.js
CHANGED
|
@@ -191,6 +191,37 @@ var OpenPondProfileActionsClient = class {
|
|
|
191
191
|
"Get Profile Action catalog"
|
|
192
192
|
)).catalog;
|
|
193
193
|
}
|
|
194
|
+
async run(input) {
|
|
195
|
+
const teamId = requiredValue(input.teamId, "teamId");
|
|
196
|
+
const actionKey = requiredValue(input.actionKey, "actionKey");
|
|
197
|
+
const idempotencyKey = requiredValue(input.idempotencyKey, "idempotencyKey");
|
|
198
|
+
const catalogVersion = requiredValue(input.catalogVersion, "catalogVersion");
|
|
199
|
+
const response = await apiFetch(
|
|
200
|
+
this.#apiBaseUrl,
|
|
201
|
+
this.#apiKey,
|
|
202
|
+
`/v1/profile/actions/run?${new URLSearchParams({ teamId }).toString()}`,
|
|
203
|
+
{
|
|
204
|
+
method: "POST",
|
|
205
|
+
headers: { "Content-Type": "application/json" },
|
|
206
|
+
body: JSON.stringify({
|
|
207
|
+
...input.profileId?.trim() ? { profileId: input.profileId.trim() } : {},
|
|
208
|
+
...input.profileName?.trim() ? { profileName: input.profileName.trim() } : {},
|
|
209
|
+
actionKey,
|
|
210
|
+
value: input.value ?? {},
|
|
211
|
+
conversationId: input.conversationId ?? null,
|
|
212
|
+
createConversation: input.createConversation,
|
|
213
|
+
conversationTitle: input.conversationTitle ?? null,
|
|
214
|
+
idempotencyKey,
|
|
215
|
+
catalogVersion,
|
|
216
|
+
externalCapabilityLeases: input.externalCapabilityLeases
|
|
217
|
+
})
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
return readApiJson(
|
|
221
|
+
response,
|
|
222
|
+
"Run Profile Action"
|
|
223
|
+
);
|
|
224
|
+
}
|
|
194
225
|
};
|
|
195
226
|
function requiredValue(value, name) {
|
|
196
227
|
const normalized = value.trim();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../cloud/src/api/vercel-protection.ts", "../../cloud/src/api/core.ts", "../src/profile-actions.ts"],
|
|
4
|
-
"sourcesContent": ["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 callerSignal ? AbortSignal.any([callerSignal, timeoutSignal]) : timeoutSignal;\n}\n", "import { apiFetch, readApiJson } from \"@openpond/cloud/api/core\";\n\nexport type OpenPondProfileActionSetupRequirement = {\n kind: string;\n key: string;\n label: string | null;\n required: boolean;\n status: string;\n warning: string | null;\n};\n\nexport type OpenPondProfileActionCatalogEntry = {\n /** Stable action key. This is the only action selector accepted by follow-up invocation APIs. */\n key: string;\n agentId: string;\n agentName: string;\n agentSlug: string;\n actionId: string;\n actionLabel: string;\n description: string;\n inputSchema: Record<string, unknown>;\n invokesModel: boolean;\n approvalPolicy: {\n required: boolean;\n risk: \"read\" | \"write\" | \"destructive\";\n };\n setupStatus: \"ready\" | \"setup_required\";\n setupRequirements: OpenPondProfileActionSetupRequirement[];\n requiredCapabilities: string[];\n};\n\nexport type OpenPondProfileActionCatalog = {\n profileId: string;\n profileName: string;\n /** Opaque source/action contract version used to reject catalog drift at invocation time. */\n catalogVersion: string;\n sourceCommitSha: string | null;\n actions: OpenPondProfileActionCatalogEntry[];\n};\n\ntype ProfileActionsClientInput = {\n apiKey: string;\n apiBaseUrl: string;\n};\n\nexport class OpenPondProfileActionsClient {\n readonly #apiKey: string;\n readonly #apiBaseUrl: string;\n\n constructor(input: ProfileActionsClientInput) {\n this.#apiKey = input.apiKey;\n this.#apiBaseUrl = input.apiBaseUrl.replace(/\\/+$/, \"\");\n }\n\n async catalog(input: {\n teamId: string;\n profileId?: string;\n profileName?: string;\n }): Promise<OpenPondProfileActionCatalog> {\n const teamId = requiredValue(input.teamId, \"teamId\");\n const search = new URLSearchParams({ teamId });\n if (input.profileId?.trim()) search.set(\"profileId\", input.profileId.trim());\n if (input.profileName?.trim()) {\n search.set(\"profileName\", input.profileName.trim());\n }\n const response = await apiFetch(\n this.#apiBaseUrl,\n this.#apiKey,\n `/v1/profile/actions?${search.toString()}`,\n );\n return (\n await readApiJson<{ catalog: OpenPondProfileActionCatalog }>(\n response,\n \"Get Profile Action catalog\",\n )\n ).catalog;\n }\n}\n\nfunction requiredValue(value: string, name: string): string {\n const normalized = value.trim();\n if (!normalized) throw new Error(`${name} is required`);\n return normalized;\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,IAAM,kCAAkC;AAElC,SAAU,2BACd,YACA,cACA,MACE,OAAO,YAAY,cAAc,CAAA,IAAK,QAAQ,KAAG;AAEnD,QAAM,UAAU,IAAI,QAAQ,YAAY;AACxC,QAAM,SAAS,IAAI,iCAAiC,KAAI;AACxD,MAAI,CAAC,UAAU,CAAC,qBAAqB,UAAU;AAAG,WAAO;AACzD,UAAQ,IAAI,iCAAiC,MAAM;AACnD,SAAO;AACT;AAEA,SAAS,qBAAqB,YAAkB;AAC9C,MAAI;AACF,UAAM,WAAW,IAAI,IAAI,UAAU,EAAE,SAAS,YAAW;AACzD,WACE,aAAa,yBACb,aAAa,6BACb,SAAS,SAAS,0BAA0B;EAEhD,QAAQ;AACN,WAAO;EACT;AACF;;;ACxBA,IAAM,yBAAyB;AAC/B,IAAM,6BAA6B,IAAI,OAAO;AACvC,IAAM,0BAA0B,EAAE,WAAW,KAAK,KAAK,KAAM,kBAAkB,KAAK,OAAO,KAAI;AAOhG,IAAO,kBAAP,cAA+B,MAAK;EAGnB;EAA4B;EAFxC,OAAO;EAEhB,YAAqB,WAA4B,YAAkB;AACjE,UAAM,+BAA+B,SAAS,OAAO,UAAU,EAAE;AAD9C,SAAA,YAAA;AAA4B,SAAA,aAAA;AAE/C,SAAK,OAAO;EACd;;AAGI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,QAAM,SAAS,SAAS,KAAK,UAAS;AACtC,MAAI,gBAAgB;AACpB,QAAM,OAAO,IAAI,eAA2B;IAC1C,MAAM,KAAK,YAAU;AACnB,UAAI;AACF,cAAM,SAAS,MAAM,OAAO,KAAI;AAChC,YAAI,OAAO,MAAM;AACf,gBAAM,QAAO;AACb,qBAAW,MAAK;AAChB;QACF;AACA,yBAAiB,OAAO,MAAM;AAC9B,YAAI,MAAM,eAAe,KAAK,gBAAgB,MAAM,cAAc;AAChE,gBAAM,QAAO;AACb,gBAAM,OAAO,OAAM;AACnB,qBAAW,MAAM,IAAI,yBAAyB,MAAM,cAAc,MAAM,UAAU,CAAC;AACnF;QACF;AACA,mBAAW,QAAQ,OAAO,KAAK;MACjC,SAAS,OAAO;AACd,cAAM,QAAO;AACb,mBAAW,MAAM,MAAM,kBAAkB,OAAO,UAAU,MAAM,eAAe,KAAK;MACtF;IACF;IACA,MAAM,OAAO,QAAM;AACjB,YAAM,QAAO;AACb,YAAM,OAAO,OAAO,MAAM;IAC5B;GACD;AACD,SAAO,IAAI,SAAS,MAAM;IACxB,SAAS,SAAS;IAClB,QAAQ,SAAS;IACjB,YAAY,SAAS;GACtB;AACH;AAEA,SAAS,eACP,cACA,eACA,WAAiB;AAEjB,MAAI,aAAa;AAAG,WAAO,gBAAgB;AAC3C,SAAO,eAAe,YAAY,IAAI,CAAC,cAAc,aAAa,CAAC,IAAI;AACzE;;;
|
|
4
|
+
"sourcesContent": ["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 callerSignal ? AbortSignal.any([callerSignal, timeoutSignal]) : timeoutSignal;\n}\n", "import { apiFetch, readApiJson } from \"@openpond/cloud/api/core\";\n\nexport type OpenPondProfileActionSetupRequirement = {\n kind: string;\n key: string;\n label: string | null;\n required: boolean;\n status: string;\n warning: string | null;\n};\n\nexport type OpenPondProfileActionCatalogEntry = {\n /** Stable action key. This is the only action selector accepted by follow-up invocation APIs. */\n key: string;\n agentId: string;\n agentName: string;\n agentSlug: string;\n actionId: string;\n actionLabel: string;\n description: string;\n inputSchema: Record<string, unknown>;\n invokesModel: boolean;\n approvalPolicy: {\n required: boolean;\n risk: \"read\" | \"write\" | \"destructive\";\n };\n setupStatus: \"ready\" | \"setup_required\";\n setupRequirements: OpenPondProfileActionSetupRequirement[];\n requiredCapabilities: string[];\n};\n\nexport type OpenPondProfileActionCatalog = {\n profileId: string;\n profileName: string;\n /** Opaque source/action contract version used to reject catalog drift at invocation time. */\n catalogVersion: string;\n sourceCommitSha: string | null;\n actions: OpenPondProfileActionCatalogEntry[];\n};\n\nexport type OpenPondProfileActionInvocation<TOutput = Record<string, unknown>> = {\n run: {\n id: string;\n status: string;\n conversationId: string | null;\n resultJson: TOutput | null;\n };\n};\n\n/** A short-lived capability granted by the calling product for one Profile Action run. */\nexport type OpenPondExternalCapabilityLease = {\n provider: string;\n capabilities: string[];\n proxyUrl: string;\n bearerToken: string;\n expiresAt?: string;\n resourcePolicy?: Record<string, unknown>;\n};\n\ntype ProfileActionsClientInput = {\n apiKey: string;\n apiBaseUrl: string;\n};\n\nexport class OpenPondProfileActionsClient {\n readonly #apiKey: string;\n readonly #apiBaseUrl: string;\n\n constructor(input: ProfileActionsClientInput) {\n this.#apiKey = input.apiKey;\n this.#apiBaseUrl = input.apiBaseUrl.replace(/\\/+$/, \"\");\n }\n\n async catalog(input: {\n teamId: string;\n profileId?: string;\n profileName?: string;\n }): Promise<OpenPondProfileActionCatalog> {\n const teamId = requiredValue(input.teamId, \"teamId\");\n const search = new URLSearchParams({ teamId });\n if (input.profileId?.trim()) search.set(\"profileId\", input.profileId.trim());\n if (input.profileName?.trim()) {\n search.set(\"profileName\", input.profileName.trim());\n }\n const response = await apiFetch(\n this.#apiBaseUrl,\n this.#apiKey,\n `/v1/profile/actions?${search.toString()}`,\n );\n return (\n await readApiJson<{ catalog: OpenPondProfileActionCatalog }>(\n response,\n \"Get Profile Action catalog\",\n )\n ).catalog;\n }\n\n async run<TOutput = Record<string, unknown>>(input: {\n teamId: string;\n actionKey: string;\n profileId?: string;\n profileName?: string;\n value?: Record<string, unknown>;\n conversationId?: string | null;\n createConversation?: boolean;\n conversationTitle?: string | null;\n idempotencyKey: string;\n catalogVersion: string;\n externalCapabilityLeases?: OpenPondExternalCapabilityLease[];\n }): Promise<OpenPondProfileActionInvocation<TOutput>> {\n const teamId = requiredValue(input.teamId, \"teamId\");\n const actionKey = requiredValue(input.actionKey, \"actionKey\");\n const idempotencyKey = requiredValue(input.idempotencyKey, \"idempotencyKey\");\n const catalogVersion = requiredValue(input.catalogVersion, \"catalogVersion\");\n const response = await apiFetch(\n this.#apiBaseUrl,\n this.#apiKey,\n `/v1/profile/actions/run?${new URLSearchParams({ teamId }).toString()}`,\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n ...(input.profileId?.trim() ? { profileId: input.profileId.trim() } : {}),\n ...(input.profileName?.trim() ? { profileName: input.profileName.trim() } : {}),\n actionKey,\n value: input.value ?? {},\n conversationId: input.conversationId ?? null,\n createConversation: input.createConversation,\n conversationTitle: input.conversationTitle ?? null,\n idempotencyKey,\n catalogVersion,\n externalCapabilityLeases: input.externalCapabilityLeases,\n }),\n },\n );\n return readApiJson<OpenPondProfileActionInvocation<TOutput>>(\n response,\n \"Run Profile Action\",\n );\n }\n}\n\nfunction requiredValue(value: string, name: string): string {\n const normalized = value.trim();\n if (!normalized) throw new Error(`${name} is required`);\n return normalized;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,IAAM,kCAAkC;AAElC,SAAU,2BACd,YACA,cACA,MACE,OAAO,YAAY,cAAc,CAAA,IAAK,QAAQ,KAAG;AAEnD,QAAM,UAAU,IAAI,QAAQ,YAAY;AACxC,QAAM,SAAS,IAAI,iCAAiC,KAAI;AACxD,MAAI,CAAC,UAAU,CAAC,qBAAqB,UAAU;AAAG,WAAO;AACzD,UAAQ,IAAI,iCAAiC,MAAM;AACnD,SAAO;AACT;AAEA,SAAS,qBAAqB,YAAkB;AAC9C,MAAI;AACF,UAAM,WAAW,IAAI,IAAI,UAAU,EAAE,SAAS,YAAW;AACzD,WACE,aAAa,yBACb,aAAa,6BACb,SAAS,SAAS,0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AAM,aAAa,KAAK,IAAI,EAAE,aAAa,MAAM,YAAY,KAAK,EAAE,IAAI,CAAC;AAAA,UAC7E;AAAA,UACA,OAAO,MAAM,SAAS,CAAC;AAAA,UACvB,gBAAgB,MAAM,kBAAkB;AAAA,UACxC,oBAAoB,MAAM;AAAA,UAC1B,mBAAmB,MAAM,qBAAqB;AAAA,UAC9C;AAAA,UACA;AAAA,UACA,0BAA0B,MAAM;AAAA,QAClC,CAAC;AAAA,MACH;AAAA,IACF;AACA,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,cAAc,OAAe,MAAsB;AAC1D,QAAM,aAAa,MAAM,KAAK;AAC9B,MAAI,CAAC,WAAY,OAAM,IAAI,MAAM,GAAG,IAAI,cAAc;AACtD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -19,7 +19,7 @@ export { OpenPondWorkflowsClient } from "./workflows.js";
|
|
|
19
19
|
export { OpenPondProjectActionsClient } from "./project-actions.js";
|
|
20
20
|
export { OpenPondProfileActionsClient } from "./profile-actions.js";
|
|
21
21
|
export type { HostedProjectActionCatalog, ProjectActionInvocation, ProjectActionRelease, } from "./project-actions.js";
|
|
22
|
-
export type { OpenPondProfileActionCatalog, OpenPondProfileActionCatalogEntry, OpenPondProfileActionSetupRequirement, } from "./profile-actions.js";
|
|
22
|
+
export type { OpenPondProfileActionCatalog, OpenPondProfileActionCatalogEntry, OpenPondProfileActionInvocation, OpenPondProfileActionSetupRequirement, } from "./profile-actions.js";
|
|
23
23
|
export { OpenPondApiError } from "@openpond/cloud/api/core";
|
|
24
24
|
export type { OpenPondWorkEvent, OpenPondWorkCleanup, OpenPondWorkHistoryMessage, OpenPondWorkInputFile, OpenPondWorkLifecycle, OpenPondWorkOutput, OpenPondWorkOutputPersistenceContext, OpenPondWorkRunInput, OpenPondWorkRunResult, } from "./work.js";
|
|
25
25
|
export type { OpenPondWorkflowCatalog, OpenPondWorkflowCreateInput, OpenPondWorkflowCreateResult, OpenPondWorkflowDefinition, OpenPondWorkflowDeleteResult, OpenPondWorkflowRecurrence, OpenPondWorkflowRequestOptions, OpenPondWorkflowRun, OpenPondWorkflowRunNowResult, OpenPondWorkflowSchedule, OpenPondWorkflowUpdateInput, OpenPondWorkflowUpdateResult, OpenPondWorkflowWeekday, } from "./workflows.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,qBAAa,cAAc;IACzB,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC;IAC/C,QAAQ,CAAC,cAAc,EAAE,4BAA4B,CAAC;gBAE1C,OAAO,EAAE,qBAAqB;CAsB3C;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAEnF;AAED,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,YAAY,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,4BAA4B,EAC5B,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,oCAAoC,EACpC,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,8BAA8B,EAC9B,mBAAmB,EACnB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,uBAAuB,GACxB,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,4B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AAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,8BAA8B,EAC9B,mBAAmB,EACnB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,uBAAuB,GACxB,MAAM,6BAA6B,CAAC"}
|
|
@@ -33,6 +33,23 @@ export type OpenPondProfileActionCatalog = {
|
|
|
33
33
|
sourceCommitSha: string | null;
|
|
34
34
|
actions: OpenPondProfileActionCatalogEntry[];
|
|
35
35
|
};
|
|
36
|
+
export type OpenPondProfileActionInvocation<TOutput = Record<string, unknown>> = {
|
|
37
|
+
run: {
|
|
38
|
+
id: string;
|
|
39
|
+
status: string;
|
|
40
|
+
conversationId: string | null;
|
|
41
|
+
resultJson: TOutput | null;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/** A short-lived capability granted by the calling product for one Profile Action run. */
|
|
45
|
+
export type OpenPondExternalCapabilityLease = {
|
|
46
|
+
provider: string;
|
|
47
|
+
capabilities: string[];
|
|
48
|
+
proxyUrl: string;
|
|
49
|
+
bearerToken: string;
|
|
50
|
+
expiresAt?: string;
|
|
51
|
+
resourcePolicy?: Record<string, unknown>;
|
|
52
|
+
};
|
|
36
53
|
type ProfileActionsClientInput = {
|
|
37
54
|
apiKey: string;
|
|
38
55
|
apiBaseUrl: string;
|
|
@@ -45,6 +62,19 @@ export declare class OpenPondProfileActionsClient {
|
|
|
45
62
|
profileId?: string;
|
|
46
63
|
profileName?: string;
|
|
47
64
|
}): Promise<OpenPondProfileActionCatalog>;
|
|
65
|
+
run<TOutput = Record<string, unknown>>(input: {
|
|
66
|
+
teamId: string;
|
|
67
|
+
actionKey: string;
|
|
68
|
+
profileId?: string;
|
|
69
|
+
profileName?: string;
|
|
70
|
+
value?: Record<string, unknown>;
|
|
71
|
+
conversationId?: string | null;
|
|
72
|
+
createConversation?: boolean;
|
|
73
|
+
conversationTitle?: string | null;
|
|
74
|
+
idempotencyKey: string;
|
|
75
|
+
catalogVersion: string;
|
|
76
|
+
externalCapabilityLeases?: OpenPondExternalCapabilityLease[];
|
|
77
|
+
}): Promise<OpenPondProfileActionInvocation<TOutput>>;
|
|
48
78
|
}
|
|
49
79
|
export {};
|
|
50
80
|
//# sourceMappingURL=profile-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-actions.d.ts","sourceRoot":"","sources":["../../../../../src/profile-actions.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,iGAAiG;IACjG,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,C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