@fragno-dev/pi-fragment 0.0.1
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 +107 -0
- package/bin/run.js +72 -0
- package/dist/browser/client/react.d.ts +264 -0
- package/dist/browser/client/react.d.ts.map +1 -0
- package/dist/browser/client/react.js +84 -0
- package/dist/browser/client/react.js.map +1 -0
- package/dist/browser/client/solid.d.ts +266 -0
- package/dist/browser/client/solid.d.ts.map +1 -0
- package/dist/browser/client/solid.js +122 -0
- package/dist/browser/client/solid.js.map +1 -0
- package/dist/browser/client/svelte.d.ts +261 -0
- package/dist/browser/client/svelte.d.ts.map +1 -0
- package/dist/browser/client/svelte.js +126 -0
- package/dist/browser/client/svelte.js.map +1 -0
- package/dist/browser/client/vanilla.d.ts +238 -0
- package/dist/browser/client/vanilla.d.ts.map +1 -0
- package/dist/browser/client/vanilla.js +11 -0
- package/dist/browser/client/vanilla.js.map +1 -0
- package/dist/browser/client/vue.d.ts +264 -0
- package/dist/browser/client/vue.d.ts.map +1 -0
- package/dist/browser/client/vue.js +125 -0
- package/dist/browser/client/vue.js.map +1 -0
- package/dist/browser/client-Bk-J98pf.d.ts +679 -0
- package/dist/browser/client-Bk-J98pf.d.ts.map +1 -0
- package/dist/browser/factory-DKoO_lRA.js +2470 -0
- package/dist/browser/factory-DKoO_lRA.js.map +1 -0
- package/dist/browser/index.d.ts +776 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +3 -0
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +10 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/config.d.ts +13 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +64 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/http/client.js +95 -0
- package/dist/cli/http/client.js.map +1 -0
- package/dist/cli/mod.d.ts +62 -0
- package/dist/cli/mod.d.ts.map +1 -0
- package/dist/cli/mod.js +644 -0
- package/dist/cli/mod.js.map +1 -0
- package/dist/cli/render/index.d.ts +23 -0
- package/dist/cli/render/index.d.ts.map +1 -0
- package/dist/cli/render/index.js +37 -0
- package/dist/cli/render/index.js.map +1 -0
- package/dist/node/index.d.ts +10 -0
- package/dist/node/index.js +9 -0
- package/dist/node/pi/clients.d.ts +240 -0
- package/dist/node/pi/clients.d.ts.map +1 -0
- package/dist/node/pi/clients.js +18 -0
- package/dist/node/pi/clients.js.map +1 -0
- package/dist/node/pi/constants.d.ts +9 -0
- package/dist/node/pi/constants.d.ts.map +1 -0
- package/dist/node/pi/constants.js +22 -0
- package/dist/node/pi/constants.js.map +1 -0
- package/dist/node/pi/definition.d.ts +13 -0
- package/dist/node/pi/definition.d.ts.map +1 -0
- package/dist/node/pi/definition.js +10 -0
- package/dist/node/pi/definition.js.map +1 -0
- package/dist/node/pi/dsl.d.ts +24 -0
- package/dist/node/pi/dsl.d.ts.map +1 -0
- package/dist/node/pi/dsl.js +57 -0
- package/dist/node/pi/dsl.js.map +1 -0
- package/dist/node/pi/factory.d.ts +220 -0
- package/dist/node/pi/factory.d.ts.map +1 -0
- package/dist/node/pi/factory.js +12 -0
- package/dist/node/pi/factory.js.map +1 -0
- package/dist/node/pi/mappers.js +47 -0
- package/dist/node/pi/mappers.js.map +1 -0
- package/dist/node/pi/route-schemas.js +112 -0
- package/dist/node/pi/route-schemas.js.map +1 -0
- package/dist/node/pi/types.d.ts +67 -0
- package/dist/node/pi/types.d.ts.map +1 -0
- package/dist/node/pi/workflow.d.ts +31 -0
- package/dist/node/pi/workflow.d.ts.map +1 -0
- package/dist/node/pi/workflow.js +242 -0
- package/dist/node/pi/workflow.js.map +1 -0
- package/dist/node/routes.d.ts +217 -0
- package/dist/node/routes.d.ts.map +1 -0
- package/dist/node/routes.js +328 -0
- package/dist/node/routes.js.map +1 -0
- package/dist/node/schema.js +12 -0
- package/dist/node/schema.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +125 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Copyright 2025 - present "ReJot Nederland B.V.", and individual contributors.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
|
+
associated documentation files (the “Software”), to deal in the Software without restriction,
|
|
5
|
+
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
6
|
+
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
+
furnished to do so, subject to the following conditions:
|
|
8
|
+
|
|
9
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
10
|
+
portions of the Software.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
13
|
+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
14
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
|
|
15
|
+
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
16
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# pi-fragment
|
|
2
|
+
|
|
3
|
+
A Fragno fragment that runs Pi agents using workflow-backed sessions with registry-based config.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Session lifecycle (create, list, fetch)
|
|
8
|
+
- Workflow-backed agent turns (history stored in workflow steps)
|
|
9
|
+
- Registry-driven agent + tool configuration
|
|
10
|
+
- Minimal API surface for sessions + messages
|
|
11
|
+
|
|
12
|
+
## Server usage
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { defaultFragnoRuntime } from "@fragno-dev/core";
|
|
16
|
+
import { SqlAdapter } from "@fragno-dev/db/adapters/sql";
|
|
17
|
+
import { createWorkflowsFragment } from "@fragno-dev/workflows";
|
|
18
|
+
import { getModel } from "@mariozechner/pi-ai";
|
|
19
|
+
import { createPi, createPiFragment, defineAgent } from "@fragno-dev/pi-fragment";
|
|
20
|
+
|
|
21
|
+
const pi = createPi()
|
|
22
|
+
.agent(
|
|
23
|
+
defineAgent("support-agent", {
|
|
24
|
+
systemPrompt: "You are a helpful support agent.",
|
|
25
|
+
model: getModel("openai", "gpt-4.1"),
|
|
26
|
+
tools: ["search"],
|
|
27
|
+
}),
|
|
28
|
+
)
|
|
29
|
+
.tool("search", async () => ({
|
|
30
|
+
name: "search",
|
|
31
|
+
description: "Lookup references",
|
|
32
|
+
inputSchema: { type: "object", properties: { query: { type: "string" } } },
|
|
33
|
+
handler: async ({ query }: { query: string }) => `Result for ${query}`,
|
|
34
|
+
}))
|
|
35
|
+
.build();
|
|
36
|
+
|
|
37
|
+
const workflowsFragment = createWorkflowsFragment(
|
|
38
|
+
{
|
|
39
|
+
workflows: pi.workflows,
|
|
40
|
+
runtime: defaultFragnoRuntime,
|
|
41
|
+
},
|
|
42
|
+
{ databaseAdapter: new SqlAdapter({ filename: "./pi.db" }), mountRoute: "/api/workflows" },
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const fragment = createPiFragment(
|
|
46
|
+
pi.config,
|
|
47
|
+
{ databaseAdapter: new SqlAdapter({ filename: "./pi.db" }) },
|
|
48
|
+
{ workflows: workflowsFragment.services },
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Example: Next.js route handlers
|
|
52
|
+
export const { GET, POST, PATCH } = fragment.handlersFor("next-js");
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Workflows are executed via the workflows fragment durable hook dispatcher. For a full example, see
|
|
56
|
+
`apps/review-mode/workers/pi-fragment.do.ts`.
|
|
57
|
+
|
|
58
|
+
### Config highlights
|
|
59
|
+
|
|
60
|
+
- `agents`: registry of agent definitions (name, system prompt, model, tools)
|
|
61
|
+
- `tools`: registry of tool factories
|
|
62
|
+
- `defaultSteeringMode`: optional default for agent steering mode
|
|
63
|
+
|
|
64
|
+
## Routes
|
|
65
|
+
|
|
66
|
+
- `POST /sessions`
|
|
67
|
+
- `GET /sessions`
|
|
68
|
+
- `GET /sessions/:sessionId`
|
|
69
|
+
- `POST /sessions/:sessionId/messages`
|
|
70
|
+
|
|
71
|
+
`POST /sessions/:sessionId/messages` is asynchronous. It returns `202 Accepted` with a status-only
|
|
72
|
+
ACK payload. Fetch `GET /sessions/:sessionId` to read assistant messages, trace, and summaries once
|
|
73
|
+
the workflow processes the message.
|
|
74
|
+
|
|
75
|
+
## Client usage
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import { createPiFragmentClient } from "@fragno-dev/pi-fragment/react";
|
|
79
|
+
|
|
80
|
+
const pi = createPiFragmentClient({ baseUrl: "/" });
|
|
81
|
+
|
|
82
|
+
const { data: sessions } = pi.useSessions();
|
|
83
|
+
const createSession = pi.useCreateSession();
|
|
84
|
+
const sendMessage = pi.useSendMessage();
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## CLI
|
|
88
|
+
|
|
89
|
+
Use the CLI to list sessions, create a session, fetch details, or send messages.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# From the workspace
|
|
93
|
+
pnpm -C packages/pi-fragment build
|
|
94
|
+
node packages/pi-fragment/bin/run.js --help
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Use the CLI
|
|
99
|
+
fragno-pi --help
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Development
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pnpm --filter @fragno-dev/pi-fragment test
|
|
106
|
+
pnpm --filter @fragno-dev/pi-fragment build
|
|
107
|
+
```
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { createRequire } from "node:module";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
|
+
|
|
9
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const distCli = path.join(__dirname, "..", "dist", "cli", "cli.js");
|
|
11
|
+
const srcCli = path.join(__dirname, "..", "src", "cli", "cli.ts");
|
|
12
|
+
|
|
13
|
+
const runBuiltCli = async () => {
|
|
14
|
+
await import(pathToFileURL(distCli).href);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const runSourceCli = async () => {
|
|
18
|
+
const require = createRequire(import.meta.url);
|
|
19
|
+
let tsxCli;
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
tsxCli = require.resolve("tsx/cli");
|
|
23
|
+
} catch (error) {
|
|
24
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
25
|
+
console.error("fragno-pi: unable to find tsx to run from source.");
|
|
26
|
+
console.error("Install dependencies or build the CLI before running.");
|
|
27
|
+
if (message) {
|
|
28
|
+
console.error(message);
|
|
29
|
+
}
|
|
30
|
+
process.exit(1);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
await new Promise((resolve) => {
|
|
35
|
+
const child = spawn(process.execPath, [tsxCli, srcCli, ...process.argv.slice(2)], {
|
|
36
|
+
stdio: "inherit",
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
child.on("error", (err) => {
|
|
40
|
+
console.error(`fragno-pi: failed to start tsx (${err.message})`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
resolve(null);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
child.on("exit", (code, signal) => {
|
|
46
|
+
if (signal) {
|
|
47
|
+
process.kill(process.pid, signal);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
process.exit(code ?? 0);
|
|
51
|
+
resolve(null);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const main = async () => {
|
|
57
|
+
if (existsSync(distCli)) {
|
|
58
|
+
await runBuiltCli();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
await runSourceCli();
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
main().catch((error) => {
|
|
66
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
67
|
+
console.error("fragno-pi: unexpected error while running CLI.");
|
|
68
|
+
if (message) {
|
|
69
|
+
console.error(message);
|
|
70
|
+
}
|
|
71
|
+
process.exit(1);
|
|
72
|
+
});
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { a as FragnoClientError, c as InferOr, d as MaybeExtractPathParamsOrWiden, f as QueryParamsHint, i as ReadableAtom, l as ExtractPathParamsOrWiden, o as NonGetHTTPMethod, r as FetcherValue, s as FragnoPublicClientConfig, u as HasPathParams } from "../client-Bk-J98pf.js";
|
|
2
|
+
import * as zod from "zod";
|
|
3
|
+
import "react";
|
|
4
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
5
|
+
import * as _standard_schema_spec0 from "@standard-schema/spec";
|
|
6
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
7
|
+
|
|
8
|
+
//#region ../fragno/dist/client/react.d.ts
|
|
9
|
+
//#region src/client/react.d.ts
|
|
10
|
+
type FragnoReactHook<_TMethod extends "GET", TPath$1 extends string, TOutputSchema$1 extends StandardSchemaV1, TErrorCode$1 extends string, TQueryParameters$1 extends string> = (args?: {
|
|
11
|
+
path?: MaybeExtractPathParamsOrWiden<TPath$1, string | ReadableAtom<string>>;
|
|
12
|
+
query?: QueryParamsHint<TQueryParameters$1, string | ReadableAtom<string>>;
|
|
13
|
+
}) => FetcherValue<StandardSchemaV1.InferOutput<TOutputSchema$1>, FragnoClientError<NonNullable<TErrorCode$1>>>;
|
|
14
|
+
type FragnoReactMutator<_TMethod extends NonGetHTTPMethod, TPath$1 extends string, TInputSchema extends StandardSchemaV1 | undefined, TOutputSchema$1 extends StandardSchemaV1 | undefined, TErrorCode$1 extends string, TQueryParameters$1 extends string> = () => {
|
|
15
|
+
mutate: ({
|
|
16
|
+
body,
|
|
17
|
+
path,
|
|
18
|
+
query
|
|
19
|
+
}: {
|
|
20
|
+
body?: InferOr<TInputSchema, undefined>;
|
|
21
|
+
path?: HasPathParams<TPath$1> extends true ? ExtractPathParamsOrWiden<TPath$1, string | ReadableAtom<string>> : undefined;
|
|
22
|
+
query?: QueryParamsHint<TQueryParameters$1, string | ReadableAtom<string>>;
|
|
23
|
+
}) => Promise<InferOr<TOutputSchema$1, undefined>>;
|
|
24
|
+
loading?: boolean | undefined;
|
|
25
|
+
error?: FragnoClientError<NonNullable<TErrorCode$1>[number]> | undefined;
|
|
26
|
+
data?: InferOr<TOutputSchema$1, undefined> | undefined;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Type helper that unwraps any Store fields of the object into StoreValues
|
|
30
|
+
*/
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/client/react.d.ts
|
|
33
|
+
declare function createPiFragmentClient(config?: FragnoPublicClientConfig): {
|
|
34
|
+
useSessions: FragnoReactHook<"GET", "/sessions", zod.ZodArray<zod.ZodObject<{
|
|
35
|
+
id: zod.ZodString;
|
|
36
|
+
name: zod.ZodNullable<zod.ZodString>;
|
|
37
|
+
status: zod.ZodEnum<{
|
|
38
|
+
active: "active";
|
|
39
|
+
paused: "paused";
|
|
40
|
+
errored: "errored";
|
|
41
|
+
terminated: "terminated";
|
|
42
|
+
complete: "complete";
|
|
43
|
+
waiting: "waiting";
|
|
44
|
+
}>;
|
|
45
|
+
agent: zod.ZodString;
|
|
46
|
+
workflowInstanceId: zod.ZodNullable<zod.ZodString>;
|
|
47
|
+
steeringMode: zod.ZodEnum<{
|
|
48
|
+
all: "all";
|
|
49
|
+
"one-at-a-time": "one-at-a-time";
|
|
50
|
+
}>;
|
|
51
|
+
metadata: zod.ZodNullable<zod.ZodAny>;
|
|
52
|
+
tags: zod.ZodArray<zod.ZodString>;
|
|
53
|
+
createdAt: zod.ZodDate;
|
|
54
|
+
updatedAt: zod.ZodDate;
|
|
55
|
+
}, zod_v4_core0.$strip>>, string, "limit">;
|
|
56
|
+
useSession: FragnoReactHook<"GET", "/sessions/:sessionId", zod.ZodObject<{
|
|
57
|
+
id: zod.ZodString;
|
|
58
|
+
name: zod.ZodNullable<zod.ZodString>;
|
|
59
|
+
status: zod.ZodEnum<{
|
|
60
|
+
active: "active";
|
|
61
|
+
paused: "paused";
|
|
62
|
+
errored: "errored";
|
|
63
|
+
terminated: "terminated";
|
|
64
|
+
complete: "complete";
|
|
65
|
+
waiting: "waiting";
|
|
66
|
+
}>;
|
|
67
|
+
agent: zod.ZodString;
|
|
68
|
+
workflowInstanceId: zod.ZodNullable<zod.ZodString>;
|
|
69
|
+
steeringMode: zod.ZodEnum<{
|
|
70
|
+
all: "all";
|
|
71
|
+
"one-at-a-time": "one-at-a-time";
|
|
72
|
+
}>;
|
|
73
|
+
metadata: zod.ZodNullable<zod.ZodAny>;
|
|
74
|
+
tags: zod.ZodArray<zod.ZodString>;
|
|
75
|
+
createdAt: zod.ZodDate;
|
|
76
|
+
updatedAt: zod.ZodDate;
|
|
77
|
+
workflow: zod.ZodObject<{
|
|
78
|
+
status: zod.ZodEnum<{
|
|
79
|
+
active: "active";
|
|
80
|
+
paused: "paused";
|
|
81
|
+
errored: "errored";
|
|
82
|
+
terminated: "terminated";
|
|
83
|
+
complete: "complete";
|
|
84
|
+
waiting: "waiting";
|
|
85
|
+
}>;
|
|
86
|
+
error: zod.ZodOptional<zod.ZodObject<{
|
|
87
|
+
name: zod.ZodString;
|
|
88
|
+
message: zod.ZodString;
|
|
89
|
+
}, zod_v4_core0.$strip>>;
|
|
90
|
+
output: zod.ZodOptional<zod.ZodAny>;
|
|
91
|
+
}, zod_v4_core0.$strip>;
|
|
92
|
+
messages: zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
93
|
+
role: zod.ZodLiteral<"user">;
|
|
94
|
+
content: zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
95
|
+
type: zod.ZodLiteral<"text">;
|
|
96
|
+
text: zod.ZodString;
|
|
97
|
+
textSignature: zod.ZodOptional<zod.ZodString>;
|
|
98
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
99
|
+
type: zod.ZodLiteral<"thinking">;
|
|
100
|
+
thinking: zod.ZodString;
|
|
101
|
+
thinkingSignature: zod.ZodOptional<zod.ZodString>;
|
|
102
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
103
|
+
type: zod.ZodLiteral<"image">;
|
|
104
|
+
data: zod.ZodString;
|
|
105
|
+
mimeType: zod.ZodString;
|
|
106
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
107
|
+
type: zod.ZodLiteral<"toolCall">;
|
|
108
|
+
id: zod.ZodString;
|
|
109
|
+
name: zod.ZodString;
|
|
110
|
+
arguments: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
|
|
111
|
+
thoughtSignature: zod.ZodOptional<zod.ZodString>;
|
|
112
|
+
}, zod_v4_core0.$strip>]>>]>;
|
|
113
|
+
timestamp: zod.ZodNumber;
|
|
114
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
115
|
+
role: zod.ZodLiteral<"assistant">;
|
|
116
|
+
content: zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
117
|
+
type: zod.ZodLiteral<"text">;
|
|
118
|
+
text: zod.ZodString;
|
|
119
|
+
textSignature: zod.ZodOptional<zod.ZodString>;
|
|
120
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
121
|
+
type: zod.ZodLiteral<"thinking">;
|
|
122
|
+
thinking: zod.ZodString;
|
|
123
|
+
thinkingSignature: zod.ZodOptional<zod.ZodString>;
|
|
124
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
125
|
+
type: zod.ZodLiteral<"image">;
|
|
126
|
+
data: zod.ZodString;
|
|
127
|
+
mimeType: zod.ZodString;
|
|
128
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
129
|
+
type: zod.ZodLiteral<"toolCall">;
|
|
130
|
+
id: zod.ZodString;
|
|
131
|
+
name: zod.ZodString;
|
|
132
|
+
arguments: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
|
|
133
|
+
thoughtSignature: zod.ZodOptional<zod.ZodString>;
|
|
134
|
+
}, zod_v4_core0.$strip>]>>;
|
|
135
|
+
api: zod.ZodString;
|
|
136
|
+
provider: zod.ZodString;
|
|
137
|
+
model: zod.ZodString;
|
|
138
|
+
usage: zod.ZodObject<{
|
|
139
|
+
input: zod.ZodNumber;
|
|
140
|
+
output: zod.ZodNumber;
|
|
141
|
+
cacheRead: zod.ZodNumber;
|
|
142
|
+
cacheWrite: zod.ZodNumber;
|
|
143
|
+
totalTokens: zod.ZodNumber;
|
|
144
|
+
cost: zod.ZodObject<{
|
|
145
|
+
input: zod.ZodNumber;
|
|
146
|
+
output: zod.ZodNumber;
|
|
147
|
+
cacheRead: zod.ZodNumber;
|
|
148
|
+
cacheWrite: zod.ZodNumber;
|
|
149
|
+
total: zod.ZodNumber;
|
|
150
|
+
}, zod_v4_core0.$strip>;
|
|
151
|
+
}, zod_v4_core0.$strip>;
|
|
152
|
+
stopReason: zod.ZodString;
|
|
153
|
+
errorMessage: zod.ZodOptional<zod.ZodString>;
|
|
154
|
+
timestamp: zod.ZodNumber;
|
|
155
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
156
|
+
role: zod.ZodLiteral<"toolResult">;
|
|
157
|
+
toolCallId: zod.ZodString;
|
|
158
|
+
toolName: zod.ZodString;
|
|
159
|
+
content: zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
160
|
+
type: zod.ZodLiteral<"text">;
|
|
161
|
+
text: zod.ZodString;
|
|
162
|
+
textSignature: zod.ZodOptional<zod.ZodString>;
|
|
163
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
164
|
+
type: zod.ZodLiteral<"thinking">;
|
|
165
|
+
thinking: zod.ZodString;
|
|
166
|
+
thinkingSignature: zod.ZodOptional<zod.ZodString>;
|
|
167
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
168
|
+
type: zod.ZodLiteral<"image">;
|
|
169
|
+
data: zod.ZodString;
|
|
170
|
+
mimeType: zod.ZodString;
|
|
171
|
+
}, zod_v4_core0.$strip>, zod.ZodObject<{
|
|
172
|
+
type: zod.ZodLiteral<"toolCall">;
|
|
173
|
+
id: zod.ZodString;
|
|
174
|
+
name: zod.ZodString;
|
|
175
|
+
arguments: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
|
|
176
|
+
thoughtSignature: zod.ZodOptional<zod.ZodString>;
|
|
177
|
+
}, zod_v4_core0.$strip>]>>;
|
|
178
|
+
details: zod.ZodOptional<zod.ZodUnknown>;
|
|
179
|
+
isError: zod.ZodBoolean;
|
|
180
|
+
timestamp: zod.ZodNumber;
|
|
181
|
+
}, zod_v4_core0.$strip>]>>;
|
|
182
|
+
trace: zod.ZodArray<zod.ZodObject<{
|
|
183
|
+
type: zod.ZodString;
|
|
184
|
+
timestamp: zod.ZodOptional<zod.ZodNumber>;
|
|
185
|
+
}, zod_v4_core0.$strip>>;
|
|
186
|
+
summaries: zod.ZodArray<zod.ZodObject<{
|
|
187
|
+
turn: zod.ZodNumber;
|
|
188
|
+
assistant: zod.ZodNullable<zod.ZodAny>;
|
|
189
|
+
summary: zod.ZodNullable<zod.ZodString>;
|
|
190
|
+
}, zod_v4_core0.$strip>>;
|
|
191
|
+
}, zod_v4_core0.$strip>, "WORKFLOWS_REQUIRED" | "SESSION_NOT_FOUND" | "WORKFLOW_INSTANCE_MISSING", string>;
|
|
192
|
+
useCreateSession: FragnoReactMutator<NonGetHTTPMethod, "/sessions", _standard_schema_spec0.StandardSchemaV1<unknown, unknown> | zod.ZodObject<{
|
|
193
|
+
agent: zod.ZodString;
|
|
194
|
+
name: zod.ZodOptional<zod.ZodString>;
|
|
195
|
+
metadata: zod.ZodOptional<zod.ZodAny>;
|
|
196
|
+
tags: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
197
|
+
steeringMode: zod.ZodOptional<zod.ZodEnum<{
|
|
198
|
+
all: "all";
|
|
199
|
+
"one-at-a-time": "one-at-a-time";
|
|
200
|
+
}>>;
|
|
201
|
+
}, zod_v4_core0.$strip> | undefined, zod.ZodObject<{
|
|
202
|
+
id: zod.ZodString;
|
|
203
|
+
name: zod.ZodNullable<zod.ZodString>;
|
|
204
|
+
status: zod.ZodEnum<{
|
|
205
|
+
active: "active";
|
|
206
|
+
paused: "paused";
|
|
207
|
+
errored: "errored";
|
|
208
|
+
terminated: "terminated";
|
|
209
|
+
complete: "complete";
|
|
210
|
+
waiting: "waiting";
|
|
211
|
+
}>;
|
|
212
|
+
agent: zod.ZodString;
|
|
213
|
+
workflowInstanceId: zod.ZodNullable<zod.ZodString>;
|
|
214
|
+
steeringMode: zod.ZodEnum<{
|
|
215
|
+
all: "all";
|
|
216
|
+
"one-at-a-time": "one-at-a-time";
|
|
217
|
+
}>;
|
|
218
|
+
metadata: zod.ZodNullable<zod.ZodAny>;
|
|
219
|
+
tags: zod.ZodArray<zod.ZodString>;
|
|
220
|
+
createdAt: zod.ZodDate;
|
|
221
|
+
updatedAt: zod.ZodDate;
|
|
222
|
+
}, zod_v4_core0.$strip> | zod.ZodArray<zod.ZodObject<{
|
|
223
|
+
id: zod.ZodString;
|
|
224
|
+
name: zod.ZodNullable<zod.ZodString>;
|
|
225
|
+
status: zod.ZodEnum<{
|
|
226
|
+
active: "active";
|
|
227
|
+
paused: "paused";
|
|
228
|
+
errored: "errored";
|
|
229
|
+
terminated: "terminated";
|
|
230
|
+
complete: "complete";
|
|
231
|
+
waiting: "waiting";
|
|
232
|
+
}>;
|
|
233
|
+
agent: zod.ZodString;
|
|
234
|
+
workflowInstanceId: zod.ZodNullable<zod.ZodString>;
|
|
235
|
+
steeringMode: zod.ZodEnum<{
|
|
236
|
+
all: "all";
|
|
237
|
+
"one-at-a-time": "one-at-a-time";
|
|
238
|
+
}>;
|
|
239
|
+
metadata: zod.ZodNullable<zod.ZodAny>;
|
|
240
|
+
tags: zod.ZodArray<zod.ZodString>;
|
|
241
|
+
createdAt: zod.ZodDate;
|
|
242
|
+
updatedAt: zod.ZodDate;
|
|
243
|
+
}, zod_v4_core0.$strip>> | undefined, string, string>;
|
|
244
|
+
useSendMessage: FragnoReactMutator<NonGetHTTPMethod, "/sessions/:sessionId/messages", zod.ZodObject<{
|
|
245
|
+
text: zod.ZodString;
|
|
246
|
+
done: zod.ZodOptional<zod.ZodBoolean>;
|
|
247
|
+
steeringMode: zod.ZodOptional<zod.ZodEnum<{
|
|
248
|
+
all: "all";
|
|
249
|
+
"one-at-a-time": "one-at-a-time";
|
|
250
|
+
}>>;
|
|
251
|
+
}, zod_v4_core0.$strip> | undefined, zod.ZodObject<{
|
|
252
|
+
status: zod.ZodEnum<{
|
|
253
|
+
active: "active";
|
|
254
|
+
paused: "paused";
|
|
255
|
+
errored: "errored";
|
|
256
|
+
terminated: "terminated";
|
|
257
|
+
complete: "complete";
|
|
258
|
+
waiting: "waiting";
|
|
259
|
+
}>;
|
|
260
|
+
}, zod_v4_core0.$strip> | undefined, "WORKFLOWS_REQUIRED" | "SESSION_NOT_FOUND" | "WORKFLOW_INSTANCE_MISSING", string>;
|
|
261
|
+
};
|
|
262
|
+
//#endregion
|
|
263
|
+
export { createPiFragmentClient };
|
|
264
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","names":["ExtractPathParamsOrWiden","HasPathParams","MaybeExtractPathParamsOrWiden","QueryParamsHint","InferOr","NonGetHTTPMethod","FragnoClientError","FragnoClientHookData","FragnoClientMutatorData","FragnoStoreData","ReadableAtom","Store","StoreValue","FetcherValue","react0","DependencyList","StandardSchemaV1","FragnoReactHook","_TMethod","TPath$1","TOutputSchema$1","TErrorCode$1","TQueryParameters$1","InferOutput","NonNullable","path","query","args","FragnoReactMutator","TInputSchema","body","Promise","mutate","loading","error","data","FragnoReactStore","T","TStore","K","useFragno","Record","TPath","TOutputSchema","TErrorCode","TQueryParameters","TMethod","TInput","TOutput","TError","TStoreObj","clientObj","StoreKeys","setKey","k","v","UseStoreOptions","SomeStore","deps","keys","useStore","store","options","FragnoHydrator","children","React","ReactNode"],"sources":["../../../../fragno/dist/client/react.d.ts","../../../src/client/react.ts"],"mappings":";;;;;;;;;KAYKiB,eAAAA,yEAAwFD,gBAAAA,qEAAqFW,IAAAA;EAChLF,IAAAA,GAAOvB,6BAAAA,CAA8BiB,OAAAA,WAAkBT,YAAAA;EACvDgB,KAAAA,GAAQvB,eAAAA,CAAgBmB,kBAAAA,WAA6BZ,YAAAA;AAAAA,MACjDG,YAAAA,CAAaG,gBAAAA,CAAiBO,WAAAA,CAAYH,eAAAA,GAAkBd,iBAAAA,CAAkBkB,WAAAA,CAAYH,YAAAA;AAAAA,KAC3FO,kBAAAA,kBAAoCvB,gBAAAA,+CAA+DW,gBAAAA,sCAAsDA,gBAAAA;EAC5JgB,MAAAA;IACEF,IAAAA;IACAL,IAAAA;IACAC;EAAAA;IAEAI,IAAAA,GAAO1B,OAAAA,CAAQyB,YAAAA;IACfJ,IAAAA,GAAOxB,aAAAA,CAAckB,OAAAA,iBAAwBnB,wBAAAA,CAAyBmB,OAAAA,WAAkBT,YAAAA;IACxFgB,KAAAA,GAAQvB,eAAAA,CAAgBmB,kBAAAA,WAA6BZ,YAAAA;EAAAA,MACjDqB,OAAAA,CAAQ3B,OAAAA,CAAQgB,eAAAA;EACtBa,OAAAA;EACAC,KAAAA,GAAQ5B,iBAAAA,CAAkBkB,WAAAA,CAAYH,YAAAA;EACtCc,IAAAA,GAAO/B,OAAAA,CAAQgB,eAAAA;AAAAA;;;;;;iBCxBD,sBAAA,CAAuB,MAAA,GAAQ,wBAAA;;QAA6B,GAAA,CAAA,SAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { f as isGetHook, h as isReadableAtom, m as isStore, o as createPiFragmentClients, p as isMutatorHook } from "../factory-DKoO_lRA.js";
|
|
2
|
+
import "../index.js";
|
|
3
|
+
import { useCallback, useMemo, useRef, useSyncExternalStore } from "react";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/listen-keys/index.js
|
|
6
|
+
function listenKeys($store, keys, listener) {
|
|
7
|
+
let keysSet = new Set(keys).add(void 0);
|
|
8
|
+
return $store.listen((value, oldValue, changed) => {
|
|
9
|
+
if (keysSet.has(changed)) listener(value, oldValue, changed);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../fragno/dist/client/react.js
|
|
15
|
+
function createReactHook(hook) {
|
|
16
|
+
return ({ path, query } = {}) => {
|
|
17
|
+
const pathParamValues = path ? Object.values(path) : [];
|
|
18
|
+
const queryParamValues = query ? Object.values(query) : [];
|
|
19
|
+
const store = useMemo(() => hook.store({
|
|
20
|
+
path,
|
|
21
|
+
query
|
|
22
|
+
}), [hook, ...[...pathParamValues, ...queryParamValues]]);
|
|
23
|
+
if (typeof window === "undefined") return store.get();
|
|
24
|
+
return useStore(store);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function createReactMutator(hook) {
|
|
28
|
+
return () => {
|
|
29
|
+
return useStore(useMemo(() => hook.mutatorStore, [hook]));
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function createReactStore(hook) {
|
|
33
|
+
if (isReadableAtom(hook.obj)) return () => useStore(hook.obj);
|
|
34
|
+
return () => {
|
|
35
|
+
const result = {};
|
|
36
|
+
for (const key in hook.obj) {
|
|
37
|
+
if (!Object.prototype.hasOwnProperty.call(hook.obj, key)) continue;
|
|
38
|
+
const value = hook.obj[key];
|
|
39
|
+
if (isReadableAtom(value)) result[key] = useStore(value);
|
|
40
|
+
else result[key] = value;
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function useFragno(clientObj) {
|
|
46
|
+
const result = {};
|
|
47
|
+
for (const key in clientObj) {
|
|
48
|
+
if (!Object.prototype.hasOwnProperty.call(clientObj, key)) continue;
|
|
49
|
+
const hook = clientObj[key];
|
|
50
|
+
if (isGetHook(hook)) result[key] = createReactHook(hook);
|
|
51
|
+
else if (isMutatorHook(hook)) result[key] = createReactMutator(hook);
|
|
52
|
+
else if (isStore(hook)) result[key] = createReactStore(hook);
|
|
53
|
+
else result[key] = hook;
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
function useStore(store, options = {}) {
|
|
58
|
+
const snapshotRef = useRef(store.get());
|
|
59
|
+
const { keys, deps = [store, keys] } = options;
|
|
60
|
+
const subscribe = useCallback((onChange) => {
|
|
61
|
+
const emitChange = (value) => {
|
|
62
|
+
if (snapshotRef.current === value) return;
|
|
63
|
+
snapshotRef.current = value;
|
|
64
|
+
onChange();
|
|
65
|
+
};
|
|
66
|
+
emitChange(store.value);
|
|
67
|
+
if (keys?.length) return listenKeys(store, keys, emitChange);
|
|
68
|
+
return store.listen(emitChange);
|
|
69
|
+
}, deps);
|
|
70
|
+
const get = () => snapshotRef.current;
|
|
71
|
+
return useSyncExternalStore(subscribe, get, () => {
|
|
72
|
+
return get();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/client/react.ts
|
|
78
|
+
function createPiFragmentClient(config = {}) {
|
|
79
|
+
return useFragno(createPiFragmentClients(config));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
export { createPiFragmentClient };
|
|
84
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","names":["listenKeys","$store","keys","listener","keysSet","Set","add","undefined","listen","value","oldValue","changed","has","subscribeKeys","unbind","hydrateFromWindow","isReadableAtom","isGetHook","isMutatorHook","isStore","listenKeys","useCallback","useMemo","useRef","useSyncExternalStore","createReactHook","hook","path","query","pathParamValues","Object","values","queryParamValues","store","window","get","useStore","createReactMutator","mutatorStore","createReactStore","obj","result","key","prototype","hasOwnProperty","call","value","useFragno","clientObj","options","snapshotRef","keys","deps","subscribe","onChange","emitChange","current","length","listen","FragnoHydrator","children","useFragno","FragnoPublicClientConfig","createPiFragmentClients","createPiFragmentClient","config"],"sources":["../../../../../node_modules/.pnpm/nanostores@1.1.0/node_modules/nanostores/listen-keys/index.js","../../../../fragno/dist/client/react.js","../../../src/client/react.ts"],"sourcesContent":["export function listenKeys($store, keys, listener) {\n let keysSet = new Set(keys).add(undefined)\n return $store.listen((value, oldValue, changed) => {\n if (keysSet.has(changed)) {\n listener(value, oldValue, changed)\n }\n })\n}\n\nexport function subscribeKeys($store, keys, listener) {\n let unbind = listenKeys($store, keys, listener)\n listener($store.value)\n return unbind\n}\n","import { hydrateFromWindow } from \"../util/ssr.js\";\nimport { isReadableAtom } from \"../util/nanostores.js\";\nimport { isGetHook, isMutatorHook, isStore } from \"./client.js\";\nimport { listenKeys } from \"nanostores\";\nimport { useCallback, useMemo, useRef, useSyncExternalStore } from \"react\";\n\n//#region src/client/react.ts\nfunction createReactHook(hook) {\n\treturn ({ path, query } = {}) => {\n\t\tconst pathParamValues = path ? Object.values(path) : [];\n\t\tconst queryParamValues = query ? Object.values(query) : [];\n\t\tconst store = useMemo(() => hook.store({\n\t\t\tpath,\n\t\t\tquery\n\t\t}), [hook, ...[...pathParamValues, ...queryParamValues]]);\n\t\tif (typeof window === \"undefined\") return store.get();\n\t\treturn useStore(store);\n\t};\n}\nfunction createReactMutator(hook) {\n\treturn () => {\n\t\treturn useStore(useMemo(() => hook.mutatorStore, [hook]));\n\t};\n}\nfunction createReactStore(hook) {\n\tif (isReadableAtom(hook.obj)) return () => useStore(hook.obj);\n\treturn () => {\n\t\tconst result = {};\n\t\tfor (const key in hook.obj) {\n\t\t\tif (!Object.prototype.hasOwnProperty.call(hook.obj, key)) continue;\n\t\t\tconst value = hook.obj[key];\n\t\t\tif (isReadableAtom(value)) result[key] = useStore(value);\n\t\t\telse result[key] = value;\n\t\t}\n\t\treturn result;\n\t};\n}\nfunction useFragno(clientObj) {\n\tconst result = {};\n\tfor (const key in clientObj) {\n\t\tif (!Object.prototype.hasOwnProperty.call(clientObj, key)) continue;\n\t\tconst hook = clientObj[key];\n\t\tif (isGetHook(hook)) result[key] = createReactHook(hook);\n\t\telse if (isMutatorHook(hook)) result[key] = createReactMutator(hook);\n\t\telse if (isStore(hook)) result[key] = createReactStore(hook);\n\t\telse result[key] = hook;\n\t}\n\treturn result;\n}\nfunction useStore(store, options = {}) {\n\tconst snapshotRef = useRef(store.get());\n\tconst { keys, deps = [store, keys] } = options;\n\tconst subscribe = useCallback((onChange) => {\n\t\tconst emitChange = (value) => {\n\t\t\tif (snapshotRef.current === value) return;\n\t\t\tsnapshotRef.current = value;\n\t\t\tonChange();\n\t\t};\n\t\temitChange(store.value);\n\t\tif (keys?.length) return listenKeys(store, keys, emitChange);\n\t\treturn store.listen(emitChange);\n\t}, deps);\n\tconst get = () => snapshotRef.current;\n\treturn useSyncExternalStore(subscribe, get, () => {\n\t\treturn get();\n\t});\n}\nfunction FragnoHydrator({ children }) {\n\tuseMemo(() => {\n\t\thydrateFromWindow();\n\t}, []);\n\treturn children;\n}\n\n//#endregion\nexport { FragnoHydrator, useFragno, useStore };\n//# sourceMappingURL=react.js.map","import { useFragno } from \"@fragno-dev/core/react\";\nimport type { FragnoPublicClientConfig } from \"@fragno-dev/core/client\";\nimport { createPiFragmentClients } from \"..\";\n\nexport function createPiFragmentClient(config: FragnoPublicClientConfig = {}) {\n return useFragno(createPiFragmentClients(config));\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;AAAA,SAAgBA,WAAWC,QAAQC,MAAMC,UAAU;CACjD,IAAIC,UAAU,IAAIC,IAAIH,KAAK,CAACI,IAAIC,OAAU;AAC1C,QAAON,OAAOO,QAAQC,OAAOC,UAAUC,YAAY;AACjD,MAAIP,QAAQQ,IAAID,QAAQ,CACtBR,UAASM,OAAOC,UAAUC,QAAQ;GAEpC;;;;;ACCJ,SAASc,gBAAgBC,MAAM;AAC9B,SAAQ,EAAEC,MAAMC,UAAU,EAAE,KAAK;EAChC,MAAMC,kBAAkBF,OAAOG,OAAOC,OAAOJ,KAAK,GAAG,EAAE;EACvD,MAAMK,mBAAmBJ,QAAQE,OAAOC,OAAOH,MAAM,GAAG,EAAE;EAC1D,MAAMK,QAAQX,cAAcI,KAAKO,MAAM;GACtCN;GACAC;GACA,CAAC,EAAE,CAACF,MAAM,GAAG,CAAC,GAAGG,iBAAiB,GAAGG,iBAAiB,CAAC,CAAC;AACzD,MAAI,OAAOE,WAAW,YAAa,QAAOD,MAAME,KAAK;AACrD,SAAOC,SAASH,MAAM;;;AAGxB,SAASI,mBAAmBX,MAAM;AACjC,cAAa;AACZ,SAAOU,SAASd,cAAcI,KAAKY,cAAc,CAACZ,KAAK,CAAC,CAAC;;;AAG3D,SAASa,iBAAiBb,MAAM;AAC/B,KAAIV,eAAeU,KAAKc,IAAI,CAAE,cAAaJ,SAASV,KAAKc,IAAI;AAC7D,cAAa;EACZ,MAAMC,SAAS,EAAE;AACjB,OAAK,MAAMC,OAAOhB,KAAKc,KAAK;AAC3B,OAAI,CAACV,OAAOa,UAAUC,eAAeC,KAAKnB,KAAKc,KAAKE,IAAI,CAAE;GAC1D,MAAMI,QAAQpB,KAAKc,IAAIE;AACvB,OAAI1B,eAAe8B,MAAM,CAAEL,QAAOC,OAAON,SAASU,MAAM;OACnDL,QAAOC,OAAOI;;AAEpB,SAAOL;;;AAGT,SAASM,UAAUC,WAAW;CAC7B,MAAMP,SAAS,EAAE;AACjB,MAAK,MAAMC,OAAOM,WAAW;AAC5B,MAAI,CAAClB,OAAOa,UAAUC,eAAeC,KAAKG,WAAWN,IAAI,CAAE;EAC3D,MAAMhB,OAAOsB,UAAUN;AACvB,MAAIzB,UAAUS,KAAK,CAAEe,QAAOC,OAAOjB,gBAAgBC,KAAK;WAC/CR,cAAcQ,KAAK,CAAEe,QAAOC,OAAOL,mBAAmBX,KAAK;WAC3DP,QAAQO,KAAK,CAAEe,QAAOC,OAAOH,iBAAiBb,KAAK;MACvDe,QAAOC,OAAOhB;;AAEpB,QAAOe;;AAER,SAASL,SAASH,OAAOgB,UAAU,EAAE,EAAE;CACtC,MAAMC,cAAc3B,OAAOU,MAAME,KAAK,CAAC;CACvC,MAAM,EAAEgB,MAAMC,OAAO,CAACnB,OAAOkB,KAAI,KAAMF;CACvC,MAAMI,YAAYhC,aAAaiC,aAAa;EAC3C,MAAMC,cAAcT,UAAU;AAC7B,OAAII,YAAYM,YAAYV,MAAO;AACnCI,eAAYM,UAAUV;AACtBQ,aAAU;;AAEXC,aAAWtB,MAAMa,MAAM;AACvB,MAAIK,MAAMM,OAAQ,QAAOrC,WAAWa,OAAOkB,MAAMI,WAAW;AAC5D,SAAOtB,MAAMyB,OAAOH,WAAW;IAC7BH,KAAK;CACR,MAAMjB,YAAYe,YAAYM;AAC9B,QAAOhC,qBAAqB6B,WAAWlB,WAAW;AACjD,SAAOA,KAAK;GACX;;;;;AC7DH,SAAgB6B,uBAAuBC,SAAmC,EAAE,EAAE;AAC5E,QAAOJ,UAAUE,wBAAwBE,OAAO,CAAC"}
|