@empyria/restate 0.4.23 → 0.4.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,43 +61,6 @@ point, so the root import never loads the AI SDK. It needs the optional peer dep
61
61
  bun add ai @ai-sdk/openai-compatible @ai-sdk/provider
62
62
  ```
63
63
 
64
- ```js
65
- import { defineAgent } from '@empyria/restate/agent'
66
-
67
- export const triage = defineAgent({
68
- name: 'CorporateActionTriage',
69
- env: { LLM_BASE_URL: '', MODEL_ID: '' },
70
- system: 'You triage corporate action notices.',
71
- tools: {
72
- // a Restate call to another building block
73
- lookupIssuer: {
74
- description: 'Look up an issuer by ISIN',
75
- inputSchema: {
76
- type: 'object',
77
- properties: { isin: { type: 'string' } },
78
- required: ['isin'],
79
- },
80
- block: 'IssuerService',
81
- handler: 'get',
82
- },
83
- // a direct side effect in its own bounded ctx.run, gated by approval
84
- notifyDesk: {
85
- description: 'Notify the operations desk',
86
- inputSchema: { type: 'object', properties: { message: { type: 'string' } } },
87
- execute: async ({ message }, { idempotencyKey }) => sendToDesk(message, idempotencyKey),
88
- approval: {
89
- timeout: 4 * 3600_000,
90
- notify: { block: 'ApprovalInbox', handler: 'request' },
91
- },
92
- },
93
- },
94
- output: TriageResultSchema, // the model answers through a final_answer tool
95
- memory: 'none', // or 'session': a virtual object keyed by session, plus a reset handler
96
- limits: { maxSteps: 8, maxTokens: 50_000 },
97
- })
98
- // register `triage` on your endpoint, then: POST /CorporateActionTriage/ask {"prompt": "…"}
99
- ```
100
-
101
64
  | Module | Purpose |
102
65
  | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
103
66
  | [lib/agent/Agent.js](./lib/agent/Agent.js) | `defineAgent` — builds the service/object and its `ask` handler: validated I/O, `loadContext` that journals only the skill index, session memory (object state or an external `historyStore`), step/token budgets, invocation retry policy. `createAgentService` is the deprecated `AgentService` shortcut. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empyria/restate",
3
- "version": "0.4.23",
3
+ "version": "0.4.25",
4
4
  "description": "Restate.dev helpers for the Empyria nanoservice framework",
5
5
  "license": "MIT",
6
6
  "author": "Imre Fazekas <imre.fazekas@icloud.com>",
@@ -26,22 +26,22 @@
26
26
  "test:watch": "bun test --watch"
27
27
  },
28
28
  "dependencies": {
29
- "@empyria/classification": "0.1.10",
30
- "@empyria/common": "0.3.12",
29
+ "@empyria/classification": "0.1.11",
30
+ "@empyria/common": "0.3.13",
31
31
  "@restatedev/pubsub": "0.3.2",
32
32
  "@restatedev/pubsub-client": "0.3.2",
33
- "@restatedev/restate-sdk": "1.17.2",
34
- "@restatedev/restate-sdk-clients": "1.17.2",
35
- "@restatedev/restate-sdk-core": "1.17.2",
33
+ "@restatedev/restate-sdk": "1.17.3",
34
+ "@restatedev/restate-sdk-clients": "1.17.3",
35
+ "@restatedev/restate-sdk-core": "1.17.3",
36
36
  "croner": "10.0.1"
37
37
  },
38
38
  "devDependencies": {
39
- "@ai-sdk/openai-compatible": "3.0.65",
40
- "@ai-sdk/provider": "4.0.24",
41
- "@restatedev/restate-server": "1.7.13",
42
- "ai": "7.0.130",
43
- "oxfmt": "0.72.0",
44
- "oxlint": "1.87.0"
39
+ "@ai-sdk/openai-compatible": "3.0.69",
40
+ "@ai-sdk/provider": "4.0.27",
41
+ "@restatedev/restate-server": "1.8.0",
42
+ "ai": "7.0.141",
43
+ "oxfmt": "0.73.0",
44
+ "oxlint": "1.88.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@ai-sdk/openai-compatible": "^3.0.60",
@@ -63,5 +63,5 @@
63
63
  "bun": ">=1.4.2",
64
64
  "node": ">=26"
65
65
  },
66
- "packageManager": "bun@1.4.2"
66
+ "packageManager": "bun@1.4.3"
67
67
  }
@@ -180,10 +180,10 @@ describe('startSubWorkflow / callSubWorkflow', () => {
180
180
  let sentArgs
181
181
  /** @type {import('@restatedev/restate-sdk').Context} */
182
182
  const plainServiceCtx = { genericSend: (args) => (sentArgs = args) ?? 'handle' }
183
- startSubWorkflow(plainServiceCtx, 'CorporateActionWorkflow', 'CA08841DVCA26', {
183
+ startSubWorkflow(plainServiceCtx, 'DemoWorkflow', 'CA08841DVCA26', {
184
184
  triggeredBy: 'swift-upstream-sort',
185
185
  })
186
- expect(sentArgs.service).toBe('CorporateActionWorkflow')
186
+ expect(sentArgs.service).toBe('DemoWorkflow')
187
187
  expect(sentArgs.method).toBe('run')
188
188
  expect(sentArgs.key).toBe('CA08841DVCA26')
189
189
  })