@copass/core
Advanced tools
+88
-6
@@ -47,2 +47,3 @@ "use strict"; | ||
| DEFAULT_LANGUAGE_MAP: () => DEFAULT_LANGUAGE_MAP, | ||
| DEFAULT_MODEL_BY_BACKEND: () => DEFAULT_MODEL_BY_BACKEND, | ||
| DEK_HKDF_INFO: () => DEK_HKDF_INFO, | ||
@@ -922,3 +923,3 @@ DEK_HKDF_SALT: () => DEK_HKDF_SALT, | ||
| * Mint a fresh webhook signing secret for a `realtime` data source whose | ||
| * provider has a registered ingestor (Pipedream today). The plaintext | ||
| * provider has a registered ingestor. The plaintext | ||
| * `webhook_signing_secret` is returned ONCE on the response — paste it | ||
@@ -1031,2 +1032,16 @@ * into your provider's HTTP step as `Authorization: Bearer <secret>`. | ||
| } | ||
| /** List the user's raw upstream OAuth accounts. | ||
| * | ||
| * Distinct from {@link list}: connections are local DataSource rows | ||
| * the connect webhook materialises; accounts are the raw grants on | ||
| * the upstream provider. Backs the `list_connected_accounts` | ||
| * management tool. Server-side at | ||
| * `GET /sources/integrations/accounts`. */ | ||
| async listAccounts(sandboxId, options = {}) { | ||
| const params = new URLSearchParams(); | ||
| if (options.app_slug) params.set("app_slug", options.app_slug); | ||
| const qs = params.toString(); | ||
| const path3 = qs ? `${base4(sandboxId)}/accounts?${qs}` : `${base4(sandboxId)}/accounts`; | ||
| return this.get(path3); | ||
| } | ||
| /** List the sandbox's active integration-sourced connections. | ||
@@ -1118,2 +1133,46 @@ * Optionally filter by `app` slug. */ | ||
| } | ||
| /** | ||
| * Replace an agent's `tool_sources` (the resolver list). | ||
| * | ||
| * Targets `PATCH /agents/{slug}/tool-sources`. Distinct from | ||
| * {@link update} so the absent-vs-null distinction is structural: | ||
| * | ||
| * - `tool_sources: null` — sent as JSON `null`; reverts to the | ||
| * caller's default tool-sources set. | ||
| * - `tool_sources: []` — explicit "tool-less by choice". | ||
| * - `tool_sources: [...]` — set the list verbatim. | ||
| * | ||
| * Distinct from `tool_allowlist` — this controls which RESOLVERS | ||
| * run (which tools are AVAILABLE), not which tool NAMES are | ||
| * CALLABLE. | ||
| */ | ||
| async updateToolSources(sandboxId, slug, toolSources) { | ||
| const body = { | ||
| tool_sources: toolSources === null ? null : [...toolSources] | ||
| }; | ||
| return this.patch( | ||
| `${agentsBase(sandboxId)}/${slug}/tool-sources`, | ||
| body | ||
| ); | ||
| } | ||
| /** | ||
| * Wire a third-party integration's tools into one agent atomically. | ||
| * | ||
| * Targets `POST /agents/{slug}/wire-integration`. Resolves | ||
| * `appSlug` against the user's active OAuth-connected providers, | ||
| * unions the matching source(s) into the agent's `tool_sources`, | ||
| * and rebuilds `tool_allowlist` from the full resulting source set | ||
| * in one `update_agent` call. | ||
| * | ||
| * Idempotent per ADR 0006: re-firing on an already-wired | ||
| * `(slug, appSlug)` pair returns `sources_added: []` with the | ||
| * current `tool_count`. | ||
| */ | ||
| async wireIntegration(sandboxId, slug, appSlug) { | ||
| const body = { app_slug: appSlug }; | ||
| return this.post( | ||
| `${agentsBase(sandboxId)}/${slug}/wire-integration`, | ||
| body | ||
| ); | ||
| } | ||
| // ─── Invocation ───────────────────────────────────────────────────── | ||
@@ -1126,3 +1185,3 @@ /** | ||
| * failed run with a clear error | ||
| * - No Pipedream tools wired (empty registry); real trigger dispatch | ||
| * - No third-party tools wired (empty registry); real trigger dispatch | ||
| * restores tool wiring | ||
@@ -1153,4 +1212,18 @@ * - No credit gate — iterate freely without burning balance | ||
| /** | ||
| * Dynamic-per-sandbox tool catalog (resolved live from Pipedream | ||
| * discovery on the user's connected sources). Server-side at | ||
| * Fetch one run by id, including the `tool_resolution_trace` audit | ||
| * JSON (Phase 4). Targets | ||
| * `GET /api/v1/storage/sandboxes/{sandbox_id}/agents/runs/{run_id}`. | ||
| * | ||
| * The trace is NULL on pre-Phase-4 runs and on ad-hoc | ||
| * `/agents/run` invocations that bypass the persisted-agent | ||
| * runtime. | ||
| */ | ||
| async getRun(sandboxId, runId) { | ||
| return this.get( | ||
| `${agentsBase(sandboxId)}/runs/${runId}` | ||
| ); | ||
| } | ||
| /** | ||
| * Dynamic-per-sandbox tool catalog (resolved live from upstream | ||
| * provider discovery on the user's connected sources). Server-side at | ||
| * `GET /agents/tools`. | ||
@@ -1164,7 +1237,9 @@ */ | ||
| /** | ||
| * Search Pipedream's trigger-component registry. Use BEFORE | ||
| * Search the upstream trigger-component registry. Use BEFORE | ||
| * `client.sources.register({ adapter_config: { pipedream_trigger: | ||
| * { component_id, configured_props } } })` to discover the right | ||
| * `component_id` and the `configurable_props` schema the user | ||
| * needs to fill in. Server-side at | ||
| * needs to fill in. (Note: the `pipedream_trigger` adapter-config | ||
| * key is the literal backend field name and is part of the API | ||
| * contract today.) Server-side at | ||
| * `GET /agents/triggers/components`. | ||
@@ -1522,2 +1597,8 @@ */ | ||
| // src/types/agents.ts | ||
| var DEFAULT_MODEL_BY_BACKEND = { | ||
| anthropic: "claude-sonnet-4-6", | ||
| google: "gemini-2.5-flash" | ||
| }; | ||
| // src/config/index.ts | ||
@@ -1764,2 +1845,3 @@ var import_zod = require("zod"); | ||
| DEFAULT_LANGUAGE_MAP, | ||
| DEFAULT_MODEL_BY_BACKEND, | ||
| DEK_HKDF_INFO, | ||
@@ -1766,0 +1848,0 @@ DEK_HKDF_SALT, |
+87
-6
@@ -834,3 +834,3 @@ // src/auth/api-key.ts | ||
| * Mint a fresh webhook signing secret for a `realtime` data source whose | ||
| * provider has a registered ingestor (Pipedream today). The plaintext | ||
| * provider has a registered ingestor. The plaintext | ||
| * `webhook_signing_secret` is returned ONCE on the response — paste it | ||
@@ -943,2 +943,16 @@ * into your provider's HTTP step as `Authorization: Bearer <secret>`. | ||
| } | ||
| /** List the user's raw upstream OAuth accounts. | ||
| * | ||
| * Distinct from {@link list}: connections are local DataSource rows | ||
| * the connect webhook materialises; accounts are the raw grants on | ||
| * the upstream provider. Backs the `list_connected_accounts` | ||
| * management tool. Server-side at | ||
| * `GET /sources/integrations/accounts`. */ | ||
| async listAccounts(sandboxId, options = {}) { | ||
| const params = new URLSearchParams(); | ||
| if (options.app_slug) params.set("app_slug", options.app_slug); | ||
| const qs = params.toString(); | ||
| const path3 = qs ? `${base4(sandboxId)}/accounts?${qs}` : `${base4(sandboxId)}/accounts`; | ||
| return this.get(path3); | ||
| } | ||
| /** List the sandbox's active integration-sourced connections. | ||
@@ -1030,2 +1044,46 @@ * Optionally filter by `app` slug. */ | ||
| } | ||
| /** | ||
| * Replace an agent's `tool_sources` (the resolver list). | ||
| * | ||
| * Targets `PATCH /agents/{slug}/tool-sources`. Distinct from | ||
| * {@link update} so the absent-vs-null distinction is structural: | ||
| * | ||
| * - `tool_sources: null` — sent as JSON `null`; reverts to the | ||
| * caller's default tool-sources set. | ||
| * - `tool_sources: []` — explicit "tool-less by choice". | ||
| * - `tool_sources: [...]` — set the list verbatim. | ||
| * | ||
| * Distinct from `tool_allowlist` — this controls which RESOLVERS | ||
| * run (which tools are AVAILABLE), not which tool NAMES are | ||
| * CALLABLE. | ||
| */ | ||
| async updateToolSources(sandboxId, slug, toolSources) { | ||
| const body = { | ||
| tool_sources: toolSources === null ? null : [...toolSources] | ||
| }; | ||
| return this.patch( | ||
| `${agentsBase(sandboxId)}/${slug}/tool-sources`, | ||
| body | ||
| ); | ||
| } | ||
| /** | ||
| * Wire a third-party integration's tools into one agent atomically. | ||
| * | ||
| * Targets `POST /agents/{slug}/wire-integration`. Resolves | ||
| * `appSlug` against the user's active OAuth-connected providers, | ||
| * unions the matching source(s) into the agent's `tool_sources`, | ||
| * and rebuilds `tool_allowlist` from the full resulting source set | ||
| * in one `update_agent` call. | ||
| * | ||
| * Idempotent per ADR 0006: re-firing on an already-wired | ||
| * `(slug, appSlug)` pair returns `sources_added: []` with the | ||
| * current `tool_count`. | ||
| */ | ||
| async wireIntegration(sandboxId, slug, appSlug) { | ||
| const body = { app_slug: appSlug }; | ||
| return this.post( | ||
| `${agentsBase(sandboxId)}/${slug}/wire-integration`, | ||
| body | ||
| ); | ||
| } | ||
| // ─── Invocation ───────────────────────────────────────────────────── | ||
@@ -1038,3 +1096,3 @@ /** | ||
| * failed run with a clear error | ||
| * - No Pipedream tools wired (empty registry); real trigger dispatch | ||
| * - No third-party tools wired (empty registry); real trigger dispatch | ||
| * restores tool wiring | ||
@@ -1065,4 +1123,18 @@ * - No credit gate — iterate freely without burning balance | ||
| /** | ||
| * Dynamic-per-sandbox tool catalog (resolved live from Pipedream | ||
| * discovery on the user's connected sources). Server-side at | ||
| * Fetch one run by id, including the `tool_resolution_trace` audit | ||
| * JSON (Phase 4). Targets | ||
| * `GET /api/v1/storage/sandboxes/{sandbox_id}/agents/runs/{run_id}`. | ||
| * | ||
| * The trace is NULL on pre-Phase-4 runs and on ad-hoc | ||
| * `/agents/run` invocations that bypass the persisted-agent | ||
| * runtime. | ||
| */ | ||
| async getRun(sandboxId, runId) { | ||
| return this.get( | ||
| `${agentsBase(sandboxId)}/runs/${runId}` | ||
| ); | ||
| } | ||
| /** | ||
| * Dynamic-per-sandbox tool catalog (resolved live from upstream | ||
| * provider discovery on the user's connected sources). Server-side at | ||
| * `GET /agents/tools`. | ||
@@ -1076,7 +1148,9 @@ */ | ||
| /** | ||
| * Search Pipedream's trigger-component registry. Use BEFORE | ||
| * Search the upstream trigger-component registry. Use BEFORE | ||
| * `client.sources.register({ adapter_config: { pipedream_trigger: | ||
| * { component_id, configured_props } } })` to discover the right | ||
| * `component_id` and the `configurable_props` schema the user | ||
| * needs to fill in. Server-side at | ||
| * needs to fill in. (Note: the `pipedream_trigger` adapter-config | ||
| * key is the literal backend field name and is part of the API | ||
| * contract today.) Server-side at | ||
| * `GET /agents/triggers/components`. | ||
@@ -1434,2 +1508,8 @@ */ | ||
| // src/types/agents.ts | ||
| var DEFAULT_MODEL_BY_BACKEND = { | ||
| anthropic: "claude-sonnet-4-6", | ||
| google: "gemini-2.5-flash" | ||
| }; | ||
| // src/config/index.ts | ||
@@ -1675,2 +1755,3 @@ import { z } from "zod"; | ||
| DEFAULT_LANGUAGE_MAP, | ||
| DEFAULT_MODEL_BY_BACKEND, | ||
| DEK_HKDF_INFO, | ||
@@ -1677,0 +1758,0 @@ DEK_HKDF_SALT, |
+2
-2
| { | ||
| "name": "@copass/core", | ||
| "version": "0.3.6", | ||
| "version": "0.3.8", | ||
| "description": "Core client SDK for the Copass platform", | ||
@@ -64,3 +64,3 @@ "publishConfig": { | ||
| }, | ||
| "gitHead": "8ade3ea8b8d9f19b84b618dce5e96565eeaef0f7" | ||
| "gitHead": "b2bba74253d159b7c917309c6c3ad4d1aa29fc07" | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
619155
8.39%6032
5.4%