@cadenya/cadenya 1.5.0 → 1.7.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/api.md +71 -3
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -1
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/agent-pools.d.ts +214 -0
- package/dist/resources/agent-pools.d.ts.map +1 -0
- package/dist/resources/agent-pools.js +157 -0
- package/dist/resources/agent-pools.js.map +1 -0
- package/dist/resources/objectives.d.ts +179 -14
- package/dist/resources/objectives.d.ts.map +1 -1
- package/dist/resources/objectives.js +73 -3
- package/dist/resources/objectives.js.map +1 -1
- package/dist/resources/profiles.d.ts +3 -3
- package/dist/resources/profiles.d.ts.map +1 -1
- package/dist/resources/profiles.js +1 -1
- package/dist/resources/profiles.js.map +1 -1
- package/dist/types.d.ts +611 -41
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +4 -1
- package/src/index.ts +1 -0
- package/src/resources/agent-pools.ts +287 -0
- package/src/resources/objectives.ts +213 -16
- package/src/resources/profiles.ts +4 -4
- package/src/types.ts +681 -42
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-pools.js","sourceRoot":"","sources":["../../src/resources/agent-pools.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,OAAO,EAA0C,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAsI7C,MAAM,OAAO,UAAU;IACQ;IAA7B,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,I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AM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;YAClH,IAAI,WAAW,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,uHAAuH,CAAC,CAAC;YACxK,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,gBAAgB,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,EAAE,CAAC;QAC/I,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,EAAU,EAAE,MAAiC,EAAE,OAAwB;QAC/E,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAY,GAAG,EAAE;YAC7C,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;YAClH,IAAI,WAAW,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,uHAAuH,CAAC,CAAC;YACxK,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,gBAAgB,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,EAAE,CAAC;QAC9I,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;CACF","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\nimport { HttpClient, RequestOptions, APIPromise, pathSegment, snapshotParams } from '../core/http.js';\nimport { Page } from '../core/pagination.js';\nimport type { AgentPool, AgentPoolServiceListAgentPoolsState, AgentPoolSpec, AgentPoolUpdateSpec, CreateResourceMetadata, ListAgentPoolsResponse, UpdateResourceMetadata } from '../types.js';\n\nexport interface AgentPoolListParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n /**\n * Maximum number of results to return\n */\n limit?: number;\n /**\n * Pagination cursor from previous response\n */\n cursor?: string;\n /**\n * Filter expression (query param: prefix)\n */\n prefix?: string;\n /**\n * Free-form search query\n */\n query?: string;\n /**\n * Filter by lifecycle state. Unspecified returns active and inactive pools;\n * explicitly select ARCHIVED to list archived pools.\n */\n state?: AgentPoolServiceListAgentPoolsState;\n /**\n * Filters by metadata labels. Comma-separated key=value pairs,\n * e.g. \"env=prod,team=ai\". A resource matches only if every pair\n * matches exactly (AND semantics).\n */\n labels?: string;\n /**\n * Sort order for results (asc or desc by creation time)\n */\n sortOrder?: string;\n /**\n * When true, the `info` field on each returned agent pool is populated. Requests\n * with this flag count more against your rate limit.\n */\n includeInfo?: boolean;\n}\n\nexport interface AgentPoolCreateParams {\n metadata: CreateResourceMetadata;\n spec: AgentPoolSpec;\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentPoolRetrieveParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentPoolDeleteParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentPoolUpdateParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n metadata?: UpdateResourceMetadata;\n spec?: AgentPoolUpdateSpec;\n /**\n * Fields to update. Only metadata and spec are mutable; top-level state and info\n * paths are invalid. spec.assignments replaces the entire membership list.\n * A spec mask replaces the full spec; * replaces all mutable fields.\n * Without a mask, infer paths from non-empty fields. Empty or omitted\n * membership then leaves the existing list unchanged. Element/index paths\n * are invalid. Validate the merged pool atomically: an empty description\n * or membership (including an explicitly masked empty list) is invalid.\n */\n updateMask?: string;\n}\n\nexport interface AgentPoolActivateParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentPoolArchiveParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentPoolDeactivateParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport interface AgentPoolUnarchiveParams {\n /**\n * Workspace ID.\n * \n * Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.\n */\n workspaceId?: string;\n}\n\nexport class AgentPools {\n constructor(private readonly _client: HttpClient) {}\n\n /**\n * List agent pools\n * \n * @example\n * ```ts\n * const page = await client.agentPools.list();\n * for await (const item of page) {\n * // auto-fetches every page\n * }\n * ```\n */\n async list(params?: AgentPoolListParams, options?: RequestOptions): Promise<Page<AgentPool>> {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n const _base = snapshotParams(params);\n const response = await this._client.request<ListAgentPoolsResponse>({ method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools`, query: { limit: params?.limit, cursor: params?.cursor, prefix: params?.prefix, query: params?.query, state: params?.state, labels: params?.labels, sortOrder: params?.sortOrder, includeInfo: params?.includeInfo } }, options);\n return new Page(response.items ?? [], response.pagination?.nextCursor, (cursor) => this.list({ ..._base, cursor: cursor }, options));\n }\n\n /**\n * Create a new agent pool\n * \n * @example\n * ```ts\n * const agentPool = await client.agentPools.create({ metadata: { name: 'sample' }, spec: { assignments: [{ agentId: 'sample' }], description: 'sample' } });\n * ```\n */\n create(params: AgentPoolCreateParams, options?: RequestOptions): APIPromise<AgentPool> {\n return this._client.requestAPI<AgentPool>(() => {\n const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools`, body: { metadata: params.metadata, spec: params.spec } };\n }, options);\n }\n\n /**\n * Get an agent pool by ID\n * \n * @example\n * ```ts\n * const agentPool = await client.agentPools.retrieve('_123');\n * ```\n */\n retrieve(id: string, params?: AgentPoolRetrieveParams, options?: RequestOptions): APIPromise<AgentPool> {\n return this._client.requestAPI<AgentPool>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools/${pathSegment('id', id)}` };\n }, options);\n }\n\n /**\n * Delete an agent pool\n * \n * @example\n * ```ts\n * await client.agentPools.delete('_123');\n * ```\n */\n delete(id: string, params?: AgentPoolDeleteParams, options?: RequestOptions): APIPromise<void> {\n return this._client.requestAPI<void>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'DELETE', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools/${pathSegment('id', id)}`, void: true };\n }, options);\n }\n\n /**\n * Update an agent pool\n * \n * @example\n * ```ts\n * const agentPool = await client.agentPools.update('_123');\n * ```\n */\n update(id: string, params?: AgentPoolUpdateParams, options?: RequestOptions): APIPromise<AgentPool> {\n return this._client.requestAPI<AgentPool>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'PATCH', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools/${pathSegment('id', id)}`, body: { metadata: params?.metadata, spec: params?.spec, updateMask: params?.updateMask } };\n }, options);\n }\n\n /**\n * Activate an agent pool\n * \n * @example\n * ```ts\n * const agentPool = await client.agentPools.activate('_123');\n * ```\n */\n activate(id: string, params?: AgentPoolActivateParams, options?: RequestOptions): APIPromise<AgentPool> {\n return this._client.requestAPI<AgentPool>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools/${pathSegment('id', id)}:activate` };\n }, options);\n }\n\n /**\n * Archive an agent pool\n * \n * @example\n * ```ts\n * const agentPool = await client.agentPools.archive('_123');\n * ```\n */\n archive(id: string, params?: AgentPoolArchiveParams, options?: RequestOptions): APIPromise<AgentPool> {\n return this._client.requestAPI<AgentPool>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools/${pathSegment('id', id)}:archive` };\n }, options);\n }\n\n /**\n * Deactivate an agent pool\n * \n * @example\n * ```ts\n * const agentPool = await client.agentPools.deactivate('_123');\n * ```\n */\n deactivate(id: string, params?: AgentPoolDeactivateParams, options?: RequestOptions): APIPromise<AgentPool> {\n return this._client.requestAPI<AgentPool>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools/${pathSegment('id', id)}:deactivate` };\n }, options);\n }\n\n /**\n * Unarchive an agent pool\n * \n * @example\n * ```ts\n * const agentPool = await client.agentPools.unarchive('_123');\n * ```\n */\n unarchive(id: string, params?: AgentPoolUnarchiveParams, options?: RequestOptions): APIPromise<AgentPool> {\n return this._client.requestAPI<AgentPool>(() => {\n const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;\n if (workspaceId === undefined) throw new Error(\"Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.\");\n return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/agent_pools/${pathSegment('id', id)}:unarchive` };\n }, options);\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpClient, RequestOptions, APIPromise } from '../core/http.js';
|
|
2
2
|
import { Page } from '../core/pagination.js';
|
|
3
3
|
import { Stream } from '../core/sse.js';
|
|
4
|
-
import type { AgentVariationSpec_CompactionConfig,
|
|
4
|
+
import type { AgentVariationSpec_CompactionConfig, ContinueObjectiveResponse, CreateAndStreamObjectiveRequest_Metadata, CreateAndStreamObjectiveResponse, CreateObjectiveRequest_Secret, CreateOperationMetadata, GetObjectiveDiagnosticsResponse, MemoryReference, Objective, ObjectiveContextWindow, ObjectiveEpisodicConfigParam, ObjectiveEvent, ObjectiveFeedback, ObjectiveFeedbackData, ObjectiveQueuedAction, ObjectiveServiceListObjectiveQueuedActionsState, ObjectiveServiceListObjectiveToolCallsExecutionStatus, ObjectiveServiceListObjectiveToolCallsStatus, ObjectiveServiceListObjectivesState, ObjectiveTool, ObjectiveToolCall, ObjectiveToolCallWithResult, SetToolCallContentRequest_ContentBlock, SubjectAssertion, TenantAssertion } from '../types.js';
|
|
5
5
|
export interface ObjectiveListParams {
|
|
6
6
|
/**
|
|
7
7
|
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
@@ -70,12 +70,6 @@ export interface ObjectiveListParams {
|
|
|
70
70
|
}
|
|
71
71
|
export interface ObjectiveCreateParams {
|
|
72
72
|
agentId: string;
|
|
73
|
-
/**
|
|
74
|
-
* Arbitrary data rendered into the selected variation's system_prompt_template
|
|
75
|
-
* (liquid) to produce the objective's system prompt. If the agent has a
|
|
76
|
-
* system_prompt_data_schema, this must satisfy it.
|
|
77
|
-
*/
|
|
78
|
-
systemPromptData: Record<string, unknown>;
|
|
79
73
|
/**
|
|
80
74
|
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
81
75
|
*/
|
|
@@ -85,6 +79,12 @@ export interface ObjectiveCreateParams {
|
|
|
85
79
|
*/
|
|
86
80
|
variationId?: string;
|
|
87
81
|
metadata?: CreateOperationMetadata;
|
|
82
|
+
/**
|
|
83
|
+
* Arbitrary data rendered into the selected variation's system_prompt_template
|
|
84
|
+
* (liquid) to produce the objective's system prompt. If the agent has a
|
|
85
|
+
* system_prompt_data_schema, this must satisfy it.
|
|
86
|
+
*/
|
|
87
|
+
systemPromptData?: Record<string, unknown>;
|
|
88
88
|
/**
|
|
89
89
|
* Optional explicit first user message for the LLM chat history. When not set,
|
|
90
90
|
* the selected variation's first_user_message_template is rendered with
|
|
@@ -254,6 +254,34 @@ export interface ObjectiveCreateFeedbackParams {
|
|
|
254
254
|
*/
|
|
255
255
|
workspaceId?: string;
|
|
256
256
|
}
|
|
257
|
+
export interface ObjectiveListQueuedActionsParams {
|
|
258
|
+
/**
|
|
259
|
+
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
260
|
+
*/
|
|
261
|
+
workspaceId?: string;
|
|
262
|
+
/**
|
|
263
|
+
* Maximum number of results to return
|
|
264
|
+
*/
|
|
265
|
+
limit?: number;
|
|
266
|
+
/**
|
|
267
|
+
* Pagination cursor from previous response
|
|
268
|
+
*/
|
|
269
|
+
cursor?: string;
|
|
270
|
+
/**
|
|
271
|
+
* Only return actions in this state. When unset, actions in every state are returned.
|
|
272
|
+
*/
|
|
273
|
+
state?: ObjectiveServiceListObjectiveQueuedActionsState;
|
|
274
|
+
}
|
|
275
|
+
export interface ObjectiveRemoveQueuedActionParams {
|
|
276
|
+
/**
|
|
277
|
+
* The ID of the queued action to remove.
|
|
278
|
+
*/
|
|
279
|
+
queuedActionId: string;
|
|
280
|
+
/**
|
|
281
|
+
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
282
|
+
*/
|
|
283
|
+
workspaceId?: string;
|
|
284
|
+
}
|
|
257
285
|
export interface ObjectiveListToolCallsParams {
|
|
258
286
|
/**
|
|
259
287
|
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
@@ -358,7 +386,7 @@ export interface ObjectiveCompactParams {
|
|
|
358
386
|
}
|
|
359
387
|
export interface ObjectiveContinueParams {
|
|
360
388
|
/**
|
|
361
|
-
* The message to
|
|
389
|
+
* The user message to send to the objective.
|
|
362
390
|
*/
|
|
363
391
|
message: string;
|
|
364
392
|
/**
|
|
@@ -366,10 +394,105 @@ export interface ObjectiveContinueParams {
|
|
|
366
394
|
*/
|
|
367
395
|
workspaceId?: string;
|
|
368
396
|
/**
|
|
369
|
-
* When
|
|
397
|
+
* When false, the objective must be waiting and the message is sent immediately.
|
|
398
|
+
* When true, a waiting objective still receives the message immediately; an
|
|
399
|
+
* objective whose agent loop is busy queues it instead, and the agent picks it
|
|
400
|
+
* up before its next assistant turn. Queued messages can be listed and removed
|
|
401
|
+
* until then.
|
|
370
402
|
*/
|
|
371
403
|
enqueue?: boolean;
|
|
372
404
|
}
|
|
405
|
+
export interface ObjectiveInterruptParams {
|
|
406
|
+
/**
|
|
407
|
+
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
408
|
+
*/
|
|
409
|
+
workspaceId?: string;
|
|
410
|
+
}
|
|
411
|
+
export interface ObjectiveCreateAndStreamParams {
|
|
412
|
+
agentId: string;
|
|
413
|
+
/**
|
|
414
|
+
* Required here, though Create objective leaves it optional: the external
|
|
415
|
+
* ID inside it is the idempotency key that makes a retry of this request
|
|
416
|
+
* resume the objective instead of starting another.
|
|
417
|
+
*/
|
|
418
|
+
metadata: CreateAndStreamObjectiveRequest_Metadata;
|
|
419
|
+
/**
|
|
420
|
+
* Defaults to the client-level `workspaceId` option or the CADENYA_WORKSPACE_ID environment variable.
|
|
421
|
+
*/
|
|
422
|
+
workspaceId?: string;
|
|
423
|
+
/**
|
|
424
|
+
* Optional explicit variation selection. Overrides the agent's variation_selection_mode.
|
|
425
|
+
*/
|
|
426
|
+
variationId?: string;
|
|
427
|
+
/**
|
|
428
|
+
* Arbitrary data rendered into the selected variation's system_prompt_template
|
|
429
|
+
* (liquid) to produce the objective's system prompt. If the agent has a
|
|
430
|
+
* system_prompt_data_schema, this must satisfy it.
|
|
431
|
+
*/
|
|
432
|
+
systemPromptData?: Record<string, unknown>;
|
|
433
|
+
/**
|
|
434
|
+
* Optional explicit first user message for the LLM chat history. When not set,
|
|
435
|
+
* the selected variation's first_user_message_template is rendered with
|
|
436
|
+
* first_user_message_data instead. If neither this field nor a
|
|
437
|
+
* first_user_message_template is present, the request is rejected with InvalidArgument.
|
|
438
|
+
*/
|
|
439
|
+
firstUserMessage?: string;
|
|
440
|
+
/**
|
|
441
|
+
* Secrets that can be used in the headers for tool calls using the secret interpolation format.
|
|
442
|
+
*/
|
|
443
|
+
secrets?: Array<CreateObjectiveRequest_Secret>;
|
|
444
|
+
/**
|
|
445
|
+
* Memory layers/entries layered over the baseline cascade inherited
|
|
446
|
+
* from the selected variation — element-level rules over inherited
|
|
447
|
+
* styles, in CSS terms.
|
|
448
|
+
*
|
|
449
|
+
* Array order is resolution order: EARLIER elements are more specific
|
|
450
|
+
* and are consulted first. Entries pinned via memory_entry_id behave
|
|
451
|
+
* as single-entry layers at their position.
|
|
452
|
+
*
|
|
453
|
+
* System-managed layers (e.g., episodic) cannot be referenced here;
|
|
454
|
+
* they attach themselves automatically based on the episodic key.
|
|
455
|
+
*
|
|
456
|
+
* Size cap: the TOTAL effective cascade (this field + the variation's
|
|
457
|
+
* memory layer assignments) must not exceed 10 entries. A request
|
|
458
|
+
* that would produce a larger cascade is rejected with
|
|
459
|
+
* InvalidArgument.
|
|
460
|
+
*/
|
|
461
|
+
memoryCascade?: Array<MemoryReference>;
|
|
462
|
+
/**
|
|
463
|
+
* Arbitrary data rendered into the selected variation's first_user_message_template
|
|
464
|
+
* (liquid) to produce the first user message. Separate from `system_prompt_data`,
|
|
465
|
+
* which renders the system prompt template.
|
|
466
|
+
*/
|
|
467
|
+
firstUserMessageData?: Record<string, unknown>;
|
|
468
|
+
/**
|
|
469
|
+
* If the agent variation that is selected has episodic memory enabled, then this key is used to create/update a memory layer
|
|
470
|
+
* specific to the episodic memory. The layer may have a TTL configured by the variation.
|
|
471
|
+
*/
|
|
472
|
+
episodicMemory?: ObjectiveEpisodicConfigParam;
|
|
473
|
+
/**
|
|
474
|
+
* Optional tenant assertion — the customer's org/company identifier for the
|
|
475
|
+
* end user this objective serves. Upserts the tenant record in the
|
|
476
|
+
* workspace and associates the objective with it.
|
|
477
|
+
*/
|
|
478
|
+
tenant?: TenantAssertion;
|
|
479
|
+
/**
|
|
480
|
+
* Optional subject assertion — the person within the tenant this objective
|
|
481
|
+
* serves. Requires `tenant`; a subject asserted without a tenant is
|
|
482
|
+
* rejected with InvalidArgument.
|
|
483
|
+
*/
|
|
484
|
+
subject?: SubjectAssertion;
|
|
485
|
+
/**
|
|
486
|
+
* Parameters forced onto this objective's tool calls. A pinned parameter
|
|
487
|
+
* is removed from the tool schema the LLM sees, and its value is always
|
|
488
|
+
* overwritten server-side with the pinned value — the model cannot choose
|
|
489
|
+
* a different value for it. By default a pinned key applies to every tool
|
|
490
|
+
* with a top-level parameter of the same name; a tool set's overlays
|
|
491
|
+
* (ToolSetSpec.overlays) can bind pinned keys to nested paths, differently
|
|
492
|
+
* named parameters, or a subset of tools.
|
|
493
|
+
*/
|
|
494
|
+
pinnedParameters?: Record<string, string>;
|
|
495
|
+
}
|
|
373
496
|
export declare class Objectives {
|
|
374
497
|
private readonly _client;
|
|
375
498
|
constructor(_client: HttpClient);
|
|
@@ -390,7 +513,7 @@ export declare class Objectives {
|
|
|
390
513
|
*
|
|
391
514
|
* @example
|
|
392
515
|
* ```ts
|
|
393
|
-
* const objective = await client.objectives.create({ agentId: 'sample'
|
|
516
|
+
* const objective = await client.objectives.create({ agentId: 'sample' });
|
|
394
517
|
* ```
|
|
395
518
|
*/
|
|
396
519
|
create(params: ObjectiveCreateParams, options?: RequestOptions): APIPromise<Objective>;
|
|
@@ -469,6 +592,27 @@ export declare class Objectives {
|
|
|
469
592
|
* ```
|
|
470
593
|
*/
|
|
471
594
|
createFeedback(objectiveId: string, params: ObjectiveCreateFeedbackParams, options?: RequestOptions): APIPromise<ObjectiveFeedback>;
|
|
595
|
+
/**
|
|
596
|
+
* List objective queued actions
|
|
597
|
+
*
|
|
598
|
+
* @example
|
|
599
|
+
* ```ts
|
|
600
|
+
* const page = await client.objectives.listQueuedActions('objective_123');
|
|
601
|
+
* for await (const item of page) {
|
|
602
|
+
* // auto-fetches every page
|
|
603
|
+
* }
|
|
604
|
+
* ```
|
|
605
|
+
*/
|
|
606
|
+
listQueuedActions(objectiveId: string, params?: ObjectiveListQueuedActionsParams, options?: RequestOptions): Promise<Page<ObjectiveQueuedAction>>;
|
|
607
|
+
/**
|
|
608
|
+
* Remove a queued action
|
|
609
|
+
*
|
|
610
|
+
* @example
|
|
611
|
+
* ```ts
|
|
612
|
+
* const objectiveQueuedAction = await client.objectives.removeQueuedAction('objective_123', { queuedActionId: 'queued_action_123' });
|
|
613
|
+
* ```
|
|
614
|
+
*/
|
|
615
|
+
removeQueuedAction(objectiveId: string, params: ObjectiveRemoveQueuedActionParams, options?: RequestOptions): APIPromise<ObjectiveQueuedAction>;
|
|
472
616
|
/**
|
|
473
617
|
* List objective tool calls
|
|
474
618
|
*
|
|
@@ -543,18 +687,39 @@ export declare class Objectives {
|
|
|
543
687
|
*
|
|
544
688
|
* @example
|
|
545
689
|
* ```ts
|
|
546
|
-
* const
|
|
690
|
+
* const objectiveQueuedAction = await client.objectives.compact('objective_123');
|
|
547
691
|
* ```
|
|
548
692
|
*/
|
|
549
|
-
compact(objectiveId: string, params?: ObjectiveCompactParams, options?: RequestOptions): APIPromise<
|
|
693
|
+
compact(objectiveId: string, params?: ObjectiveCompactParams, options?: RequestOptions): APIPromise<ObjectiveQueuedAction>;
|
|
550
694
|
/**
|
|
551
695
|
* Continue an objective
|
|
552
696
|
*
|
|
553
697
|
* @example
|
|
554
698
|
* ```ts
|
|
555
|
-
* const
|
|
699
|
+
* const continueObjectiveResponse = await client.objectives.continue('objective_123', { message: 'sample' });
|
|
700
|
+
* ```
|
|
701
|
+
*/
|
|
702
|
+
continue(objectiveId: string, params: ObjectiveContinueParams, options?: RequestOptions): APIPromise<ContinueObjectiveResponse>;
|
|
703
|
+
/**
|
|
704
|
+
* Interrupt an objective
|
|
705
|
+
*
|
|
706
|
+
* @example
|
|
707
|
+
* ```ts
|
|
708
|
+
* const objectiveEvent = await client.objectives.interrupt('objective_123');
|
|
709
|
+
* ```
|
|
710
|
+
*/
|
|
711
|
+
interrupt(objectiveId: string, params?: ObjectiveInterruptParams, options?: RequestOptions): APIPromise<ObjectiveEvent>;
|
|
712
|
+
/**
|
|
713
|
+
* Create an objective and stream its events
|
|
714
|
+
*
|
|
715
|
+
* @example
|
|
716
|
+
* ```ts
|
|
717
|
+
* const stream = await client.objectives.createAndStream({ agentId: 'sample', metadata: { externalId: 'sample' } });
|
|
718
|
+
* for await (const event of stream) {
|
|
719
|
+
* // typed event payloads; housekeeping frames are skipped
|
|
720
|
+
* }
|
|
556
721
|
* ```
|
|
557
722
|
*/
|
|
558
|
-
|
|
723
|
+
createAndStream(params: ObjectiveCreateAndStreamParams, options?: RequestOptions): Promise<Stream<CreateAndStreamObjectiveResponse>>;
|
|
559
724
|
}
|
|
560
725
|
//# sourceMappingURL=objectives.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectives.d.ts","sourceRoot":"","sources":["../../src/resources/objectives.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAe,UAAU,EAA+B,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EAAE,mCAAmC,EAAE,
|
|
1
|
+
{"version":3,"file":"objectives.d.ts","sourceRoot":"","sources":["../../src/resources/objectives.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAe,UAAU,EAA+B,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EAAE,mCAAmC,EAAE,yBAAyB,EAAE,wCAAwC,EAAE,gCAAgC,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,+BAA+B,EAA2N,eAAe,EAAE,SAAS,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,cAAc,EAAE,iBAAiB,EAAE,qBAAqB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,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAQ5G;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAQ1H;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAQ/H;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAQvH;;;;;;;;;;OAUG;IACG,eAAe,CAAC,MAAM,EAAE,8BAA8B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC;CAO3I"}
|
|
@@ -32,7 +32,7 @@ export class Objectives {
|
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```ts
|
|
35
|
-
* const objective = await client.objectives.create({ agentId: 'sample'
|
|
35
|
+
* const objective = await client.objectives.create({ agentId: 'sample' });
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
create(params, options) {
|
|
@@ -167,6 +167,41 @@ export class Objectives {
|
|
|
167
167
|
return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/objectives/${pathSegment('objectiveId', objectiveId)}/feedback`, body: { metadata: params.metadata, data: params.data } };
|
|
168
168
|
}, options);
|
|
169
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* List objective queued actions
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* const page = await client.objectives.listQueuedActions('objective_123');
|
|
176
|
+
* for await (const item of page) {
|
|
177
|
+
* // auto-fetches every page
|
|
178
|
+
* }
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
async listQueuedActions(objectiveId, params, options) {
|
|
182
|
+
const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
|
|
183
|
+
if (workspaceId === undefined)
|
|
184
|
+
throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
|
|
185
|
+
const _base = snapshotParams(params);
|
|
186
|
+
const response = await this._client.request({ method: 'GET', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/objectives/${pathSegment('objectiveId', objectiveId)}/queued_actions`, query: { limit: params?.limit, cursor: params?.cursor, state: params?.state } }, options);
|
|
187
|
+
return new Page(response.items ?? [], response.pagination?.nextCursor, (cursor) => this.listQueuedActions(objectiveId, { ..._base, cursor: cursor }, options));
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Remove a queued action
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```ts
|
|
194
|
+
* const objectiveQueuedAction = await client.objectives.removeQueuedAction('objective_123', { queuedActionId: 'queued_action_123' });
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
removeQueuedAction(objectiveId, params, options) {
|
|
198
|
+
return this._client.requestAPI(() => {
|
|
199
|
+
const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
|
|
200
|
+
if (workspaceId === undefined)
|
|
201
|
+
throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
|
|
202
|
+
return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/objectives/${pathSegment('objectiveId', objectiveId)}/queued_actions/${pathSegment('queuedActionId', params.queuedActionId)}:remove` };
|
|
203
|
+
}, options);
|
|
204
|
+
}
|
|
170
205
|
/**
|
|
171
206
|
* List objective tool calls
|
|
172
207
|
*
|
|
@@ -290,7 +325,7 @@ export class Objectives {
|
|
|
290
325
|
*
|
|
291
326
|
* @example
|
|
292
327
|
* ```ts
|
|
293
|
-
* const
|
|
328
|
+
* const objectiveQueuedAction = await client.objectives.compact('objective_123');
|
|
294
329
|
* ```
|
|
295
330
|
*/
|
|
296
331
|
compact(objectiveId, params, options) {
|
|
@@ -306,7 +341,7 @@ export class Objectives {
|
|
|
306
341
|
*
|
|
307
342
|
* @example
|
|
308
343
|
* ```ts
|
|
309
|
-
* const
|
|
344
|
+
* const continueObjectiveResponse = await client.objectives.continue('objective_123', { message: 'sample' });
|
|
310
345
|
* ```
|
|
311
346
|
*/
|
|
312
347
|
continue(objectiveId, params, options) {
|
|
@@ -317,5 +352,40 @@ export class Objectives {
|
|
|
317
352
|
return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/objectives/${pathSegment('objectiveId', objectiveId)}:continue`, body: { message: params.message, enqueue: params.enqueue } };
|
|
318
353
|
}, options);
|
|
319
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Interrupt an objective
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* const objectiveEvent = await client.objectives.interrupt('objective_123');
|
|
361
|
+
* ```
|
|
362
|
+
*/
|
|
363
|
+
interrupt(objectiveId, params, options) {
|
|
364
|
+
return this._client.requestAPI(() => {
|
|
365
|
+
const workspaceId = String(params?.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
|
|
366
|
+
if (workspaceId === undefined)
|
|
367
|
+
throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
|
|
368
|
+
return { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/objectives/${pathSegment('objectiveId', objectiveId)}:interrupt` };
|
|
369
|
+
}, options);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Create an objective and stream its events
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* ```ts
|
|
376
|
+
* const stream = await client.objectives.createAndStream({ agentId: 'sample', metadata: { externalId: 'sample' } });
|
|
377
|
+
* for await (const event of stream) {
|
|
378
|
+
* // typed event payloads; housekeeping frames are skipped
|
|
379
|
+
* }
|
|
380
|
+
* ```
|
|
381
|
+
*/
|
|
382
|
+
async createAndStream(params, options) {
|
|
383
|
+
const workspaceId = String(params.workspaceId ?? this._client.defaults['workspaceId'] ?? '').trim() || undefined;
|
|
384
|
+
if (workspaceId === undefined)
|
|
385
|
+
throw new Error("Missing 'workspaceId': pass it in params, set it on the client, or set the CADENYA_WORKSPACE_ID environment variable.");
|
|
386
|
+
const _spec = { method: 'POST', path: `/v1/workspaces/${pathSegment('workspaceId', workspaceId)}/objectives:stream`, body: { agentId: params.agentId, variationId: params.variationId, metadata: params.metadata, systemPromptData: params.systemPromptData, firstUserMessage: params.firstUserMessage, secrets: params.secrets, memoryCascade: params.memoryCascade, firstUserMessageData: params.firstUserMessageData, episodicMemory: wireObjectiveEpisodicConfig(params.episodicMemory), tenant: params.tenant, subject: params.subject, pinnedParameters: params.pinnedParameters }, stream: true };
|
|
387
|
+
const response = await this._client.rawRequest(_spec, options);
|
|
388
|
+
return new Stream(response, options?.signal, options?.lastEventId, ['ping', 'open'], options?.reconnect === false ? undefined : (lastEventId, signal) => this._client.rawRequest(_spec, { ...options, lastEventId, signal }));
|
|
389
|
+
}
|
|
320
390
|
}
|
|
321
391
|
//# sourceMappingURL=objectives.js.map
|