@positronic/spec 0.0.56 → 0.0.57

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 (68) hide show
  1. package/dist/{api.d.ts → api/brains.d.ts} +2 -160
  2. package/dist/api/brains.d.ts.map +1 -0
  3. package/dist/{api.js → api/brains.js} +18 -1234
  4. package/dist/api/brains.js.map +1 -0
  5. package/dist/api/bundle.d.ts +17 -0
  6. package/dist/api/bundle.d.ts.map +1 -0
  7. package/dist/api/bundle.js +56 -0
  8. package/dist/api/bundle.js.map +1 -0
  9. package/dist/api/index.d.ts +12 -0
  10. package/dist/api/index.d.ts.map +1 -0
  11. package/dist/api/index.js +11 -0
  12. package/dist/api/index.js.map +1 -0
  13. package/dist/api/pages.d.ts +46 -0
  14. package/dist/api/pages.d.ts.map +1 -0
  15. package/dist/api/pages.js +338 -0
  16. package/dist/api/pages.js.map +1 -0
  17. package/dist/api/resources.d.ts +28 -0
  18. package/dist/api/resources.d.ts.map +1 -0
  19. package/dist/api/resources.js +272 -0
  20. package/dist/api/resources.js.map +1 -0
  21. package/dist/api/schedules.d.ts +20 -0
  22. package/dist/api/schedules.d.ts.map +1 -0
  23. package/dist/api/schedules.js +159 -0
  24. package/dist/api/schedules.js.map +1 -0
  25. package/dist/api/secrets.d.ts +27 -0
  26. package/dist/api/secrets.d.ts.map +1 -0
  27. package/dist/api/secrets.js +175 -0
  28. package/dist/api/secrets.js.map +1 -0
  29. package/dist/api/signals.d.ts +53 -0
  30. package/dist/api/signals.d.ts.map +1 -0
  31. package/dist/api/signals.js +276 -0
  32. package/dist/api/signals.js.map +1 -0
  33. package/dist/api/status.d.ts +3 -0
  34. package/dist/api/status.d.ts.map +1 -0
  35. package/dist/api/status.js +23 -0
  36. package/dist/api/status.js.map +1 -0
  37. package/dist/api/types.d.ts +2 -0
  38. package/dist/api/types.d.ts.map +1 -0
  39. package/dist/api/types.js +2 -0
  40. package/dist/api/types.js.map +1 -0
  41. package/dist/api/users.d.ts +43 -0
  42. package/dist/api/users.d.ts.map +1 -0
  43. package/dist/api/users.js +221 -0
  44. package/dist/api/users.js.map +1 -0
  45. package/dist/api/webhooks.d.ts +30 -0
  46. package/dist/api/webhooks.d.ts.map +1 -0
  47. package/dist/api/webhooks.js +208 -0
  48. package/dist/api/webhooks.js.map +1 -0
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/index.js.map +1 -1
  53. package/dist/src/{api.js → api/brains.js} +1378 -4108
  54. package/dist/src/api/bundle.js +228 -0
  55. package/dist/src/api/index.js +10 -0
  56. package/dist/src/api/pages.js +840 -0
  57. package/dist/src/api/resources.js +707 -0
  58. package/dist/src/api/schedules.js +479 -0
  59. package/dist/src/api/secrets.js +518 -0
  60. package/dist/src/api/signals.js +778 -0
  61. package/dist/src/api/status.js +180 -0
  62. package/dist/src/api/types.js +1 -0
  63. package/dist/src/api/users.js +650 -0
  64. package/dist/src/api/webhooks.js +639 -0
  65. package/dist/src/index.js +1 -1
  66. package/package.json +1 -1
  67. package/dist/api.d.ts.map +0 -1
  68. package/dist/api.js.map +0 -1
