@nyte-ai/schema 0.0.0-stage → 0.0.18

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 +800 -0
  3. package/dist/chunks/browser-0byq2fja.js +50 -0
  4. package/dist/chunks/browser-0ebnhqs2.js +36 -0
  5. package/dist/chunks/browser-0g0z3617.js +47 -0
  6. package/dist/chunks/browser-0khex2b1.js +33 -0
  7. package/dist/chunks/browser-1sfp0bcx.js +73 -0
  8. package/dist/chunks/browser-40enyw9r.js +75 -0
  9. package/dist/chunks/browser-48g24pes.js +106 -0
  10. package/dist/chunks/browser-4et7qtz3.js +7 -0
  11. package/dist/chunks/browser-5n1dh580.js +66 -0
  12. package/dist/chunks/browser-5pvw8svn.js +243 -0
  13. package/dist/chunks/browser-6e1madxa.js +83 -0
  14. package/dist/chunks/browser-6yby604e.js +96 -0
  15. package/dist/chunks/browser-7195qf3t.js +14 -0
  16. package/dist/chunks/browser-7gjnxy9m.js +172 -0
  17. package/dist/chunks/browser-8t9anqfc.js +113 -0
  18. package/dist/chunks/browser-9ystjh78.js +0 -0
  19. package/dist/chunks/browser-ad9yebg7.js +101 -0
  20. package/dist/chunks/browser-b519jtez.js +102 -0
  21. package/dist/chunks/browser-bg1esaw0.js +82 -0
  22. package/dist/chunks/browser-bxz3z1v6.js +181 -0
  23. package/dist/chunks/browser-e5xgzd28.js +82 -0
  24. package/dist/chunks/browser-ebr6k189.js +120 -0
  25. package/dist/chunks/browser-ekbecx9r.js +73 -0
  26. package/dist/chunks/browser-fd3accdr.js +159 -0
  27. package/dist/chunks/browser-fth801bw.js +50 -0
  28. package/dist/chunks/browser-g5khdcap.js +170 -0
  29. package/dist/chunks/browser-gchr2880.js +135 -0
  30. package/dist/chunks/browser-h86zs54a.js +65 -0
  31. package/dist/chunks/browser-hq5q56sf.js +79 -0
  32. package/dist/chunks/browser-j629a6wa.js +17 -0
  33. package/dist/chunks/browser-k20f6cvv.js +0 -0
  34. package/dist/chunks/browser-m0wzr0g8.js +5 -0
  35. package/dist/chunks/browser-mnejgne0.js +125 -0
  36. package/dist/chunks/browser-mzfc0v5j.js +58 -0
  37. package/dist/chunks/browser-pdv675va.js +135 -0
  38. package/dist/chunks/browser-pdx38ng3.js +301 -0
  39. package/dist/chunks/browser-qkxe0fwp.js +6 -0
  40. package/dist/chunks/browser-r00v3vwv.js +238 -0
  41. package/dist/chunks/browser-r87w64mz.js +32 -0
  42. package/dist/chunks/browser-s7907azt.js +118 -0
  43. package/dist/chunks/browser-sgwxbek9.js +37 -0
  44. package/dist/chunks/browser-v70eq512.js +215 -0
  45. package/dist/chunks/browser-vapnjwp3.js +35 -0
  46. package/dist/chunks/browser-vkh2tpmf.js +283 -0
  47. package/dist/chunks/browser-vzc3r2r3.js +64 -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 +1750 -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 +271 -0
  64. package/dist/src/git.js +64 -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 +779 -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 +195 -0
  100. package/dist/src/models.js +45 -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 +831 -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 +2737 -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 +1011 -0
  138. package/dist/src/wire/operations/host.js +27 -0
  139. package/dist/src/wire/operations/index.d.ts +6703 -0
  140. package/dist/src/wire/operations/index.js +40 -0
  141. package/dist/src/wire/operations/session.d.ts +3411 -0
  142. package/dist/src/wire/operations/session.js +25 -0
  143. package/dist/src/wire/operations/workspace.d.ts +830 -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,195 @@
