@cadenya/cadenya 1.6.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 +23 -3
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- 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 +336 -25
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/resources/objectives.ts +213 -16
- package/src/resources/profiles.ts +4 -4
- package/src/types.ts +366 -26
package/api.md
CHANGED
|
@@ -138,7 +138,7 @@ client.workspaceAdmin.removeMember(profileId: string, params?: WorkspaceAdminRem
|
|
|
138
138
|
Retrieves the profile for the credentials accessing the API
|
|
139
139
|
|
|
140
140
|
```ts
|
|
141
|
-
client.profiles.whoami(options?: RequestOptions): APIPromise<
|
|
141
|
+
client.profiles.whoami(options?: RequestOptions): APIPromise<WhoamiResponse>
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
## workspaces
|
|
@@ -520,6 +520,16 @@ Submit feedback for an objective
|
|
|
520
520
|
```ts
|
|
521
521
|
client.objectives.createFeedback(objectiveId: string, params: ObjectiveCreateFeedbackParams, options?: RequestOptions): APIPromise<ObjectiveFeedback>
|
|
522
522
|
```
|
|
523
|
+
List objective queued actions
|
|
524
|
+
|
|
525
|
+
```ts
|
|
526
|
+
client.objectives.listQueuedActions(objectiveId: string, params?: ObjectiveListQueuedActionsParams, options?: RequestOptions): Promise<Page<ObjectiveQueuedAction>>
|
|
527
|
+
```
|
|
528
|
+
Remove a queued action
|
|
529
|
+
|
|
530
|
+
```ts
|
|
531
|
+
client.objectives.removeQueuedAction(objectiveId: string, params: ObjectiveRemoveQueuedActionParams, options?: RequestOptions): APIPromise<ObjectiveQueuedAction>
|
|
532
|
+
```
|
|
523
533
|
List objective tool calls
|
|
524
534
|
|
|
525
535
|
```ts
|
|
@@ -558,12 +568,22 @@ client.objectives.cancel(objectiveId: string, params?: ObjectiveCancelParams, op
|
|
|
558
568
|
Compact an objective
|
|
559
569
|
|
|
560
570
|
```ts
|
|
561
|
-
client.objectives.compact(objectiveId: string, params?: ObjectiveCompactParams, options?: RequestOptions): APIPromise<
|
|
571
|
+
client.objectives.compact(objectiveId: string, params?: ObjectiveCompactParams, options?: RequestOptions): APIPromise<ObjectiveQueuedAction>
|
|
562
572
|
```
|
|
563
573
|
Continue an objective
|
|
564
574
|
|
|
565
575
|
```ts
|
|
566
|
-
client.objectives.continue(objectiveId: string, params: ObjectiveContinueParams, options?: RequestOptions): APIPromise<
|
|
576
|
+
client.objectives.continue(objectiveId: string, params: ObjectiveContinueParams, options?: RequestOptions): APIPromise<ContinueObjectiveResponse>
|
|
577
|
+
```
|
|
578
|
+
Interrupt an objective
|
|
579
|
+
|
|
580
|
+
```ts
|
|
581
|
+
client.objectives.interrupt(objectiveId: string, params?: ObjectiveInterruptParams, options?: RequestOptions): APIPromise<ObjectiveEvent>
|
|
582
|
+
```
|
|
583
|
+
Create an objective and stream its events
|
|
584
|
+
|
|
585
|
+
```ts
|
|
586
|
+
client.objectives.createAndStream(params: ObjectiveCreateAndStreamParams, options?: RequestOptions): Promise<Stream<CreateAndStreamObjectiveResponse>>
|
|
567
587
|
```
|
|
568
588
|
|
|
569
589
|
## toolSearch
|
package/dist/client.js
CHANGED
|
@@ -52,7 +52,7 @@ export class Cadenya {
|
|
|
52
52
|
authHeader: () => ({ Authorization: `Bearer ${apiKey}` }),
|
|
53
53
|
maxRetries: options.maxRetries ?? 0,
|
|
54
54
|
timeout: options.timeout,
|
|
55
|
-
defaultHeaders: { ...nodeUserAgent('cadenya-typescript/1.
|
|
55
|
+
defaultHeaders: { ...nodeUserAgent('cadenya-typescript/1.6.0 (api 1.0)'), ...options.defaultHeaders },
|
|
56
56
|
fetch: options.fetch,
|
|
57
57
|
logger: options.logger,
|
|
58
58
|
logLevel: options.logLevel,
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,w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AAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;AAClC,CAAC","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\nimport { HttpClient } from './core/http.js';\nimport type { Logger, LogLevel } from './core/http.js';\nimport { Webhooks } from './webhooks.js';\nimport { Accounts } from './resources/accounts.js';\nimport { ApiKeys } from './resources/api-keys.js';\nimport { WorkspaceAdmin } from './resources/workspace-admin.js';\nimport { Profiles } from './resources/profiles.js';\nimport { Workspaces } from './resources/workspaces.js';\nimport { AgentPools } from './resources/agent-pools.js';\nimport { Agents } from './resources/agents.js';\nimport { AiProviderKeys } from './resources/ai-provider-keys.js';\nimport { Models } from './resources/models.js';\nimport { MemoryLayers } from './resources/memory-layers.js';\nimport { Objectives } from './resources/objectives.js';\nimport { ToolSearch } from './resources/tool-search.js';\nimport { Tenants } from './resources/tenants.js';\nimport { ToolSets } from './resources/tool-sets.js';\nimport { Uploads } from './resources/uploads.js';\nimport { WidgetSessions } from './resources/widget-sessions.js';\nimport { Widgets } from './resources/widgets.js';\nimport { WorkspaceSecrets } from './resources/workspace-secrets.js';\n\nexport interface ClientOptions {\n /** API key. Defaults to the CADENYA_API_KEY environment variable. */\n apiKey?: string;\n /** Override the API base URL. Defaults to https://api.cadenya.com. */\n baseURL?: string;\n /** Max automatic retries for retryable failures. Defaults to 0. */\n maxRetries?: number;\n /**\n * Deadline for ordinary (non-streaming) requests in milliseconds; override\n * per request with `options.timeout`. Streams bound only response-header\n * acquisition — body lifetime stays under the caller's AbortSignal.\n * Defaults to 60000; a non-finite or <= 0 value disables the deadline.\n */\n timeout?: number;\n /** Additional request headers. Browsers supply their own User-Agent by default. */\n defaultHeaders?: Record<string, string>;\n /** Custom fetch implementation. */\n fetch?: typeof fetch;\n /** Destination for SDK logs. Defaults to `console`. */\n logger?: Logger;\n /** 'debug' | 'warn' (default) | 'off'. Never logs headers or bodies. */\n logLevel?: LogLevel;\n /** Default `workspaceId` for every call that takes one. Defaults to the CADENYA_WORKSPACE_ID environment variable. */\n workspaceId?: string;\n /** Secret for webhook signature verification. Defaults to the CADENYA_WEBHOOK_SECRET environment variable. */\n webhookSecret?: string;\n}\n\nexport class Cadenya {\n readonly accounts: Accounts;\n readonly apiKeys: ApiKeys;\n readonly workspaceAdmin: WorkspaceAdmin;\n readonly profiles: Profiles;\n readonly workspaces: Workspaces;\n readonly agentPools: AgentPools;\n readonly agents: Agents;\n readonly aiProviderKeys: AiProviderKeys;\n readonly models: Models;\n readonly memoryLayers: MemoryLayers;\n readonly objectives: Objectives;\n readonly toolSearch: ToolSearch;\n readonly tenants: Tenants;\n readonly toolSets: ToolSets;\n readonly uploads: Uploads;\n readonly widgetSessions: WidgetSessions;\n readonly widgets: Widgets;\n readonly workspaceSecrets: WorkspaceSecrets;\n readonly webhooks: Webhooks;\n\n private readonly _client: HttpClient;\n\n constructor(options: ClientOptions = {}) {\n // Presence is not validity: empty strings from options or environment\n // are configuration mistakes, not credentials.\n const apiKey = resolveOption('apiKey', options.apiKey, readEnv('CADENYA_API_KEY'));\n if (!apiKey) {\n throw new Error(\n \"Missing API key. Pass it with `new Cadenya({ apiKey })` or set the CADENYA_API_KEY environment variable.\",\n );\n }\n this._client = new HttpClient({\n baseURL: resolveOption('baseURL', options.baseURL, readEnv('CADENYA_BASE_URL')) ?? 'https://api.cadenya.com',\n authHeader: () => ({ Authorization: `Bearer ${apiKey}` }),\n maxRetries: options.maxRetries ?? 0,\n timeout: options.timeout,\n defaultHeaders: { ...nodeUserAgent('cadenya-typescript/1.5.0 (api 1.0)'), ...options.defaultHeaders },\n fetch: options.fetch,\n logger: options.logger,\n logLevel: options.logLevel,\n defaults: { workspaceId: resolveOption('workspaceId', options.workspaceId, readEnv('CADENYA_WORKSPACE_ID')) },\n });\n this.webhooks = new Webhooks(resolveOption('webhookSecret', options.webhookSecret, readEnv('CADENYA_WEBHOOK_SECRET')));\n this.accounts = new Accounts(this._client);\n this.apiKeys = new ApiKeys(this._client);\n this.workspaceAdmin = new WorkspaceAdmin(this._client);\n this.profiles = new Profiles(this._client);\n this.workspaces = new Workspaces(this._client);\n this.agentPools = new AgentPools(this._client);\n this.agents = new Agents(this._client);\n this.aiProviderKeys = new AiProviderKeys(this._client);\n this.models = new Models(this._client);\n this.memoryLayers = new MemoryLayers(this._client);\n this.objectives = new Objectives(this._client);\n this.toolSearch = new ToolSearch(this._client);\n this.tenants = new Tenants(this._client);\n this.toolSets = new ToolSets(this._client);\n this.uploads = new Uploads(this._client);\n this.widgetSessions = new WidgetSessions(this._client);\n this.widgets = new Widgets(this._client);\n this.workspaceSecrets = new WorkspaceSecrets(this._client);\n }\n}\n\n// Browser-authored User-Agent headers require CORS permission. Only Node-compatible\n// runtimes receive the SDK default; browsers and workers use their native header.\nfunction nodeUserAgent(value: string): Record<string, string> {\n const nodeVersion = (globalThis as { process?: { versions?: { node?: string } } })\n .process?.versions?.node;\n return nodeVersion ? { 'User-Agent': value } : {};\n}\n\nfunction readEnv(name: string): string | undefined {\n const env = (globalThis as { process?: { env?: Record<string, string | undefined> } })\n .process?.env;\n return env?.[name];\n}\n\n// Presence is not validity: an explicitly provided option must be usable —\n// a blank value is a configuration mistake and never silently falls back to\n// the environment or a default. Only an OMITTED option reads the env.\nfunction resolveOption(\n label: string,\n explicit: string | undefined,\n env: string | undefined,\n): string | undefined {\n if (explicit !== undefined) {\n const value = explicit.trim();\n if (!value) {\n throw new Error(\n `${label} must not be blank when provided explicitly; omit it to use the environment instead.`,\n );\n }\n return value;\n }\n return env?.trim() || undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CA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,CAAC,CAAC;QACzC,IAAI,CAAC,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF;AAED,oFAAoF;AACpF,kFAAkF;AAClF,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,WAAW,GAAI,UAA6D;SAC/E,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC;IAC3B,OAAO,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IAC3B,MAAM,GAAG,GAAI,UAAyE;SACnF,OAAO,EAAE,GAAG,CAAC;IAChB,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,2EAA2E;AAC3E,4EAA4E;AAC5E,sEAAsE;AACtE,SAAS,aAAa,CACpB,KAAa,EACb,QAA4B,EAC5B,GAAuB;IAEvB,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,sFAAsF,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;AAClC,CAAC","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\nimport { HttpClient } from './core/http.js';\nimport type { Logger, LogLevel } from './core/http.js';\nimport { Webhooks } from './webhooks.js';\nimport { Accounts } from './resources/accounts.js';\nimport { ApiKeys } from './resources/api-keys.js';\nimport { WorkspaceAdmin } from './resources/workspace-admin.js';\nimport { Profiles } from './resources/profiles.js';\nimport { Workspaces } from './resources/workspaces.js';\nimport { AgentPools } from './resources/agent-pools.js';\nimport { Agents } from './resources/agents.js';\nimport { AiProviderKeys } from './resources/ai-provider-keys.js';\nimport { Models } from './resources/models.js';\nimport { MemoryLayers } from './resources/memory-layers.js';\nimport { Objectives } from './resources/objectives.js';\nimport { ToolSearch } from './resources/tool-search.js';\nimport { Tenants } from './resources/tenants.js';\nimport { ToolSets } from './resources/tool-sets.js';\nimport { Uploads } from './resources/uploads.js';\nimport { WidgetSessions } from './resources/widget-sessions.js';\nimport { Widgets } from './resources/widgets.js';\nimport { WorkspaceSecrets } from './resources/workspace-secrets.js';\n\nexport interface ClientOptions {\n /** API key. Defaults to the CADENYA_API_KEY environment variable. */\n apiKey?: string;\n /** Override the API base URL. Defaults to https://api.cadenya.com. */\n baseURL?: string;\n /** Max automatic retries for retryable failures. Defaults to 0. */\n maxRetries?: number;\n /**\n * Deadline for ordinary (non-streaming) requests in milliseconds; override\n * per request with `options.timeout`. Streams bound only response-header\n * acquisition — body lifetime stays under the caller's AbortSignal.\n * Defaults to 60000; a non-finite or <= 0 value disables the deadline.\n */\n timeout?: number;\n /** Additional request headers. Browsers supply their own User-Agent by default. */\n defaultHeaders?: Record<string, string>;\n /** Custom fetch implementation. */\n fetch?: typeof fetch;\n /** Destination for SDK logs. Defaults to `console`. */\n logger?: Logger;\n /** 'debug' | 'warn' (default) | 'off'. Never logs headers or bodies. */\n logLevel?: LogLevel;\n /** Default `workspaceId` for every call that takes one. Defaults to the CADENYA_WORKSPACE_ID environment variable. */\n workspaceId?: string;\n /** Secret for webhook signature verification. Defaults to the CADENYA_WEBHOOK_SECRET environment variable. */\n webhookSecret?: string;\n}\n\nexport class Cadenya {\n readonly accounts: Accounts;\n readonly apiKeys: ApiKeys;\n readonly workspaceAdmin: WorkspaceAdmin;\n readonly profiles: Profiles;\n readonly workspaces: Workspaces;\n readonly agentPools: AgentPools;\n readonly agents: Agents;\n readonly aiProviderKeys: AiProviderKeys;\n readonly models: Models;\n readonly memoryLayers: MemoryLayers;\n readonly objectives: Objectives;\n readonly toolSearch: ToolSearch;\n readonly tenants: Tenants;\n readonly toolSets: ToolSets;\n readonly uploads: Uploads;\n readonly widgetSessions: WidgetSessions;\n readonly widgets: Widgets;\n readonly workspaceSecrets: WorkspaceSecrets;\n readonly webhooks: Webhooks;\n\n private readonly _client: HttpClient;\n\n constructor(options: ClientOptions = {}) {\n // Presence is not validity: empty strings from options or environment\n // are configuration mistakes, not credentials.\n const apiKey = resolveOption('apiKey', options.apiKey, readEnv('CADENYA_API_KEY'));\n if (!apiKey) {\n throw new Error(\n \"Missing API key. Pass it with `new Cadenya({ apiKey })` or set the CADENYA_API_KEY environment variable.\",\n );\n }\n this._client = new HttpClient({\n baseURL: resolveOption('baseURL', options.baseURL, readEnv('CADENYA_BASE_URL')) ?? 'https://api.cadenya.com',\n authHeader: () => ({ Authorization: `Bearer ${apiKey}` }),\n maxRetries: options.maxRetries ?? 0,\n timeout: options.timeout,\n defaultHeaders: { ...nodeUserAgent('cadenya-typescript/1.6.0 (api 1.0)'), ...options.defaultHeaders },\n fetch: options.fetch,\n logger: options.logger,\n logLevel: options.logLevel,\n defaults: { workspaceId: resolveOption('workspaceId', options.workspaceId, readEnv('CADENYA_WORKSPACE_ID')) },\n });\n this.webhooks = new Webhooks(resolveOption('webhookSecret', options.webhookSecret, readEnv('CADENYA_WEBHOOK_SECRET')));\n this.accounts = new Accounts(this._client);\n this.apiKeys = new ApiKeys(this._client);\n this.workspaceAdmin = new WorkspaceAdmin(this._client);\n this.profiles = new Profiles(this._client);\n this.workspaces = new Workspaces(this._client);\n this.agentPools = new AgentPools(this._client);\n this.agents = new Agents(this._client);\n this.aiProviderKeys = new AiProviderKeys(this._client);\n this.models = new Models(this._client);\n this.memoryLayers = new MemoryLayers(this._client);\n this.objectives = new Objectives(this._client);\n this.toolSearch = new ToolSearch(this._client);\n this.tenants = new Tenants(this._client);\n this.toolSets = new ToolSets(this._client);\n this.uploads = new Uploads(this._client);\n this.widgetSessions = new WidgetSessions(this._client);\n this.widgets = new Widgets(this._client);\n this.workspaceSecrets = new WorkspaceSecrets(this._client);\n }\n}\n\n// Browser-authored User-Agent headers require CORS permission. Only Node-compatible\n// runtimes receive the SDK default; browsers and workers use their native header.\nfunction nodeUserAgent(value: string): Record<string, string> {\n const nodeVersion = (globalThis as { process?: { versions?: { node?: string } } })\n .process?.versions?.node;\n return nodeVersion ? { 'User-Agent': value } : {};\n}\n\nfunction readEnv(name: string): string | undefined {\n const env = (globalThis as { process?: { env?: Record<string, string | undefined> } })\n .process?.env;\n return env?.[name];\n}\n\n// Presence is not validity: an explicitly provided option must be usable —\n// a blank value is a configuration mistake and never silently falls back to\n// the environment or a default. Only an OMITTED option reads the env.\nfunction resolveOption(\n label: string,\n explicit: string | undefined,\n env: string | undefined,\n): string | undefined {\n if (explicit !== undefined) {\n const value = explicit.trim();\n if (!value) {\n throw new Error(\n `${label} must not be blank when provided explicitly; omit it to use the environment instead.`,\n );\n }\n return value;\n }\n return env?.trim() || undefined;\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,EAAE,qBAAqB,EAAE,+CAA+C,EAAE,qDAAqD,EAAE,4CAA4C,EAAE,mCAAmC,EAAE,aAAa,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,sCAAsC,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGx8B,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MA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,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
|