pilotswarm-sdk 0.2.2 → 0.3.1

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 (97) hide show
  1. package/dist/agent-loader.d.ts +8 -6
  2. package/dist/agent-loader.d.ts.map +1 -1
  3. package/dist/agent-loader.js +5 -1
  4. package/dist/agent-loader.js.map +1 -1
  5. package/dist/facts-migrations.d.ts.map +1 -1
  6. package/dist/facts-migrations.js +176 -0
  7. package/dist/facts-migrations.js.map +1 -1
  8. package/dist/facts-store.d.ts +39 -12
  9. package/dist/facts-store.d.ts.map +1 -1
  10. package/dist/facts-store.js +76 -22
  11. package/dist/facts-store.js.map +1 -1
  12. package/dist/facts-tools.d.ts +4 -0
  13. package/dist/facts-tools.d.ts.map +1 -1
  14. package/dist/facts-tools.js +24 -16
  15. package/dist/facts-tools.js.map +1 -1
  16. package/dist/graph-tools.d.ts +8 -6
  17. package/dist/graph-tools.d.ts.map +1 -1
  18. package/dist/graph-tools.js +37 -26
  19. package/dist/graph-tools.js.map +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/orchestration/index.d.ts +2 -2
  24. package/dist/orchestration/index.js +1 -1
  25. package/dist/orchestration/lifecycle.d.ts.map +1 -1
  26. package/dist/orchestration/lifecycle.js +1 -0
  27. package/dist/orchestration/lifecycle.js.map +1 -1
  28. package/dist/orchestration/runtime.d.ts +1 -1
  29. package/dist/orchestration/runtime.d.ts.map +1 -1
  30. package/dist/orchestration/runtime.js +4 -0
  31. package/dist/orchestration/runtime.js.map +1 -1
  32. package/dist/orchestration-registry.d.ts.map +1 -1
  33. package/dist/orchestration-registry.js +4 -2
  34. package/dist/orchestration-registry.js.map +1 -1
  35. package/dist/orchestration-version.d.ts +1 -1
  36. package/dist/orchestration-version.js +1 -1
  37. package/dist/orchestration.d.ts +2 -2
  38. package/dist/orchestration.js +1 -1
  39. package/dist/orchestration_1_0_46.d.ts +1 -1
  40. package/dist/orchestration_1_0_47.d.ts +1 -1
  41. package/dist/orchestration_1_0_48.d.ts +1 -1
  42. package/dist/orchestration_1_0_49.d.ts +1 -1
  43. package/dist/orchestration_1_0_50.d.ts +1 -1
  44. package/dist/orchestration_1_0_53/agents.d.ts +41 -0
  45. package/dist/orchestration_1_0_53/agents.d.ts.map +1 -0
  46. package/dist/orchestration_1_0_53/agents.js +758 -0
  47. package/dist/orchestration_1_0_53/agents.js.map +1 -0
  48. package/dist/orchestration_1_0_53/index.d.ts +24 -0
  49. package/dist/orchestration_1_0_53/index.d.ts.map +1 -0
  50. package/dist/orchestration_1_0_53/index.js +13 -0
  51. package/dist/orchestration_1_0_53/index.js.map +1 -0
  52. package/dist/orchestration_1_0_53/lifecycle.d.ts +41 -0
  53. package/dist/orchestration_1_0_53/lifecycle.d.ts.map +1 -0
  54. package/dist/orchestration_1_0_53/lifecycle.js +509 -0
  55. package/dist/orchestration_1_0_53/lifecycle.js.map +1 -0
  56. package/dist/orchestration_1_0_53/queue.d.ts +7 -0
  57. package/dist/orchestration_1_0_53/queue.d.ts.map +1 -0
  58. package/dist/orchestration_1_0_53/queue.js +644 -0
  59. package/dist/orchestration_1_0_53/queue.js.map +1 -0
  60. package/dist/orchestration_1_0_53/runtime.d.ts +29 -0
  61. package/dist/orchestration_1_0_53/runtime.d.ts.map +1 -0
  62. package/dist/orchestration_1_0_53/runtime.js +190 -0
  63. package/dist/orchestration_1_0_53/runtime.js.map +1 -0
  64. package/dist/orchestration_1_0_53/state.d.ts +125 -0
  65. package/dist/orchestration_1_0_53/state.d.ts.map +1 -0
  66. package/dist/orchestration_1_0_53/state.js +105 -0
  67. package/dist/orchestration_1_0_53/state.js.map +1 -0
  68. package/dist/orchestration_1_0_53/turn.d.ts +6 -0
  69. package/dist/orchestration_1_0_53/turn.d.ts.map +1 -0
  70. package/dist/orchestration_1_0_53/turn.js +864 -0
  71. package/dist/orchestration_1_0_53/turn.js.map +1 -0
  72. package/dist/orchestration_1_0_53/utils.d.ts +22 -0
  73. package/dist/orchestration_1_0_53/utils.d.ts.map +1 -0
  74. package/dist/orchestration_1_0_53/utils.js +226 -0
  75. package/dist/orchestration_1_0_53/utils.js.map +1 -0
  76. package/dist/session-manager.d.ts.map +1 -1
  77. package/dist/session-manager.js +3 -2
  78. package/dist/session-manager.js.map +1 -1
  79. package/dist/session-proxy.d.ts +22 -17
  80. package/dist/session-proxy.d.ts.map +1 -1
  81. package/dist/session-proxy.js +27 -23
  82. package/dist/session-proxy.js.map +1 -1
  83. package/dist/sweeper-tools.d.ts.map +1 -1
  84. package/dist/sweeper-tools.js +168 -52
  85. package/dist/sweeper-tools.js.map +1 -1
  86. package/dist/types.d.ts +10 -7
  87. package/dist/types.d.ts.map +1 -1
  88. package/dist/types.js.map +1 -1
  89. package/dist/worker.d.ts +8 -3
  90. package/dist/worker.d.ts.map +1 -1
  91. package/dist/worker.js +75 -5
  92. package/dist/worker.js.map +1 -1
  93. package/package.json +11 -1
  94. package/plugins/default-agents/agents/generic-crawler.agent.md +162 -0
  95. package/plugins/mgmt/agents/facts-manager.agent.md +2 -1
  96. package/plugins/mgmt/agents/sweeper.agent.md +6 -3
  97. package/plugins/mgmt/skills/sweeper/SKILL.md +4 -1