@@ -1,31 +1,4 @@
1
- type Fetch = (request: Request) => Promise<Response>;
2
- export declare function testStatus(fetch: Fetch): Promise<boolean>;
3
- export declare const resources: {
4
- /**
5
- * Test GET /resources - List all resources
6
- */
7
- list(fetch: Fetch): Promise<boolean>;
8
- /**
9
- * Test POST /resources - Upload a resource
10
- */
11
- upload(fetch: Fetch): Promise<boolean>;
12
- /**
13
- * Test DELETE /resources/:key - Delete a specific resource
14
- */
15
- delete(fetch: Fetch, key: string): Promise<boolean>;
16
- /**
17
- * Test DELETE /resources - Bulk delete all resources (dev mode only)
18
- */
19
- deleteAll(fetch: Fetch): Promise<boolean>;
20
- /**
21
- * Test DELETE /resources preserves pages - bulk delete should not delete pages
22
- */
23
- deleteAllPreservesPages(fetch: Fetch): Promise<boolean>;
24
- /**
25
- * Test POST /resources/presigned-link - Generate presigned URL for upload
26
- */
27
- generatePresignedLink(fetch: Fetch): Promise<boolean>;
28
- };
1
+ import type { Fetch } from './types.js';
29
2
  export declare const brains: {
30
3
  /**
31
4
  * Test POST /brains/runs - Create a new brain run
@@ -152,135 +125,4 @@ export declare const brains: {
152
125
  */
153
126
  innerBrainCompleteDoesNotAffectOuterStatus(fetch: Fetch, outerBrainIdentifier: string, webhookSlug: string, webhookPayload: Record<string, any>): Promise<boolean>;
154
127
  };
