@vibesdotdev/code-sessions 0.0.0-stage → 1.0.0-rc.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 +18 -0
- package/README.md +165 -2
- package/dist/agent/coordinator.agent.descriptor.d.ts +69 -0
- package/dist/agent/coordinator.agent.descriptor.d.ts.map +1 -0
- package/dist/agent/coordinator.agent.descriptor.js +60 -0
- package/dist/agent/coordinator.agent.descriptor.js.map +1 -0
- package/dist/agent/coordinator.prompt.descriptor.d.ts +135 -0
- package/dist/agent/coordinator.prompt.descriptor.d.ts.map +1 -0
- package/dist/agent/coordinator.prompt.descriptor.js +29 -0
- package/dist/agent/coordinator.prompt.descriptor.js.map +1 -0
- package/dist/agent/coordinator.system-prompt.d.ts +3 -0
- package/dist/agent/coordinator.system-prompt.d.ts.map +1 -0
- package/dist/agent/coordinator.system-prompt.js +18 -0
- package/dist/agent/coordinator.system-prompt.js.map +1 -0
- package/dist/agent/developer.agent.descriptor.d.ts +74 -0
- package/dist/agent/developer.agent.descriptor.d.ts.map +1 -0
- package/dist/agent/developer.agent.descriptor.js +138 -0
- package/dist/agent/developer.agent.descriptor.js.map +1 -0
- package/dist/agent/developer.prompt.descriptor.d.ts +137 -0
- package/dist/agent/developer.prompt.descriptor.d.ts.map +1 -0
- package/dist/agent/developer.prompt.descriptor.js +29 -0
- package/dist/agent/developer.prompt.descriptor.js.map +1 -0
- package/dist/agent/reviewer.agent.descriptor.d.ts +69 -0
- package/dist/agent/reviewer.agent.descriptor.d.ts.map +1 -0
- package/dist/agent/reviewer.agent.descriptor.js +60 -0
- package/dist/agent/reviewer.agent.descriptor.js.map +1 -0
- package/dist/agent/reviewer.prompt.descriptor.d.ts +135 -0
- package/dist/agent/reviewer.prompt.descriptor.d.ts.map +1 -0
- package/dist/agent/reviewer.prompt.descriptor.js +29 -0
- package/dist/agent/reviewer.prompt.descriptor.js.map +1 -0
- package/dist/agent/reviewer.system-prompt.d.ts +3 -0
- package/dist/agent/reviewer.system-prompt.d.ts.map +1 -0
- package/dist/agent/reviewer.system-prompt.js +17 -0
- package/dist/agent/reviewer.system-prompt.js.map +1 -0
- package/dist/agent/system-prompt.d.ts +12 -0
- package/dist/agent/system-prompt.d.ts.map +1 -0
- package/dist/agent/system-prompt.js +28 -0
- package/dist/agent/system-prompt.js.map +1 -0
- package/dist/api/code-sessions.api-client.descriptor.d.ts +25 -0
- package/dist/api/code-sessions.api-client.descriptor.d.ts.map +1 -0
- package/dist/api/code-sessions.api-client.descriptor.js +26 -0
- package/dist/api/code-sessions.api-client.descriptor.js.map +1 -0
- package/dist/api/code-sessions.api-client.impl.d.ts +156 -0
- package/dist/api/code-sessions.api-client.impl.d.ts.map +1 -0
- package/dist/api/code-sessions.api-client.impl.js +852 -0
- package/dist/api/code-sessions.api-client.impl.js.map +1 -0
- package/dist/api/code-sessions.api-client.schemas.d.ts +2 -0
- package/dist/api/code-sessions.api-client.schemas.d.ts.map +1 -0
- package/dist/api/code-sessions.api-client.schemas.js +2 -0
- package/dist/api/code-sessions.api-client.schemas.js.map +1 -0
- package/dist/api/code-sessions.api-client.types.d.ts +252 -0
- package/dist/api/code-sessions.api-client.types.d.ts.map +1 -0
- package/dist/api/code-sessions.api-client.types.js +77 -0
- package/dist/api/code-sessions.api-client.types.js.map +1 -0
- package/dist/api/index.d.ts +13 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +20 -0
- package/dist/api/index.js.map +1 -0
- package/dist/capability.d.ts +9 -0
- package/dist/capability.d.ts.map +1 -0
- package/dist/capability.js +9 -0
- package/dist/capability.js.map +1 -0
- package/dist/catalog/index.d.ts +2 -0
- package/dist/catalog/index.d.ts.map +1 -0
- package/dist/catalog/index.js +2 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/catalog/session-catalog.d.ts +131 -0
- package/dist/catalog/session-catalog.d.ts.map +1 -0
- package/dist/catalog/session-catalog.impl.consumer.worker.d.ts +113 -0
- package/dist/catalog/session-catalog.impl.consumer.worker.d.ts.map +1 -0
- package/dist/catalog/session-catalog.impl.consumer.worker.js +32 -0
- package/dist/catalog/session-catalog.impl.consumer.worker.js.map +1 -0
- package/dist/catalog/session-catalog.js +126 -0
- package/dist/catalog/session-catalog.js.map +1 -0
- package/dist/clock/clock.client.d.ts +18 -0
- package/dist/clock/clock.client.d.ts.map +1 -0
- package/dist/clock/clock.client.js +43 -0
- package/dist/clock/clock.client.js.map +1 -0
- package/dist/code-sessions.consumer.plugin.d.ts +4 -0
- package/dist/code-sessions.consumer.plugin.d.ts.map +1 -0
- package/dist/code-sessions.consumer.plugin.js +16 -0
- package/dist/code-sessions.consumer.plugin.js.map +1 -0
- package/dist/code-sessions.plugin.d.ts +15 -0
- package/dist/code-sessions.plugin.d.ts.map +1 -0
- package/dist/code-sessions.plugin.js +65 -0
- package/dist/code-sessions.plugin.js.map +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +9 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/preparation.d.ts +2 -0
- package/dist/config/preparation.d.ts.map +1 -0
- package/dist/config/preparation.js +2 -0
- package/dist/config/preparation.js.map +1 -0
- package/dist/docs/code-sessions.docs.descriptor.d.ts +4 -0
- package/dist/docs/code-sessions.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/code-sessions.docs.descriptor.js +241 -0
- package/dist/docs/code-sessions.docs.descriptor.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/pull-request-plan.d.ts +68 -0
- package/dist/pull-request-plan.d.ts.map +1 -0
- package/dist/pull-request-plan.js +94 -0
- package/dist/pull-request-plan.js.map +1 -0
- package/dist/schemas/preparation.d.ts +51 -0
- package/dist/schemas/preparation.d.ts.map +1 -0
- package/dist/schemas/preparation.js +20 -0
- package/dist/schemas/preparation.js.map +1 -0
- package/dist/schemas/requests.d.ts +411 -0
- package/dist/schemas/requests.d.ts.map +1 -0
- package/dist/schemas/requests.js +87 -0
- package/dist/schemas/requests.js.map +1 -0
- package/dist/schemas/responses.d.ts +275 -0
- package/dist/schemas/responses.d.ts.map +1 -0
- package/dist/schemas/responses.js +90 -0
- package/dist/schemas/responses.js.map +1 -0
- package/dist/svelte/actions.d.ts +70 -0
- package/dist/svelte/actions.d.ts.map +1 -0
- package/dist/svelte/actions.js +280 -0
- package/dist/svelte/clock.svelte.d.ts +6 -0
- package/dist/svelte/clock.svelte.d.ts.map +1 -0
- package/dist/svelte/clock.svelte.js +33 -0
- package/dist/svelte/components/CreateSessionDialog.svelte +470 -0
- package/dist/svelte/components/CreateSessionDialog.svelte.d.ts +57 -0
- package/dist/svelte/components/CreateSessionDialog.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SessionCard.svelte +216 -0
- package/dist/svelte/components/SessionCard.svelte.d.ts +27 -0
- package/dist/svelte/components/SessionCard.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SessionList.svelte +86 -0
- package/dist/svelte/components/SessionList.svelte.d.ts +23 -0
- package/dist/svelte/components/SessionList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SessionSeed.svelte +60 -0
- package/dist/svelte/components/SessionSeed.svelte.d.ts +9 -0
- package/dist/svelte/components/SessionSeed.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TranscriptView.svelte +360 -0
- package/dist/svelte/components/TranscriptView.svelte.d.ts +26 -0
- package/dist/svelte/components/TranscriptView.svelte.d.ts.map +1 -0
- package/dist/svelte/create-session-form.d.ts +84 -0
- package/dist/svelte/create-session-form.d.ts.map +1 -0
- package/dist/svelte/create-session-form.js +107 -0
- package/dist/svelte/index.d.ts +20 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +18 -0
- package/dist/svelte/live-session.d.ts +156 -0
- package/dist/svelte/live-session.d.ts.map +1 -0
- package/dist/svelte/live-session.js +152 -0
- package/dist/svelte/loaders.d.ts +74 -0
- package/dist/svelte/loaders.d.ts.map +1 -0
- package/dist/svelte/loaders.js +124 -0
- package/dist/svelte/outcome.d.ts +46 -0
- package/dist/svelte/outcome.d.ts.map +1 -0
- package/dist/svelte/outcome.js +49 -0
- package/dist/svelte/relative-time.d.ts +32 -0
- package/dist/svelte/relative-time.d.ts.map +1 -0
- package/dist/svelte/relative-time.js +51 -0
- package/dist/svelte/session-list-item.d.ts +23 -0
- package/dist/svelte/session-list-item.d.ts.map +1 -0
- package/dist/svelte/session-list-item.js +1 -0
- package/dist/svelte/styles.css +8 -0
- package/dist/svelte/transcript-input.d.ts +45 -0
- package/dist/svelte/transcript-input.d.ts.map +1 -0
- package/dist/svelte/transcript-input.js +188 -0
- package/dist/tui/code-sessions-tui.plugin.d.ts +10 -0
- package/dist/tui/code-sessions-tui.plugin.d.ts.map +1 -0
- package/dist/tui/code-sessions-tui.plugin.js +29 -0
- package/dist/tui/code-sessions-tui.plugin.js.map +1 -0
- package/dist/tui/code-sessions.tui-app.descriptor.d.ts +7 -0
- package/dist/tui/code-sessions.tui-app.descriptor.d.ts.map +1 -0
- package/dist/tui/code-sessions.tui-app.descriptor.js +30 -0
- package/dist/tui/code-sessions.tui-app.descriptor.js.map +1 -0
- package/dist/tui/code-sessions.tui-app.impl.consumer.d.ts +14 -0
- package/dist/tui/code-sessions.tui-app.impl.consumer.d.ts.map +1 -0
- package/dist/tui/code-sessions.tui-app.impl.consumer.js +453 -0
- package/dist/tui/code-sessions.tui-app.impl.consumer.js.map +1 -0
- package/dist/tui/code-sessions.tui-client.d.ts +22 -0
- package/dist/tui/code-sessions.tui-client.d.ts.map +1 -0
- package/dist/tui/code-sessions.tui-client.js +95 -0
- package/dist/tui/code-sessions.tui-client.js.map +1 -0
- package/dist/tui/code-sessions.tui-open.descriptor.d.ts +7 -0
- package/dist/tui/code-sessions.tui-open.descriptor.d.ts.map +1 -0
- package/dist/tui/code-sessions.tui-open.descriptor.js +16 -0
- package/dist/tui/code-sessions.tui-open.descriptor.js.map +1 -0
- package/dist/tui/code-sessions.tui-open.impl.consumer.d.ts +7 -0
- package/dist/tui/code-sessions.tui-open.impl.consumer.d.ts.map +1 -0
- package/dist/tui/code-sessions.tui-open.impl.consumer.js +11 -0
- package/dist/tui/code-sessions.tui-open.impl.consumer.js.map +1 -0
- package/dist/tui/code-sessions.tui-state.descriptor.d.ts +16 -0
- package/dist/tui/code-sessions.tui-state.descriptor.d.ts.map +1 -0
- package/dist/tui/code-sessions.tui-state.descriptor.js +50 -0
- package/dist/tui/code-sessions.tui-state.descriptor.js.map +1 -0
- package/dist/tui/code-sessions.tui-state.impl.consumer.d.ts +30 -0
- package/dist/tui/code-sessions.tui-state.impl.consumer.d.ts.map +1 -0
- package/dist/tui/code-sessions.tui-state.impl.consumer.js +533 -0
- package/dist/tui/code-sessions.tui-state.impl.consumer.js.map +1 -0
- package/dist/tui/code-sessions.tui-state.key.d.ts +322 -0
- package/dist/tui/code-sessions.tui-state.key.d.ts.map +1 -0
- package/dist/tui/code-sessions.tui-state.key.js +104 -0
- package/dist/tui/code-sessions.tui-state.key.js.map +1 -0
- package/dist/tui/index.d.ts +9 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/workspace/index.d.ts +2 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +2 -0
- package/dist/workspace/index.js.map +1 -0
- package/dist/workspace/workspace-binding.d.ts +74 -0
- package/dist/workspace/workspace-binding.d.ts.map +1 -0
- package/dist/workspace/workspace-binding.impl.consumer.worker.d.ts +17 -0
- package/dist/workspace/workspace-binding.impl.consumer.worker.d.ts.map +1 -0
- package/dist/workspace/workspace-binding.impl.consumer.worker.js +134 -0
- package/dist/workspace/workspace-binding.impl.consumer.worker.js.map +1 -0
- package/dist/workspace/workspace-binding.js +72 -0
- package/dist/workspace/workspace-binding.js.map +1 -0
- package/package.json +238 -4
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Sessions API Client — response schemas.
|
|
3
|
+
*
|
|
4
|
+
* Every platform answer the client returns is parsed here, at the I/O
|
|
5
|
+
* boundary, before a caller sees it: a 200 whose body is not the declared
|
|
6
|
+
* shape becomes a typed refusal instead of an unchecked value. Each schema is
|
|
7
|
+
* bound to its declared type with `satisfies`, so the wire contract and the
|
|
8
|
+
* public type cannot drift apart.
|
|
9
|
+
*/
|
|
10
|
+
import * as z from 'zod/v4';
|
|
11
|
+
export declare const PlatformCodeSessionRecordSchema: z.ZodObject<{
|
|
12
|
+
sessionId: z.ZodString;
|
|
13
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
14
|
+
repositoryName: z.ZodNullable<z.ZodString>;
|
|
15
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
hostTarget: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
+
kind: z.ZodLiteral<"cloud">;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
kind: z.ZodLiteral<"host">;
|
|
20
|
+
hostId: z.ZodString;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"provisioned">;
|
|
23
|
+
adapter: z.ZodString;
|
|
24
|
+
region: z.ZodOptional<z.ZodString>;
|
|
25
|
+
size: z.ZodOptional<z.ZodString>;
|
|
26
|
+
image: z.ZodOptional<z.ZodString>;
|
|
27
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
28
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
29
|
+
ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
providerConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
+
}, z.core.$strip>], "kind">;
|
|
32
|
+
runtimeConfig: z.ZodObject<{
|
|
33
|
+
environmentName: z.ZodOptional<z.ZodString>;
|
|
34
|
+
node: z.ZodOptional<z.ZodString>;
|
|
35
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
36
|
+
setupScript: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
status: z.ZodEnum<{
|
|
39
|
+
error: "error";
|
|
40
|
+
active: "active";
|
|
41
|
+
initializing: "initializing";
|
|
42
|
+
ended: "ended";
|
|
43
|
+
}>;
|
|
44
|
+
statusReason: z.ZodOptional<z.ZodString>;
|
|
45
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
46
|
+
workspacePath: z.ZodString;
|
|
47
|
+
checkoutRef: z.ZodNullable<z.ZodString>;
|
|
48
|
+
ownerType: z.ZodEnum<{
|
|
49
|
+
user: "user";
|
|
50
|
+
organization: "organization";
|
|
51
|
+
}>;
|
|
52
|
+
ownerId: z.ZodString;
|
|
53
|
+
createdAt: z.ZodString;
|
|
54
|
+
lastActivityAt: z.ZodString;
|
|
55
|
+
lastMeteredAt: z.ZodOptional<z.ZodString>;
|
|
56
|
+
seed: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
source: z.ZodString;
|
|
58
|
+
title: z.ZodString;
|
|
59
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
60
|
+
body: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
+
kind: z.ZodString;
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
source: z.ZodString;
|
|
66
|
+
role: z.ZodDefault<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
/** `{ result: record }`: get, create and link. */
|
|
70
|
+
export declare const CodeSessionRecordEnvelopeSchema: z.ZodObject<{
|
|
71
|
+
result: z.ZodObject<{
|
|
72
|
+
sessionId: z.ZodString;
|
|
73
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
74
|
+
repositoryName: z.ZodNullable<z.ZodString>;
|
|
75
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
hostTarget: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
|
+
kind: z.ZodLiteral<"cloud">;
|
|
78
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<"host">;
|
|
80
|
+
hostId: z.ZodString;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
kind: z.ZodLiteral<"provisioned">;
|
|
83
|
+
adapter: z.ZodString;
|
|
84
|
+
region: z.ZodOptional<z.ZodString>;
|
|
85
|
+
size: z.ZodOptional<z.ZodString>;
|
|
86
|
+
image: z.ZodOptional<z.ZodString>;
|
|
87
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
88
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
89
|
+
ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
providerConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
91
|
+
}, z.core.$strip>], "kind">;
|
|
92
|
+
runtimeConfig: z.ZodObject<{
|
|
93
|
+
environmentName: z.ZodOptional<z.ZodString>;
|
|
94
|
+
node: z.ZodOptional<z.ZodString>;
|
|
95
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
96
|
+
setupScript: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
status: z.ZodEnum<{
|
|
99
|
+
error: "error";
|
|
100
|
+
active: "active";
|
|
101
|
+
initializing: "initializing";
|
|
102
|
+
ended: "ended";
|
|
103
|
+
}>;
|
|
104
|
+
statusReason: z.ZodOptional<z.ZodString>;
|
|
105
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
106
|
+
workspacePath: z.ZodString;
|
|
107
|
+
checkoutRef: z.ZodNullable<z.ZodString>;
|
|
108
|
+
ownerType: z.ZodEnum<{
|
|
109
|
+
user: "user";
|
|
110
|
+
organization: "organization";
|
|
111
|
+
}>;
|
|
112
|
+
ownerId: z.ZodString;
|
|
113
|
+
createdAt: z.ZodString;
|
|
114
|
+
lastActivityAt: z.ZodString;
|
|
115
|
+
lastMeteredAt: z.ZodOptional<z.ZodString>;
|
|
116
|
+
seed: z.ZodOptional<z.ZodObject<{
|
|
117
|
+
source: z.ZodString;
|
|
118
|
+
title: z.ZodString;
|
|
119
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
120
|
+
body: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
123
|
+
kind: z.ZodString;
|
|
124
|
+
id: z.ZodString;
|
|
125
|
+
source: z.ZodString;
|
|
126
|
+
role: z.ZodDefault<z.ZodString>;
|
|
127
|
+
}, z.core.$strip>>>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
/** `{ results: record[] }`: list. */
|
|
131
|
+
export declare const CodeSessionListEnvelopeSchema: z.ZodObject<{
|
|
132
|
+
results: z.ZodArray<z.ZodObject<{
|
|
133
|
+
sessionId: z.ZodString;
|
|
134
|
+
repositoryId: z.ZodNullable<z.ZodString>;
|
|
135
|
+
repositoryName: z.ZodNullable<z.ZodString>;
|
|
136
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
hostTarget: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
138
|
+
kind: z.ZodLiteral<"cloud">;
|
|
139
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
+
kind: z.ZodLiteral<"host">;
|
|
141
|
+
hostId: z.ZodString;
|
|
142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
143
|
+
kind: z.ZodLiteral<"provisioned">;
|
|
144
|
+
adapter: z.ZodString;
|
|
145
|
+
region: z.ZodOptional<z.ZodString>;
|
|
146
|
+
size: z.ZodOptional<z.ZodString>;
|
|
147
|
+
image: z.ZodOptional<z.ZodString>;
|
|
148
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
149
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
150
|
+
ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
providerConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
152
|
+
}, z.core.$strip>], "kind">;
|
|
153
|
+
runtimeConfig: z.ZodObject<{
|
|
154
|
+
environmentName: z.ZodOptional<z.ZodString>;
|
|
155
|
+
node: z.ZodOptional<z.ZodString>;
|
|
156
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
157
|
+
setupScript: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
status: z.ZodEnum<{
|
|
160
|
+
error: "error";
|
|
161
|
+
active: "active";
|
|
162
|
+
initializing: "initializing";
|
|
163
|
+
ended: "ended";
|
|
164
|
+
}>;
|
|
165
|
+
statusReason: z.ZodOptional<z.ZodString>;
|
|
166
|
+
previewUrl: z.ZodNullable<z.ZodString>;
|
|
167
|
+
workspacePath: z.ZodString;
|
|
168
|
+
checkoutRef: z.ZodNullable<z.ZodString>;
|
|
169
|
+
ownerType: z.ZodEnum<{
|
|
170
|
+
user: "user";
|
|
171
|
+
organization: "organization";
|
|
172
|
+
}>;
|
|
173
|
+
ownerId: z.ZodString;
|
|
174
|
+
createdAt: z.ZodString;
|
|
175
|
+
lastActivityAt: z.ZodString;
|
|
176
|
+
lastMeteredAt: z.ZodOptional<z.ZodString>;
|
|
177
|
+
seed: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
source: z.ZodString;
|
|
179
|
+
title: z.ZodString;
|
|
180
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
181
|
+
body: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
184
|
+
kind: z.ZodString;
|
|
185
|
+
id: z.ZodString;
|
|
186
|
+
source: z.ZodString;
|
|
187
|
+
role: z.ZodDefault<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>>>;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
/** `{ result }`: prepare's envelope; the result is parsed by its own schema. */
|
|
192
|
+
export declare const PreparationEnvelopeSchema: z.ZodObject<{
|
|
193
|
+
result: z.ZodObject<{
|
|
194
|
+
sessionId: z.ZodString;
|
|
195
|
+
repositoryId: z.ZodUUID;
|
|
196
|
+
hostTarget: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
197
|
+
kind: z.ZodLiteral<"cloud">;
|
|
198
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
199
|
+
kind: z.ZodLiteral<"host">;
|
|
200
|
+
hostId: z.ZodString;
|
|
201
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
202
|
+
kind: z.ZodLiteral<"provisioned">;
|
|
203
|
+
adapter: z.ZodString;
|
|
204
|
+
region: z.ZodOptional<z.ZodString>;
|
|
205
|
+
size: z.ZodOptional<z.ZodString>;
|
|
206
|
+
image: z.ZodOptional<z.ZodString>;
|
|
207
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
208
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
209
|
+
ttlHours: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
providerConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
211
|
+
}, z.core.$strip>], "kind">;
|
|
212
|
+
workspacePath: z.ZodString;
|
|
213
|
+
status: z.ZodLiteral<"active">;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
export declare const RunCommandResponseSchema: z.ZodObject<{
|
|
217
|
+
sessionId: z.ZodString;
|
|
218
|
+
command: z.ZodArray<z.ZodString>;
|
|
219
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
220
|
+
stdout: z.ZodString;
|
|
221
|
+
stderr: z.ZodString;
|
|
222
|
+
timedOut: z.ZodBoolean;
|
|
223
|
+
durationMs: z.ZodNumber;
|
|
224
|
+
startedAt: z.ZodString;
|
|
225
|
+
endedAt: z.ZodString;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
export declare const PushBranchResponseSchema: z.ZodObject<{
|
|
228
|
+
pushed: z.ZodBoolean;
|
|
229
|
+
repository: z.ZodString;
|
|
230
|
+
branch: z.ZodString;
|
|
231
|
+
headSha: z.ZodOptional<z.ZodString>;
|
|
232
|
+
pullRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
233
|
+
ready: z.ZodLiteral<true>;
|
|
234
|
+
repo: z.ZodString;
|
|
235
|
+
sourceRef: z.ZodString;
|
|
236
|
+
title: z.ZodString;
|
|
237
|
+
description: z.ZodString;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
ready: z.ZodLiteral<false>;
|
|
240
|
+
reason: z.ZodString;
|
|
241
|
+
}, z.core.$strip>], "ready">;
|
|
242
|
+
pullRequestItem: z.ZodOptional<z.ZodObject<{
|
|
243
|
+
id: z.ZodString;
|
|
244
|
+
issueNumber: z.ZodNullable<z.ZodNumber>;
|
|
245
|
+
title: z.ZodString;
|
|
246
|
+
sourceRef: z.ZodString;
|
|
247
|
+
targetRef: z.ZodString;
|
|
248
|
+
href: z.ZodString;
|
|
249
|
+
headSha: z.ZodString;
|
|
250
|
+
}, z.core.$strip>>;
|
|
251
|
+
pullRequestOpenError: z.ZodOptional<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
export declare const CreatePullRequestResponseSchema: z.ZodObject<{
|
|
254
|
+
created: z.ZodBoolean;
|
|
255
|
+
plan: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
256
|
+
ready: z.ZodLiteral<true>;
|
|
257
|
+
repo: z.ZodString;
|
|
258
|
+
sourceRef: z.ZodString;
|
|
259
|
+
title: z.ZodString;
|
|
260
|
+
description: z.ZodString;
|
|
261
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
262
|
+
ready: z.ZodLiteral<false>;
|
|
263
|
+
reason: z.ZodString;
|
|
264
|
+
}, z.core.$strip>], "ready">;
|
|
265
|
+
item: z.ZodObject<{
|
|
266
|
+
id: z.ZodString;
|
|
267
|
+
issueNumber: z.ZodNullable<z.ZodNumber>;
|
|
268
|
+
title: z.ZodString;
|
|
269
|
+
sourceRef: z.ZodString;
|
|
270
|
+
targetRef: z.ZodString;
|
|
271
|
+
href: z.ZodString;
|
|
272
|
+
headSha: z.ZodString;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
}, z.core.$strip>;
|
|
275
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/schemas/responses.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAsB5B,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBK,CAAC;AAElD,kDAAkD;AAClD,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAwD,CAAC;AAErG,qCAAqC;AACrC,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAkE,CAAC;AAE7G,gFAAgF;AAChF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;iBAAkD,CAAC;AAEzF,eAAO,MAAM,wBAAwB;;;;;;;;;;iBAUK,CAAC;AAuB3C,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;iBAQK,CAAC;AAE3C,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;iBAIK,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Sessions API Client — response schemas.
|
|
3
|
+
*
|
|
4
|
+
* Every platform answer the client returns is parsed here, at the I/O
|
|
5
|
+
* boundary, before a caller sees it: a 200 whose body is not the declared
|
|
6
|
+
* shape becomes a typed refusal instead of an unchecked value. Each schema is
|
|
7
|
+
* bound to its declared type with `satisfies`, so the wire contract and the
|
|
8
|
+
* public type cannot drift apart.
|
|
9
|
+
*/
|
|
10
|
+
import * as z from 'zod/v4';
|
|
11
|
+
import { preparedCodeSessionSchema } from "./preparation.js";
|
|
12
|
+
import { CodeSessionRuntimeConfigSchema, SessionHostTargetSchema } from '@vibesdotdev/agent-execution/code-session';
|
|
13
|
+
import { VibesLinkSchema } from '@vibesdotdev/shared/schemas';
|
|
14
|
+
const CodeSessionSeedSchema = z.object({
|
|
15
|
+
source: z.string(),
|
|
16
|
+
title: z.string(),
|
|
17
|
+
ref: z.string().optional(),
|
|
18
|
+
body: z.string().optional()
|
|
19
|
+
});
|
|
20
|
+
export const PlatformCodeSessionRecordSchema = z.object({
|
|
21
|
+
sessionId: z.string().min(1),
|
|
22
|
+
repositoryId: z.string().nullable(),
|
|
23
|
+
repositoryName: z.string().nullable(),
|
|
24
|
+
ephemeral: z.boolean().optional(),
|
|
25
|
+
hostTarget: SessionHostTargetSchema,
|
|
26
|
+
runtimeConfig: CodeSessionRuntimeConfigSchema,
|
|
27
|
+
status: z.enum(['initializing', 'active', 'error', 'ended']),
|
|
28
|
+
statusReason: z.string().optional(),
|
|
29
|
+
previewUrl: z.string().nullable(),
|
|
30
|
+
workspacePath: z.string(),
|
|
31
|
+
checkoutRef: z.string().nullable(),
|
|
32
|
+
ownerType: z.enum(['user', 'organization']),
|
|
33
|
+
ownerId: z.string(),
|
|
34
|
+
createdAt: z.string(),
|
|
35
|
+
lastActivityAt: z.string(),
|
|
36
|
+
lastMeteredAt: z.string().optional(),
|
|
37
|
+
seed: CodeSessionSeedSchema.optional(),
|
|
38
|
+
links: z.array(VibesLinkSchema).optional()
|
|
39
|
+
});
|
|
40
|
+
/** `{ result: record }`: get, create and link. */
|
|
41
|
+
export const CodeSessionRecordEnvelopeSchema = z.object({ result: PlatformCodeSessionRecordSchema });
|
|
42
|
+
/** `{ results: record[] }`: list. */
|
|
43
|
+
export const CodeSessionListEnvelopeSchema = z.object({ results: z.array(PlatformCodeSessionRecordSchema) });
|
|
44
|
+
/** `{ result }`: prepare's envelope; the result is parsed by its own schema. */
|
|
45
|
+
export const PreparationEnvelopeSchema = z.object({ result: preparedCodeSessionSchema });
|
|
46
|
+
export const RunCommandResponseSchema = z.object({
|
|
47
|
+
sessionId: z.string(),
|
|
48
|
+
command: z.array(z.string()),
|
|
49
|
+
exitCode: z.number().int().nullable(),
|
|
50
|
+
stdout: z.string(),
|
|
51
|
+
stderr: z.string(),
|
|
52
|
+
timedOut: z.boolean(),
|
|
53
|
+
durationMs: z.number(),
|
|
54
|
+
startedAt: z.string(),
|
|
55
|
+
endedAt: z.string()
|
|
56
|
+
});
|
|
57
|
+
const PullRequestPlanSchema = z.discriminatedUnion('ready', [
|
|
58
|
+
z.object({
|
|
59
|
+
ready: z.literal(true),
|
|
60
|
+
repo: z.string(),
|
|
61
|
+
sourceRef: z.string(),
|
|
62
|
+
title: z.string(),
|
|
63
|
+
description: z.string()
|
|
64
|
+
}),
|
|
65
|
+
z.object({ ready: z.literal(false), reason: z.string() })
|
|
66
|
+
]);
|
|
67
|
+
const PullRequestItemSchema = z.object({
|
|
68
|
+
id: z.string(),
|
|
69
|
+
issueNumber: z.number().int().nullable(),
|
|
70
|
+
title: z.string(),
|
|
71
|
+
sourceRef: z.string(),
|
|
72
|
+
targetRef: z.string(),
|
|
73
|
+
href: z.string(),
|
|
74
|
+
headSha: z.string()
|
|
75
|
+
});
|
|
76
|
+
export const PushBranchResponseSchema = z.object({
|
|
77
|
+
pushed: z.boolean(),
|
|
78
|
+
repository: z.string(),
|
|
79
|
+
branch: z.string(),
|
|
80
|
+
headSha: z.string().optional(),
|
|
81
|
+
pullRequest: PullRequestPlanSchema,
|
|
82
|
+
pullRequestItem: PullRequestItemSchema.optional(),
|
|
83
|
+
pullRequestOpenError: z.string().optional()
|
|
84
|
+
});
|
|
85
|
+
export const CreatePullRequestResponseSchema = z.object({
|
|
86
|
+
created: z.boolean(),
|
|
87
|
+
plan: PullRequestPlanSchema,
|
|
88
|
+
item: PullRequestItemSchema
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/schemas/responses.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,8BAA8B,EAC9B,uBAAuB,EACvB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAS9D,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,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,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,qBAAqB;IAClC,eAAe,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IACjD,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAyC,CAAC;AAE3C,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,qBAAqB;CAC3B,CAAgD,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ActionResult } from '@sveltejs/kit';
|
|
2
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
3
|
+
import type { CodeSessionCreateInput, CodeSessionSeed } from '@vibesdotdev/code-sessions/api';
|
|
4
|
+
export type CodeSessionActionFetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
5
|
+
/** SvelteKit's `deserialize` from `$app/forms`: the serialized `ActionResult` a route action answered. */
|
|
6
|
+
export type CodeSessionActionDeserializer = (text: string) => ActionResult;
|
|
7
|
+
export interface SubmitCodeSessionActionOptions {
|
|
8
|
+
action?: string;
|
|
9
|
+
fallbackMessage?: string;
|
|
10
|
+
messageFields?: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
export type SubmitCodeSessionActionOutcome = {
|
|
13
|
+
ok: true;
|
|
14
|
+
status: number;
|
|
15
|
+
data?: unknown;
|
|
16
|
+
sessionId?: string;
|
|
17
|
+
redirectLocation?: string;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
status: number;
|
|
21
|
+
message: string;
|
|
22
|
+
data?: unknown;
|
|
23
|
+
resultType?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The typed reason the response could not be read as an action
|
|
26
|
+
* result (`INTERNAL` / `action-response-unreadable`, the read failure
|
|
27
|
+
* as `cause`). Absent when the action itself answered.
|
|
28
|
+
*/
|
|
29
|
+
failure?: CapabilityError;
|
|
30
|
+
};
|
|
31
|
+
export declare function createCodeSessionActionFormData(input: CodeSessionCreateInput): FormData;
|
|
32
|
+
/**
|
|
33
|
+
* Read the seed back off an action FormData. The parser lives beside the
|
|
34
|
+
* serializer deliberately: the two are one contract, and a server route
|
|
35
|
+
* hand-rolling `JSON.parse(data.get('seed'))` is how the shapes drift apart.
|
|
36
|
+
*
|
|
37
|
+
* Absent seed → `undefined`; sessions without an originating record are normal.
|
|
38
|
+
* PRESENT BUT MALFORMED → throws. A caller that sent a seed meant to attach one,
|
|
39
|
+
* and silently dropping it would mint an untraceable session while reporting
|
|
40
|
+
* success — the same failure class as forgetting to serialize it.
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseCodeSessionSeedFormValue(value: FormDataEntryValue | null | undefined): CodeSessionSeed | undefined;
|
|
43
|
+
export declare function deleteCodeSessionActionFormData(sessionId: string): FormData;
|
|
44
|
+
export declare function submitCodeSessionCreateAction(fetcher: CodeSessionActionFetcher, deserialize: CodeSessionActionDeserializer, input: CodeSessionCreateInput, options?: SubmitCodeSessionActionOptions): Promise<SubmitCodeSessionActionOutcome>;
|
|
45
|
+
/**
|
|
46
|
+
* Form body for publishing a session's branch.
|
|
47
|
+
*
|
|
48
|
+
* `branch` is optional and OMITTED when blank rather than sent empty: the server
|
|
49
|
+
* treats an absent branch as "use whatever the session is actually on", which is
|
|
50
|
+
* the right default and the only thing a caller can honestly say without reading
|
|
51
|
+
* the workspace. Sending `branch=''` would look like a deliberate choice of a
|
|
52
|
+
* branch named nothing.
|
|
53
|
+
*/
|
|
54
|
+
export declare function publishCodeSessionActionFormData(branch?: string): FormData;
|
|
55
|
+
/**
|
|
56
|
+
* Publish the session's branch through the surface's own `?/publish` action.
|
|
57
|
+
*
|
|
58
|
+
* A refused push — protected branch, non-fast-forward, a lapsed entitlement — is
|
|
59
|
+
* an ordinary outcome with a message worth reading, not an exception. It comes
|
|
60
|
+
* back as `{ok: false, message}` like every other action here, so the surface
|
|
61
|
+
* shows it instead of replacing the page the person was watching.
|
|
62
|
+
*/
|
|
63
|
+
export declare function submitCodeSessionPublishAction(fetcher: CodeSessionActionFetcher, deserialize: CodeSessionActionDeserializer, branch?: string, options?: SubmitCodeSessionActionOptions): Promise<SubmitCodeSessionActionOutcome>;
|
|
64
|
+
/**
|
|
65
|
+
* Open a forge PR from the published session branch via `?/createPullRequest`.
|
|
66
|
+
* Title/body/head are re-planned on the platform — not invented by the form.
|
|
67
|
+
*/
|
|
68
|
+
export declare function submitCodeSessionCreatePullRequestAction(fetcher: CodeSessionActionFetcher, deserialize: CodeSessionActionDeserializer, options?: SubmitCodeSessionActionOptions): Promise<SubmitCodeSessionActionOutcome>;
|
|
69
|
+
export declare function submitCodeSessionDeleteAction(fetcher: CodeSessionActionFetcher, deserialize: CodeSessionActionDeserializer, sessionId: string, options?: SubmitCodeSessionActionOptions): Promise<SubmitCodeSessionActionOutcome>;
|
|
70
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/svelte/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAA2C,MAAM,qBAAqB,CAAC;AAG/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