@copilotkit/core 2.0.0-rc.47 → 2.0.0-rc.48

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,4 +1,4 @@
1
- import { r as OpenThreadRegistration } from "./learning-bridge-jOC46U9n.cjs";
1
+ import { r as OpenThreadRegistration } from "./learning-bridge-wVcSJ_Kp.cjs";
2
2
 
3
3
  //#region src/chat/chat-configuration.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { r as OpenThreadRegistration } from "./learning-bridge-DbE4J5tK.mjs";
1
+ import { r as OpenThreadRegistration } from "./learning-bridge-CvCMCZoR.mjs";
2
2
 
3
3
  //#region src/chat/chat-configuration.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Su as ɵGenerativeUIDebugSource, Vo as A2UIMarkdownOperation, a as CopilotKitCore, bu as ɵGenerativeUIDebugRun, es as MarkdownSegment } from "../learning-bridge-jOC46U9n.cjs";
1
+ import { Su as ɵGenerativeUIDebugSource, Vo as A2UIMarkdownOperation, a as CopilotKitCore, bu as ɵGenerativeUIDebugRun, es as MarkdownSegment } from "../learning-bridge-wVcSJ_Kp.cjs";
2
2
  import "../index.cjs";
3
3
  import { AbstractAgent, Message } from "@ag-ui/client";
4
4
  import { A2UIActionMessage, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, CopilotKitUIEnvelope, GenerativeUIActionBinding, GenerativeUIFunctionManifest, GenerativeUIManifest, GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUIUserEvent, StandardSchemaV1, ValidateOperationOptions } from "@copilotkit/shared";
@@ -1,4 +1,4 @@
1
- import { Su as ɵGenerativeUIDebugSource, Vo as A2UIMarkdownOperation, a as CopilotKitCore, bu as ɵGenerativeUIDebugRun, es as MarkdownSegment } from "../learning-bridge-DbE4J5tK.mjs";
1
+ import { Su as ɵGenerativeUIDebugSource, Vo as A2UIMarkdownOperation, a as CopilotKitCore, bu as ɵGenerativeUIDebugRun, es as MarkdownSegment } from "../learning-bridge-CvCMCZoR.mjs";
2
2
  import "../index.mjs";
3
3
  import { AbstractAgent, Message } from "@ag-ui/client";
4
4
  import { A2UIActionMessage, A2UIFunctionPermissions, A2UIFunctionReturnType, A2UIOperation, CopilotKitUIEnvelope, GenerativeUIActionBinding, GenerativeUIFunctionManifest, GenerativeUIManifest, GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUISurfaceStatus, GenerativeUISurfaceSummary, GenerativeUITarget, GenerativeUIUserEvent, StandardSchemaV1, ValidateOperationOptions } from "@copilotkit/shared";