155
- export declare const schedules: {
156
- /**
157
- * Test POST /brains/schedules - Create a new schedule
158
- */
159
- create(fetch: Fetch, identifier: string, cronExpression: string): Promise<string | null>;
160
- /**
161
- * Test GET /brains/schedules - List all schedules
162
- */
163
- list(fetch: Fetch): Promise<boolean>;
164
- /**
165
- * Test DELETE /brains/schedules/:scheduleId - Delete a schedule
166
- */
167
- delete(fetch: Fetch, scheduleId: string): Promise<boolean>;
168
- /**
169
- * Test GET /brains/schedules/runs - Get history of scheduled runs
170
- */
171
- runs(fetch: Fetch, scheduleId?: string, limit?: number): Promise<boolean>;
172
- };
173
- export declare const secrets: {
174
- /**
175
- * Test POST /secrets - Create or update a secret
176
- */
177
- create(fetch: Fetch, name: string, value: string): Promise<boolean>;
178
- /**
179
- * Test GET /secrets - List all secrets (names only, not values)
180
- */
181
- list(fetch: Fetch): Promise<boolean>;
182
- /**
183
- * Test DELETE /secrets/:name - Delete a specific secret
184
- */
185
- delete(fetch: Fetch, name: string): Promise<boolean>;
186
- /**
187
- * Test GET /secrets/:name/exists - Check if a secret exists
188
- */
189
- exists(fetch: Fetch, name: string): Promise<boolean>;
190
- /**
191
- * Test POST /secrets/bulk - Create multiple secrets
192
- */
193
- bulk(fetch: Fetch, secrets: Array<{
194
- name: string;
195
- value: string;
196
- }>): Promise<boolean>;
197
- };
198
- export declare const webhooks: {
199
- /**
200
- * Test GET /webhooks - List all available webhook handlers
201
- */
202
- list(fetch: Fetch): Promise<boolean>;
203
- /**
204
- * Test POST /webhooks/:slug - Receive an incoming webhook from an external service
205
- */
206
- receive(fetch: Fetch, slug: string, payload: any): Promise<boolean>;
207
- /**
208
- * Test POST /webhooks/:slug with non-existent webhook - Should return 404
209
- */
210
- notFound(fetch: Fetch, slug: string): Promise<boolean>;
211
- /**
212
- * Test POST /webhooks/system/ui-form - Built-in webhook for UI form submissions.
213
- * This is used by pages generated via .ui() steps to submit form data.
214
- *
215
- * The endpoint:
216
- * - Accepts form data (application/x-www-form-urlencoded or multipart/form-data)
217
- * - Requires an `identifier` query parameter to match the waiting brain
218
- * - Returns { received: true, action: 'resumed' | 'not_found', ... }
219
- */
220
- uiForm(fetch: Fetch, identifier: string, formData: Record<string, string | string[]>): Promise<boolean>;
221
- /**
222
- * Test POST /webhooks/system/ui-form with missing identifier - Should return 400
223
- */
224
- uiFormMissingIdentifier(fetch: Fetch): Promise<boolean>;
225
- };
226
- export declare const pages: {
227
- /**
228
- * Test GET /pages - List all pages
229
- */
230
- list(fetch: Fetch): Promise<boolean>;
231
- /**
232
- * Test POST /pages - Create a new page
233
- */
234
- create(fetch: Fetch, slug: string, html: string, brainRunId: string, options?: {
235
- persist?: boolean;
236
- ttl?: number;
237
- }): Promise<string | null>;
238
- /**
239
- * Test GET /pages/:slug - Get page HTML content
240
- */
241
- get(fetch: Fetch, slug: string): Promise<string | null>;
242
- /**
243
- * Test GET /pages/:slug/meta - Get page metadata
244
- */
245
- getMeta(fetch: Fetch, slug: string): Promise<{
246
- slug: string;
247
- brainRunId: string;
248
- persist: boolean;
249
- ttl?: number;
250
- createdAt: string;
251
- size: number;
252
- } | null>;
253
- /**
254
- * Test PUT /pages/:slug - Update page HTML content
255
- */
256
- update(fetch: Fetch, slug: string, html: string): Promise<boolean>;
257
- /**
258
- * Test DELETE /pages/:slug - Delete a page
259
- */
260
- delete(fetch: Fetch, slug: string): Promise<boolean>;
261
- /**
262
- * Test GET /pages/:slug with non-existent page - Should return 404
263
- */
264
- notFound(fetch: Fetch, slug: string): Promise<boolean>;
265
- /**
266
- * Test DELETE /pages/:slug preserves resources - deleting a page should not delete resources
267
- */
268
- deletePreservesResources(fetch: Fetch): Promise<boolean>;
269
- };
270
- /**
271
- * Bundle API Tests
272
- *
273
- * Tests for the /bundle/components.js endpoint which serves the component bundle.
274
- *
275
- * NOTE: These tests only verify the API endpoint behavior. The bundle build and
276
- * upload process is backend-specific and must be tested separately by each
277
- * backend implementation.
278
- */
279
- export declare const bundle: {
280
- /**
281
- * Test GET /bundle/components.js - Serve the component bundle
282
- */
283
- get(fetch: Fetch): Promise<boolean>;
284
- };
285
- export {};
286
- //# sourceMappingURL=api.d.ts.map
128
+ //# sourceMappingURL=brains.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brains.d.ts","sourceRoot":"","sources":["../../src/api/brains.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,eAAO,MAAM,MAAM;IACjB;;OAEG;eAEM,KAAK,cACA,MAAM,YACR,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAwCzB;;OAEG;0BAEM,KAAK,cACA,MAAM,WACT,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAmCzB;;OAEG;uBAEM,KAAK,yBACW,MAAM,GAC5B,OAAO,CAAC,OAAO,CAAC;IAuDnB;;OAEG;iBACgB,KAAK,SAAS,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA2D1D;;OAEG;mBAEM,KAAK,cACA,MAAM,UACV,MAAM,GACb,OAAO,CAAC,OAAO,CAAC;IA2DnB;;OAEG;oBACmB,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;IAsD9C;;OAEG;gBACe,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;IA6D1C;;;;;OAKG;kBAEM,KAAK,SACL,MAAM,GACZ,OAAO,CAAC;QACT,MAAM,EAA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