perchai-cli 2.4.34 → 2.4.36

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 (2) hide show
  1. package/dist/perch.mjs +47 -4
  2. package/package.json +1 -1
package/dist/perch.mjs CHANGED
@@ -75566,7 +75566,6 @@ var init_payroll = __esm({
75566
75566
  // lib/perchBusinessTools/index.ts
75567
75567
  var init_perchBusinessTools = __esm({
75568
75568
  "lib/perchBusinessTools/index.ts"() {
75569
- "use strict";
75570
75569
  init_generateAPAuditPacket();
75571
75570
  init_inventoryFolder();
75572
75571
  init_loadBusinessTables();
@@ -83127,6 +83126,7 @@ function listFinancialRoleIds() {
83127
83126
  var FINANCIAL_ROLE_REGISTRY, evidenceScoutManifest;
83128
83127
  var init_financialRoles = __esm({
83129
83128
  "features/perchTerminal/agentPlatform/financialRoles.ts"() {
83129
+ "use strict";
83130
83130
  FINANCIAL_ROLE_REGISTRY = /* @__PURE__ */ new Map();
83131
83131
  evidenceScoutManifest = {
83132
83132
  workerId: "evidence_scout",
@@ -134942,9 +134942,29 @@ function validateArgs(name, args) {
134942
134942
  if (args.reason !== void 0 && typeof args.reason !== "string")
134943
134943
  return "task_stop.reason must be a string.";
134944
134944
  return null;
134945
- case TOOL_NAMES.spawnWorker:
134946
- if (typeof args.workerId !== "string" || !args.workerId.trim()) {
134947
- return "spawn_worker.workerId must be a non-empty string.";
134945
+ case TOOL_NAMES.spawnWorker: {
134946
+ const hasWorkerId = typeof args.workerId === "string" && args.workerId.trim().length > 0;
134947
+ const customRaw = args.custom;
134948
+ if (!hasWorkerId && customRaw === void 0) {
134949
+ return "spawn_worker requires workerId (registered worker) or custom { displayName, allowedTools, ... } (ad-hoc worker).";
134950
+ }
134951
+ if (customRaw !== void 0) {
134952
+ if (!customRaw || typeof customRaw !== "object" || Array.isArray(customRaw)) {
134953
+ return "spawn_worker.custom must be an object.";
134954
+ }
134955
+ const custom = customRaw;
134956
+ if (typeof custom.displayName !== "string" || !custom.displayName.trim()) {
134957
+ return "spawn_worker.custom.displayName must be a non-empty string.";
134958
+ }
134959
+ if (custom.allowedTools !== void 0 && (!Array.isArray(custom.allowedTools) || !custom.allowedTools.every((tool) => typeof tool === "string"))) {
134960
+ return "spawn_worker.custom.allowedTools must be an array of tool name strings.";
134961
+ }
134962
+ if (custom.writesWorkspace !== void 0 && typeof custom.writesWorkspace !== "boolean") {
134963
+ return "spawn_worker.custom.writesWorkspace must be a boolean.";
134964
+ }
134965
+ if (custom.outputContract !== void 0 && typeof custom.outputContract !== "string") {
134966
+ return "spawn_worker.custom.outputContract must be a string.";
134967
+ }
134948
134968
  }
134949
134969
  if (typeof args.objective !== "string" || !args.objective.trim())
134950
134970
  return "spawn_worker.objective must be a non-empty string.";
@@ -134964,6 +134984,7 @@ function validateArgs(name, args) {
134964
134984
  if (args.maxIterations !== void 0 && !isPositiveNumber(args.maxIterations))
134965
134985
  return "spawn_worker.maxIterations must be a positive number.";
134966
134986
  return null;
134987
+ }
134967
134988
  case TOOL_NAMES.dispatchAgent: {
134968
134989
  if (Array.isArray(args.tasks)) {
134969
134990
  if (args.tasks.length === 0)
@@ -197902,6 +197923,15 @@ async function dispatchAgentHandler(args, ctx) {
197902
197923
  const agentCtx = {
197903
197924
  workspaceRoot,
197904
197925
  desktopConnected: ctx.desktopConnected,
197926
+ // CLI surface: children inherit the local bridge and server auth, same as
197927
+ // flock's buildSpawnContext — otherwise filesystem workers fail with
197928
+ // worker_desktop_workspace_required on the CLI.
197929
+ cliLocalTools: ctx.cliLocalTools === true,
197930
+ scopedFolderPath: ctx.scopedFolderPath,
197931
+ cliServerAppUrl: ctx.cliServerAppUrl ?? null,
197932
+ cliServerAccessToken: ctx.cliServerAccessToken ?? null,
197933
+ marketDeskProxyAppUrl: ctx.marketDeskProxyAppUrl ?? null,
197934
+ marketDeskProxyAccessToken: ctx.marketDeskProxyAccessToken ?? null,
197905
197935
  activeRootPath: ctx.activeRootPath,
197906
197936
  permissionMode: ctx.permissionMode,
197907
197937
  workspaceId: ctx.workspaceId,
@@ -205457,6 +205487,7 @@ var init_spawnWorker = __esm({
205457
205487
  init_toolNames();
205458
205488
  init_adhocManifest();
205459
205489
  init_registry();
205490
+ init_workerManifest();
205460
205491
  init_flockNicknames();
205461
205492
  spawnWorkerTool = {
205462
205493
  name: TOOL_NAMES.spawnWorker,
@@ -205475,6 +205506,9 @@ var init_spawnWorker = __esm({
205475
205506
  errorCode: "adhoc_spec_invalid"
205476
205507
  };
205477
205508
  }
205509
+ if (workerId && customSpec && !resolveWorkerManifest(workerId)) {
205510
+ workerId = "";
205511
+ }
205478
205512
  if (!workerId && customSpec) {
205479
205513
  const { manifest, droppedTools } = buildAdhocWorkerManifest(customSpec);
205480
205514
  registerWorkerManifest(manifest);
@@ -205534,6 +205568,15 @@ Proceed with the available context. If a missing fact is essential, ask the user
205534
205568
  {
205535
205569
  workspaceRoot: effectiveWorkspaceRoot(ctx),
205536
205570
  desktopConnected: ctx.desktopConnected,
205571
+ // CLI surface: children inherit the local bridge and server auth,
205572
+ // same as flock's buildSpawnContext — without these, every worker
205573
+ // needing filesystem access dies with worker_desktop_workspace_required.
205574
+ cliLocalTools: ctx.cliLocalTools === true,
205575
+ scopedFolderPath: ctx.scopedFolderPath,
205576
+ cliServerAppUrl: ctx.cliServerAppUrl ?? null,
205577
+ cliServerAccessToken: ctx.cliServerAccessToken ?? null,
205578
+ marketDeskProxyAppUrl: ctx.marketDeskProxyAppUrl ?? null,
205579
+ marketDeskProxyAccessToken: ctx.marketDeskProxyAccessToken ?? null,
205537
205580
  activeRootPath: ctx.activeRootPath,
205538
205581
  permissionMode: ctx.permissionMode,
205539
205582
  workspaceId: ctx.workspaceId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perchai-cli",
3
- "version": "2.4.34",
3
+ "version": "2.4.36",
4
4
  "description": "Perch AI command-line interface",
5
5
  "bin": {
6
6
  "perch": "bin/perch"