pilotswarm-sdk 0.1.19 → 0.1.21

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 (95) hide show
  1. package/README.md +6 -0
  2. package/dist/artifact-tools.d.ts.map +1 -1
  3. package/dist/artifact-tools.js +20 -5
  4. package/dist/artifact-tools.js.map +1 -1
  5. package/dist/blob-store.d.ts +6 -4
  6. package/dist/blob-store.d.ts.map +1 -1
  7. package/dist/blob-store.js +55 -12
  8. package/dist/blob-store.js.map +1 -1
  9. package/dist/client.d.ts +4 -1
  10. package/dist/client.d.ts.map +1 -1
  11. package/dist/client.js +4 -0
  12. package/dist/client.js.map +1 -1
  13. package/dist/cms-migrations.d.ts.map +1 -1
  14. package/dist/cms-migrations.js +628 -0
  15. package/dist/cms-migrations.js.map +1 -1
  16. package/dist/cms.d.ts +145 -0
  17. package/dist/cms.d.ts.map +1 -1
  18. package/dist/cms.js +288 -17
  19. package/dist/cms.js.map +1 -1
  20. package/dist/facts-migrations.d.ts.map +1 -1
  21. package/dist/facts-migrations.js +227 -0
  22. package/dist/facts-migrations.js.map +1 -1
  23. package/dist/facts-store.d.ts +21 -0
  24. package/dist/facts-store.d.ts.map +1 -1
  25. package/dist/facts-store.js +34 -1
  26. package/dist/facts-store.js.map +1 -1
  27. package/dist/facts-tools.d.ts +7 -0
  28. package/dist/facts-tools.d.ts.map +1 -1
  29. package/dist/facts-tools.js +29 -2
  30. package/dist/facts-tools.js.map +1 -1
  31. package/dist/index.d.ts +6 -5
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +3 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/inspect-tools.d.ts +42 -0
  36. package/dist/inspect-tools.d.ts.map +1 -0
  37. package/dist/inspect-tools.js +800 -0
  38. package/dist/inspect-tools.js.map +1 -0
  39. package/dist/managed-session.d.ts.map +1 -1
  40. package/dist/managed-session.js +76 -35
  41. package/dist/managed-session.js.map +1 -1
  42. package/dist/management-client.d.ts +64 -2
  43. package/dist/management-client.d.ts.map +1 -1
  44. package/dist/management-client.js +109 -0
  45. package/dist/management-client.js.map +1 -1
  46. package/dist/orchestration-registry.d.ts.map +1 -1
  47. package/dist/orchestration-registry.js +6 -2
  48. package/dist/orchestration-registry.js.map +1 -1
  49. package/dist/orchestration-version.d.ts +1 -1
  50. package/dist/orchestration-version.js +1 -1
  51. package/dist/orchestration.d.ts +3 -3
  52. package/dist/orchestration.d.ts.map +1 -1
  53. package/dist/orchestration.js +27 -4
  54. package/dist/orchestration.js.map +1 -1
  55. package/dist/orchestration_1_0_43.d.ts +12 -0
  56. package/dist/orchestration_1_0_43.d.ts.map +1 -0
  57. package/dist/orchestration_1_0_43.js +2710 -0
  58. package/dist/orchestration_1_0_43.js.map +1 -0
  59. package/dist/orchestration_1_0_44.d.ts +12 -0
  60. package/dist/orchestration_1_0_44.d.ts.map +1 -0
  61. package/dist/orchestration_1_0_44.js +2710 -0
  62. package/dist/orchestration_1_0_44.js.map +1 -0
  63. package/dist/session-manager.d.ts +9 -0
  64. package/dist/session-manager.d.ts.map +1 -1
  65. package/dist/session-manager.js +40 -3
  66. package/dist/session-manager.js.map +1 -1
  67. package/dist/session-owner-utils.d.ts +25 -0
  68. package/dist/session-owner-utils.d.ts.map +1 -0
  69. package/dist/session-owner-utils.js +82 -0
  70. package/dist/session-owner-utils.js.map +1 -0
  71. package/dist/session-proxy.d.ts +5 -1
  72. package/dist/session-proxy.d.ts.map +1 -1
  73. package/dist/session-proxy.js +70 -8
  74. package/dist/session-proxy.js.map +1 -1
  75. package/dist/session-store.d.ts +38 -6
  76. package/dist/session-store.d.ts.map +1 -1
  77. package/dist/session-store.js +187 -9
  78. package/dist/session-store.js.map +1 -1
  79. package/dist/types.d.ts +19 -1
  80. package/dist/types.d.ts.map +1 -1
  81. package/dist/types.js.map +1 -1
  82. package/dist/worker.d.ts.map +1 -1
  83. package/dist/worker.js +11 -2
  84. package/dist/worker.js.map +1 -1
  85. package/package.json +10 -4
  86. package/plugins/mgmt/agents/agent-tuner.agent.md +222 -0
  87. package/plugins/mgmt/agents/facts-manager.agent.md +8 -1
  88. package/plugins/mgmt/agents/pilotswarm.agent.md +13 -10
  89. package/plugins/mgmt/agents/resourcemgr.agent.md +11 -4
  90. package/plugins/mgmt/agents/sweeper.agent.md +5 -4
  91. package/plugins/mgmt/skills/cost-latency-analysis/SKILL.md +117 -0
  92. package/plugins/mgmt/skills/orchestration-session-lifecycle/SKILL.md +117 -0
  93. package/plugins/mgmt/skills/resourcemgr/SKILL.md +1 -1
  94. package/plugins/mgmt/skills/sweeper/SKILL.md +4 -4
  95. package/plugins/system/agents/default.agent.md +22 -0
