@pimote/sdk 0.16.0-rc.2 → 0.16.0-rc.4

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/README.md CHANGED
@@ -120,7 +120,23 @@ This module defines the per-session presentation provider for interactive subage
120
120
 
121
121
  Use `registerProvider(pi, provider)` to publish a provider. Use `discoverProvider(pi, onProvider)` or the discovery handle to find providers, including late registration and replacement. Registration and discovery return cleanup functions or handles. Cleanup stops discovery or registration; it does not dispose the provider or child sessions. The `SubagentPresentationProvider` contract, typed operation data, cursors, snapshots, and borrowed-session lease types are exported from this module. The my-pi subagents extension implements this provider for Pimote.
122
122
 
123
- Provider operations carry typed placement through `toolCallId` and `contentIndex`, or through the containing custom entry's `entryId`. Pimote's server projector suppresses the declared native renderers and places each operation as typed subagent content inside its originating assistant row, preserving surrounding native content order. Router correlation IDs stay inside my-pi. Pimote restores persisted operations through provider hydration rather than decoding extension details.
123
+ Provider operations carry typed placement through `toolCallId` and `contentIndex`, or through the containing custom entry's `entryId`. Pimote's server projector suppresses the declared native renderers and places each operation as typed subagent content inside its originating assistant row, preserving surrounding native content order.
124
+
125
+ Tool-backed final payloads use `{ operation, parameters, result }`. Parameters contain the complete normalized public inputs. Results retain output, errors, outcome flags, and received metadata. Target references use root-relative agent paths. Router correlation IDs stay inside my-pi. Asynchronous custom messages carry result-only payloads rather than invented tool parameters. Pimote renders these fields as labeled data and uses its transcript Markdown renderer for free-form prose.
126
+
127
+ Await starts only after complete tool arguments arrive. Omitted or empty `parameters.agents` means all agents. Named targets remain in the final parameters, including when a wait is interrupted or returns no child results. Send and respond retain progressive prose in `parameters.message`; send responses stream into `result.response`. Existing lifecycle event types remain unchanged.
128
+
129
+ An await result contains the child completions returned by that tool call. Standalone completion operations replace asynchronous subagent custom messages only. Pimote restores persisted operations through provider hydration. The provider normalizes older saved payloads into the current envelope rather than making the client decode extension details.
130
+
131
+ ```ts
132
+ {
133
+ operation: 'await',
134
+ parameters: { agents: [['worker']] },
135
+ result: {
136
+ statuses: [{ path: ['worker'], state: 'idle', output: 'Checks passed.' }]
137
+ }
138
+ }
139
+ ```
124
140
 
125
141
  ## Pimote extensions — `@pimote/sdk/pimote`
126
142
 
@@ -1,4 +1,4 @@
1
1
  export type { AgentPath, BorrowedAgentSession, BorrowedSessionManager, FeedCursor, PiEventRef, SubagentAwaitChildStatus, SubagentCapabilities, SubagentLease, SubagentLeaseEvent, SubagentNode, SubagentNodeEventData, SubagentNodeSnapshot, SubagentNodeState, SubagentOperation, SubagentOwnerControlPort, SubagentProviderDiscovery, SubagentProviderRequest, SubagentProviderResponse, SubagentResurrectRequest, SubagentResurrectResult, SubagentState, SubagentStopRequest, SubagentTeardownReason, SubagentTeardownResult, SubagentUsage, SubagentUsageSnapshot, SubagentRuntimeReplacedData, SubagentCostBreakdown, } from './types.js';
2
2
  export { SUBAGENT_PROVIDER_REQUEST, SUBAGENT_PROVIDER_RESPONSE, discover, discoverProvider, register, registerProvider } from './provider.js';
3
3
  export type { DiscoverProviderOptions } from './provider.js';
