@cubicecho/agent-router-worker 0.2.0 → 0.4.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/lib.js CHANGED
@@ -1 +1 @@
1
- export { r as TOOL_ORIGIN_LOCAL, i as TOOL_ORIGIN_ROUTER, a as WorkerConfigError, n as executeRun, o as readWorkerConfig, t as startWorker } from "./chunks/worker-CIZuf0jz.js";
1
+ export { r as TOOL_ORIGIN_LOCAL, i as TOOL_ORIGIN_ROUTER, a as WorkerConfigError, n as executeRun, o as readWorkerConfig, t as startWorker } from "./chunks/worker-D1CclE3Q.js";
package/llms.txt ADDED
@@ -0,0 +1,21 @@
1
+ # @cubicecho/agent-router-worker
2
+
3
+ > agent-router's worker program: runs a workspace's agent loops on another machine.
4
+
5
+ Agent-facing docs for @cubicecho/agent-router-worker, one task or concept per page. Generated from _agents/docs/ by @cubicecho/agent-docs; edit the pages, not this file.
6
+
7
+ ## Docs
8
+
9
+ - [Install and run a worker](_agents/docs/01-install.md): `@cubicecho/agent-router-worker` is agent-router's worker: a program that dials a router with a worker key and runs the agent loops of the workspaces placed on it, with its own MCP servers as their tools. This page covers the command, its environment, and placing a workspace on it.
10
+ - [Common mistakes with the worker](_agents/docs/common-mistakes.md): Each entry is a mistake made running a worker or building on its library, what happens, and the fix.
11
+ - [Run a worker with your own loop](_agents/docs/custom-loop.md): `startWorker` runs each assignment on agent-core's `runAgentLoop`, or on the one its `runtime` names. This page covers replacing the loop, what a replacement must do, and testing one with `executeRun` and no router.
12
+ - [Local servers: the tools a worker gives its runs](_agents/docs/local-servers.md): A worker's runs reach its built-in `workdir` server and each MCP server the `WORKER_CONFIG` file names. This page covers that file, the environment and folder a server starts with, how tools are named, and what `workdir` offers.
13
+
14
+ ## Exports
15
+
16
+ - [`@cubicecho/agent-router-worker`](types/worker/lib.d.ts): the library. The declarations it re-exports from, beside it in `types/`, carry the doc comment of every export.
17
+ - `@cubicecho/agent-router-worker/package.json`: the manifest.
18
+
19
+ ## Elsewhere
20
+
21
+ - [The router's own pages](https://github.com/cubicecho/agent-router/tree/main/_agents/docs): its `/graphql`, `/v1`, `/mcp` and `/runs`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubicecho/agent-router-worker",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "agent-router's worker program: runs a workspace's agent loops on another machine.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,9 +19,14 @@
19
19
  "lib.js",
20
20
  "chunks",
21
21
  "types",
22
+ "llms.txt",
23
+ "_agents/docs",
22
24
  "README.md",
23
25
  "LICENSE"
24
26
  ],
27
+ "scripts": {
28
+ "prepack": "agent-docs llms"
29
+ },
25
30
  "engines": {
26
31
  "node": ">=22"
27
32
  },
@@ -121,17 +121,6 @@ export interface ConversationSettings {
121
121
  maxIdLength: number;
122
122
  }
123
123
  export declare const CONVERSATION_DEFAULTS: Readonly<ConversationSettings>;
124
- /**
125
- * The page sizes of this package's generated GraphQL lists. Depth, alias and cost limits are the host's handler's,
126
- * since they apply to the merged schema.
127
- */
128
- export interface OperationLimitSettings {
129
- /** Rows a list returns when the request names no `limit`. */
130
- defaultPageSize: number;
131
- /** The largest `limit` a request may ask for. Larger is refused, not trimmed. */
132
- maxPageSize: number;
133
- }
134
- export declare const OPERATION_LIMIT_DEFAULTS: Readonly<OperationLimitSettings>;
135
124
  /** Workspaces and their keys, as people write them. */
136
125
  export interface WorkspaceSettings {
137
126
  /** Longest name, in characters. */
@@ -146,3 +135,9 @@ export interface WorkspaceSettings {
146
135
  maxToolNameLength: number;
147
136
  }
148
137
  export declare const WORKSPACE_DEFAULTS: Readonly<WorkspaceSettings>;
138
+ /** The standalone host's connections to Postgres. Reaching it at boot is server-kit's `DATABASE_DEFAULTS`. */
139
+ export interface PoolSettings {
140
+ /** How long running queries get at shutdown before they are cancelled. */
141
+ closeTimeoutSeconds: number;
142
+ }
143
+ export declare const POOL_DEFAULTS: Readonly<PoolSettings>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Reads the message of any caught value.
3
+ *
4
+ * @param error - Whatever was thrown.
5
+ * @returns `error.message` for an Error, otherwise `String(error)`.
6
+ *
7
+ * @remarks
8
+ * server-kit has one too, but the runner and the worker program use this, and its entry would bundle Yoga into theirs.
9
+ */
10
+ export declare function errorMessage(error: unknown): string;
@@ -18,6 +18,8 @@ export declare const HttpStatus: {
18
18
  readonly GatewayTimeout: 504;
19
19
  };
20
20
  export type HttpStatus = (typeof HttpStatus)[keyof typeof HttpStatus];
21
+ /** The `code` a REST door answers its own failure with, as Yoga masks one on /graphql. The log says why. */
22
+ export declare const INTERNAL_ERROR: 'INTERNAL_SERVER_ERROR';
21
23
  /** What every workspace key starts with, so a leaked one is recognisable as the router's. */
22
24
  export declare const KEY_PREFIX = "air_";
23
25
  /** What every worker key starts with, so no door for apps or people mistakes one for theirs. */
package/worker.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { o as readWorkerConfig, s as errorMessage, t as startWorker } from "./chunks/worker-CIZuf0jz.js";
2
+ import { o as readWorkerConfig, s as errorMessage, t as startWorker } from "./chunks/worker-D1CclE3Q.js";
3
3
  // worker/index.ts
4
4
  /** Exits with this when the worker can't start, or is stopped twice. */
5
5
  const EXIT_FAILED = 1;