@copilotkit/runtime 2.0.0-rc.34 → 2.0.0-rc.35

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.
@@ -1,7 +1,7 @@
1
1
 
2
2
  //#region src/runtime/core/package-info.ts
3
3
  const RUNTIME_PACKAGE_NAME = "@copilotkit/runtime";
4
- const RUNTIME_PACKAGE_VERSION = "2.0.0-rc.34";
4
+ const RUNTIME_PACKAGE_VERSION = "2.0.0-rc.35";
5
5
 
6
6
  //#endregion
7
7
  exports.RUNTIME_PACKAGE_NAME = RUNTIME_PACKAGE_NAME;
@@ -1,6 +1,6 @@
1
1
  //#region src/runtime/core/package-info.ts
2
2
  const RUNTIME_PACKAGE_NAME = "@copilotkit/runtime";
3
- const RUNTIME_PACKAGE_VERSION = "2.0.0-rc.34";
3
+ const RUNTIME_PACKAGE_VERSION = "2.0.0-rc.35";
4
4
 
5
5
  //#endregion
6
6
  export { RUNTIME_PACKAGE_NAME, RUNTIME_PACKAGE_VERSION };
@@ -37,7 +37,7 @@ function fireInstanceCreatedTelemetry({ runtime, info }) {
37
37
  if (reportedRuntimes.has(runtime)) return;
38
38
  reportedRuntimes.add(runtime);
39
39
  const runtimeTelemetry = runtime.telemetry ?? require_telemetry_client.default;
40
- if (info) {
40
+ if (info !== void 0) {
41
41
  runtimeTelemetry.capture("oss.runtime.instance_created", info);
42
42
  return;
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"instance-created.cjs","names":["telemetry"],"sources":["../../../src/runtime/telemetry/instance-created.ts"],"sourcesContent":["import { telemetry } from \".\";\nimport type { CopilotRuntimeLike } from \"../core/runtime\";\nimport type { RuntimeInstanceCreatedInfo } from \"./events\";\n\n/**\n * Runtimes that already reported `oss.runtime.instance_created`. The event\n * counts runtime instances, so it fires at most once per runtime object, no\n * matter how many handlers are built from that runtime. A WeakSet keeps the\n * guard from holding a discarded runtime in memory.\n *\n * The guard keys on the runtime and not on the process: one process can host\n * several distinct runtimes (multi-tenant servers, tests), and each of those\n * is a real instance. The guard exists for code that builds a handler per\n * request from one long-lived runtime (an old docs snippet did this). Before\n * the guard, that code reported one instance per HTTP request.\n */\nconst reportedRuntimes = new WeakSet<object>();\n\n/**\n * Fire the `oss.runtime.instance_created` telemetry event for a v2 runtime\n * handler. Called once per handler factory invocation (not per request), and\n * sends at most one event per runtime object (see {@link reportedRuntimes}).\n *\n * v2 does not have a concept of remote endpoints or standalone actions, so\n * those counts are 0 / []. `cloud.api_key_provided` is false at this level\n * because in v2 the cloud public key arrives per-request via the\n * `x-copilotcloud-public-api-key` header — not at handler creation time.\n * See `handlers/handle-run.ts` for the per-request event that DOES carry\n * the key when present.\n *\n * `info` replaces those defaults. The v1 integration wrappers pass the v1\n * payload (endpoint types, actions, the cloud key) here, because they build\n * a v2 handler and must not capture the event a second time themselves.\n *\n * Errors resolving agents are swallowed — telemetry must never break\n * runtime setup.\n */\nexport function fireInstanceCreatedTelemetry({\n runtime,\n info,\n}: {\n runtime: CopilotRuntimeLike;\n info?: RuntimeInstanceCreatedInfo;\n}): void {\n if (reportedRuntimes.has(runtime)) return;\n reportedRuntimes.add(runtime);\n\n const runtimeTelemetry = runtime.telemetry ?? telemetry;\n\n if (info) {\n runtimeTelemetry.capture(\"oss.runtime.instance_created\", info);\n return;\n }\n\n // agents can be a static Record, a Promise, or a per-request factory.\n // Factory configs cannot be resolved at handler-creation time (no Request\n // context), so report agentsAmount as null in that case.\n const agentsPromise =\n typeof runtime.agents === \"function\"\n ? Promise.resolve<Record<string, unknown> | null>(null)\n : Promise.resolve(runtime.agents);\n\n agentsPromise\n .then((agents) =>\n runtimeTelemetry.capture(\"oss.runtime.instance_created\", {\n actionsAmount: 0,\n endpointTypes: [],\n endpointsAmount: 0,\n agentsAmount: agents ? Object.keys(agents).length : null,\n \"cloud.api_key_provided\": false,\n }),\n )\n .catch(() => {\n // Swallow — telemetry must not break runtime creation.\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,mCAAmB,IAAI,SAAiB;;;;;;;;;;;;;;;;;;;;AAqB9C,SAAgB,6BAA6B,EAC3C,SACA,QAIO;AACP,KAAI,iBAAiB,IAAI,QAAQ,CAAE;AACnC,kBAAiB,IAAI,QAAQ;CAE7B,MAAM,mBAAmB,QAAQ,aAAaA;AAE9C,KAAI,MAAM;AACR,mBAAiB,QAAQ,gCAAgC,KAAK;AAC9D;;AAWF,EAJE,OAAO,QAAQ,WAAW,aACtB,QAAQ,QAAwC,KAAK,GACrD,QAAQ,QAAQ,QAAQ,OAAO,EAGlC,MAAM,WACL,iBAAiB,QAAQ,gCAAgC;EACvD,eAAe;EACf,eAAe,EAAE;EACjB,iBAAiB;EACjB,cAAc,SAAS,OAAO,KAAK,OAAO,CAAC,SAAS;EACpD,0BAA0B;EAC3B,CAAC,CACH,CACA,YAAY,GAEX"}
1
+ {"version":3,"file":"instance-created.cjs","names":["telemetry"],"sources":["../../../src/runtime/telemetry/instance-created.ts"],"sourcesContent":["import { telemetry } from \".\";\nimport type { CopilotRuntimeLike } from \"../core/runtime\";\nimport type { RuntimeInstanceCreatedInfo } from \"./events\";\n\n/**\n * Runtimes that already reported `oss.runtime.instance_created`. The event\n * counts runtime instances, so it fires at most once per runtime object, no\n * matter how many handlers are built from that runtime. A WeakSet keeps the\n * guard from holding a discarded runtime in memory.\n *\n * The guard keys on the runtime and not on the process: one process can host\n * several distinct runtimes (multi-tenant servers, tests), and each of those\n * is a real instance. The guard exists for code that builds a handler per\n * request from one long-lived runtime (an old docs snippet did this). Before\n * the guard, that code reported one instance per HTTP request.\n */\nconst reportedRuntimes = new WeakSet<object>();\n\n/**\n * Fire the `oss.runtime.instance_created` telemetry event for a v2 runtime\n * handler. Called once per handler factory invocation (not per request), and\n * sends at most one event per runtime object (see {@link reportedRuntimes}).\n *\n * v2 does not have a concept of remote endpoints or standalone actions, so\n * those counts are 0 / []. `cloud.api_key_provided` is false at this level\n * because in v2 the cloud public key arrives per-request via the\n * `x-copilotcloud-public-api-key` header — not at handler creation time.\n * See `handlers/handle-run.ts` for the per-request event that DOES carry\n * the key when present.\n *\n * `info` replaces those defaults. The v1 integration wrappers pass the v1\n * payload (endpoint types, actions, the cloud key) here, because they build\n * a v2 handler and must not capture the event a second time themselves.\n *\n * Errors resolving agents are swallowed — telemetry must never break\n * runtime setup.\n */\nexport function fireInstanceCreatedTelemetry({\n runtime,\n info,\n}: {\n runtime: CopilotRuntimeLike;\n info?: RuntimeInstanceCreatedInfo;\n}): void {\n if (reportedRuntimes.has(runtime)) return;\n reportedRuntimes.add(runtime);\n\n const runtimeTelemetry = runtime.telemetry ?? telemetry;\n\n if (info !== undefined) {\n void runtimeTelemetry.capture(\"oss.runtime.instance_created\", info);\n return;\n }\n\n // agents can be a static Record, a Promise, or a per-request factory.\n // Factory configs cannot be resolved at handler-creation time (no Request\n // context), so report agentsAmount as null in that case.\n const agentsPromise =\n typeof runtime.agents === \"function\"\n ? Promise.resolve<Record<string, unknown> | null>(null)\n : Promise.resolve(runtime.agents);\n\n agentsPromise\n .then((agents) =>\n runtimeTelemetry.capture(\"oss.runtime.instance_created\", {\n actionsAmount: 0,\n endpointTypes: [],\n endpointsAmount: 0,\n agentsAmount: agents ? Object.keys(agents).length : null,\n \"cloud.api_key_provided\": false,\n }),\n )\n .catch(() => {\n // Swallow — telemetry must not break runtime creation.\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,mCAAmB,IAAI,SAAiB;;;;;;;;;;;;;;;;;;;;AAqB9C,SAAgB,6BAA6B,EAC3C,SACA,QAIO;AACP,KAAI,iBAAiB,IAAI,QAAQ,CAAE;AACnC,kBAAiB,IAAI,QAAQ;CAE7B,MAAM,mBAAmB,QAAQ,aAAaA;AAE9C,KAAI,SAAS,QAAW;AACtB,EAAK,iBAAiB,QAAQ,gCAAgC,KAAK;AACnE;;AAWF,EAJE,OAAO,QAAQ,WAAW,aACtB,QAAQ,QAAwC,KAAK,GACrD,QAAQ,QAAQ,QAAQ,OAAO,EAGlC,MAAM,WACL,iBAAiB,QAAQ,gCAAgC;EACvD,eAAe;EACf,eAAe,EAAE;EACjB,iBAAiB;EACjB,cAAc,SAAS,OAAO,KAAK,OAAO,CAAC,SAAS;EACpD,0BAA0B;EAC3B,CAAC,CACH,CACA,YAAY,GAEX"}
@@ -37,7 +37,7 @@ function fireInstanceCreatedTelemetry({ runtime, info }) {
37
37
  if (reportedRuntimes.has(runtime)) return;
38
38
  reportedRuntimes.add(runtime);
39
39
  const runtimeTelemetry = runtime.telemetry ?? telemetry;
40
- if (info) {
40
+ if (info !== void 0) {
41
41
  runtimeTelemetry.capture("oss.runtime.instance_created", info);
42
42
  return;
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"instance-created.mjs","names":[],"sources":["../../../src/runtime/telemetry/instance-created.ts"],"sourcesContent":["import { telemetry } from \".\";\nimport type { CopilotRuntimeLike } from \"../core/runtime\";\nimport type { RuntimeInstanceCreatedInfo } from \"./events\";\n\n/**\n * Runtimes that already reported `oss.runtime.instance_created`. The event\n * counts runtime instances, so it fires at most once per runtime object, no\n * matter how many handlers are built from that runtime. A WeakSet keeps the\n * guard from holding a discarded runtime in memory.\n *\n * The guard keys on the runtime and not on the process: one process can host\n * several distinct runtimes (multi-tenant servers, tests), and each of those\n * is a real instance. The guard exists for code that builds a handler per\n * request from one long-lived runtime (an old docs snippet did this). Before\n * the guard, that code reported one instance per HTTP request.\n */\nconst reportedRuntimes = new WeakSet<object>();\n\n/**\n * Fire the `oss.runtime.instance_created` telemetry event for a v2 runtime\n * handler. Called once per handler factory invocation (not per request), and\n * sends at most one event per runtime object (see {@link reportedRuntimes}).\n *\n * v2 does not have a concept of remote endpoints or standalone actions, so\n * those counts are 0 / []. `cloud.api_key_provided` is false at this level\n * because in v2 the cloud public key arrives per-request via the\n * `x-copilotcloud-public-api-key` header — not at handler creation time.\n * See `handlers/handle-run.ts` for the per-request event that DOES carry\n * the key when present.\n *\n * `info` replaces those defaults. The v1 integration wrappers pass the v1\n * payload (endpoint types, actions, the cloud key) here, because they build\n * a v2 handler and must not capture the event a second time themselves.\n *\n * Errors resolving agents are swallowed — telemetry must never break\n * runtime setup.\n */\nexport function fireInstanceCreatedTelemetry({\n runtime,\n info,\n}: {\n runtime: CopilotRuntimeLike;\n info?: RuntimeInstanceCreatedInfo;\n}): void {\n if (reportedRuntimes.has(runtime)) return;\n reportedRuntimes.add(runtime);\n\n const runtimeTelemetry = runtime.telemetry ?? telemetry;\n\n if (info) {\n runtimeTelemetry.capture(\"oss.runtime.instance_created\", info);\n return;\n }\n\n // agents can be a static Record, a Promise, or a per-request factory.\n // Factory configs cannot be resolved at handler-creation time (no Request\n // context), so report agentsAmount as null in that case.\n const agentsPromise =\n typeof runtime.agents === \"function\"\n ? Promise.resolve<Record<string, unknown> | null>(null)\n : Promise.resolve(runtime.agents);\n\n agentsPromise\n .then((agents) =>\n runtimeTelemetry.capture(\"oss.runtime.instance_created\", {\n actionsAmount: 0,\n endpointTypes: [],\n endpointsAmount: 0,\n agentsAmount: agents ? Object.keys(agents).length : null,\n \"cloud.api_key_provided\": false,\n }),\n )\n .catch(() => {\n // Swallow — telemetry must not break runtime creation.\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,mCAAmB,IAAI,SAAiB;;;;;;;;;;;;;;;;;;;;AAqB9C,SAAgB,6BAA6B,EAC3C,SACA,QAIO;AACP,KAAI,iBAAiB,IAAI,QAAQ,CAAE;AACnC,kBAAiB,IAAI,QAAQ;CAE7B,MAAM,mBAAmB,QAAQ,aAAa;AAE9C,KAAI,MAAM;AACR,mBAAiB,QAAQ,gCAAgC,KAAK;AAC9D;;AAWF,EAJE,OAAO,QAAQ,WAAW,aACtB,QAAQ,QAAwC,KAAK,GACrD,QAAQ,QAAQ,QAAQ,OAAO,EAGlC,MAAM,WACL,iBAAiB,QAAQ,gCAAgC;EACvD,eAAe;EACf,eAAe,EAAE;EACjB,iBAAiB;EACjB,cAAc,SAAS,OAAO,KAAK,OAAO,CAAC,SAAS;EACpD,0BAA0B;EAC3B,CAAC,CACH,CACA,YAAY,GAEX"}
1
+ {"version":3,"file":"instance-created.mjs","names":[],"sources":["../../../src/runtime/telemetry/instance-created.ts"],"sourcesContent":["import { telemetry } from \".\";\nimport type { CopilotRuntimeLike } from \"../core/runtime\";\nimport type { RuntimeInstanceCreatedInfo } from \"./events\";\n\n/**\n * Runtimes that already reported `oss.runtime.instance_created`. The event\n * counts runtime instances, so it fires at most once per runtime object, no\n * matter how many handlers are built from that runtime. A WeakSet keeps the\n * guard from holding a discarded runtime in memory.\n *\n * The guard keys on the runtime and not on the process: one process can host\n * several distinct runtimes (multi-tenant servers, tests), and each of those\n * is a real instance. The guard exists for code that builds a handler per\n * request from one long-lived runtime (an old docs snippet did this). Before\n * the guard, that code reported one instance per HTTP request.\n */\nconst reportedRuntimes = new WeakSet<object>();\n\n/**\n * Fire the `oss.runtime.instance_created` telemetry event for a v2 runtime\n * handler. Called once per handler factory invocation (not per request), and\n * sends at most one event per runtime object (see {@link reportedRuntimes}).\n *\n * v2 does not have a concept of remote endpoints or standalone actions, so\n * those counts are 0 / []. `cloud.api_key_provided` is false at this level\n * because in v2 the cloud public key arrives per-request via the\n * `x-copilotcloud-public-api-key` header — not at handler creation time.\n * See `handlers/handle-run.ts` for the per-request event that DOES carry\n * the key when present.\n *\n * `info` replaces those defaults. The v1 integration wrappers pass the v1\n * payload (endpoint types, actions, the cloud key) here, because they build\n * a v2 handler and must not capture the event a second time themselves.\n *\n * Errors resolving agents are swallowed — telemetry must never break\n * runtime setup.\n */\nexport function fireInstanceCreatedTelemetry({\n runtime,\n info,\n}: {\n runtime: CopilotRuntimeLike;\n info?: RuntimeInstanceCreatedInfo;\n}): void {\n if (reportedRuntimes.has(runtime)) return;\n reportedRuntimes.add(runtime);\n\n const runtimeTelemetry = runtime.telemetry ?? telemetry;\n\n if (info !== undefined) {\n void runtimeTelemetry.capture(\"oss.runtime.instance_created\", info);\n return;\n }\n\n // agents can be a static Record, a Promise, or a per-request factory.\n // Factory configs cannot be resolved at handler-creation time (no Request\n // context), so report agentsAmount as null in that case.\n const agentsPromise =\n typeof runtime.agents === \"function\"\n ? Promise.resolve<Record<string, unknown> | null>(null)\n : Promise.resolve(runtime.agents);\n\n agentsPromise\n .then((agents) =>\n runtimeTelemetry.capture(\"oss.runtime.instance_created\", {\n actionsAmount: 0,\n endpointTypes: [],\n endpointsAmount: 0,\n agentsAmount: agents ? Object.keys(agents).length : null,\n \"cloud.api_key_provided\": false,\n }),\n )\n .catch(() => {\n // Swallow — telemetry must not break runtime creation.\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,mCAAmB,IAAI,SAAiB;;;;;;;;;;;;;;;;;;;;AAqB9C,SAAgB,6BAA6B,EAC3C,SACA,QAIO;AACP,KAAI,iBAAiB,IAAI,QAAQ,CAAE;AACnC,kBAAiB,IAAI,QAAQ;CAE7B,MAAM,mBAAmB,QAAQ,aAAa;AAE9C,KAAI,SAAS,QAAW;AACtB,EAAK,iBAAiB,QAAQ,gCAAgC,KAAK;AACnE;;AAWF,EAJE,OAAO,QAAQ,WAAW,aACtB,QAAQ,QAAwC,KAAK,GACrD,QAAQ,QAAQ,QAAQ,OAAO,EAGlC,MAAM,WACL,iBAAiB,QAAQ,gCAAgC;EACvD,eAAe;EACf,eAAe,EAAE;EACjB,iBAAiB;EACjB,cAAc,SAAS,OAAO,KAAK,OAAO,CAAC,SAAS;EACpD,0BAA0B;EAC3B,CAAC,CACH,CACA,YAAY,GAEX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@copilotkit/runtime",
3
- "version": "2.0.0-rc.34",
3
+ "version": "2.0.0-rc.35",
4
4
  "private": false,
5
5
  "keywords": [
6
6
  "ai",
@@ -65,7 +65,7 @@
65
65
  "@ai-sdk/openai": "^3.0.36",
66
66
  "@cfworker/json-schema": "^4.1.1",
67
67
  "@copilotkit/license-verifier": "~0.5.0",
68
- "@copilotkit/shared": "2.0.0-rc.34",
68
+ "@copilotkit/shared": "2.0.0-rc.35",
69
69
  "@modelcontextprotocol/sdk": "^1.29.0",
70
70
  "@remix-run/node-fetch-server": "^0.13.0",
71
71
  "ai": "^6.0.104",