@nyte-ai/schema 0.0.0-stage → 0.0.19

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.
Files changed (148) hide show
  1. package/LICENSE +21 -0
  2. package/THIRD-PARTY-NOTICES.md +866 -0
  3. package/dist/chunks/browser-0byq2fja.js +50 -0
  4. package/dist/chunks/browser-0chm3654.js +125 -0
  5. package/dist/chunks/browser-0g0z3617.js +47 -0
  6. package/dist/chunks/browser-0khex2b1.js +33 -0
  7. package/dist/chunks/browser-0sbkxgkx.js +115 -0
  8. package/dist/chunks/browser-0xr6c36r.js +106 -0
  9. package/dist/chunks/browser-1nqahr9q.js +239 -0
  10. package/dist/chunks/browser-1sfp0bcx.js +73 -0
  11. package/dist/chunks/browser-3exd93gm.js +50 -0
  12. package/dist/chunks/browser-40enyw9r.js +75 -0
  13. package/dist/chunks/browser-4et7qtz3.js +7 -0
  14. package/dist/chunks/browser-6e1madxa.js +83 -0
  15. package/dist/chunks/browser-6yby604e.js +96 -0
  16. package/dist/chunks/browser-7195qf3t.js +14 -0
  17. package/dist/chunks/browser-8ancsy4m.js +118 -0
  18. package/dist/chunks/browser-9ystjh78.js +0 -0
  19. package/dist/chunks/browser-b519jtez.js +102 -0
  20. package/dist/chunks/browser-bg1esaw0.js +82 -0
  21. package/dist/chunks/browser-ebr6k189.js +120 -0
  22. package/dist/chunks/browser-ekbecx9r.js +73 -0
  23. package/dist/chunks/browser-fd3accdr.js +159 -0
  24. package/dist/chunks/browser-g5khdcap.js +170 -0
  25. package/dist/chunks/browser-h5k4hqfq.js +244 -0
  26. package/dist/chunks/browser-h86zs54a.js +65 -0
  27. package/dist/chunks/browser-hp9ze9ga.js +185 -0
  28. package/dist/chunks/browser-hq5q56sf.js +79 -0
  29. package/dist/chunks/browser-j150etqf.js +101 -0
  30. package/dist/chunks/browser-j629a6wa.js +17 -0
  31. package/dist/chunks/browser-jgxe05s4.js +301 -0
  32. package/dist/chunks/browser-k20f6cvv.js +0 -0
  33. package/dist/chunks/browser-m0wzr0g8.js +5 -0
  34. package/dist/chunks/browser-mzfc0v5j.js +58 -0
  35. package/dist/chunks/browser-p691tcac.js +139 -0
  36. package/dist/chunks/browser-pdv675va.js +135 -0
  37. package/dist/chunks/browser-pvfshqyk.js +36 -0
  38. package/dist/chunks/browser-qkxe0fwp.js +6 -0
  39. package/dist/chunks/browser-qncc807c.js +66 -0
  40. package/dist/chunks/browser-r87w64mz.js +32 -0
  41. package/dist/chunks/browser-s2xe7c21.js +82 -0
  42. package/dist/chunks/browser-sgst60b0.js +293 -0
  43. package/dist/chunks/browser-sgwxbek9.js +37 -0
  44. package/dist/chunks/browser-v70eq512.js +215 -0
  45. package/dist/chunks/browser-vzc3r2r3.js +64 -0
  46. package/dist/chunks/browser-xensz05x.js +172 -0
  47. package/dist/chunks/browser-ynj8v9ad.js +35 -0
  48. package/dist/chunks/browser-ypez6s7v.js +52 -0
  49. package/dist/src/browser.d.ts +64 -0
  50. package/dist/src/browser.js +26 -0
  51. package/dist/src/configuration.d.ts +26 -0
  52. package/dist/src/configuration.js +17 -0
  53. package/dist/src/connection.d.ts +189 -0
  54. package/dist/src/connection.js +35 -0
  55. package/dist/src/declaration.d.ts +12 -0
  56. package/dist/src/declaration.js +1 -0
  57. package/dist/src/errors.d.ts +56 -0
  58. package/dist/src/errors.js +23 -0
  59. package/dist/src/events.d.ts +1752 -0
  60. package/dist/src/events.js +36 -0
  61. package/dist/src/files.d.ts +130 -0
  62. package/dist/src/files.js +49 -0
  63. package/dist/src/git.d.ts +280 -0
  64. package/dist/src/git.js +66 -0
  65. package/dist/src/github.d.ts +174 -0
  66. package/dist/src/github.js +31 -0
  67. package/dist/src/heads.d.ts +255 -0
  68. package/dist/src/heads.js +48 -0
  69. package/dist/src/hooks.d.ts +201 -0
  70. package/dist/src/hooks.js +28 -0
  71. package/dist/src/host.d.ts +137 -0
  72. package/dist/src/host.js +49 -0
  73. package/dist/src/ids.d.ts +66 -0
  74. package/dist/src/ids.js +67 -0
  75. package/dist/src/index.d.ts +30 -0
  76. package/dist/src/index.js +783 -0
  77. package/dist/src/jobs.d.ts +152 -0
  78. package/dist/src/jobs.js +34 -0
  79. package/dist/src/json.d.ts +24 -0
  80. package/dist/src/json.js +21 -0
  81. package/dist/src/mcp.d.ts +212 -0
  82. package/dist/src/mcp.js +34 -0
  83. package/dist/src/messages.d.ts +114 -0
  84. package/dist/src/messages.js +28 -0
  85. package/dist/src/model/index.d.ts +6 -0
  86. package/dist/src/model/index.js +61 -0
  87. package/dist/src/model/message.d.ts +178 -0
  88. package/dist/src/model/message.js +7 -0
  89. package/dist/src/model/model.d.ts +154 -0
  90. package/dist/src/model/model.js +11 -0
  91. package/dist/src/model/text.d.ts +6 -0
  92. package/dist/src/model/text.js +10 -0
  93. package/dist/src/model/tool.d.ts +36 -0
  94. package/dist/src/model/tool.js +1 -0
  95. package/dist/src/model/transcript.d.ts +34 -0
  96. package/dist/src/model/transcript.js +37 -0
  97. package/dist/src/model/typed.d.ts +6 -0
  98. package/dist/src/model/typed.js +8 -0
  99. package/dist/src/models.d.ts +198 -0
  100. package/dist/src/models.js +47 -0
  101. package/dist/src/parts.d.ts +364 -0
  102. package/dist/src/parts.js +35 -0
  103. package/dist/src/patch.d.ts +21 -0
  104. package/dist/src/patch.js +11 -0
  105. package/dist/src/plugins.d.ts +36 -0
  106. package/dist/src/plugins.js +9 -0
  107. package/dist/src/primitives.d.ts +83 -0
  108. package/dist/src/primitives.js +26 -0
  109. package/dist/src/runs.d.ts +433 -0
  110. package/dist/src/runs.js +39 -0
  111. package/dist/src/schema.d.ts +14 -0
  112. package/dist/src/schema.js +8 -0
  113. package/dist/src/serial.d.ts +18 -0
  114. package/dist/src/serial.js +39 -0
  115. package/dist/src/sessions.d.ts +578 -0
  116. package/dist/src/sessions.js +74 -0
  117. package/dist/src/store.d.ts +830 -0
  118. package/dist/src/store.js +33 -0
  119. package/dist/src/tools.d.ts +76 -0
  120. package/dist/src/tools.js +24 -0
  121. package/dist/src/views.d.ts +3105 -0
  122. package/dist/src/views.js +50 -0
  123. package/dist/src/wire/base64.d.ts +2 -0
  124. package/dist/src/wire/base64.js +6 -0
  125. package/dist/src/wire/nullable.d.ts +2 -0
  126. package/dist/src/wire/nullable.js +6 -0
  127. package/dist/src/wire/operations/browser.d.ts +535 -0
  128. package/dist/src/wire/operations/browser.js +12 -0
  129. package/dist/src/wire/operations/fields.d.ts +54 -0
  130. package/dist/src/wire/operations/fields.js +30 -0
  131. package/dist/src/wire/operations/files.d.ts +244 -0
  132. package/dist/src/wire/operations/files.js +13 -0
  133. package/dist/src/wire/operations/git.d.ts +513 -0
  134. package/dist/src/wire/operations/git.js +15 -0
  135. package/dist/src/wire/operations/github.d.ts +172 -0
  136. package/dist/src/wire/operations/github.js +12 -0
  137. package/dist/src/wire/operations/host.d.ts +1031 -0
  138. package/dist/src/wire/operations/host.js +27 -0
  139. package/dist/src/wire/operations/index.d.ts +7103 -0
  140. package/dist/src/wire/operations/index.js +40 -0
  141. package/dist/src/wire/operations/session.d.ts +3779 -0
  142. package/dist/src/wire/operations/session.js +25 -0
  143. package/dist/src/wire/operations/workspace.d.ts +842 -0
  144. package/dist/src/wire/operations/workspace.js +24 -0
  145. package/dist/src/workspaces.d.ts +119 -0
  146. package/dist/src/workspaces.js +38 -0
  147. package/package.json +51 -3
  148. package/README.md +0 -3
