perchai-cli 2.4.32 → 2.4.33

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 +61 -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();
@@ -91010,7 +91009,6 @@ Final answers lead with findings, name artifacts or delivery status, and give on
91010
91009
  var MARKET_DESK_TOOL_NAMES;
91011
91010
  var init_marketDeskAccess = __esm({
91012
91011
  "features/perchTerminal/runtime/marketDesk/marketDeskAccess.ts"() {
91013
- "use strict";
91014
91012
  init_toolNames();
91015
91013
  MARKET_DESK_TOOL_NAMES = /* @__PURE__ */ new Set([
91016
91014
  TOOL_NAMES.getMarketSignal,
@@ -221429,6 +221427,27 @@ var init_flockRoles = __esm({
221429
221427
  "Return JSON with verificationStatus (pass|partial|fail), verifiedClaims, unsupportedClaims, warnings."
221430
221428
  )
221431
221429
  },
221430
+ consistency_checker: {
221431
+ roleId: "consistency_checker",
221432
+ workerId: "flock_consistency_checker",
221433
+ displayName: "Consistency Checker",
221434
+ role: "verifier",
221435
+ lane: "verifier",
221436
+ allowedTools: [
221437
+ TOOL_NAMES.searchKnowledge,
221438
+ TOOL_NAMES.readLocalFile,
221439
+ TOOL_NAMES.listLocalSources,
221440
+ TOOL_NAMES.readLocalSourceFile
221441
+ ],
221442
+ writesWorkspace: false,
221443
+ maxIterations: 8,
221444
+ outputContract: "JSON { continuityStatus: 'pass'|'partial'|'fail', contradictions, styleIssues, warnings }",
221445
+ objectiveTemplate: (task) => bounded(
221446
+ task,
221447
+ "Review the provided draft for internal consistency and craft: continuity of characters, names, timeline, and established facts; tone and voice drift; pacing; clich\xE9s. Do not fact-check against external sources.",
221448
+ "Return JSON with continuityStatus (pass|partial|fail), contradictions (string[]), styleIssues (string[]), warnings (string[])."
221449
+ )
221450
+ },
221432
221451
  browser_operator: {
221433
221452
  roleId: "browser_operator",
221434
221453
  // Reuses the roster manifest from workers/registry — its system prompt and
@@ -221503,7 +221522,16 @@ function planFlock(rawTask, options = {}) {
221503
221522
  if (selected.has("patch_worker") || selected.has("test_runner") || selected.has("ui_reviewer")) {
221504
221523
  selected.add("workspace_scout");
221505
221524
  }
221506
- if (selected.has("writer")) selected.add("researcher");
221525
+ if (selected.has("writer")) {
221526
+ const grounded = selected.has("researcher") || selected.has("citation_checker") || selected.has("source_verifier");
221527
+ if (grounded) {
221528
+ selected.add("researcher");
221529
+ selected.add("citation_checker");
221530
+ selected.delete("consistency_checker");
221531
+ } else {
221532
+ selected.add("consistency_checker");
221533
+ }
221534
+ }
221507
221535
  if (selected.size === 0) {
221508
221536
  selected.add("workspace_scout");
221509
221537
  selected.add("evidence_reviewer");
@@ -221563,6 +221591,7 @@ var init_flockPlanner = __esm({
221563
221591
  { roleId: "researcher", pattern: /\b(research|sources?|find|look up|references?|citations?|academic|papers?|literature|background)\b/i },
221564
221592
  { roleId: "writer", pattern: /\b(write|draft|compose|essay|memo|report|article|document|copy)\b/i },
221565
221593
  { roleId: "citation_checker", pattern: /\b(citations?|verify|check sources?|fact.?check|references?)\b/i },
221594
+ { roleId: "consistency_checker", pattern: /\b(fiction|stor(?:y|ies)|novel|chapters?|poems?|screenplay|scripts?|lyrics)\b/i },
221566
221595
  { roleId: "browser_operator", pattern: /\b(browser|open|navigate|click|fill|submit|login|webpage|url|site)\b/i }
221567
221596
  ];
221568
221597
  ROLE_TRIM_PRIORITY = [
@@ -221572,6 +221601,7 @@ var init_flockPlanner = __esm({
221572
221601
  "workspace_scout",
221573
221602
  "researcher",
221574
221603
  "citation_checker",
221604
+ "consistency_checker",
221575
221605
  "evidence_reviewer",
221576
221606
  "source_verifier",
221577
221607
  "ui_reviewer",
@@ -221609,7 +221639,8 @@ function buildFlockPlannerPrompts(ctx) {
221609
221639
  `- At most ${writeCap} workers with writesWorkspace=true; each writer needs a disjoint, clearly scoped responsibility, and writeJustification is required for more than ${resolveFlockWriteWorkerCap({ permissionMode: null, planJustifiesMoreWriters: false })}.`,
221610
221640
  `- maxIterations: 1-${caps.maxIterationsPerWorker}.`,
221611
221641
  "- dependsOn: ids of earlier workers whose output this worker needs. No cycles. You decide the graph: parallel where independent, chained where not. Final verifier/reducer workers usually benefit from depending on the workers they check \u2014 guidance, not a requirement.",
221612
- "- baseWorkerId: set ONLY to reuse an id from existingWorkers; otherwise null.",
221642
+ "- baseWorkerId: set ONLY to reuse an id from existingWorkers; otherwise null. Prefer reusing existingWorkers ids when a role matches instead of inventing a near-duplicate.",
221643
+ "- Writing tasks: pair the draft with exactly ONE draft verifier \u2014 reuse flock_citation_checker (together with flock_researcher) when the piece makes factual or source-backed claims, or flock_consistency_checker for creative/fiction drafts (continuity, voice, pacing \u2014 no researcher, never demand citations from fiction).",
221613
221644
  "- Decline (accepted=false, with reason) tasks that are trivial, conversational, or need no fanout."
221614
221645
  ].join("\n");
221615
221646
  ensureFlockWorkersRegistered();
@@ -221792,6 +221823,32 @@ function validateLlmFlockPlan(record, ctx) {
221792
221823
  }
221793
221824
  }
221794
221825
  }
221826
+ const writerWorker = surfacedWorkers.find(
221827
+ (worker) => worker.workerId === FLOCK_ROLES.writer.workerId
221828
+ );
221829
+ if (writerWorker && !surfacedWorkers.some((worker) => worker.role === "verifier") && surfacedWorkers.length < FLOCK_MAX_WORKERS) {
221830
+ const hasResearch = surfacedWorkers.some(
221831
+ (worker) => worker.workerId === FLOCK_ROLES.researcher.workerId
221832
+ );
221833
+ const spec = hasResearch ? FLOCK_ROLES.citation_checker : FLOCK_ROLES.consistency_checker;
221834
+ const index = surfacedWorkers.length;
221835
+ surfacedWorkers.push({
221836
+ flockWorkerId: `fw${index + 1}_${spec.roleId}`,
221837
+ workerId: spec.workerId,
221838
+ displayName: spec.displayName,
221839
+ nickname: flockNicknameFor(ctx.flockId, index),
221840
+ role: spec.role,
221841
+ objective: spec.objectiveTemplate(ctx.task),
221842
+ maxIterations: Math.min(spec.maxIterations, caps.maxIterationsPerWorker),
221843
+ allowedTools: [...spec.allowedTools],
221844
+ writesWorkspace: false,
221845
+ writeScope: null,
221846
+ outputContract: spec.outputContract,
221847
+ dependsOn: [writerWorker.flockWorkerId],
221848
+ modelOverride: null,
221849
+ dynamicManifest: null
221850
+ });
221851
+ }
221795
221852
  surfacedWorkers.sort((a, b2) => FLOCK_ROLE_ORDER[a.role] - FLOCK_ROLE_ORDER[b2.role]);
221796
221853
  const summary = sanitizeLine(record.summary, 200) || `${surfacedWorkers.length} workers: ${surfacedWorkers.map((worker) => worker.displayName).join(", ")}`;
221797
221854
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perchai-cli",
3
- "version": "2.4.32",
3
+ "version": "2.4.33",
4
4
  "description": "Perch AI command-line interface",
5
5
  "bin": {
6
6
  "perch": "bin/perch"