package/dist/index.cjs CHANGED
@@ -16067,19 +16067,29 @@ function resolveLicenseBannerType(warningStatus, publicKey) {
16067
16067
  * status is `valid` or `expiring` and `checkFeature("threads")` is `true`.
16068
16068
  * - `licensePending` is `true` while the status is `null` (the runtime has
16069
16069
  * not reported yet). Show the loading state then, not the locked view.
16070
+ * - A connected runtime that reports no license status and no entitlements
16071
+ * (a runtime without Intelligence) never will, so its `null` status is
16072
+ * not pending: it counts as `unknown` and the threads endpoint decides.
16070
16073
  *
16071
16074
  * @param context - The license context from {@link ɵresolveLicenseState}.
16075
+ * @param runtime - Core's runtime info snapshot (`core.ɵruntimeInfo`), or
16076
+ * `undefined` when there is no core.
16072
16077
  *
16073
16078
  * @example
16074
16079
  * ```ts
16075
- * const { licensed, licensePending } = ɵresolveThreadsLicense(context);
16080
+ * const { licensed, licensePending } = ɵresolveThreadsLicense(
16081
+ * context,
16082
+ * core.ɵruntimeInfo,
16083
+ * );
16076
16084
  * ```
16077
16085
  */
16078
- function ɵresolveThreadsLicense(context) {
16086
+ function ɵresolveThreadsLicense(context, runtime) {
16079
16087
  const { status } = context;
16088
+ const isLicensePresent = status === "valid" || status === "expiring";
16089
+ const hasNoLicenseAuthority = runtime?.status === CopilotKitCoreRuntimeConnectionStatus.Connected && runtime.licenseStatus === void 0 && runtime.runtimeEntitlements === void 0;
16080
16090
  return {
16081
- licensed: status === "unknown" || (status === "valid" || status === "expiring") && context.checkFeature("threads"),
16082
- licensePending: status === null
16091
+ licensed: status === "unknown" || status === null && hasNoLicenseAuthority || isLicensePresent && context.checkFeature("threads"),
16092
+ licensePending: status === null && !hasNoLicenseAuthority
16083
16093
  };
16084
16094
  }
16085
16095
  const PRICING_URL = "https://copilotkit.ai/pricing";
@@ -18238,6 +18248,7 @@ function ɵprojectThread({ id, agentId, name, archived, createdAt, updatedAt, la
18238
18248
  }
18239
18249
  const RUNTIME_URL_MISSING = "Runtime URL is not configured";
18240
18250
  const THREAD_ENDPOINTS_UNAVAILABLE = "Thread endpoints are not available on this CopilotKit runtime";
18251
+ const THREAD_LIST_NEEDS_IDENTITY = "Listing threads needs a caller identity. Set identifyUser on CopilotRuntime.";
18241
18252
  const THREAD_MUTATIONS_UNAVAILABLE = "Thread mutations are not available on this CopilotKit runtime";
18242
18253
  function isSameThreadsSnapshot(a, b) {
18243
18254
  return a.threads === b.threads && a.isLoading === b.isLoading && a.error === b.error && a.listError === b.listError && a.fetchMoreError === b.fetchMoreError && a.hasMoreThreads === b.hasMoreThreads && a.isFetchingMoreThreads === b.isFetchingMoreThreads && a.isMutating === b.isMutating;
@@ -18271,6 +18282,7 @@ var ɵThreadsController = class {
18271
18282
  #configErrorDismissed = false;
18272
18283
  #runtimeError = null;
18273
18284
  #endpointsError = null;
18285
+ #listAccessError = null;
18274
18286
  #mutationsError = null;
18275
18287
  #storeThreads = null;
18276
18288
  #threads = [];
@@ -18355,6 +18367,15 @@ var ɵThreadsController = class {
18355
18367
  get #endpointsUnavailable() {
18356
18368
  return !!this.#runtimeUrl && this.#isConnected && !this.#listSupported;
18357
18369
  }
18370
+ /**
18371
+ * The runtime refuses to list threads because the caller has no identity:
18372
+ * it reads a thread by id but does not list. Only the runtime's anonymous
18373
+ * thread access policy (no `identifyUser`, default `owner` access) reports
18374
+ * that pair; a runtime without thread endpoints reports neither.
18375
+ */
18376
+ get #listNeedsIdentity() {
18377
+ return this.#endpointsUnavailable && this.#core.ɵruntimeInfo.threadEndpoints?.inspect === true;
18378
+ }
18358
18379
  #guard(mutation) {
18359
18380
  if (this.#mutationsError) return Promise.reject(this.#mutationsError);
18360
18381
  return mutation();
@@ -18412,11 +18433,13 @@ var ɵThreadsController = class {
18412
18433
  }
18413
18434
  #syncConfigErrors() {
18414
18435
  const hasRuntimeError = !this.#runtimeUrl;
18415
- const hasEndpointsError = this.#endpointsUnavailable;
18436
+ const listNeedsIdentity = this.#listNeedsIdentity;
18437
+ const hasEndpointsError = this.#endpointsUnavailable && !listNeedsIdentity;
18416
18438
  const runtimeChanged = hasRuntimeError !== (this.#runtimeError !== null);
18417
18439
  const endpointsChanged = hasEndpointsError !== (this.#endpointsError !== null);
18418
18440
  if (runtimeChanged) this.#runtimeError = hasRuntimeError ? new Error(RUNTIME_URL_MISSING) : null;
18419
18441
  if (endpointsChanged) this.#endpointsError = hasEndpointsError ? new Error(THREAD_ENDPOINTS_UNAVAILABLE) : null;
18442
+ if (listNeedsIdentity !== (this.#listAccessError !== null)) this.#listAccessError = listNeedsIdentity ? new Error(THREAD_LIST_NEEDS_IDENTITY) : null;
18420
18443
  if (runtimeChanged || endpointsChanged) this.#configErrorDismissed = false;
18421
18444
  if (this.#core.ɵruntimeInfo.threadEndpoints?.mutations !== false) this.#mutationsError = null;
18422
18445
  else this.#mutationsError ??= new Error(THREAD_MUTATIONS_UNAVAILABLE);
@@ -18432,7 +18455,7 @@ var ɵThreadsController = class {
18432
18455
  const endpointsError = this.#configErrorDismissed ? null : this.#endpointsError;
18433
18456
  const configError = runtimeError ?? endpointsError;
18434
18457
  const preConnectLoading = this.#input.enabled && !!this.#runtimeUrl && !this.#endpointsUnavailable && !this.#hasDispatchedContext;
18435
- const listError = selectors.error(state);
18458
+ const listError = this.#listAccessError ?? selectors.error(state);
18436
18459
  return {
18437
18460
  threads: this.#threads,
18438
18461
  isLoading: configError ? false : preConnectLoading || selectors.isLoading(state),