@empyria/restate 0.4.21 → 0.4.23

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
@@ -66,7 +66,7 @@ import { defineAgent } from '@empyria/restate/agent'
66
66
 
67
67
  export const triage = defineAgent({
68
68
  name: 'CorporateActionTriage',
69
- env: { LLM_BASE_URL: 'https://agent-bureau.vip/v1', MODEL_ID: 'vllm/ornith-1.5' },
69
+ env: { LLM_BASE_URL: '', MODEL_ID: '' },
70
70
  system: 'You triage corporate action notices.',
71
71
  tools: {
72
72
  // a Restate call to another building block
@@ -127,7 +127,8 @@ Cron expressions are `croner` patterns (five fields, or six with seconds for tes
127
127
  `setupRestate({ restateAdminURL, serviceURL: 'https://agent-service.internal:9080', services })` takes one complete URL, the
128
128
  address Restate reaches the endpoint at. It is registered as given and the endpoint listens on its port (80 or 443 when
129
129
  the URL has none or states the scheme's default), so the scheme is required (there is no separate host or port option);
130
- the health endpoint listens on the next port unless `healthPort` is set.
130
+ pass `port` when the endpoint listens on another port than the one in the URL (a container behind a Service or proxy). The
131
+ health endpoint listens on the port after that unless `healthPort` is set.
131
132
 
132
133
  It serves, registers the deployment, and deletes it again on SIGINT/SIGTERM. Invocations in flight are
133
134
  pinned to their deployment, so deleting it strands them: a restarted process cannot finish them and they can only be
package/lib/Admin.js CHANGED
@@ -623,6 +623,8 @@ export function defaultHealthCheck(req, res, { isHealthy, deploymentId, services
623
623
  * @param {string} params.serviceURL Complete URL Restate uses to reach this endpoint (e.g.
624
624
  * `https://agent-service.internal:9080`). It is registered as given, and the endpoint listens on its port: 80 or 443
625
625
  * when the URL has none or states the scheme's default (listening there needs the privilege to bind it).
626
+ * @param {number} [params.port] Port the endpoint listens on. Defaults to the port of `serviceURL`; set it when they
627
+ * differ (a container port behind a Service or proxy on another port).
626
628
  * @param {number} [params.healthPort] - Defaults to `port + 1`.
627
629
  * @param {Parameters<typeof restate.createEndpointHandler>[0]['services']} [params.services]
628
630
  * @param {() => void} [params.shutdownCallbackFn]
@@ -639,6 +641,7 @@ export function defaultHealthCheck(req, res, { isHealthy, deploymentId, services
639
641
  export async function setupRestate({
640
642
  restateAdminURL,
641
643
  serviceURL: serviceURLParam,
644
+ port: portParam,
642
645
  healthPort: healthPortParam,
643
646
  services = [],
644
647
  shutdownCallbackFn,
@@ -647,7 +650,8 @@ export async function setupRestate({
647
650
  keepDeploymentOnShutdown = false,
648
651
  forceRegistration = false,
649
652
  }) {
650
- const { serviceURL, port } = parseServiceURL(serviceURLParam)
653
+ const { serviceURL, port: serviceURLPort } = parseServiceURL(serviceURLParam)
654
+ const port = portParam ?? serviceURLPort
651
655
  const healthPort = healthPortParam ?? port + 1
652
656
 
653
657
  const handler = restate.createEndpointHandler({ services })
@@ -43,7 +43,7 @@ export function readLlmEnv(source = process.env) {
43
43
  /**
44
44
  * AI SDK Core model, pointed at an OpenAI-compatible endpoint — Bifrost
45
45
  * (llm-system's gateway) by default, fully overridable via env. `LLM_BASE_URL`
46
- * already includes the `/v1` suffix Bifrost's own docs use (`https://agent-bureau.vip/v1`);
46
+ * already includes the `/v1` suffix Bifrost's own docs use (``);
47
47
  * `MODEL_ID` defaults to `vllm/ornith-1.5`, the currently-live routed model ID on that
48
48
  * gateway (see llm-system's README, "Verifying").
49
49
  * @param {{LLM_BASE_URL: string, LLM_API_KEY?: string, MODEL_ID: string}} env
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empyria/restate",
3
- "version": "0.4.21",
3
+ "version": "0.4.23",
4
4
  "description": "Restate.dev helpers for the Empyria nanoservice framework",
5
5
  "license": "MIT",
6
6
  "author": "Imre Fazekas <imre.fazekas@icloud.com>",