@openwaggle/extension-sdk 0.0.0-bootstrap.0 → 0.1.0

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 (104) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -0
  4. package/dist/agent-loop.d.ts +128 -0
  5. package/dist/agent-loop.js +47 -0
  6. package/dist/broker-validation.d.ts +17 -0
  7. package/dist/broker-validation.js +99 -0
  8. package/dist/broker.d.ts +193 -0
  9. package/dist/broker.js +81 -0
  10. package/dist/constants.d.ts +183 -0
  11. package/dist/constants.js +245 -0
  12. package/dist/context.d.ts +66 -0
  13. package/dist/context.js +49 -0
  14. package/dist/contribution-types.d.ts +21 -0
  15. package/dist/contribution-types.js +1 -0
  16. package/dist/core-types.d.ts +58 -0
  17. package/dist/core-types.js +1 -0
  18. package/dist/docs-validation.d.ts +3 -0
  19. package/dist/docs-validation.js +93 -0
  20. package/dist/docs.d.ts +231 -0
  21. package/dist/docs.js +85 -0
  22. package/dist/index.d.ts +15 -0
  23. package/dist/index.js +10 -0
  24. package/dist/internal-validation.d.ts +4 -0
  25. package/dist/internal-validation.js +24 -0
  26. package/dist/json.d.ts +9 -0
  27. package/dist/json.js +3 -0
  28. package/dist/manifest-contributions.d.ts +380 -0
  29. package/dist/manifest-contributions.js +75 -0
  30. package/dist/manifest-primitives.d.ts +20 -0
  31. package/dist/manifest-primitives.js +118 -0
  32. package/dist/manifest.d.ts +303 -0
  33. package/dist/manifest.js +89 -0
  34. package/dist/openwaggle-sdk.d.ts +2 -0
  35. package/dist/openwaggle-sdk.js +127 -0
  36. package/dist/openwaggle-types.d.ts +111 -0
  37. package/dist/openwaggle-types.js +1 -0
  38. package/dist/openwaggle-validation.d.ts +12 -0
  39. package/dist/openwaggle-validation.js +135 -0
  40. package/dist/registry-types.d.ts +34 -0
  41. package/dist/registry-types.js +1 -0
  42. package/dist/runtime-sdk.d.ts +2 -0
  43. package/dist/runtime-sdk.js +19 -0
  44. package/dist/runtime-types.d.ts +19 -0
  45. package/dist/runtime-types.js +1 -0
  46. package/dist/runtime.d.ts +22 -0
  47. package/dist/runtime.js +22 -0
  48. package/dist/schema.d.ts +13 -0
  49. package/dist/schema.js +25 -0
  50. package/dist/sdk-types.d.ts +92 -0
  51. package/dist/sdk-types.js +1 -0
  52. package/dist/storage-sdk.d.ts +2 -0
  53. package/dist/storage-sdk.js +51 -0
  54. package/dist/storage-types.d.ts +40 -0
  55. package/dist/storage-types.js +1 -0
  56. package/dist/theme-data.d.ts +126 -0
  57. package/dist/theme-data.js +144 -0
  58. package/dist/theme-types.d.ts +61 -0
  59. package/dist/theme-types.js +1 -0
  60. package/dist/theme.d.ts +6 -0
  61. package/dist/theme.js +128 -0
  62. package/dist/types.d.ts +6 -0
  63. package/dist/types.js +1 -0
  64. package/dist/ui-constants.d.ts +24 -0
  65. package/dist/ui-constants.js +22 -0
  66. package/dist/ui-stylesheet.d.ts +8 -0
  67. package/dist/ui-stylesheet.js +223 -0
  68. package/dist/ui.d.ts +6 -0
  69. package/dist/ui.js +16 -0
  70. package/dist-cjs/agent-loop.js +83 -0
  71. package/dist-cjs/broker-validation.js +109 -0
  72. package/dist-cjs/broker.js +120 -0
  73. package/dist-cjs/constants.js +248 -0
  74. package/dist-cjs/context.js +54 -0
  75. package/dist-cjs/contribution-types.js +2 -0
  76. package/dist-cjs/core-types.js +2 -0
  77. package/dist-cjs/docs-validation.js +97 -0
  78. package/dist-cjs/docs.js +121 -0
  79. package/dist-cjs/index.js +56 -0
  80. package/dist-cjs/internal-validation.js +30 -0
  81. package/dist-cjs/json.js +39 -0
  82. package/dist-cjs/manifest-contributions.js +111 -0
  83. package/dist-cjs/manifest-primitives.js +158 -0
  84. package/dist-cjs/manifest.js +140 -0
  85. package/dist-cjs/openwaggle-sdk.js +130 -0
  86. package/dist-cjs/openwaggle-types.js +2 -0
  87. package/dist-cjs/openwaggle-validation.js +148 -0
  88. package/dist-cjs/package.json +3 -0
  89. package/dist-cjs/registry-types.js +2 -0
  90. package/dist-cjs/runtime-sdk.js +22 -0
  91. package/dist-cjs/runtime-types.js +2 -0
  92. package/dist-cjs/runtime.js +61 -0
  93. package/dist-cjs/schema.js +61 -0
  94. package/dist-cjs/sdk-types.js +2 -0
  95. package/dist-cjs/storage-sdk.js +54 -0
  96. package/dist-cjs/storage-types.js +2 -0
  97. package/dist-cjs/theme-data.js +147 -0
  98. package/dist-cjs/theme-types.js +2 -0
  99. package/dist-cjs/theme.js +135 -0
  100. package/dist-cjs/types.js +2 -0
  101. package/dist-cjs/ui-constants.js +25 -0
  102. package/dist-cjs/ui-stylesheet.js +227 -0
  103. package/dist-cjs/ui.js +24 -0
  104. package/package.json +98 -8
