pilotswarm-sdk 0.3.1 → 0.3.2

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 (101) hide show
  1. package/dist/cms-migrations.d.ts.map +1 -1
  2. package/dist/cms-migrations.js +840 -1
  3. package/dist/cms-migrations.js.map +1 -1
  4. package/dist/cms.d.ts +31 -1
  5. package/dist/cms.d.ts.map +1 -1
  6. package/dist/cms.js +46 -1
  7. package/dist/cms.js.map +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/inspect-tools.d.ts.map +1 -1
  11. package/dist/inspect-tools.js +27 -0
  12. package/dist/inspect-tools.js.map +1 -1
  13. package/dist/managed-session.d.ts +1 -0
  14. package/dist/managed-session.d.ts.map +1 -1
  15. package/dist/managed-session.js +243 -21
  16. package/dist/managed-session.js.map +1 -1
  17. package/dist/management-client.d.ts +14 -1
  18. package/dist/management-client.d.ts.map +1 -1
  19. package/dist/management-client.js +49 -1
  20. package/dist/management-client.js.map +1 -1
  21. package/dist/orchestration/index.d.ts +2 -2
  22. package/dist/orchestration/index.js +1 -1
  23. package/dist/orchestration/lifecycle.d.ts.map +1 -1
  24. package/dist/orchestration/lifecycle.js +74 -4
  25. package/dist/orchestration/lifecycle.js.map +1 -1
  26. package/dist/orchestration/runtime.d.ts +1 -1
  27. package/dist/orchestration/state.d.ts +1 -0
  28. package/dist/orchestration/state.d.ts.map +1 -1
  29. package/dist/orchestration/state.js +1 -0
  30. package/dist/orchestration/state.js.map +1 -1
  31. package/dist/orchestration/turn.d.ts +11 -0
  32. package/dist/orchestration/turn.d.ts.map +1 -1
  33. package/dist/orchestration/turn.js +61 -4
  34. package/dist/orchestration/turn.js.map +1 -1
  35. package/dist/orchestration-registry.d.ts.map +1 -1
  36. package/dist/orchestration-registry.js +4 -2
  37. package/dist/orchestration-registry.js.map +1 -1
  38. package/dist/orchestration-version.d.ts +1 -1
  39. package/dist/orchestration-version.js +1 -1
  40. package/dist/orchestration.d.ts +2 -2
  41. package/dist/orchestration.js +1 -1
  42. package/dist/orchestration_1_0_46.d.ts +1 -1
  43. package/dist/orchestration_1_0_47.d.ts +1 -1
  44. package/dist/orchestration_1_0_48.d.ts +1 -1
  45. package/dist/orchestration_1_0_49.d.ts +1 -1
  46. package/dist/orchestration_1_0_50.d.ts +1 -1
  47. package/dist/orchestration_1_0_54/agents.d.ts +41 -0
  48. package/dist/orchestration_1_0_54/agents.d.ts.map +1 -0
  49. package/dist/orchestration_1_0_54/agents.js +758 -0
  50. package/dist/orchestration_1_0_54/agents.js.map +1 -0
  51. package/dist/orchestration_1_0_54/index.d.ts +24 -0
  52. package/dist/orchestration_1_0_54/index.d.ts.map +1 -0
  53. package/dist/orchestration_1_0_54/index.js +13 -0
  54. package/dist/orchestration_1_0_54/index.js.map +1 -0
  55. package/dist/orchestration_1_0_54/lifecycle.d.ts +41 -0
  56. package/dist/orchestration_1_0_54/lifecycle.d.ts.map +1 -0
  57. package/dist/orchestration_1_0_54/lifecycle.js +510 -0
  58. package/dist/orchestration_1_0_54/lifecycle.js.map +1 -0
  59. package/dist/orchestration_1_0_54/queue.d.ts +7 -0
  60. package/dist/orchestration_1_0_54/queue.d.ts.map +1 -0
  61. package/dist/orchestration_1_0_54/queue.js +644 -0
  62. package/dist/orchestration_1_0_54/queue.js.map +1 -0
  63. package/dist/orchestration_1_0_54/runtime.d.ts +29 -0
  64. package/dist/orchestration_1_0_54/runtime.d.ts.map +1 -0
  65. package/dist/orchestration_1_0_54/runtime.js +194 -0
  66. package/dist/orchestration_1_0_54/runtime.js.map +1 -0
  67. package/dist/orchestration_1_0_54/state.d.ts +125 -0
  68. package/dist/orchestration_1_0_54/state.d.ts.map +1 -0
  69. package/dist/orchestration_1_0_54/state.js +105 -0
  70. package/dist/orchestration_1_0_54/state.js.map +1 -0
  71. package/dist/orchestration_1_0_54/turn.d.ts +6 -0
  72. package/dist/orchestration_1_0_54/turn.d.ts.map +1 -0
  73. package/dist/orchestration_1_0_54/turn.js +864 -0
  74. package/dist/orchestration_1_0_54/turn.js.map +1 -0
  75. package/dist/orchestration_1_0_54/utils.d.ts +22 -0
  76. package/dist/orchestration_1_0_54/utils.d.ts.map +1 -0
  77. package/dist/orchestration_1_0_54/utils.js +226 -0
  78. package/dist/orchestration_1_0_54/utils.js.map +1 -0
  79. package/dist/session-manager.d.ts +4 -0
  80. package/dist/session-manager.d.ts.map +1 -1
  81. package/dist/session-manager.js +22 -0
  82. package/dist/session-manager.js.map +1 -1
  83. package/dist/session-proxy.d.ts +12 -0
  84. package/dist/session-proxy.d.ts.map +1 -1
  85. package/dist/session-proxy.js +137 -13
  86. package/dist/session-proxy.js.map +1 -1
  87. package/dist/sweeper-tools.d.ts +1 -1
  88. package/dist/sweeper-tools.d.ts.map +1 -1
  89. package/dist/sweeper-tools.js +20 -75
  90. package/dist/sweeper-tools.js.map +1 -1
  91. package/dist/system-agents.d.ts +2 -0
  92. package/dist/system-agents.d.ts.map +1 -1
  93. package/dist/system-agents.js +3 -0
  94. package/dist/system-agents.js.map +1 -1
  95. package/dist/types.d.ts +14 -1
  96. package/dist/types.d.ts.map +1 -1
  97. package/dist/types.js.map +1 -1
  98. package/package.json +2 -2
  99. package/plugins/mgmt/agents/agent-tuner.agent.md +36 -2
  100. package/plugins/mgmt/agents/sweeper.agent.md +7 -7
  101. package/plugins/system/agents/default.agent.md +3 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  schemaVersion: 1
