@pimote/sdk 0.16.0-rc.2 → 0.16.0-rc.3
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 +17 -1
- package/dist/subagents/index.d.ts +1 -1
- package/dist/subagents/presentation.d.ts +28 -16
- package/dist/subagents/types.d.ts +2 -0
- package/package.json +1 -1
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.
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
parameters: SubagentToolParameters;
|
|
43
|
+
result: Readonly<{
|
|
44
|
+
response: string;
|
|
45
|
+
phase: 'ready' | 'sending' | 'waiting' | 'responding';
|
|
46
|
+
}>;
|
|
44
47
|
}> | Readonly<{
|
|
45
48
|
operation: 'respond';
|
|
46
|
-
|
|
49
|
+
parameters: SubagentToolParameters;
|
|
50
|
+
result: Readonly<Record<string, unknown>>;
|
|
47
51
|
}> | Readonly<{
|
|
48
52
|
operation: 'await';
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
parameters: SubagentToolParameters;
|
|
54
|
+
result: SubagentAwaitResult;
|
|
51
55
|
}>;
|
|
52
56
|
export type SubagentDeltaData = Readonly<{
|
|
53
57
|
operation: 'send';
|
|
@@ -65,22 +69,22 @@ export type SubagentDeltaData = Readonly<{
|
|
|
65
69
|
}>;
|
|
66
70
|
export type SubagentEndData = Readonly<{
|
|
67
71
|
operation: 'send';
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
response: string;
|
|
71
|
-
error?: string;
|
|
72
|
+
parameters?: SubagentToolParameters;
|
|
73
|
+
result: Readonly<Record<string, unknown>>;
|
|
72
74
|
}> | Readonly<{
|
|
73
75
|
operation: 'respond';
|
|
74
|
-
|
|
75
|
-
|
|
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'];
|
|
84
88
|
}>;
|
|
85
89
|
export type SubagentInterruptTarget = Readonly<{
|
|
86
90
|
path: AgentPath;
|
|
@@ -103,15 +107,20 @@ export type SubagentResurrectedAgent = Readonly<{
|
|
|
103
107
|
}>;
|
|
104
108
|
export type SubagentFiniteData = Readonly<{
|
|
105
109
|
operation: 'delegation';
|
|
106
|
-
|
|
110
|
+
parameters: SubagentToolParameters;
|
|
111
|
+
result: Readonly<{
|
|
112
|
+
children: readonly SubagentDelegatedChild[];
|
|
113
|
+
}>;
|
|
107
114
|
}> | Readonly<{
|
|
108
115
|
operation: 'completion';
|
|
109
116
|
result: SubagentCompletionResult;
|
|
110
117
|
}> | Readonly<{
|
|
111
118
|
operation: 'interrupt';
|
|
119
|
+
parameters: SubagentToolParameters;
|
|
112
120
|
result: SubagentInterruptResult;
|
|
113
121
|
}> | Readonly<{
|
|
114
122
|
operation: 'teardown';
|
|
123
|
+
parameters: SubagentToolParameters;
|
|
115
124
|
result: Readonly<{
|
|
116
125
|
affectedAgents: readonly Readonly<{
|
|
117
126
|
path: AgentPath;
|
|
@@ -126,12 +135,15 @@ export type SubagentFiniteData = Readonly<{
|
|
|
126
135
|
}>;
|
|
127
136
|
}> | Readonly<{
|
|
128
137
|
operation: 'resurrect';
|
|
138
|
+
parameters: SubagentToolParameters;
|
|
129
139
|
result: Readonly<{
|
|
130
140
|
affectedAgents: readonly SubagentResurrectedAgent[];
|
|
131
141
|
}>;
|
|
132
142
|
}> | Readonly<{
|
|
133
143
|
operation: 'protocol_error';
|
|
134
|
-
|
|
144
|
+
result: Readonly<{
|
|
145
|
+
error: string;
|
|
146
|
+
}>;
|
|
135
147
|
}>;
|
|
136
148
|
export type SubagentFinalData = SubagentEndData | SubagentFiniteData;
|
|
137
149
|
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