@elevasis/sdk 1.43.0 → 1.44.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "1.43.0",
3
+ "version": "1.44.0",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "type": "module",
6
6
  "bin": {
@@ -59,8 +59,8 @@
59
59
  "typescript": "5.9.2",
60
60
  "zod": "^4.1.0",
61
61
  "@repo/core": "0.58.0",
62
- "@repo/typescript-config": "0.0.0",
63
- "@repo/eslint-config": "0.0.0"
62
+ "@repo/eslint-config": "0.0.0",
63
+ "@repo/typescript-config": "0.0.0"
64
64
  },
65
65
  "scripts": {
66
66
  "lint": "eslint src --max-warnings 0",
@@ -271,28 +271,63 @@ Agents are autonomous resources that use an LLM and tools to complete a goal. Yo
271
271
 
272
272
  **Note:** Use `elevasis-sdk exec --async` when executing agents. Agents can run for minutes or longer, and the synchronous execute endpoint will time out for long-running runs. The `--async` flag returns an execution ID immediately and polls for the result.
273
273
 
274
+ There is no separate `agentConfig` object — agent-specific fields (`kind`, `systemPrompt`, `constraints`, `sessionCapable`, `securityLevel`, `memoryPreferences`) live directly on `config`, alongside the same identity fields a `WorkflowDefinition` uses. `modelConfig` is a sibling of `config`, not nested inside it. `kind` and `contract` are both required.
275
+
276
+ This example is a minimal single-shot (non-session) agent: one question in, one structured answer out. It is type-checked against the published `@elevasis/sdk` on every `pnpm check:docs-snippets` run — see `operations/src/example/example-agent.ts` in a scaffolded project for the working, OM-descriptor-bound copy (`resourceId` there derives from the OM Resource descriptor, same as the workflow example above; this version inlines the id directly to keep the snippet self-contained).
277
+
278
+ {/* doc-snippet:start:agent-definition-example */}
279
+
274
280
  ```typescript
275
281
  import type { AgentDefinition } from '@elevasis/sdk';
276
- import { resourceDescriptors } from '@core/config/organization-model';
282
+ import { z } from 'zod';
283
+
284
+ const inputSchema = z.object({
285
+ question: z.string().min(1),
286
+ });
287
+ const outputSchema = z.object({
288
+ answer: z.string(),
289
+ confidence: z.enum(['high', 'medium', 'low']),
290
+ });
277
291
 
278
292
  const myAgent: AgentDefinition = {
279
293
  config: {
280
- resource: resourceDescriptors.myAgent,
281
- resourceId: resourceDescriptors.myAgent.id,
282
- name: 'my-agent',
283
- type: resourceDescriptors.myAgent.kind,
284
- description: 'Answers questions using platform tools',
294
+ resourceId: 'my-agent',
295
+ name: 'My Agent',
296
+ description: 'Answers a single question with a structured, confidence-rated response.',
297
+ type: 'agent',
298
+ kind: 'utility',
299
+ version: '1.0.0',
285
300
  status: 'dev',
301
+ systemPrompt:
302
+ 'You answer a single question directly and concisely. State your confidence honestly.',
286
303
  },
287
- agentConfig: {
288
- model: { provider: 'openai', model: 'gpt-5' },
289
- systemPrompt: 'You are a helpful assistant.',
290
- maxIterations: 10,
291
- },
304
+ contract: { inputSchema, outputSchema },
292
305
  tools: [],
306
+ modelConfig: {
307
+ provider: 'anthropic',
308
+ model: 'claude-sonnet-5',
309
+ apiKey: process.env.ANTHROPIC_API_KEY ?? '',
310
+ },
293
311
  };
294
312
  ```
295
313
 
314
+ {/* doc-snippet:end:agent-definition-example */}
315
+
316
+ ### config (agent-specific fields)
317
+
318
+ | Field | Type | Description |
319
+ | ------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
320
+ | `kind` | `'orchestrator' | 'specialist' | 'utility' | 'platform'` | Required. What role this agent plays — not enforced at runtime today, but tenant-authored and validated at deploy against your OM resource descriptor's own `kind`. |
321
+ | `systemPrompt` | `string` | Required. The agent's base system prompt. |
322
+ | `constraints` | `{ maxIterations?, timeout?, maxSessionMemoryKeys?, maxMemoryTokens? }` (optional) | Iteration budget, execution timeout in ms, and session-memory limits. |
323
+ | `sessionCapable` | `boolean` (optional) | Opt in to multi-turn sessions. Defaults to `false` — the shape used in the example above, which completes and returns `contract.outputSchema` in a single turn. |
324
+ | `securityLevel` | `'standard' | 'hardened' | 'none'` (optional) | Prompt-hardening tier. Auto-derived from `sessionCapable` when omitted (`true` → `'hardened'`, `false` → `'standard'`). Never set `'none'` on a session-capable agent. |
325
+ | `memoryPreferences` | `string` (optional) | Guidance injected into the system prompt when session memory management is enabled. |
326
+
327
+ ### contract (agent)
328
+
329
+ `contract.inputSchema` is required, same as a workflow. `contract.outputSchema` is what a **non-session** (single-shot) agent like the example above returns — there is no conversational reply to read a structured answer from otherwise. A `sessionCapable: true` agent typically omits `outputSchema` and speaks through its conversational `message` instead.
330
+
296
331
  ---
297
332
 
298
333
  ## DeploymentSpec
@@ -59,20 +59,20 @@ config: {
59
59
 
60
60
  ## Execution Types
61
61
 
62
- | Type | Description |
63
- | -------------------- | ------------------------------------------------------------------------------ |
64
- | `WorkflowDefinition` | Complete workflow definition including config, contract, steps, and entryPoint |
65
- | `WorkflowStep` | Individual step definition with type, handler, and next routing |
66
- | `WorkflowConfig` | Metadata block: name, description, status, links, category |
67
- | `StepHandler` | Function type: `(input: unknown, context: StepContext) => Promise<unknown>` |
68
- | `NextConfig` | Union of `LinearNext` and `ConditionalNext` |
69
- | `LinearNext` | Fixed next step routing |
70
- | `ConditionalNext` | Branching step routing |
71
- | `StepType` | Runtime enum for step routing |
72
- | `AgentDefinition` | Complete agent definition including config, agentConfig, and tools |
73
- | `ExecutionContext` | Runtime context passed to step handlers |
74
- | `ExecutionMetadata` | Metadata about a running execution |
75
- | `ExecutionInterface` | Interface for triggering and inspecting executions |
62
+ | Type | Description |
63
+ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
64
+ | `WorkflowDefinition` | Complete workflow definition including config, contract, steps, and entryPoint |
65
+ | `WorkflowStep` | Individual step definition with type, handler, and next routing |
66
+ | `WorkflowConfig` | Metadata block: name, description, status, links, category |
67
+ | `StepHandler` | Function type: `(input: unknown, context: StepContext) => Promise<unknown>` |
68
+ | `NextConfig` | Union of `LinearNext` and `ConditionalNext` |
69
+ | `LinearNext` | Fixed next step routing |
70
+ | `ConditionalNext` | Branching step routing |
71
+ | `StepType` | Runtime enum for step routing |
72
+ | `AgentDefinition` | Complete agent definition: `config` (agent-specific fields live here directly, not in a separate `agentConfig`), `contract`, `tools`, and `modelConfig` |
73
+ | `ExecutionContext` | Runtime context passed to step handlers |
74
+ | `ExecutionMetadata` | Metadata about a running execution |
75
+ | `ExecutionInterface` | Interface for triggering and inspecting executions |
76
76
 
77
77
  ## ElevasConfig
78
78