wayang-ai 0.9.2 โ†’ 0.9.3

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.
Files changed (3) hide show
  1. package/README.md +4 -2
  2. package/dist/cli.js +85 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -82,6 +82,8 @@ On first run, an interactive setup wizard will guide you through configuring you
82
82
 
83
83
  On first run, Wayang launches an interactive setup wizard. Just fill in your LLM provider details.
84
84
 
85
+ For every field, worker type, and troubleshooting, see the [configuration guide](docs/guides/configuration.md).
86
+
85
87
  Or create `~/.wayang.config.json` manually:
86
88
 
87
89
  ```json
@@ -149,8 +151,8 @@ wayang --resume --all # list all sessions to pick
149
151
 
150
152
  ```json
151
153
  "workers": {
152
- "codebuddy": { "type": "codebuddy-acp", "description": "Tencent CodeBuddy Code (ACP)", "capabilities": ["code","refactor","shell"] },
153
- "opencode": { "type": "opencode-acp", "description": "OpenCode (ACP)", "capabilities": ["code","refactor","shell"] }
154
+ "codebuddy": { "type": "codebuddy", "description": "Tencent CodeBuddy Code (ACP)", "capabilities": ["code","refactor","shell"] },
155
+ "opencode": { "type": "opencode", "description": "OpenCode (ACP)", "capabilities": ["code","refactor","shell"] }
154
156
  }
155
157
  ```
156
158
 
package/dist/cli.js CHANGED
@@ -1411,9 +1411,24 @@ import { join as join7 } from "path";
1411
1411
  import { get, set, cloneDeep } from "lodash-es";
1412
1412
 
1413
1413
  // src/types/config.ts
1414
- var WORKER_TYPES = ["claude-code", "codebuddy-acp", "opencode-acp"];
1414
+ var WORKER_TYPES = ["claude-code", "acp", "codebuddy", "opencode"];
1415
+ var DEPRECATED_WORKER_TYPES = {
1416
+ "codebuddy-acp": "codebuddy",
1417
+ "opencode-acp": "opencode"
1418
+ };
1419
+ function normalizeWorkerTypes(config, warn) {
1420
+ for (const [id, worker] of Object.entries(config.workers ?? {})) {
1421
+ if (typeof worker !== "object" || worker === null) continue;
1422
+ const current = worker.type;
1423
+ if (typeof current !== "string") continue;
1424
+ const canonical = DEPRECATED_WORKER_TYPES[current];
1425
+ if (!canonical) continue;
1426
+ worker.type = canonical;
1427
+ warn(`worker type '${current}' is deprecated, use '${canonical}' (workers.${id})`);
1428
+ }
1429
+ }
1415
1430
  function isAcpWorkerType(type) {
1416
- return type === "codebuddy-acp" || type === "opencode-acp";
1431
+ return type === "acp" || type === "codebuddy" || type === "opencode";
1417
1432
  }
1418
1433
  var ACP_TIMEOUT_KEYS = ["handshakeMs", "sessionNewMs", "promptMs", "permissionMs", "cancelGraceMs", "sigtermWaitMs"];
1419
1434
  var ACP_CAPABILITY_KEYS = ["permissionRequests", "toolCalls"];
@@ -1442,16 +1457,22 @@ function validateWorkerEntry(id, worker) {
1442
1457
  return `${at}.emoji must be a string (got ${JSON.stringify(worker.emoji)})`;
1443
1458
  }
1444
1459
  if (type === "claude-code") {
1445
- for (const key of ["command", "args", "env", "protocol"]) {
1460
+ for (const key of ["command", "args", "env", "protocol", "trustUpdatesAfterCancel"]) {
1446
1461
  if (worker[key] !== void 0) {
1447
1462
  return `${at}.${key} is not supported for type "claude-code" (claude-code uses cliPath)`;
1448
1463
  }
1449
1464
  }
1450
1465
  }
1451
1466
  if (isAcpWorkerType(worker.type)) {
1467
+ if (worker.type === "acp" && (worker.command === void 0 || worker.command === "")) {
1468
+ return `${at}.command is required for type "acp" (set workers.${id}.command to the ACP agent executable)`;
1469
+ }
1452
1470
  if (worker.command !== void 0 && (typeof worker.command !== "string" || worker.command.length === 0)) {
1453
1471
  return `${at}.command must be a non-empty string (got ${JSON.stringify(worker.command)})`;
1454
1472
  }
1473
+ if (worker.trustUpdatesAfterCancel !== void 0 && typeof worker.trustUpdatesAfterCancel !== "boolean") {
1474
+ return `${at}.trustUpdatesAfterCancel must be a boolean (got ${JSON.stringify(worker.trustUpdatesAfterCancel)})`;
1475
+ }
1455
1476
  if (worker.args !== void 0 && (!Array.isArray(worker.args) || worker.args.some((a) => typeof a !== "string"))) {
1456
1477
  return `${at}.args must be an array of strings (got ${JSON.stringify(worker.args)})`;
1457
1478
  }
@@ -1561,7 +1582,7 @@ function collectWorkerWarnings(config) {
1561
1582
  warnings.push(`workers.${id}.maxTurns has no effect on type "${worker.type}" (ACP has no turn cap)`);
1562
1583
  }
1563
1584
  if (worker.cliPath !== void 0) {
1564
- warnings.push(`workers.${id}.cliPath has no effect on type "${worker.type}" (*-acp workers use "command")`);
1585
+ warnings.push(`workers.${id}.cliPath has no effect on type "${worker.type}" (ACP workers use "command")`);
1565
1586
  }
1566
1587
  }
1567
1588
  return warnings;
@@ -3381,9 +3402,11 @@ var PUPPET_DEFAULTS = {
3381
3402
  capabilities: ["code", "debug", "refactor", "search", "file-io", "web-search", "shell"]
3382
3403
  };
3383
3404
  var ACP_PROVIDER_EMOJIS = {
3384
- "codebuddy-acp": "\u{1F427}",
3405
+ acp: "\u{1F9E9}",
3406
+ // ๐Ÿงฉ generic config-driven ACP worker
3407
+ codebuddy: "\u{1F427}",
3385
3408
  // ๐Ÿง Tencent CodeBuddy
3386
- "opencode-acp": "\u{1F989}"
3409
+ opencode: "\u{1F989}"
3387
3410
  // ๐Ÿฆ‰ OpenCode (experimental)
3388
3411
  };
3389
3412
  function getWorkerMeta(workerType, workerConfigs) {
@@ -5671,7 +5694,7 @@ function AppContent() {
5671
5694
  // package.json
5672
5695
  var package_default = {
5673
5696
  name: "wayang-ai",
5674
- version: "0.9.2",
5697
+ version: "0.9.3",
5675
5698
  description: "Multi-agent orchestration platform",
5676
5699
  type: "module",
5677
5700
  license: "MIT",
@@ -5945,7 +5968,7 @@ async function buildConfigInteractive() {
5945
5968
  if (workerConfig) {
5946
5969
  config.workers = { "claude-code": workerConfig };
5947
5970
  }
5948
- console.log(' Tip: ACP workers (codebuddy-acp / opencode-acp) can be added later under "workers" in the config file.');
5971
+ console.log(' Tip: ACP workers (acp / codebuddy / opencode) can be added later under "workers" in the config file.');
5949
5972
  return config;
5950
5973
  }
5951
5974
  async function loadConfig(configPath2, options = {}) {
@@ -5987,6 +6010,7 @@ async function loadConfig(configPath2, options = {}) {
5987
6010
  }
5988
6011
  }
5989
6012
  fillApiKeys(config);
6013
+ normalizeWorkerTypes(config, (message) => console.warn(`Warning: ${message}`));
5990
6014
  warnDeprecatedPermissionKeys(config.permission, (message) => console.warn(`Warning: ${message}`));
5991
6015
  for (const warning of collectWorkerWarnings(config)) {
5992
6016
  console.warn(`Warning: ${warning}`);
@@ -7698,12 +7722,25 @@ var HARD_CONSTRAINTS = section(
7698
7722
  - NEVER mention internal concepts (Controller, Worker, signals) to the user. You are just "Wayang".`