4
- export type { ActiveSubagentOperation, PersistedSubagentContent, SubagentDelegatedChild, SubagentInterruptResult, SubagentInterruptTarget, SubagentResurrectedAgent, SubagentAwaitResult, SubagentAwaitStatus, SubagentCompletionResult, SubagentDeltaData, SubagentDeltaEvent, SubagentEndData, SubagentEndEvent, SubagentFiniteData, SubagentFiniteEvent, SubagentFinalData, SubagentOperationKind, SubagentOperationTarget, SubagentPlacement, SubagentPresentationManifest, SubagentPresentationProvider, SubagentPresentationReplay, SubagentProtocolErrorData, SubagentProviderEvent, SubagentProviderSnapshot, SubagentStartData, SubagentStartEvent, SubagentTopologyEvent, } from './presentation.js';
4
+ export type { ActiveSubagentOperation, PersistedSubagentContent, SubagentDelegatedChild, SubagentInterruptResult, SubagentInterruptTarget, SubagentResurrectedAgent, SubagentAwaitResult, SubagentAwaitStatus, SubagentCompletionResult, SubagentDeltaData, SubagentDeltaEvent, SubagentEndData, SubagentEndEvent, SubagentFiniteData, SubagentFiniteEvent, SubagentFinalData, SubagentOperationKind, SubagentOperationTarget, SubagentPlacement, SubagentPresentationManifest, SubagentPresentationProvider, SubagentPresentationReplay, SubagentProtocolErrorData, SubagentProviderEvent, SubagentProviderSnapshot, SubagentStartData, SubagentStartEvent, SubagentToolParameters, SubagentTopologyEvent, } from './presentation.js';
@@ -3,7 +3,9 @@ export type SubagentPresentationManifest = Readonly<{
3
3
  hiddenToolNames: readonly string[];
4
4
  hiddenCustomTypes: readonly string[];
5
5
  }>;
