@hachej/boring-agent 0.1.109 → 0.1.111
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/{errors-CEU4iujR.d.ts → admin-DORVQfLn.d.ts} +80 -3
- package/dist/{chunk-GS4ADE34.js → chunk-42D6KAQV.js} +36 -12
- package/dist/{chunk-6OANSUEI.js → chunk-72KT6VWV.js} +59 -2
- package/dist/{chunk-3JFPS2O6.js → chunk-KJIEMSQP.js} +10 -1
- package/dist/{chunk-MVKXLMH3.js → chunk-KN72XWP7.js} +1 -1
- package/dist/{chunk-KDXIXVF6.js → chunk-V3H5A3BR.js} +12410 -5047
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +2 -1
- package/dist/{createHarness-AHWSC36D.js → createHarness-DOLOHA62.js} +2 -2
- package/dist/file-search-BUgMSKZE.d.ts +289 -0
- package/dist/front/index.d.ts +89 -4
- package/dist/front/index.js +508 -47
- package/dist/front/styles.css +55 -55
- package/dist/{harness-Ct0e4RWc.d.ts → harness-qHlMJhZo.d.ts} +1 -1
- package/dist/{piChatEvent-BUWIzw5l.d.ts → piChatEvent-DpE0lIb9.d.ts} +49 -17
- package/dist/{piChatSessionService-nvroRAVk.d.ts → piChatSessionService-CBct-hmz.d.ts} +4 -1
- package/dist/server/agent-host/testing/gatewayConformance.d.ts +7 -6
- package/dist/server/agent-host/testing/gatewayConformance.js +14 -7
- package/dist/server/index.d.ts +890 -56
- package/dist/server/index.js +73 -7
- package/dist/server/worker/index.js +5 -5
- package/dist/{lease-nASWv2tU.d.ts → share-entry-CxS6UJ_L.d.ts} +77 -179
- package/dist/shared/index.d.ts +118 -222
- package/dist/shared/index.js +17 -5
- package/dist/{types-B7-PN5jV.d.ts → types-DcWoQMn8.d.ts} +346 -10
- package/docs/AGENT_GATEWAY_V0.md +22 -2
- package/docs/AGENT_PACKAGES.md +15 -5
- package/docs/ERROR_CODES.md +14 -0
- package/package.json +10 -18
- package/dist/file-search-BGUHnW9o.d.ts +0 -87
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-qHlMJhZo.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-qHlMJhZo.js';
|
|
3
|
+
import { S as SessionStore } from '../piChatEvent-DpE0lIb9.js';
|
|
4
|
+
import { A as AgentCoreSessionService, a as AgentEffectAdmission } from '../piChatSessionService-CBct-hmz.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-CBct-hmz.js';
|
|
6
6
|
import '@mariozechner/pi-coding-agent';
|
|
7
7
|
import 'zod';
|
|
8
8
|
|
package/dist/core/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "../chunk-YTUZFKB3.js";
|
|
5
5
|
import {
|
|
6
6
|
ErrorCode
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-KJIEMSQP.js";
|
|
8
8
|
|
|
9
9
|
// src/core/piChatSessionService.ts
|
|
10
10
|
var AgentEffectAdmissionError = class extends Error {
|
|
@@ -40,6 +40,7 @@ var AGENT_EFFECT_METHODS = {
|
|
|
40
40
|
};
|
|
41
41
|
function withAgentEffectAdmission(service, admit) {
|
|
42
42
|
return {
|
|
43
|
+
...service.resolveSessionStreamPath ? { resolveSessionStreamPath: (ctx, sessionId) => service.resolveSessionStreamPath(ctx, sessionId) } : {},
|
|
43
44
|
...service.ensurePiSessionBound ? { ensurePiSessionBound: (ctx, sessionId) => service.ensurePiSessionBound(ctx, sessionId) } : {},
|
|
44
45
|
...service.listSessions ? { listSessions: (ctx, options) => service.listSessions(ctx, options) } : {},
|
|
45
46
|
async createSession(ctx, init) {
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
mergePiPackageSources,
|
|
6
6
|
projectSkillResourceLocations,
|
|
7
7
|
withPiHarnessDefaults
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-42D6KAQV.js";
|
|
9
9
|
import "./chunk-7XAOVFSN.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-KJIEMSQP.js";
|
|
11
11
|
export {
|
|
12
12
|
createPiCodingAgentHarness,
|
|
13
13
|
createResourceSettingsManager,
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { o as InterruptReceipt, j as StopReceipt } from './piChatEvent-DpE0lIb9.js';
|
|
2
|
+
import { p as AgentSendInput, j as AgentEvent } from './harness-qHlMJhZo.js';
|
|
3
|
+
import { b as Workspace } from './sandbox-BMhut3kh.js';
|
|
4
|
+
import { b as AgentSessionRef, d as AgentSendReceipt, A as AgentGateway, a as AuthorizedAgentScope } from './admin-DORVQfLn.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Opaque, in-process Core capability. The brand symbol and constructor are not
|
|
8
|
+
* exported; Core records issued object identity in a private WeakMap.
|
|
9
|
+
*/
|
|
10
|
+
declare const authorizedWorkspaceCredentialScopeBrand: unique symbol;
|
|
11
|
+
interface AuthorizedWorkspaceCredentialScopeV1 {
|
|
12
|
+
readonly contractVersion: "boring.authorized-workspace-credential-scope.v1";
|
|
13
|
+
readonly [authorizedWorkspaceCredentialScopeBrand]: true;
|
|
14
|
+
}
|
|
15
|
+
type VerifiedWorkspaceCredentialPrincipalV1 = Readonly<{
|
|
16
|
+
kind: "user";
|
|
17
|
+
userId: string;
|
|
18
|
+
membershipRole: "owner" | "editor" | "viewer";
|
|
19
|
+
}> | Readonly<{
|
|
20
|
+
kind: "system";
|
|
21
|
+
principalId: string;
|
|
22
|
+
workspaceGrantId: string;
|
|
23
|
+
}>;
|
|
24
|
+
interface VerifiedWorkspaceCredentialAuthorityV1 {
|
|
25
|
+
readonly workspaceId: string;
|
|
26
|
+
readonly appId: string;
|
|
27
|
+
readonly principal: VerifiedWorkspaceCredentialPrincipalV1;
|
|
28
|
+
readonly authorizationReceiptId: string;
|
|
29
|
+
readonly expiresAt: string;
|
|
30
|
+
}
|
|
31
|
+
/** Core-owned verifier; a TypeScript cast or copied object is never authority. */
|
|
32
|
+
interface WorkspaceCredentialAuthorityVerifierV1 {
|
|
33
|
+
readonly contractVersion: "boring.workspace-credential-authority-verifier.v1";
|
|
34
|
+
verifyCurrent(scope: AuthorizedWorkspaceCredentialScopeV1): Promise<VerifiedWorkspaceCredentialAuthorityV1>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type ProviderId = string & {
|
|
38
|
+
readonly __providerId: unique symbol;
|
|
39
|
+
};
|
|
40
|
+
type CredentialFieldId = string & {
|
|
41
|
+
readonly __credentialFieldId: unique symbol;
|
|
42
|
+
};
|
|
43
|
+
type CredentialConsumerBindingId = string & {
|
|
44
|
+
readonly __credentialConsumerBindingId: unique symbol;
|
|
45
|
+
};
|
|
46
|
+
type ProviderCategoryV1 = "llm" | "search" | "transcription" | "mcp" | "other";
|
|
47
|
+
interface CredentialFieldDefinitionV1 {
|
|
48
|
+
readonly id: CredentialFieldId;
|
|
49
|
+
readonly label: string;
|
|
50
|
+
readonly required: boolean;
|
|
51
|
+
readonly sensitivity: "secret" | "public";
|
|
52
|
+
readonly minBytes?: number;
|
|
53
|
+
readonly maxBytes: number;
|
|
54
|
+
}
|
|
55
|
+
interface ExternalManagedAccountReferenceDefinitionV1 {
|
|
56
|
+
readonly label: string;
|
|
57
|
+
readonly maxBytes: number;
|
|
58
|
+
readonly persistence: "server-only-metadata";
|
|
59
|
+
}
|
|
60
|
+
type ProviderCredentialDefinitionV1 = Readonly<{
|
|
61
|
+
type: "api-key";
|
|
62
|
+
fields: readonly CredentialFieldDefinitionV1[];
|
|
63
|
+
}> | Readonly<{
|
|
64
|
+
type: "oauth2-authorization-code";
|
|
65
|
+
tokenCustody: "local-vault";
|
|
66
|
+
clientRegistrationRef: string;
|
|
67
|
+
authorizationEndpoint: `https://${string}`;
|
|
68
|
+
tokenEndpoint: `https://${string}`;
|
|
69
|
+
revocationEndpoint?: `https://${string}`;
|
|
70
|
+
scopes: readonly string[];
|
|
71
|
+
usePkce: true;
|
|
72
|
+
refreshTokenField: CredentialFieldDefinitionV1;
|
|
73
|
+
resolvedAccessTokenField: CredentialFieldDefinitionV1;
|
|
74
|
+
accessTokenPersistence: "memory-only";
|
|
75
|
+
}> | Readonly<{
|
|
76
|
+
type: "oauth2-authorization-code";
|
|
77
|
+
tokenCustody: "external-managed";
|
|
78
|
+
custodianAdapterId: string;
|
|
79
|
+
connectUrlOrigins: readonly `https://${string}`[];
|
|
80
|
+
scopes: readonly string[];
|
|
81
|
+
accountReference: ExternalManagedAccountReferenceDefinitionV1;
|
|
82
|
+
delivery: "host-session-adapter-only";
|
|
83
|
+
}> | Readonly<{
|
|
84
|
+
type: "none";
|
|
85
|
+
}>;
|
|
86
|
+
interface ProviderDefinitionV1 {
|
|
87
|
+
readonly contractVersion: "boring.provider.v1";
|
|
88
|
+
readonly id: ProviderId;
|
|
89
|
+
readonly displayName: string;
|
|
90
|
+
readonly category: ProviderCategoryV1;
|
|
91
|
+
readonly credential: ProviderCredentialDefinitionV1;
|
|
92
|
+
readonly consumerBindingIds: readonly CredentialConsumerBindingId[];
|
|
93
|
+
readonly sandboxEgressOrigins: readonly `https://${string}`[];
|
|
94
|
+
readonly mcp?: Readonly<{
|
|
95
|
+
transport: "streamable-http";
|
|
96
|
+
endpoint?: `https://${string}`;
|
|
97
|
+
toolkitId?: string;
|
|
98
|
+
allowedTools: readonly string[];
|
|
99
|
+
deniedTools: readonly string[];
|
|
100
|
+
}>;
|
|
101
|
+
}
|
|
102
|
+
interface ProviderRegistryV1 {
|
|
103
|
+
readonly contractVersion: "boring.provider-registry.v1";
|
|
104
|
+
list(): readonly ProviderDefinitionV1[];
|
|
105
|
+
require(providerId: ProviderId): ProviderDefinitionV1;
|
|
106
|
+
}
|
|
107
|
+
declare function createProviderRegistryV1(defs: readonly ProviderDefinitionV1[]): ProviderRegistryV1;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Ratified `KmsBackend` abstraction (docs/issues/820/byok-secret-vault-plan.md,
|
|
111
|
+
* "KmsBackend interface (pluggable KEK provider)", amendment A).
|
|
112
|
+
*
|
|
113
|
+
* This module is intentionally backend-agnostic: OVH KMS, Scaleway Key Manager,
|
|
114
|
+
* Exoscale KMS, self-run Vault/OpenBao Transit and the local-KEK envelope are
|
|
115
|
+
* all implementations of `WorkspaceKekProviderV1`. Only the KEK-holder call
|
|
116
|
+
* differs; the per-workspace DEK and the AAD-bound AES-256-GCM field crypto are
|
|
117
|
+
* identical across every backend.
|
|
118
|
+
*
|
|
119
|
+
* Shared code stays `Uint8Array`-only: no `node:*` import and no Node byte-array
|
|
120
|
+
* type may appear here. Backend-specific crypto lives under `src/server/**`.
|
|
121
|
+
*/
|
|
122
|
+
declare const WORKSPACE_KEK_PROVIDER_VERSION: "boring.workspace-kek-provider.v1";
|
|
123
|
+
declare const CREDENTIAL_ENVELOPE_VERSION: "boring.credential-envelope.v1";
|
|
124
|
+
/** Canonical AAD encoding version; changing it is a migration, not a tweak. */
|
|
125
|
+
declare const CREDENTIAL_AAD_ENCODING_VERSION: "boring.credential-aad.v1";
|
|
126
|
+
/** AES-256-GCM parameters. Fixed by the ratified design; never widened. */
|
|
127
|
+
declare const CREDENTIAL_DEK_BYTE_LENGTH_V1 = 32;
|
|
128
|
+
declare const CREDENTIAL_KEK_BYTE_LENGTH_V1 = 32;
|
|
129
|
+
declare const CREDENTIAL_NONCE_BYTE_LENGTH_V1 = 12;
|
|
130
|
+
declare const CREDENTIAL_AUTH_TAG_BYTE_LENGTH_V1 = 16;
|
|
131
|
+
interface WorkspaceKekContextV1 {
|
|
132
|
+
readonly workspaceId: string;
|
|
133
|
+
readonly dekGeneration: number;
|
|
134
|
+
readonly requestId: string;
|
|
135
|
+
}
|
|
136
|
+
type WrappedWorkspaceDekPayloadV1 = Readonly<{
|
|
137
|
+
/** Reserved for a future self-run Vault/OpenBao Transit backend. */
|
|
138
|
+
format: "vault-transit-ciphertext.v1";
|
|
139
|
+
ciphertext: Uint8Array;
|
|
140
|
+
}> | Readonly<{
|
|
141
|
+
format: "local-aes-256-gcm.v1";
|
|
142
|
+
ciphertext: Uint8Array;
|
|
143
|
+
nonce: Uint8Array;
|
|
144
|
+
authTag: Uint8Array;
|
|
145
|
+
aadContext: Uint8Array;
|
|
146
|
+
}> | Readonly<{
|
|
147
|
+
/** Reserved. A future backend must define and conformance-test this. */
|
|
148
|
+
format: "external-kms-opaque.v1";
|
|
149
|
+
payloadFormatId: string;
|
|
150
|
+
opaqueAuthenticatedPayload: Uint8Array;
|
|
151
|
+
}>;
|
|
152
|
+
interface WrappedWorkspaceDekV1 {
|
|
153
|
+
readonly providerId: string;
|
|
154
|
+
readonly keyRef: string;
|
|
155
|
+
readonly keyVersion: number;
|
|
156
|
+
readonly payload: WrappedWorkspaceDekPayloadV1;
|
|
157
|
+
}
|
|
158
|
+
interface GeneratedWorkspaceDekV1 {
|
|
159
|
+
/** Transient plaintext; the caller overwrites and drops it in `finally`. */
|
|
160
|
+
readonly plaintextDek: Uint8Array;
|
|
161
|
+
readonly wrappedDek: WrappedWorkspaceDekV1;
|
|
162
|
+
}
|
|
163
|
+
interface WorkspaceKekProviderReadinessV1 {
|
|
164
|
+
readonly ready: boolean;
|
|
165
|
+
readonly reasonCode?: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* `readiness()` returning `ready: false`, or any backend/KEK error, denies the
|
|
169
|
+
* credential operation (fail closed). An implementation never falls back to
|
|
170
|
+
* another backend or to plaintext.
|
|
171
|
+
*/
|
|
172
|
+
interface WorkspaceKekProviderV1 {
|
|
173
|
+
readonly contractVersion: typeof WORKSPACE_KEK_PROVIDER_VERSION;
|
|
174
|
+
readonly providerId: string;
|
|
175
|
+
generateDataKey(context: WorkspaceKekContextV1): Promise<GeneratedWorkspaceDekV1>;
|
|
176
|
+
unwrapDataKey(context: WorkspaceKekContextV1, wrapped: WrappedWorkspaceDekV1): Promise<Uint8Array>;
|
|
177
|
+
rewrapDataKey?(context: WorkspaceKekContextV1, wrapped: WrappedWorkspaceDekV1): Promise<WrappedWorkspaceDekV1>;
|
|
178
|
+
readiness(): Promise<WorkspaceKekProviderReadinessV1>;
|
|
179
|
+
close?(): Promise<void>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The identity a field envelope is cryptographically bound to. Every component
|
|
183
|
+
* is part of the AAD, so moving a row between workspaces, providers, fields,
|
|
184
|
+
* credential versions or DEK generations fails authentication.
|
|
185
|
+
*/
|
|
186
|
+
interface CredentialFieldAadContextV1 {
|
|
187
|
+
readonly workspaceId: string;
|
|
188
|
+
readonly credentialId: string;
|
|
189
|
+
readonly providerId: string;
|
|
190
|
+
readonly fieldId: string;
|
|
191
|
+
readonly credentialVersion: number;
|
|
192
|
+
readonly dekGeneration: number;
|
|
193
|
+
}
|
|
194
|
+
/** Logical encrypted field envelope; the DB may normalize `wrappedDek` away. */
|
|
195
|
+
interface CredentialEnvelopeV1 {
|
|
196
|
+
readonly envelopeVersion: typeof CREDENTIAL_ENVELOPE_VERSION;
|
|
197
|
+
readonly ciphertext: Uint8Array;
|
|
198
|
+
readonly nonce: Uint8Array;
|
|
199
|
+
readonly authTag: Uint8Array;
|
|
200
|
+
readonly aadContext: Uint8Array;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
interface WorkspaceAgentDispatcherContext {
|
|
204
|
+
workspaceId: string;
|
|
205
|
+
userId: string;
|
|
206
|
+
}
|
|
207
|
+
type WorkspaceAgentDispatcherSendInput = Omit<AgentSendInput, 'ctx'>;
|
|
208
|
+
interface WorkspaceAgentDispatcherDispatchInput extends WorkspaceAgentDispatcherSendInput {
|
|
209
|
+
/** Optional user-visible presentation when content carries hidden instructions. */
|
|
210
|
+
displayMessage?: string;
|
|
211
|
+
/** Optional title for a newly created addressed session. */
|
|
212
|
+
title?: string;
|
|
213
|
+
/** Durable caller-owned idempotency key. */
|
|
214
|
+
requestId: string;
|
|
215
|
+
/** Defaults to requestId. */
|
|
216
|
+
clientNonce?: string;
|
|
217
|
+
/** Defaults to prompt; follow-up requires a non-negative clientSeq. */
|
|
218
|
+
kind?: 'prompt' | 'followup';
|
|
219
|
+
/** Server-only atomic admission for durable background prompt delivery. */
|
|
220
|
+
requireIdle?: true;
|
|
221
|
+
clientSeq?: number;
|
|
222
|
+
}
|
|
223
|
+
interface WorkspaceAgentDispatch {
|
|
224
|
+
ref: AgentSessionRef;
|
|
225
|
+
receipt: AgentSendReceipt;
|
|
226
|
+
events: AsyncIterable<AgentEvent>;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Callback-scoped direct Agent capability. The Workspace and operations are
|
|
230
|
+
* lease guarded by the Host and must not be retained after the callback.
|
|
231
|
+
*/
|
|
232
|
+
interface LeaseBoundWorkspaceAgent {
|
|
233
|
+
readonly workspace: Workspace;
|
|
234
|
+
readonly signal: AbortSignal;
|
|
235
|
+
dispatch(input: WorkspaceAgentDispatcherDispatchInput, onEvent: (event: AgentEvent) => void | Promise<void>, onAccepted?: (accepted: {
|
|
236
|
+
readonly ref: AgentSessionRef;
|
|
237
|
+
readonly receipt: AgentSendReceipt;
|
|
238
|
+
}) => void | Promise<void>): Promise<{
|
|
239
|
+
readonly ref: AgentSessionRef;
|
|
240
|
+
readonly receipt: AgentSendReceipt;
|
|
241
|
+
}>;
|
|
242
|
+
interrupt(sessionId: string, requestId: string): Promise<InterruptReceipt>;
|
|
243
|
+
stop(sessionId: string, requestId: string): Promise<StopReceipt>;
|
|
244
|
+
}
|
|
245
|
+
type AgentInvocationFundingPolicyV1 = 'personal-subscription' | 'api-key-only';
|
|
246
|
+
interface WorkspaceAgentDirectRunInput {
|
|
247
|
+
readonly agentTypeId: string;
|
|
248
|
+
readonly context: WorkspaceAgentDispatcherContext;
|
|
249
|
+
readonly requestId: string;
|
|
250
|
+
/** Dispatcher invocations are unattended by contract and can never opt into personal OAuth. */
|
|
251
|
+
readonly fundingPolicy: 'api-key-only';
|
|
252
|
+
}
|
|
253
|
+
type WorkspaceAgentDirectRunCallback = (binding: LeaseBoundWorkspaceAgent) => Promise<void>;
|
|
254
|
+
/** Addressed gateway binding minted by the trusted composition root. */
|
|
255
|
+
interface WorkspaceAgentGatewayBinding {
|
|
256
|
+
gateway: AgentGateway;
|
|
257
|
+
scope: AuthorizedAgentScope;
|
|
258
|
+
agentTypeId: string;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Compatibility-facing delegation surface. New durable callers use dispatch so
|
|
262
|
+
* the addressed ref and accepted Gateway receipt can be persisted before they
|
|
263
|
+
* consume events. send remains for callers that only need the legacy stream.
|
|
264
|
+
*/
|
|
265
|
+
interface WorkspaceAgentDispatcher {
|
|
266
|
+
/** Optional only for source compatibility with pre-Gateway injected resolvers. */
|
|
267
|
+
dispatch?(input: WorkspaceAgentDispatcherDispatchInput): Promise<WorkspaceAgentDispatch>;
|
|
268
|
+
send(input: WorkspaceAgentDispatcherSendInput): AsyncIterable<AgentEvent>;
|
|
269
|
+
interrupt(sessionId: string): Promise<InterruptReceipt>;
|
|
270
|
+
stop(sessionId: string): Promise<StopReceipt>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
declare const AGENT_RESOURCES_FILESYSTEM_ID: "agent_resources";
|
|
274
|
+
/**
|
|
275
|
+
* Agent-scoped readonly filesystem carrying the knowledge/ folder shipped
|
|
276
|
+
* inside an agent definition package (gh-1107 slice 2). Generic id only —
|
|
277
|
+
* never tenant-named. The binding exists only for the owning agent.
|
|
278
|
+
*/
|
|
279
|
+
declare const AGENT_KNOWLEDGE_FILESYSTEM_ID: "agent_knowledge";
|
|
280
|
+
interface AgentSkillResource {
|
|
281
|
+
readonly filesystem: 'user' | typeof AGENT_RESOURCES_FILESYSTEM_ID | (string & {});
|
|
282
|
+
readonly path: string;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
interface FileSearch {
|
|
286
|
+
search(glob: string, limit?: number): Promise<string[]>;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export { type AuthorizedWorkspaceCredentialScopeV1 as A, type WorkspaceCredentialAuthorityVerifierV1 as B, type CredentialConsumerBindingId as C, type WorkspaceKekContextV1 as D, type ExternalManagedAccountReferenceDefinitionV1 as E, type FileSearch as F, type GeneratedWorkspaceDekV1 as G, type WorkspaceKekProviderReadinessV1 as H, type WorkspaceKekProviderV1 as I, type WrappedWorkspaceDekPayloadV1 as J, type WrappedWorkspaceDekV1 as K, type LeaseBoundWorkspaceAgent as L, createProviderRegistryV1 as M, type AgentInvocationFundingPolicyV1 as N, type ProviderId as P, type VerifiedWorkspaceCredentialAuthorityV1 as V, WORKSPACE_KEK_PROVIDER_VERSION as W, type CredentialFieldId as a, type ProviderRegistryV1 as b, type ProviderDefinitionV1 as c, type CredentialFieldDefinitionV1 as d, AGENT_KNOWLEDGE_FILESYSTEM_ID as e, AGENT_RESOURCES_FILESYSTEM_ID as f, type AgentSkillResource as g, CREDENTIAL_AAD_ENCODING_VERSION as h, CREDENTIAL_AUTH_TAG_BYTE_LENGTH_V1 as i, CREDENTIAL_DEK_BYTE_LENGTH_V1 as j, CREDENTIAL_ENVELOPE_VERSION as k, CREDENTIAL_KEK_BYTE_LENGTH_V1 as l, CREDENTIAL_NONCE_BYTE_LENGTH_V1 as m, type CredentialEnvelopeV1 as n, type CredentialFieldAadContextV1 as o, type ProviderCategoryV1 as p, type ProviderCredentialDefinitionV1 as q, type VerifiedWorkspaceCredentialPrincipalV1 as r, type WorkspaceAgentDirectRunCallback as s, type WorkspaceAgentDirectRunInput as t, type WorkspaceAgentDispatch as u, type WorkspaceAgentDispatcher as v, type WorkspaceAgentDispatcherContext as w, type WorkspaceAgentDispatcherDispatchInput as x, type WorkspaceAgentDispatcherSendInput as y, type WorkspaceAgentGatewayBinding as z };
|
package/dist/front/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { q as ToolUiMetadata, B as BoringChatPart, w as BoringChatMessage,
|
|
1
|
+
import { q as ToolUiMetadata, B as BoringChatPart, w as BoringChatMessage, M as PiChatStatus, c as PiChatSnapshot, n as QueuedUserMessage, D as ChatError, d as PiChatEvent, P as PromptPayload, e as PromptReceipt, F as FollowUpPayload, f as FollowUpReceipt, Q as QueueClearPayload, g as QueueClearReceipt, I as InterruptPayload, h as CommandReceipt, i as StopPayload, j as StopReceipt, b as SessionSummary, H as ErrorCode } from '../piChatEvent-DpE0lIb9.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ComponentProps, HTMLAttributes, FormEvent, ReactNode, ComponentType } from 'react';
|
|
4
4
|
import { FileUIPart, ChatStatus, UIMessage } from 'ai';
|
|
5
|
-
import { s as AgentSummary, j as AgentGatewayErrorCode,
|
|
5
|
+
import { s as AgentSummary, j as AgentGatewayErrorCode, P as JsonValue, E as CredentialMetadataV1 } from '../admin-DORVQfLn.js';
|
|
6
6
|
export { Artifact, ArtifactAction, ArtifactActions, ArtifactDescription, ArtifactHeader, ArtifactOpenProvider, ArtifactTitle, OpenArtifactHandler, useOpenArtifact } from './artifacts.js';
|
|
7
7
|
import { InputGroupAddon, InputGroupButton, InputGroupTextarea, Button, Collapsible, CollapsibleContent, CollapsibleTrigger } from '@hachej/boring-ui-kit';
|
|
8
8
|
import { Streamdown } from 'streamdown';
|
|
@@ -663,6 +663,17 @@ interface ComposerBlocker {
|
|
|
663
663
|
target?: unknown;
|
|
664
664
|
}
|
|
665
665
|
|
|
666
|
+
/**
|
|
667
|
+
* How much of a turn the transcript shows.
|
|
668
|
+
*
|
|
669
|
+
* - `full` (default): everything — text, reasoning, tool calls, tool groups.
|
|
670
|
+
* - `messages-only`: just the conversation. Reasoning and tool activity are
|
|
671
|
+
* suppressed and a streaming turn shows one quiet status line instead. For
|
|
672
|
+
* hosts whose user is not a developer and for whom "ran bash" is noise, not
|
|
673
|
+
* progress.
|
|
674
|
+
*/
|
|
675
|
+
type ChatRenderMode = 'full' | 'messages-only';
|
|
676
|
+
|
|
666
677
|
type ChatSubmitSource = 'composer' | 'suggestion' | 'auto-submit';
|
|
667
678
|
interface ChatSubmitContext {
|
|
668
679
|
files: PromptInputFilePart[];
|
|
@@ -696,6 +707,26 @@ interface PiChatPanelProps<TComposerBlocker extends ComposerBlocker = ComposerBl
|
|
|
696
707
|
fetch?: typeof globalThis.fetch;
|
|
697
708
|
className?: string;
|
|
698
709
|
chrome?: boolean;
|
|
710
|
+
/**
|
|
711
|
+
* How much of a turn the transcript shows. `messages-only` renders user and
|
|
712
|
+
* assistant text only — no reasoning, no tool calls, one quiet working line
|
|
713
|
+
* while a turn streams. Defaults to `full`, so existing hosts are unchanged.
|
|
714
|
+
*/
|
|
715
|
+
renderMode?: ChatRenderMode;
|
|
716
|
+
/**
|
|
717
|
+
* Tool names that stay visible under `renderMode="messages-only"`. Empty by
|
|
718
|
+
* default. Pair each with a renderer in `toolRenderers`: the host opts a tool
|
|
719
|
+
* back in when the call is itself something the user must see and act on.
|
|
720
|
+
*/
|
|
721
|
+
messagesOnlyVisibleTools?: readonly string[];
|
|
722
|
+
/** Hide per-message copy actions in `messages-only` mode. Defaults to false. */
|
|
723
|
+
messagesOnlyHideCopyActions?: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* User-message prefixes omitted from the transcript in `messages-only` mode.
|
|
726
|
+
* The messages remain in agent context; this only lets a host hide its own
|
|
727
|
+
* machine-authored control prompts from the person using the chat.
|
|
728
|
+
*/
|
|
729
|
+
messagesOnlyHiddenUserPrefixes?: readonly string[];
|
|
699
730
|
debug?: boolean;
|
|
700
731
|
showSessions?: boolean;
|
|
701
732
|
hotReloadEnabled?: boolean;
|
|
@@ -703,6 +734,8 @@ interface PiChatPanelProps<TComposerBlocker extends ComposerBlocker = ComposerBl
|
|
|
703
734
|
emptyState?: ChatPanelEmptyState;
|
|
704
735
|
emptyPlacement?: 'default' | 'hero';
|
|
705
736
|
composerPlaceholder?: string;
|
|
737
|
+
/** Replaces the composer's default streaming pill when supplied. Pass `null` to hide it. */
|
|
738
|
+
composerActivity?: ReactNode;
|
|
706
739
|
initialDraft?: string;
|
|
707
740
|
autoSubmitInitialDraft?: boolean;
|
|
708
741
|
onDraftRestored?: () => void;
|
|
@@ -757,7 +790,7 @@ interface PiChatPanelProps<TComposerBlocker extends ComposerBlocker = ComposerBl
|
|
|
757
790
|
* knowing what the code means or what the action does. */
|
|
758
791
|
renderNoticeAction?: (notice: PiChatRuntimeNotice) => ReactNode;
|
|
759
792
|
}
|
|
760
|
-
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, spillLargePrompts, largePromptThresholdChars, onBeforeSubmit, onReloadAgentPlugins, onCommandResult, onComposerWarning, onMentionedFilesConsumed, onPromptSubmitStarted, onData, onOpenArtifact, composerBlockers, onComposerStop, onComposerBlockerAction, onTurnComplete, renderNoticeAction, }: PiChatPanelProps<TComposerBlocker>): react.JSX.Element;
|
|
793
|
+
declare function PiChatPanel<TComposerBlocker extends ComposerBlocker = ComposerBlocker>({ sessionId, agentTypeId, extraCommands, apiBaseUrl, workspaceId, storageScope, requestHeaders, storage, fetch, className, chrome, renderMode, messagesOnlyVisibleTools, messagesOnlyHideCopyActions, messagesOnlyHiddenUserPrefixes, debug, showSessions, hotReloadEnabled, suggestions, emptyState, emptyPlacement, composerPlaceholder, composerActivity, initialDraft, autoSubmitInitialDraft, onDraftRestored, onAutoSubmitInitialDraftAccepted, onAutoSubmitInitialDraftSettled, model, defaultModel, availableModels, hideDefaultModelOption, hideComposerSettings, suppressPreSubmitCancelledWarning, thinkingLevel, thinkingControl, serverResourcesEnabled, mentionedFiles, commands, excludeBuiltinCommands, toolRenderers, createRemoteSession, remoteSessionOptions, hydrateMessages, allowPromptDuringInitialHydration, workspaceWarmupStatus, onSessionReset, spillLargePrompts, largePromptThresholdChars, onBeforeSubmit, onReloadAgentPlugins, onCommandResult, onComposerWarning, onMentionedFilesConsumed, onPromptSubmitStarted, onData, onOpenArtifact, composerBlockers, onComposerStop, onComposerBlockerAction, onTurnComplete, renderNoticeAction, }: PiChatPanelProps<TComposerBlocker>): react.JSX.Element;
|
|
761
794
|
|
|
762
795
|
type AddressedAgentOption = Pick<AgentSummary, 'agentTypeId' | 'label' | 'description' | 'pluginIds'>;
|
|
763
796
|
interface UseAddressedAgentSelectionOptions {
|
|
@@ -805,6 +838,58 @@ interface DebugDrawerProps {
|
|
|
805
838
|
}
|
|
806
839
|
declare function DebugDrawer({ agentTypeId, apiBaseUrl, fetch, sessionId, messages, requestHeaders, storageScope, width, onWidthChange }: DebugDrawerProps): react.JSX.Element;
|
|
807
840
|
|
|
841
|
+
type CredentialFundingMethod = 'api-key' | 'openai-codex';
|
|
842
|
+
type CredentialOAuthEvent = {
|
|
843
|
+
readonly type: 'auth_url';
|
|
844
|
+
readonly url: string;
|
|
845
|
+
} | {
|
|
846
|
+
readonly type: 'device_code';
|
|
847
|
+
readonly userCode: string;
|
|
848
|
+
readonly verificationUri: string;
|
|
849
|
+
readonly expiresInSeconds?: number;
|
|
850
|
+
} | {
|
|
851
|
+
readonly type: 'progress';
|
|
852
|
+
};
|
|
853
|
+
interface CredentialOAuthPrompt {
|
|
854
|
+
readonly type: string;
|
|
855
|
+
readonly options?: readonly {
|
|
856
|
+
readonly id: string;
|
|
857
|
+
readonly label: string;
|
|
858
|
+
}[];
|
|
859
|
+
}
|
|
860
|
+
interface CredentialOAuthFlow {
|
|
861
|
+
readonly flowId: string;
|
|
862
|
+
readonly providerId: 'openai-codex';
|
|
863
|
+
readonly status: 'pending' | 'succeeded' | 'failed' | 'cancelled';
|
|
864
|
+
readonly events: readonly CredentialOAuthEvent[];
|
|
865
|
+
readonly prompt?: CredentialOAuthPrompt;
|
|
866
|
+
}
|
|
867
|
+
interface CredentialSettingsClient {
|
|
868
|
+
list(): Promise<readonly CredentialMetadataV1[]>;
|
|
869
|
+
putApiKey(providerId: string, apiKey: string): Promise<CredentialMetadataV1>;
|
|
870
|
+
disable(providerId: string): Promise<CredentialMetadataV1>;
|
|
871
|
+
revoke(providerId: string): Promise<CredentialMetadataV1>;
|
|
872
|
+
delete(providerId: string): Promise<CredentialMetadataV1>;
|
|
873
|
+
startCodexLogin(): Promise<CredentialOAuthFlow>;
|
|
874
|
+
getCodexLogin(flowId: string): Promise<CredentialOAuthFlow>;
|
|
875
|
+
respondToCodexLogin(flowId: string, value: string): Promise<CredentialOAuthFlow>;
|
|
876
|
+
cancelCodexLogin(flowId: string): Promise<void>;
|
|
877
|
+
}
|
|
878
|
+
declare function createCredentialSettingsClient(apiBaseUrl?: string, fetchImpl?: typeof fetch, requestHeaders?: Readonly<Record<string, string>>): CredentialSettingsClient;
|
|
879
|
+
|
|
880
|
+
interface CredentialSettingsSurfaceProps {
|
|
881
|
+
/** The host must derive this from its authenticated workspace membership. */
|
|
882
|
+
isWorkspaceOwner: boolean;
|
|
883
|
+
/** Active workspace scope sent to the authenticated credential routes. */
|
|
884
|
+
workspaceId?: string;
|
|
885
|
+
apiBaseUrl?: string;
|
|
886
|
+
/** Test/host transport seam. It must preserve the metadata-only contract. */
|
|
887
|
+
client?: CredentialSettingsClient;
|
|
888
|
+
}
|
|
889
|
+
/** Workspace identity is also the state boundary: switching workspaces remounts
|
|
890
|
+
* the inner surface so metadata and pending OAuth/lifecycle state cannot cross. */
|
|
891
|
+
declare function CredentialSettingsSurface(props: CredentialSettingsSurfaceProps): react.JSX.Element;
|
|
892
|
+
|
|
808
893
|
type SelectorTrigger = 'button' | 'slash';
|
|
809
894
|
declare const ModelSelectTrigger: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "value"> & {
|
|
810
895
|
value: ModelSelection | null;
|
|
@@ -994,4 +1079,4 @@ declare const ToolContent: ({ className, ...props }: ToolContentProps) => react.
|
|
|
994
1079
|
|
|
995
1080
|
declare function cn(...inputs: ClassValue[]): string;
|
|
996
1081
|
|
|
997
|
-
export { type AddressedAgentOption, type AgentCommandContribution, type AgentCommandOptions, type AgentPluginReloadResult, type AvailableModel, BoringChatMessage, type ChatBeforeSubmitResult, ChatEmptyState, type ChatEmptyStateProps, type ChatMessageContribution, type ChatMessageContributionProps, ChatMessageContributionProvider, PiChatPanel as ChatPanel, type PiChatPanelProps as ChatPanelProps, type ChatSubmitContext, type ChatSuggestion, CodeBlock, type CommandRegistry, type ComposerActionContributionProps, type ComposerBlocker, type ComposerBlockerAction, type ComposerContribution, ComposerContributionProvider, type ComposerDraftUpdate, Conversation, ConversationContent, ConversationScrollButton, DebugDrawer, GatewayResponseError, type GatewayResponseErrorCode, type GroupedToolEntry, Message, MessageAction, MessageActions, MessageContent, MessageResponse, ModelPickerMenu, ModelSelect, ModelSelectTrigger, type ModelSelection, type ParsedCommand, PiChatPanel, type PiChatPanelProps, SessionBrowser as PiSessionBrowser, type PiSessionCreateInit, SessionList as PiSessionList, type PiSessionSearchItem, type PiSessionSearchOptions, type PiSessionSearchSortMode, PromptInput, PromptInputFooter, PromptInputSubmit, PromptInputTextarea, Reasoning, ReasoningContent, ReasoningTrigger, type SessionListProps, type SlashCommand, type SlashCommandContext, type ThinkingLevel, ThinkingSelect, Tool, ToolCallGroup, ToolContent, ToolHeader, type ToolPart$1 as ToolPart, type ToolRenderer, type ToolRendererOverrides, type UploadFileOptions, type UploadFileResult, type UseAddressedAgentSelectionOptions, type UseAddressedAgentSelectionResult, type UsePiSessionsOptions, type UsePiSessionsResult, activeSessionStorageKey, builtinCommands, cn, createCommandRegistry, defaultChatSuggestions, defaultToolRenderers, errorResponseCode, gatewayResponseError, gatewayResponseErrorFromBody, getAgentCommands, matchPiSessionSearch, mergeShadcnToolRenderers, mergeToolRenderers, parsePiSessionSearchQuery, parseSlashCommand, readActiveSessionId, resolveToolRenderer, searchPiSessions, uploadFile, useAddressedAgentSelection, usePiSessions, writeActiveSessionId };
|
|
1082
|
+
export { type AddressedAgentOption, type AgentCommandContribution, type AgentCommandOptions, type AgentPluginReloadResult, type AvailableModel, BoringChatMessage, type ChatBeforeSubmitResult, ChatEmptyState, type ChatEmptyStateProps, type ChatMessageContribution, type ChatMessageContributionProps, ChatMessageContributionProvider, PiChatPanel as ChatPanel, type PiChatPanelProps as ChatPanelProps, type ChatRenderMode, type ChatSubmitContext, type ChatSuggestion, CodeBlock, type CommandRegistry, type ComposerActionContributionProps, type ComposerBlocker, type ComposerBlockerAction, type ComposerContribution, ComposerContributionProvider, type ComposerDraftUpdate, Conversation, ConversationContent, ConversationScrollButton, type CredentialFundingMethod, type CredentialOAuthEvent, type CredentialOAuthFlow, type CredentialOAuthPrompt, type CredentialSettingsClient, CredentialSettingsSurface, type CredentialSettingsSurfaceProps, DebugDrawer, GatewayResponseError, type GatewayResponseErrorCode, type GroupedToolEntry, Message, MessageAction, MessageActions, MessageContent, MessageResponse, ModelPickerMenu, ModelSelect, ModelSelectTrigger, type ModelSelection, type ParsedCommand, PiChatPanel, type PiChatPanelProps, SessionBrowser as PiSessionBrowser, type PiSessionCreateInit, SessionList as PiSessionList, type PiSessionSearchItem, type PiSessionSearchOptions, type PiSessionSearchSortMode, PromptInput, PromptInputFooter, PromptInputSubmit, PromptInputTextarea, Reasoning, ReasoningContent, ReasoningTrigger, type SessionListProps, type SlashCommand, type SlashCommandContext, type ThinkingLevel, ThinkingSelect, Tool, ToolCallGroup, ToolContent, ToolHeader, type ToolPart$1 as ToolPart, type ToolRenderer, type ToolRendererOverrides, type UploadFileOptions, type UploadFileResult, type UseAddressedAgentSelectionOptions, type UseAddressedAgentSelectionResult, type UsePiSessionsOptions, type UsePiSessionsResult, activeSessionStorageKey, builtinCommands, cn, createCommandRegistry, createCredentialSettingsClient, defaultChatSuggestions, defaultToolRenderers, errorResponseCode, gatewayResponseError, gatewayResponseErrorFromBody, getAgentCommands, matchPiSessionSearch, mergeShadcnToolRenderers, mergeToolRenderers, parsePiSessionSearchQuery, parseSlashCommand, readActiveSessionId, resolveToolRenderer, searchPiSessions, uploadFile, useAddressedAgentSelection, usePiSessions, writeActiveSessionId };
|