agent-worker 0.17.0 → 0.19.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.
@@ -0,0 +1,20 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-wcPFST8Q.mjs";
2
+ //#region src/cli/output.ts
3
+ var output_exports = /* @__PURE__ */ __exportAll({ outputJson: () => outputJson });
4
+ /**
5
+ * CLI Output Utilities
6
+ *
7
+ * Rules:
8
+ * - --json mode: stdout = pure JSON data only, everything else to stderr
9
+ * - Errors: always to stderr via console.error + process.exit(1)
10
+ * - Exit codes: 0 = success, 1 = failure (authoritative for agent callers)
11
+ */
12
+ /**
13
+ * Output JSON data to stdout.
14
+ * Use this instead of raw console.log(JSON.stringify(...)) for consistency.
15
+ */
16
+ function outputJson(data) {
17
+ console.log(JSON.stringify(data, null, 2));
18
+ }
19
+ //#endregion
20
+ export { output_exports as n, outputJson as t };
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
@@ -0,0 +1,105 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-wcPFST8Q.mjs";
2
+ //#region src/cli/target.ts
3
+ var target_exports = /* @__PURE__ */ __exportAll({
4
+ DEFAULT_WORKSPACE: () => DEFAULT_WORKSPACE,
5
+ parseTarget: () => parseTarget
6
+ });
7
+ /**
8
+ * Target identifier utilities
9
+ *
10
+ * Format: agent@workspace:tag
11
+ * - agent: agent name (optional for @workspace references)
12
+ * - workspace: workspace name (optional, defaults to 'global')
13
+ * - tag: workspace instance tag (optional, nullable)
14
+ *
15
+ * Examples:
16
+ * - "alice" → { agent: "alice", workspace: "global", display: "alice" }
17
+ * - "alice@review" → { agent: "alice", workspace: "review", display: "alice@review" }
18
+ * - "alice@review:pr-123"→ { agent: "alice", workspace: "review", tag: "pr-123", display: "alice@review:pr-123" }
19
+ * - "@review" → { agent: undefined, workspace: "review", display: "@review" }
20
+ * - "@review:pr-123" → { agent: undefined, workspace: "review", tag: "pr-123", display: "@review:pr-123" }
21
+ *
22
+ * Display rules:
23
+ * - Omit @global (standalone agents): "alice" not "alice@global"
24
+ * - Omit :tag when no tag: "@review" not "@review:"
25
+ */
26
+ const DEFAULT_WORKSPACE = "global";
27
+ /**
28
+ * Parse target identifier from string
29
+ * Supports: "agent", "agent@workspace", "agent@workspace:tag", "@workspace", "@workspace:tag"
30
+ */
31
+ function parseTarget(input) {
32
+ if (input.startsWith("@")) {
33
+ const workspacePart = input.slice(1);
34
+ const colonIndex = workspacePart.indexOf(":");
35
+ if (colonIndex === -1) {
36
+ const workspace = workspacePart || "global";
37
+ return {
38
+ agent: void 0,
39
+ workspace,
40
+ tag: void 0,
41
+ full: `@${workspace}`,
42
+ display: `@${workspace}`
43
+ };
44
+ } else {
45
+ const workspace = workspacePart.slice(0, colonIndex) || "global";
46
+ const tag = workspacePart.slice(colonIndex + 1) || void 0;
47
+ return {
48
+ agent: void 0,
49
+ workspace,
50
+ tag,
51
+ full: tag ? `@${workspace}:${tag}` : `@${workspace}`,
52
+ display: buildDisplay(void 0, workspace, tag)
53
+ };
54
+ }
55
+ }
56
+ const atIndex = input.indexOf("@");
57
+ if (atIndex === -1) return {
58
+ agent: input,
59
+ workspace: DEFAULT_WORKSPACE,
60
+ tag: void 0,
61
+ full: `${input}@${DEFAULT_WORKSPACE}`,
62
+ display: input
63
+ };
64
+ const agent = input.slice(0, atIndex);
65
+ const workspacePart = input.slice(atIndex + 1);
66
+ const colonIndex = workspacePart.indexOf(":");
67
+ if (colonIndex === -1) {
68
+ const workspace = workspacePart || "global";
69
+ return {
70
+ agent,
71
+ workspace,
72
+ tag: void 0,
73
+ full: `${agent}@${workspace}`,
74
+ display: buildDisplay(agent, workspace, void 0)
75
+ };
76
+ } else {
77
+ const workspace = workspacePart.slice(0, colonIndex) || "global";
78
+ const tag = workspacePart.slice(colonIndex + 1) || void 0;
79
+ return {
80
+ agent,
81
+ workspace,
82
+ tag,
83
+ full: tag ? `${agent}@${workspace}:${tag}` : `${agent}@${workspace}`,
84
+ display: buildDisplay(agent, workspace, tag)
85
+ };
86
+ }
87
+ }
88
+ /**
89
+ * Build display string following display rules:
90
+ * - Omit @global for standalone agents
91
+ * - Omit :tag when no tag
92
+ */
93
+ function buildDisplay(agent, workspace, tag) {
94
+ const isGlobal = workspace === DEFAULT_WORKSPACE;
95
+ if (agent === void 0) {
96
+ if (tag) return `@${workspace}:${tag}`;
97
+ return `@${workspace}`;
98
+ }
99
+ if (isGlobal && !tag) return agent;
100
+ if (isGlobal && tag) return `${agent}@${workspace}:${tag}`;
101
+ if (!isGlobal && !tag) return `${agent}@${workspace}`;
102
+ return `${agent}@${workspace}:${tag}`;
103
+ }
104
+ //#endregion
105
+ export { parseTarget as n, target_exports as r, DEFAULT_WORKSPACE as t };
package/package.json CHANGED
@@ -1,23 +1,28 @@
1
1
  {
2
2
  "name": "agent-worker",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "SDK and CLI for creating and testing agent workers with Vercel AI SDK",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/lidessen/moniro.git",
8
+ "directory": "packages/agent-worker"
9
+ },
10
+ "bin": {
11
+ "agent-worker": "./dist/cli/index.mjs"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
5
16
  "type": "module",
6
17
  "main": "./dist/index.mjs",
7
18
  "module": "./dist/index.mjs",
8
19
  "types": "./dist/index.d.mts",
9
- "bin": {
10
- "agent-worker": "./dist/cli/index.mjs"
11
- },
12
20
  "exports": {
13
21
  ".": {
14
22
  "types": "./dist/index.d.mts",
15
23
  "import": "./dist/index.mjs"
16
24
  }
17
25
  },
18
- "files": [
19
- "dist"
20
- ],
21
26
  "scripts": {
22
27
  "dev": "tsdown --watch",
23
28
  "build": "tsdown",
@@ -33,41 +38,24 @@
33
38
  "prepublishOnly": "bun run build"
34
39
  },
35
40
  "dependencies": {
36
- "@ai-sdk/anthropic": "^3.0.0",
37
- "@ai-sdk/deepseek": "^1.0.0",
38
- "@ai-sdk/google": "^1.0.0",
39
- "@ai-sdk/groq": "^1.0.0",
40
- "@ai-sdk/mistral": "^1.0.0",
41
- "@ai-sdk/openai": "^3.0.0",
42
- "@ai-sdk/xai": "^1.0.0",
43
- "@clack/prompts": "^1.0.0",
44
- "@hono/node-server": "^1.19.9",
45
- "@modelcontextprotocol/sdk": "^1.26.0",
46
- "ai": "^6.0.69",
47
- "bash-tool": "^1.3.12",
48
- "chalk": "^5.6.2",
41
+ "@moniro/agent-loop": "workspace:*",
42
+ "@moniro/agent-worker": "workspace:*",
43
+ "@moniro/workspace": "workspace:*",
44
+ "@hono/node-server": "^1.19.11",
45
+ "@modelcontextprotocol/sdk": "^1.27.1",
49
46
  "commander": "^14.0.3",
50
- "execa": "^9.6.1",
51
- "hono": "^4.11.9",
52
- "just-bash": "^2.8.0",
47
+ "hono": "^4.12.5",
53
48
  "nanoid": "^5.1.6",
54
- "picocolors": "^1.1.1",
55
- "string-width": "^8.1.1",
56
- "wrap-ansi": "^9.0.2",
57
- "yaml": "^2.7.0",
58
- "zod": "^4.3.6"
49
+ "yaml": "^2.7.0"
59
50
  },
60
51
  "devDependencies": {
61
52
  "@types/bun": "latest",
62
53
  "@types/node": ">=22",
63
- "@typescript/native-preview": "^7.0.0-dev.20260203.1",
64
- "oxfmt": "^0.28.0",
65
- "oxlint": "^1.43.0",
66
- "tsdown": "^0.20.1"
67
- },
68
- "repository": {
69
- "type": "git",
70
- "url": "https://github.com/lidessen/moniro.git",
71
- "directory": "packages/agent-worker"
54
+ "@typescript/native-preview": "^7.0.0-dev.20260307.1",
55
+ "ai": "^6.0.116",
56
+ "oxfmt": "^0.36.0",
57
+ "oxlint": "^1.51.0",
58
+ "tsdown": "^0.21.0",
59
+ "typescript": "^5.8.3"
72
60
  }
73
61
  }