@@ -22,40 +22,44 @@ export declare function createSessionProxy(ctx: any, sessionId: string, affinity
22
22
  };
23
23
  export declare function buildRunTurnConfig(inputConfig: SerializableSessionConfig, hostname: string, fallbackAgentIdentity?: string): SerializableSessionConfig;
24
24
  /**
25
- * Derive the app-assigned HARVESTER role from the bound agent definition
26
- * (enhancedfactstore 07 §1.5 / P4 review BLOCKER#2).
25
+ * Derive the app-assigned CRAWLER role from the bound agent definition.
27
26
  *
28
- * The harvester role is a property of the AGENT, not of a session: it is
29
- * resolved from the worker's static, loaded agent definitions every turn by
30
- * matching the session's resolved identity (agentIdentity / boundAgentName)
31
- * against each agent's CANONICAL identifier (id / name). Because the agent list
32
- * is static worker configuration, this is deterministic and replay-safe.
27
+ * The crawler role is a property of the AGENT, not of a session: it is resolved
28
+ * from the worker's static, loaded agent definitions every turn by matching the
29
+ * session's resolved identity (agentIdentity / boundAgentName) against each
30
+ * agent's CANONICAL identifier (id / name). Because the agent list is static
31
+ * worker configuration, this is deterministic and replay-safe.
33
32
  *
34
- * Deriving it here (rather than trusting a persisted `isHarvester`) means the
35
- * role can NEVER be inherited from a parent session or smuggled in via a stale
36
- * serialized config — a child only becomes a harvester if its OWN bound agent
37
- * declares `harvester: true`. System agents (e.g. facts-manager) that should be
38
- * harvester-capable get the tools through the SessionManager gating, not here.
33
+ * Deriving it here (rather than trusting a persisted `isCrawler` / legacy
34
+ * `isHarvester`) means the role can NEVER be inherited from a parent session or
35
+ * smuggled in via a stale serialized config — a child only becomes a crawler if
36
+ * its OWN bound agent declares `crawler: true` (or legacy `harvester: true`).
37
+ * System agents (e.g. facts-manager) that should be crawler-capable get the
38
+ * tools through the SessionManager gating, not here.
39
39
  *
40
40
  * SECURITY (P5 review BLOCKER#2): `title` is display metadata, NOT an
41
- * authorization key — matching on it would let a non-harvester whose title
42
- * normalizes to a harvester's identity receive the privileged crawl queue
43
- * (`facts_read_uncrawled` / `facts_mark_crawled`, which read facts across ALL
41
+ * authorization key — matching on it would let a non-crawler whose title
42
+ * normalizes to a crawler's identity receive the privileged crawl queue
43
+ * (`facts_read_uncrawled` / `facts_set_crawled`, which read facts across ALL
44
44
  * scopes). We match only `id` / `name`, and we FAIL CLOSED on ambiguity: when
45
45
  * more than one loaded agent resolves to the same normalized identity, the
46
- * privileged role is granted only if EVERY one of them declares `harvester`.
46
+ * privileged role is granted only if EVERY one declares the crawler role.
47
47
  */