7699
7723
  );
7700
7724
  var ACP_WORKER_HINT = "external ACP agent: no update_progress/done tools (it ends each turn by itself); chat_worker messages are delivered at its next turn boundary; sensitive operations still surface as permission requests you must answer; it needs its CLI installed and logged in \u2014 a missing CLI fails the task fast with an install hint";
7725
+ function acpTagFor(config) {
7726
+ switch (config.type) {
7727
+ case "acp":
7728
+ return `acp:${config.command ?? "acp"}`;
7729
+ case "codebuddy":
7730
+ return "acp:codebuddy";
7731
+ case "opencode":
7732
+ return "acp:opencode";
7733
+ default:
7734
+ return null;
7735
+ }
7736
+ }
7701
7737
  function buildWorkerList(workers) {
7702
7738
  const lines = [`- \`puppet\` \u2014 ${PUPPET_DEFAULTS.description} [${PUPPET_DEFAULTS.capabilities.join(", ")}]`];
7703
7739
  if (workers) {
7704
7740
  for (const [id, config] of Object.entries(workers)) {
7705
7741
  const caps = config.capabilities?.length ? ` [${config.capabilities.join(", ")}]` : "";
7706
- const acp = config.type.endsWith("-acp") ? ` [acp:${config.type.slice(0, -"-acp".length)}] \u2014 ${ACP_WORKER_HINT}` : "";
7742
+ const acpTag = acpTagFor(config);
7743
+ const acp = acpTag ? ` [${acpTag}] \u2014 ${ACP_WORKER_HINT}` : "";
7707
7744
  lines.push(`- \`${id}\` \u2014 ${config.description}${caps}${acp}`);
7708
7745
  }
7709
7746
  }
@@ -13422,6 +13459,22 @@ var BaseAcpWorker = class {
13422
13459
  ctx.sessionId
13423
13460
  );
13424
13461
  }