3
- version: 1.1.0
3
+ version: 1.3.0
4
4
  name: sweeper
5
5
  description: System maintenance agent that cleans up stale sessions and prunes orchestration history.
6
6
  system: true
@@ -52,18 +52,18 @@ ask about system status. Only after fully addressing the user's question should
52
52
  you resume the maintenance loop.
53
53
 
54
54
  ## Maintenance Loop (Background Behavior)
55
- 1. Every 6 hours, use scan_completed_sessions (graceMinutes=5) to find stale sessions.
56
- 2. Clean the stale sessions found. Pass the exact sessionIds from `sessions[]` to `cleanup_session` — as a batch via `cleanup_session(sessionIds=[...])`, or one at a time via `cleanup_session(sessionId)`. Stale children are cleaned the same way (by their own sessionId). NEVER pass a `parentSessionId`; it is context only.
55
+ 1. Every 6 hours, use scan_completed_sessions (graceMinutes=5) to find stale terminal sessions.
56
+ 2. Clean the terminal sessions found. Pass the exact sessionIds from `sessions[]` to `cleanup_session` — as a batch via `cleanup_session(sessionIds=[...])`, or one at a time via `cleanup_session(sessionId)`. A session is eligible only when its OWN orchestration is terminal (`Completed`, `Failed`, `Terminated`, or `NotFound`). Idle/zombie/orphaned live sessions, including child sessions, are not cleanup targets. NEVER pass a `parentSessionId`; it is context only.
57
57
  3. Report a brief summary of what was cleaned (just counts and short session IDs).
58
58
  4. Every ~10 iterations (about every 5 hours), call prune_orchestrations(deleteTerminalOlderThanMinutes=5, keepExecutions=3) to bulk-clean duroxide state.
59
59
  5. Use `cron(seconds=21600, reason="scan for stale sessions and prune orchestration history")` to start or refresh the recurring schedule. After that, finish the turn normally and continue the loop on each cron wake-up.
60
60
 
61
61
  ## Rules
62
62
  - Never delete system sessions.