@@ -0,0 +1,239 @@
1
+ import {
2
+ standard2
3
+ } from "./browser-vzc3r2r3.js";
4
+ import {
5
+ JsonType2,
6
+ withJson2
7
+ } from "./browser-sgwxbek9.js";
8
+ import {
9
+ idSchema2,
10
+ SeqType2
11
+ } from "./browser-ypez6s7v.js";
12
+ import {
13
+ nullable2
14
+ } from "./browser-4et7qtz3.js";
15
+ import {
16
+ UsageType2,
17
+ ContextViewType2
18
+ } from "./browser-0sbkxgkx.js";
19
+ import {
20
+ ConfigurationType2
21
+ } from "./browser-ynj8v9ad.js";
22
+ import {
23
+ FailureType2
24
+ } from "./browser-1sfp0bcx.js";
25
+ import {
26
+ FileChangeType2
27
+ } from "./browser-ebr6k189.js";
28
+ import {
29
+ DeliveryType2,
30
+ UserContentType2,
31
+ MessageSourceType2,
32
+ ScheduleType2
33
+ } from "./browser-hq5q56sf.js";
34
+ import {
35
+ RunViewType2,
36
+ RunEndType2,
37
+ WaitTargetType2,
38
+ BackgroundItemType2
39
+ } from "./browser-8ancsy4m.js";
40
+ import {
41
+ ToolOutcomeType2,
42
+ ToolProgressType2
43
+ } from "./browser-h86zs54a.js";
44
+ import {
45
+ PlacementType2
46
+ } from "./browser-j150etqf.js";
47
+ import {
48
+ ActivationType2
49
+ } from "./browser-bg1esaw0.js";
50
+ import {
51
+ SessionInfoType2,
52
+ SessionCatalogViewType2
53
+ } from "./browser-xensz05x.js";
54
+
55
+ // src/events.ts
56
+ import { Type } from "typebox";
57
+ var CHANGES = nullable2(Type.Object({ added: Type.Number(), removed: Type.Number(), paths: Type.Array(Type.String()) }));
58
+ var REPLACED = nullable2(Type.Object({ previous: idSchema2(), stopped: nullable2(idSchema2()) }));
59
+ var CommitBodyType2 = Type.Union([
60
+ Type.Object({
61
+ kind: Type.Literal("user"),
62
+ message: idSchema2(),
63
+ content: UserContentType2,
64
+ source: MessageSourceType2,
65
+ delivery: DeliveryType2,
66
+ siblings: Type.Array(idSchema2())
67
+ }),
68
+ Type.Object({ kind: Type.Literal("part"), part: idSchema2() }),
69
+ Type.Object({
70
+ kind: Type.Literal("compaction"),
71
+ part: idSchema2(),
72
+ replaces: Type.Array(idSchema2())
73
+ }),
74
+ Type.Object({
75
+ kind: Type.Literal("branchSummary"),
76
+ part: idSchema2(),
77
+ replaces: Type.Array(idSchema2())
78
+ })
79
+ ]);
80
+ var INPUT = { kind: Type.Literal("input"), message: idSchema2() };
81
+ var RUN = { kind: Type.Literal("run"), run: idSchema2() };
82
+ var PART = { kind: Type.Literal("part"), part: idSchema2() };
83
+ var CALL = { kind: Type.Literal("call"), call: idSchema2(), part: idSchema2() };
84
+ var PATCH = { kind: Type.Literal("patch"), part: idSchema2() };
85
+ function durableEvent(common) {
86
+ return Type.Union([
87
+ Type.Object({
88
+ ...common,
89
+ kind: Type.Literal("commit"),
90
+ id: idSchema2(),
91
+ parent: nullable2(idSchema2()),
92
+ run: nullable2(idSchema2()),
93
+ body: CommitBodyType2
94
+ }),
95
+ Type.Object({
96
+ ...common,
97
+ kind: Type.Literal("head"),
98
+ from: nullable2(idSchema2()),
99
+ to: nullable2(idSchema2()),
100
+ reason: Type.Enum(["moved", "merged", "created", "removed"])
101
+ }),
102
+ Type.Object({
103
+ ...common,
104
+ kind: Type.Literal("seen"),
105
+ principal: idSchema2(),
106
+ commit: nullable2(idSchema2())
107
+ }),
108
+ Type.Object({
109
+ ...common,
110
+ ...INPUT,
111
+ change: Type.Literal("admitted"),
112
+ content: UserContentType2,
113
+ source: MessageSourceType2,
114
+ delivery: DeliveryType2,
115
+ schedule: ScheduleType2,
116
+ covered: Type.Boolean(),
117
+ configuration: ConfigurationType2,
118
+ replaced: REPLACED,
119
+ requires: Type.Optional(Type.Array(Type.String()))
120
+ }),
121
+ Type.Object({
122
+ ...common,
123
+ ...INPUT,
124
+ change: Type.Literal("scheduled"),
125
+ schedule: ScheduleType2,
126
+ position: Type.Number()
127
+ }),
128
+ Type.Object({
129
+ ...common,
130
+ ...INPUT,
131
+ change: Type.Literal("landed"),
132
+ commit: idSchema2(),
133
+ run: nullable2(idSchema2())
134
+ }),
135
+ Type.Object({ ...common, ...INPUT, change: Type.Literal("withdrawn") }),
136
+ Type.Object({
137
+ ...common,
138
+ ...INPUT,
139
+ change: Type.Literal("superseded"),
140
+ by: idSchema2()
141
+ }),
142
+ Type.Object({ ...common, ...RUN, change: Type.Literal("started"), view: RunViewType2 }),
143
+ Type.Object({
144
+ ...common,
145
+ ...RUN,
146
+ change: Type.Literal("phase"),
147
+ phase: Type.Enum(["responding", "executing"])
148
+ }),
149
+ Type.Object({ ...common, ...RUN, change: Type.Literal("waiting"), on: WaitTargetType2 }),
150
+ Type.Object({
151
+ ...common,
152
+ ...RUN,
153
+ change: Type.Literal("retrying"),
154
+ attempt: Type.Number(),
155
+ until: Type.Number(),
156
+ reason: Type.String()
157
+ }),
158
+ Type.Object({ ...common, ...RUN, change: Type.Literal("stopping") }),
159
+ Type.Object({ ...common, ...RUN, change: Type.Literal("ended"), end: RunEndType2 }),
160
+ Type.Object({
161
+ ...common,
162
+ ...PART,
163
+ change: Type.Literal("created"),
164
+ partKind: Type.String(),
165
+ placement: PlacementType2,
166
+ state: JsonType2,
167
+ version: Type.Number(),
168
+ run: nullable2(idSchema2()),
169
+ owner: nullable2(Type.String())
170
+ }),
171
+ Type.Object({
172
+ ...common,
173
+ ...PART,
174
+ change: Type.Literal("updated"),
175
+ state: JsonType2,
176
+ version: Type.Number()
177
+ }),
178
+ Type.Object({ ...common, ...PART, change: Type.Literal("waiting"), call: idSchema2() }),
179
+ Type.Object({
180
+ ...common,
181
+ ...PART,
182
+ change: Type.Literal("settled"),
183
+ commit: idSchema2(),
184
+ endedAt: Type.Number()
185
+ }),
186
+ Type.Object({ ...common, ...PART, change: Type.Literal("failed"), failure: FailureType2 }),
187
+ Type.Object({
188
+ ...common,
189
+ ...PART,
190
+ change: Type.Literal("answered"),
191
+ answer: Type.Object({ action: Type.String(), input: JsonType2 })
192
+ }),
193
+ Type.Object({ ...common, ...PART, change: Type.Literal("closed") }),
194
+ Type.Object({ ...common, ...CALL, change: Type.Literal("intent") }),
195
+ Type.Object({ ...common, ...CALL, change: Type.Literal("waiting"), on: WaitTargetType2 }),
196
+ Type.Object({
197
+ ...common,
198
+ ...CALL,
199
+ change: Type.Literal("settled"),
200
+ outcome: ToolOutcomeType2,
201
+ changes: CHANGES
202
+ }),
203
+ Type.Object({ ...common, kind: Type.Literal("background"), item: BackgroundItemType2 }),
204
+ Type.Object({
205
+ ...common,
206
+ kind: Type.Literal("configured"),
207
+ selected: nullable2(ConfigurationType2),
208
+ effective: nullable2(ConfigurationType2)
209
+ }),
210
+ Type.Object({
211
+ ...common,
212
+ kind: Type.Literal("request"),
213
+ usage: UsageType2,
214
+ context: ContextViewType2,
215
+ step: Type.Enum(["assistant", "compaction", "summary", "plugin"])
216
+ }),
217
+ Type.Object({ ...common, kind: Type.Literal("changes"), files: Type.Array(FileChangeType2) }),
218
+ Type.Object({ ...common, kind: Type.Literal("session"), info: SessionInfoType2 }),
219
+ Type.Object({ ...common, kind: Type.Literal("activation"), activation: ActivationType2 }),
220
+ Type.Object({ ...common, kind: Type.Literal("catalog"), catalog: SessionCatalogViewType2 })
221
+ ]);
222
+ }
223
+ var DurableEventType2 = durableEvent({ head: nullable2(idSchema2()) });
224
+ var SessionEventType2 = durableEvent({
225
+ seq: SeqType2,
226
+ at: Type.Number(),
227
+ head: nullable2(idSchema2())
228
+ });
229
+ var PatchEventType2 = Type.Union([
230
+ Type.Object({ ...PATCH, append: Type.String() }),
231
+ Type.Object({ ...PATCH, markdown: Type.String() }),
232
+ Type.Object({ ...PATCH, progress: ToolProgressType2 })
233
+ ]);
234
+ var CommitBodySchema2 = standard2(CommitBodyType2);
235
+ var DurableEventSchema2 = standard2(withJson2(DurableEventType2));
236
+ var SessionEventSchema2 = standard2(withJson2(SessionEventType2));
237
+ var PatchEventSchema2 = standard2(withJson2(PatchEventType2));
238
+
239
+ export { CommitBodyType2, DurableEventType2, SessionEventType2, PatchEventType2, CommitBodySchema2, DurableEventSchema2, SessionEventSchema2, PatchEventSchema2 };
@@ -0,0 +1,73 @@
1
+ import {
2
+ standard2
3
+ } from "./browser-vzc3r2r3.js";
4
+ import {
5
+ idSchema2
6
+ } from "./browser-ypez6s7v.js";
7
+ import {
8
+ nullable2
9
+ } from "./browser-4et7qtz3.js";
10
+
11
+ // src/errors.ts
12
+ import { Type } from "typebox";
13
+ var ValidationIssueType2 = Type.Object({
14
+ severity: Type.Enum(["error", "warning"]),
15
+ path: Type.Array(Type.Union([Type.String(), Type.Number()])),
16
+ message: Type.String(),
17
+ source: Type.Optional(Type.Object({
18
+ plugin: Type.String(),
19
+ file: Type.Optional(Type.String()),
20
+ line: Type.Optional(Type.Number())
21
+ }))
22
+ });
23
+ var FailureClassType2 = Type.Enum([
24
+ "rate_limit",
25
+ "auth",
26
+ "quota",
27
+ "context_window",
28
+ "overloaded",
29
+ "network",
30
+ "aborted",
31
+ "provider",
32
+ "runner"
33
+ ]);
34
+ var FailureType2 = Type.Object({
35
+ class: FailureClassType2,
36
+ message: Type.String(),
37
+ retryAfterMs: Type.Optional(Type.Number())
38
+ });
39
+ var SdkErrorWireType2 = Type.Object({
40
+ code: Type.Enum([
41
+ "unauthenticated",
42
+ "denied",
43
+ "unknown",
44
+ "invalid",
45
+ "stale",
46
+ "unavailable",
47
+ "internal"
48
+ ]),
49
+ message: Type.String(),
50
+ hostId: nullable2(idSchema2()),
51
+ issues: Type.Array(ValidationIssueType2),
52
+ correlation: nullable2(Type.String())
53
+ });
54
+
55
+ class SdkError2 extends Error {
56
+ name = "SdkError";
57
+ code;
58
+ hostId;
59
+ issues;
60
+ correlation;
61
+ constructor(code, message, options) {
62
+ super(message);
63
+ this.code = code;
64
+ this.hostId = options?.hostId ?? null;
65
+ this.issues = options?.issues ?? [];
66
+ this.correlation = options?.correlation ?? null;
67
+ }
68
+ }
69
+ var ValidationIssueSchema2 = standard2(ValidationIssueType2);
70
+ var FailureSchema2 = standard2(FailureType2);
71
+ var SdkErrorWireSchema2 = standard2(SdkErrorWireType2);
72
+
73
+ export { ValidationIssueType2, FailureClassType2, FailureType2, SdkErrorWireType2, SdkError2, ValidationIssueSchema2, FailureSchema2, SdkErrorWireSchema2 };
@@ -0,0 +1,50 @@
1
+ import {
2
+ standard2
3
+ } from "./browser-vzc3r2r3.js";
4
+ import {
5
+ withJson2
6
+ } from "./browser-sgwxbek9.js";
7
+ import {
8
+ idSchema2,
9
+ SeqType2
10
+ } from "./browser-ypez6s7v.js";
11
+ import {
12
+ nullable2
13
+ } from "./browser-4et7qtz3.js";
14
+ import {
15
+ DurableEventType2
16
+ } from "./browser-1nqahr9q.js";
17
+
18
+ // src/store.ts
19
+ import { Type } from "typebox";
20
+ var RefType2 = Type.Object({
21
+ name: Type.String(),
22
+ target: nullable2(idSchema2()),
23
+ revision: idSchema2()
24
+ });
25
+ var RefUpdateType2 = Type.Object({
26
+ name: Type.String(),
27
+ target: nullable2(idSchema2()),
28
+ expect: Type.Optional(Type.Union([Type.Literal("absent"), idSchema2()])),
29
+ events: Type.Optional(Type.Array(DurableEventType2)),
30
+ fences: Type.Optional(Type.Array(Type.String()))
31
+ });
32
+ var SetOutcomeType2 = Type.Union([
33
+ Type.Object({
34
+ kind: Type.Literal("set"),
35
+ logged: Type.Array(SeqType2),
36
+ at: Type.Number(),
37
+ revisions: Type.Array(idSchema2())
38
+ }),
39
+ Type.Object({
40
+ kind: Type.Literal("stale"),
41
+ name: Type.String(),
42
+ revision: nullable2(idSchema2())
43
+ }),
44
+ Type.Object({ kind: Type.Literal("fenced"), name: Type.String() })
45
+ ]);
46
+ var RefSchema2 = standard2(RefType2);
47
+ var RefUpdateSchema2 = standard2(withJson2(RefUpdateType2));
48
+ var SetOutcomeSchema2 = standard2(SetOutcomeType2);
49
+
50
+ export { RefType2, RefUpdateType2, SetOutcomeType2, RefSchema2, RefUpdateSchema2, SetOutcomeSchema2 };
@@ -0,0 +1,75 @@
1
+ import {
2
+ standard2
3
+ } from "./browser-vzc3r2r3.js";
4
+ import {
5
+ idSchema2
6
+ } from "./browser-ypez6s7v.js";
7
+ import {
8
+ base64Bytes2
9
+ } from "./browser-m0wzr0g8.js";
10
+ import {
11
+ nullable2
12
+ } from "./browser-4et7qtz3.js";
13
+
14
+ // src/jobs.ts
15
+ import { Type } from "typebox";
16
+ var EndReasonType2 = Type.Enum(["exited", "terminated", "expired", "host-lost"]);
17
+ var JobEndType2 = Type.Union([
18
+ Type.Object({
19
+ kind: Type.Literal("exited"),
20
+ code: nullable2(Type.Number()),
21
+ reason: EndReasonType2
22
+ }),
23
+ Type.Object({ kind: Type.Literal("lost") })
24
+ ]);
25
+ var JobStateType2 = Type.Union([
26
+ Type.Object({ kind: Type.Literal("running") }),
27
+ JobEndType2
28
+ ]);
29
+ var JobViewType2 = Type.Object({
30
+ id: idSchema2(),
31
+ command: Type.String(),
32
+ title: Type.String(),
33
+ session: nullable2(idSchema2()),
34
+ pty: nullable2(Type.Object({ columns: Type.Number(), rows: Type.Number(), shell: Type.String() })),
35
+ state: JobStateType2,
36
+ startedAt: Type.Number(),
37
+ endedAt: nullable2(Type.Number()),
38
+ tail: Type.String()
39
+ });
40
+ var JobMovedType = Type.Object({ kind: Type.Literal("job"), job: JobViewType2 });
41
+ var JobForgottenType = Type.Object({ kind: Type.Literal("forgotten"), id: idSchema2() });
42
+ var JobChangeType2 = Type.Union([JobMovedType, JobForgottenType]);
43
+ var JobsChangeType2 = Type.Union([
44
+ Type.Object({ kind: Type.Literal("jobs"), jobs: Type.Array(JobViewType2) }),
45
+ JobMovedType,
46
+ JobForgottenType
47
+ ]);
48
+ function foldJobChange2(jobs, change) {
49
+ switch (change.kind) {
50
+ case "jobs":
51
+ return change.jobs;
52
+ case "forgotten":
53
+ return jobs.filter((job) => job.id !== change.id);
54
+ case "job": {
55
+ const moved = change.job;
56
+ return jobs.some((job) => job.id === moved.id) ? jobs.map((job) => job.id === moved.id ? moved : job) : [...jobs, moved];
57
+ }
58
+ }
59
+ }
60
+ var OutputFrameType2 = Type.Union([
61
+ Type.Object({
62
+ kind: Type.Literal("bytes"),
63
+ data: base64Bytes2,
64
+ stream: Type.Optional(Type.Literal("stderr"))
65
+ }),
66
+ Type.Object({ kind: Type.Literal("gap") }),
67
+ Type.Object({ kind: Type.Literal("exit"), code: nullable2(Type.Number()) })
68
+ ]);
69
+ var EndReasonSchema2 = standard2(EndReasonType2);
70
+ var JobEndSchema2 = standard2(JobEndType2);
71
+ var JobStateSchema2 = standard2(JobStateType2);
72
+ var JobViewSchema2 = standard2(JobViewType2);
73
+ var OutputFrameSchema2 = standard2(OutputFrameType2);
74
+
75
+ export { EndReasonType2, JobEndType2, JobStateType2, JobViewType2, JobChangeType2, JobsChangeType2, foldJobChange2, OutputFrameType2, EndReasonSchema2, JobEndSchema2, JobStateSchema2, JobViewSchema2, OutputFrameSchema2 };
@@ -0,0 +1,7 @@
1
+ // src/wire/nullable.ts
2
+ import { Type } from "typebox";
3
+ function nullable2(schema) {
4
+ return Type.Union([schema, Type.Null()]);
5
+ }
6
+
7
+ export { nullable2 };
@@ -0,0 +1,83 @@
1
+ import {
2
+ standard2
3
+ } from "./browser-vzc3r2r3.js";
4
+ import {
5
+ idSchema2
6
+ } from "./browser-ypez6s7v.js";
7
+ import {
8
+ nullable2
9
+ } from "./browser-4et7qtz3.js";
10
+ import {
11
+ ValidationIssueType2
12
+ } from "./browser-1sfp0bcx.js";
13
+ import {
14
+ JsonType2,
15
+ withJson2
16
+ } from "./browser-sgwxbek9.js";
17
+
18
+ // src/host.ts
19
+ import { Type } from "typebox";
20
+ var AuthorityType2 = Type.Enum(["participant", "owner", "maintenance"]);
21
+ var ExecutionCoverageType2 = Type.Union([
22
+ Type.Object({ kind: Type.Literal("all") }),
23
+ Type.Object({ kind: Type.Literal("workspace"), workspace: idSchema2() }),
24
+ Type.Object({ kind: Type.Literal("sessions"), sessions: Type.Array(idSchema2()) })
25
+ ]);
26
+ var AdvanceReportType2 = Type.Union([
27
+ Type.Object({ kind: Type.Literal("continue") }),
28
+ Type.Object({ kind: Type.Literal("idle") }),
29
+ Type.Object({ kind: Type.Literal("waiting"), until: nullable2(Type.Number()) }),
30
+ Type.Object({ kind: Type.Literal("retry"), until: Type.Number() }),
31
+ Type.Object({ kind: Type.Literal("busy"), until: Type.Number() }),
32
+ Type.Object({ kind: Type.Literal("fenced") })
33
+ ]);
34
+ var RepairPageType2 = Type.Object({
35
+ runnable: Type.Array(Type.Object({ session: idSchema2(), head: idSchema2() })),
36
+ next: nullable2(idSchema2())
37
+ });
38
+ var PrincipalViewWireType2 = Type.Object({
39
+ id: idSchema2(),
40
+ label: Type.String(),
41
+ authority: Type.Array(AuthorityType2),
42
+ pairedAt: Type.Number()
43
+ });
44
+ var PluginLoadOutcomeType2 = Type.Object({
45
+ kind: Type.Enum(["activated", "rejected", "kept-previous"]),
46
+ id: Type.String(),
47
+ issues: Type.Array(ValidationIssueType2)
48
+ });
49
+ var PluginCheckReportType2 = Type.Object({
50
+ plugins: Type.Array(PluginLoadOutcomeType2),
51
+ collisions: Type.Array(ValidationIssueType2)
52
+ });
53
+ var PluginReplacementReportType2 = Type.Object({
54
+ generation: idSchema2(),
55
+ plugins: Type.Array(PluginLoadOutcomeType2)
56
+ });
57
+ var DecodedObjectViewType2 = Type.Object({
58
+ id: idSchema2(),
59
+ kind: Type.String(),
60
+ parent: nullable2(idSchema2()),
61
+ body: JsonType2,
62
+ at: Type.Number()
63
+ });
64
+ var IntegrityReportType2 = Type.Object({
65
+ ok: Type.Boolean(),
66
+ issues: Type.Array(Type.Object({
67
+ ref: nullable2(Type.String()),
68
+ object: nullable2(idSchema2()),
69
+ message: Type.String()
70
+ }))
71
+ });
72
+ var AuthoritySchema2 = standard2(AuthorityType2);
73
+ var ExecutionCoverageSchema2 = standard2(ExecutionCoverageType2);
74
+ var AdvanceReportSchema2 = standard2(AdvanceReportType2);
75
+ var RepairPageSchema2 = standard2(RepairPageType2);
76
+ var PrincipalViewWireSchema2 = standard2(PrincipalViewWireType2);
77
+ var PluginLoadOutcomeSchema2 = standard2(PluginLoadOutcomeType2);
78
+ var PluginCheckReportSchema2 = standard2(PluginCheckReportType2);
79
+ var PluginReplacementReportSchema2 = standard2(PluginReplacementReportType2);
80
+ var DecodedObjectViewSchema2 = standard2(withJson2(DecodedObjectViewType2));
81
+ var IntegrityReportSchema2 = standard2(IntegrityReportType2);
82
+
83
+ export { AuthorityType2, ExecutionCoverageType2, AdvanceReportType2, RepairPageType2, PrincipalViewWireType2, PluginLoadOutcomeType2, PluginCheckReportType2, PluginReplacementReportType2, DecodedObjectViewType2, IntegrityReportType2, AuthoritySchema2, ExecutionCoverageSchema2, AdvanceReportSchema2, RepairPageSchema2, PrincipalViewWireSchema2, PluginLoadOutcomeSchema2, PluginCheckReportSchema2, PluginReplacementReportSchema2, DecodedObjectViewSchema2, IntegrityReportSchema2 };
@@ -0,0 +1,96 @@
1
+ import {
2
+ nullable2
3
+ } from "./browser-4et7qtz3.js";
4
+
5
+ // src/patch.ts
6
+ import { Type } from "typebox";
7
+ var HunkType2 = Type.Object({
8
+ oldStart: Type.Number(),
9
+ oldLines: Type.Number(),
10
+ newStart: Type.Number(),
11
+ newLines: Type.Number(),
12
+ header: nullable2(Type.String()),
13
+ lines: Type.Array(Type.Object({
14
+ kind: Type.Enum(["context", "add", "remove"]),
15
+ text: Type.String(),
16
+ noNewline: Type.Optional(Type.Literal(true))
17
+ }))
18
+ });
19
+ var HUNK_HEADER = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@ ?(.*)$/;
20
+ var MARKS = { add: "+", remove: "-", context: " " };
21
+ function writePatch2(path, status, hunks) {
22
+ const before = status === "added" || status === "untracked" ? "/dev/null" : `a/${path}`;
23
+ const after = status === "deleted" ? "/dev/null" : `b/${path}`;
24
+ const lines = [`diff --git a/${path} b/${path}`, `--- ${before}`, `+++ ${after}`];
25
+ for (const hunk of hunks) {
26
+ const header = hunk.header === null ? "" : ` ${hunk.header}`;
27
+ lines.push(`@@ -${String(hunk.oldStart)},${String(hunk.oldLines)} +${String(hunk.newStart)},${String(hunk.newLines)} @@${header}`);
28
+ for (const line of hunk.lines) {
29
+ lines.push(`${MARKS[line.kind]}${line.text}`);
30
+ if (line.noNewline === true)
31
+ lines.push("\");
32
+ }
33
+ }
34
+ return `${lines.join(`
35
+ `)}
36
+ `;
37
+ }
38
+ function readHunks2(patch) {
39
+ const lines = patch.split(`
40
+ `);
41
+ if (lines.at(-1) === "")
42
+ lines.pop();
43
+ const hunks = [];
44
+ let index = 0;
45
+ while (index < lines.length) {
46
+ const header = HUNK_HEADER.exec(lines[index] ?? "");
47
+ if (header === null) {
48
+ index += 1;
49
+ continue;
50
+ }
51
+ const oldLines = header[2] === undefined ? 1 : Number(header[2]);
52
+ const newLines = header[4] === undefined ? 1 : Number(header[4]);
53
+ const body = [];
54
+ let oldSeen = 0;
55
+ let newSeen = 0;
56
+ index += 1;
57
+ while (index < lines.length) {
58
+ const line = lines[index] ?? "";
59
+ if (line.startsWith("\\")) {
60
+ const last = body.pop();
61
+ if (last !== undefined)
62
+ body.push({ ...last, noNewline: true });
63
+ index += 1;
64
+ continue;
65
+ }
66
+ if (oldSeen >= oldLines && newSeen >= newLines)
67
+ break;
68
+ const mark = line[0];
69
+ if (mark === "+") {
70
+ body.push({ kind: "add", text: line.slice(1) });
71
+ newSeen += 1;
72
+ } else if (mark === "-") {
73
+ body.push({ kind: "remove", text: line.slice(1) });
74
+ oldSeen += 1;
75
+ } else if (mark === " " || line === "") {
76
+ body.push({ kind: "context", text: line.slice(1) });
77
+ oldSeen += 1;
78
+ newSeen += 1;
79
+ } else
80
+ break;
81
+ index += 1;
82
+ }
83
+ const text = header[5] ?? "";
84
+ hunks.push({
85
+ oldStart: Number(header[1]),
86
+ oldLines,
87
+ newStart: Number(header[3]),
88
+ newLines,
89
+ header: text === "" ? null : text,
90
+ lines: body
91
+ });
92
+ }
93
+ return hunks;
94
+ }
95
+
96
+ export { HunkType2, writePatch2, readHunks2 };
@@ -0,0 +1,14 @@
1
+ import {
2
+ typed2,
3
+ object2
4
+ } from "./browser-qkxe0fwp.js";
5
+
6
+ // src/model/message.ts
7
+ import { Type } from "typebox";
8
+ var TextSignatureV1Schema2 = typed2()(object2({
9
+ v: Type.Literal(1),
10
+ id: Type.String(),
11
+ phase: Type.Optional(Type.Union([Type.Literal("commentary"), Type.Literal("final_answer")]))
12
+ }));
13
+
14
+ export { TextSignatureV1Schema2 };