@contractspec/example.pocket-family-office 3.7.17 → 3.7.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 (64) hide show
  1. package/dist/blueprint.js +1 -197
  2. package/dist/browser/blueprint.js +1 -197
  3. package/dist/browser/connections/samples.js +1 -197
  4. package/dist/browser/docs/index.js +3 -48
  5. package/dist/browser/docs/pocket-family-office.docblock.js +3 -48
  6. package/dist/browser/example.js +1 -42
  7. package/dist/browser/index.js +4 -1660
  8. package/dist/browser/knowledge/sources.sample.js +1 -70
  9. package/dist/browser/operations/index.js +1 -314
  10. package/dist/browser/pocket-family-office.capability.js +1 -19
  11. package/dist/browser/pocket-family-office.feature.js +2 -86
  12. package/dist/browser/telemetry.js +1 -176
  13. package/dist/browser/tenant.sample.js +1 -71
  14. package/dist/browser/workflows/generate-financial-summary.js +1 -58
  15. package/dist/browser/workflows/generate-openbanking-overview.js +1 -52
  16. package/dist/browser/workflows/index.js +1 -467
  17. package/dist/browser/workflows/ingest-email-threads.js +1 -56
  18. package/dist/browser/workflows/process-uploaded-document.js +1 -54
  19. package/dist/browser/workflows/refresh-openbanking-balances.js +1 -64
  20. package/dist/browser/workflows/sync-openbanking-accounts.js +1 -64
  21. package/dist/browser/workflows/sync-openbanking-transactions.js +1 -64
  22. package/dist/browser/workflows/upcoming-payments-reminder.js +1 -62
  23. package/dist/connections/samples.js +1 -197
  24. package/dist/docs/index.js +3 -48
  25. package/dist/docs/pocket-family-office.docblock.js +3 -48
  26. package/dist/example.js +1 -42
  27. package/dist/index.js +4 -1660
  28. package/dist/knowledge/sources.sample.js +1 -70
  29. package/dist/node/blueprint.js +1 -197
  30. package/dist/node/connections/samples.js +1 -197
  31. package/dist/node/docs/index.js +3 -48
  32. package/dist/node/docs/pocket-family-office.docblock.js +3 -48
  33. package/dist/node/example.js +1 -42
  34. package/dist/node/index.js +4 -1660
  35. package/dist/node/knowledge/sources.sample.js +1 -70
  36. package/dist/node/operations/index.js +1 -314
  37. package/dist/node/pocket-family-office.capability.js +1 -19
  38. package/dist/node/pocket-family-office.feature.js +2 -86
  39. package/dist/node/telemetry.js +1 -176
  40. package/dist/node/tenant.sample.js +1 -71
  41. package/dist/node/workflows/generate-financial-summary.js +1 -58
  42. package/dist/node/workflows/generate-openbanking-overview.js +1 -52
  43. package/dist/node/workflows/index.js +1 -467
  44. package/dist/node/workflows/ingest-email-threads.js +1 -56
  45. package/dist/node/workflows/process-uploaded-document.js +1 -54
  46. package/dist/node/workflows/refresh-openbanking-balances.js +1 -64
  47. package/dist/node/workflows/sync-openbanking-accounts.js +1 -64
  48. package/dist/node/workflows/sync-openbanking-transactions.js +1 -64
  49. package/dist/node/workflows/upcoming-payments-reminder.js +1 -62
  50. package/dist/operations/index.js +1 -314
  51. package/dist/pocket-family-office.capability.js +1 -19
  52. package/dist/pocket-family-office.feature.js +2 -86
  53. package/dist/telemetry.js +1 -176
  54. package/dist/tenant.sample.js +1 -71
  55. package/dist/workflows/generate-financial-summary.js +1 -58
  56. package/dist/workflows/generate-openbanking-overview.js +1 -52
  57. package/dist/workflows/index.js +1 -467
  58. package/dist/workflows/ingest-email-threads.js +1 -56
  59. package/dist/workflows/process-uploaded-document.js +1 -54
  60. package/dist/workflows/refresh-openbanking-balances.js +1 -64
  61. package/dist/workflows/sync-openbanking-accounts.js +1 -64
  62. package/dist/workflows/sync-openbanking-transactions.js +1 -64
  63. package/dist/workflows/upcoming-payments-reminder.js +1 -62
  64. package/package.json +7 -7