6
- export type SubagentOperationKind = 'send' | 'respond' | 'await' | 'delegation' | 'completion' | 'interrupt' | 'teardown' | 'resurrect';
6
+ export type SubagentOperationKind = 'send' | 'message_received' | 'respond' | 'await' | 'delegation' | 'completion' | 'interrupt' | 'teardown' | 'resurrect';
7
+ /** Normalized public tool inputs. Final operations carry complete values. */
8
+ export type SubagentToolParameters = Readonly<Record<string, unknown>>;
7
9
  export type SubagentPlacement = Readonly<{
8
10
  toolCallId: string;
9
11
  contentIndex: number;
@@ -37,17 +39,19 @@ export type SubagentAwaitResult = Readonly<{
37
39
  }>;
38
40
  export type SubagentStartData = Readonly<{
39
41
  operation: 'send';
40
- to: AgentPath;
41
- request: string;
42
- response: string;
43
- phase: 'ready' | 'sending' | 'waiting' | 'responding';
42
+ parameters: SubagentToolParameters;
43
+ result: Readonly<{
44
+ response: string;
45
+ phase: 'ready' | 'sending' | 'waiting' | 'responding';
46
+ }>;
44
47
  }> | Readonly<{
45
48
  operation: 'respond';
46
- body: string;
49
+ parameters: SubagentToolParameters;
50
+ result: Readonly<Record<string, unknown>>;
47
51
  }> | Readonly<{
48
52
  operation: 'await';
49
- requested: readonly AgentPath[];
50
- statuses: readonly SubagentAwaitStatus[];
53
+ parameters: SubagentToolParameters;
54
+ result: SubagentAwaitResult;
51
55
  }>;
52
56
  export type SubagentDeltaData = Readonly<{
53
57
  operation: 'send';
@@ -65,22 +69,34 @@ export type SubagentDeltaData = Readonly<{
65
69
  }>;
66
70
  export type SubagentEndData = Readonly<{
67
71
  operation: 'send';
68
- to: AgentPath;
69
- request: string;
70
- response: string;
71
- error?: string;
72
+ parameters?: SubagentToolParameters;
73
+ result: Readonly<Record<string, unknown>>;
72
74
  }> | Readonly<{
73
75
  operation: 'respond';
74
- body: string;
75
- error?: string;
76
+ parameters?: SubagentToolParameters;
77
+ result: Readonly<Record<string, unknown>>;
76
78
  }> | Readonly<{
77
79
  operation: 'await';
80
+ parameters: SubagentToolParameters;
78
81
  result: SubagentAwaitResult;
79
82
  }>;
80
83
  export type SubagentDelegatedChild = Readonly<{
81
84
  path: AgentPath;
82
85
  task: string;
83
86
  persona?: string;
87
+ status?: SubagentAwaitStatus['state'];
88
+ }>;
89
+ /** One agent touched by a teardown, carrying its final identity and usage. */
90
+ export type SubagentAffectedAgent = Readonly<{
91
+ path: AgentPath;
92
+ sessionId: string;
93
+ incarnation: string;
94
+ state: SubagentAwaitStatus['state'];
95
+ usage: SubagentUsage;
96
+ /** Pre-attach usage the reported delta excludes; present only when non-zero. */
97
+ usageBaseline?: SubagentUsage;
98
+ output?: string;
99
+ error?: string;
84
100
  }>;
85
101
  export type SubagentInterruptTarget = Readonly<{
86
102
  path: AgentPath;
@@ -98,40 +114,41 @@ export type SubagentResurrectedAgent = Readonly<{
98
114
  incarnation: string;
99
115
  state: 'idle' | 'running';
100
116
  usage: SubagentUsage;
117
+ usageBaseline?: SubagentUsage;
101
118
  output?: string;
102
119
  error?: string;
103
120
  }>;
104
121
  export type SubagentFiniteData = Readonly<{
105
122
  operation: 'delegation';
106
- children: readonly SubagentDelegatedChild[];
123
+ parameters: SubagentToolParameters;
124
+ result: Readonly<{
125
+ children: readonly SubagentDelegatedChild[];
126
+ }>;
107
127
  }> | Readonly<{
108
128
  operation: 'completion';
109
129
  result: SubagentCompletionResult;
110
130
  }> | Readonly<{
111
131
  operation: 'interrupt';
132
+ parameters: SubagentToolParameters;
112
133
  result: SubagentInterruptResult;
113
134
  }> | Readonly<{
114
135
  operation: 'teardown';
136
+ parameters: SubagentToolParameters;
115
137
  result: Readonly<{
116
- affectedAgents: readonly Readonly<{
117
- path: AgentPath;
118
- sessionId: string;
119
- incarnation: string;
120
- state: SubagentAwaitStatus['state'];
121
- usage: SubagentUsage;
122
- output?: string;
123
- error?: string;
124
- }>[];
138
+ affectedAgents: readonly SubagentAffectedAgent[];
125
139
  status: 'removed' | 'already_removed' | 'not_found';
126
140
  }>;
127
141
  }> | Readonly<{
128
142
  operation: 'resurrect';
143
+ parameters: SubagentToolParameters;
129
144
  result: Readonly<{
130
145
  affectedAgents: readonly SubagentResurrectedAgent[];
131
146
  }>;
132
147
  }> | Readonly<{
133
148
  operation: 'protocol_error';
134
- message: string;
149
+ result: Readonly<{
150
+ error: string;
151
+ }>;
135
152
  }>;
136
153
  export type SubagentFinalData = SubagentEndData | SubagentFiniteData;
137
154
  export type SubagentProtocolErrorData = Readonly<{
@@ -144,6 +144,8 @@ export type BorrowedSessionManager = Pick<AgentSession['sessionManager'], 'getEn
144
144
  */
145
145
  export type BorrowedAgentSession = Pick<AgentSession, 'sessionId' | 'sessionFile' | 'messages' | 'model' | 'thinkingLevel' | 'isStreaming' | 'isIdle' | 'isCompacting' | 'subscribe' | 'prompt' | 'steer' | 'followUp' | 'abort' | 'executeBash' | 'abortBash' | 'setModel' | 'cycleModel' | 'setThinkingLevel' | 'cycleThinkingLevel' | 'setAutoCompactionEnabled' | 'compact' | 'navigateTree' | 'getContextUsage' | 'getSessionStats'> & {
146
146
  readonly sessionManager: BorrowedSessionManager;
147
+ /** Current native steering queue, when supported by the provider. */
148
+ readonly getSteeringMessages?: AgentSession['getSteeringMessages'];
147
149
  /** Full-resync native state projection. */
148
150
  readonly state: Pick<AgentSession['state'], 'streamingMessage' | 'pendingToolCalls' | 'errorMessage'>;
149
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pimote/sdk",
3
- "version": "0.16.0-rc.2",
3
+ "version": "0.16.0-rc.4",
4
4
  "description": "Pimote extensibility SDK: panel cards, background-activity reap guard, Pimote extensions, and source-only folder discovery",
5
5
  "type": "module",
6
6
  "license": "MIT",