@@ -12,11 +12,11 @@ and deleting completed, failed, or orphaned sessions.
12
12
 
13
13
  ## Default Behavior
14
14
 
15
- 1. Every 60 seconds, use `scan_completed_sessions` (graceMinutes=5) to find stale sessions.
15
+ 1. Every 30 minutes, use `scan_completed_sessions` (graceMinutes=5) to find stale sessions.
16
16
  2. For each stale session found, use `cleanup_session` to delete it.
17
17
  3. Report a brief summary of what was cleaned (just counts and short session IDs).
18
- 4. Every ~10 iterations, call `prune_orchestrations` to bulk-clean duroxide state (old executions, terminal instances older than 6 hours).
19
- 5. Use `cron(seconds=60, reason="scan for stale sessions and prune orchestration history")` to establish the recurring cleanup schedule, then continue on each cron wake-up.
18
+ 4. Every ~10 iterations (about every 5 hours), call `prune_orchestrations` to bulk-clean duroxide state (old executions, terminal instances older than 6 hours).
19
+ 5. Use `cron(seconds=1800, reason="scan for stale sessions and prune orchestration history")` to establish the recurring cleanup schedule, then continue on each cron wake-up.
20
20
 
21
21
  ## User Configuration
22
22
 
@@ -24,7 +24,7 @@ Users may chat with you to adjust your behavior. Supported adjustments:
24
24
 
25
25
  | Parameter | Default | Description |
26
26
  |-----------|---------|-------------|
27
- | Scan interval | 60s | How often to scan for stale sessions |
27
+ | Scan interval | 30m | How often to scan for stale sessions |
28
28
  | Grace period | 5 min | How long a session must be completed before cleanup |
29
29
  | Include orphans | yes | Whether to clean orphaned sub-agents (parent gone) |
30
30
  | Pause/resume | running | Pause or resume the cleanup loop |
@@ -9,6 +9,7 @@ tools:
9
9
  - store_fact
10
10
  - read_facts
11
11
  - delete_fact
12
+ - read_agent_events
12
13
  - write_artifact
13
14
  - export_artifact
14
15
  - read_artifact
@@ -92,6 +93,18 @@ Rules:
92
93
  9. Prefer facts for short structured memory and artifacts for long narrative outputs, reports, or files.
93
94
  10. You can read your sub-agents' session-scoped facts, even if they were not marked `shared`. Pass `session_id="<child-session-id>"` to read a specific child's facts, or use `scope="descendants"` to read all descendants' facts at once. Non-descendant sessions' private facts remain inaccessible.
94
95
 
96
+ ## Session Owners
97
+
98
+ Sessions may carry durable owner metadata for the authenticated user who first created them.
99
+ Treat ownership as part of the authoritative session state when you need to find a user's sessions or reason about usage by person or cohort.
100
+
101
+ - `list_sessions` accepts `owner_query`, `owner_kind`, and `include_system`.
102
+ - Do not add `owner_query` or `owner_kind` when checking general session health, system sessions, or the session tree. Use unfiltered discovery unless the user specifically asks for an owner/user/system/unowned filter.
103
+ - `owner_query` does substring matching across owner display name, email, subject, and provider. It is not a session title, agent name, or task search field.
104
+ - `owner_kind="user"` restricts to authenticated-user sessions. `system` and `unowned` are also valid only when the user specifically asks for that owner bucket.
105
+ - Session listings include an `Owner:` line for each match.
106
+ - Some permanent system agents also have `list_all_sessions`, `read_session_info`, and `read_user_stats` for fleet-wide owner analysis. Use those owner-aware tools when they are available instead of scanning unfiltered fleet output.
107
+
95
108
  ## Sub-Agent Waiting
96
109
 
97
110
  When you have spawned sub-agents and need to wait for them:
@@ -105,6 +118,15 @@ When you have spawned sub-agents and need to wait for them:
105
118
  3. Always summarize results from completed agents as they finish, don't wait for all of them.
106
119
  4. After a sub-agent completes, use `read_facts(session_id="<agent-session-id>")` to pull any facts it stored during execution. Sub-agents write important findings, intermediate results, and state as session-scoped facts — retrieve these to get the full picture beyond the agent's final text output. Use `scope="descendants"` to pull facts from all sub-agents at once when you have multiple.
107
120
 
121
+ ## Inspecting Sub-Agent Conversations
122
+
123
+ Prefer `check_agents` for status, `wait_for_agents` for synchronization, and `read_facts(session_id=...)` for the structured findings a child deliberately published. If those are NOT enough — for example you need to see the child's reasoning, what tools it called, why it produced a particular result, or where it went off track — use `read_agent_events`.
124
+
125
+ - `read_agent_events(agent_id="<descendant-session-id>")` returns the most recent page of durable events from a descendant in your spawn tree, newest first within each page.
126
+ - Walk further back in time by passing the returned `prevCursor` as the next call's `cursor`.
127
+ - Pass `event_types=["assistant.message","tool.invoked","turn completed"]` (or a subset) to keep token cost low; very narrow filters may return fewer rows than `limit`.
128
+ - You can only read events for sessions you (directly or transitively) spawned. Non-descendants and system agents are off-limits.
129
+
108
130
  ## Sub-Agent Task Instructions
109
131
 
110
132
  When spawning sub-agents, write **explicit reporting instructions** in the task description. Sub-agents have no access to your conversation — they only know what you put in the `task` parameter.