@fragno-dev/pi-harness 0.0.0-stage → 0.0.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/LICENSE.md +16 -0
- package/README.md +181 -2
- package/dist/browser/agent-harness-event-protocol-CuKubox1.js +666 -0
- package/dist/browser/agent-harness-event-protocol-CuKubox1.js.map +1 -0
- package/dist/browser/agent-harness-event-protocol-d6mH_9n3.d.ts +261 -0
- package/dist/browser/agent-harness-event-protocol-d6mH_9n3.d.ts.map +1 -0
- package/dist/browser/client/clients.d.ts +2 -0
- package/dist/browser/client/clients.js +2 -0
- package/dist/browser/client/pi-workflow-emission-stream.d.ts +13 -0
- package/dist/browser/client/pi-workflow-emission-stream.d.ts.map +1 -0
- package/dist/browser/client/pi-workflow-emission-stream.js +29 -0
- package/dist/browser/client/pi-workflow-emission-stream.js.map +1 -0
- package/dist/browser/client/react.d.ts +147 -0
- package/dist/browser/client/react.d.ts.map +1 -0
- package/dist/browser/client/react.js +187 -0
- package/dist/browser/client/react.js.map +1 -0
- package/dist/browser/client/solid.d.ts +150 -0
- package/dist/browser/client/solid.d.ts.map +1 -0
- package/dist/browser/client/solid.js +130 -0
- package/dist/browser/client/solid.js.map +1 -0
- package/dist/browser/client/svelte.d.ts +150 -0
- package/dist/browser/client/svelte.d.ts.map +1 -0
- package/dist/browser/client/svelte.js +132 -0
- package/dist/browser/client/svelte.js.map +1 -0
- package/dist/browser/client/vanilla.d.ts +177 -0
- package/dist/browser/client/vanilla.d.ts.map +1 -0
- package/dist/browser/client/vanilla.js +159 -0
- package/dist/browser/client/vanilla.js.map +1 -0
- package/dist/browser/client/vue.d.ts +150 -0
- package/dist/browser/client/vue.d.ts.map +1 -0
- package/dist/browser/client/vue.js +128 -0
- package/dist/browser/client/vue.js.map +1 -0
- package/dist/browser/client/workflow-lofi-session-projection.d.ts +17 -0
- package/dist/browser/client/workflow-lofi-session-projection.d.ts.map +1 -0
- package/dist/browser/client/workflow-lofi-session-projection.js +107 -0
- package/dist/browser/client/workflow-lofi-session-projection.js.map +1 -0
- package/dist/browser/clients-DYXj19je.d.ts +247 -0
- package/dist/browser/clients-DYXj19je.d.ts.map +1 -0
- package/dist/browser/clients-pIAk6ClP.js +1853 -0
- package/dist/browser/clients-pIAk6ClP.js.map +1 -0
- package/dist/browser/pi/context-usage.d.ts +20 -0
- package/dist/browser/pi/context-usage.d.ts.map +1 -0
- package/dist/browser/pi/context-usage.js +84 -0
- package/dist/browser/pi/context-usage.js.map +1 -0
- package/dist/browser/pi/harness/agent-harness-event-protocol.d.ts +2 -0
- package/dist/browser/pi/harness/agent-harness-event-protocol.js +2 -0
- package/dist/browser/pi/route-schemas.d.ts +2 -0
- package/dist/browser/pi/route-schemas.js +130 -0
- package/dist/browser/pi/route-schemas.js.map +1 -0
- package/dist/browser/pi/workflow-session-projection.d.ts +2 -0
- package/dist/browser/pi/workflow-session-projection.js +2 -0
- package/dist/browser/route-schemas-DQB5ZR1E.d.ts +109 -0
- package/dist/browser/route-schemas-DQB5ZR1E.d.ts.map +1 -0
- package/dist/browser/types-8q4RWFXT.js +23 -0
- package/dist/browser/types-8q4RWFXT.js.map +1 -0
- package/dist/browser/types-Dk856kV1.d.ts +527 -0
- package/dist/browser/types-Dk856kV1.d.ts.map +1 -0
- package/dist/browser/workflow-session-projection-CJ4MUkpJ.js +443 -0
- package/dist/browser/workflow-session-projection-CJ4MUkpJ.js.map +1 -0
- package/dist/browser/workflow-session-projection-Dj_a79GF.d.ts +93 -0
- package/dist/browser/workflow-session-projection-Dj_a79GF.d.ts.map +1 -0
- package/dist/node/pi/compact-command-outcome-projection.js +41 -0
- package/dist/node/pi/compact-command-outcome-projection.js.map +1 -0
- package/dist/node/pi/context-usage.d.ts +20 -0
- package/dist/node/pi/context-usage.d.ts.map +1 -0
- package/dist/node/pi/context-usage.js +84 -0
- package/dist/node/pi/context-usage.js.map +1 -0
- package/dist/node/pi/definition.d.ts +535 -0
- package/dist/node/pi/definition.d.ts.map +1 -0
- package/dist/node/pi/definition.js +71 -0
- package/dist/node/pi/definition.js.map +1 -0
- package/dist/node/pi/factory.d.ts +142 -0
- package/dist/node/pi/factory.d.ts.map +1 -0
- package/dist/node/pi/factory.js +22 -0
- package/dist/node/pi/factory.js.map +1 -0
- package/dist/node/pi/harness/agent-harness-event-protocol.d.ts +261 -0
- package/dist/node/pi/harness/agent-harness-event-protocol.d.ts.map +1 -0
- package/dist/node/pi/harness/agent-harness-event-protocol.js +588 -0
- package/dist/node/pi/harness/agent-harness-event-protocol.js.map +1 -0
- package/dist/node/pi/harness/json-value.js +82 -0
- package/dist/node/pi/harness/json-value.js.map +1 -0
- package/dist/node/pi/harness/pi-operation-completed.d.ts +16 -0
- package/dist/node/pi/harness/pi-operation-completed.d.ts.map +1 -0
- package/dist/node/pi/harness/pi-operation-completed.js +71 -0
- package/dist/node/pi/harness/pi-operation-completed.js.map +1 -0
- package/dist/node/pi/harness/session-storage.d.ts +62 -0
- package/dist/node/pi/harness/session-storage.d.ts.map +1 -0
- package/dist/node/pi/harness/session-storage.js +174 -0
- package/dist/node/pi/harness/session-storage.js.map +1 -0
- package/dist/node/pi/pi-jsonl-export.d.ts +11 -0
- package/dist/node/pi/pi-jsonl-export.d.ts.map +1 -0
- package/dist/node/pi/pi-jsonl-export.js +31 -0
- package/dist/node/pi/pi-jsonl-export.js.map +1 -0
- package/dist/node/pi/route-schemas.d.ts +109 -0
- package/dist/node/pi/route-schemas.d.ts.map +1 -0
- package/dist/node/pi/route-schemas.js +130 -0
- package/dist/node/pi/route-schemas.js.map +1 -0
- package/dist/node/pi/session-command-protocol.d.ts +14 -0
- package/dist/node/pi/session-command-protocol.d.ts.map +1 -0
- package/dist/node/pi/session-command-protocol.js +25 -0
- package/dist/node/pi/session-command-protocol.js.map +1 -0
- package/dist/node/pi/session-entry-projection.js +79 -0
- package/dist/node/pi/session-entry-projection.js.map +1 -0
- package/dist/node/pi/skills.d.ts +70 -0
- package/dist/node/pi/skills.d.ts.map +1 -0
- package/dist/node/pi/skills.js +150 -0
- package/dist/node/pi/skills.js.map +1 -0
- package/dist/node/pi/tools.d.ts +12 -0
- package/dist/node/pi/tools.d.ts.map +1 -0
- package/dist/node/pi/tools.js +8 -0
- package/dist/node/pi/tools.js.map +1 -0
- package/dist/node/pi/types.d.ts +165 -0
- package/dist/node/pi/types.d.ts.map +1 -0
- package/dist/node/pi/types.js +49 -0
- package/dist/node/pi/types.js.map +1 -0
- package/dist/node/pi/wait-for-command-step.js +46 -0
- package/dist/node/pi/wait-for-command-step.js.map +1 -0
- package/dist/node/pi/workflow-session-live-projection.js +220 -0
- package/dist/node/pi/workflow-session-live-projection.js.map +1 -0
- package/dist/node/pi/workflow-session-projection.d.ts +84 -0
- package/dist/node/pi/workflow-session-projection.d.ts.map +1 -0
- package/dist/node/pi/workflow-session-projection.js +100 -0
- package/dist/node/pi/workflow-session-projection.js.map +1 -0
- package/dist/node/pi/workflows/interactive-chat-workflow.d.ts +37 -0
- package/dist/node/pi/workflows/interactive-chat-workflow.d.ts.map +1 -0
- package/dist/node/pi/workflows/interactive-chat-workflow.js +219 -0
- package/dist/node/pi/workflows/interactive-chat-workflow.js.map +1 -0
- package/dist/node/pi/workflows/workflow-agent-harness.d.ts +142 -0
- package/dist/node/pi/workflows/workflow-agent-harness.d.ts.map +1 -0
- package/dist/node/pi/workflows/workflow-agent-harness.js +450 -0
- package/dist/node/pi/workflows/workflow-agent-harness.js.map +1 -0
- package/dist/node/routes.d.ts +631 -0
- package/dist/node/routes.d.ts.map +1 -0
- package/dist/node/routes.js +355 -0
- package/dist/node/routes.js.map +1 -0
- package/dist/node/schema.d.ts +5 -0
- package/dist/node/schema.d.ts.map +1 -0
- package/dist/node/schema.js +7 -0
- package/dist/node/schema.js.map +1 -0
- package/package.json +175 -3
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
import { d as PiHarnessFrontendAgentMessage } from "./agent-harness-event-protocol-d6mH_9n3.js";
|
|
2
|
+
import "@fragno-dev/db";
|
|
3
|
+
import { AgentMessage, SessionTreeEntry } from "@earendil-works/pi-agent-core";
|
|
4
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
|
+
import { AssistantMessage, ToolCall } from "@earendil-works/pi-ai";
|
|
6
|
+
import { InstanceStatus } from "@fragno-dev/workflows/workflow";
|
|
7
|
+
import "typebox";
|
|
8
|
+
//#region ../fragno/dist/api/internal/path.d.ts
|
|
9
|
+
//#region src/api/internal/path.d.ts
|
|
10
|
+
type SplitPath<T extends string> = T extends `${infer First}/${infer Rest}` ? First extends "" ? SplitPath<Rest> : [First, ...SplitPath<Rest>] : T extends "" ? [] : [T];
|
|
11
|
+
type ExtractParam<T extends string> = T extends `:${infer Name}` ? Name : T extends `**:${infer Name}` ? Name : T extends "**" ? "**" : never;
|
|
12
|
+
type ExtractParamsFromSegments<T extends readonly string[]> = T extends readonly [infer First, ...infer Rest] ? First extends string ? Rest extends readonly string[] ? ExtractParam<First> | ExtractParamsFromSegments<Rest> : ExtractParam<First> : never : never;
|
|
13
|
+
/**
|
|
14
|
+
* Type helper to extract path parameters from a const string path
|
|
15
|
+
*
|
|
16
|
+
* Supports:
|
|
17
|
+
* - Regular paths: "/path" -> never
|
|
18
|
+
* - Named parameters: "/path/:name" -> "name"
|
|
19
|
+
* - Wildcard paths: "/path/foo/**" -> "**"
|
|
20
|
+
* - Named wildcard paths: "/path/foo/**:name" -> "name"
|
|
21
|
+
* - String (narrows): string -> never
|
|
22
|
+
*/
|
|
23
|
+
type ExtractPathParams<T extends string, ValueType = string> = ExtractParamsFromSegments<SplitPath<T>> extends never ? Record<string, never> : Record<ExtractParamsFromSegments<SplitPath<T>>, ValueType>;
|
|
24
|
+
/**
|
|
25
|
+
* Same as @see ExtractPathParams, but returns `Record<string, ValueType>` when a string is
|
|
26
|
+
* passed in.
|
|
27
|
+
*/
|
|
28
|
+
type ExtractPathParamsOrWiden<T extends string, ValueType = string> = string extends T ? Record<string, ValueType> : ExtractPathParams<T, ValueType>;
|
|
29
|
+
/**
|
|
30
|
+
* Same as @see ExtractPathParamsOrWiden, but returns `undefined` when no path parameters in the
|
|
31
|
+
* const.
|
|
32
|
+
*/
|
|
33
|
+
type MaybeExtractPathParamsOrWiden<T extends string, ValueType = string> = HasPathParams<T> extends true ? ExtractPathParamsOrWiden<T, ValueType> : undefined;
|
|
34
|
+
type ExtractPathParamNames<T extends string> = ExtractParamsFromSegments<SplitPath<T>>;
|
|
35
|
+
type HasPathParams<T extends string> = ExtractPathParamNames<T> extends never ? false : true;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a query parameters type where the specified keys are hints (optional)
|
|
38
|
+
* and additional string keys are also allowed.
|
|
39
|
+
*
|
|
40
|
+
* This allows for flexible query parameter typing where:
|
|
41
|
+
* - All hinted parameters are optional
|
|
42
|
+
* - Additional parameters beyond the hints are allowed
|
|
43
|
+
* - Values can be of any specified type (defaults to string)
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* type MyQuery = QueryParamsHint<"page" | "limit", string>;
|
|
48
|
+
* // Allows: { page?: string, limit?: string, [key: string]: string }
|
|
49
|
+
*
|
|
50
|
+
* const query1: MyQuery = {}; // Valid - no params required
|
|
51
|
+
* const query2: MyQuery = { page: "1" }; // Valid - hinted param
|
|
52
|
+
* const query3: MyQuery = { page: "1", sort: "asc" }; // Valid - additional param
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
type QueryParamsHint<TQueryParameters extends string, ValueType = string> = Partial<Record<TQueryParameters, ValueType>> & Record<string, ValueType | undefined>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region ../fragno/dist/util/types-util.d.ts
|
|
58
|
+
//#region src/util/types-util.d.ts
|
|
59
|
+
type InferOr<T, U> = T extends NonNullable<StandardSchemaV1> ? StandardSchemaV1.InferOutput<T> : T extends undefined ? U : U;
|
|
60
|
+
type InferOrUnknown<T> = InferOr<T, unknown>;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region ../fragno/dist/api/mutable-request-state.d.ts
|
|
63
|
+
//#region src/api/mutable-request-state.d.ts
|
|
64
|
+
/**
|
|
65
|
+
* Holds mutable request state that can be modified by middleware and consumed by handlers.
|
|
66
|
+
*
|
|
67
|
+
* This class provides a structural way for middleware to modify request data:
|
|
68
|
+
* - Path parameters can be modified
|
|
69
|
+
* - Query/search parameters can be modified
|
|
70
|
+
* - Request body can be overridden
|
|
71
|
+
* - Request headers can be modified
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* // In middleware
|
|
76
|
+
* const state = new MutableRequestState({
|
|
77
|
+
* pathParams: { id: "123" },
|
|
78
|
+
* searchParams: new URLSearchParams("?role=user"),
|
|
79
|
+
* body: { name: "John" },
|
|
80
|
+
* headers: new Headers()
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* // Modify query parameters
|
|
84
|
+
* state.searchParams.set("role", "admin");
|
|
85
|
+
*
|
|
86
|
+
* // Override body
|
|
87
|
+
* state.setBody({ name: "Jane" });
|
|
88
|
+
*
|
|
89
|
+
* // Modify headers
|
|
90
|
+
* state.headers.set("X-Custom", "value");
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
declare class MutableRequestState {
|
|
94
|
+
#private;
|
|
95
|
+
constructor(config: {
|
|
96
|
+
pathParams: Record<string, string>;
|
|
97
|
+
searchParams: URLSearchParams;
|
|
98
|
+
body: unknown;
|
|
99
|
+
headers: Headers;
|
|
100
|
+
});
|
|
101
|
+
/**
|
|
102
|
+
* Path parameters extracted from the route.
|
|
103
|
+
* Can be modified directly (e.g., `state.pathParams.id = "456"`).
|
|
104
|
+
*/
|
|
105
|
+
get pathParams(): Record<string, string>;
|
|
106
|
+
/**
|
|
107
|
+
* URLSearchParams for query parameters.
|
|
108
|
+
* Can be modified using URLSearchParams API (e.g., `state.searchParams.set("key", "value")`).
|
|
109
|
+
*/
|
|
110
|
+
get searchParams(): URLSearchParams;
|
|
111
|
+
/**
|
|
112
|
+
* Request headers.
|
|
113
|
+
* Can be modified using Headers API (e.g., `state.headers.set("X-Custom", "value")`).
|
|
114
|
+
*/
|
|
115
|
+
get headers(): Headers;
|
|
116
|
+
/**
|
|
117
|
+
* Get the current body value.
|
|
118
|
+
* Returns the override if set, otherwise the initial body.
|
|
119
|
+
*/
|
|
120
|
+
get body(): unknown;
|
|
121
|
+
/**
|
|
122
|
+
* Override the request body.
|
|
123
|
+
* This allows middleware to replace the body that will be seen by the handler.
|
|
124
|
+
*
|
|
125
|
+
* @param body - The new body value
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* // In middleware
|
|
130
|
+
* state.setBody({ modifiedField: "new value" });
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
setBody(body: unknown): void;
|
|
134
|
+
/**
|
|
135
|
+
* Check if the body has been overridden by middleware.
|
|
136
|
+
*/
|
|
137
|
+
get hasBodyOverride(): boolean;
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region ../fragno/dist/api/request-input-context.d.ts
|
|
141
|
+
//#region src/api/request-input-context.d.ts
|
|
142
|
+
type ValidatedInputContext<TInputSchema extends StandardSchemaV1 | undefined> = TInputSchema extends undefined ? undefined : {
|
|
143
|
+
schema: TInputSchema;
|
|
144
|
+
valid: () => Promise<TInputSchema extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<TInputSchema> : unknown>;
|
|
145
|
+
};
|
|
146
|
+
declare class RequestInputContext<TPath extends string = string, TInputSchema extends StandardSchemaV1 | undefined = undefined> {
|
|
147
|
+
#private;
|
|
148
|
+
constructor(config: {
|
|
149
|
+
path: TPath;
|
|
150
|
+
method: string;
|
|
151
|
+
pathParams: ExtractPathParams<TPath>;
|
|
152
|
+
searchParams: URLSearchParams;
|
|
153
|
+
parsedBody: unknown;
|
|
154
|
+
rawBody?: string;
|
|
155
|
+
headers: Headers;
|
|
156
|
+
request?: Request;
|
|
157
|
+
inputSchema?: TInputSchema;
|
|
158
|
+
shouldValidateInput?: boolean;
|
|
159
|
+
});
|
|
160
|
+
/**
|
|
161
|
+
* Create a RequestContext from a Request object for server-side handling
|
|
162
|
+
*/
|
|
163
|
+
static fromRequest<TPath extends string, TInputSchema extends StandardSchemaV1 | undefined = undefined>(config: {
|
|
164
|
+
request: Request;
|
|
165
|
+
method: string;
|
|
166
|
+
path: TPath;
|
|
167
|
+
pathParams: ExtractPathParams<TPath>;
|
|
168
|
+
inputSchema?: TInputSchema;
|
|
169
|
+
shouldValidateInput?: boolean;
|
|
170
|
+
state: MutableRequestState;
|
|
171
|
+
rawBody?: string;
|
|
172
|
+
}): Promise<RequestInputContext<TPath, TInputSchema>>;
|
|
173
|
+
/**
|
|
174
|
+
* Create a RequestContext for server-side rendering contexts (no Request object)
|
|
175
|
+
*/
|
|
176
|
+
static fromSSRContext<TPath extends string, TInputSchema extends StandardSchemaV1 | undefined = undefined>(config: {
|
|
177
|
+
method: "GET";
|
|
178
|
+
path: TPath;
|
|
179
|
+
pathParams: ExtractPathParams<TPath>;
|
|
180
|
+
searchParams?: URLSearchParams;
|
|
181
|
+
headers?: Headers;
|
|
182
|
+
} | {
|
|
183
|
+
method: Exclude<HTTPMethod, "GET">;
|
|
184
|
+
path: TPath;
|
|
185
|
+
pathParams: ExtractPathParams<TPath>;
|
|
186
|
+
searchParams?: URLSearchParams;
|
|
187
|
+
headers?: Headers;
|
|
188
|
+
body: unknown;
|
|
189
|
+
inputSchema?: TInputSchema;
|
|
190
|
+
}): RequestInputContext<TPath, TInputSchema>;
|
|
191
|
+
/**
|
|
192
|
+
* The HTTP method as string (e.g., `GET`, `POST`)
|
|
193
|
+
*/
|
|
194
|
+
get method(): string;
|
|
195
|
+
/**
|
|
196
|
+
* The matched route path (e.g., `/users/:id`)
|
|
197
|
+
* @remarks `string`
|
|
198
|
+
*/
|
|
199
|
+
get path(): TPath;
|
|
200
|
+
/**
|
|
201
|
+
* Extracted path parameters as object (e.g., `{ id: '123' }`)
|
|
202
|
+
* @remarks `Record<string, string>`
|
|
203
|
+
*/
|
|
204
|
+
get pathParams(): ExtractPathParams<TPath>;
|
|
205
|
+
/**
|
|
206
|
+
* [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) object for query parameters
|
|
207
|
+
* @remarks `URLSearchParams`
|
|
208
|
+
*/
|
|
209
|
+
get query(): URLSearchParams;
|
|
210
|
+
/**
|
|
211
|
+
* [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object for request headers
|
|
212
|
+
* @remarks `Headers`
|
|
213
|
+
*/
|
|
214
|
+
get headers(): Headers;
|
|
215
|
+
get rawBody(): string | undefined;
|
|
216
|
+
get request(): Request | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* Access the request body as FormData.
|
|
219
|
+
*
|
|
220
|
+
* Use this method when handling file uploads or multipart form submissions.
|
|
221
|
+
* The request must have been sent with Content-Type: multipart/form-data.
|
|
222
|
+
*
|
|
223
|
+
* @throws Error if the request body is not FormData
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* defineRoute({
|
|
228
|
+
* method: "POST",
|
|
229
|
+
* path: "/upload",
|
|
230
|
+
* async handler(ctx, res) {
|
|
231
|
+
* const formData = ctx.formData();
|
|
232
|
+
* const file = formData.get("file") as File;
|
|
233
|
+
* const description = formData.get("description") as string;
|
|
234
|
+
* // ... process file
|
|
235
|
+
* }
|
|
236
|
+
* });
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
formData(): FormData;
|
|
240
|
+
/**
|
|
241
|
+
* Check if the request body is FormData.
|
|
242
|
+
*
|
|
243
|
+
* Useful for routes that accept both JSON and FormData payloads.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```typescript
|
|
247
|
+
* defineRoute({
|
|
248
|
+
* method: "POST",
|
|
249
|
+
* path: "/upload",
|
|
250
|
+
* async handler(ctx, res) {
|
|
251
|
+
* if (ctx.isFormData()) {
|
|
252
|
+
* const formData = ctx.formData();
|
|
253
|
+
* // handle file upload
|
|
254
|
+
* } else {
|
|
255
|
+
* const json = await ctx.input.valid();
|
|
256
|
+
* // handle JSON payload
|
|
257
|
+
* }
|
|
258
|
+
* }
|
|
259
|
+
* });
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
isFormData(): boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Access the request body as a ReadableStream (application/octet-stream).
|
|
265
|
+
*
|
|
266
|
+
* @throws Error if the request body is not a ReadableStream
|
|
267
|
+
*/
|
|
268
|
+
bodyStream(): ReadableStream<Uint8Array>;
|
|
269
|
+
/**
|
|
270
|
+
* Check if the request body is a ReadableStream.
|
|
271
|
+
*/
|
|
272
|
+
isBodyStream(): boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Input validation context (only if inputSchema is defined)
|
|
275
|
+
* @remarks `InputContext`
|
|
276
|
+
*/
|
|
277
|
+
get input(): ValidatedInputContext<TInputSchema>;
|
|
278
|
+
}
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region ../fragno/dist/http/http-status.d.ts
|
|
281
|
+
//#region src/http/http-status.d.ts
|
|
282
|
+
/**
|
|
283
|
+
* @module
|
|
284
|
+
* HTTP Status utility.
|
|
285
|
+
*
|
|
286
|
+
* Modified from honojs/hono
|
|
287
|
+
* Original source: https://github.com/honojs/hono/blob/0e3db674ad3f40be215a55a18062dd8e387ce525/src/utils/http-status.ts
|
|
288
|
+
* License: MIT
|
|
289
|
+
* Date obtained: August 28 2025
|
|
290
|
+
* Copyright (c) 2021-present Yusuke Wada and Hono contributors
|
|
291
|
+
*
|
|
292
|
+
*/
|
|
293
|
+
type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
294
|
+
type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
295
|
+
type DeprecatedStatusCode = 305 | 306;
|
|
296
|
+
type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
297
|
+
type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
|
|
298
|
+
type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
299
|
+
/**
|
|
300
|
+
* If you want to use an unofficial status, use `UnofficialStatusCode`.
|
|
301
|
+
*/
|
|
302
|
+
type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode;
|
|
303
|
+
type ContentlessStatusCode = 101 | 204 | 205 | 304;
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region ../fragno/dist/api/internal/response-stream.d.ts
|
|
306
|
+
//#region src/api/internal/response-stream.d.ts
|
|
307
|
+
/**
|
|
308
|
+
* @module
|
|
309
|
+
* Stream utility.
|
|
310
|
+
*
|
|
311
|
+
* Modified from honojs/hono
|
|
312
|
+
* Original source: https://github.com/honojs/hono/blob/0e3db674ad3f40be215a55a18062dd8e387ce525/src/utils/stream.ts
|
|
313
|
+
* License: MIT
|
|
314
|
+
* Date obtained: August 28 2025
|
|
315
|
+
* Copyright (c) 2021-present Yusuke Wada and Hono contributors
|
|
316
|
+
*/
|
|
317
|
+
type Error$1<Message extends string> = {
|
|
318
|
+
__errorMessage: Message;
|
|
319
|
+
};
|
|
320
|
+
declare class ResponseStream<TArray> {
|
|
321
|
+
#private;
|
|
322
|
+
/**
|
|
323
|
+
* Whether the stream has been aborted.
|
|
324
|
+
*/
|
|
325
|
+
get aborted(): boolean;
|
|
326
|
+
/**
|
|
327
|
+
* Whether the stream has been closed normally.
|
|
328
|
+
*/
|
|
329
|
+
get closed(): boolean;
|
|
330
|
+
/**
|
|
331
|
+
* The readable stream that the response is piped to.
|
|
332
|
+
*/
|
|
333
|
+
get responseReadable(): ReadableStream;
|
|
334
|
+
constructor(writable: WritableStream, readable: ReadableStream);
|
|
335
|
+
writeRaw(input: Uint8Array | string): Promise<boolean>;
|
|
336
|
+
write(input: TArray extends (infer U)[] ? U : Error$1<"To use a streaming response, outputSchema must be an array.">): Promise<void>;
|
|
337
|
+
sleep(ms: number): Promise<unknown>;
|
|
338
|
+
close(): Promise<void>;
|
|
339
|
+
onAbort(listener: () => void | Promise<void>): void;
|
|
340
|
+
/**
|
|
341
|
+
* Abort the stream.
|
|
342
|
+
* You can call this method when stream is aborted by external event.
|
|
343
|
+
*/
|
|
344
|
+
abort(): Promise<void>;
|
|
345
|
+
}
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region ../fragno/dist/api/request-output-context.d.ts
|
|
348
|
+
//#region src/api/request-output-context.d.ts
|
|
349
|
+
interface ResponseInit<T extends StatusCode = StatusCode> {
|
|
350
|
+
headers?: HeadersInit;
|
|
351
|
+
status?: T;
|
|
352
|
+
statusText?: string;
|
|
353
|
+
}
|
|
354
|
+
type JsonStreamCallbackRunner = (callback: () => void | Promise<void>) => void | Promise<void>;
|
|
355
|
+
type OutputContextOptions = {
|
|
356
|
+
runJsonStreamCallback?: JsonStreamCallbackRunner;
|
|
357
|
+
};
|
|
358
|
+
declare abstract class OutputContext<const TOutput, const TErrorCode extends string> {
|
|
359
|
+
#private;
|
|
360
|
+
constructor(options?: OutputContextOptions);
|
|
361
|
+
/**
|
|
362
|
+
* Creates an error response.
|
|
363
|
+
*
|
|
364
|
+
* Shortcut for `throw new FragnoApiError(...)`
|
|
365
|
+
*/
|
|
366
|
+
error: ({ message, code }: {
|
|
367
|
+
message: string;
|
|
368
|
+
code: TErrorCode;
|
|
369
|
+
}, initOrStatus?: ResponseInit | StatusCode, headers?: HeadersInit) => Response;
|
|
370
|
+
empty: (initOrStatus?: ResponseInit<ContentlessStatusCode> | ContentlessStatusCode, headers?: HeadersInit) => Response;
|
|
371
|
+
json: (object: TOutput, initOrStatus?: ResponseInit | StatusCode, headers?: HeadersInit) => Response;
|
|
372
|
+
jsonStream: (cb: (stream: ResponseStream<TOutput>) => void | Promise<void>, { onError, headers }?: {
|
|
373
|
+
onError?: (error: Error, stream: ResponseStream<TOutput>) => void | Promise<void>;
|
|
374
|
+
headers?: HeadersInit;
|
|
375
|
+
}) => Response;
|
|
376
|
+
}
|
|
377
|
+
declare class RequestOutputContext<const TOutputSchema extends StandardSchemaV1 | undefined = undefined, const TErrorCode extends string = string> extends OutputContext<InferOrUnknown<TOutputSchema>, TErrorCode> {
|
|
378
|
+
#private;
|
|
379
|
+
constructor(outputSchema?: TOutputSchema, options?: OutputContextOptions);
|
|
380
|
+
}
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region ../fragno/dist/api/api.d.ts
|
|
383
|
+
//#region src/api/api.d.ts
|
|
384
|
+
type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
385
|
+
type NonGetHTTPMethod = Exclude<HTTPMethod, "GET">;
|
|
386
|
+
interface RequestThisContext {}
|
|
387
|
+
/**
|
|
388
|
+
* Content types that can be accepted by a route.
|
|
389
|
+
*
|
|
390
|
+
* - `"application/json"` (default): JSON request body, validated against inputSchema
|
|
391
|
+
* - `"multipart/form-data"`: FormData request body (file uploads), no schema validation
|
|
392
|
+
*/
|
|
393
|
+
type RouteContentType = "application/json" | "multipart/form-data" | "application/octet-stream";
|
|
394
|
+
interface FragnoRouteConfig<TMethod extends HTTPMethod, TPath extends string, TInputSchema extends StandardSchemaV1 | undefined, TOutputSchema extends StandardSchemaV1 | undefined, TErrorCode extends string = string, TQueryParameters extends string = string, TThisContext extends RequestThisContext = RequestThisContext> {
|
|
395
|
+
method: TMethod;
|
|
396
|
+
path: TPath;
|
|
397
|
+
/**
|
|
398
|
+
* The expected content type for this route's request body.
|
|
399
|
+
*
|
|
400
|
+
* - `"application/json"` (default): Expects JSON body, will be validated against inputSchema
|
|
401
|
+
* - `"multipart/form-data"`: Expects FormData body (for file uploads), use `ctx.formData()` in handler
|
|
402
|
+
*
|
|
403
|
+
* The server will reject requests with mismatched Content-Type headers.
|
|
404
|
+
*
|
|
405
|
+
* @default "application/json"
|
|
406
|
+
*/
|
|
407
|
+
contentType?: RouteContentType;
|
|
408
|
+
inputSchema?: TInputSchema;
|
|
409
|
+
outputSchema?: TOutputSchema;
|
|
410
|
+
errorCodes?: readonly TErrorCode[];
|
|
411
|
+
queryParameters?: readonly TQueryParameters[];
|
|
412
|
+
handler(this: TThisContext, inputCtx: RequestInputContext<TPath, TInputSchema>, outputCtx: RequestOutputContext<TOutputSchema, TErrorCode>): Promise<Response>;
|
|
413
|
+
}
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region ../fragno/dist/api/shared-types.d.ts
|
|
416
|
+
/**
|
|
417
|
+
* Configuration for custom fetch behavior in client-side fragments.
|
|
418
|
+
*/
|
|
419
|
+
type FetcherConfig = {
|
|
420
|
+
type: "options";
|
|
421
|
+
options: RequestInit;
|
|
422
|
+
} | {
|
|
423
|
+
type: "function";
|
|
424
|
+
fetcher: typeof fetch;
|
|
425
|
+
/**
|
|
426
|
+
* Use this fetcher even when `window` is undefined.
|
|
427
|
+
* By default, server-side clients call route handlers directly for SSR.
|
|
428
|
+
*/
|
|
429
|
+
useOnServer?: boolean;
|
|
430
|
+
};
|
|
431
|
+
/**
|
|
432
|
+
* Public configuration for Fragno fragments on the client side.
|
|
433
|
+
*/
|
|
434
|
+
interface FragnoPublicClientConfig {
|
|
435
|
+
mountRoute?: string;
|
|
436
|
+
baseUrl?: string;
|
|
437
|
+
fetcherConfig?: FetcherConfig;
|
|
438
|
+
}
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/pi/workflows/workflow-agent-harness.d.ts
|
|
441
|
+
type PiHarnessStepResult = {
|
|
442
|
+
type: "harness-run";
|
|
443
|
+
appendedEntries: SessionTreeEntry[];
|
|
444
|
+
leafId: string | null;
|
|
445
|
+
};
|
|
446
|
+
type PiHarnessSessionEntryEmission = {
|
|
447
|
+
kind: "harness-session-entry";
|
|
448
|
+
entry: SessionTreeEntry;
|
|
449
|
+
};
|
|
450
|
+
type PiHarnessOperationStartEmission = {
|
|
451
|
+
kind: "harness-operation-start";
|
|
452
|
+
operationId: string;
|
|
453
|
+
replay: {
|
|
454
|
+
protocol: "pi-harness-operation";
|
|
455
|
+
version: 1;
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
type PiHarnessOperationCompleteEmission<TResult = PiHarnessStepResult> = {
|
|
459
|
+
kind: "harness-operation-complete";
|
|
460
|
+
operationId: string;
|
|
461
|
+
result: TResult;
|
|
462
|
+
};
|
|
463
|
+
//#endregion
|
|
464
|
+
//#region src/pi/types.d.ts
|
|
465
|
+
type PiWorkflowStatus = InstanceStatus["status"];
|
|
466
|
+
type PiPromptInput = {
|
|
467
|
+
text: string;
|
|
468
|
+
images?: Array<{
|
|
469
|
+
type: "image";
|
|
470
|
+
data: string;
|
|
471
|
+
mimeType: string;
|
|
472
|
+
}>;
|
|
473
|
+
};
|
|
474
|
+
type PiCompactCommandOutcome = {
|
|
475
|
+
kind: "compact";
|
|
476
|
+
commandId: string;
|
|
477
|
+
status: "succeeded";
|
|
478
|
+
} | {
|
|
479
|
+
kind: "compact";
|
|
480
|
+
commandId: string;
|
|
481
|
+
status: "rejected";
|
|
482
|
+
code: "nothing_to_compact" | "compaction_failed";
|
|
483
|
+
message: string;
|
|
484
|
+
};
|
|
485
|
+
type PiSessionCommandPayload = {
|
|
486
|
+
commandId: string;
|
|
487
|
+
kind: "prompt";
|
|
488
|
+
input: PiPromptInput;
|
|
489
|
+
} | {
|
|
490
|
+
commandId: string;
|
|
491
|
+
kind: "skill";
|
|
492
|
+
input: {
|
|
493
|
+
name: string;
|
|
494
|
+
additionalInstructions?: string;
|
|
495
|
+
};
|
|
496
|
+
} | {
|
|
497
|
+
commandId: string;
|
|
498
|
+
kind: "promptFromTemplate";
|
|
499
|
+
input: {
|
|
500
|
+
name: string;
|
|
501
|
+
args?: string[];
|
|
502
|
+
};
|
|
503
|
+
} | {
|
|
504
|
+
commandId: string;
|
|
505
|
+
kind: "compact";
|
|
506
|
+
input: {
|
|
507
|
+
customInstructions?: string;
|
|
508
|
+
};
|
|
509
|
+
} | {
|
|
510
|
+
commandId: string;
|
|
511
|
+
kind: "abort";
|
|
512
|
+
reason?: string;
|
|
513
|
+
} | {
|
|
514
|
+
commandId: string;
|
|
515
|
+
kind: "steer";
|
|
516
|
+
input: PiPromptInput;
|
|
517
|
+
} | {
|
|
518
|
+
commandId: string;
|
|
519
|
+
kind: "followUp";
|
|
520
|
+
input: PiPromptInput;
|
|
521
|
+
};
|
|
522
|
+
type PiAgentStateSnapshot = {
|
|
523
|
+
messages: PiHarnessFrontendAgentMessage[];
|
|
524
|
+
};
|
|
525
|
+
//#endregion
|
|
526
|
+
export { QueryParamsHint as _, PiHarnessOperationCompleteEmission as a, FragnoPublicClientConfig as c, NonGetHTTPMethod as d, StatusCode as f, MaybeExtractPathParamsOrWiden as g, HasPathParams as h, PiWorkflowStatus as i, FragnoRouteConfig as l, ExtractPathParamsOrWiden as m, PiCompactCommandOutcome as n, PiHarnessOperationStartEmission as o, InferOr as p, PiSessionCommandPayload as r, PiHarnessSessionEntryEmission as s, PiAgentStateSnapshot as t, HTTPMethod as u };
|
|
527
|
+
//# sourceMappingURL=types-Dk856kV1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-Dk856kV1.d.ts","names":[],"sources":["../../../fragno/dist/api/internal/path.d.ts","../../../fragno/dist/util/types-util.d.ts","../../../fragno/dist/api/mutable-request-state.d.ts","../../../fragno/dist/api/request-input-context.d.ts","../../../fragno/dist/http/http-status.d.ts","../../../fragno/dist/api/internal/response-stream.d.ts","../../../fragno/dist/api/request-output-context.d.ts","../../../fragno/dist/api/api.d.ts","../../../fragno/dist/api/shared-types.d.ts","../../src/pi/workflows/workflow-agent-harness.ts","../../src/pi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