@hachej/boring-agent 0.1.90 → 0.1.92
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/dist/{chunk-4PKGVPJA.js → chunk-2GBHYJVC.js} +27 -5
- package/dist/{chunk-BEFJNMKQ.js → chunk-CJ2BW2W2.js} +23 -8
- package/dist/{chunk-F7ZS27HE.js → chunk-IWBC6SF7.js} +93 -19
- package/dist/chunk-NITBKFG6.js +1246 -0
- package/dist/{chunk-JEDRQAR5.js → chunk-OFQ7J6SI.js} +8 -2
- package/dist/{chunk-5CYVBVP3.js → chunk-V3ZD3T3G.js} +4785 -2153
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +2 -2
- package/dist/{createHarness-UCCGMVQJ.js → createHarness-PMYRKDE4.js} +2 -2
- package/dist/errors-C38f6pol.d.ts +200 -0
- package/dist/front/index.d.ts +20 -4
- package/dist/front/index.js +172 -44
- package/dist/{harness-Rbkdpvse.d.ts → harness-Cc48o6uS.d.ts} +2 -2
- package/dist/{workspaceAgentDispatcher-50Uzuxhs.d.ts → lease-BqeCLGPL.d.ts} +266 -57
- package/dist/{protocol-CDA4bcP9.d.ts → middleware-CzW8n7B7.d.ts} +20 -2
- package/dist/piChatEvent-BsMp3MSo.d.ts +368 -0
- package/dist/{piChatSessionService-DDKPOj4x.d.ts → piChatSessionService-BrPqKrpY.d.ts} +5 -1
- package/dist/{sandbox-OEG_l9GE.d.ts → sandbox-DAD8cWQR.d.ts} +14 -1
- package/dist/server/agent-host/testing/gatewayConformance.d.ts +41 -0
- package/dist/server/agent-host/testing/gatewayConformance.js +465 -0
- package/dist/server/index.d.ts +451 -528
- package/dist/server/index.js +43 -9
- package/dist/server/worker/index.d.ts +2 -2
- package/dist/server/worker/index.js +7 -7
- package/dist/shared/index.d.ts +115 -41
- package/dist/shared/index.js +65 -282
- package/dist/types-uQozUhGt.d.ts +759 -0
- package/docs/ACCESSIBILITY.md +4 -5
- package/docs/API.md +3 -0
- package/docs/AUTHORING.md +68 -0
- package/docs/ERROR_CODES.md +27 -6
- package/docs/README.md +1 -0
- package/docs/runtime.md +3 -3
- package/package.json +22 -13
- package/dist/chunk-CFQQXJKK.js +0 -385
- package/dist/chunk-DGRKMMXO.js +0 -8
- package/dist/piChatEvent-CHgln6yx.d.ts +0 -367
package/dist/core/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as AgentHarness, a as AgentReadiness, b as Agent } from '../harness-
|
|
2
|
-
export { c as AGENT_NOT_IMPLEMENTED_UNTIL_T1, d as AgentActor, e as AgentCoreHarness, f as AgentCoreHarnessFactory, g as AgentCorePromptInput, h as AgentCoreSessionAdapter, i as AgentCoreSessionSnapshot, j as AgentEvent, k as AgentMessageContent, l as AgentMessagePart, m as AgentNotImplementedError, n as AgentReadinessStatus, o as AgentResolveInputResponse, p as AgentSendInput, q as AgentStartReceipt, r as AgentStreamOptions } from '../harness-
|
|
3
|
-
import { S as SessionStore } from '../piChatEvent-
|
|
4
|
-
import { A as AgentCoreSessionService, a as AgentEffectAdmission } from '../piChatSessionService-
|
|
5
|
-
export { b as AGENT_EFFECT_METHODS, c as AgentEffectAdmissionError, P as PiChatEventStreamResult, d as PiChatEventStreamSubscription, e as PiChatEventSubscriber, f as PiChatReplayRangeError, g as PiChatSessionService, h as PiSessionCreateInit, i as PiSessionRequestContext, w as withAgentEffectAdmission } from '../piChatSessionService-
|
|
1
|
+
import { A as AgentHarness, a as AgentReadiness, b as Agent } from '../harness-Cc48o6uS.js';
|
|
2
|
+
export { c as AGENT_NOT_IMPLEMENTED_UNTIL_T1, d as AgentActor, e as AgentCoreHarness, f as AgentCoreHarnessFactory, g as AgentCorePromptInput, h as AgentCoreSessionAdapter, i as AgentCoreSessionSnapshot, j as AgentEvent, k as AgentMessageContent, l as AgentMessagePart, m as AgentNotImplementedError, n as AgentReadinessStatus, o as AgentResolveInputResponse, p as AgentSendInput, q as AgentStartReceipt, r as AgentStreamOptions } from '../harness-Cc48o6uS.js';
|
|
3
|
+
import { S as SessionStore } from '../piChatEvent-BsMp3MSo.js';
|
|
4
|
+
import { A as AgentCoreSessionService, a as AgentEffectAdmission } from '../piChatSessionService-BrPqKrpY.js';
|
|
5
|
+
export { b as AGENT_EFFECT_METHODS, c as AgentEffectAdmissionError, P as PiChatEventStreamResult, d as PiChatEventStreamSubscription, e as PiChatEventSubscriber, f as PiChatReplayRangeError, g as PiChatSessionService, h as PiSessionCreateInit, i as PiSessionRequestContext, w as withAgentEffectAdmission } from '../piChatSessionService-BrPqKrpY.js';
|
|
6
6
|
import '@mariozechner/pi-coding-agent';
|
|
7
7
|
import 'zod';
|
|
8
8
|
|
package/dist/core/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
AgentEffectAdmissionError,
|
|
4
4
|
createAgent,
|
|
5
5
|
withAgentEffectAdmission
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-CJ2BW2W2.js";
|
|
7
7
|
import {
|
|
8
8
|
AGENT_NOT_IMPLEMENTED_UNTIL_T1,
|
|
9
9
|
AgentNotImplementedError
|
|
10
10
|
} from "../chunk-WSQ5QNIY.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-2GBHYJVC.js";
|
|
12
12
|
export {
|
|
13
13
|
AGENT_EFFECT_METHODS,
|
|
14
14
|
AGENT_NOT_IMPLEMENTED_UNTIL_T1,
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
deriveSourcePlugin,
|
|
5
5
|
mergePiPackageSources,
|
|
6
6
|
withPiHarnessDefaults
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IWBC6SF7.js";
|
|
8
8
|
import "./chunk-AQBXNPMD.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-2GBHYJVC.js";
|
|
10
10
|
export {
|
|
11
11
|
createPiCodingAgentHarness,
|
|
12
12
|
createResourceSettingsManager,
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { b as PiChatEvent, o as ChatModelSelection, K as ThinkingLevel, v as ChatAttachmentPayload, Q as QueuedUserMessage, n as PiChatSnapshot } from './piChatEvent-BsMp3MSo.js';
|
|
2
|
+
|
|
3
|
+
/** Placement-independent event envelope. `seq` is the only replay cursor. */
|
|
4
|
+
interface AgentSessionEvent {
|
|
5
|
+
readonly ref: AgentSessionRef;
|
|
6
|
+
readonly seq: number;
|
|
7
|
+
readonly event: JsonSafe<PiChatEvent>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type WorkspaceScopeId = string;
|
|
11
|
+
type AuthSubjectId = string;
|
|
12
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
13
|
+
type JsonValue = JsonPrimitive | readonly JsonValue[] | {
|
|
14
|
+
readonly [key: string]: JsonValue;
|
|
15
|
+
};
|
|
16
|
+
/** Maps unknown event leaves onto the JSON transport boundary. */
|
|
17
|
+
type JsonSafe<T> = unknown extends T ? JsonValue : T extends JsonPrimitive ? T : T extends (...args: readonly never[]) => unknown ? never : T extends readonly (infer U)[] ? readonly JsonSafe<U>[] : T extends object ? {
|
|
18
|
+
readonly [K in keyof T]: JsonSafe<T[K]>;
|
|
19
|
+
} : never;
|
|
20
|
+
/** Verified identity facts returned only by the app-owned verifier. */
|
|
21
|
+
interface VerifiedAgentScopeClaim {
|
|
22
|
+
readonly workspaceScopeId: WorkspaceScopeId;
|
|
23
|
+
readonly authSubjectId: AuthSubjectId;
|
|
24
|
+
}
|
|
25
|
+
declare const authorizedAgentScope: unique symbol;
|
|
26
|
+
/**
|
|
27
|
+
* Issuer-owned runtime capability. It is deliberately not a transport DTO and
|
|
28
|
+
* must be checked by issuer identity and current membership on every use.
|
|
29
|
+
*/
|
|
30
|
+
interface AuthorizedAgentScope {
|
|
31
|
+
readonly workspaceScopeId: WorkspaceScopeId;
|
|
32
|
+
readonly authSubjectId: AuthSubjectId;
|
|
33
|
+
readonly [authorizedAgentScope]: true;
|
|
34
|
+
}
|
|
35
|
+
interface AgentScopeVerifier {
|
|
36
|
+
verify(scope: AuthorizedAgentScope): Promise<VerifiedAgentScopeClaim>;
|
|
37
|
+
}
|
|
38
|
+
interface AgentSessionRef {
|
|
39
|
+
readonly agentTypeId: string;
|
|
40
|
+
readonly sessionId: string;
|
|
41
|
+
}
|
|
42
|
+
interface AgentSummary {
|
|
43
|
+
readonly agentTypeId: string;
|
|
44
|
+
readonly label: string;
|
|
45
|
+
readonly description?: string;
|
|
46
|
+
readonly definition?: {
|
|
47
|
+
readonly version: string;
|
|
48
|
+
readonly digest: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
interface ListAgentsInput {
|
|
52
|
+
readonly scope: AuthorizedAgentScope;
|
|
53
|
+
}
|
|
54
|
+
interface AuthorizedAgentSessionQuery {
|
|
55
|
+
readonly scope: AuthorizedAgentScope;
|
|
56
|
+
readonly agentTypeId?: string;
|
|
57
|
+
readonly cursor?: string;
|
|
58
|
+
readonly limit?: number;
|
|
59
|
+
}
|
|
60
|
+
type AgentSessionActivity = 'idle' | 'running' | 'aborting' | 'error';
|
|
61
|
+
interface AgentSessionSummary {
|
|
62
|
+
readonly ref: AgentSessionRef;
|
|
63
|
+
readonly title: string;
|
|
64
|
+
readonly status: AgentSessionActivity;
|
|
65
|
+
readonly createdAt: number;
|
|
66
|
+
readonly updatedAt: number;
|
|
67
|
+
}
|
|
68
|
+
interface AgentSessionPage {
|
|
69
|
+
readonly sessions: readonly AgentSessionSummary[];
|
|
70
|
+
readonly nextCursor?: string;
|
|
71
|
+
}
|
|
72
|
+
interface CreateAgentSessionInput {
|
|
73
|
+
readonly scope: AuthorizedAgentScope;
|
|
74
|
+
readonly agentTypeId: string;
|
|
75
|
+
readonly requestId: string;
|
|
76
|
+
readonly title?: string;
|
|
77
|
+
}
|
|
78
|
+
interface ConnectAgentSessionInput {
|
|
79
|
+
readonly scope: AuthorizedAgentScope;
|
|
80
|
+
readonly ref: AgentSessionRef;
|
|
81
|
+
readonly cursor?: number;
|
|
82
|
+
}
|
|
83
|
+
interface ReadAgentSessionStateInput {
|
|
84
|
+
readonly scope: AuthorizedAgentScope;
|
|
85
|
+
readonly ref: AgentSessionRef;
|
|
86
|
+
}
|
|
87
|
+
interface RenameAgentSessionInput {
|
|
88
|
+
readonly scope: AuthorizedAgentScope;
|
|
89
|
+
readonly ref: AgentSessionRef;
|
|
90
|
+
readonly requestId: string;
|
|
91
|
+
readonly title: string;
|
|
92
|
+
}
|
|
93
|
+
interface DeleteAgentSessionInput {
|
|
94
|
+
readonly scope: AuthorizedAgentScope;
|
|
95
|
+
readonly ref: AgentSessionRef;
|
|
96
|
+
readonly requestId: string;
|
|
97
|
+
}
|
|
98
|
+
interface AgentPromptCommand {
|
|
99
|
+
readonly kind: 'prompt';
|
|
100
|
+
readonly requestId: string;
|
|
101
|
+
readonly clientNonce: string;
|
|
102
|
+
readonly content: string;
|
|
103
|
+
readonly displayContent?: string;
|
|
104
|
+
readonly model?: ChatModelSelection;
|
|
105
|
+
readonly thinkingLevel?: ThinkingLevel;
|
|
106
|
+
readonly attachments?: readonly ChatAttachmentPayload[];
|
|
107
|
+
}
|
|
108
|
+
interface AgentFollowUpCommand {
|
|
109
|
+
readonly kind: 'followup';
|
|
110
|
+
readonly requestId: string;
|
|
111
|
+
readonly clientNonce: string;
|
|
112
|
+
readonly content: string;
|
|
113
|
+
readonly displayContent?: string;
|
|
114
|
+
readonly clientSeq: number;
|
|
115
|
+
}
|
|
116
|
+
type IdempotentAgentSend = AgentPromptCommand | AgentFollowUpCommand;
|
|
117
|
+
interface IdempotentAgentControl {
|
|
118
|
+
readonly requestId: string;
|
|
119
|
+
}
|
|
120
|
+
interface IdempotentQueueClear extends IdempotentAgentControl {
|
|
121
|
+
readonly clientNonce?: string;
|
|
122
|
+
readonly clientSeq?: number;
|
|
123
|
+
}
|
|
124
|
+
interface CommandReceipt {
|
|
125
|
+
readonly accepted: true;
|
|
126
|
+
readonly cursor: number;
|
|
127
|
+
}
|
|
128
|
+
interface AgentSendReceipt extends CommandReceipt {
|
|
129
|
+
readonly disposition: 'prompt' | 'followup';
|
|
130
|
+
readonly clientNonce: string;
|
|
131
|
+
readonly duplicate?: boolean;
|
|
132
|
+
readonly clientSeq?: number;
|
|
133
|
+
}
|
|
134
|
+
interface QueueClearReceipt extends CommandReceipt {
|
|
135
|
+
readonly cleared: number;
|
|
136
|
+
}
|
|
137
|
+
interface StopReceipt extends CommandReceipt {
|
|
138
|
+
readonly stopped: boolean;
|
|
139
|
+
readonly clearedQueue: readonly QueuedUserMessage[];
|
|
140
|
+
}
|
|
141
|
+
interface AgentSessionStateSnapshot {
|
|
142
|
+
readonly ref: AgentSessionRef;
|
|
143
|
+
readonly seq: number;
|
|
144
|
+
readonly summary: AgentSessionSummary;
|
|
145
|
+
readonly state: JsonSafe<PiChatSnapshot>;
|
|
146
|
+
}
|
|
147
|
+
interface AgentSessionConnection {
|
|
148
|
+
readonly ref: AgentSessionRef;
|
|
149
|
+
readonly events: AsyncIterable<AgentSessionEvent>;
|
|
150
|
+
send(input: IdempotentAgentSend): Promise<AgentSendReceipt>;
|
|
151
|
+
interrupt(input: IdempotentAgentControl): Promise<CommandReceipt>;
|
|
152
|
+
stop(input: IdempotentAgentControl): Promise<StopReceipt>;
|
|
153
|
+
clearQueue(input: IdempotentQueueClear): Promise<QueueClearReceipt>;
|
|
154
|
+
close(): Promise<void>;
|
|
155
|
+
}
|
|
156
|
+
interface AgentGateway {
|
|
157
|
+
listAgents(input: ListAgentsInput): Promise<readonly AgentSummary[]>;
|
|
158
|
+
listSessions(input: AuthorizedAgentSessionQuery): Promise<AgentSessionPage>;
|
|
159
|
+
createSession(input: CreateAgentSessionInput): Promise<AgentSessionRef>;
|
|
160
|
+
connectSession(input: ConnectAgentSessionInput): Promise<AgentSessionConnection>;
|
|
161
|
+
readSessionState(input: ReadAgentSessionStateInput): Promise<AgentSessionStateSnapshot>;
|
|
162
|
+
renameSession(input: RenameAgentSessionInput): Promise<AgentSessionSummary>;
|
|
163
|
+
deleteSession(input: DeleteAgentSessionInput): Promise<void>;
|
|
164
|
+
close(): Promise<void>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
interface FileSearch {
|
|
168
|
+
search(glob: string, limit?: number): Promise<string[]>;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
declare const AgentGatewayErrorCode: {
|
|
172
|
+
readonly AGENT_TYPE_UNKNOWN: "AGENT_TYPE_UNKNOWN";
|
|
173
|
+
readonly AGENT_SESSION_NOT_FOUND: "AGENT_SESSION_NOT_FOUND";
|
|
174
|
+
readonly AGENT_SCOPE_DENIED: "AGENT_SCOPE_DENIED";
|
|
175
|
+
readonly AGENT_SESSION_REPLAY_GAP: "AGENT_SESSION_REPLAY_GAP";
|
|
176
|
+
readonly AGENT_SESSION_CURSOR_AHEAD: "AGENT_SESSION_CURSOR_AHEAD";
|
|
177
|
+
readonly AGENT_SESSION_CURSOR_EXPIRED: "AGENT_SESSION_CURSOR_EXPIRED";
|
|
178
|
+
readonly AGENT_SESSION_CURSOR_INVALID: "AGENT_SESSION_CURSOR_INVALID";
|
|
179
|
+
readonly AGENT_REQUEST_CONFLICT: "AGENT_REQUEST_CONFLICT";
|
|
180
|
+
readonly AGENT_REQUEST_OUTCOME_UNKNOWN: "AGENT_REQUEST_OUTCOME_UNKNOWN";
|
|
181
|
+
readonly AGENT_COMMAND_INVALID_STATE: "AGENT_COMMAND_INVALID_STATE";
|
|
182
|
+
readonly AGENT_SESSION_RUNTIME_SCOPE_MISMATCH: "AGENT_SESSION_RUNTIME_SCOPE_MISMATCH";
|
|
183
|
+
readonly AGENT_SHARED_ENVIRONMENT_UNAVAILABLE: "AGENT_SHARED_ENVIRONMENT_UNAVAILABLE";
|
|
184
|
+
readonly AGENT_GATEWAY_CLOSED: "AGENT_GATEWAY_CLOSED";
|
|
185
|
+
};
|
|
186
|
+
type AgentGatewayErrorCode = (typeof AgentGatewayErrorCode)[keyof typeof AgentGatewayErrorCode];
|
|
187
|
+
declare const AGENT_GATEWAY_ERROR_CODES: readonly ["AGENT_TYPE_UNKNOWN", "AGENT_SESSION_NOT_FOUND", "AGENT_SCOPE_DENIED", "AGENT_SESSION_REPLAY_GAP", "AGENT_SESSION_CURSOR_AHEAD", "AGENT_SESSION_CURSOR_EXPIRED", "AGENT_SESSION_CURSOR_INVALID", "AGENT_REQUEST_CONFLICT", "AGENT_REQUEST_OUTCOME_UNKNOWN", "AGENT_COMMAND_INVALID_STATE", "AGENT_SESSION_RUNTIME_SCOPE_MISMATCH", "AGENT_SHARED_ENVIRONMENT_UNAVAILABLE", "AGENT_GATEWAY_CLOSED"];
|
|
188
|
+
interface AgentGatewayErrorDTO {
|
|
189
|
+
readonly code: AgentGatewayErrorCode;
|
|
190
|
+
readonly message: string;
|
|
191
|
+
readonly details?: JsonValue;
|
|
192
|
+
}
|
|
193
|
+
declare class AgentGatewayError extends Error {
|
|
194
|
+
readonly code: AgentGatewayErrorCode;
|
|
195
|
+
readonly details?: JsonValue;
|
|
196
|
+
constructor(code: AgentGatewayErrorCode, message: string, details?: JsonValue);
|
|
197
|
+
toJSON(): AgentGatewayErrorDTO;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export { type AgentGateway as A, type ConnectAgentSessionInput as C, type DeleteAgentSessionInput as D, type FileSearch as F, type IdempotentAgentControl as I, type JsonValue as J, type ListAgentsInput as L, type ReadAgentSessionStateInput as R, type VerifiedAgentScopeClaim as V, type WorkspaceScopeId as W, type AuthorizedAgentScope as a, type AgentSessionRef as b, type AgentSessionActivity as c, type AgentSessionSummary as d, type AgentSessionStateSnapshot as e, type AgentSessionConnection as f, type AgentGatewayErrorDTO as g, type AgentScopeVerifier as h, AGENT_GATEWAY_ERROR_CODES as i, type AgentFollowUpCommand as j, AgentGatewayError as k, AgentGatewayErrorCode as l, type AgentPromptCommand as m, type AgentSendReceipt as n, type AgentSessionEvent as o, type AgentSessionPage as p, type AgentSummary as q, type AuthSubjectId as r, type AuthorizedAgentSessionQuery as s, type CreateAgentSessionInput as t, type IdempotentAgentSend as u, type IdempotentQueueClear as v, type JsonPrimitive as w, type JsonSafe as x, type RenameAgentSessionInput as y };
|
package/dist/front/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentProps, HTMLAttributes, FormEvent, ReactNode, ComponentType } from 'react';
|
|
3
3
|
import { FileUIPart, ChatStatus, UIMessage } from 'ai';
|
|
4
|
-
import { T as ToolUiMetadata, B as BoringChatPart, a as BoringChatMessage, P as PiChatStatus, Q as QueuedUserMessage, C as ChatError, b as PiChatEvent, c as PromptPayload, d as PromptReceipt, F as FollowUpPayload, e as FollowUpReceipt, f as QueueClearPayload, g as QueueClearReceipt, I as InterruptPayload, h as CommandReceipt, i as StopPayload, j as StopReceipt, k as SessionSummary } from '../piChatEvent-
|
|
4
|
+
import { T as ToolUiMetadata, B as BoringChatPart, a as BoringChatMessage, P as PiChatStatus, Q as QueuedUserMessage, C as ChatError, b as PiChatEvent, c as PromptPayload, d as PromptReceipt, F as FollowUpPayload, e as FollowUpReceipt, f as QueueClearPayload, g as QueueClearReceipt, I as InterruptPayload, h as CommandReceipt, i as StopPayload, j as StopReceipt, k as SessionSummary } from '../piChatEvent-BsMp3MSo.js';
|
|
5
5
|
import { InputGroupAddon, InputGroupButton, InputGroupTextarea, Button, Collapsible, CollapsibleContent, CollapsibleTrigger } from '@hachej/boring-ui-kit';
|
|
6
6
|
import { Streamdown } from 'streamdown';
|
|
7
7
|
import { StickToBottom } from 'use-stick-to-bottom';
|
|
@@ -336,6 +336,8 @@ interface RemotePiSessionHeaders {
|
|
|
336
336
|
}
|
|
337
337
|
interface RemotePiSessionOptions {
|
|
338
338
|
sessionId: string;
|
|
339
|
+
/** Selects the additive addressed AgentGateway transport. Omit for legacy wire. */
|
|
340
|
+
agentTypeId?: string;
|
|
339
341
|
workspaceId?: string;
|
|
340
342
|
storageScope?: string;
|
|
341
343
|
apiBaseUrl?: string;
|
|
@@ -432,11 +434,14 @@ declare class RemotePiSession {
|
|
|
432
434
|
private ensureReconnectScheduled;
|
|
433
435
|
private scheduleReconnect;
|
|
434
436
|
private postCommand;
|
|
437
|
+
private addressedCommandReceipt;
|
|
435
438
|
private rollbackOptimisticMessage;
|
|
436
439
|
private fetchJson;
|
|
437
440
|
private requestHeaders;
|
|
438
441
|
private stateUrl;
|
|
442
|
+
private eventsUrl;
|
|
439
443
|
private sessionUrl;
|
|
444
|
+
private addressedCommandPayload;
|
|
440
445
|
private dispatchProtocolError;
|
|
441
446
|
private recordEventType;
|
|
442
447
|
private recordLargeStateWarning;
|
|
@@ -465,10 +470,14 @@ interface PiSessionCreateInit {
|
|
|
465
470
|
}
|
|
466
471
|
interface PiSessionRefreshOptions {
|
|
467
472
|
background?: boolean;
|
|
473
|
+
/** Reject when the authoritative refresh fails instead of only updating hook state. */
|
|
474
|
+
throwOnError?: boolean;
|
|
468
475
|
}
|
|
469
476
|
interface UsePiSessionsOptions {
|
|
470
477
|
apiBaseUrl?: string;
|
|
471
478
|
sessionsApiPath?: string;
|
|
479
|
+
/** Selects the additive addressed AgentGateway transport. Omit for legacy wire. */
|
|
480
|
+
agentTypeId?: string;
|
|
472
481
|
workspaceId?: string;
|
|
473
482
|
storageScope?: string;
|
|
474
483
|
requestHeaders?: Record<string, string | undefined>;
|
|
@@ -478,7 +487,7 @@ interface UsePiSessionsOptions {
|
|
|
478
487
|
fetch?: typeof globalThis.fetch;
|
|
479
488
|
storage?: ActiveSessionStorageLike;
|
|
480
489
|
createRemoteSession?: (options: RemotePiSessionOptions) => RemotePiSession;
|
|
481
|
-
remoteSessionOptions?: Omit<Partial<RemotePiSessionOptions>, 'sessionId' | 'workspaceId' | 'storageScope' | 'apiBaseUrl' | 'headers' | 'fetch'>;
|
|
490
|
+
remoteSessionOptions?: Omit<Partial<RemotePiSessionOptions>, 'sessionId' | 'agentTypeId' | 'workspaceId' | 'storageScope' | 'apiBaseUrl' | 'headers' | 'fetch'>;
|
|
482
491
|
connectActiveSession?: boolean;
|
|
483
492
|
retry?: {
|
|
484
493
|
maxRetries?: number;
|
|
@@ -600,6 +609,8 @@ interface AgentPluginReloadResult {
|
|
|
600
609
|
interface PiChatPanelProps<TComposerBlocker extends ComposerBlocker = ComposerBlocker> {
|
|
601
610
|
/** Optional externally selected Pi session id. When provided, session navigation is owned by the host. */
|
|
602
611
|
sessionId?: string;
|
|
612
|
+
/** Selects the additive addressed AgentGateway transport. Omit for legacy wire. */
|
|
613
|
+
agentTypeId?: string;
|
|
603
614
|
/** Alias kept for consumers that still pass the pre-cutover prop name. */
|
|
604
615
|
extraCommands?: SlashCommand[];
|
|
605
616
|
apiBaseUrl?: string;
|
|
@@ -667,7 +678,7 @@ interface PiChatPanelProps<TComposerBlocker extends ComposerBlocker = ComposerBl
|
|
|
667
678
|
* knowing what the code means or what the action does. */
|
|
668
679
|
renderNoticeAction?: (notice: PiChatRuntimeNotice) => ReactNode;
|
|
669
680
|
}
|
|
670
|
-
declare function PiChatPanel<TComposerBlocker extends ComposerBlocker = ComposerBlocker>({ sessionId, extraCommands, apiBaseUrl, workspaceId, storageScope, requestHeaders, storage, fetch, className, chrome, debug, showSessions, hotReloadEnabled, suggestions, emptyState, emptyPlacement, composerPlaceholder, initialDraft, autoSubmitInitialDraft, onDraftRestored, onAutoSubmitInitialDraftAccepted, onAutoSubmitInitialDraftSettled, model, defaultModel, availableModels, hideDefaultModelOption, hideComposerSettings, suppressPreSubmitCancelledWarning, thinkingLevel, thinkingControl, serverResourcesEnabled, mentionedFiles, commands, excludeBuiltinCommands, toolRenderers, createRemoteSession, remoteSessionOptions, hydrateMessages, allowPromptDuringInitialHydration, workspaceWarmupStatus, onSessionReset, onBeforeSubmit, onReloadAgentPlugins, onCommandResult, onComposerWarning, onMentionedFilesConsumed, onPromptSubmitStarted, onData, onOpenArtifact, composerBlockers, onComposerStop, onComposerBlockerAction, onTurnComplete, renderNoticeAction, }: PiChatPanelProps<TComposerBlocker>): react.JSX.Element;
|
|
681
|
+
declare function PiChatPanel<TComposerBlocker extends ComposerBlocker = ComposerBlocker>({ sessionId, agentTypeId, extraCommands, apiBaseUrl, workspaceId, storageScope, requestHeaders, storage, fetch, className, chrome, debug, showSessions, hotReloadEnabled, suggestions, emptyState, emptyPlacement, composerPlaceholder, initialDraft, autoSubmitInitialDraft, onDraftRestored, onAutoSubmitInitialDraftAccepted, onAutoSubmitInitialDraftSettled, model, defaultModel, availableModels, hideDefaultModelOption, hideComposerSettings, suppressPreSubmitCancelledWarning, thinkingLevel, thinkingControl, serverResourcesEnabled, mentionedFiles, commands, excludeBuiltinCommands, toolRenderers, createRemoteSession, remoteSessionOptions, hydrateMessages, allowPromptDuringInitialHydration, workspaceWarmupStatus, onSessionReset, onBeforeSubmit, onReloadAgentPlugins, onCommandResult, onComposerWarning, onMentionedFilesConsumed, onPromptSubmitStarted, onData, onOpenArtifact, composerBlockers, onComposerStop, onComposerBlockerAction, onTurnComplete, renderNoticeAction, }: PiChatPanelProps<TComposerBlocker>): react.JSX.Element;
|
|
671
682
|
|
|
672
683
|
interface DebugDrawerProps {
|
|
673
684
|
apiBaseUrl?: string;
|
|
@@ -699,6 +710,7 @@ declare const ModelSelectTrigger: react.ForwardRefExoticComponent<Omit<Omit<reac
|
|
|
699
710
|
disabled?: boolean;
|
|
700
711
|
trigger?: SelectorTrigger;
|
|
701
712
|
open?: boolean;
|
|
713
|
+
emptyLabel?: string;
|
|
702
714
|
} & react.RefAttributes<HTMLButtonElement>>;
|
|
703
715
|
declare function ModelPickerMenu({ value, onChange, options, disabled, hideDefaultOption, onClose, className, }: {
|
|
704
716
|
value: ModelSelection | null;
|
|
@@ -716,7 +728,7 @@ declare function ModelPickerMenu({ value, onChange, options, disabled, hideDefau
|
|
|
716
728
|
* option's stored value, encoded as "{provider}:{id}" to keep
|
|
717
729
|
* ids stable across providers.
|
|
718
730
|
*/
|
|
719
|
-
declare function ModelSelect({ value, onChange, options, disabled, trigger, openSignal, className, }: {
|
|
731
|
+
declare function ModelSelect({ value, onChange, options, disabled, trigger, openSignal, className, emptyLabel, ariaInvalid, ariaDescribedBy, hideDefaultOption, }: {
|
|
720
732
|
value: ModelSelection | null;
|
|
721
733
|
onChange: (next: ModelSelection | null) => void;
|
|
722
734
|
options: AvailableModel[];
|
|
@@ -724,6 +736,10 @@ declare function ModelSelect({ value, onChange, options, disabled, trigger, open
|
|
|
724
736
|
trigger?: SelectorTrigger;
|
|
725
737
|
openSignal?: unknown;
|
|
726
738
|
className?: string;
|
|
739
|
+
emptyLabel?: string;
|
|
740
|
+
ariaInvalid?: boolean;
|
|
741
|
+
ariaDescribedBy?: string;
|
|
742
|
+
hideDefaultOption?: boolean;
|
|
727
743
|
}): react.JSX.Element;
|
|
728
744
|
declare function ThinkingSelect({ value, onChange, disabled, trigger, openSignal, className, }: {
|
|
729
745
|
value: ThinkingLevel;
|