@elevasis/sdk 0.5.14 → 0.5.16

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.d.ts CHANGED
@@ -2436,7 +2436,11 @@ type Database = {
2436
2436
  };
2437
2437
  sessions: {
2438
2438
  Row: {
2439
+ context_window_size: number;
2439
2440
  created_at: string | null;
2441
+ cumulative_input_tokens: number;
2442
+ cumulative_output_tokens: number;
2443
+ deleted_at: string | null;
2440
2444
  ended_at: string | null;
2441
2445
  memory_snapshot: Json;
2442
2446
  metadata: Json | null;
@@ -2448,7 +2452,11 @@ type Database = {
2448
2452
  user_id: string | null;
2449
2453
  };
2450
2454
  Insert: {
2455
+ context_window_size?: number;
2451
2456
  created_at?: string | null;
2457
+ cumulative_input_tokens?: number;
2458
+ cumulative_output_tokens?: number;
2459
+ deleted_at?: string | null;
2452
2460
  ended_at?: string | null;
2453
2461
  memory_snapshot: Json;
2454
2462
  metadata?: Json | null;
@@ -2460,7 +2468,11 @@ type Database = {
2460
2468
  user_id?: string | null;
2461
2469
  };
2462
2470
  Update: {
2471
+ context_window_size?: number;
2463
2472
  created_at?: string | null;
2473
+ cumulative_input_tokens?: number;
2474
+ cumulative_output_tokens?: number;
2475
+ deleted_at?: string | null;
2464
2476
  ended_at?: string | null;
2465
2477
  memory_snapshot?: Json;
2466
2478
  metadata?: Json | null;
@@ -3084,6 +3096,18 @@ declare class ResourceRegistry {
3084
3096
  * @throws Error if incoming deployment contains duplicate resourceIds
3085
3097
  */
3086
3098
  registerOrganization(orgName: string, org: OrganizationResources, remote: RemoteOrgConfig): void;
3099
+ /**
3100
+ * Register built-in platform resources (static, local execution)
3101
+ *
3102
+ * Unlike registerOrganization(), these resources:
3103
+ * - Do NOT have remote config (execute in-process, not in worker threads)
3104
+ * - Are NOT removed by unregisterOrganization() (persist across redeployments)
3105
+ * - Use reserved resource IDs that external deployments cannot claim
3106
+ *
3107
+ * @param orgName - Organization name
3108
+ * @param org - Resource definitions with real handlers (not stubs)
3109
+ */
3110
+ registerStaticResources(orgName: string, org: OrganizationResources): void;
3087
3111
  /**
3088
3112
  * Unregister runtime-registered resources for an organization
3089
3113
  *
package/dist/index.js CHANGED
@@ -142,6 +142,12 @@ var DOMAIN_MAP = {
142
142
  [DOMAINS.DIAGNOSTIC]: DIAGNOSTIC_DOMAIN
143
143
  };
144
144
 
145
+ // ../core/src/platform/registry/reserved.ts
146
+ var RESERVED_RESOURCE_IDS = /* @__PURE__ */ new Set(["command-center-assistant"]);
147
+ function isReservedResourceId(resourceId) {
148
+ return RESERVED_RESOURCE_IDS.has(resourceId);
149
+ }
150
+
145
151
  // ../core/src/execution/engine/base/errors.ts
146
152
  var ExecutionError2 = class extends Error {
147
153
  /**
@@ -3295,6 +3301,13 @@ var ResourceRegistry = class {
3295
3301
  }
3296
3302
  seen.add(id);
3297
3303
  }
3304
+ for (const id of incomingIds) {
3305
+ if (isReservedResourceId(id)) {
3306
+ throw new Error(
3307
+ `Resource ID '${id}' is reserved for platform use. External deployments cannot use reserved resource IDs.`
3308
+ );
3309
+ }
3310
+ }
3298
3311
  if (this.isRemote(orgName)) {
3299
3312
  this.unregisterOrganization(orgName);
3300
3313
  }
@@ -3327,6 +3340,46 @@ var ResourceRegistry = class {
3327
3340
  }
3328
3341
  this.serializedCache.set(orgName, serializeOrganization(this.registry[orgName]));
3329
3342
  }
3343
+ /**
3344
+ * Register built-in platform resources (static, local execution)
3345
+ *
3346
+ * Unlike registerOrganization(), these resources:
3347
+ * - Do NOT have remote config (execute in-process, not in worker threads)
3348
+ * - Are NOT removed by unregisterOrganization() (persist across redeployments)
3349
+ * - Use reserved resource IDs that external deployments cannot claim
3350
+ *
3351
+ * @param orgName - Organization name
3352
+ * @param org - Resource definitions with real handlers (not stubs)
3353
+ */
3354
+ registerStaticResources(orgName, org) {
3355
+ const incomingWorkflowIds = (org.workflows ?? []).map((w) => w.config.resourceId);
3356
+ const incomingAgentIds = (org.agents ?? []).map((a) => a.config.resourceId);
3357
+ const incomingIds = [...incomingWorkflowIds, ...incomingAgentIds];
3358
+ const seen = /* @__PURE__ */ new Set();
3359
+ for (const id of incomingIds) {
3360
+ if (seen.has(id)) {
3361
+ throw new Error(`Duplicate resource ID '${id}' in static resources.`);
3362
+ }
3363
+ seen.add(id);
3364
+ }
3365
+ const existingOrg = this.registry[orgName];
3366
+ if (existingOrg) {
3367
+ const existingWorkflowIds = new Set((existingOrg.workflows ?? []).map((w) => w.config.resourceId));
3368
+ const existingAgentIds = new Set((existingOrg.agents ?? []).map((a) => a.config.resourceId));
3369
+ for (const id of incomingIds) {
3370
+ if (existingWorkflowIds.has(id) || existingAgentIds.has(id)) {
3371
+ throw new Error(`Static resource '${id}' conflicts with existing resource in '${orgName}'.`);
3372
+ }
3373
+ }
3374
+ }
3375
+ if (existingOrg) {
3376
+ existingOrg.workflows = [...existingOrg.workflows ?? [], ...org.workflows ?? []];
3377
+ existingOrg.agents = [...existingOrg.agents ?? [], ...org.agents ?? []];
3378
+ } else {
3379
+ this.registry[orgName] = org;
3380
+ }
3381
+ this.serializedCache.set(orgName, serializeOrganization(this.registry[orgName]));
3382
+ }
3330
3383
  /**
3331
3384
  * Unregister runtime-registered resources for an organization
3332
3385
  *