1
+ import { Type } from "typebox";
2
+ import type { Decoded, Schema } from "./schema.ts";
3
+ export declare const ModelRefType: Type.TObject<{
4
+ provider: Type.TString;
5
+ id: Type.TString;
6
+ }>;
7
+ export type ModelRef = Decoded<typeof ModelRefType>;
8
+ export declare const ThinkingType: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
9
+ export type Thinking = Decoded<typeof ThinkingType>;
10
+ export declare const UsageType: Type.TObject<{
11
+ input: Type.TNumber;
12
+ output: Type.TNumber;
13
+ cacheRead: Type.TNumber;
14
+ cacheWrite: Type.TNumber;
15
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
16
+ total: Type.TNumber;
17
+ cost: Type.TObject<{
18
+ input: Type.TNumber;
19
+ output: Type.TNumber;
20
+ cacheRead: Type.TNumber;
21
+ cacheWrite: Type.TNumber;
22
+ total: Type.TNumber;
23
+ }>;
24
+ }>;
25
+ export type Usage = Decoded<typeof UsageType>;
26
+ export declare const ContextViewType: Type.TObject<{
27
+ tokens: Type.TNumber;
28
+ window: Type.TNumber;
29
+ lastRequest: Type.TUnion<[Type.TObject<{
30
+ input: Type.TNumber;
31
+ output: Type.TNumber;
32
+ cacheRead: Type.TNumber;
33
+ cacheWrite: Type.TNumber;
34
+ reasoning: Type.TUnion<[Type.TNumber, Type.TNull]>;
35
+ total: Type.TNumber;
36
+ cost: Type.TObject<{
37
+ input: Type.TNumber;
38
+ output: Type.TNumber;
39
+ cacheRead: Type.TNumber;
40
+ cacheWrite: Type.TNumber;
41
+ total: Type.TNumber;
42
+ }>;
43
+ }>, Type.TNull]>;
44
+ }>;
45
+ export type ContextView = Decoded<typeof ContextViewType>;
46
+ export declare const LoginMethodType: Type.TUnion<[Type.TObject<{
47
+ kind: Type.TLiteral<"oauth">;
48
+ }>, Type.TObject<{
49
+ kind: Type.TLiteral<"key">;
50
+ }>]>;
51
+ export type LoginMethod = Decoded<typeof LoginMethodType>;
52
+ export declare const ModelAccountType: Type.TObject<{
53
+ provider: Type.TString;
54
+ id: Type.TString;
55
+ label: Type.TString;
56
+ method: Type.TUnion<[Type.TObject<{
57
+ kind: Type.TLiteral<"oauth">;
58
+ }>, Type.TObject<{
59
+ kind: Type.TLiteral<"key">;
60
+ }>]>;
61
+ active: Type.TBoolean;
62
+ }>;
63
+ export type ModelAccount = Decoded<typeof ModelAccountType>;
64
+ export declare const ProviderUsageType: Type.TObject<{
65
+ provider: Type.TString;
66
+ name: Type.TString;
67
+ account: Type.TUnion<[Type.TObject<{
68
+ provider: Type.TString;
69
+ id: Type.TString;
70
+ label: Type.TString;
71
+ method: Type.TUnion<[Type.TObject<{
72
+ kind: Type.TLiteral<"oauth">;
73
+ }>, Type.TObject<{
74
+ kind: Type.TLiteral<"key">;
75
+ }>]>;
76
+ active: Type.TBoolean;
77
+ }>, Type.TNull]>;
78
+ state: Type.TUnion<[Type.TObject<{
79
+ kind: Type.TLiteral<"ready">;
80
+ limits: Type.TArray<Type.TObject<{
81
+ label: Type.TString;
82
+ used: Type.TNumber;
83
+ limit: Type.TNumber;
84
+ resetsAt: Type.TUnion<[Type.TNumber, Type.TNull]>;
85
+ }>>;
86
+ observedAt: Type.TNumber;
87
+ stale: Type.TBoolean;
88
+ error: Type.TUnion<[Type.TString, Type.TNull]>;
89
+ }>, Type.TObject<{
90
+ kind: Type.TLiteral<"unavailable">;
91
+ reason: Type.TEnum<["unsupported", "unconfigured", "failed"]>;
92
+ message: Type.TString;
93
+ }>]>;
94
+ }>;
95
+ export type ProviderUsage = Decoded<typeof ProviderUsageType>;
96
+ /**
97
+ * What a model's runtime does around a turn, for clients to read instead of
98
+ * its provider id: `steer` when a message sent mid-turn reaches it before the
99
+ * turn ends (otherwise it waits for the turn). The inputs it reads are
100
+ * `ModelInfo.input`.
101
+ */
102
+ export declare const ModelCapabilitiesType: Type.TObject<{
103
+ steer: Type.TBoolean;
104
+ }>;
105
+ export type ModelCapabilities = Decoded<typeof ModelCapabilitiesType>;
106
+ export declare const ModelInfoType: Type.TObject<{
107
+ ref: Type.TObject<{
108
+ provider: Type.TString;
109
+ id: Type.TString;
110
+ }>;
111
+ name: Type.TString;
112
+ reasoning: Type.TBoolean;
113
+ thinking: Type.TArray<Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>>;
114
+ /** The level a chat on this model thinks at when it names none. */
115
+ defaultThinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
116
+ fast: Type.TUnion<[Type.TObject<{
117
+ provider: Type.TString;
118
+ id: Type.TString;
119
+ }>, Type.TNull]>;
120
+ contextWindow: Type.TNumber;
121
+ compactAt: Type.TNumber;
122
+ maxOutput: Type.TNumber;
123
+ input: Type.TArray<Type.TEnum<["text", "image"]>>;
124
+ capabilities: Type.TObject<{
125
+ steer: Type.TBoolean;
126
+ }>;
127
+ cost: Type.TObject<{
128
+ input: Type.TNumber;
129
+ output: Type.TNumber;
130
+ cacheRead: Type.TNumber;
131
+ cacheWrite: Type.TNumber;
132
+ }>;
133
+ }>;
134
+ export type ModelInfo = Decoded<typeof ModelInfoType>;
135
+ export declare const ModelCatalogViewType: Type.TObject<{
136
+ generation: Type.TUnsafe<import("./ids.ts").Id<"catalog-generation">>;
137
+ default: Type.TUnion<[Type.TObject<{
138
+ provider: Type.TString;
139
+ id: Type.TString;
140
+ }>, Type.TNull]>;
141
+ providers: Type.TArray<Type.TObject<{
142
+ id: Type.TString;
143
+ name: Type.TString;
144
+ credential: Type.TEnum<["unknown", "missing", "configured", "verified", "failed"]>;
145
+ methods: Type.TArray<Type.TUnion<[Type.TObject<{
146
+ kind: Type.TLiteral<"oauth">;
147
+ }>, Type.TObject<{
148
+ kind: Type.TLiteral<"key">;
149
+ }>]>>;
150
+ limits: Type.TArray<Type.TObject<{
151
+ label: Type.TString;
152
+ used: Type.TNumber;
153
+ limit: Type.TNumber;
154
+ resetsAt: Type.TUnion<[Type.TNumber, Type.TNull]>;
155
+ }>>;
156
+ models: Type.TArray<Type.TObject<{
157
+ ref: Type.TObject<{
158
+ provider: Type.TString;
159
+ id: Type.TString;
160
+ }>;
161
+ name: Type.TString;
162
+ reasoning: Type.TBoolean;
163
+ thinking: Type.TArray<Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>>;
164
+ /** The level a chat on this model thinks at when it names none. */
165
+ defaultThinking: Type.TEnum<["off", "minimal", "low", "medium", "high", "xhigh", "max"]>;
166
+ fast: Type.TUnion<[Type.TObject<{
167
+ provider: Type.TString;
168
+ id: Type.TString;
169
+ }>, Type.TNull]>;
170
+ contextWindow: Type.TNumber;
171
+ compactAt: Type.TNumber;
172
+ maxOutput: Type.TNumber;
173
+ input: Type.TArray<Type.TEnum<["text", "image"]>>;
174
+ capabilities: Type.TObject<{
175
+ steer: Type.TBoolean;
176
+ }>;
177
+ cost: Type.TObject<{
178
+ input: Type.TNumber;
179
+ output: Type.TNumber;
180
+ cacheRead: Type.TNumber;
181
+ cacheWrite: Type.TNumber;
182
+ }>;
183
+ }>>;
184
+ }>>;
185
+ }>;
186
+ export type ModelCatalogView = Decoded<typeof ModelCatalogViewType>;
187
+ export declare const ModelRefSchema: Schema<ModelRef>;
188
+ export declare const ThinkingSchema: Schema<Thinking>;
189
+ export declare const UsageSchema: Schema<Usage>;
190
+ export declare const ContextViewSchema: Schema<ContextView>;
191
+ export declare const LoginMethodSchema: Schema<LoginMethod>;
192
+ export declare const ModelAccountSchema: Schema<ModelAccount>;
193
+ export declare const ProviderUsageSchema: Schema<ProviderUsage>;
194
+ export declare const ModelInfoSchema: Schema<ModelInfo>;
195
+ export declare const ModelCatalogViewSchema: Schema<ModelCatalogView>;
@@ -0,0 +1,45 @@
1
+ import {
2
+ ModelRefType2,
3
+ ThinkingType2,
4
+ UsageType2,
5
+ ContextViewType2,
6
+ LoginMethodType2,
7
+ ModelAccountType2,
8
+ ProviderUsageType2,
9
+ ModelCapabilitiesType2,
10
+ ModelInfoType2,
11
+ ModelCatalogViewType2,
12
+ ModelRefSchema2,
13
+ ThinkingSchema2,
14
+ UsageSchema2,
15
+ ContextViewSchema2,
16
+ LoginMethodSchema2,
17
+ ModelAccountSchema2,
18
+ ProviderUsageSchema2,
19
+ ModelInfoSchema2,
20
+ ModelCatalogViewSchema2
21
+ } from "../chunks/browser-8t9anqfc.js";
22
+ import"../chunks/browser-4et7qtz3.js";
23
+ import"../chunks/browser-ypez6s7v.js";
24
+ import"../chunks/browser-vzc3r2r3.js";
25
+ export {
26
+ ContextViewSchema2 as ContextViewSchema,
27
+ ContextViewType2 as ContextViewType,
28
+ LoginMethodSchema2 as LoginMethodSchema,
29
+ LoginMethodType2 as LoginMethodType,
30
+ ModelAccountSchema2 as ModelAccountSchema,
31
+ ModelAccountType2 as ModelAccountType,
32
+ ModelCapabilitiesType2 as ModelCapabilitiesType,
33
+ ModelCatalogViewSchema2 as ModelCatalogViewSchema,
34
+ ModelCatalogViewType2 as ModelCatalogViewType,
35
+ ModelInfoSchema2 as ModelInfoSchema,
36
+ ModelInfoType2 as ModelInfoType,
37
+ ModelRefSchema2 as ModelRefSchema,
38
+ ModelRefType2 as ModelRefType,
39
+ ProviderUsageSchema2 as ProviderUsageSchema,
40
+ ProviderUsageType2 as ProviderUsageType,
41
+ ThinkingSchema2 as ThinkingSchema,
42
+ ThinkingType2 as ThinkingType,
43
+ UsageSchema2 as UsageSchema,
44
+ UsageType2 as UsageType
45
+ };
@@ -0,0 +1,364 @@
1
+ import { Type } from "typebox";
2
+ import type { TSchema } from "typebox";
3
+ import type { Decoded, Schema } from "./schema.ts";
4
+ export declare const SignatureType: Type.TUnion<[Type.TUnsafe<import("./json.ts").Json>, Type.TNull]>;
5
+ export declare const PlacementType: Type.TUnion<[Type.TObject<{
6
+ kind: Type.TLiteral<"transcript">;
7
+ role: Type.TEnum<["step", "answer", "note"]>;
8
+ }>, Type.TObject<{
9
+ kind: Type.TLiteral<"modal">;
10
+ }>, Type.TIntersect<[Type.TObject<{
11
+ kind: Type.TString;
12
+ }>, Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>]>]>;
13
+ export type Placement = Decoded<typeof PlacementType>;
14
+ export declare const PartStatusType: Type.TUnion<[Type.TObject<{
15
+ kind: Type.TLiteral<"live">;
16
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
17
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
18
+ answer: Type.TOptional<Type.TObject<{
19
+ action: Type.TString;
20
+ input: Type.TUnsafe<import("./json.ts").Json>;
21
+ }>>;
22
+ }>, Type.TObject<{
23
+ kind: Type.TLiteral<"waiting">;
24
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
25
+ on: Type.TUnion<[Type.TObject<{
26
+ kind: Type.TLiteral<"run">;
27
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
28
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
29
+ deadline: Type.TOptional<Type.TNumber>;
30
+ }>, Type.TObject<{
31
+ kind: Type.TLiteral<"job">;
32
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
33
+ deadline: Type.TOptional<Type.TNumber>;
34
+ }>, Type.TObject<{
35
+ kind: Type.TLiteral<"part">;
36
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
37
+ deadline: Type.TOptional<Type.TNumber>;
38
+ }>, Type.TObject<{
39
+ kind: Type.TLiteral<"timer">;
40
+ until: Type.TNumber;
41
+ deadline: Type.TOptional<Type.TNumber>;
42
+ }>]>;
43
+ }>, Type.TObject<{
44
+ kind: Type.TLiteral<"settled">;
45
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
46
+ endedAt: Type.TNumber;
47
+ }>, Type.TObject<{
48
+ kind: Type.TLiteral<"failed">;
49
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
50
+ failure: Type.TObject<{
51
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
52
+ message: Type.TString;
53
+ retryAfterMs: Type.TOptional<Type.TNumber>;
54
+ }>;
55
+ }>]>;
56
+ export type PartStatus = Decoded<typeof PartStatusType>;
57
+ export declare const PartViewType: Type.TObject<{
58
+ id: Type.TUnsafe<import("./ids.ts").Id<"part">>;
59
+ partKind: Type.TString;
60
+ placement: Type.TUnion<[Type.TObject<{
61
+ kind: Type.TLiteral<"transcript">;
62
+ role: Type.TEnum<["step", "answer", "note"]>;
63
+ }>, Type.TObject<{
64
+ kind: Type.TLiteral<"modal">;
65
+ }>, Type.TIntersect<[Type.TObject<{
66
+ kind: Type.TString;
67
+ }>, Type.TRecord<"^.*$", Type.TUnsafe<import("./json.ts").Json>>]>]>;
68
+ state: Type.TUnsafe<import("./json.ts").Json>;
69
+ version: Type.TNumber;
70
+ status: Type.TUnion<[Type.TObject<{
71
+ kind: Type.TLiteral<"live">;
72
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
73
+ waiting: Type.TOptional<Type.TUnsafe<import("./ids.ts").Id<"call">>>;
74
+ answer: Type.TOptional<Type.TObject<{
75
+ action: Type.TString;
76
+ input: Type.TUnsafe<import("./json.ts").Json>;
77
+ }>>;
78
+ }>, Type.TObject<{
79
+ kind: Type.TLiteral<"waiting">;
80
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
81
+ on: Type.TUnion<[Type.TObject<{
82
+ kind: Type.TLiteral<"run">;
83
+ session: Type.TUnsafe<import("./ids.ts").Id<"session">>;
84
+ run: Type.TUnsafe<import("./ids.ts").Id<"run">>;
85
+ deadline: Type.TOptional<Type.TNumber>;
86
+ }>, Type.TObject<{
87
+ kind: Type.TLiteral<"job">;
88
+ job: Type.TUnsafe<import("./ids.ts").Id<"job">>;
89
+ deadline: Type.TOptional<Type.TNumber>;
90
+ }>, Type.TObject<{
91
+ kind: Type.TLiteral<"part">;
92
+ part: Type.TUnsafe<import("./ids.ts").Id<"part">>;
93
+ deadline: Type.TOptional<Type.TNumber>;
94
+ }>, Type.TObject<{
95
+ kind: Type.TLiteral<"timer">;
96
+ until: Type.TNumber;
97
+ deadline: Type.TOptional<Type.TNumber>;
98
+ }>]>;
99
+ }>, Type.TObject<{
100
+ kind: Type.TLiteral<"settled">;
101
+ commit: Type.TUnsafe<import("./ids.ts").Id<"commit">>;
102
+ endedAt: Type.TNumber;
103
+ }>, Type.TObject<{
104
+ kind: Type.TLiteral<"failed">;
105
+ run: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"run">>, Type.TNull]>;
106
+ failure: Type.TObject<{
107
+ class: Type.TEnum<["rate_limit", "auth", "quota", "context_window", "overloaded", "network", "aborted", "provider", "runner"]>;
108
+ message: Type.TString;
109
+ retryAfterMs: Type.TOptional<Type.TNumber>;
110
+ }>;
111
+ }>]>;
112
+ owner: Type.TUnion<[Type.TString, Type.TNull]>;
113
+ }>;
114
+ export type PartView = Decoded<typeof PartViewType>;
115
+ export declare const ToolPartStateType: Type.TUnion<[Type.TObject<{
116
+ phase: Type.TLiteral<"calling">;
117
+ call: Type.TUnsafe<import("./ids.ts").Id<"call">>;
118
+ name: Type.TString;
119
+ args: Type.TUnsafe<import("./json.ts").Json>;
120
+ class: Type.TUnion<[Type.TObject<{
121
+ kind: Type.TLiteral<"read">;
122
+ path: Type.TString;
123
+ }>, Type.TObject<{
124
+ kind: Type.TLiteral<"list">;
125
+ path: Type.TString;
126
+ }>, Type.TObject<{
127
+ kind: Type.TLiteral<"edit">;
128
+ path: Type.TString;
129
+ }>, Type.TObject<{
130
+ kind: Type.TLiteral<"shell">;
131
+ command: Type.TString;
132
+ description: Type.TOptional<Type.TString>;
133
+ }>, Type.TObject<{
134
+ kind: Type.TLiteral<"delegate">;
135
+ child: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"session">>, Type.TNull]>;
136
+ role: Type.TEnum<["task", "create", "send", "await", "read", "stop"]>;
137
+ title: Type.TUnion<[Type.TString, Type.TNull]>;
138
+ }>, Type.TObject<{
139
+ kind: Type.TLiteral<"custom">;
140
+ label: Type.TString;
141
+ }>]>;
142
+ }>, Type.TObject<{
143
+ phase: Type.TLiteral<"running">;
144
+ progress: Type.TUnion<[Type.TObject<{
145
+ text: Type.TOptional<Type.TString>;
146
+ fraction: Type.TOptional<Type.TNumber>;
147
+ detail: Type.TOptional<Type.TUnsafe<import("./json.ts").Json>>;
148
+ }>, Type.TNull]>;
149
+ call: Type.TUnsafe<import("./ids.ts").Id<"call">>;
150
+ name: Type.TString;
151
+ args: Type.TUnsafe<import("./json.ts").Json>;
152
+ class: Type.TUnion<[Type.TObject<{
153
+ kind: Type.TLiteral<"read">;
154
+ path: Type.TString;
155
+ }>, Type.TObject<{
156
+ kind: Type.TLiteral<"list">;
157
+ path: Type.TString;
158
+ }>, Type.TObject<{
159
+ kind: Type.TLiteral<"edit">;
160
+ path: Type.TString;
161
+ }>, Type.TObject<{
162
+ kind: Type.TLiteral<"shell">;
163
+ command: Type.TString;
164
+ description: Type.TOptional<Type.TString>;
165
+ }>, Type.TObject<{
166
+ kind: Type.TLiteral<"delegate">;
167
+ child: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"session">>, Type.TNull]>;
168
+ role: Type.TEnum<["task", "create", "send", "await", "read", "stop"]>;
169
+ title: Type.TUnion<[Type.TString, Type.TNull]>;
170
+ }>, Type.TObject<{
171
+ kind: Type.TLiteral<"custom">;
172
+ label: Type.TString;
173
+ }>]>;
174
+ }>, Type.TObject<{
175
+ phase: Type.TLiteral<"settled">;
176
+ outcome: Type.TUnion<[Type.TObject<{
177
+ kind: Type.TLiteral<"ok">;
178
+ content: Type.TArray<Type.TUnion<[Type.TObject<{
179
+ kind: Type.TLiteral<"text">;
180
+ text: Type.TString;
181
+ }>, Type.TObject<{
182
+ kind: Type.TLiteral<"file">;
183
+ blob: Type.TUnsafe<import("./ids.ts").Id<"blob">>;
184
+ mime: Type.TString;
185
+ name: Type.TOptional<Type.TString>;
186
+ }>]>>;
187
+ output: Type.TUnsafe<import("./json.ts").Json>;
188
+ parts: Type.TArray<Type.TUnsafe<import("./ids.ts").Id<"part">>>;
189
+ }>, Type.TObject<{
190
+ kind: Type.TLiteral<"failed">;
191
+ message: Type.TString;
192
+ }>, Type.TObject<{
193
+ kind: Type.TLiteral<"interrupted">;
194
+ }>, Type.TObject<{
195
+ kind: Type.TLiteral<"rejected">;
196
+ reason: Type.TString;
197
+ }>, Type.TObject<{
198
+ kind: Type.TLiteral<"stopped">;
199
+ }>]>;
200
+ changes: Type.TUnion<[Type.TObject<{
201
+ added: Type.TNumber;
202
+ removed: Type.TNumber;
203
+ paths: Type.TArray<Type.TString>;
204
+ }>, Type.TNull]>;
205
+ call: Type.TUnsafe<import("./ids.ts").Id<"call">>;
206
+ name: Type.TString;
207
+ args: Type.TUnsafe<import("./json.ts").Json>;
208
+ class: Type.TUnion<[Type.TObject<{
209
+ kind: Type.TLiteral<"read">;
210
+ path: Type.TString;
211
+ }>, Type.TObject<{
212
+ kind: Type.TLiteral<"list">;
213
+ path: Type.TString;
214
+ }>, Type.TObject<{
215
+ kind: Type.TLiteral<"edit">;
216
+ path: Type.TString;
217
+ }>, Type.TObject<{
218
+ kind: Type.TLiteral<"shell">;
219
+ command: Type.TString;
220
+ description: Type.TOptional<Type.TString>;
221
+ }>, Type.TObject<{
222
+ kind: Type.TLiteral<"delegate">;
223
+ child: Type.TUnion<[Type.TUnsafe<import("./ids.ts").Id<"session">>, Type.TNull]>;
224
+ role: Type.TEnum<["task", "create", "send", "await", "read", "stop"]>;
225
+ title: Type.TUnion<[Type.TString, Type.TNull]>;
226
+ }>, Type.TObject<{
227
+ kind: Type.TLiteral<"custom">;
228
+ label: Type.TString;
229
+ }>]>;
230
+ }>]>;
231
+ export type ToolPartState = Decoded<typeof ToolPartStateType>;
232
+ export declare function actOutcomeSchema<T extends TSchema>(output: T): Schema<((Readonly<Partial<Pick<{
233
+ kind: "ok";
234
+ output: import("typebox").StaticType<["Root"], "Decode", {
235
+ Json: Type.TUnion<[Type.TNull, Type.TBoolean, Type.TNumber, Type.TString, Type.TArray<Type.TRef<"Json">>, Type.TRecord<"^.*$", Type.TRef<"Json">>]>;
236
+ } & {
237
+ Root: Type.TUnion<[Type.TObject<{
238
+ kind: Type.TLiteral<"ok">;
239
+ output: T;
240
+ }>, Type.TObject<{
241
+ kind: Type.TLiteral<"rejected">;
242
+ reason: Type.TString;
243
+ }>, Type.TObject<{
244
+ kind: Type.TLiteral<"unknown-action">;
245
+ }>, Type.TObject<{
246
+ kind: Type.TLiteral<"closed">;
247
+ }>, Type.TObject<{
248
+ kind: Type.TLiteral<"no-owner">;
249
+ }>, Type.TObject<{
250
+ kind: Type.TLiteral<"failed">;
251
+ message: Type.TString;
252
+ }>]>;
253
+ }, {
254
+ kind: Type.TLiteral<"ok">;
255
+ output: T;
256
+ }, T>;
257
+ }, T extends Type.TReadonly<Type.TSchema> ? T extends Type.TOptional<T> ? "output" : never : never>>> & Readonly<Pick<{
258
+ kind: "ok";
259
+ output: import("typebox").StaticType<["Root"], "Decode", {
260
+ Json: Type.TUnion<[Type.TNull, Type.TBoolean, Type.TNumber, Type.TString, Type.TArray<Type.TRef<"Json">>, Type.TRecord<"^.*$", Type.TRef<"Json">>]>;
261
+ } & {
262
+ Root: Type.TUnion<[Type.TObject<{
263
+ kind: Type.TLiteral<"ok">;
264
+ output: T;
265
+ }>, Type.TObject<{
266
+ kind: Type.TLiteral<"rejected">;
267
+ reason: Type.TString;
268
+ }>, Type.TObject<{
269
+ kind: Type.TLiteral<"unknown-action">;
270
+ }>, Type.TObject<{
271
+ kind: Type.TLiteral<"closed">;
272
+ }>, Type.TObject<{
273
+ kind: Type.TLiteral<"no-owner">;
274
+ }>, Type.TObject<{
275
+ kind: Type.TLiteral<"failed">;
276
+ message: Type.TString;
277
+ }>]>;
278
+ }, {
279
+ kind: Type.TLiteral<"ok">;
280
+ output: T;
281
+ }, T>;
282
+ }, T extends Type.TReadonly<Type.TSchema> ? T extends Type.TOptional<T> ? never : "output" : never>> & Partial<Pick<{
283
+ kind: "ok";
284
+ output: import("typebox").StaticType<["Root"], "Decode", {
285
+ Json: Type.TUnion<[Type.TNull, Type.TBoolean, Type.TNumber, Type.TString, Type.TArray<Type.TRef<"Json">>, Type.TRecord<"^.*$", Type.TRef<"Json">>]>;
286
+ } & {
287
+ Root: Type.TUnion<[Type.TObject<{
288
+ kind: Type.TLiteral<"ok">;
289
+ output: T;
290
+ }>, Type.TObject<{
291
+ kind: Type.TLiteral<"rejected">;
292
+ reason: Type.TString;
293
+ }>, Type.TObject<{
294
+ kind: Type.TLiteral<"unknown-action">;
295
+ }>, Type.TObject<{
296
+ kind: Type.TLiteral<"closed">;
297
+ }>, Type.TObject<{
298
+ kind: Type.TLiteral<"no-owner">;
299
+ }>, Type.TObject<{
300
+ kind: Type.TLiteral<"failed">;
301
+ message: Type.TString;
302
+ }>]>;
303
+ }, {
304
+ kind: Type.TLiteral<"ok">;
305
+ output: T;
306
+ }, T>;
307
+ }, T extends Type.TOptional<Type.TSchema> ? T extends Type.TReadonly<T> ? never : "output" : never>> & Required<Pick<{
308
+ kind: "ok";
309
+ output: import("typebox").StaticType<["Root"], "Decode", {
310
+ Json: Type.TUnion<[Type.TNull, Type.TBoolean, Type.TNumber, Type.TString, Type.TArray<Type.TRef<"Json">>, Type.TRecord<"^.*$", Type.TRef<"Json">>]>;
311
+ } & {
312
+ Root: Type.TUnion<[Type.TObject<{
313
+ kind: Type.TLiteral<"ok">;
314
+ output: T;
315
+ }>, Type.TObject<{
316
+ kind: Type.TLiteral<"rejected">;
317
+ reason: Type.TString;
318
+ }>, Type.TObject<{
319
+ kind: Type.TLiteral<"unknown-action">;
320
+ }>, Type.TObject<{
321
+ kind: Type.TLiteral<"closed">;
322
+ }>, Type.TObject<{
323
+ kind: Type.TLiteral<"no-owner">;
324
+ }>, Type.TObject<{
325
+ kind: Type.TLiteral<"failed">;
326
+ message: Type.TString;
327
+ }>]>;
328
+ }, {
329
+ kind: Type.TLiteral<"ok">;
330
+ output: T;
331
+ }, T>;
332
+ }, Exclude<"output", (T extends Type.TReadonly<Type.TSchema> ? T extends Type.TOptional<T> ? "output" : never : never) | (T extends Type.TReadonly<Type.TSchema> ? T extends Type.TOptional<T> ? never : "output" : never) | (T extends Type.TOptional<Type.TSchema> ? T extends Type.TReadonly<T> ? never : "output" : never)> | Exclude<"kind", (T extends Type.TReadonly<Type.TSchema> ? T extends Type.TOptional<T> ? "output" : never : never) | (T extends Type.TReadonly<Type.TSchema> ? T extends Type.TOptional<T> ? never : "output" : never) | (T extends Type.TOptional<Type.TSchema> ? T extends Type.TReadonly<T> ? never : "output" : never)>>> extends infer T_2 ? { [K in keyof T_2]: T_2[K]; } : never) extends infer T_1 extends Record<PropertyKey, unknown> ? { [Key in keyof T_1]: T_1[Key]; } : never) | {
333
+ kind: "rejected";
334
+ reason: string;
335
+ } | {
336
+ kind: "unknown-action";
337
+ } | {
338
+ kind: "closed";
339
+ } | {
340
+ kind: "no-owner";
341
+ } | {
342
+ message: string;
343
+ kind: "failed";
344
+ }>;
345
+ export declare const PlacementSchema: Schema<Placement>;
346
+ export declare const PartStatusSchema: Schema<PartStatus>;
347
+ export declare const PartViewSchema: Schema<PartView>;
348
+ export declare const ToolPartStateSchema: Schema<ToolPartState>;
349
+ export type ActOutcome<Output> = {
350
+ readonly kind: "ok";
351
+ readonly output: Output;
352
+ } | {
353
+ readonly kind: "rejected";
354
+ readonly reason: string;
355
+ } | {
356
+ readonly kind: "unknown-action";
357
+ } | {
358
+ readonly kind: "closed";
359
+ } | {
360
+ readonly kind: "no-owner";
361
+ } | {
362
+ readonly kind: "failed";
363
+ readonly message: string;
364
+ };
@@ -0,0 +1,35 @@
1
+ import {
2
+ SignatureType2,
3
+ PlacementType2,
4
+ PartStatusType2,
5
+ PartViewType2,
6
+ ToolPartStateType2,
7
+ actOutcomeSchema2,
8
+ PlacementSchema2,
9
+ PartStatusSchema2,
10
+ PartViewSchema2,
11
+ ToolPartStateSchema2
12
+ } from "../chunks/browser-ad9yebg7.js";
13
+ import"../chunks/browser-h86zs54a.js";
14
+ import"../chunks/browser-s7907azt.js";
15
+ import"../chunks/browser-40enyw9r.js";
16
+ import"../chunks/browser-m0wzr0g8.js";
17
+ import"../chunks/browser-vapnjwp3.js";
18
+ import"../chunks/browser-8t9anqfc.js";
19
+ import"../chunks/browser-sgwxbek9.js";
20
+ import"../chunks/browser-1sfp0bcx.js";
21
+ import"../chunks/browser-4et7qtz3.js";
22
+ import"../chunks/browser-ypez6s7v.js";
23
+ import"../chunks/browser-vzc3r2r3.js";
24
+ export {
25
+ PartStatusSchema2 as PartStatusSchema,
26
+ PartStatusType2 as PartStatusType,
27
+ PartViewSchema2 as PartViewSchema,
28
+ PartViewType2 as PartViewType,
29
+ PlacementSchema2 as PlacementSchema,
30
+ PlacementType2 as PlacementType,
31
+ SignatureType2 as SignatureType,
32
+ ToolPartStateSchema2 as ToolPartStateSchema,
33
+ ToolPartStateType2 as ToolPartStateType,
34
+ actOutcomeSchema2 as actOutcomeSchema
35
+ };
@@ -0,0 +1,21 @@
1
+ import { Type } from "typebox";
2
+ import type { FileStatus } from "./files.ts";
3
+ import type { Decoded } from "./schema.ts";
4
+ export declare const HunkType: Type.TObject<{
5
+ oldStart: Type.TNumber;
6
+ oldLines: Type.TNumber;
7
+ newStart: Type.TNumber;
8
+ newLines: Type.TNumber;
9
+ header: Type.TUnion<[Type.TString, Type.TNull]>;
10
+ lines: Type.TArray<Type.TObject<{
11
+ kind: Type.TEnum<["context", "add", "remove"]>;
12
+ text: Type.TString;
13
+ noNewline: Type.TOptional<Type.TLiteral<true>>;
14
+ }>>;
15
+ }>;
16
+ /** One hunk of a unified diff: where it sits on each side, the text after its `@@` header, and its lines, `noNewline` on a line the file ends without a newline after. */
17
+ export type Hunk = Decoded<typeof HunkType>;
18
+ /** Writes one file's unified diff as `git diff` prints it: the `diff --git` header, the `---`/`+++` sides (`/dev/null` for an added, untracked or deleted file) and the hunks. */
19
+ export declare function writePatch(path: string, status: FileStatus, hunks: readonly Hunk[]): string;
20
+ /** Reads the hunks of one file's unified diff, the text a `PatchEntry` of kind `text` carries as `patch`. */
21
+ export declare function readHunks(patch: string): readonly Hunk[];
@@ -0,0 +1,11 @@
1
+ import {
2
+ HunkType2,
3
+ writePatch2,
4
+ readHunks2
5
+ } from "../chunks/browser-6yby604e.js";
6
+ import"../chunks/browser-4et7qtz3.js";
7
+ export {
8
+ HunkType2 as HunkType,
9
+ readHunks2 as readHunks,
10
+ writePatch2 as writePatch
11
+ };