@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/README.md +6 -2
- package/dist/cli.js +123 -35
- package/dist/index.cjs +75 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +141 -48
- package/dist/index.d.ts +141 -48
- package/dist/index.js +75 -23
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +74 -24
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +136 -39
- package/dist/react.d.ts +136 -39
- package/dist/react.js +74 -24
- package/dist/react.js.map +1 -1
- package/package.json +2 -1
- package/skills/lunnoa-client/SKILL.md +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -131,6 +131,15 @@ type ChatMode = 'builder' | 'preview';
|
|
|
131
131
|
interface StreamMessageOptions {
|
|
132
132
|
/** Agent chat mode; defaults to the server default (`builder`). */
|
|
133
133
|
chatMode?: ChatMode;
|
|
134
|
+
/** Optional image attachment forwarded with this turn. */
|
|
135
|
+
data?: {
|
|
136
|
+
imageUrl?: string;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Answer to an ask-before-sending personal-data prompt.
|
|
140
|
+
* Applies to this message only.
|
|
141
|
+
*/
|
|
142
|
+
piiResolution?: 'anonymize' | 'fallback';
|
|
134
143
|
/** Abort the stream (closes the HTTP connection; the run keeps going server-side — call `stop` to cancel it). */
|
|
135
144
|
signal?: AbortSignal;
|
|
136
145
|
}
|
|
@@ -806,8 +815,8 @@ interface paths {
|
|
|
806
815
|
get?: never;
|
|
807
816
|
put?: never;
|
|
808
817
|
/**
|
|
809
|
-
* Upsert entity type by
|
|
810
|
-
* @description Creates or updates an entity type identified by
|
|
818
|
+
* Upsert entity type by deployment-wide slug
|
|
819
|
+
* @description Creates or updates an entity type identified by deployment-wide `slug`. A new slug is granted to the caller workspace. A type already granted to other workspaces is not rewritten unless the caller is a platform admin. Marks `managedByCode` by default. Prefer the CLI (`npx @lunnoa/client entity-types deploy`). Unknown instance attributes are rejected unless `allowUnknownAttributes` is true; reserved key `extensions` is always allowed.
|
|
811
820
|
*/
|
|
812
821
|
post: operations["ObjectTypesController_upsertBySlug"];
|
|
813
822
|
delete?: never;
|
|
@@ -859,7 +868,7 @@ interface paths {
|
|
|
859
868
|
};
|
|
860
869
|
/**
|
|
861
870
|
* Get all entities for workspace with filtering
|
|
862
|
-
* @description Returns a paginated list of entities in the workspace, optionally filtered by type, state,
|
|
871
|
+
* @description Returns a paginated list of entities in the workspace, optionally filtered by type, state, or a name search.
|
|
863
872
|
*/
|
|
864
873
|
get: operations["ObjectsController_findAll"];
|
|
865
874
|
put?: never;
|
|
@@ -1660,8 +1669,6 @@ interface components {
|
|
|
1660
1669
|
SKILLS: boolean;
|
|
1661
1670
|
/** @description Whether the hexagonal agent builder canvas UI is enabled. */
|
|
1662
1671
|
AGENT_BUILDER_CANVAS: boolean;
|
|
1663
|
-
/** @description Whether the Solution Designer UI is enabled. */
|
|
1664
|
-
SOLUTION_DESIGNER: boolean;
|
|
1665
1672
|
/** @description Whether isolated code execution for agents is enabled. */
|
|
1666
1673
|
CODE_EXECUTION: boolean;
|
|
1667
1674
|
/** @description Whether SSO (OIDC) login is enabled. Requires at least one enabled SSO provider. */
|
|
@@ -2282,9 +2289,7 @@ interface components {
|
|
|
2282
2289
|
/** @description Error message to record against the queue item. */
|
|
2283
2290
|
error: string;
|
|
2284
2291
|
/** @description Additional structured error details, supplied as a JSON string. */
|
|
2285
|
-
errorDetails?:
|
|
2286
|
-
[key: string]: unknown;
|
|
2287
|
-
};
|
|
2292
|
+
errorDetails?: string;
|
|
2288
2293
|
};
|
|
2289
2294
|
BulkDeleteItemsDto: {
|
|
2290
2295
|
/** @description IDs of the queue items to delete. */
|
|
@@ -2403,7 +2408,7 @@ interface components {
|
|
|
2403
2408
|
managedByCode?: boolean;
|
|
2404
2409
|
};
|
|
2405
2410
|
UpsertObjectTypeBySlugDto: {
|
|
2406
|
-
/** @description Stable
|
|
2411
|
+
/** @description Stable deployment-wide slug (lowercase, digits, hyphens). Used as the upsert key. Granted to the caller workspace when new. */
|
|
2407
2412
|
slug: string;
|
|
2408
2413
|
/** @description Singular display name. */
|
|
2409
2414
|
name?: string;
|
|
@@ -2466,7 +2471,7 @@ interface components {
|
|
|
2466
2471
|
name: string;
|
|
2467
2472
|
/** @description Plural display name of the entity type. */
|
|
2468
2473
|
namePlural: string;
|
|
2469
|
-
/** @description URL-safe slug, unique
|
|
2474
|
+
/** @description URL-safe slug, unique across the deployment. */
|
|
2470
2475
|
slug: string;
|
|
2471
2476
|
/** @description Icon identifier for the entity type. */
|
|
2472
2477
|
icon: string;
|
|
@@ -2519,11 +2524,6 @@ interface components {
|
|
|
2519
2524
|
attributes?: {
|
|
2520
2525
|
[key: string]: unknown;
|
|
2521
2526
|
};
|
|
2522
|
-
/**
|
|
2523
|
-
* Format: uuid
|
|
2524
|
-
* @description Workspace user ID of the entity owner.
|
|
2525
|
-
*/
|
|
2526
|
-
ownerId?: string;
|
|
2527
2527
|
};
|
|
2528
2528
|
ObjectTypeSummaryDto: {
|
|
2529
2529
|
/** @description Entity type ID. */
|
|
@@ -2639,8 +2639,6 @@ interface components {
|
|
|
2639
2639
|
attributes?: {
|
|
2640
2640
|
[key: string]: unknown;
|
|
2641
2641
|
};
|
|
2642
|
-
/** @description Workspace user ID of the new entity owner. */
|
|
2643
|
-
ownerId?: string;
|
|
2644
2642
|
};
|
|
2645
2643
|
ChangeObjectStateDto: {
|
|
2646
2644
|
/** @description ID of the target state. Must be a valid transition from the current state when the entity type defines transitions. */
|
|
@@ -3424,7 +3422,7 @@ interface components {
|
|
|
3424
3422
|
approvalStatus?: "pending" | "partially_approved" | "approved" | "rejected" | "expired";
|
|
3425
3423
|
/** @description Number of approve decisions received so far */
|
|
3426
3424
|
approvalsReceived?: number;
|
|
3427
|
-
/** @description
|
|
3425
|
+
/** @description How many approvals are required before the workflow continues */
|
|
3428
3426
|
approvalsRequired?: number;
|
|
3429
3427
|
};
|
|
3430
3428
|
PendingInputFieldDto: {
|
|
@@ -3802,11 +3800,15 @@ interface components {
|
|
|
3802
3800
|
* "imageUrl": "https://example.com/image.png"
|
|
3803
3801
|
* }
|
|
3804
3802
|
*/
|
|
3805
|
-
data?:
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3803
|
+
data?: {
|
|
3804
|
+
/** @description URL of an image attached to the message. */
|
|
3805
|
+
imageUrl?: string;
|
|
3806
|
+
};
|
|
3807
|
+
/**
|
|
3808
|
+
* @description Answer to an ask-before-sending personal-data prompt. Applies to this message only.
|
|
3809
|
+
* @enum {string}
|
|
3810
|
+
*/
|
|
3811
|
+
piiResolution?: "anonymize" | "fallback";
|
|
3810
3812
|
};
|
|
3811
3813
|
StreamMessageStopDto: {
|
|
3812
3814
|
/** @description Partial assistant message to persist when stopping a stream */
|
|
@@ -4870,8 +4872,6 @@ interface operations {
|
|
|
4870
4872
|
state?: string;
|
|
4871
4873
|
/** @description Filter by multiple state IDs, supplied as a comma-separated list. */
|
|
4872
4874
|
states?: string;
|
|
4873
|
-
/** @description Filter by owner workspace user ID. */
|
|
4874
|
-
ownerId?: string;
|
|
4875
4875
|
/** @description Case-insensitive search on the entity name. */
|
|
4876
4876
|
search?: string;
|
|
4877
4877
|
/** @description Field to sort by (for example name, createdAt, updatedAt). Defaults to updatedAt. */
|
|
@@ -5153,13 +5153,11 @@ interface operations {
|
|
|
5153
5153
|
* @enum {string}
|
|
5154
5154
|
*/
|
|
5155
5155
|
format?: "csv" | "xlsx";
|
|
5156
|
-
/** @description When true, adds an ownerName column resolved from the owning workspace member. */
|
|
5157
|
-
includeRelatedEntityNames?: boolean;
|
|
5158
5156
|
};
|
|
5159
5157
|
};
|
|
5160
5158
|
};
|
|
5161
5159
|
responses: {
|
|
5162
|
-
/** @description Flat export rows. Each row contains id, name, state, createdAt, updatedAt, the requested attribute fields
|
|
5160
|
+
/** @description Flat export rows. Each row contains id, name, state, createdAt, updatedAt, and the requested attribute fields. */
|
|
5163
5161
|
201: {
|
|
5164
5162
|
headers: {
|
|
5165
5163
|
[name: string]: unknown;
|
|
@@ -6626,7 +6624,7 @@ declare function defineWorkflow(config: Omit<WorkflowDefinition, 'kind'>): Workf
|
|
|
6626
6624
|
declare function defineAgent(config: Omit<AgentDefinition, 'kind'>): AgentDefinition;
|
|
6627
6625
|
interface EntityTypeDefinition {
|
|
6628
6626
|
kind: typeof DEFINE_KINDS.entityType;
|
|
6629
|
-
/** Stable
|
|
6627
|
+
/** Stable deployment-wide slug (upsert key). Granted to the deployer's workspace when new. */
|
|
6630
6628
|
slug: string;
|
|
6631
6629
|
name?: string;
|
|
6632
6630
|
namePlural?: string;
|
|
@@ -6851,8 +6849,6 @@ interface ListEntitiesOptions {
|
|
|
6851
6849
|
state?: string;
|
|
6852
6850
|
/** Filter by several states (comma-separated server-side). */
|
|
6853
6851
|
states?: string[];
|
|
6854
|
-
/** Filter by owner workspace-user ID. */
|
|
6855
|
-
ownerId?: string;
|
|
6856
6852
|
/** Free-text search over entity names. */
|
|
6857
6853
|
search?: string;
|
|
6858
6854
|
sortBy?: string;
|
|
@@ -6884,7 +6880,6 @@ interface ExportEntitiesInput {
|
|
|
6884
6880
|
value: unknown;
|
|
6885
6881
|
}>;
|
|
6886
6882
|
format?: 'csv' | 'xlsx';
|
|
6887
|
-
includeRelatedEntityNames?: boolean;
|
|
6888
6883
|
}
|
|
6889
6884
|
/**
|
|
6890
6885
|
* Entities (the platform calls them Objects internally): the structured data
|
|
@@ -6960,7 +6955,7 @@ declare class EntityTypesResource {
|
|
|
6960
6955
|
private readonly http;
|
|
6961
6956
|
constructor(http: HttpClient);
|
|
6962
6957
|
/**
|
|
6963
|
-
* Lists entity types
|
|
6958
|
+
* Lists entity types granted to the API key's workspace. Request
|
|
6964
6959
|
* `expansion: ['attributeSchema', 'stateSchema']` for the field and state
|
|
6965
6960
|
* machine definitions the codegen CLI builds types from.
|
|
6966
6961
|
*/
|
|
@@ -6972,7 +6967,9 @@ declare class EntityTypesResource {
|
|
|
6972
6967
|
/** Returns a single entity type by its URL-safe slug. */
|
|
6973
6968
|
getBySlug(slug: string, options?: EntityTypeReadOptions): Promise<EntityType>;
|
|
6974
6969
|
/**
|
|
6975
|
-
* Creates or updates an entity type by
|
|
6970
|
+
* Creates or updates an entity type by deployment-wide slug.
|
|
6971
|
+
* A new slug is granted to the API key's workspace. A slug already shared
|
|
6972
|
+
* with another workspace is rejected unless the key belongs to a platform admin.
|
|
6976
6973
|
* Prefer the CLI (`npx @lunnoa/client entity-types deploy`) for happy-path deploy.
|
|
6977
6974
|
*/
|
|
6978
6975
|
upsertBySlug(definition: EntityTypeDefinition | UpsertEntityTypeBySlugInput): Promise<EntityType>;
|
|
@@ -6991,7 +6988,6 @@ type ApprovalInboxItem = {
|
|
|
6991
6988
|
status: string;
|
|
6992
6989
|
requiredCount: number;
|
|
6993
6990
|
receivedApprovals: number;
|
|
6994
|
-
currentStageIndex?: number;
|
|
6995
6991
|
expiresAt?: string;
|
|
6996
6992
|
createdAt?: string;
|
|
6997
6993
|
updatedAt?: string;
|
|
@@ -7010,7 +7006,7 @@ type ApprovalInboxItem = {
|
|
|
7010
7006
|
comment?: string;
|
|
7011
7007
|
decidedAt?: string;
|
|
7012
7008
|
};
|
|
7013
|
-
/** People who can still decide
|
|
7009
|
+
/** People who can still decide. */
|
|
7014
7010
|
eligibleApprovers?: EligibleApprover[];
|
|
7015
7011
|
approval?: Record<string, unknown>;
|
|
7016
7012
|
};
|
|
@@ -7079,6 +7075,16 @@ declare class ProjectsResource {
|
|
|
7079
7075
|
create(data: CreateProjectInput): Promise<Project>;
|
|
7080
7076
|
}
|
|
7081
7077
|
|
|
7078
|
+
type QueueItemStatus = 'PENDING' | 'PROCESSING' | 'SUCCESS' | 'FAILED' | 'RETRYING';
|
|
7079
|
+
interface AddQueueItemErrorInput {
|
|
7080
|
+
/** Error message recorded on the item. */
|
|
7081
|
+
error: string;
|
|
7082
|
+
/**
|
|
7083
|
+
* Extra details. An object is sent as a JSON string, which is what the
|
|
7084
|
+
* server validates.
|
|
7085
|
+
*/
|
|
7086
|
+
errorDetails?: string | Record<string, unknown>;
|
|
7087
|
+
}
|
|
7082
7088
|
interface ListQueueItemsOptions {
|
|
7083
7089
|
limit?: number;
|
|
7084
7090
|
offset?: number;
|
|
@@ -7124,12 +7130,18 @@ declare class QueueItemsResource {
|
|
|
7124
7130
|
}): Promise<QueueItem[]>;
|
|
7125
7131
|
/** Returns items eligible for retry. */
|
|
7126
7132
|
listRetryable(queueId: string): Promise<QueueItem[]>;
|
|
7127
|
-
/** Returns items with the given status. */
|
|
7128
|
-
listByStatus(queueId: string, status:
|
|
7133
|
+
/** Returns a page of items with the given status. */
|
|
7134
|
+
listByStatus(queueId: string, status: QueueItemStatus, options?: {
|
|
7135
|
+
limit?: number;
|
|
7136
|
+
offset?: number;
|
|
7137
|
+
}): Promise<QueueItemList>;
|
|
7129
7138
|
/** Looks an item up by the external ID your system supplied. */
|
|
7130
7139
|
getByExternalId(queueId: string, externalId: string): Promise<QueueItemFull>;
|
|
7131
|
-
/**
|
|
7132
|
-
|
|
7140
|
+
/**
|
|
7141
|
+
* Searches items by external id, item data, and metadata.
|
|
7142
|
+
* Returns one page, same shape as `list`.
|
|
7143
|
+
*/
|
|
7144
|
+
search(queueId: string, query: string, options?: Omit<ListQueueItemsOptions, 'filterBy'>): Promise<QueueItemList>;
|
|
7133
7145
|
/** Returns per-status and per-priority counts for the queue. */
|
|
7134
7146
|
stats(queueId: string): Promise<QueueItemStats>;
|
|
7135
7147
|
/** Returns the recorded processing errors of an item. */
|
|
@@ -7141,10 +7153,7 @@ declare class QueueItemsResource {
|
|
|
7141
7153
|
/** Queues the item for another processing attempt. */
|
|
7142
7154
|
retry(queueId: string, itemId: string): Promise<QueueItem>;
|
|
7143
7155
|
/** Records a processing error on the item. */
|
|
7144
|
-
addError(queueId: string, itemId: string, error:
|
|
7145
|
-
message: string;
|
|
7146
|
-
[key: string]: unknown;
|
|
7147
|
-
}): Promise<QueueItem>;
|
|
7156
|
+
addError(queueId: string, itemId: string, error: AddQueueItemErrorInput): Promise<QueueItem>;
|
|
7148
7157
|
}
|
|
7149
7158
|
|
|
7150
7159
|
declare class QueuesResource {
|
|
@@ -7201,6 +7210,91 @@ declare class RunsResource {
|
|
|
7201
7210
|
startAndWait(input: StartRunInput, waitOptions?: WaitUntilFinishedOptions): Promise<Execution>;
|
|
7202
7211
|
}
|
|
7203
7212
|
|
|
7213
|
+
type ScorecardMeasureStatus = 'ON_TRACK' | 'AT_RISK' | 'OFF_TRACK' | 'NO_DATA';
|
|
7214
|
+
type ScorecardSummary = {
|
|
7215
|
+
id: string;
|
|
7216
|
+
name: string;
|
|
7217
|
+
periodLabel: string | null;
|
|
7218
|
+
description: string | null;
|
|
7219
|
+
FK_ownerId: string | null;
|
|
7220
|
+
createdAt: string;
|
|
7221
|
+
_count: {
|
|
7222
|
+
objectives: number;
|
|
7223
|
+
};
|
|
7224
|
+
};
|
|
7225
|
+
type ScorecardMeasure = {
|
|
7226
|
+
id: string;
|
|
7227
|
+
name: string;
|
|
7228
|
+
unit: string;
|
|
7229
|
+
currency: string | null;
|
|
7230
|
+
direction: 'HIGHER_IS_BETTER' | 'LOWER_IS_BETTER';
|
|
7231
|
+
kind: 'LEADING' | 'LAGGING';
|
|
7232
|
+
cadence: 'DAILY' | 'WEEKLY' | 'MONTHLY';
|
|
7233
|
+
sourceType: 'MANUAL' | 'API' | 'WORKFLOW' | 'BUILT_IN';
|
|
7234
|
+
builtInKey: string | null;
|
|
7235
|
+
target: number;
|
|
7236
|
+
atRiskThreshold: number | null;
|
|
7237
|
+
latest: {
|
|
7238
|
+
value: number;
|
|
7239
|
+
periodStart: string;
|
|
7240
|
+
createdAt: string;
|
|
7241
|
+
} | null;
|
|
7242
|
+
previousValue: number | null;
|
|
7243
|
+
series: {
|
|
7244
|
+
periodStart: string;
|
|
7245
|
+
value: number;
|
|
7246
|
+
}[];
|
|
7247
|
+
status: ScorecardMeasureStatus;
|
|
7248
|
+
stale: boolean;
|
|
7249
|
+
};
|
|
7250
|
+
type ScorecardObjective = {
|
|
7251
|
+
id: string;
|
|
7252
|
+
perspective: 'FINANCIAL' | 'CUSTOMER' | 'PROCESS' | 'LEARNING';
|
|
7253
|
+
name: string;
|
|
7254
|
+
description: string | null;
|
|
7255
|
+
ownerLabel: string | null;
|
|
7256
|
+
drivesIds: string[];
|
|
7257
|
+
position: number;
|
|
7258
|
+
status: ScorecardMeasureStatus;
|
|
7259
|
+
measures: ScorecardMeasure[];
|
|
7260
|
+
};
|
|
7261
|
+
type Scorecard = Omit<ScorecardSummary, '_count'> & {
|
|
7262
|
+
aiSpendUsdThisMonth: number;
|
|
7263
|
+
objectives: ScorecardObjective[];
|
|
7264
|
+
};
|
|
7265
|
+
type ScorecardMeasureValue = {
|
|
7266
|
+
id: string;
|
|
7267
|
+
FK_measureId: string;
|
|
7268
|
+
periodStart: string;
|
|
7269
|
+
value: number;
|
|
7270
|
+
note: string | null;
|
|
7271
|
+
sourceType: ScorecardMeasure['sourceType'];
|
|
7272
|
+
supersededAt: string | null;
|
|
7273
|
+
createdAt: string;
|
|
7274
|
+
};
|
|
7275
|
+
type RecordMeasureValueInput = {
|
|
7276
|
+
value: number;
|
|
7277
|
+
/** Any ISO date inside the target period; defaults to the current period. */
|
|
7278
|
+
period?: string;
|
|
7279
|
+
note?: string;
|
|
7280
|
+
};
|
|
7281
|
+
/**
|
|
7282
|
+
* Balanced Scorecard (workspace API). Pushing values needs `scorecard:record`.
|
|
7283
|
+
*/
|
|
7284
|
+
declare class ScorecardsResource {
|
|
7285
|
+
private readonly http;
|
|
7286
|
+
constructor(http: HttpClient);
|
|
7287
|
+
/** Lists scorecards in the workspace. */
|
|
7288
|
+
list(): Promise<ScorecardSummary[]>;
|
|
7289
|
+
/** Returns a scorecard with objectives, measures, latest values and status. */
|
|
7290
|
+
get(scorecardId: string): Promise<Scorecard>;
|
|
7291
|
+
/**
|
|
7292
|
+
* Records a measure value. A value for the same period replaces the current
|
|
7293
|
+
* one; the old value is kept as superseded history.
|
|
7294
|
+
*/
|
|
7295
|
+
recordValue(measureId: string, data: RecordMeasureValueInput): Promise<ScorecardMeasureValue>;
|
|
7296
|
+
}
|
|
7297
|
+
|
|
7204
7298
|
declare class TasksResource {
|
|
7205
7299
|
private readonly http;
|
|
7206
7300
|
constructor(http: HttpClient);
|
|
@@ -7220,9 +7314,7 @@ declare class TasksResource {
|
|
|
7220
7314
|
* messages in AI SDK UIMessage format. For token-by-token output use
|
|
7221
7315
|
* `client.agentChat.streamMessage` instead.
|
|
7222
7316
|
*/
|
|
7223
|
-
message(agentId: string, taskId: string, message: string | UIMessage, options?:
|
|
7224
|
-
chatMode?: ChatMode;
|
|
7225
|
-
}): Promise<string | UIMessage[]>;
|
|
7317
|
+
message(agentId: string, taskId: string, message: string | UIMessage, options?: Omit<StreamMessageOptions, 'signal'>): Promise<string | UIMessage[]>;
|
|
7226
7318
|
}
|
|
7227
7319
|
|
|
7228
7320
|
declare class VariablesResource {
|
|
@@ -7338,6 +7430,7 @@ declare class LunnoaClient {
|
|
|
7338
7430
|
readonly queues: QueuesResource;
|
|
7339
7431
|
readonly queueItems: QueueItemsResource;
|
|
7340
7432
|
readonly variables: VariablesResource;
|
|
7433
|
+
readonly scorecards: ScorecardsResource;
|
|
7341
7434
|
readonly connections: ConnectionsResource;
|
|
7342
7435
|
readonly projects: ProjectsResource;
|
|
7343
7436
|
readonly workflowApps: WorkflowAppsResource;
|
|
@@ -7486,4 +7579,4 @@ interface CreateServerClientOptions {
|
|
|
7486
7579
|
*/
|
|
7487
7580
|
declare function createServerClient(options: CreateServerClientOptions): LunnoaClient;
|
|
7488
7581
|
|
|
7489
|
-
export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnectionDefinition, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateProjectInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type Project, ProjectsResource, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, QueueItemsResource, type QueueStats, QueuesResource, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Task, type TaskListItem, TasksResource, type TokenStore, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, resolveActionAppId, resolveActionId };
|
|
7582
|
+
export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnectionDefinition, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateProjectInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type Project, ProjectsResource, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Task, type TaskListItem, TasksResource, type TokenStore, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, resolveActionAppId, resolveActionId };
|
package/dist/index.js
CHANGED
|
@@ -424,10 +424,7 @@ var AgentChatClient = class {
|
|
|
424
424
|
raw: true,
|
|
425
425
|
signal: options.signal,
|
|
426
426
|
headers: { Accept: "text/event-stream" },
|
|
427
|
-
body:
|
|
428
|
-
messages: [uiMessage],
|
|
429
|
-
...options.chatMode ? { chatMode: options.chatMode } : {}
|
|
430
|
-
}
|
|
427
|
+
body: messageTaskBody(uiMessage, options)
|
|
431
428
|
}
|
|
432
429
|
);
|
|
433
430
|
return new AgentChatStream(response, { signal: options.signal });
|
|
@@ -466,6 +463,14 @@ var AgentChatClient = class {
|
|
|
466
463
|
);
|
|
467
464
|
}
|
|
468
465
|
};
|
|
466
|
+
function messageTaskBody(message, options = {}) {
|
|
467
|
+
return {
|
|
468
|
+
messages: [message],
|
|
469
|
+
...options.chatMode ? { chatMode: options.chatMode } : {},
|
|
470
|
+
...options.data ? { data: options.data } : {},
|
|
471
|
+
...options.piiResolution ? { piiResolution: options.piiResolution } : {}
|
|
472
|
+
};
|
|
473
|
+
}
|
|
469
474
|
function generateMessageId() {
|
|
470
475
|
const cryptoObj = globalThis.crypto;
|
|
471
476
|
if (cryptoObj?.randomUUID) {
|
|
@@ -1045,7 +1050,6 @@ var EntitiesResource = class {
|
|
|
1045
1050
|
objectTypeSlug: options.objectTypeSlug,
|
|
1046
1051
|
state: options.state,
|
|
1047
1052
|
states: options.states?.join(","),
|
|
1048
|
-
ownerId: options.ownerId,
|
|
1049
1053
|
search: options.search,
|
|
1050
1054
|
sortBy: options.sortBy,
|
|
1051
1055
|
sortOrder: options.sortOrder,
|
|
@@ -1078,7 +1082,7 @@ var EntityTypesResource = class {
|
|
|
1078
1082
|
}
|
|
1079
1083
|
http;
|
|
1080
1084
|
/**
|
|
1081
|
-
* Lists entity types
|
|
1085
|
+
* Lists entity types granted to the API key's workspace. Request
|
|
1082
1086
|
* `expansion: ['attributeSchema', 'stateSchema']` for the field and state
|
|
1083
1087
|
* machine definitions the codegen CLI builds types from.
|
|
1084
1088
|
*/
|
|
@@ -1103,7 +1107,9 @@ var EntityTypesResource = class {
|
|
|
1103
1107
|
});
|
|
1104
1108
|
}
|
|
1105
1109
|
/**
|
|
1106
|
-
* Creates or updates an entity type by
|
|
1110
|
+
* Creates or updates an entity type by deployment-wide slug.
|
|
1111
|
+
* A new slug is granted to the API key's workspace. A slug already shared
|
|
1112
|
+
* with another workspace is rejected unless the key belongs to a platform admin.
|
|
1107
1113
|
* Prefer the CLI (`npx @lunnoa/client entity-types deploy`) for happy-path deploy.
|
|
1108
1114
|
*/
|
|
1109
1115
|
upsertBySlug(definition) {
|
|
@@ -1641,10 +1647,11 @@ var QueueItemsResource = class {
|
|
|
1641
1647
|
listRetryable(queueId) {
|
|
1642
1648
|
return this.http.get(`/api/queues/${queueId}/items/retry`);
|
|
1643
1649
|
}
|
|
1644
|
-
/** Returns items with the given status. */
|
|
1645
|
-
listByStatus(queueId, status) {
|
|
1650
|
+
/** Returns a page of items with the given status. */
|
|
1651
|
+
listByStatus(queueId, status, options = {}) {
|
|
1646
1652
|
return this.http.get(
|
|
1647
|
-
`/api/queues/${queueId}/items/status/${status}
|
|
1653
|
+
`/api/queues/${queueId}/items/status/${status}`,
|
|
1654
|
+
{ query: { limit: options.limit, offset: options.offset } }
|
|
1648
1655
|
);
|
|
1649
1656
|
}
|
|
1650
1657
|
/** Looks an item up by the external ID your system supplied. */
|
|
@@ -1653,11 +1660,22 @@ var QueueItemsResource = class {
|
|
|
1653
1660
|
`/api/queues/${queueId}/items/external/${externalId}`
|
|
1654
1661
|
);
|
|
1655
1662
|
}
|
|
1656
|
-
/**
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1663
|
+
/**
|
|
1664
|
+
* Searches items by external id, item data, and metadata.
|
|
1665
|
+
* Returns one page, same shape as `list`.
|
|
1666
|
+
*/
|
|
1667
|
+
search(queueId, query, options = {}) {
|
|
1668
|
+
return this.http.get(
|
|
1669
|
+
`/api/queues/${queueId}/items/search`,
|
|
1670
|
+
{
|
|
1671
|
+
query: {
|
|
1672
|
+
limit: options.limit,
|
|
1673
|
+
offset: options.offset,
|
|
1674
|
+
expansion: serializeCsv(options.expansion),
|
|
1675
|
+
filterBy: serializeFilterBy({ search: query })
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
);
|
|
1661
1679
|
}
|
|
1662
1680
|
/** Returns per-status and per-priority counts for the queue. */
|
|
1663
1681
|
stats(queueId) {
|
|
@@ -1693,10 +1711,21 @@ var QueueItemsResource = class {
|
|
|
1693
1711
|
addError(queueId, itemId, error) {
|
|
1694
1712
|
return this.http.post(
|
|
1695
1713
|
`/api/queues/${queueId}/items/${itemId}/error`,
|
|
1696
|
-
{
|
|
1714
|
+
{
|
|
1715
|
+
body: {
|
|
1716
|
+
error: error.error,
|
|
1717
|
+
errorDetails: serializeErrorDetails(error.errorDetails)
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1697
1720
|
);
|
|
1698
1721
|
}
|
|
1699
1722
|
};
|
|
1723
|
+
function serializeErrorDetails(value) {
|
|
1724
|
+
if (value === void 0) {
|
|
1725
|
+
return void 0;
|
|
1726
|
+
}
|
|
1727
|
+
return typeof value === "string" ? value : JSON.stringify(value);
|
|
1728
|
+
}
|
|
1700
1729
|
|
|
1701
1730
|
// src/resources/queues.ts
|
|
1702
1731
|
var QueuesResource = class {
|
|
@@ -1823,6 +1852,32 @@ var RunsResource = class {
|
|
|
1823
1852
|
}
|
|
1824
1853
|
};
|
|
1825
1854
|
|
|
1855
|
+
// src/resources/scorecards.ts
|
|
1856
|
+
var ScorecardsResource = class {
|
|
1857
|
+
constructor(http) {
|
|
1858
|
+
this.http = http;
|
|
1859
|
+
}
|
|
1860
|
+
http;
|
|
1861
|
+
/** Lists scorecards in the workspace. */
|
|
1862
|
+
list() {
|
|
1863
|
+
return this.http.get("/api/scorecards");
|
|
1864
|
+
}
|
|
1865
|
+
/** Returns a scorecard with objectives, measures, latest values and status. */
|
|
1866
|
+
get(scorecardId) {
|
|
1867
|
+
return this.http.get(`/api/scorecards/${scorecardId}`);
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* Records a measure value. A value for the same period replaces the current
|
|
1871
|
+
* one; the old value is kept as superseded history.
|
|
1872
|
+
*/
|
|
1873
|
+
recordValue(measureId, data) {
|
|
1874
|
+
return this.http.post(
|
|
1875
|
+
`/api/scorecards/measures/${measureId}/values`,
|
|
1876
|
+
{ body: data }
|
|
1877
|
+
);
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1826
1881
|
// src/resources/tasks.ts
|
|
1827
1882
|
var TasksResource = class {
|
|
1828
1883
|
constructor(http) {
|
|
@@ -1873,12 +1928,7 @@ var TasksResource = class {
|
|
|
1873
1928
|
} : message;
|
|
1874
1929
|
return this.http.post(
|
|
1875
1930
|
`/api/agents/${agentId}/tasks/${taskId}/message`,
|
|
1876
|
-
{
|
|
1877
|
-
body: {
|
|
1878
|
-
messages: [uiMessage],
|
|
1879
|
-
...options.chatMode ? { chatMode: options.chatMode } : {}
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1931
|
+
{ body: messageTaskBody(uiMessage, options) }
|
|
1882
1932
|
);
|
|
1883
1933
|
}
|
|
1884
1934
|
};
|
|
@@ -2061,6 +2111,7 @@ var LunnoaClient = class {
|
|
|
2061
2111
|
queues;
|
|
2062
2112
|
queueItems;
|
|
2063
2113
|
variables;
|
|
2114
|
+
scorecards;
|
|
2064
2115
|
connections;
|
|
2065
2116
|
projects;
|
|
2066
2117
|
workflowApps;
|
|
@@ -2083,6 +2134,7 @@ var LunnoaClient = class {
|
|
|
2083
2134
|
this.queues = new QueuesResource(this.http);
|
|
2084
2135
|
this.queueItems = new QueueItemsResource(this.http);
|
|
2085
2136
|
this.variables = new VariablesResource(this.http);
|
|
2137
|
+
this.scorecards = new ScorecardsResource(this.http);
|
|
2086
2138
|
this.connections = new ConnectionsResource(this.http);
|
|
2087
2139
|
this.projects = new ProjectsResource(this.http);
|
|
2088
2140
|
this.discovery = new DiscoveryResource(this.http);
|
|
@@ -2161,6 +2213,6 @@ function createServerClient(options) {
|
|
|
2161
2213
|
});
|
|
2162
2214
|
}
|
|
2163
2215
|
|
|
2164
|
-
export { API_KEY_PREFIX, ActionsResource, AgentChatClient, AgentChatStream, AgentsResource, ApprovalsResource, AuthResource, ConnectionsResource, DEFINE_KINDS, DiscoveryResource, EntitiesResource, EntityTypesResource, ExecutionProgressStream, ExecutionTimeoutError, ExecutionsResource, HttpClient, KnowledgeResource, LunnoaApiError, LunnoaClient, ProjectsResource, QueueItemsResource, QueuesResource, RunsResource, SsoAuthResource, TasksResource, VariablesResource, WorkflowAppsResource, WorkflowsResource, assertApiKeyAllowedInEnvironment, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, parseSseEvents, parseSseStream, resolveActionAppId, resolveActionId };
|
|
2216
|
+
export { API_KEY_PREFIX, ActionsResource, AgentChatClient, AgentChatStream, AgentsResource, ApprovalsResource, AuthResource, ConnectionsResource, DEFINE_KINDS, DiscoveryResource, EntitiesResource, EntityTypesResource, ExecutionProgressStream, ExecutionTimeoutError, ExecutionsResource, HttpClient, KnowledgeResource, LunnoaApiError, LunnoaClient, ProjectsResource, QueueItemsResource, QueuesResource, RunsResource, ScorecardsResource, SsoAuthResource, TasksResource, VariablesResource, WorkflowAppsResource, WorkflowsResource, assertApiKeyAllowedInEnvironment, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, parseSseEvents, parseSseStream, resolveActionAppId, resolveActionId };
|
|
2165
2217
|
//# sourceMappingURL=index.js.map
|
|
2166
2218
|
//# sourceMappingURL=index.js.map
|