primitive-functions 0.3.0-alpha.18 → 0.3.0-alpha.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "primitive-functions",
3
- "version": "0.3.0-alpha.18",
4
- "description": "The module a Primitive server function imports. Supplied by the platform at invoke time; reserved here so the name is ours before the runtime lands.",
3
+ "version": "0.3.0-alpha.19",
4
+ "description": "The module a Primitive server function imports, supplied by the platform at invoke time, and test doubles for its context and step (primitive-functions/testing).",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Primitive LLC",
7
7
  "type": "module",
@@ -12,11 +12,19 @@
12
12
  "types": "./index.d.ts",
13
13
  "import": "./index.js",
14
14
  "default": "./index.js"
15
+ },
16
+ "./testing": {
17
+ "types": "./testing.d.ts",
18
+ "import": "./testing.js",
19
+ "default": "./testing.js"
15
20
  }
16
21
  },
17
22
  "files": [
18
23
  "index.js",
19
24
  "index.d.ts",
25
+ "testing.js",
26
+ "testing.d.ts",
27
+ "testing-members.generated.js",
20
28
  "README.md"
21
29
  ],
22
30
  "publishConfig": {
@@ -0,0 +1,502 @@
1
+ // GENERATED by `pnpm functions:profile` (scripts/generate-function-profile.mjs)
2
+ // from the `primitive-functions` authoring types. Do not edit.
3
+ //
4
+ // Every member of `FunctionContext` and `FunctionStep`, for the test doubles in
5
+ // `testing.js`: "fn" is a function, "data" a required data member, "data?" an
6
+ // optional one, and a nested object a namespace.
7
+
8
+ export const TEST_MEMBERS = {
9
+ "ctx": {
10
+ "user": "data",
11
+ "trigger": "data",
12
+ "tool": "data?",
13
+ "runtime": "data",
14
+ "actionTokens": {
15
+ "sign": "fn"
16
+ },
17
+ "runId": "data",
18
+ "sliceId": "data",
19
+ "api": {
20
+ "agentSessions": {
21
+ "addMember": "fn",
22
+ "answer": "fn",
23
+ "attachArtifact": "fn",
24
+ "attachments": {
25
+ "downloadHeaders": "fn",
26
+ "download": "fn",
27
+ "upload": "fn"
28
+ },
29
+ "cancel": "fn",
30
+ "create": "fn",
31
+ "delete": "fn",
32
+ "get": "fn",
33
+ "list": "fn",
34
+ "markRead": "fn",
35
+ "recordEvent": "fn",
36
+ "removeMember": "fn",
37
+ "rename": "fn",
38
+ "send": "fn"
39
+ },
40
+ "analytics": {
41
+ "cohortRetention": "fn",
42
+ "dailyActive": "fn",
43
+ "db3Queries": "fn",
44
+ "errorGroups": "fn",
45
+ "integrationUsage": "fn",
46
+ "listEvents": "fn",
47
+ "listEventsGrouped": "fn",
48
+ "overviewDau": "fn",
49
+ "overviewGrowth": "fn",
50
+ "overviewMau": "fn",
51
+ "overviewWau": "fn",
52
+ "requests": "fn",
53
+ "rollingActive": "fn",
54
+ "searchUsers": "fn",
55
+ "topPrompts": "fn",
56
+ "topUsers": "fn",
57
+ "userDetail": "fn",
58
+ "userSnapshot": "fn",
59
+ "writeForUser": "fn"
60
+ },
61
+ "blobBuckets": {
62
+ "createBucket": "fn",
63
+ "delete": "fn",
64
+ "deleteBatch": "fn",
65
+ "deleteBucket": "fn",
66
+ "download": "fn",
67
+ "downloadHeaders": "fn",
68
+ "downloadSigned": "fn",
69
+ "get": "fn",
70
+ "getBucket": "fn",
71
+ "getSignedUrl": "fn",
72
+ "getSignedUrls": "fn",
73
+ "list": "fn",
74
+ "listBuckets": "fn",
75
+ "updateBucket": "fn",
76
+ "upload": "fn"
77
+ },
78
+ "channels": {
79
+ "authorize": "fn",
80
+ "publish": "fn"
81
+ },
82
+ "collections": {
83
+ "addDocument": "fn",
84
+ "addMember": "fn",
85
+ "create": "fn",
86
+ "delete": "fn",
87
+ "get": "fn",
88
+ "getAccess": "fn",
89
+ "grantGroupPermission": "fn",
90
+ "list": "fn",
91
+ "listByCustodian": "fn",
92
+ "listCollectionsForDocument": "fn",
93
+ "listDb3": "fn",
94
+ "listDocuments": "fn",
95
+ "listForUser": "fn",
96
+ "listMembers": "fn",
97
+ "listPendingInvitations": "fn",
98
+ "removeDocument": "fn",
99
+ "removeMember": "fn",
100
+ "resolveRole": "fn",
101
+ "revokeGroupPermission": "fn",
102
+ "revokePendingInvitation": "fn",
103
+ "setMemberRole": "fn",
104
+ "transfer": "fn",
105
+ "update": "fn"
106
+ },
107
+ "configVars": {
108
+ "get": "fn"
109
+ },
110
+ "connections": {
111
+ "send": "fn"
112
+ },
113
+ "databaseTypeConfigs": {
114
+ "create": "fn",
115
+ "delete": "fn",
116
+ "get": "fn",
117
+ "getReindexStatus": "fn",
118
+ "list": "fn",
119
+ "scaffoldSchema": "fn",
120
+ "update": "fn"
121
+ },
122
+ "databases": {
123
+ "addManager": "fn",
124
+ "create": "fn",
125
+ "delete": "fn",
126
+ "get": "fn",
127
+ "grantGroupPermission": "fn",
128
+ "list": "fn",
129
+ "listGroupPermissions": "fn",
130
+ "listPermissions": "fn",
131
+ "records": {
132
+ "addToSet": "fn",
133
+ "aggregate": "fn",
134
+ "batch": "fn",
135
+ "count": "fn",
136
+ "delete": "fn",
137
+ "describe": "fn",
138
+ "dropIndex": "fn",
139
+ "dropUniqueConstraint": "fn",
140
+ "increment": "fn",
141
+ "listIndexes": "fn",
142
+ "listUniqueConstraints": "fn",
143
+ "models": "fn",
144
+ "patch": "fn",
145
+ "query": "fn",
146
+ "registerIndex": "fn",
147
+ "registerUniqueConstraint": "fn",
148
+ "removeFromSet": "fn",
149
+ "save": "fn",
150
+ "syncIndexes": "fn"
151
+ },
152
+ "reindex": "fn",
153
+ "revokeGroupPermission": "fn",
154
+ "revokeGroupPermissionByType": "fn",
155
+ "revokePermission": "fn",
156
+ "transferOwnership": "fn",
157
+ "update": "fn"
158
+ },
159
+ "db3": {
160
+ "abortIngest": "fn",
161
+ "addTag": "fn",
162
+ "aliases": {
163
+ "delete": "fn",
164
+ "listForDocument": "fn",
165
+ "resolve": "fn",
166
+ "set": "fn"
167
+ },
168
+ "approveAccessRequest": "fn",
169
+ "blobs": {
170
+ "delete": "fn",
171
+ "downloadHeaders": "fn",
172
+ "downloadPublic": "fn",
173
+ "downloadSigned": "fn",
174
+ "download": "fn",
175
+ "get": "fn",
176
+ "getSignedUrls": "fn",
177
+ "list": "fn",
178
+ "signedUploadUrl": "fn",
179
+ "upload": "fn"
180
+ },
181
+ "clearLinkAccess": "fn",
182
+ "commitIngest": "fn",
183
+ "create": "fn",
184
+ "createIngest": "fn",
185
+ "delete": "fn",
186
+ "denyAccessRequest": "fn",
187
+ "exportChain": "fn",
188
+ "get": "fn",
189
+ "getAppAccess": "fn",
190
+ "getIngest": "fn",
191
+ "getLinkAccess": "fn",
192
+ "getOrCreateWithAlias": "fn",
193
+ "getPermissions": "fn",
194
+ "getSchema": "fn",
195
+ "getSnapshot": "fn",
196
+ "getStats": "fn",
197
+ "getSync": "fn",
198
+ "getType": "fn",
199
+ "grantGroupPermission": "fn",
200
+ "indexes": {
201
+ "drop": "fn",
202
+ "list": "fn",
203
+ "model": {
204
+ "delete": "fn",
205
+ "get": "fn",
206
+ "upload": "fn"
207
+ },
208
+ "register": "fn"
209
+ },
210
+ "listAccessRequests": "fn",
211
+ "listGroupPermissions": "fn",
212
+ "listHeldByUser": "fn",
213
+ "listIngests": "fn",
214
+ "listPendingInvitations": "fn",
215
+ "listSharedWithUser": "fn",
216
+ "listSnapshots": "fn",
217
+ "records": {
218
+ "aggregate": "fn",
219
+ "batch": "fn",
220
+ "batchRead": "fn",
221
+ "clear": "fn",
222
+ "count": "fn",
223
+ "delete": "fn",
224
+ "explain": "fn",
225
+ "increment": "fn",
226
+ "patch": "fn",
227
+ "query": "fn",
228
+ "save": "fn"
229
+ },
230
+ "removePermissionByEmail": "fn",
231
+ "removePermissionByUserId": "fn",
232
+ "removeTag": "fn",
233
+ "requestAccess": "fn",
234
+ "requestSnapshot": "fn",
235
+ "revokeGroupPermission": "fn",
236
+ "revokePendingInvitation": "fn",
237
+ "room": "fn",
238
+ "setAppAccess": "fn",
239
+ "setLinkAccess": "fn",
240
+ "setOwnerRow": "fn",
241
+ "setPublicAccess": "fn",
242
+ "setSync": "fn",
243
+ "setType": "fn",
244
+ "transfer": "fn",
245
+ "update": "fn",
246
+ "updatePermissions": "fn",
247
+ "uploadIngestChunk": "fn",
248
+ "validateAccess": "fn"
249
+ },
250
+ "documents": {
251
+ "abortIngest": "fn",
252
+ "addTag": "fn",
253
+ "aliases": {
254
+ "delete": "fn",
255
+ "listForDocument": "fn",
256
+ "resolve": "fn",
257
+ "set": "fn"
258
+ },
259
+ "approveAccessRequest": "fn",
260
+ "blobs": {
261
+ "delete": "fn",
262
+ "downloadHeaders": "fn",
263
+ "download": "fn",
264
+ "get": "fn",
265
+ "list": "fn",
266
+ "upload": "fn"
267
+ },
268
+ "clearLinkAccess": "fn",
269
+ "commitIngest": "fn",
270
+ "create": "fn",
271
+ "createIngest": "fn",
272
+ "createWithAlias": "fn",
273
+ "debugDumpUpdates": "fn",
274
+ "debugMerge": "fn",
275
+ "debugMergeBlock": "fn",
276
+ "debugRestore": "fn",
277
+ "debugStats": "fn",
278
+ "delete": "fn",
279
+ "denyAccessRequest": "fn",
280
+ "exportChain": "fn",
281
+ "exportState": "fn",
282
+ "get": "fn",
283
+ "getImportChainStatus": "fn",
284
+ "getIngest": "fn",
285
+ "getLinkAccess": "fn",
286
+ "getOrCreateWithAlias": "fn",
287
+ "getPermissions": "fn",
288
+ "getSchema": "fn",
289
+ "getSnapshot": "fn",
290
+ "getStats": "fn",
291
+ "grantGroupPermission": "fn",
292
+ "importChain": "fn",
293
+ "importChainArtifact": "fn",
294
+ "importState": "fn",
295
+ "listAccessRequests": "fn",
296
+ "listGroupPermissions": "fn",
297
+ "listIngests": "fn",
298
+ "listOwnedByUser": "fn",
299
+ "listPendingInvitations": "fn",
300
+ "listSharedWithUser": "fn",
301
+ "listSnapshots": "fn",
302
+ "open": "fn",
303
+ "records": {
304
+ "aggregate": "fn",
305
+ "batch": "fn",
306
+ "count": "fn",
307
+ "delete": "fn",
308
+ "patch": "fn",
309
+ "query": "fn",
310
+ "save": "fn"
311
+ },
312
+ "removePermissionByEmail": "fn",
313
+ "removePermissionByUserId": "fn",
314
+ "removeTag": "fn",
315
+ "requestAccess": "fn",
316
+ "requestSnapshot": "fn",
317
+ "revokeGroupPermission": "fn",
318
+ "revokeGroupPermissionByType": "fn",
319
+ "revokePendingInvitation": "fn",
320
+ "room": "fn",
321
+ "setLinkAccess": "fn",
322
+ "transferOwnership": "fn",
323
+ "update": "fn",
324
+ "updatePermissions": "fn",
325
+ "uploadIngestChunk": "fn",
326
+ "validateAccess": "fn"
327
+ },
328
+ "email": {
329
+ "send": "fn"
330
+ },
331
+ "functions": {
332
+ "getStatus": "fn",
333
+ "getStatusByRunKey": "fn",
334
+ "invoke": "fn",
335
+ "invokeAsSystem": "fn",
336
+ "listRunSteps": "fn",
337
+ "listRuns": "fn",
338
+ "logs": "fn",
339
+ "start": "fn",
340
+ "startAsSystem": "fn",
341
+ "terminate": "fn"
342
+ },
343
+ "groups": {
344
+ "addMember": "fn",
345
+ "addMemberByType": "fn",
346
+ "create": "fn",
347
+ "delete": "fn",
348
+ "deleteByType": "fn",
349
+ "get": "fn",
350
+ "getByType": "fn",
351
+ "list": "fn",
352
+ "listByCustodian": "fn",
353
+ "listDatabases": "fn",
354
+ "listDatabasesByType": "fn",
355
+ "listDb3": "fn",
356
+ "listDb3ByType": "fn",
357
+ "listDocuments": "fn",
358
+ "listDocumentsByType": "fn",
359
+ "listMembers": "fn",
360
+ "listMembersByType": "fn",
361
+ "listPendingInvitations": "fn",
362
+ "listPendingInvitationsByType": "fn",
363
+ "listUserMemberships": "fn",
364
+ "removeMember": "fn",
365
+ "removeMemberByEmail": "fn",
366
+ "removeMemberByEmailByType": "fn",
367
+ "removeMemberByType": "fn",
368
+ "revokePendingInvitation": "fn",
369
+ "revokePendingInvitationByType": "fn",
370
+ "setMemberRole": "fn",
371
+ "transfer": "fn",
372
+ "update": "fn",
373
+ "updateByType": "fn"
374
+ },
375
+ "integrations": {
376
+ "call": "fn",
377
+ "list": "fn"
378
+ },
379
+ "invitations": {
380
+ "accept": "fn",
381
+ "create": "fn",
382
+ "delete": "fn",
383
+ "get": "fn",
384
+ "getBy": "fn",
385
+ "list": "fn",
386
+ "quota": "fn"
387
+ },
388
+ "locks": {
389
+ "forceRelease": "fn",
390
+ "list": "fn",
391
+ "release": "fn",
392
+ "renew": "fn",
393
+ "status": "fn",
394
+ "tryAcquire": "fn"
395
+ },
396
+ "notifications": {
397
+ "list": "fn",
398
+ "listDevices": "fn",
399
+ "markAllRead": "fn",
400
+ "markRead": "fn",
401
+ "registerDevice": "fn",
402
+ "send": "fn",
403
+ "unreadCount": "fn",
404
+ "unregisterDevice": "fn"
405
+ },
406
+ "prompts": {
407
+ "run": "fn"
408
+ },
409
+ "resourceMetadata": {
410
+ "delete": "fn",
411
+ "get": "fn",
412
+ "getBatch": "fn",
413
+ "list": "fn",
414
+ "resolve": "fn",
415
+ "set": "fn"
416
+ },
417
+ "secrets": {
418
+ "get": "fn"
419
+ },
420
+ "usage": {
421
+ "forUser": "fn"
422
+ },
423
+ "users": {
424
+ "aggregate": "fn",
425
+ "count": "fn",
426
+ "forEachBatch": "fn",
427
+ "get": "fn",
428
+ "getBasic": "fn",
429
+ "getBy": "fn",
430
+ "getProfiles": "fn",
431
+ "getRootDocument": "fn",
432
+ "list": "fn",
433
+ "lookup": "fn",
434
+ "query": "fn",
435
+ "remove": "fn",
436
+ "send": "fn",
437
+ "setProfile": "fn",
438
+ "setProperties": "fn",
439
+ "setRole": "fn"
440
+ }
441
+ },
442
+ "db": "fn",
443
+ "db3": "fn",
444
+ "doc": "fn",
445
+ "integrations": {
446
+ "call": "fn"
447
+ },
448
+ "functions": {
449
+ "start": "fn"
450
+ },
451
+ "prompts": {
452
+ "run": "fn"
453
+ },
454
+ "agents": {
455
+ "createSession": "fn",
456
+ "getSession": "fn",
457
+ "listSessions": "fn",
458
+ "recordEvent": "fn",
459
+ "deleteSession": "fn"
460
+ },
461
+ "usage": {
462
+ "forUser": "fn"
463
+ },
464
+ "secret": "fn",
465
+ "configVar": "fn",
466
+ "users": {
467
+ "list": "fn",
468
+ "iterate": "fn",
469
+ "query": "fn",
470
+ "count": "fn",
471
+ "aggregate": "fn",
472
+ "forEachBatch": "fn",
473
+ "send": "fn",
474
+ "get": "fn",
475
+ "getBy": "fn",
476
+ "setProperties": "fn",
477
+ "addToSet": "fn",
478
+ "removeFromSet": "fn"
479
+ },
480
+ "invitations": {
481
+ "getBy": "fn"
482
+ },
483
+ "connections": {
484
+ "send": "fn"
485
+ },
486
+ "channels": {
487
+ "authorize": "fn",
488
+ "publish": "fn"
489
+ },
490
+ "locks": {
491
+ "acquire": "fn",
492
+ "release": "fn",
493
+ "withLock": "fn"
494
+ }
495
+ },
496
+ "step": {
497
+ "do": "fn",
498
+ "sleep": "fn",
499
+ "sleepUntil": "fn",
500
+ "waitForEvent": "fn"
501
+ }
502
+ };