@@ -1,467 +1 @@
1
- // src/workflows/generate-financial-summary.ts
2
- import {
3
- OwnersEnum,
4
- StabilityEnum,
5
- TagsEnum
6
- } from "@contractspec/lib.contracts-spec";
7
- import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow/spec";
8
- var generateFinancialSummaryWorkflow = defineWorkflow({
9
- meta: {
10
- key: "pfo.workflow.generate-financial-summary",
11
- version: "1.0.0",
12
- title: "Generate Financial Summary",
13
- description: "Retrieves the latest financial signals, generates an AI summary, and optionally distributes it by voice or email.",
14
- domain: "finance",
15
- owners: [OwnersEnum.PlatformFinance],
16
- tags: ["summary", "ai", TagsEnum.Automation],
17
- stability: StabilityEnum.Beta
18
- },
19
- definition: {
20
- entryStepId: "summarise",
21
- steps: [
22
- {
23
- id: "summarise",
24
- type: "automation",
25
- label: "Generate Summary",
26
- description: "Run retrieval augmented generation over the knowledge base to produce a household summary.",
27
- action: {
28
- operation: { key: "pfo.summary.generate", version: "1.0.0" }
29
- },
30
- requiredIntegrations: ["primaryLLM", "primaryVectorDb"],
31
- retry: {
32
- maxAttempts: 3,
33
- backoff: "exponential",
34
- delayMs: 750
35
- }
36
- },
37
- {
38
- id: "distribute",
39
- type: "automation",
40
- label: "Distribute Summary",
41
- description: "Send the generated summary via email and optionally synthesise a voice note.",
42
- action: {
43
- operation: { key: "pfo.summary.dispatch", version: "1.0.0" }
44
- },
45
- requiredIntegrations: ["emailOutbound"],
46
- retry: {
47
- maxAttempts: 2,
48
- backoff: "linear",
49
- delayMs: 500
50
- }
51
- }
52
- ],
53
- transitions: [{ from: "summarise", to: "distribute" }]
54
- }
55
- });
56
-
57
- // src/workflows/generate-openbanking-overview.ts
58
- import {
59
- OwnersEnum as OwnersEnum2,
60
- StabilityEnum as StabilityEnum2,
61
- TagsEnum as TagsEnum2
62
- } from "@contractspec/lib.contracts-spec";
63
- import { defineWorkflow as defineWorkflow2 } from "@contractspec/lib.contracts-spec/workflow/spec";
64
- var OPEN_BANKING_CAPABILITIES = [
65
- { key: "openbanking.accounts.read", version: "1.0.0" },
66
- { key: "openbanking.transactions.read", version: "1.0.0" },
67
- { key: "openbanking.balances.read", version: "1.0.0" }
68
- ];
69
- var generateOpenBankingOverviewWorkflow = defineWorkflow2({
70
- meta: {
71
- key: "pfo.workflow.generate-openbanking-overview",
72
- version: "1.0.0",
73
- title: "Generate Open Banking Overview",
74
- description: "Produces a derived financial overview and stores it in the operational knowledge space.",
75
- domain: "finance",
76
- owners: [OwnersEnum2.PlatformFinance],
77
- tags: ["open-banking", "summary", TagsEnum2.Automation],
78
- stability: StabilityEnum2.Experimental
79
- },
80
- definition: {
81
- entryStepId: "generate-overview",
82
- steps: [
83
- {
84
- id: "generate-overview",
85
- type: "automation",
86
- label: "Generate Overview",
87
- description: "Aggregate balances, cashflow, and category breakdowns into a knowledge entry.",
88
- action: {
89
- operation: {
90
- key: "pfo.openbanking.generate-overview",
91
- version: "1.0.0"
92
- }
93
- },
94
- requiredIntegrations: ["primaryOpenBanking"],
95
- requiredCapabilities: OPEN_BANKING_CAPABILITIES,
96
- retry: {
97
- maxAttempts: 3,
98
- backoff: "exponential",
99
- delayMs: 1500
100
- }
101
- }
102
- ],
103
- transitions: []
104
- }
105
- });
106
-
107
- // src/workflows/ingest-email-threads.ts
108
- import {
109
- OwnersEnum as OwnersEnum3,
110
- StabilityEnum as StabilityEnum3,
111
- TagsEnum as TagsEnum3
112
- } from "@contractspec/lib.contracts-spec";
113
- import { defineWorkflow as defineWorkflow3 } from "@contractspec/lib.contracts-spec/workflow/spec";
114
- var ingestEmailThreadsWorkflow = defineWorkflow3({
115
- meta: {
116
- key: "pfo.workflow.ingest-email-threads",
117
- version: "1.0.0",
118
- title: "Ingest Email Threads",
119
- description: "Synchronises Gmail threads tagged with finance labels and indexes them into operational knowledge spaces.",
120
- domain: "communications",
121
- owners: [OwnersEnum3.PlatformMessaging],
122
- tags: ["gmail", "knowledge", TagsEnum3.Automation],
123
- stability: StabilityEnum3.Experimental
124
- },
125
- definition: {
126
- entryStepId: "sync",
127
- steps: [
128
- {
129
- id: "sync",
130
- type: "automation",
131
- label: "Sync Gmail Threads",
132
- description: "Fetches Gmail threads and transforms them into knowledge fragments before vector indexing.",
133
- action: {
134
- operation: { key: "pfo.email.sync-threads", version: "1.0.0" }
135
- },
136
- requiredIntegrations: ["emailInbound", "primaryVectorDb"],
137
- retry: {
138
- maxAttempts: 3,
139
- backoff: "exponential",
140
- delayMs: 1000
141
- }
142
- },
143
- {
144
- id: "triage",
145
- type: "human",
146
- label: "Triage Exceptions",
147
- description: "Operators can resolve sync failures or tag important threads for follow-up."
148
- }
149
- ],
150
- transitions: [
151
- {
152
- from: "sync",
153
- to: "triage",
154
- condition: "output?.syncedThreads === 0",
155
- label: "No new threads"
156
- }
157
- ]
158
- }
159
- });
160
-
161
- // src/workflows/process-uploaded-document.ts
162
- import {
163
- OwnersEnum as OwnersEnum4,
164
- StabilityEnum as StabilityEnum4,
165
- TagsEnum as TagsEnum4
166
- } from "@contractspec/lib.contracts-spec";
167
- import { defineWorkflow as defineWorkflow4 } from "@contractspec/lib.contracts-spec/workflow/spec";
168
- var processUploadedDocumentWorkflow = defineWorkflow4({
169
- meta: {
170
- key: "pfo.workflow.process-uploaded-document",
171
- version: "1.0.0",
172
- title: "Process Uploaded Document",
173
- description: "Stores an uploaded invoice/contract, queues ingestion, and records any follow-up reminders.",
174
- domain: "finance",
175
- owners: [OwnersEnum4.PlatformFinance],
176
- tags: ["documents", "ingestion", TagsEnum4.Automation],
177
- stability: StabilityEnum4.Experimental
178
- },
179
- definition: {
180
- entryStepId: "store",
181
- steps: [
182
- {
183
- id: "store",
184
- type: "automation",
185
- label: "Store and Queue Ingestion",
186
- description: "Persist the document to storage and enqueue the knowledge ingestion pipeline.",
187
- action: {
188
- operation: { key: "pfo.documents.upload", version: "1.0.0" }
189
- },
190
- requiredIntegrations: ["primaryStorage", "primaryVectorDb"],
191
- retry: {
192
- maxAttempts: 3,
193
- backoff: "exponential",
194
- delayMs: 500
195
- }
196
- },
197
- {
198
- id: "review",
199
- type: "human",
200
- label: "Optional Human Classification",
201
- description: "Finance lead can categorise the document while ingestion completes."
202
- }
203
- ],
204
- transitions: [
205
- {
206
- from: "store",
207
- to: "review"
208
- }
209
- ]
210
- }
211
- });
212
-
213
- // src/workflows/refresh-openbanking-balances.ts
214
- import {
215
- OwnersEnum as OwnersEnum5,
216
- StabilityEnum as StabilityEnum5,
217
- TagsEnum as TagsEnum5
218
- } from "@contractspec/lib.contracts-spec";
219
- import { defineWorkflow as defineWorkflow5 } from "@contractspec/lib.contracts-spec/workflow/spec";
220
- var BALANCE_CAPABILITY = {
221
- key: "openbanking.balances.read",
222
- version: "1.0.0"
223
- };
224
- var refreshOpenBankingBalancesWorkflow = defineWorkflow5({
225
- meta: {
226
- key: "pfo.workflow.refresh-openbanking-balances",
227
- version: "1.0.0",
228
- title: "Refresh Open Banking Balances",
229
- description: "Refreshes balances for synced accounts to surface the latest cash positions in dashboards.",
230
- domain: "finance",
231
- owners: [OwnersEnum5.PlatformFinance],
232
- tags: ["open-banking", "powens", TagsEnum5.Automation],
233
- stability: StabilityEnum5.Experimental
234
- },
235
- definition: {
236
- entryStepId: "refresh-balances",
237
- steps: [
238
- {
239
- id: "refresh-balances",
240
- type: "automation",
241
- label: "Refresh Balances",
242
- description: "Trigger the Powens provider to obtain current and available balances.",
243
- action: {
244
- operation: { key: "openbanking.balances.refresh", version: "1.0.0" }
245
- },
246
- requiredIntegrations: ["primaryOpenBanking"],
247
- requiredCapabilities: [BALANCE_CAPABILITY],
248
- retry: {
249
- maxAttempts: 3,
250
- backoff: "exponential",
251
- delayMs: 1000
252
- }
253
- },
254
- {
255
- id: "fetch-balances",
256
- type: "automation",
257
- label: "Fetch Balances",
258
- description: "Load the canonical balance snapshots for downstream workflows and dashboards.",
259
- action: {
260
- operation: { key: "openbanking.balances.get", version: "1.0.0" }
261
- },
262
- requiredIntegrations: ["primaryOpenBanking"],
263
- requiredCapabilities: [BALANCE_CAPABILITY],
264
- retry: {
265
- maxAttempts: 2,
266
- backoff: "linear",
267
- delayMs: 750
268
- }
269
- }
270
- ],
271
- transitions: [{ from: "refresh-balances", to: "fetch-balances" }]
272
- }
273
- });
274
-
275
- // src/workflows/sync-openbanking-accounts.ts
276
- import {
277
- OwnersEnum as OwnersEnum6,
278
- StabilityEnum as StabilityEnum6,
279
- TagsEnum as TagsEnum6
280
- } from "@contractspec/lib.contracts-spec";
281
- import { defineWorkflow as defineWorkflow6 } from "@contractspec/lib.contracts-spec/workflow/spec";
282
- var ACCOUNT_CAPABILITY = {
283
- key: "openbanking.accounts.read",
284
- version: "1.0.0"
285
- };
286
- var syncOpenBankingAccountsWorkflow = defineWorkflow6({
287
- meta: {
288
- key: "pfo.workflow.sync-openbanking-accounts",
289
- version: "1.0.0",
290
- title: "Synchronise Open Banking Accounts",
291
- description: "Validates Powens connectivity and synchronises bank account metadata into the canonical ledger.",
292
- domain: "finance",
293
- owners: [OwnersEnum6.PlatformFinance],
294
- tags: ["open-banking", "powens", TagsEnum6.Automation],
295
- stability: StabilityEnum6.Experimental
296
- },
297
- definition: {
298
- entryStepId: "sync-accounts",
299
- steps: [
300
- {
301
- id: "sync-accounts",
302
- type: "automation",
303
- label: "Sync Accounts",
304
- description: "Refresh linked bank accounts via Powens and upsert canonical BankAccount records.",
305
- action: {
306
- operation: { key: "openbanking.accounts.sync", version: "1.0.0" }
307
- },
308
- requiredIntegrations: ["primaryOpenBanking"],
309
- requiredCapabilities: [ACCOUNT_CAPABILITY],
310
- retry: {
311
- maxAttempts: 3,
312
- backoff: "exponential",
313
- delayMs: 1000
314
- }
315
- },
316
- {
317
- id: "fetch-accounts",
318
- type: "automation",
319
- label: "Fetch Accounts",
320
- description: "Retrieve the latest canonical account snapshot for downstream consumers.",
321
- action: {
322
- operation: { key: "openbanking.accounts.list", version: "1.0.0" }
323
- },
324
- requiredIntegrations: ["primaryOpenBanking"],
325
- requiredCapabilities: [ACCOUNT_CAPABILITY],
326
- retry: {
327
- maxAttempts: 2,
328
- backoff: "linear",
329
- delayMs: 750
330
- }
331
- }
332
- ],
333
- transitions: [{ from: "sync-accounts", to: "fetch-accounts" }]
334
- }
335
- });
336
-
337
- // src/workflows/sync-openbanking-transactions.ts
338
- import {
339
- OwnersEnum as OwnersEnum7,
340
- StabilityEnum as StabilityEnum7,
341
- TagsEnum as TagsEnum7
342
- } from "@contractspec/lib.contracts-spec";
343
- import { defineWorkflow as defineWorkflow7 } from "@contractspec/lib.contracts-spec/workflow/spec";
344
- var TRANSACTION_CAPABILITY = {
345
- key: "openbanking.transactions.read",
346
- version: "1.0.0"
347
- };
348
- var syncOpenBankingTransactionsWorkflow = defineWorkflow7({
349
- meta: {
350
- key: "pfo.workflow.sync-openbanking-transactions",
351
- version: "1.0.0",
352
- title: "Synchronise Open Banking Transactions",
353
- description: "Fetches recent transactions from Powens for each linked account and stores them in the canonical ledger.",
354
- domain: "finance",
355
- owners: [OwnersEnum7.PlatformFinance],
356
- tags: ["open-banking", "powens", TagsEnum7.Automation],
357
- stability: StabilityEnum7.Experimental
358
- },
359
- definition: {
360
- entryStepId: "sync-transactions",
361
- steps: [
362
- {
363
- id: "sync-transactions",
364
- type: "automation",
365
- label: "Sync Transactions",
366
- description: "Call the Powens provider to pull incremental transactions for active accounts.",
367
- action: {
368
- operation: { key: "openbanking.transactions.sync", version: "1.0.0" }
369
- },
370
- requiredIntegrations: ["primaryOpenBanking"],
371
- requiredCapabilities: [TRANSACTION_CAPABILITY],
372
- retry: {
373
- maxAttempts: 4,
374
- backoff: "exponential",
375
- delayMs: 1500
376
- }
377
- },
378
- {
379
- id: "list-transactions",
380
- type: "automation",
381
- label: "List Transactions",
382
- description: "Retrieve the canonical transaction list for reporting and downstream analytics.",
383
- action: {
384
- operation: { key: "openbanking.transactions.list", version: "1.0.0" }
385
- },
386
- requiredIntegrations: ["primaryOpenBanking"],
387
- requiredCapabilities: [TRANSACTION_CAPABILITY],
388
- retry: {
389
- maxAttempts: 2,
390
- backoff: "linear",
391
- delayMs: 1000
392
- }
393
- }
394
- ],
395
- transitions: [{ from: "sync-transactions", to: "list-transactions" }]
396
- }
397
- });
398
-
399
- // src/workflows/upcoming-payments-reminder.ts
400
- import {
401
- OwnersEnum as OwnersEnum8,
402
- StabilityEnum as StabilityEnum8,
403
- TagsEnum as TagsEnum8
404
- } from "@contractspec/lib.contracts-spec";
405
- import { defineWorkflow as defineWorkflow8 } from "@contractspec/lib.contracts-spec/workflow/spec";
406
- var upcomingPaymentsReminderWorkflow = defineWorkflow8({
407
- meta: {
408
- key: "pfo.workflow.upcoming-payments-reminder",
409
- version: "1.0.0",
410
- title: "Schedule Upcoming Payment Reminder",
411
- description: "Collects payment metadata and schedules multi-channel reminders for bills that are due soon.",
412
- domain: "finance",
413
- owners: [OwnersEnum8.PlatformFinance],
414
- tags: ["payments", "reminders", TagsEnum8.Automation],
415
- stability: StabilityEnum8.Beta
416
- },
417
- definition: {
418
- entryStepId: "collect",
419
- steps: [
420
- {
421
- id: "collect",
422
- type: "human",
423
- label: "Review Upcoming Bill",
424
- description: "Confirm amount, due date, and preferred delivery channels before scheduling reminder."
425
- },
426
- {
427
- id: "schedule",
428
- type: "automation",
429
- label: "Schedule Reminder",
430
- action: {
431
- operation: {
432
- key: "pfo.reminders.schedule-payment",
433
- version: "1.0.0"
434
- }
435
- },
436
- requiredIntegrations: [
437
- "emailOutbound",
438
- "smsNotifications",
439
- "calendarScheduling"
440
- ],
441
- retry: {
442
- maxAttempts: 2,
443
- backoff: "linear",
444
- delayMs: 1000
445
- }
446
- }
447
- ],
448
- transitions: [
449
- {
450
- from: "collect",
451
- to: "schedule",
452
- condition: "output?.confirmed === true",
453
- label: "Reminder confirmed"
454
- }
455
- ]
456
- }
457
- });
458
- export {
459
- upcomingPaymentsReminderWorkflow,
460
- syncOpenBankingTransactionsWorkflow,
461
- syncOpenBankingAccountsWorkflow,
462
- refreshOpenBankingBalancesWorkflow,
463
- processUploadedDocumentWorkflow,
464
- ingestEmailThreadsWorkflow,
465
- generateOpenBankingOverviewWorkflow,
466
- generateFinancialSummaryWorkflow
467
- };
1
+ import{OwnersEnum as q,StabilityEnum as v,TagsEnum as z}from"@contractspec/lib.contracts-spec";import{defineWorkflow as D}from"@contractspec/lib.contracts-spec/workflow/spec";var I=D({meta:{key:"pfo.workflow.generate-financial-summary",version:"1.0.0",title:"Generate Financial Summary",description:"Retrieves the latest financial signals, generates an AI summary, and optionally distributes it by voice or email.",domain:"finance",owners:[q.PlatformFinance],tags:["summary","ai",z.Automation],stability:v.Beta},definition:{entryStepId:"summarise",steps:[{id:"summarise",type:"automation",label:"Generate Summary",description:"Run retrieval augmented generation over the knowledge base to produce a household summary.",action:{operation:{key:"pfo.summary.generate",version:"1.0.0"}},requiredIntegrations:["primaryLLM","primaryVectorDb"],retry:{maxAttempts:3,backoff:"exponential",delayMs:750}},{id:"distribute",type:"automation",label:"Distribute Summary",description:"Send the generated summary via email and optionally synthesise a voice note.",action:{operation:{key:"pfo.summary.dispatch",version:"1.0.0"}},requiredIntegrations:["emailOutbound"],retry:{maxAttempts:2,backoff:"linear",delayMs:500}}],transitions:[{from:"summarise",to:"distribute"}]}});import{OwnersEnum as F,StabilityEnum as H,TagsEnum as J}from"@contractspec/lib.contracts-spec";import{defineWorkflow as M}from"@contractspec/lib.contracts-spec/workflow/spec";var Q=[{key:"openbanking.accounts.read",version:"1.0.0"},{key:"openbanking.transactions.read",version:"1.0.0"},{key:"openbanking.balances.read",version:"1.0.0"}],A=M({meta:{key:"pfo.workflow.generate-openbanking-overview",version:"1.0.0",title:"Generate Open Banking Overview",description:"Produces a derived financial overview and stores it in the operational knowledge space.",domain:"finance",owners:[F.PlatformFinance],tags:["open-banking","summary",J.Automation],stability:H.Experimental},definition:{entryStepId:"generate-overview",steps:[{id:"generate-overview",type:"automation",label:"Generate Overview",description:"Aggregate balances, cashflow, and category breakdowns into a knowledge entry.",action:{operation:{key:"pfo.openbanking.generate-overview",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:Q,retry:{maxAttempts:3,backoff:"exponential",delayMs:1500}}],transitions:[]}});import{OwnersEnum as V,StabilityEnum as X,TagsEnum as Z}from"@contractspec/lib.contracts-spec";import{defineWorkflow as $}from"@contractspec/lib.contracts-spec/workflow/spec";var l=$({meta:{key:"pfo.workflow.ingest-email-threads",version:"1.0.0",title:"Ingest Email Threads",description:"Synchronises Gmail threads tagged with finance labels and indexes them into operational knowledge spaces.",domain:"communications",owners:[V.PlatformMessaging],tags:["gmail","knowledge",Z.Automation],stability:X.Experimental},definition:{entryStepId:"sync",steps:[{id:"sync",type:"automation",label:"Sync Gmail Threads",description:"Fetches Gmail threads and transforms them into knowledge fragments before vector indexing.",action:{operation:{key:"pfo.email.sync-threads",version:"1.0.0"}},requiredIntegrations:["emailInbound","primaryVectorDb"],retry:{maxAttempts:3,backoff:"exponential",delayMs:1000}},{id:"triage",type:"human",label:"Triage Exceptions",description:"Operators can resolve sync failures or tag important threads for follow-up."}],transitions:[{from:"sync",to:"triage",condition:"output?.syncedThreads === 0",label:"No new threads"}]}});import{OwnersEnum as G,StabilityEnum as K,TagsEnum as R}from"@contractspec/lib.contracts-spec";import{defineWorkflow as U}from"@contractspec/lib.contracts-spec/workflow/spec";var t=U({meta:{key:"pfo.workflow.process-uploaded-document",version:"1.0.0",title:"Process Uploaded Document",description:"Stores an uploaded invoice/contract, queues ingestion, and records any follow-up reminders.",domain:"finance",owners:[G.PlatformFinance],tags:["documents","ingestion",R.Automation],stability:K.Experimental},definition:{entryStepId:"store",steps:[{id:"store",type:"automation",label:"Store and Queue Ingestion",description:"Persist the document to storage and enqueue the knowledge ingestion pipeline.",action:{operation:{key:"pfo.documents.upload",version:"1.0.0"}},requiredIntegrations:["primaryStorage","primaryVectorDb"],retry:{maxAttempts:3,backoff:"exponential",delayMs:500}},{id:"review",type:"human",label:"Optional Human Classification",description:"Finance lead can categorise the document while ingestion completes."}],transitions:[{from:"store",to:"review"}]}});import{OwnersEnum as Y,StabilityEnum as d,TagsEnum as g}from"@contractspec/lib.contracts-spec";import{defineWorkflow as y}from"@contractspec/lib.contracts-spec/workflow/spec";var x={key:"openbanking.balances.read",version:"1.0.0"},xx=y({meta:{key:"pfo.workflow.refresh-openbanking-balances",version:"1.0.0",title:"Refresh Open Banking Balances",description:"Refreshes balances for synced accounts to surface the latest cash positions in dashboards.",domain:"finance",owners:[Y.PlatformFinance],tags:["open-banking","powens",g.Automation],stability:d.Experimental},definition:{entryStepId:"refresh-balances",steps:[{id:"refresh-balances",type:"automation",label:"Refresh Balances",description:"Trigger the Powens provider to obtain current and available balances.",action:{operation:{key:"openbanking.balances.refresh",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[x],retry:{maxAttempts:3,backoff:"exponential",delayMs:1000}},{id:"fetch-balances",type:"automation",label:"Fetch Balances",description:"Load the canonical balance snapshots for downstream workflows and dashboards.",action:{operation:{key:"openbanking.balances.get",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[x],retry:{maxAttempts:2,backoff:"linear",delayMs:750}}],transitions:[{from:"refresh-balances",to:"fetch-balances"}]}});import{OwnersEnum as P,StabilityEnum as W,TagsEnum as _}from"@contractspec/lib.contracts-spec";import{defineWorkflow as L}from"@contractspec/lib.contracts-spec/workflow/spec";var h={key:"openbanking.accounts.read",version:"1.0.0"},vx=L({meta:{key:"pfo.workflow.sync-openbanking-accounts",version:"1.0.0",title:"Synchronise Open Banking Accounts",description:"Validates Powens connectivity and synchronises bank account metadata into the canonical ledger.",domain:"finance",owners:[P.PlatformFinance],tags:["open-banking","powens",_.Automation],stability:W.Experimental},definition:{entryStepId:"sync-accounts",steps:[{id:"sync-accounts",type:"automation",label:"Sync Accounts",description:"Refresh linked bank accounts via Powens and upsert canonical BankAccount records.",action:{operation:{key:"openbanking.accounts.sync",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[h],retry:{maxAttempts:3,backoff:"exponential",delayMs:1000}},{id:"fetch-accounts",type:"automation",label:"Fetch Accounts",description:"Retrieve the latest canonical account snapshot for downstream consumers.",action:{operation:{key:"openbanking.accounts.list",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[h],retry:{maxAttempts:2,backoff:"linear",delayMs:750}}],transitions:[{from:"sync-accounts",to:"fetch-accounts"}]}});import{OwnersEnum as B,StabilityEnum as N,TagsEnum as S}from"@contractspec/lib.contracts-spec";import{defineWorkflow as O}from"@contractspec/lib.contracts-spec/workflow/spec";var j={key:"openbanking.transactions.read",version:"1.0.0"},Hx=O({meta:{key:"pfo.workflow.sync-openbanking-transactions",version:"1.0.0",title:"Synchronise Open Banking Transactions",description:"Fetches recent transactions from Powens for each linked account and stores them in the canonical ledger.",domain:"finance",owners:[B.PlatformFinance],tags:["open-banking","powens",S.Automation],stability:N.Experimental},definition:{entryStepId:"sync-transactions",steps:[{id:"sync-transactions",type:"automation",label:"Sync Transactions",description:"Call the Powens provider to pull incremental transactions for active accounts.",action:{operation:{key:"openbanking.transactions.sync",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[j],retry:{maxAttempts:4,backoff:"exponential",delayMs:1500}},{id:"list-transactions",type:"automation",label:"List Transactions",description:"Retrieve the canonical transaction list for reporting and downstream analytics.",action:{operation:{key:"openbanking.transactions.list",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[j],retry:{maxAttempts:2,backoff:"linear",delayMs:1000}}],transitions:[{from:"sync-transactions",to:"list-transactions"}]}});import{OwnersEnum as C,StabilityEnum as b,TagsEnum as f}from"@contractspec/lib.contracts-spec";import{defineWorkflow as k}from"@contractspec/lib.contracts-spec/workflow/spec";var Vx=k({meta:{key:"pfo.workflow.upcoming-payments-reminder",version:"1.0.0",title:"Schedule Upcoming Payment Reminder",description:"Collects payment metadata and schedules multi-channel reminders for bills that are due soon.",domain:"finance",owners:[C.PlatformFinance],tags:["payments","reminders",f.Automation],stability:b.Beta},definition:{entryStepId:"collect",steps:[{id:"collect",type:"human",label:"Review Upcoming Bill",description:"Confirm amount, due date, and preferred delivery channels before scheduling reminder."},{id:"schedule",type:"automation",label:"Schedule Reminder",action:{operation:{key:"pfo.reminders.schedule-payment",version:"1.0.0"}},requiredIntegrations:["emailOutbound","smsNotifications","calendarScheduling"],retry:{maxAttempts:2,backoff:"linear",delayMs:1000}}],transitions:[{from:"collect",to:"schedule",condition:"output?.confirmed === true",label:"Reminder confirmed"}]}});export{Vx as upcomingPaymentsReminderWorkflow,Hx as syncOpenBankingTransactionsWorkflow,vx as syncOpenBankingAccountsWorkflow,xx as refreshOpenBankingBalancesWorkflow,t as processUploadedDocumentWorkflow,l as ingestEmailThreadsWorkflow,A as generateOpenBankingOverviewWorkflow,I as generateFinancialSummaryWorkflow};
@@ -1,56 +1 @@
1
- // src/workflows/ingest-email-threads.ts
2
- import {
3
- OwnersEnum,
4
- StabilityEnum,
5
- TagsEnum
6
- } from "@contractspec/lib.contracts-spec";
7
- import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow/spec";
8
- var ingestEmailThreadsWorkflow = defineWorkflow({
9
- meta: {
10
- key: "pfo.workflow.ingest-email-threads",
11
- version: "1.0.0",
12
- title: "Ingest Email Threads",
13
- description: "Synchronises Gmail threads tagged with finance labels and indexes them into operational knowledge spaces.",
14
- domain: "communications",
15
- owners: [OwnersEnum.PlatformMessaging],
16
- tags: ["gmail", "knowledge", TagsEnum.Automation],
17
- stability: StabilityEnum.Experimental
18
- },
19
- definition: {
20
- entryStepId: "sync",
21
- steps: [
22
- {
23
- id: "sync",
24
- type: "automation",
25
- label: "Sync Gmail Threads",
26
- description: "Fetches Gmail threads and transforms them into knowledge fragments before vector indexing.",
27
- action: {
28
- operation: { key: "pfo.email.sync-threads", version: "1.0.0" }
29
- },
30
- requiredIntegrations: ["emailInbound", "primaryVectorDb"],
31
- retry: {
32
- maxAttempts: 3,
33
- backoff: "exponential",
34
- delayMs: 1000
35
- }
36
- },
37
- {
38
- id: "triage",
39
- type: "human",
40
- label: "Triage Exceptions",
41
- description: "Operators can resolve sync failures or tag important threads for follow-up."
42
- }
43
- ],
44
- transitions: [
45
- {
46
- from: "sync",
47
- to: "triage",
48
- condition: "output?.syncedThreads === 0",
49
- label: "No new threads"
50
- }
51
- ]
52
- }
53
- });
54
- export {
55
- ingestEmailThreadsWorkflow
56
- };
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as q}from"@contractspec/lib.contracts-spec";import{defineWorkflow as v}from"@contractspec/lib.contracts-spec/workflow/spec";var A=v({meta:{key:"pfo.workflow.ingest-email-threads",version:"1.0.0",title:"Ingest Email Threads",description:"Synchronises Gmail threads tagged with finance labels and indexes them into operational knowledge spaces.",domain:"communications",owners:[h.PlatformMessaging],tags:["gmail","knowledge",q.Automation],stability:j.Experimental},definition:{entryStepId:"sync",steps:[{id:"sync",type:"automation",label:"Sync Gmail Threads",description:"Fetches Gmail threads and transforms them into knowledge fragments before vector indexing.",action:{operation:{key:"pfo.email.sync-threads",version:"1.0.0"}},requiredIntegrations:["emailInbound","primaryVectorDb"],retry:{maxAttempts:3,backoff:"exponential",delayMs:1000}},{id:"triage",type:"human",label:"Triage Exceptions",description:"Operators can resolve sync failures or tag important threads for follow-up."}],transitions:[{from:"sync",to:"triage",condition:"output?.syncedThreads === 0",label:"No new threads"}]}});export{A as ingestEmailThreadsWorkflow};
@@ -1,54 +1 @@
1
- // src/workflows/process-uploaded-document.ts
2
- import {
3
- OwnersEnum,
4
- StabilityEnum,
5
- TagsEnum
6
- } from "@contractspec/lib.contracts-spec";
7
- import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow/spec";
8
- var processUploadedDocumentWorkflow = defineWorkflow({
9
- meta: {
10
- key: "pfo.workflow.process-uploaded-document",
11
- version: "1.0.0",
12
- title: "Process Uploaded Document",
13
- description: "Stores an uploaded invoice/contract, queues ingestion, and records any follow-up reminders.",
14
- domain: "finance",
15
- owners: [OwnersEnum.PlatformFinance],
16
- tags: ["documents", "ingestion", TagsEnum.Automation],
17
- stability: StabilityEnum.Experimental
18
- },
19
- definition: {
20
- entryStepId: "store",
21
- steps: [
22
- {
23
- id: "store",
24
- type: "automation",
25
- label: "Store and Queue Ingestion",
26
- description: "Persist the document to storage and enqueue the knowledge ingestion pipeline.",
27
- action: {
28
- operation: { key: "pfo.documents.upload", version: "1.0.0" }
29
- },
30
- requiredIntegrations: ["primaryStorage", "primaryVectorDb"],
31
- retry: {
32
- maxAttempts: 3,
33
- backoff: "exponential",
34
- delayMs: 500
35
- }
36
- },
37
- {
38
- id: "review",
39
- type: "human",
40
- label: "Optional Human Classification",
41
- description: "Finance lead can categorise the document while ingestion completes."
42
- }
43
- ],
44
- transitions: [
45
- {
46
- from: "store",
47
- to: "review"
48
- }
49
- ]
50
- }
51
- });
52
- export {
53
- processUploadedDocumentWorkflow
54
- };
1
+ import{OwnersEnum as h,StabilityEnum as j,TagsEnum as q}from"@contractspec/lib.contracts-spec";import{defineWorkflow as v}from"@contractspec/lib.contracts-spec/workflow/spec";var A=v({meta:{key:"pfo.workflow.process-uploaded-document",version:"1.0.0",title:"Process Uploaded Document",description:"Stores an uploaded invoice/contract, queues ingestion, and records any follow-up reminders.",domain:"finance",owners:[h.PlatformFinance],tags:["documents","ingestion",q.Automation],stability:j.Experimental},definition:{entryStepId:"store",steps:[{id:"store",type:"automation",label:"Store and Queue Ingestion",description:"Persist the document to storage and enqueue the knowledge ingestion pipeline.",action:{operation:{key:"pfo.documents.upload",version:"1.0.0"}},requiredIntegrations:["primaryStorage","primaryVectorDb"],retry:{maxAttempts:3,backoff:"exponential",delayMs:500}},{id:"review",type:"human",label:"Optional Human Classification",description:"Finance lead can categorise the document while ingestion completes."}],transitions:[{from:"store",to:"review"}]}});export{A as processUploadedDocumentWorkflow};
@@ -1,64 +1 @@
1
- // src/workflows/refresh-openbanking-balances.ts
2
- import {
3
- OwnersEnum,
4
- StabilityEnum,
5
- TagsEnum
6
- } from "@contractspec/lib.contracts-spec";
7
- import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow/spec";
8
- var BALANCE_CAPABILITY = {
9
- key: "openbanking.balances.read",
10
- version: "1.0.0"
11
- };
12
- var refreshOpenBankingBalancesWorkflow = defineWorkflow({
13
- meta: {
14
- key: "pfo.workflow.refresh-openbanking-balances",
15
- version: "1.0.0",
16
- title: "Refresh Open Banking Balances",
17
- description: "Refreshes balances for synced accounts to surface the latest cash positions in dashboards.",
18
- domain: "finance",
19
- owners: [OwnersEnum.PlatformFinance],
20
- tags: ["open-banking", "powens", TagsEnum.Automation],
21
- stability: StabilityEnum.Experimental
22
- },
23
- definition: {
24
- entryStepId: "refresh-balances",
25
- steps: [
26
- {
27
- id: "refresh-balances",
28
- type: "automation",
29
- label: "Refresh Balances",
30
- description: "Trigger the Powens provider to obtain current and available balances.",
31
- action: {
32
- operation: { key: "openbanking.balances.refresh", version: "1.0.0" }
33
- },
34
- requiredIntegrations: ["primaryOpenBanking"],
35
- requiredCapabilities: [BALANCE_CAPABILITY],
36
- retry: {
37
- maxAttempts: 3,
38
- backoff: "exponential",
39
- delayMs: 1000
40
- }
41
- },
42
- {
43
- id: "fetch-balances",
44
- type: "automation",
45
- label: "Fetch Balances",
46
- description: "Load the canonical balance snapshots for downstream workflows and dashboards.",
47
- action: {
48
- operation: { key: "openbanking.balances.get", version: "1.0.0" }
49
- },
50
- requiredIntegrations: ["primaryOpenBanking"],
51
- requiredCapabilities: [BALANCE_CAPABILITY],
52
- retry: {
53
- maxAttempts: 2,
54
- backoff: "linear",
55
- delayMs: 750
56
- }
57
- }
58
- ],
59
- transitions: [{ from: "refresh-balances", to: "fetch-balances" }]
60
- }
61
- });
62
- export {
63
- refreshOpenBankingBalancesWorkflow
64
- };
1
+ import{OwnersEnum as j,StabilityEnum as q,TagsEnum as v}from"@contractspec/lib.contracts-spec";import{defineWorkflow as x}from"@contractspec/lib.contracts-spec/workflow/spec";var h={key:"openbanking.balances.read",version:"1.0.0"},F=x({meta:{key:"pfo.workflow.refresh-openbanking-balances",version:"1.0.0",title:"Refresh Open Banking Balances",description:"Refreshes balances for synced accounts to surface the latest cash positions in dashboards.",domain:"finance",owners:[j.PlatformFinance],tags:["open-banking","powens",v.Automation],stability:q.Experimental},definition:{entryStepId:"refresh-balances",steps:[{id:"refresh-balances",type:"automation",label:"Refresh Balances",description:"Trigger the Powens provider to obtain current and available balances.",action:{operation:{key:"openbanking.balances.refresh",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[h],retry:{maxAttempts:3,backoff:"exponential",delayMs:1000}},{id:"fetch-balances",type:"automation",label:"Fetch Balances",description:"Load the canonical balance snapshots for downstream workflows and dashboards.",action:{operation:{key:"openbanking.balances.get",version:"1.0.0"}},requiredIntegrations:["primaryOpenBanking"],requiredCapabilities:[h],retry:{maxAttempts:2,backoff:"linear",delayMs:750}}],transitions:[{from:"refresh-balances",to:"fetch-balances"}]}});export{F as refreshOpenBankingBalancesWorkflow};