48
- export declare function resolveHarvesterRole(identity: string | undefined, boundAgentName: string | undefined, userAgents?: Array<{
48
+ export declare function resolveCrawlerRole(identity: string | undefined, boundAgentName: string | undefined, userAgents?: Array<{
49
49
  name?: string;
50
50
  id?: string;
51
51
  title?: string;
52
+ crawler?: boolean;
52
53
  harvester?: boolean;
53
54
  }>, systemAgents?: Array<{
54
55
  name?: string;
55
56
  id?: string;
56
57
  title?: string;
58
+ crawler?: boolean;
57
59
  harvester?: boolean;
58
60
  }>): boolean;
61
+ /** @deprecated Use `resolveCrawlerRole`; retained for compatibility. */
62
+ export declare const resolveHarvesterRole: typeof resolveCrawlerRole;
59
63
  export declare function createSessionManagerProxy(ctx: any): {
60
64
  listModels(): any;
61
65
  summarizeSession(sessionId: string): any;
@@ -130,6 +134,7 @@ userAgents?: Array<{
130
134
  initialPrompt?: string;
131
135
  splash?: string;
132
136
  parent?: string;
137
+ crawler?: boolean;
133
138
  harvester?: boolean;
134
139
  promptLayerKind?: "app-agent" | "app-system-agent" | "pilotswarm-system-agent";
135
140
  }>,
@@ -1 +1 @@
1
- {"version":3,"file":"session-proxy.d.ts","sourceRoot":"","sources":["../src/session-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAgC,KAAK,yBAAyB,EAA4C,MAAM,YAAY,CAAC;AACpI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUrD,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AA+Z1E,wBAAgB,kBAAkB,CAC9B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,yBAAyB;oBAIjB,MAAM,cACF,OAAO,cACP,MAAM,aACP;QAAE,eAAe,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAA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,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,WAAW,GAAG,kBAAkB,GAAG,yBAAyB,CAAA;CAAE,CAAC;AACtU,+DAA+D;AAC/D,SAAS,CAAC,EAAE,OAAO,kBAAkB,EAAE,SAAS,GAAG,IAAI;AACvD,+EAA+E;AAC/E,YAAY,CAAC,EAAE,MAAM,QA+nExB"}
@@ -429,30 +429,30 @@ export function buildRunTurnConfig(inputConfig, hostname, fallbackAgentIdentity)
429
429
  return runConfig;
430
430
  }
431
431
  /**
432
- * Derive the app-assigned HARVESTER role from the bound agent definition
433
- * (enhancedfactstore 07 §1.5 / P4 review BLOCKER#2).
432
+ * Derive the app-assigned CRAWLER role from the bound agent definition.
434
433
  *
435
- * The harvester role is a property of the AGENT, not of a session: it is
436
- * resolved from the worker's static, loaded agent definitions every turn by
437
- * matching the session's resolved identity (agentIdentity / boundAgentName)
438
- * against each agent's CANONICAL identifier (id / name). Because the agent list
439
- * is static worker configuration, this is deterministic and replay-safe.
434
+ * The crawler role is a property of the AGENT, not of a session: it is resolved
435
+ * from the worker's static, loaded agent definitions every turn by matching the
436
+ * session's resolved identity (agentIdentity / boundAgentName) against each
437
+ * agent's CANONICAL identifier (id / name). Because the agent list is static
438
+ * worker configuration, this is deterministic and replay-safe.
440
439
  *
441
- * Deriving it here (rather than trusting a persisted `isHarvester`) means the
442
- * role can NEVER be inherited from a parent session or smuggled in via a stale
443
- * serialized config — a child only becomes a harvester if its OWN bound agent
444
- * declares `harvester: true`. System agents (e.g. facts-manager) that should be
445
- * harvester-capable get the tools through the SessionManager gating, not here.
440
+ * Deriving it here (rather than trusting a persisted `isCrawler` / legacy
441
+ * `isHarvester`) means the role can NEVER be inherited from a parent session or
442
+ * smuggled in via a stale serialized config — a child only becomes a crawler if
443
+ * its OWN bound agent declares `crawler: true` (or legacy `harvester: true`).
444
+ * System agents (e.g. facts-manager) that should be crawler-capable get the
445
+ * tools through the SessionManager gating, not here.
446
446
  *
447
447
  * SECURITY (P5 review BLOCKER#2): `title` is display metadata, NOT an
448
- * authorization key — matching on it would let a non-harvester whose title
449
- * normalizes to a harvester's identity receive the privileged crawl queue
450
- * (`facts_read_uncrawled` / `facts_mark_crawled`, which read facts across ALL
448
+ * authorization key — matching on it would let a non-crawler whose title
449
+ * normalizes to a crawler's identity receive the privileged crawl queue
450
+ * (`facts_read_uncrawled` / `facts_set_crawled`, which read facts across ALL
451
451
  * scopes). We match only `id` / `name`, and we FAIL CLOSED on ambiguity: when
452
452
  * more than one loaded agent resolves to the same normalized identity, the
453
- * privileged role is granted only if EVERY one of them declares `harvester`.
453
+ * privileged role is granted only if EVERY one declares the crawler role.
454
454
  */
455
- export function resolveHarvesterRole(identity, boundAgentName, userAgents, systemAgents) {
455
+ export function resolveCrawlerRole(identity, boundAgentName, userAgents, systemAgents) {
456
456
  const norm = (v) => (v || "").toLowerCase().replace(/[^a-z0-9]+/g, "");
457
457
  const target = norm(identity) || norm(boundAgentName);
458
458
  if (!target)
@@ -465,10 +465,13 @@ export function resolveHarvesterRole(identity, boundAgentName, userAgents, syste
465
465
  });
466
466
  if (matches.length === 0)
467
467
  return false;
468
+ const hasCrawlerRole = (agent) => agent.crawler === true || agent.harvester === true;
468
469
  // Fail closed on a normalized-id/name collision: do not let an ambiguous
469
- // match between a harvester and a non-harvester escalate to the role.
470
- return matches.every((a) => a.harvester === true);
470
+ // match between a crawler and a non-crawler escalate to the role.
471
+ return matches.every(hasCrawlerRole);
471
472
  }
473
+ /** @deprecated Use `resolveCrawlerRole`; retained for compatibility. */
474
+ export const resolveHarvesterRole = resolveCrawlerRole;
472
475
  // ─── SessionManagerProxy ─────────────────────────────────────────
473
476
  // The orchestration's view of the SessionManager singleton.
474
477
  // Operations that don't require session affinity.
@@ -632,12 +635,13 @@ workerNodeId) {
632
635
  fallbackAgentIdentity = row?.agentId ?? undefined;
633
636
  }
634
637
  const runConfig = buildRunTurnConfig(input.config, hostname, fallbackAgentIdentity);
635
- // Derive the app-assigned harvester role authoritatively from the bound
636
- // agent definition EVERY turn (enhancedfactstore 07 §1.5 / BLOCKER#2).
638
+ // Derive the app-assigned crawler role authoritatively from the bound
639
+ // agent definition EVERY turn.
637
640
  // It is a property of the agent, resolved from static worker config, so
638
641
  // it survives hydration, is replay-safe, and can never be inherited from
639
642
  // a parent or trusted from a stale serialized config.
640
- runConfig.isHarvester = resolveHarvesterRole(runConfig.agentIdentity, runConfig.boundAgentName, userAgents, systemAgents);
643
+ runConfig.isCrawler = resolveCrawlerRole(runConfig.agentIdentity, runConfig.boundAgentName, userAgents, systemAgents);
644
+ runConfig.isHarvester = runConfig.isCrawler;
641
645
  const trace = activityTrace(activityCtx, "runTurn");
642
646
  const failForMissingState = async (message) => {
643
647
  if (catalog) {
@@ -881,7 +885,7 @@ workerNodeId) {
881
885
  // still apply. The parent is responsible for closing
882
886
  // each instance with complete_agent / cancel_agent /
883
887
  // delete_agent when it no longer needs the child.
884
- const { boundAgentName: _parentBoundAgentName, promptLayering: _parentPromptLayering, isHarvester: _parentIsHarvester, ...parentConfig } = input.config;
888
+ const { boundAgentName: _parentBoundAgentName, promptLayering: _parentPromptLayering, isCrawler: _parentIsCrawler, isHarvester: _parentIsHarvester, ...parentConfig } = input.config;
885
889
  const childConfig = {
886
890
  ...parentConfig,
887
891
  ...(agentModel ? { model: agentModel } : {}),