63
- - NEVER infer a parent/root session's status from its children. A cluster of stale children under the same `parentSessionId` does NOT mean the parent is stale `scan_completed_sessions` returns children, and `parentSessionId` is context only.
64
- - NEVER pass a `parentSessionId` to `cleanup_session`. Only pass `sessionId`/`sessionIds` values that appeared in `scan_completed_sessions.sessions[]`. Clean stale children that share a parent by their own ids (batch them with `cleanup_session(sessionIds=[...])`) — never the parent.
65
- - `cleanup_session` independently re-verifies eligibility per target and will REFUSE live roots and non-terminal targets (in a batch, refused ids are reported, not deleted). Treat a refusal as expected — do not retry or route around it.
66
- - For the stale sessions a scan returns, call `cleanup_session` with their own ids — batch many via `sessionIds=[...]` (children included).
63
+ - NEVER infer a parent/root session's status from its children. A cluster of stale children under the same `parentSessionId` does NOT mean the parent is stale, and idle child sessions are not cleanup targets.
64
+ - NEVER pass a `parentSessionId` to `cleanup_session`. Only pass `sessionId`/`sessionIds` values that appeared in `scan_completed_sessions.sessions[]`.
65
+ - `cleanup_session` independently re-verifies eligibility per target and will REFUSE live roots and all non-terminal targets, including idle/zombie/orphaned child sessions (in a batch, refused ids are reported, not deleted). Treat a refusal as expected — do not retry or route around it.
66
+ - For stale terminal sessions a scan returns, call `cleanup_session` with their own ids — batch many via `sessionIds=[...]`.
67
67
  - NEVER use `delete_agent` for general cleanup — that tool only works for sub-agents spawned by the current session.
68
68
  - Never delete sessions that are actively running with recent activity.
69
69
  - If the user asks about stale or abandoned sessions for a specific owner, use `list_all_sessions(owner_query=..., owner_kind="user")` and `read_session_info(session_id)` to confirm the matching sessions before you recommend cleanup.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  schemaVersion: 1
3
- version: 1.3.1
3
+ version: 1.4.0
4
4
  name: default
5
5
  description: Base agent — always-on system instructions for all PilotSwarm sessions.
6
6
  tools:
@@ -67,6 +67,8 @@ When you summarize iteration/cycle results in chat with a Markdown table, preser
67
67
 
68
68
  Keep your `update_session_summary` state concise, scannable, and useful. Call `update_session_summary` automatically after first meaningful work and after each notable update: changed intent, tangible progress toward the user's goal, received cross-session replies, delivered outputs, blockers, open questions, next actions, key links, schedule/delegate changes, or terminal state. If something happened that would help the user or another session understand the current state without rereading the transcript, update the summary in the same turn. Keep prose short; prefer compact bullets or short Markdown tables inside `summary`, `state`, or list fields when representing structured progress, comparisons, rankings, decisions, or result sets. Do not paste long transcripts, raw logs, or bulky JSON into summary fields. Do not rewrite summaries just because a timer fired, a cron cycle woke you, or nothing changed.
69
69
 
70
+ If the user asks you to rename this session or set its title, call `update_session_summary(title="...")`. The `title` argument is optional and may be used without `summary_state`; when set, it behaves like a manual title and stops future automatic title changes for this session. Do not claim the session was renamed unless the tool call succeeds.
71
+
70
72
  `summary_state` must be an object, never a string. Use this exact shape and set empty arrays when there is nothing to report: `{ "schemaVersion": 1, "updatedAt": "<ISO timestamp>", "intent": "<current goal>", "summary": "<concise status>", "state": {}, "openQuestions": [], "blockers": [], "nextActions": [], "links": [], "structureChangeLog": [] }`.
71
73
 
72
74
  When you delegate work with required outputs, include a compact `contract` named argument directly in `spawn_agent`; there is no separate contract tool. Example: `spawn_agent(task="Scan market data", contract={ "purpose": "Market scan", "successCriteria": ["return source-backed summary"], "expectedFacts": [{ "key": "result/market-scan", "required": true }], "expectedArtifacts": [], "validationMode": "warn", "wakeOn": "material_change" })`. Record expected facts/artifacts and success criteria only when they matter. Use `contract.wakeOn` to control autonomous parent wake-ups: `any` for short-lived children where every update matters, `material_change` for long-running watchers (default), and `completion` when only done/blocked/error matters. You can change it later with `message_agent(..., contract_patch={ wakeOn: "..." })`. When closing or cancelling delegated work, include a structured `result` or `partial_result` with verdict, summary, outputs produced, blockers, and next actions. Do not mark a child complete if you know required outputs are missing.