perchai-cli 2.4.34 → 2.4.35
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/dist/perch.mjs +29 -5
- 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",
|
|
@@ -86724,7 +86724,6 @@ function truncateHistoryLine(value, max2) {
|
|
|
86724
86724
|
}
|
|
86725
86725
|
var init_operatorTruth = __esm({
|
|
86726
86726
|
"features/perchTerminal/runtime/operatorTruth.ts"() {
|
|
86727
|
-
"use strict";
|
|
86728
86727
|
}
|
|
86729
86728
|
});
|
|
86730
86729
|
|
|
@@ -134942,9 +134941,29 @@ function validateArgs(name, args) {
|
|
|
134942
134941
|
if (args.reason !== void 0 && typeof args.reason !== "string")
|
|
134943
134942
|
return "task_stop.reason must be a string.";
|
|
134944
134943
|
return null;
|
|
134945
|
-
case TOOL_NAMES.spawnWorker:
|
|
134946
|
-
|
|
134947
|
-
|
|
134944
|
+
case TOOL_NAMES.spawnWorker: {
|
|
134945
|
+
const hasWorkerId = typeof args.workerId === "string" && args.workerId.trim().length > 0;
|
|
134946
|
+
const customRaw = args.custom;
|
|
134947
|
+
if (!hasWorkerId && customRaw === void 0) {
|
|
134948
|
+
return "spawn_worker requires workerId (registered worker) or custom { displayName, allowedTools, ... } (ad-hoc worker).";
|
|
134949
|
+
}
|
|
134950
|
+
if (customRaw !== void 0) {
|
|
134951
|
+
if (!customRaw || typeof customRaw !== "object" || Array.isArray(customRaw)) {
|
|
134952
|
+
return "spawn_worker.custom must be an object.";
|
|
134953
|
+
}
|
|
134954
|
+
const custom = customRaw;
|
|
134955
|
+
if (typeof custom.displayName !== "string" || !custom.displayName.trim()) {
|
|
134956
|
+
return "spawn_worker.custom.displayName must be a non-empty string.";
|
|
134957
|
+
}
|
|
134958
|
+
if (custom.allowedTools !== void 0 && (!Array.isArray(custom.allowedTools) || !custom.allowedTools.every((tool) => typeof tool === "string"))) {
|
|
134959
|
+
return "spawn_worker.custom.allowedTools must be an array of tool name strings.";
|
|
134960
|
+
}
|
|
134961
|
+
if (custom.writesWorkspace !== void 0 && typeof custom.writesWorkspace !== "boolean") {
|
|
134962
|
+
return "spawn_worker.custom.writesWorkspace must be a boolean.";
|
|
134963
|
+
}
|
|
134964
|
+
if (custom.outputContract !== void 0 && typeof custom.outputContract !== "string") {
|
|
134965
|
+
return "spawn_worker.custom.outputContract must be a string.";
|
|
134966
|
+
}
|
|
134948
134967
|
}
|
|
134949
134968
|
if (typeof args.objective !== "string" || !args.objective.trim())
|
|
134950
134969
|
return "spawn_worker.objective must be a non-empty string.";
|
|
@@ -134964,6 +134983,7 @@ function validateArgs(name, args) {
|
|
|
134964
134983
|
if (args.maxIterations !== void 0 && !isPositiveNumber(args.maxIterations))
|
|
134965
134984
|
return "spawn_worker.maxIterations must be a positive number.";
|
|
134966
134985
|
return null;
|
|
134986
|
+
}
|
|
134967
134987
|
case TOOL_NAMES.dispatchAgent: {
|
|
134968
134988
|
if (Array.isArray(args.tasks)) {
|
|
134969
134989
|
if (args.tasks.length === 0)
|
|
@@ -205457,6 +205477,7 @@ var init_spawnWorker = __esm({
|
|
|
205457
205477
|
init_toolNames();
|
|
205458
205478
|
init_adhocManifest();
|
|
205459
205479
|
init_registry();
|
|
205480
|
+
init_workerManifest();
|
|
205460
205481
|
init_flockNicknames();
|
|
205461
205482
|
spawnWorkerTool = {
|
|
205462
205483
|
name: TOOL_NAMES.spawnWorker,
|
|
@@ -205475,6 +205496,9 @@ var init_spawnWorker = __esm({
|
|
|
205475
205496
|
errorCode: "adhoc_spec_invalid"
|
|
205476
205497
|
};
|
|
205477
205498
|
}
|
|
205499
|
+
if (workerId && customSpec && !resolveWorkerManifest(workerId)) {
|
|
205500
|
+
workerId = "";
|
|
205501
|
+
}
|
|
205478
205502
|
if (!workerId && customSpec) {
|
|
205479
205503
|
const { manifest, droppedTools } = buildAdhocWorkerManifest(customSpec);
|
|
205480
205504
|
registerWorkerManifest(manifest);
|