@cadenya/cadenya 0.128.0 → 0.130.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/CHANGELOG.md +16 -0
- package/client.d.mts +17 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +17 -0
- package/client.d.ts.map +1 -1
- package/client.js +17 -0
- package/client.js.map +1 -1
- package/client.mjs +17 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/api-keys.d.mts +5 -4
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +5 -4
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/objectives/objectives.d.mts +61 -1
- package/resources/objectives/objectives.d.mts.map +1 -1
- package/resources/objectives/objectives.d.ts +61 -1
- package/resources/objectives/objectives.d.ts.map +1 -1
- package/resources/objectives/objectives.js.map +1 -1
- package/resources/objectives/objectives.mjs.map +1 -1
- package/resources/widget-sessions.d.mts +388 -0
- package/resources/widget-sessions.d.mts.map +1 -0
- package/resources/widget-sessions.d.ts +388 -0
- package/resources/widget-sessions.d.ts.map +1 -0
- package/resources/widget-sessions.js +79 -0
- package/resources/widget-sessions.js.map +1 -0
- package/resources/widget-sessions.mjs +75 -0
- package/resources/widget-sessions.mjs.map +1 -0
- package/resources/widgets.d.mts +225 -0
- package/resources/widgets.d.mts.map +1 -0
- package/resources/widgets.d.ts +225 -0
- package/resources/widgets.d.ts.map +1 -0
- package/resources/widgets.js +83 -0
- package/resources/widgets.js.map +1 -0
- package/resources/widgets.mjs +79 -0
- package/resources/widgets.mjs.map +1 -0
- package/src/client.ts +81 -0
- package/src/resources/api-keys.ts +5 -4
- package/src/resources/index.ts +32 -0
- package/src/resources/objectives/objectives.ts +66 -1
- package/src/resources/widget-sessions.ts +509 -0
- package/src/resources/widgets.ts +317 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/client.ts
CHANGED
|
@@ -88,6 +88,38 @@ import {
|
|
|
88
88
|
Uploads as UploadsAPIUploads,
|
|
89
89
|
} from './resources/uploads';
|
|
90
90
|
import { UnsafeUnwrapWebhookEvent, UnwrapWebhookEvent, Webhooks } from './resources/webhooks';
|
|
91
|
+
import {
|
|
92
|
+
SubjectAssertion,
|
|
93
|
+
SubjectReference,
|
|
94
|
+
TenantAssertion,
|
|
95
|
+
TenantReference,
|
|
96
|
+
WidgetSession,
|
|
97
|
+
WidgetSessionCreateParams,
|
|
98
|
+
WidgetSessionDeleteParams,
|
|
99
|
+
WidgetSessionDeleteTenantParams,
|
|
100
|
+
WidgetSessionDeleteTenantResponse,
|
|
101
|
+
WidgetSessionInfo,
|
|
102
|
+
WidgetSessionListParams,
|
|
103
|
+
WidgetSessionRetrieveParams,
|
|
104
|
+
WidgetSessionRevokeParams,
|
|
105
|
+
WidgetSessionSpec,
|
|
106
|
+
WidgetSessions,
|
|
107
|
+
WidgetSessionsCursorPagination,
|
|
108
|
+
} from './resources/widget-sessions';
|
|
109
|
+
import {
|
|
110
|
+
Widget,
|
|
111
|
+
WidgetArchiveParams,
|
|
112
|
+
WidgetCreateParams,
|
|
113
|
+
WidgetDeleteParams,
|
|
114
|
+
WidgetInfo,
|
|
115
|
+
WidgetListParams,
|
|
116
|
+
WidgetRetrieveParams,
|
|
117
|
+
WidgetSpec,
|
|
118
|
+
WidgetUnarchiveParams,
|
|
119
|
+
WidgetUpdateParams,
|
|
120
|
+
Widgets,
|
|
121
|
+
WidgetsCursorPagination,
|
|
122
|
+
} from './resources/widgets';
|
|
91
123
|
import {
|
|
92
124
|
WorkspaceSecret,
|
|
93
125
|
WorkspaceSecretCreateParams,
|
|
@@ -1102,6 +1134,19 @@ export class Cadenya {
|
|
|
1102
1134
|
*/
|
|
1103
1135
|
workspaceAdmin: API.WorkspaceAdmin = new API.WorkspaceAdmin(this);
|
|
1104
1136
|
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
1137
|
+
/**
|
|
1138
|
+
* Manage embeddable chat widgets. A widget binds an agent to a globally
|
|
1139
|
+
* unique hostname with a per-widget origin allowlist; browsers reach it with
|
|
1140
|
+
* session tokens minted via WidgetSessionService.
|
|
1141
|
+
*/
|
|
1142
|
+
widgets: API.Widgets = new API.Widgets(this);
|
|
1143
|
+
/**
|
|
1144
|
+
* Mint and manage widget sessions. Session creation is server-to-server only:
|
|
1145
|
+
* the customer's backend authenticates its visitor, asserts tenant/subject
|
|
1146
|
+
* context, attaches any per-visitor secrets, and receives a short-lived
|
|
1147
|
+
* bearer token the browser uses against the widget host.
|
|
1148
|
+
*/
|
|
1149
|
+
widgetSessions: API.WidgetSessions = new API.WidgetSessions(this);
|
|
1105
1150
|
}
|
|
1106
1151
|
|
|
1107
1152
|
Cadenya.AIProviderKeys = AIProviderKeys;
|
|
@@ -1120,6 +1165,8 @@ Cadenya.WorkspaceSecrets = WorkspaceSecrets;
|
|
|
1120
1165
|
Cadenya.Workspaces = Workspaces;
|
|
1121
1166
|
Cadenya.WorkspaceAdmin = WorkspaceAdmin;
|
|
1122
1167
|
Cadenya.Webhooks = Webhooks;
|
|
1168
|
+
Cadenya.Widgets = Widgets;
|
|
1169
|
+
Cadenya.WidgetSessions = WidgetSessions;
|
|
1123
1170
|
|
|
1124
1171
|
export declare namespace Cadenya {
|
|
1125
1172
|
export type RequestOptions = Opts.RequestOptions;
|
|
@@ -1393,6 +1440,40 @@ export declare namespace Cadenya {
|
|
|
1393
1440
|
type UnwrapWebhookEvent as UnwrapWebhookEvent,
|
|
1394
1441
|
};
|
|
1395
1442
|
|
|
1443
|
+
export {
|
|
1444
|
+
Widgets as Widgets,
|
|
1445
|
+
type Widget as Widget,
|
|
1446
|
+
type WidgetInfo as WidgetInfo,
|
|
1447
|
+
type WidgetSpec as WidgetSpec,
|
|
1448
|
+
type WidgetsCursorPagination as WidgetsCursorPagination,
|
|
1449
|
+
type WidgetCreateParams as WidgetCreateParams,
|
|
1450
|
+
type WidgetRetrieveParams as WidgetRetrieveParams,
|
|
1451
|
+
type WidgetUpdateParams as WidgetUpdateParams,
|
|
1452
|
+
type WidgetListParams as WidgetListParams,
|
|
1453
|
+
type WidgetDeleteParams as WidgetDeleteParams,
|
|
1454
|
+
type WidgetArchiveParams as WidgetArchiveParams,
|
|
1455
|
+
type WidgetUnarchiveParams as WidgetUnarchiveParams,
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
export {
|
|
1459
|
+
WidgetSessions as WidgetSessions,
|
|
1460
|
+
type SubjectAssertion as SubjectAssertion,
|
|
1461
|
+
type SubjectReference as SubjectReference,
|
|
1462
|
+
type TenantAssertion as TenantAssertion,
|
|
1463
|
+
type TenantReference as TenantReference,
|
|
1464
|
+
type WidgetSession as WidgetSession,
|
|
1465
|
+
type WidgetSessionInfo as WidgetSessionInfo,
|
|
1466
|
+
type WidgetSessionSpec as WidgetSessionSpec,
|
|
1467
|
+
type WidgetSessionDeleteTenantResponse as WidgetSessionDeleteTenantResponse,
|
|
1468
|
+
type WidgetSessionsCursorPagination as WidgetSessionsCursorPagination,
|
|
1469
|
+
type WidgetSessionCreateParams as WidgetSessionCreateParams,
|
|
1470
|
+
type WidgetSessionRetrieveParams as WidgetSessionRetrieveParams,
|
|
1471
|
+
type WidgetSessionListParams as WidgetSessionListParams,
|
|
1472
|
+
type WidgetSessionDeleteParams as WidgetSessionDeleteParams,
|
|
1473
|
+
type WidgetSessionDeleteTenantParams as WidgetSessionDeleteTenantParams,
|
|
1474
|
+
type WidgetSessionRevokeParams as WidgetSessionRevokeParams,
|
|
1475
|
+
};
|
|
1476
|
+
|
|
1396
1477
|
export type AccountResourceMetadata = API.AccountResourceMetadata;
|
|
1397
1478
|
export type BareMetadata = API.BareMetadata;
|
|
1398
1479
|
export type CreateOperationMetadata = API.CreateOperationMetadata;
|
|
@@ -160,10 +160,11 @@ export interface APIKeySpec {
|
|
|
160
160
|
* Scopes granted to this key. Each entry is a colon-separated resource:verb string
|
|
161
161
|
* (e.g. "objectives:manage").
|
|
162
162
|
*
|
|
163
|
-
* Resources: agents, objectives, tools, memory, api_keys, workspaces,
|
|
164
|
-
* account. Verbs: read and manage, where manage implies
|
|
165
|
-
* is normalized to drop "x:read" when "x:manage" is
|
|
166
|
-
* account resources support only manage. "\*" is an
|
|
163
|
+
* Resources: agents, objectives, tools, memory, api_keys, workspaces, widgets,
|
|
164
|
+
* widget_sessions, secrets, account. Verbs: read and manage, where manage implies
|
|
165
|
+
* read — a stored scope set is normalized to drop "x:read" when "x:manage" is
|
|
166
|
+
* present. The secrets and account resources support only manage. "\*" is an
|
|
167
|
+
* explicit full-access grant.
|
|
167
168
|
*
|
|
168
169
|
* Scopes are deny-by-default: a key with an empty list can call only scope-free
|
|
169
170
|
* endpoints. Full access is always an explicit "\*" grant.
|
package/src/resources/index.ts
CHANGED
|
@@ -217,6 +217,38 @@ export {
|
|
|
217
217
|
type UploadRetrieveParams,
|
|
218
218
|
} from './uploads';
|
|
219
219
|
export { Webhooks, type UnsafeUnwrapWebhookEvent, type UnwrapWebhookEvent } from './webhooks';
|
|
220
|
+
export {
|
|
221
|
+
WidgetSessions,
|
|
222
|
+
type SubjectAssertion,
|
|
223
|
+
type SubjectReference,
|
|
224
|
+
type TenantAssertion,
|
|
225
|
+
type TenantReference,
|
|
226
|
+
type WidgetSession,
|
|
227
|
+
type WidgetSessionInfo,
|
|
228
|
+
type WidgetSessionSpec,
|
|
229
|
+
type WidgetSessionDeleteTenantResponse,
|
|
230
|
+
type WidgetSessionCreateParams,
|
|
231
|
+
type WidgetSessionRetrieveParams,
|
|
232
|
+
type WidgetSessionListParams,
|
|
233
|
+
type WidgetSessionDeleteParams,
|
|
234
|
+
type WidgetSessionDeleteTenantParams,
|
|
235
|
+
type WidgetSessionRevokeParams,
|
|
236
|
+
type WidgetSessionsCursorPagination,
|
|
237
|
+
} from './widget-sessions';
|
|
238
|
+
export {
|
|
239
|
+
Widgets,
|
|
240
|
+
type Widget,
|
|
241
|
+
type WidgetInfo,
|
|
242
|
+
type WidgetSpec,
|
|
243
|
+
type WidgetCreateParams,
|
|
244
|
+
type WidgetRetrieveParams,
|
|
245
|
+
type WidgetUpdateParams,
|
|
246
|
+
type WidgetListParams,
|
|
247
|
+
type WidgetDeleteParams,
|
|
248
|
+
type WidgetArchiveParams,
|
|
249
|
+
type WidgetUnarchiveParams,
|
|
250
|
+
type WidgetsCursorPagination,
|
|
251
|
+
} from './widgets';
|
|
220
252
|
export {
|
|
221
253
|
WorkspaceAdmin,
|
|
222
254
|
type WorkspaceMember,
|
|
@@ -4,6 +4,7 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import * as ObjectivesAPI from './objectives';
|
|
5
5
|
import * as AccountAPI from '../account';
|
|
6
6
|
import * as Shared from '../shared';
|
|
7
|
+
import * as WidgetSessionsAPI from '../widget-sessions';
|
|
7
8
|
import * as AgentsAPI from '../agents/agents';
|
|
8
9
|
import * as SchedulesAPI from '../agents/schedules';
|
|
9
10
|
import * as VariationsAPI from '../agents/variations';
|
|
@@ -587,6 +588,12 @@ export interface Objective {
|
|
|
587
588
|
*/
|
|
588
589
|
parentObjectiveId?: string;
|
|
589
590
|
|
|
591
|
+
/**
|
|
592
|
+
* Parameters forced onto this objective's tool calls, as provided at creation. See
|
|
593
|
+
* CreateObjectiveRequest.pinned_parameters for semantics.
|
|
594
|
+
*/
|
|
595
|
+
pinnedParameters?: { [key: string]: string };
|
|
596
|
+
|
|
590
597
|
/**
|
|
591
598
|
* Secrets that can be used in the headers for tool calls using the secret
|
|
592
599
|
* interpolation format.
|
|
@@ -763,11 +770,19 @@ export interface ObjectiveEvent {
|
|
|
763
770
|
* Elapsed time of the work this event records, when it is known at write time
|
|
764
771
|
* (e.g. assistant message generation, tool execution for result/error events).
|
|
765
772
|
* Unset means the event is instantaneous or the duration is not measurable.
|
|
766
|
-
* Serialized as a canonical duration string (e.g. "4.1s").
|
|
773
|
+
* Serialized as a canonical duration string (e.g. "4.1s"). Always set together
|
|
774
|
+
* with started_at.
|
|
767
775
|
*/
|
|
768
776
|
duration?: string;
|
|
769
777
|
|
|
770
778
|
info?: ObjectiveEventInfo;
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* When the work this event records began. Set together with duration, so the work
|
|
782
|
+
* interval is [started_at, started_at + duration]. The event's created_at remains
|
|
783
|
+
* the time the event was persisted.
|
|
784
|
+
*/
|
|
785
|
+
startedAt?: string;
|
|
771
786
|
}
|
|
772
787
|
|
|
773
788
|
export type ObjectiveEventData =
|
|
@@ -1123,6 +1138,18 @@ export interface ObjectiveInfo {
|
|
|
1123
1138
|
* Total number of tool calls made during execution
|
|
1124
1139
|
*/
|
|
1125
1140
|
totalToolCalls: number;
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* SubjectReference is the read-only echo of a resource's subject association,
|
|
1144
|
+
* carrying both Cadenya's canonical id and the customer's own key.
|
|
1145
|
+
*/
|
|
1146
|
+
subject?: WidgetSessionsAPI.SubjectReference;
|
|
1147
|
+
|
|
1148
|
+
/**
|
|
1149
|
+
* TenantReference is the read-only echo of a resource's tenant association,
|
|
1150
|
+
* carrying both Cadenya's canonical id and the customer's own key.
|
|
1151
|
+
*/
|
|
1152
|
+
tenant?: WidgetSessionsAPI.TenantReference;
|
|
1126
1153
|
}
|
|
1127
1154
|
|
|
1128
1155
|
export interface ObjectiveSecret {
|
|
@@ -1343,12 +1370,37 @@ export interface ObjectiveCreateParams {
|
|
|
1343
1370
|
*/
|
|
1344
1371
|
metadata?: Shared.CreateOperationMetadata;
|
|
1345
1372
|
|
|
1373
|
+
/**
|
|
1374
|
+
* Body param: Parameters forced onto this objective's tool calls. A pinned
|
|
1375
|
+
* parameter is an overlay on a tool's JSON schema: the parameter is removed from
|
|
1376
|
+
* what the LLM sees, and its value is always overwritten server-side with the
|
|
1377
|
+
* pinned value — the model cannot choose a different value for it.
|
|
1378
|
+
*/
|
|
1379
|
+
pinnedParameters?: { [key: string]: string };
|
|
1380
|
+
|
|
1346
1381
|
/**
|
|
1347
1382
|
* Body param: Secrets that can be used in the headers for tool calls using the
|
|
1348
1383
|
* secret interpolation format.
|
|
1349
1384
|
*/
|
|
1350
1385
|
secrets?: Array<ObjectiveCreateParams.Secret>;
|
|
1351
1386
|
|
|
1387
|
+
/**
|
|
1388
|
+
* Body param: SubjectAssertion identifies a person within a tenant in the
|
|
1389
|
+
* customer's own namespace — typically their user id. Asserting a subject upserts
|
|
1390
|
+
* the subject record under the asserted tenant and associates the created resource
|
|
1391
|
+
* with it. A subject assertion is only valid alongside a tenant assertion: subject
|
|
1392
|
+
* identifiers are scoped to their tenant.
|
|
1393
|
+
*/
|
|
1394
|
+
subject?: WidgetSessionsAPI.SubjectAssertion;
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* Body param: TenantAssertion identifies a tenant in the customer's own namespace
|
|
1398
|
+
* — their org, company, or team identifier for an end user. Asserting a tenant
|
|
1399
|
+
* upserts the tenant record in the workspace (keyed on `id` as the tenant's
|
|
1400
|
+
* external_id) and associates the created resource with it.
|
|
1401
|
+
*/
|
|
1402
|
+
tenant?: WidgetSessionsAPI.TenantAssertion;
|
|
1403
|
+
|
|
1352
1404
|
/**
|
|
1353
1405
|
* Body param: Optional explicit variation selection. Overrides the agent's
|
|
1354
1406
|
* variation_selection_mode.
|
|
@@ -1435,6 +1487,19 @@ export interface ObjectiveListParams extends CursorPaginationParams {
|
|
|
1435
1487
|
| 'STATE_CANCELLED'
|
|
1436
1488
|
| 'STATE_FINALIZED'
|
|
1437
1489
|
| 'STATE_TIMED_OUT';
|
|
1490
|
+
|
|
1491
|
+
/**
|
|
1492
|
+
* Query param: Filter to objectives associated with a subject. Accepts the
|
|
1493
|
+
* canonical `subj_…` form or the `external_id:<value>` form; the external_id form
|
|
1494
|
+
* is scoped within a tenant and requires `tenant_id` to also be set.
|
|
1495
|
+
*/
|
|
1496
|
+
subjectId?: string;
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Query param: Filter to objectives associated with a tenant. Accepts the
|
|
1500
|
+
* canonical `tenant_…` form or the `external_id:<value>` form.
|
|
1501
|
+
*/
|
|
1502
|
+
tenantId?: string;
|
|
1438
1503
|
}
|
|
1439
1504
|
|
|
1440
1505
|
export interface ObjectiveCancelParams {
|