13462
+ // --- Five hooks (02 ยง2) โ€” all defaulted, override optional ---
13463
+ /**
13464
+ * 1) Launch: command/args (user overrides win), env merged, cwd. The
13465
+ * default is the config-driven pass-through: `workers.<id>.command` /
13466
+ * `.args` (empty when unset). No default executable exists โ€” a missing
13467
+ * command fails fast here so the run layer surfaces an explicit error
13468
+ * instead of spawning an empty argv. Missing CLI on PATH is preflighted by
13469
+ * the skeleton. Provider subclasses keep overriding with their measured
13470
+ * default executable and fallbacks.
13471
+ */
13472
+ buildLaunch(view) {
13473
+ if (!view.command) {
13474
+ throw new AcpError("agent-error", 'workers.<id>.command is required for the generic "acp" worker type (no default executable)');
13475
+ }
13476
+ return { command: view.command, args: view.args ?? [], env: view.env, cwd: view.cwd, timeouts: view.timeouts };
13477
+ }
13425
13478
  /**
13426
13479
  * 2) Permission: the default implementation walks the shared bridge
13427
13480
  * (04 booklet); providers override only when they must not.
@@ -13484,6 +13537,17 @@ var BaseAcpWorker = class {
13484
13537
  if (ctx.handshake.protocolVersion === 1) return { ready: true };
13485
13538
  return { ready: false, message: acpUserMessage("protocol-mismatch", { command: this._launchCommand }) };
13486
13539
  }
13540
+ /**
13541
+ * 5) Stop strategy โ€” provider-measured values override (03 booklet). The
13542
+ * default is CLI-neutral and conservative, chosen because no specific CLI
13543
+ * behavior backs anything wider: cancelGraceMs 5000 / sigtermWaitMs 2000 /
13544
+ * trustUpdatesAfterCancel FALSE โ€” post-cancel updates are dropped and
13545
+ * counted rather than written, so steps that ran after a user cancel are
13546
+ * never recorded as if they were sanctioned.
13547
+ */
13548
+ stopPolicy() {
13549
+ return { cancelGraceMs: 5e3, sigtermWaitMs: 2e3, trustUpdatesAfterCancel: false };
13550
+ }
13487
13551
  // --- IWorkerInstance surface (aligned with ClaudeCodeWorker) ---
13488
13552
  /** Wire signal context. Called by the engine before run(); grants/approvalMemory are the 04 ยง3 additions. */
13489
13553
  setSignalContext(deps) {
@@ -14124,6 +14188,14 @@ var OpenCodeAcpWorker = class _OpenCodeAcpWorker extends AcpWorkerRun {
14124
14188
  }
14125
14189
  };
14126
14190
 
14191
+ // src/services/agents/acp/generic-acp-worker.ts
14192
+ var GenericAcpWorker = class extends AcpWorkerRun {
14193
+ /** Neutral grace ladder (see the base default); trust is config-driven. */
14194
+ stopPolicy() {
14195
+ return { cancelGraceMs: 5e3, sigtermWaitMs: 2e3, trustUpdatesAfterCancel: this.config.trustUpdatesAfterCancel ?? false };
14196
+ }
14197
+ };
14198
+
14127
14199
  // src/utils/llm-error.ts
14128
14200
  function formatLlmError(err) {
14129
14201
  if (!(err instanceof Error)) return String(err);
@@ -16472,9 +16544,11 @@ var WorkerDispatchEngine = class extends WorkerWiringEngine {
16472
16544
  // ACP workers: same constructor shape as ClaudeCodeWorker (freeze ยง7 โ‘ ).
16473
16545
  // Construction never spawns โ€” a missing CLI fails fast in run() (C1
16474
16546
  // preflight), so the createWorker stage cannot crash on it.
16475
- case "codebuddy-acp":
16547
+ case "acp":
16548
+ return new GenericAcpWorker(config, this.ctx.sessionDir, workspaceDir2, this.ctx, this.skills);
16549
+ case "codebuddy":
16476
16550
  return new CodebuddyAcpWorker(config, this.ctx.sessionDir, workspaceDir2, this.ctx, this.skills);
16477
- case "opencode-acp":
16551
+ case "opencode":
16478
16552
  return new OpenCodeAcpWorker(config, this.ctx.sessionDir, workspaceDir2, this.ctx, this.skills);
16479
16553
  default: {
16480
16554
  const _exhaustive = config.type;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wayang-ai",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Multi-agent orchestration platform",
5
5
  "type": "module",
6
6
  "license": "MIT",