@lunnoa/client 1.2.0 → 1.4.0

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/react.d.cts CHANGED
@@ -109,6 +109,15 @@ type ChatMode = 'builder' | 'preview';
109
109
  interface StreamMessageOptions {
110
110
  /** Agent chat mode; defaults to the server default (`builder`). */
111
111
  chatMode?: ChatMode;
112
+ /** Optional image attachment forwarded with this turn. */
113
+ data?: {
114
+ imageUrl?: string;
115
+ };
116
+ /**
117
+ * Answer to an ask-before-sending personal-data prompt.
118
+ * Applies to this message only.
119
+ */
120
+ piiResolution?: 'anonymize' | 'fallback';
112
121
  /** Abort the stream (closes the HTTP connection; the run keeps going server-side — call `stop` to cancel it). */
113
122
  signal?: AbortSignal;
114
123
  }
@@ -227,8 +236,6 @@ interface components {
227
236
  SKILLS: boolean;
228
237
  /** @description Whether the hexagonal agent builder canvas UI is enabled. */
229
238
  AGENT_BUILDER_CANVAS: boolean;
230
- /** @description Whether the Solution Designer UI is enabled. */
231
- SOLUTION_DESIGNER: boolean;
232
239
  /** @description Whether isolated code execution for agents is enabled. */
233
240
  CODE_EXECUTION: boolean;
234
241
  /** @description Whether SSO (OIDC) login is enabled. Requires at least one enabled SSO provider. */
@@ -849,9 +856,7 @@ interface components {
849
856
  /** @description Error message to record against the queue item. */
850
857
  error: string;
851
858
  /** @description Additional structured error details, supplied as a JSON string. */
852
- errorDetails?: {
853
- [key: string]: unknown;
854
- };
859
+ errorDetails?: string;
855
860
  };
856
861
  BulkDeleteItemsDto: {
857
862
  /** @description IDs of the queue items to delete. */
@@ -970,7 +975,7 @@ interface components {
970
975
  managedByCode?: boolean;
971
976
  };
972
977
  UpsertObjectTypeBySlugDto: {
973
- /** @description Stable workspace-scoped slug (lowercase, digits, hyphens). Used as the upsert key. */
978
+ /** @description Stable deployment-wide slug (lowercase, digits, hyphens). Used as the upsert key. Granted to the caller workspace when new. */
974
979
  slug: string;
975
980
  /** @description Singular display name. */
976
981
  name?: string;
@@ -1033,7 +1038,7 @@ interface components {
1033
1038
  name: string;
1034
1039
  /** @description Plural display name of the entity type. */
1035
1040
  namePlural: string;
1036
- /** @description URL-safe slug, unique within the workspace. */
1041
+ /** @description URL-safe slug, unique across the deployment. */
1037
1042
  slug: string;
1038
1043
  /** @description Icon identifier for the entity type. */
1039
1044
  icon: string;
@@ -1086,11 +1091,6 @@ interface components {
1086
1091
  attributes?: {
1087
1092
  [key: string]: unknown;
1088
1093
  };
1089
- /**
1090
- * Format: uuid
1091
- * @description Workspace user ID of the entity owner.
1092
- */
1093
- ownerId?: string;
1094
1094
  };
1095
1095
  ObjectTypeSummaryDto: {
1096
1096
  /** @description Entity type ID. */
@@ -1206,8 +1206,6 @@ interface components {
1206
1206
  attributes?: {
1207
1207
  [key: string]: unknown;
1208
1208
  };
1209
- /** @description Workspace user ID of the new entity owner. */
1210
- ownerId?: string;
1211
1209
  };
1212
1210
  ChangeObjectStateDto: {
1213
1211
  /** @description ID of the target state. Must be a valid transition from the current state when the entity type defines transitions. */
@@ -1991,7 +1989,7 @@ interface components {
1991
1989
  approvalStatus?: "pending" | "partially_approved" | "approved" | "rejected" | "expired";
1992
1990
  /** @description Number of approve decisions received so far */
1993
1991
  approvalsReceived?: number;
1994
- /** @description Number of approvals required for quorum / current stage */
1992
+ /** @description How many approvals are required before the workflow continues */
1995
1993
  approvalsRequired?: number;
1996
1994
  };
1997
1995
  PendingInputFieldDto: {
@@ -2369,11 +2367,15 @@ interface components {
2369
2367
  * "imageUrl": "https://example.com/image.png"
2370
2368
  * }
2371
2369
  */
2372
- data?: Record<string, never>;
2373
- /** @description Solution Designer handoff */
2374
- solutionId?: string;
2375
- planStepId?: string;
2376
- delegationId?: string;
2370
+ data?: {
2371
+ /** @description URL of an image attached to the message. */
2372
+ imageUrl?: string;
2373
+ };
2374
+ /**
2375
+ * @description Answer to an ask-before-sending personal-data prompt. Applies to this message only.
2376
+ * @enum {string}
2377
+ */
2378
+ piiResolution?: "anonymize" | "fallback";
2377
2379
  };
2378
2380
  StreamMessageStopDto: {
2379
2381
  /** @description Partial assistant message to persist when stopping a stream */
@@ -2749,7 +2751,7 @@ interface AgentDefinition {
2749
2751
  }
2750
2752
  interface EntityTypeDefinition {
2751
2753
  kind: typeof DEFINE_KINDS.entityType;
2752
- /** Stable workspace-scoped slug (upsert key). */
2754
+ /** Stable deployment-wide slug (upsert key). Granted to the deployer's workspace when new. */
2753
2755
  slug: string;
2754
2756
  name?: string;
2755
2757
  namePlural?: string;
@@ -2969,8 +2971,6 @@ interface ListEntitiesOptions {
2969
2971
  state?: string;
2970
2972
  /** Filter by several states (comma-separated server-side). */
2971
2973
  states?: string[];
2972
- /** Filter by owner workspace-user ID. */
2973
- ownerId?: string;
2974
2974
  /** Free-text search over entity names. */
2975
2975
  search?: string;
2976
2976
  sortBy?: string;
@@ -3002,7 +3002,6 @@ interface ExportEntitiesInput {
3002
3002
  value: unknown;
3003
3003
  }>;
3004
3004
  format?: 'csv' | 'xlsx';
3005
- includeRelatedEntityNames?: boolean;
3006
3005
  }
3007
3006
  /**
3008
3007
  * Entities (the platform calls them Objects internally): the structured data
@@ -3077,7 +3076,7 @@ declare class EntityTypesResource {
3077
3076
  private readonly http;
3078
3077
  constructor(http: HttpClient);
3079
3078
  /**
3080
- * Lists entity types in the workspace. Request
3079
+ * Lists entity types granted to the API key's workspace. Request
3081
3080
  * `expansion: ['attributeSchema', 'stateSchema']` for the field and state
3082
3081
  * machine definitions the codegen CLI builds types from.
3083
3082
  */
@@ -3089,7 +3088,9 @@ declare class EntityTypesResource {
3089
3088
  /** Returns a single entity type by its URL-safe slug. */
3090
3089
  getBySlug(slug: string, options?: EntityTypeReadOptions): Promise<EntityType>;
3091
3090
  /**
3092
- * Creates or updates an entity type by workspace-scoped slug.
3091
+ * Creates or updates an entity type by deployment-wide slug.
3092
+ * A new slug is granted to the API key's workspace. A slug already shared
3093
+ * with another workspace is rejected unless the key belongs to a platform admin.
3093
3094
  * Prefer the CLI (`npx @lunnoa/client entity-types deploy`) for happy-path deploy.
3094
3095
  */
3095
3096
  upsertBySlug(definition: EntityTypeDefinition | UpsertEntityTypeBySlugInput): Promise<EntityType>;
@@ -3108,7 +3109,6 @@ type ApprovalInboxItem = {
3108
3109
  status: string;
3109
3110
  requiredCount: number;
3110
3111
  receivedApprovals: number;
3111
- currentStageIndex?: number;
3112
3112
  expiresAt?: string;
3113
3113
  createdAt?: string;
3114
3114
  updatedAt?: string;
@@ -3127,7 +3127,7 @@ type ApprovalInboxItem = {
3127
3127
  comment?: string;
3128
3128
  decidedAt?: string;
3129
3129
  };
3130
- /** People who can still decide (current stage; emails resolved). */
3130
+ /** People who can still decide. */
3131
3131
  eligibleApprovers?: EligibleApprover[];
3132
3132
  approval?: Record<string, unknown>;
3133
3133
  };
@@ -3196,6 +3196,16 @@ declare class ProjectsResource {
3196
3196
  create(data: CreateProjectInput): Promise<Project>;
3197
3197
  }
3198
3198
 
3199
+ type QueueItemStatus = 'PENDING' | 'PROCESSING' | 'SUCCESS' | 'FAILED' | 'RETRYING';
3200
+ interface AddQueueItemErrorInput {
3201
+ /** Error message recorded on the item. */
3202
+ error: string;
3203
+ /**
3204
+ * Extra details. An object is sent as a JSON string, which is what the
3205
+ * server validates.
3206
+ */
3207
+ errorDetails?: string | Record<string, unknown>;
3208
+ }
3199
3209
  interface ListQueueItemsOptions {
3200
3210
  limit?: number;
3201
3211
  offset?: number;
@@ -3241,12 +3251,18 @@ declare class QueueItemsResource {
3241
3251
  }): Promise<QueueItem[]>;
3242
3252
  /** Returns items eligible for retry. */
3243
3253
  listRetryable(queueId: string): Promise<QueueItem[]>;
3244
- /** Returns items with the given status. */
3245
- listByStatus(queueId: string, status: string): Promise<QueueItem[]>;
3254
+ /** Returns a page of items with the given status. */
3255
+ listByStatus(queueId: string, status: QueueItemStatus, options?: {
3256
+ limit?: number;
3257
+ offset?: number;
3258
+ }): Promise<QueueItemList>;
3246
3259
  /** Looks an item up by the external ID your system supplied. */
3247
3260
  getByExternalId(queueId: string, externalId: string): Promise<QueueItemFull>;
3248
- /** Searches items in the queue. */
3249
- search(queueId: string, query: string): Promise<QueueItem[]>;
3261
+ /**
3262
+ * Searches items by external id, item data, and metadata.
3263
+ * Returns one page, same shape as `list`.
3264
+ */
3265
+ search(queueId: string, query: string, options?: Omit<ListQueueItemsOptions, 'filterBy'>): Promise<QueueItemList>;
3250
3266
  /** Returns per-status and per-priority counts for the queue. */
3251
3267
  stats(queueId: string): Promise<QueueItemStats>;
3252
3268
  /** Returns the recorded processing errors of an item. */
@@ -3258,10 +3274,7 @@ declare class QueueItemsResource {
3258
3274
  /** Queues the item for another processing attempt. */
3259
3275
  retry(queueId: string, itemId: string): Promise<QueueItem>;
3260
3276
  /** Records a processing error on the item. */
3261
- addError(queueId: string, itemId: string, error: {
3262
- message: string;
3263
- [key: string]: unknown;
3264
- }): Promise<QueueItem>;
3277
+ addError(queueId: string, itemId: string, error: AddQueueItemErrorInput): Promise<QueueItem>;
3265
3278
  }
3266
3279
 
3267
3280
  declare class QueuesResource {
@@ -3318,6 +3331,91 @@ declare class RunsResource {
3318
3331
  startAndWait(input: StartRunInput, waitOptions?: WaitUntilFinishedOptions): Promise<Execution>;
3319
3332
  }
3320
3333
 
3334
+ type ScorecardMeasureStatus = 'ON_TRACK' | 'AT_RISK' | 'OFF_TRACK' | 'NO_DATA';
3335
+ type ScorecardSummary = {
3336
+ id: string;
3337
+ name: string;
3338
+ periodLabel: string | null;
3339
+ description: string | null;
3340
+ FK_ownerId: string | null;
3341
+ createdAt: string;
3342
+ _count: {
3343
+ objectives: number;
3344
+ };
3345
+ };
3346
+ type ScorecardMeasure = {
3347
+ id: string;
3348
+ name: string;
3349
+ unit: string;
3350
+ currency: string | null;
3351
+ direction: 'HIGHER_IS_BETTER' | 'LOWER_IS_BETTER';
3352
+ kind: 'LEADING' | 'LAGGING';
3353
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY';
3354
+ sourceType: 'MANUAL' | 'API' | 'WORKFLOW' | 'BUILT_IN';
3355
+ builtInKey: string | null;
3356
+ target: number;
3357
+ atRiskThreshold: number | null;
3358
+ latest: {
3359
+ value: number;
3360
+ periodStart: string;
3361
+ createdAt: string;
3362
+ } | null;
3363
+ previousValue: number | null;
3364
+ series: {
3365
+ periodStart: string;
3366
+ value: number;
3367
+ }[];
3368
+ status: ScorecardMeasureStatus;
3369
+ stale: boolean;
3370
+ };
3371
+ type ScorecardObjective = {
3372
+ id: string;
3373
+ perspective: 'FINANCIAL' | 'CUSTOMER' | 'PROCESS' | 'LEARNING';
3374
+ name: string;
3375
+ description: string | null;
3376
+ ownerLabel: string | null;
3377
+ drivesIds: string[];
3378
+ position: number;
3379
+ status: ScorecardMeasureStatus;
3380
+ measures: ScorecardMeasure[];
3381
+ };
3382
+ type Scorecard = Omit<ScorecardSummary, '_count'> & {
3383
+ aiSpendUsdThisMonth: number;
3384
+ objectives: ScorecardObjective[];
3385
+ };
3386
+ type ScorecardMeasureValue = {
3387
+ id: string;
3388
+ FK_measureId: string;
3389
+ periodStart: string;
3390
+ value: number;
3391
+ note: string | null;
3392
+ sourceType: ScorecardMeasure['sourceType'];
3393
+ supersededAt: string | null;
3394
+ createdAt: string;
3395
+ };
3396
+ type RecordMeasureValueInput = {
3397
+ value: number;
3398
+ /** Any ISO date inside the target period; defaults to the current period. */
3399
+ period?: string;
3400
+ note?: string;
3401
+ };
3402
+ /**
3403
+ * Balanced Scorecard (workspace API). Pushing values needs `scorecard:record`.
3404
+ */
3405
+ declare class ScorecardsResource {
3406
+ private readonly http;
3407
+ constructor(http: HttpClient);
3408
+ /** Lists scorecards in the workspace. */
3409
+ list(): Promise<ScorecardSummary[]>;
3410
+ /** Returns a scorecard with objectives, measures, latest values and status. */
3411
+ get(scorecardId: string): Promise<Scorecard>;
3412
+ /**
3413
+ * Records a measure value. A value for the same period replaces the current
3414
+ * one; the old value is kept as superseded history.
3415
+ */
3416
+ recordValue(measureId: string, data: RecordMeasureValueInput): Promise<ScorecardMeasureValue>;
3417
+ }
3418
+
3321
3419
  declare class TasksResource {
3322
3420
  private readonly http;
3323
3421
  constructor(http: HttpClient);
@@ -3337,9 +3435,7 @@ declare class TasksResource {
3337
3435
  * messages in AI SDK UIMessage format. For token-by-token output use
3338
3436
  * `client.agentChat.streamMessage` instead.
3339
3437
  */
3340
- message(agentId: string, taskId: string, message: string | UIMessage, options?: {
3341
- chatMode?: ChatMode;
3342
- }): Promise<string | UIMessage[]>;
3438
+ message(agentId: string, taskId: string, message: string | UIMessage, options?: Omit<StreamMessageOptions, 'signal'>): Promise<string | UIMessage[]>;
3343
3439
  }
3344
3440
 
3345
3441
  declare class VariablesResource {
@@ -3455,6 +3551,7 @@ declare class LunnoaClient {
3455
3551
  readonly queues: QueuesResource;
3456
3552
  readonly queueItems: QueueItemsResource;
3457
3553
  readonly variables: VariablesResource;
3554
+ readonly scorecards: ScorecardsResource;
3458
3555
  readonly connections: ConnectionsResource;
3459
3556
  readonly projects: ProjectsResource;
3460
3557
  readonly workflowApps: WorkflowAppsResource;
package/dist/react.d.ts CHANGED
@@ -109,6 +109,15 @@ type ChatMode = 'builder' | 'preview';
109
109
  interface StreamMessageOptions {
110
110
  /** Agent chat mode; defaults to the server default (`builder`). */
111
111
  chatMode?: ChatMode;
112
+ /** Optional image attachment forwarded with this turn. */
113
+ data?: {
114
+ imageUrl?: string;
115
+ };
116
+ /**
117
+ * Answer to an ask-before-sending personal-data prompt.
118
+ * Applies to this message only.
119
+ */
120
+ piiResolution?: 'anonymize' | 'fallback';
112
121
  /** Abort the stream (closes the HTTP connection; the run keeps going server-side — call `stop` to cancel it). */
113
122
  signal?: AbortSignal;
114
123
  }
@@ -227,8 +236,6 @@ interface components {
227
236
  SKILLS: boolean;
228
237
  /** @description Whether the hexagonal agent builder canvas UI is enabled. */
229
238
  AGENT_BUILDER_CANVAS: boolean;
230
- /** @description Whether the Solution Designer UI is enabled. */
231
- SOLUTION_DESIGNER: boolean;
232
239
  /** @description Whether isolated code execution for agents is enabled. */
233
240
  CODE_EXECUTION: boolean;
234
241
  /** @description Whether SSO (OIDC) login is enabled. Requires at least one enabled SSO provider. */
@@ -849,9 +856,7 @@ interface components {
849
856
  /** @description Error message to record against the queue item. */
850
857
  error: string;
851
858
  /** @description Additional structured error details, supplied as a JSON string. */
852
- errorDetails?: {
853
- [key: string]: unknown;
854
- };
859
+ errorDetails?: string;
855
860
  };
856
861
  BulkDeleteItemsDto: {
857
862
  /** @description IDs of the queue items to delete. */
@@ -970,7 +975,7 @@ interface components {
970
975
  managedByCode?: boolean;
971
976
  };
972
977
  UpsertObjectTypeBySlugDto: {
973
- /** @description Stable workspace-scoped slug (lowercase, digits, hyphens). Used as the upsert key. */
978
+ /** @description Stable deployment-wide slug (lowercase, digits, hyphens). Used as the upsert key. Granted to the caller workspace when new. */
974
979
  slug: string;
975
980
  /** @description Singular display name. */
976
981
  name?: string;
@@ -1033,7 +1038,7 @@ interface components {
1033
1038
  name: string;
1034
1039
  /** @description Plural display name of the entity type. */
1035
1040
  namePlural: string;
1036
- /** @description URL-safe slug, unique within the workspace. */
1041
+ /** @description URL-safe slug, unique across the deployment. */
1037
1042
  slug: string;
1038
1043
  /** @description Icon identifier for the entity type. */
1039
1044
  icon: string;
@@ -1086,11 +1091,6 @@ interface components {
1086
1091
  attributes?: {
1087
1092
  [key: string]: unknown;
1088
1093
  };
1089
- /**
1090
- * Format: uuid
1091
- * @description Workspace user ID of the entity owner.
1092
- */
1093
- ownerId?: string;
1094
1094
  };
1095
1095
  ObjectTypeSummaryDto: {
1096
1096
  /** @description Entity type ID. */
@@ -1206,8 +1206,6 @@ interface components {
1206
1206
  attributes?: {
1207
1207
  [key: string]: unknown;
1208
1208
  };
1209
- /** @description Workspace user ID of the new entity owner. */
1210
- ownerId?: string;
1211
1209
  };
1212
1210
  ChangeObjectStateDto: {
1213
1211
  /** @description ID of the target state. Must be a valid transition from the current state when the entity type defines transitions. */
@@ -1991,7 +1989,7 @@ interface components {
1991
1989
  approvalStatus?: "pending" | "partially_approved" | "approved" | "rejected" | "expired";
1992
1990
  /** @description Number of approve decisions received so far */
1993
1991
  approvalsReceived?: number;
1994
- /** @description Number of approvals required for quorum / current stage */
1992
+ /** @description How many approvals are required before the workflow continues */
1995
1993
  approvalsRequired?: number;
1996
1994
  };
1997
1995
  PendingInputFieldDto: {
@@ -2369,11 +2367,15 @@ interface components {
2369
2367
  * "imageUrl": "https://example.com/image.png"
2370
2368
  * }
2371
2369
  */
2372
- data?: Record<string, never>;
2373
- /** @description Solution Designer handoff */
2374
- solutionId?: string;
2375
- planStepId?: string;
2376
- delegationId?: string;
2370
+ data?: {
2371
+ /** @description URL of an image attached to the message. */
2372
+ imageUrl?: string;
2373
+ };
2374
+ /**
2375
+ * @description Answer to an ask-before-sending personal-data prompt. Applies to this message only.
2376
+ * @enum {string}
2377
+ */
2378
+ piiResolution?: "anonymize" | "fallback";
2377
2379
  };
2378
2380
  StreamMessageStopDto: {
2379
2381
  /** @description Partial assistant message to persist when stopping a stream */
@@ -2749,7 +2751,7 @@ interface AgentDefinition {
2749
2751
  }
2750
2752
  interface EntityTypeDefinition {
2751
2753
  kind: typeof DEFINE_KINDS.entityType;
2752
- /** Stable workspace-scoped slug (upsert key). */
2754
+ /** Stable deployment-wide slug (upsert key). Granted to the deployer's workspace when new. */
2753
2755
  slug: string;
2754
2756
  name?: string;
2755
2757
  namePlural?: string;
@@ -2969,8 +2971,6 @@ interface ListEntitiesOptions {
2969
2971
  state?: string;
2970
2972
  /** Filter by several states (comma-separated server-side). */
2971
2973
  states?: string[];
2972
- /** Filter by owner workspace-user ID. */
2973
- ownerId?: string;
2974
2974
  /** Free-text search over entity names. */
2975
2975
  search?: string;
2976
2976
  sortBy?: string;
@@ -3002,7 +3002,6 @@ interface ExportEntitiesInput {
3002
3002
  value: unknown;
3003
3003
  }>;
3004
3004
  format?: 'csv' | 'xlsx';
3005
- includeRelatedEntityNames?: boolean;
3006
3005
  }
3007
3006
  /**
3008
3007
  * Entities (the platform calls them Objects internally): the structured data
@@ -3077,7 +3076,7 @@ declare class EntityTypesResource {
3077
3076
  private readonly http;
3078
3077
  constructor(http: HttpClient);
3079
3078
  /**
3080
- * Lists entity types in the workspace. Request
3079
+ * Lists entity types granted to the API key's workspace. Request
3081
3080
  * `expansion: ['attributeSchema', 'stateSchema']` for the field and state
3082
3081
  * machine definitions the codegen CLI builds types from.
3083
3082
  */
@@ -3089,7 +3088,9 @@ declare class EntityTypesResource {
3089
3088
  /** Returns a single entity type by its URL-safe slug. */
3090
3089
  getBySlug(slug: string, options?: EntityTypeReadOptions): Promise<EntityType>;
3091
3090
  /**
3092
- * Creates or updates an entity type by workspace-scoped slug.
3091
+ * Creates or updates an entity type by deployment-wide slug.
3092
+ * A new slug is granted to the API key's workspace. A slug already shared
3093
+ * with another workspace is rejected unless the key belongs to a platform admin.
3093
3094
  * Prefer the CLI (`npx @lunnoa/client entity-types deploy`) for happy-path deploy.
3094
3095
  */
3095
3096
  upsertBySlug(definition: EntityTypeDefinition | UpsertEntityTypeBySlugInput): Promise<EntityType>;
@@ -3108,7 +3109,6 @@ type ApprovalInboxItem = {
3108
3109
  status: string;
3109
3110
  requiredCount: number;
3110
3111
  receivedApprovals: number;
3111
- currentStageIndex?: number;
3112
3112
  expiresAt?: string;
3113
3113
  createdAt?: string;
3114
3114
  updatedAt?: string;
@@ -3127,7 +3127,7 @@ type ApprovalInboxItem = {
3127
3127
  comment?: string;
3128
3128
  decidedAt?: string;
3129
3129
  };
3130
- /** People who can still decide (current stage; emails resolved). */
3130
+ /** People who can still decide. */
3131
3131
  eligibleApprovers?: EligibleApprover[];
3132
3132
  approval?: Record<string, unknown>;
3133
3133
  };
@@ -3196,6 +3196,16 @@ declare class ProjectsResource {
3196
3196
  create(data: CreateProjectInput): Promise<Project>;
3197
3197
  }
3198
3198
 
3199
+ type QueueItemStatus = 'PENDING' | 'PROCESSING' | 'SUCCESS' | 'FAILED' | 'RETRYING';
3200
+ interface AddQueueItemErrorInput {
3201
+ /** Error message recorded on the item. */
3202
+ error: string;
3203
+ /**
3204
+ * Extra details. An object is sent as a JSON string, which is what the
3205
+ * server validates.
3206
+ */
3207
+ errorDetails?: string | Record<string, unknown>;
3208
+ }
3199
3209
  interface ListQueueItemsOptions {
3200
3210
  limit?: number;
3201
3211
  offset?: number;
@@ -3241,12 +3251,18 @@ declare class QueueItemsResource {
3241
3251
  }): Promise<QueueItem[]>;
3242
3252
  /** Returns items eligible for retry. */
3243
3253
  listRetryable(queueId: string): Promise<QueueItem[]>;
3244
- /** Returns items with the given status. */
3245
- listByStatus(queueId: string, status: string): Promise<QueueItem[]>;
3254
+ /** Returns a page of items with the given status. */
3255
+ listByStatus(queueId: string, status: QueueItemStatus, options?: {
3256
+ limit?: number;
3257
+ offset?: number;
3258
+ }): Promise<QueueItemList>;
3246
3259
  /** Looks an item up by the external ID your system supplied. */
3247
3260
  getByExternalId(queueId: string, externalId: string): Promise<QueueItemFull>;
3248
- /** Searches items in the queue. */
3249
- search(queueId: string, query: string): Promise<QueueItem[]>;
3261
+ /**
3262
+ * Searches items by external id, item data, and metadata.
3263
+ * Returns one page, same shape as `list`.
3264
+ */
3265
+ search(queueId: string, query: string, options?: Omit<ListQueueItemsOptions, 'filterBy'>): Promise<QueueItemList>;
3250
3266
  /** Returns per-status and per-priority counts for the queue. */
3251
3267
  stats(queueId: string): Promise<QueueItemStats>;
3252
3268
  /** Returns the recorded processing errors of an item. */
@@ -3258,10 +3274,7 @@ declare class QueueItemsResource {
3258
3274
  /** Queues the item for another processing attempt. */
3259
3275
  retry(queueId: string, itemId: string): Promise<QueueItem>;
3260
3276
  /** Records a processing error on the item. */
3261
- addError(queueId: string, itemId: string, error: {
3262
- message: string;
3263
- [key: string]: unknown;
3264
- }): Promise<QueueItem>;
3277
+ addError(queueId: string, itemId: string, error: AddQueueItemErrorInput): Promise<QueueItem>;
3265
3278
  }
3266
3279
 
3267
3280
  declare class QueuesResource {
@@ -3318,6 +3331,91 @@ declare class RunsResource {
3318
3331
  startAndWait(input: StartRunInput, waitOptions?: WaitUntilFinishedOptions): Promise<Execution>;
3319
3332
  }
3320
3333
 
3334
+ type ScorecardMeasureStatus = 'ON_TRACK' | 'AT_RISK' | 'OFF_TRACK' | 'NO_DATA';
3335
+ type ScorecardSummary = {
3336
+ id: string;
3337
+ name: string;
3338
+ periodLabel: string | null;
3339
+ description: string | null;
3340
+ FK_ownerId: string | null;
3341
+ createdAt: string;
3342
+ _count: {
3343
+ objectives: number;
3344
+ };
3345
+ };
3346
+ type ScorecardMeasure = {
3347
+ id: string;
3348
+ name: string;
3349
+ unit: string;
3350
+ currency: string | null;
3351
+ direction: 'HIGHER_IS_BETTER' | 'LOWER_IS_BETTER';
3352
+ kind: 'LEADING' | 'LAGGING';
3353
+ cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY';
3354
+ sourceType: 'MANUAL' | 'API' | 'WORKFLOW' | 'BUILT_IN';
3355
+ builtInKey: string | null;
3356
+ target: number;
3357
+ atRiskThreshold: number | null;
3358
+ latest: {
3359
+ value: number;
3360
+ periodStart: string;
3361
+ createdAt: string;
3362
+ } | null;
3363
+ previousValue: number | null;
3364
+ series: {
3365
+ periodStart: string;
3366
+ value: number;
3367
+ }[];
3368
+ status: ScorecardMeasureStatus;
3369
+ stale: boolean;
3370
+ };
3371
+ type ScorecardObjective = {
3372
+ id: string;
3373
+ perspective: 'FINANCIAL' | 'CUSTOMER' | 'PROCESS' | 'LEARNING';
3374
+ name: string;
3375
+ description: string | null;
3376
+ ownerLabel: string | null;
3377
+ drivesIds: string[];
3378
+ position: number;
3379
+ status: ScorecardMeasureStatus;
3380
+ measures: ScorecardMeasure[];
3381
+ };
3382
+ type Scorecard = Omit<ScorecardSummary, '_count'> & {
3383
+ aiSpendUsdThisMonth: number;
3384
+ objectives: ScorecardObjective[];
3385
+ };
3386
+ type ScorecardMeasureValue = {
3387
+ id: string;
3388
+ FK_measureId: string;
3389
+ periodStart: string;
3390
+ value: number;
3391
+ note: string | null;
3392
+ sourceType: ScorecardMeasure['sourceType'];
3393
+ supersededAt: string | null;
3394
+ createdAt: string;
3395
+ };
3396
+ type RecordMeasureValueInput = {
3397
+ value: number;
3398
+ /** Any ISO date inside the target period; defaults to the current period. */
3399
+ period?: string;
3400
+ note?: string;
3401
+ };
3402
+ /**
3403
+ * Balanced Scorecard (workspace API). Pushing values needs `scorecard:record`.
3404
+ */
3405
+ declare class ScorecardsResource {
3406
+ private readonly http;
3407
+ constructor(http: HttpClient);
3408
+ /** Lists scorecards in the workspace. */
3409
+ list(): Promise<ScorecardSummary[]>;
3410
+ /** Returns a scorecard with objectives, measures, latest values and status. */
3411
+ get(scorecardId: string): Promise<Scorecard>;
3412
+ /**
3413
+ * Records a measure value. A value for the same period replaces the current
3414
+ * one; the old value is kept as superseded history.
3415
+ */
3416
+ recordValue(measureId: string, data: RecordMeasureValueInput): Promise<ScorecardMeasureValue>;
3417
+ }
3418
+
3321
3419
  declare class TasksResource {
3322
3420
  private readonly http;
3323
3421
  constructor(http: HttpClient);
@@ -3337,9 +3435,7 @@ declare class TasksResource {
3337
3435
  * messages in AI SDK UIMessage format. For token-by-token output use
3338
3436
  * `client.agentChat.streamMessage` instead.
3339
3437
  */
3340
- message(agentId: string, taskId: string, message: string | UIMessage, options?: {
3341
- chatMode?: ChatMode;
3342
- }): Promise<string | UIMessage[]>;
3438
+ message(agentId: string, taskId: string, message: string | UIMessage, options?: Omit<StreamMessageOptions, 'signal'>): Promise<string | UIMessage[]>;
3343
3439
  }
3344
3440
 
3345
3441
  declare class VariablesResource {
@@ -3455,6 +3551,7 @@ declare class LunnoaClient {
3455
3551
  readonly queues: QueuesResource;
3456
3552
  readonly queueItems: QueueItemsResource;
3457
3553
  readonly variables: VariablesResource;
3554
+ readonly scorecards: ScorecardsResource;
3458
3555
  readonly connections: ConnectionsResource;
3459
3556
  readonly projects: ProjectsResource;
3460
3557
  readonly workflowApps: WorkflowAppsResource;