@@ -0,0 +1,303 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { OPENWAGGLE_EXTENSION } from './constants.js';
3
+ import { type SchemaType } from './schema.js';
4
+ export * from './manifest-contributions.js';
5
+ export { extensionCapabilityScopeSchema, extensionCommandContributionFamilySchema, extensionContributionFamilySchema, extensionContributionIdSchema, extensionContributionRuntimeSchema, extensionExecutionPlacementSchema, extensionIdSchema, extensionRelativePathSchema, extensionSemverVersionSchema, extensionSlotContributionFamilySchema, } from './manifest-primitives.js';
6
+ export declare const extensionRuntimeRequirementTypeSchema: Schema.SchemaClass<"binary" | "command", "binary" | "command", never>;
7
+ export declare const extensionRuntimeRequirementSchema: Schema.filter<Schema.Struct<{
8
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
9
+ label: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
10
+ kind: Schema.optional<Schema.SchemaClass<"binary" | "command", "binary" | "command", never>>;
11
+ command: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
12
+ binary: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
13
+ }>>;
14
+ export declare const extensionInstallSourceSchema: Schema.SchemaClass<"prebuilt" | "local-build", "prebuilt" | "local-build", never>;
15
+ export declare const extensionInstallSchema: Schema.Struct<{
16
+ source: Schema.SchemaClass<"prebuilt" | "local-build", "prebuilt" | "local-build", never>;
17
+ }>;
18
+ export declare const extensionBuildSchema: Schema.Struct<{
19
+ command: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
20
+ outputs: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
21
+ }>;
22
+ export declare const extensionNetworkSchema: Schema.Struct<{
23
+ origins: Schema.Array$<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
24
+ }>;
25
+ export declare const extensionDocsTopicDeclarationSchema: Schema.Struct<{
26
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
27
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
28
+ path: Schema.filter<Schema.filter<typeof Schema.String>>;
29
+ description: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
30
+ aliases: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
31
+ keywords: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
32
+ }>;
33
+ export declare const extensionDocsSchema: Schema.Struct<{
34
+ topics: Schema.optional<Schema.Array$<Schema.Struct<{
35
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
36
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
37
+ path: Schema.filter<Schema.filter<typeof Schema.String>>;
38
+ description: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
39
+ aliases: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
40
+ keywords: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
41
+ }>>>;
42
+ }>;
43
+ export declare const openWaggleExtensionManifestSchema: Schema.filter<Schema.Struct<{
44
+ manifestVersion: Schema.Literal<[1]>;
45
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
46
+ name: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
47
+ version: Schema.filter<Schema.filter<typeof Schema.String>>;
48
+ description: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
49
+ sdk: Schema.Struct<{
50
+ openwaggle: Schema.filter<Schema.filter<typeof Schema.String>>;
51
+ }>;
52
+ sourceFiles: Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>;
53
+ builtArtifacts: Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>;
54
+ install: Schema.optional<Schema.Struct<{
55
+ source: Schema.SchemaClass<"prebuilt" | "local-build", "prebuilt" | "local-build", never>;
56
+ }>>;
57
+ build: Schema.optional<Schema.Struct<{
58
+ command: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
59
+ outputs: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
60
+ }>>;
61
+ docs: Schema.optional<Schema.Struct<{
62
+ topics: Schema.optional<Schema.Array$<Schema.Struct<{
63
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
64
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
65
+ path: Schema.filter<Schema.filter<typeof Schema.String>>;
66
+ description: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
67
+ aliases: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
68
+ keywords: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
69
+ }>>>;
70
+ }>>;
71
+ network: Schema.optional<Schema.Struct<{
72
+ origins: Schema.Array$<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
73
+ }>>;
74
+ capabilities: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
75
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
76
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
77
+ scopes: Schema.optional<Schema.Array$<Schema.Literal<["app", "project", "session", "branch"]>>>;
78
+ }>>>>;
79
+ contributions: Schema.optional<Schema.Struct<{
80
+ commands: Schema.optional<Schema.Array$<Schema.Struct<{
81
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
82
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
83
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
84
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
85
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
86
+ category: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
87
+ target: Schema.optional<Schema.Struct<{
88
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
89
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
90
+ }>>;
91
+ }>>>;
92
+ slashCommands: Schema.optional<Schema.Array$<Schema.Struct<{
93
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
94
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
95
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
96
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
97
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
98
+ category: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
99
+ target: Schema.optional<Schema.Struct<{
100
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
101
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
102
+ }>>;
103
+ }>>>;
104
+ routes: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
105
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
106
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
107
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
108
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
109
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
110
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
111
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
112
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
113
+ target: Schema.optional<Schema.Struct<{
114
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
115
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
116
+ }>>;
117
+ matches: Schema.optional<Schema.Struct<{
118
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
119
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
120
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
121
+ }>>;
122
+ }>>>>;
123
+ settingsSections: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
124
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
125
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
126
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
127
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
128
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
129
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
130
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
131
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
132
+ target: Schema.optional<Schema.Struct<{
133
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
134
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
135
+ }>>;
136
+ matches: Schema.optional<Schema.Struct<{
137
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
138
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
139
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
140
+ }>>;
141
+ }>>>>;
142
+ sidePanels: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
143
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
144
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
145
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
146
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
147
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
148
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
149
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
150
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
151
+ target: Schema.optional<Schema.Struct<{
152
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
153
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
154
+ }>>;
155
+ matches: Schema.optional<Schema.Struct<{
156
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
157
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
158
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
159
+ }>>;
160
+ }>>>>;
161
+ dialogs: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
162
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
163
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
164
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
165
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
166
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
167
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
168
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
169
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
170
+ target: Schema.optional<Schema.Struct<{
171
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
172
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
173
+ }>>;
174
+ matches: Schema.optional<Schema.Struct<{
175
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
176
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
177
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
178
+ }>>;
179
+ }>>>>;
180
+ transcriptRenderers: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
181
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
182
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
183
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
184
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
185
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
186
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
187
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
188
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
189
+ target: Schema.optional<Schema.Struct<{
190
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
191
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
192
+ }>>;
193
+ matches: Schema.optional<Schema.Struct<{
194
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
195
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
196
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
197
+ }>>;
198
+ }>>>>;
199
+ toolRenderers: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
200
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
201
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
202
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
203
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
204
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
205
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
206
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
207
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
208
+ target: Schema.optional<Schema.Struct<{
209
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
210
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
211
+ }>>;
212
+ matches: Schema.optional<Schema.Struct<{
213
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
214
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
215
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
216
+ }>>;
217
+ }>>>>;
218
+ customMessageRenderers: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
219
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
220
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
221
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
222
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
223
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
224
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
225
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
226
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
227
+ target: Schema.optional<Schema.Struct<{
228
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
229
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
230
+ }>>;
231
+ matches: Schema.optional<Schema.Struct<{
232
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
233
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
234
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
235
+ }>>;
236
+ }>>>>;
237
+ interactionRenderers: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
238
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
239
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
240
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
241
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
242
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
243
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
244
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
245
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
246
+ target: Schema.optional<Schema.Struct<{
247
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
248
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
249
+ }>>;
250
+ matches: Schema.optional<Schema.Struct<{
251
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
252
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
253
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
254
+ }>>;
255
+ }>>>>;
256
+ statusWidgets: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
257
+ capability: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
258
+ method: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
259
+ methods: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
260
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
261
+ title: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
262
+ runtime: Schema.SchemaClass<"federated-module" | "trusted-renderer", "federated-module" | "trusted-renderer", never>;
263
+ execution: Schema.SchemaClass<"host-renderer" | "frame", "host-renderer" | "frame", never>;
264
+ entry: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
265
+ target: Schema.optional<Schema.Struct<{
266
+ projectPaths: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
267
+ sessionIds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
268
+ }>>;
269
+ matches: Schema.optional<Schema.Struct<{
270
+ toolNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
271
+ customMessageNames: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
272
+ interactionKinds: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
273
+ }>>;
274
+ }>>>>;
275
+ }>>;
276
+ pi: Schema.optional<Schema.Struct<{
277
+ resourceRoots: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.String>>>>;
278
+ }>>;
279
+ trusted: Schema.optional<Schema.Struct<{
280
+ main: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
281
+ renderer: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
282
+ }>>;
283
+ runtimeRequirements: Schema.optional<Schema.Array$<Schema.filter<Schema.Struct<{
284
+ id: Schema.filter<Schema.filter<typeof Schema.String>>;
285
+ label: Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>;
286
+ kind: Schema.optional<Schema.SchemaClass<"binary" | "command", "binary" | "command", never>>;
287
+ command: Schema.optional<Schema.filter<Schema.filter<typeof Schema.String>>>;
288
+ binary: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.String>>>>;
289
+ }>>>>;
290
+ }>>;
291
+ export type ExtensionRuntimeRequirementDeclaration = SchemaType<typeof extensionRuntimeRequirementSchema>;
292
+ export type ExtensionDocsTopicDeclaration = SchemaType<typeof extensionDocsTopicDeclarationSchema>;
293
+ export type OpenWaggleExtensionManifest = SchemaType<typeof openWaggleExtensionManifestSchema>;
294
+ export type OpenWaggleExtensionManifestFile = typeof OPENWAGGLE_EXTENSION.MANIFEST_FILE;
295
+ export type ExtensionManifestValidationResult = {
296
+ readonly success: true;
297
+ readonly manifest: OpenWaggleExtensionManifest;
298
+ } | {
299
+ readonly success: false;
300
+ readonly issues: readonly string[];
301
+ };
302
+ export declare function defineExtensionManifest<const TManifest extends OpenWaggleExtensionManifest>(manifest: TManifest): TManifest;
303
+ export declare function validateExtensionManifest(value: unknown): ExtensionManifestValidationResult;
@@ -0,0 +1,89 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { OPENWAGGLE_EXTENSION } from './constants.js';
3
+ import { extensionCapabilityDeclarationSchema, extensionContributionsSchema, } from './manifest-contributions.js';
4
+ import { extensionContributionIdSchema, extensionIdSchema, extensionNonEmptyStringSchema, extensionRelativePathSchema, extensionSemverVersionSchema, isBuildCommand, isNetworkOrigin, isRuntimeRequirementBinary, } from './manifest-primitives.js';
5
+ import { safeDecodeExtensionSchema } from './schema.js';
6
+ export * from './manifest-contributions.js';
7
+ export { extensionCapabilityScopeSchema, extensionCommandContributionFamilySchema, extensionContributionFamilySchema, extensionContributionIdSchema, extensionContributionRuntimeSchema, extensionExecutionPlacementSchema, extensionIdSchema, extensionRelativePathSchema, extensionSemverVersionSchema, extensionSlotContributionFamilySchema, } from './manifest-primitives.js';
8
+ export const extensionRuntimeRequirementTypeSchema = Schema.Literal(...OPENWAGGLE_EXTENSION.RUNTIME_REQUIREMENT_TYPES);
9
+ export const extensionRuntimeRequirementSchema = Schema.Struct({
10
+ id: extensionContributionIdSchema,
11
+ label: extensionNonEmptyStringSchema.pipe(Schema.maxLength(OPENWAGGLE_EXTENSION.LIMITS.NAME_MAX_LENGTH)),
12
+ kind: Schema.optional(extensionRuntimeRequirementTypeSchema),
13
+ command: Schema.optional(extensionRelativePathSchema),
14
+ binary: Schema.optional(extensionNonEmptyStringSchema.pipe(Schema.filter(isRuntimeRequirementBinary))),
15
+ }).pipe(Schema.filter((requirement) => {
16
+ const hasBinary = requirement.binary !== undefined;
17
+ const hasCommand = requirement.command !== undefined;
18
+ if (hasBinary === hasCommand) {
19
+ return 'Declare exactly one runtime requirement target: binary or command.';
20
+ }
21
+ if (hasBinary &&
22
+ requirement.kind !== undefined &&
23
+ requirement.kind !== OPENWAGGLE_EXTENSION.RUNTIME_REQUIREMENT_TYPE.BINARY) {
24
+ return 'Runtime requirement kind must be "binary" when binary is declared.';
25
+ }
26
+ if (hasCommand &&
27
+ requirement.kind !== undefined &&
28
+ requirement.kind !== OPENWAGGLE_EXTENSION.RUNTIME_REQUIREMENT_TYPE.COMMAND) {
29
+ return 'Runtime requirement kind must be "command" when command is declared.';
30
+ }
31
+ return true;
32
+ }));
33
+ export const extensionInstallSourceSchema = Schema.Literal(...OPENWAGGLE_EXTENSION.INSTALL_SOURCES);
34
+ export const extensionInstallSchema = Schema.Struct({ source: extensionInstallSourceSchema });
35
+ export const extensionBuildSchema = Schema.Struct({
36
+ command: extensionNonEmptyStringSchema.pipe(Schema.filter(isBuildCommand)),
37
+ outputs: Schema.optional(Schema.Array(extensionRelativePathSchema)),
38
+ });
39
+ export const extensionNetworkSchema = Schema.Struct({
40
+ origins: Schema.Array(extensionNonEmptyStringSchema.pipe(Schema.filter(isNetworkOrigin))),
41
+ });
42
+ export const extensionDocsTopicDeclarationSchema = Schema.Struct({
43
+ id: extensionContributionIdSchema,
44
+ title: extensionNonEmptyStringSchema.pipe(Schema.maxLength(OPENWAGGLE_EXTENSION.LIMITS.NAME_MAX_LENGTH)),
45
+ path: extensionRelativePathSchema,
46
+ description: Schema.optional(extensionNonEmptyStringSchema.pipe(Schema.maxLength(OPENWAGGLE_EXTENSION.LIMITS.DESCRIPTION_MAX_LENGTH))),
47
+ aliases: Schema.optional(Schema.Array(extensionNonEmptyStringSchema)),
48
+ keywords: Schema.optional(Schema.Array(extensionNonEmptyStringSchema)),
49
+ });
50
+ export const extensionDocsSchema = Schema.Struct({
51
+ topics: Schema.optional(Schema.Array(extensionDocsTopicDeclarationSchema)),
52
+ });
53
+ function validateTrustedRendererRuntimeBoundary(manifest) {
54
+ const usesTrustedRenderer = OPENWAGGLE_EXTENSION.ENTRY_CONTRIBUTION_FAMILIES.some((family) => manifest.contributions?.[family]?.some((contribution) => contribution.runtime === OPENWAGGLE_EXTENSION.CONTRIBUTION_RUNTIME.TRUSTED_RENDERER));
55
+ return (!usesTrustedRenderer ||
56
+ manifest.trusted?.renderer !== undefined ||
57
+ 'Trusted renderer contributions require trusted.renderer to declare privileged renderer runtime execution.');
58
+ }
59
+ export const openWaggleExtensionManifestSchema = Schema.Struct({
60
+ manifestVersion: Schema.Literal(1),
61
+ id: extensionIdSchema,
62
+ name: extensionNonEmptyStringSchema.pipe(Schema.maxLength(OPENWAGGLE_EXTENSION.LIMITS.NAME_MAX_LENGTH)),
63
+ version: extensionSemverVersionSchema,
64
+ description: Schema.optional(extensionNonEmptyStringSchema.pipe(Schema.maxLength(OPENWAGGLE_EXTENSION.LIMITS.DESCRIPTION_MAX_LENGTH))),
65
+ sdk: Schema.Struct({ openwaggle: extensionNonEmptyStringSchema }),
66
+ sourceFiles: Schema.Array(extensionRelativePathSchema),
67
+ builtArtifacts: Schema.Array(extensionRelativePathSchema),
68
+ install: Schema.optional(extensionInstallSchema),
69
+ build: Schema.optional(extensionBuildSchema),
70
+ docs: Schema.optional(extensionDocsSchema),
71
+ network: Schema.optional(extensionNetworkSchema),
72
+ capabilities: Schema.optional(Schema.Array(extensionCapabilityDeclarationSchema)),
73
+ contributions: Schema.optional(extensionContributionsSchema),
74
+ pi: Schema.optional(Schema.Struct({ resourceRoots: Schema.optional(Schema.Array(extensionRelativePathSchema)) })),
75
+ trusted: Schema.optional(Schema.Struct({
76
+ main: Schema.optional(extensionRelativePathSchema),
77
+ renderer: Schema.optional(extensionRelativePathSchema),
78
+ })),
79
+ runtimeRequirements: Schema.optional(Schema.Array(extensionRuntimeRequirementSchema)),
80
+ }).pipe(Schema.filter(validateTrustedRendererRuntimeBoundary));
81
+ export function defineExtensionManifest(manifest) {
82
+ return manifest;
83
+ }
84
+ export function validateExtensionManifest(value) {
85
+ const result = safeDecodeExtensionSchema(openWaggleExtensionManifestSchema, value);
86
+ return result.success
87
+ ? { success: true, manifest: result.data }
88
+ : { success: false, issues: result.issues };
89
+ }
@@ -0,0 +1,2 @@
1
+ import type { CreateOpenWaggleSdkOptions, ExtensionOpenWaggleSdk, ExtensionSdkInvoke } from './sdk-types.js';
2
+ export declare function createOpenWaggleSdk(invoke: ExtensionSdkInvoke, options?: CreateOpenWaggleSdkOptions): ExtensionOpenWaggleSdk;
@@ -0,0 +1,127 @@
1
+ import { toDecodedOperationResult } from './broker-validation.js';
2
+ import { OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
3
+ import { isDocsDiscoverResult, isDocsResolveTopicResult } from './docs-validation.js';
4
+ import { isActionSelectProjectResult, isSettingsGetResult, isSettingsGetSettingResult, isSettingsUpdateResult, isSettingsUpdateSettingResult, isStateCurrentBranchReadResult, isStateCurrentProjectReadResult, isStateCurrentSessionReadResult, isStateModelPreferencesReadResult, isStateReadResult, isStateRecentProjectsReadResult, } from './openwaggle-validation.js';
5
+ const ACTION_RESULT_ERROR = 'Extension broker returned an invalid OpenWaggle action result.';
6
+ const DOCS_RESULT_ERROR = 'Extension broker returned an invalid OpenWaggle docs result.';
7
+ const SETTINGS_RESULT_ERROR = 'Extension broker returned an invalid OpenWaggle settings result.';
8
+ const STATE_RESULT_ERROR = 'Extension broker returned an invalid OpenWaggle state result.';
9
+ const unsupportedOpenExternal = async () => {
10
+ throw new Error('OpenWaggle external URL action is not available in this extension host context.');
11
+ };
12
+ function createOpenWaggleStateSdk(invoke) {
13
+ return {
14
+ get: async (scope) => toDecodedOperationResult(await invoke({
15
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE,
16
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_STATE,
17
+ scope,
18
+ payload: {},
19
+ }), isStateReadResult, STATE_RESULT_ERROR),
20
+ readCurrentProject: async (scope) => toDecodedOperationResult(await invoke({
21
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE,
22
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.READ_STATE,
23
+ scope,
24
+ payload: { selector: OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.CURRENT_PROJECT },
25
+ }), isStateCurrentProjectReadResult, STATE_RESULT_ERROR),
26
+ readCurrentSession: async (scope) => toDecodedOperationResult(await invoke({
27
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE,
28
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.READ_STATE,
29
+ scope,
30
+ payload: { selector: OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.CURRENT_SESSION },
31
+ }), isStateCurrentSessionReadResult, STATE_RESULT_ERROR),
32
+ readCurrentBranch: async (scope) => toDecodedOperationResult(await invoke({
33
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE,
34
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.READ_STATE,
35
+ scope,
36
+ payload: { selector: OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.CURRENT_BRANCH },
37
+ }), isStateCurrentBranchReadResult, STATE_RESULT_ERROR),
38
+ readRecentProjects: async (scope) => toDecodedOperationResult(await invoke({
39
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE,
40
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.READ_STATE,
41
+ scope,
42
+ payload: { selector: OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.RECENT_PROJECTS },
43
+ }), isStateRecentProjectsReadResult, STATE_RESULT_ERROR),
44
+ readModelPreferences: async (scope) => toDecodedOperationResult(await invoke({
45
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE,
46
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.READ_STATE,
47
+ scope,
48
+ payload: { selector: OPENWAGGLE_EXTENSION_BROKER.STATE_SELECTOR.MODEL_PREFERENCES },
49
+ }), isStateModelPreferencesReadResult, STATE_RESULT_ERROR),
50
+ };
51
+ }
52
+ function createOpenWaggleSettingsSdk(invoke) {
53
+ return {
54
+ get: async (scope) => toDecodedOperationResult(await invoke({
55
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS,
56
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_SETTINGS,
57
+ scope,
58
+ payload: {},
59
+ }), isSettingsGetResult, SETTINGS_RESULT_ERROR),
60
+ getModelPreferences: async (scope) => toDecodedOperationResult(await invoke({
61
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS,
62
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_SETTING,
63
+ scope,
64
+ payload: { key: OPENWAGGLE_EXTENSION_BROKER.SETTING_KEY.MODEL_PREFERENCES },
65
+ }), isSettingsGetSettingResult, SETTINGS_RESULT_ERROR),
66
+ updateModelPreferences: async (scope, value) => toDecodedOperationResult(await invoke({
67
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS,
68
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.UPDATE_SETTING,
69
+ scope,
70
+ payload: { key: OPENWAGGLE_EXTENSION_BROKER.SETTING_KEY.MODEL_PREFERENCES, value },
71
+ }), isSettingsUpdateSettingResult, SETTINGS_RESULT_ERROR),
72
+ getProjectDisplayName: async (scope, projectPath) => toDecodedOperationResult(await invoke({
73
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS,
74
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_SETTING,
75
+ scope,
76
+ payload: {
77
+ key: OPENWAGGLE_EXTENSION_BROKER.SETTING_KEY.PROJECT_DISPLAY_NAME,
78
+ projectPath,
79
+ },
80
+ }), isSettingsGetSettingResult, SETTINGS_RESULT_ERROR),
81
+ setProjectDisplayName: async (scope, projectPath, value) => toDecodedOperationResult(await invoke({
82
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS,
83
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.UPDATE_SETTING,
84
+ scope,
85
+ payload: {
86
+ key: OPENWAGGLE_EXTENSION_BROKER.SETTING_KEY.PROJECT_DISPLAY_NAME,
87
+ projectPath,
88
+ value,
89
+ },
90
+ }), isSettingsUpdateSettingResult, SETTINGS_RESULT_ERROR),
91
+ update: async (scope, settings) => toDecodedOperationResult(await invoke({
92
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS,
93
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.UPDATE_SETTINGS,
94
+ scope,
95
+ payload: settings,
96
+ }), isSettingsUpdateResult, SETTINGS_RESULT_ERROR),
97
+ };
98
+ }
99
+ export function createOpenWaggleSdk(invoke, options = {}) {
100
+ return {
101
+ state: createOpenWaggleStateSdk(invoke),
102
+ actions: {
103
+ openExternal: options.openExternal ?? unsupportedOpenExternal,
104
+ selectProject: async (scope, projectPath) => toDecodedOperationResult(await invoke({
105
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.ACTIONS,
106
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.SELECT_PROJECT,
107
+ scope,
108
+ payload: { projectPath },
109
+ }), isActionSelectProjectResult, ACTION_RESULT_ERROR),
110
+ },
111
+ settings: createOpenWaggleSettingsSdk(invoke),
112
+ docs: {
113
+ discover: async (scope, input = {}) => toDecodedOperationResult(await invoke({
114
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.DOCS,
115
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.DISCOVER_DOCS,
116
+ scope,
117
+ payload: input,
118
+ }), isDocsDiscoverResult, DOCS_RESULT_ERROR),
119
+ resolveTopic: async (scope, input) => toDecodedOperationResult(await invoke({
120
+ capability: OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.DOCS,
121
+ method: OPENWAGGLE_EXTENSION_BROKER.METHOD.RESOLVE_DOCS_TOPIC,
122
+ scope,
123
+ payload: input,
124
+ }), isDocsResolveTopicResult, DOCS_RESULT_ERROR),
125
+ },
126
+ };
127
+ }
@@ -0,0 +1,111 @@
1
+ import type { OPENWAGGLE_EXTENSION_BROKER } from './constants.js';
2
+ import type { ExtensionInvokeScope, ExtensionStateSelector } from './core-types.js';
3
+ export type { ExtensionDocsDiscoverPayload, ExtensionDocsDiscoverResult, ExtensionDocsResolveTopicPayload, ExtensionDocsResolveTopicResult, } from './docs.js';
4
+ export interface ExtensionModelPrefs {
5
+ readonly selectedModel: string;
6
+ readonly favoriteModels: readonly string[];
7
+ readonly enabledModels: readonly string[];
8
+ readonly thinkingLevel: string;
9
+ }
10
+ export interface ExtensionProjectView {
11
+ readonly projectPath: string;
12
+ readonly displayName: string | null;
13
+ readonly active: boolean;
14
+ }
15
+ export interface ExtensionSessionView {
16
+ readonly sessionId: string;
17
+ readonly title: string;
18
+ readonly projectPath: string | null;
19
+ }
20
+ export interface ExtensionBranchView {
21
+ readonly branchId: string;
22
+ readonly sessionId: string;
23
+ readonly name: string;
24
+ readonly main: boolean;
25
+ readonly archived: boolean;
26
+ }
27
+ export interface ExtensionStateReadResult {
28
+ readonly extensionId: string;
29
+ readonly contributionId: string;
30
+ readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE;
31
+ readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_STATE;
32
+ readonly scope: ExtensionInvokeScope;
33
+ readonly activeProjectPath: string | null;
34
+ readonly currentProject: ExtensionProjectView | null;
35
+ readonly currentSession: ExtensionSessionView | null;
36
+ readonly currentBranch: ExtensionBranchView | null;
37
+ readonly recentProjects: readonly string[];
38
+ readonly modelPreferences: ExtensionModelPrefs;
39
+ }
40
+ export interface ExtensionSelectedStateReadResult<TValue> {
41
+ readonly extensionId: string;
42
+ readonly contributionId: string;
43
+ readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.STATE;
44
+ readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.READ_STATE;
45
+ readonly scope: ExtensionInvokeScope;
46
+ readonly selector: ExtensionStateSelector;
47
+ readonly value: TValue;
48
+ }
49
+ export type ExtensionStateCurrentProjectReadResult = ExtensionSelectedStateReadResult<ExtensionProjectView | null>;
50
+ export type ExtensionStateCurrentSessionReadResult = ExtensionSelectedStateReadResult<ExtensionSessionView | null>;
51
+ export type ExtensionStateCurrentBranchReadResult = ExtensionSelectedStateReadResult<ExtensionBranchView | null>;
52
+ export type ExtensionStateRecentProjectsReadResult = ExtensionSelectedStateReadResult<readonly string[]>;
53
+ export type ExtensionStateModelPreferencesReadResult = ExtensionSelectedStateReadResult<ExtensionModelPrefs>;
54
+ export interface ExtensionActionSelectProjectResult {
55
+ readonly extensionId: string;
56
+ readonly contributionId: string;
57
+ readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.ACTIONS;
58
+ readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.SELECT_PROJECT;
59
+ readonly previousProjectPath: string | null;
60
+ readonly projectPath: string;
61
+ readonly recentProjects: readonly string[];
62
+ }
63
+ export interface ExtensionSettingsView {
64
+ readonly modelPreferences: ExtensionModelPrefs;
65
+ readonly projectDisplayNames: Readonly<Record<string, string>>;
66
+ }
67
+ export interface ExtensionModelPreferencesSettingsPatch {
68
+ readonly selectedModel?: string;
69
+ readonly favoriteModels?: readonly string[];
70
+ readonly enabledModels?: readonly string[];
71
+ readonly thinkingLevel?: string;
72
+ }
73
+ export type ExtensionSettingsUpdatePayload = ExtensionModelPreferencesSettingsPatch & {
74
+ readonly projectDisplayNames?: Readonly<Record<string, string>>;
75
+ };
76
+ export interface ExtensionSettingsGetResult {
77
+ readonly extensionId: string;
78
+ readonly contributionId: string;
79
+ readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS;
80
+ readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_SETTINGS;
81
+ readonly settings: ExtensionSettingsView;
82
+ }
83
+ export interface ExtensionSettingsUpdateResult {
84
+ readonly extensionId: string;
85
+ readonly contributionId: string;
86
+ readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS;
87
+ readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.UPDATE_SETTINGS;
88
+ readonly settings: ExtensionSettingsView;
89
+ }
90
+ export type ExtensionSettingsSelectedValue = {
91
+ readonly key: typeof OPENWAGGLE_EXTENSION_BROKER.SETTING_KEY.MODEL_PREFERENCES;
92
+ readonly value: ExtensionModelPrefs;
93
+ } | {
94
+ readonly key: typeof OPENWAGGLE_EXTENSION_BROKER.SETTING_KEY.PROJECT_DISPLAY_NAME;
95
+ readonly projectPath: string;
96
+ readonly value: string | null;
97
+ };
98
+ export interface ExtensionSettingsGetSettingResult {
99
+ readonly extensionId: string;
100
+ readonly contributionId: string;
101
+ readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS;
102
+ readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.GET_SETTING;
103
+ readonly setting: ExtensionSettingsSelectedValue;
104
+ }
105
+ export interface ExtensionSettingsUpdateSettingResult {
106
+ readonly extensionId: string;
107
+ readonly contributionId: string;
108
+ readonly capability: typeof OPENWAGGLE_EXTENSION_BROKER.CAPABILITY.SETTINGS;
109
+ readonly method: typeof OPENWAGGLE_EXTENSION_BROKER.METHOD.UPDATE_SETTING;
110
+ readonly setting: ExtensionSettingsSelectedValue;
111
+ }
@@ -0,0 +1 @@
1
+ export {};