@contractspec/example.pocket-family-office 3.7.5 → 3.7.7

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 (41) hide show
  1. package/README.md +65 -33
  2. package/dist/browser/index.js +520 -519
  3. package/dist/browser/operations/index.js +6 -6
  4. package/dist/browser/telemetry.js +4 -4
  5. package/dist/browser/workflows/generate-financial-summary.js +1 -1
  6. package/dist/browser/workflows/generate-openbanking-overview.js +1 -1
  7. package/dist/browser/workflows/index.js +203 -203
  8. package/dist/browser/workflows/ingest-email-threads.js +1 -1
  9. package/dist/browser/workflows/process-uploaded-document.js +1 -1
  10. package/dist/browser/workflows/refresh-openbanking-balances.js +1 -1
  11. package/dist/browser/workflows/sync-openbanking-accounts.js +1 -1
  12. package/dist/browser/workflows/sync-openbanking-transactions.js +1 -1
  13. package/dist/browser/workflows/upcoming-payments-reminder.js +1 -1
  14. package/dist/index.d.ts +4 -4
  15. package/dist/index.js +520 -519
  16. package/dist/node/index.js +520 -519
  17. package/dist/node/operations/index.js +6 -6
  18. package/dist/node/telemetry.js +4 -4
  19. package/dist/node/workflows/generate-financial-summary.js +1 -1
  20. package/dist/node/workflows/generate-openbanking-overview.js +1 -1
  21. package/dist/node/workflows/index.js +203 -203
  22. package/dist/node/workflows/ingest-email-threads.js +1 -1
  23. package/dist/node/workflows/process-uploaded-document.js +1 -1
  24. package/dist/node/workflows/refresh-openbanking-balances.js +1 -1
  25. package/dist/node/workflows/sync-openbanking-accounts.js +1 -1
  26. package/dist/node/workflows/sync-openbanking-transactions.js +1 -1
  27. package/dist/node/workflows/upcoming-payments-reminder.js +1 -1
  28. package/dist/operations/index.d.ts +1 -1
  29. package/dist/operations/index.js +6 -6
  30. package/dist/telemetry.js +4 -4
  31. package/dist/workflows/generate-financial-summary.js +1 -1
  32. package/dist/workflows/generate-openbanking-overview.js +1 -1
  33. package/dist/workflows/index.d.ts +4 -4
  34. package/dist/workflows/index.js +203 -203
  35. package/dist/workflows/ingest-email-threads.js +1 -1
  36. package/dist/workflows/process-uploaded-document.js +1 -1
  37. package/dist/workflows/refresh-openbanking-balances.js +1 -1
  38. package/dist/workflows/sync-openbanking-accounts.js +1 -1
  39. package/dist/workflows/sync-openbanking-transactions.js +1 -1
  40. package/dist/workflows/upcoming-payments-reminder.js +1 -1
  41. package/package.json +9 -9
@@ -497,75 +497,6 @@ var example = defineExample({
497
497
  });
498
498
  var example_default = example;
499
499
 
500
- // src/tenant.sample.ts
501
- var pocketFamilyOfficeTenantSample = {
502
- meta: {
503
- id: "tenant-pfo-sample",
504
- tenantId: "tenant.family-office",
505
- appId: "pocket-family-office",
506
- blueprintName: "pocket-family-office.app",
507
- blueprintVersion: "1.0.0",
508
- environment: "production",
509
- version: "1.0.0",
510
- createdAt: new Date().toISOString(),
511
- updatedAt: new Date().toISOString(),
512
- status: "published"
513
- },
514
- featureFlags: [
515
- {
516
- key: "voice-summaries",
517
- enabled: true,
518
- description: "Enable spoken ElevenLabs summaries for daily briefings."
519
- }
520
- ],
521
- integrations: [
522
- { slotId: "primaryLLM", connectionId: "conn-mistral-primary" },
523
- { slotId: "primaryVectorDb", connectionId: "conn-qdrant-finance" },
524
- { slotId: "primaryStorage", connectionId: "conn-gcs-documents" },
525
- { slotId: "primaryOpenBanking", connectionId: "conn-powens-primary" },
526
- { slotId: "emailInbound", connectionId: "conn-gmail-threads" },
527
- { slotId: "emailOutbound", connectionId: "conn-postmark-outbound" },
528
- { slotId: "calendarScheduling", connectionId: "conn-google-calendar" },
529
- { slotId: "voicePlayback", connectionId: "conn-elevenlabs-voice" },
530
- { slotId: "smsNotifications", connectionId: "conn-twilio-sms" },
531
- { slotId: "paymentsProcessing", connectionId: "conn-stripe-recurring" }
532
- ],
533
- knowledge: [
534
- {
535
- spaceKey: "knowledge.financial-docs",
536
- scope: {
537
- workflows: [
538
- "pfo.workflow.process-uploaded-document",
539
- "pfo.workflow.generate-financial-summary"
540
- ]
541
- }
542
- },
543
- {
544
- spaceKey: "knowledge.email-threads",
545
- scope: {
546
- workflows: ["pfo.workflow.ingest-email-threads"]
547
- }
548
- },
549
- {
550
- spaceKey: "knowledge.financial-overview",
551
- scope: {
552
- workflows: [
553
- "pfo.workflow.sync-openbanking-transactions",
554
- "pfo.workflow.refresh-openbanking-balances",
555
- "pfo.workflow.generate-financial-summary",
556
- "pfo.workflow.generate-openbanking-overview"
557
- ]
558
- },
559
- required: false
560
- }
561
- ],
562
- locales: {
563
- defaultLocale: "en",
564
- enabledLocales: ["en"]
565
- },
566
- notes: "Sample tenant configuration for hackathon demos. Replace connection IDs with tenant-specific bindings when provisioning."
567
- };
568
-
569
500
  // src/knowledge/sources.sample.ts
570
501
  var now2 = new Date;
571
502
  var pocketFamilyOfficeKnowledgeSources = [
@@ -635,11 +566,7 @@ var pocketFamilyOfficeKnowledgeSources = [
635
566
  ];
636
567
 
637
568
  // src/operations/index.ts
638
- import {
639
- defineEnum,
640
- defineSchemaModel,
641
- ScalarTypeEnum
642
- } from "@contractspec/lib.schema";
569
+ import { OPENBANKING_TELEMETRY_EVENTS } from "@contractspec/lib.contracts-integrations";
643
570
  import {
644
571
  defineCommand,
645
572
  defineQuery
@@ -649,7 +576,11 @@ import {
649
576
  StabilityEnum as StabilityEnum2,
650
577
  TagsEnum as TagsEnum2
651
578
  } from "@contractspec/lib.contracts-spec/ownership";
652
- import { OPENBANKING_TELEMETRY_EVENTS } from "@contractspec/lib.contracts-integrations";
579
+ import {
580
+ defineEnum,
581
+ defineSchemaModel,
582
+ ScalarTypeEnum
583
+ } from "@contractspec/lib.schema";
653
584
  var SourceEnum = defineEnum("Source", ["upload", "email", "sync"]);
654
585
  var ChannelEnum = defineEnum("Channel", ["email", "sms", "both"]);
655
586
  var PeriodEnum = defineEnum("Period", ["P7d", "P30d", "P90d"]);
@@ -940,135 +871,335 @@ var pocketFamilyOfficeContracts = {
940
871
  "pfo.openbanking.generate-overview": generateOpenBankingOverviewContract
941
872
  };
942
873
 
943
- // src/workflows/process-uploaded-document.ts
944
- import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow";
874
+ // src/pocket-family-office.feature.ts
875
+ import { defineFeature } from "@contractspec/lib.contracts-spec";
876
+ var PocketFamilyOfficeFeature = defineFeature({
877
+ meta: {
878
+ key: "pocket-family-office",
879
+ version: "1.0.0",
880
+ title: "Pocket Family Office",
881
+ description: "Personal finance automation with document ingestion, open banking, and AI summaries",
882
+ domain: "finance",
883
+ owners: ["@platform.finance"],
884
+ tags: [
885
+ "finance",
886
+ "open-banking",
887
+ "documents",
888
+ "automation",
889
+ "family-office"
890
+ ],
891
+ stability: "experimental"
892
+ },
893
+ operations: [
894
+ { key: "pfo.documents.upload", version: "1.0.0" },
895
+ { key: "pfo.reminders.schedule-payment", version: "1.0.0" },
896
+ { key: "pfo.summary.generate", version: "1.0.0" },
897
+ { key: "pfo.email.sync-threads", version: "1.0.0" },
898
+ { key: "pfo.summary.dispatch", version: "1.0.0" },
899
+ { key: "pfo.openbanking.generate-overview", version: "1.0.0" }
900
+ ],
901
+ events: [],
902
+ presentations: [],
903
+ opToPresentation: [],
904
+ presentationsTargets: [],
905
+ capabilities: {
906
+ provides: [{ key: "pocket-family-office", version: "1.0.0" }],
907
+ requires: [
908
+ { key: "identity", version: "1.0.0" },
909
+ { key: "openbanking", version: "1.0.0" }
910
+ ]
911
+ },
912
+ workflows: [
913
+ { key: "pfo.workflow.sync-openbanking-accounts", version: "1.0.0" },
914
+ { key: "pfo.workflow.sync-openbanking-transactions", version: "1.0.0" },
915
+ { key: "pfo.workflow.refresh-openbanking-balances", version: "1.0.0" },
916
+ { key: "pfo.workflow.generate-openbanking-overview", version: "1.0.0" },
917
+ { key: "pfo.workflow.process-uploaded-document", version: "1.0.0" },
918
+ { key: "pfo.workflow.upcoming-payments-reminder", version: "1.0.0" },
919
+ { key: "pfo.workflow.generate-financial-summary", version: "1.0.0" },
920
+ { key: "pfo.workflow.ingest-email-threads", version: "1.0.0" }
921
+ ],
922
+ knowledge: [
923
+ { key: "knowledge.financial-docs", version: "1.0.0" },
924
+ { key: "knowledge.email-threads", version: "1.0.0" },
925
+ { key: "knowledge.financial-overview", version: "1.0.0" }
926
+ ],
927
+ telemetry: [{ key: "pfo.telemetry", version: "1.0.0" }],
928
+ policies: [{ key: "pfo.policy.tenancy", version: "1.0.0" }],
929
+ integrations: [
930
+ { key: "pfo.integration.openbanking", version: "1.0.0" },
931
+ { key: "pfo.integration.llm", version: "1.0.0" }
932
+ ],
933
+ jobs: [
934
+ { key: "pfo.job.doc-processing", version: "1.0.0" },
935
+ { key: "pfo.job.reminder-dispatch", version: "1.0.0" }
936
+ ],
937
+ docs: [
938
+ "docs.examples.pocket-family-office.goal",
939
+ "docs.examples.pocket-family-office.usage",
940
+ "docs.examples.pocket-family-office.reference"
941
+ ]
942
+ });
943
+
944
+ // src/telemetry.ts
945
+ import {
946
+ OPENBANKING_PII_FIELDS,
947
+ OPENBANKING_TELEMETRY_EVENTS as OPENBANKING_TELEMETRY_EVENTS2
948
+ } from "@contractspec/lib.contracts-integrations";
945
949
  import {
946
950
  OwnersEnum as OwnersEnum3,
947
951
  StabilityEnum as StabilityEnum3,
948
952
  TagsEnum as TagsEnum3
949
- } from "@contractspec/lib.contracts-spec";
950
- var processUploadedDocumentWorkflow = defineWorkflow({
953
+ } from "@contractspec/lib.contracts-spec/ownership";
954
+ var commonProperties = {
955
+ tenantId: {
956
+ type: "string",
957
+ required: true,
958
+ description: "Tenant identifier for multi-tenant isolation."
959
+ },
960
+ appId: {
961
+ type: "string",
962
+ required: true,
963
+ description: "Application identifier associated with the event."
964
+ },
965
+ blueprint: {
966
+ type: "string",
967
+ required: true,
968
+ description: "Blueprint name@version emitting the telemetry."
969
+ },
970
+ configVersion: {
971
+ type: "number",
972
+ required: true,
973
+ description: "Resolved app config version when the event was generated."
974
+ },
975
+ slotId: {
976
+ type: "string",
977
+ required: true,
978
+ description: "Integration slot identifier (e.g., primaryOpenBanking)."
979
+ },
980
+ connectionId: {
981
+ type: "string",
982
+ required: true,
983
+ description: "Integration connection ID used for the sync."
984
+ }
985
+ };
986
+ function piiSafeString(description) {
987
+ return {
988
+ type: "string",
989
+ description,
990
+ pii: false
991
+ };
992
+ }
993
+ var pocketFamilyOfficeTelemetry = {
951
994
  meta: {
952
- key: "pfo.workflow.process-uploaded-document",
995
+ key: "pfo.telemetry",
953
996
  version: "1.0.0",
954
- title: "Process Uploaded Document",
955
- description: "Stores an uploaded invoice/contract, queues ingestion, and records any follow-up reminders.",
997
+ title: "Pocket Family Office Telemetry",
998
+ description: "Operational telemetry for Pocket Family Office workflows, including Powens open banking syncs.",
956
999
  domain: "finance",
957
1000
  owners: [OwnersEnum3.PlatformFinance],
958
- tags: ["documents", "ingestion", TagsEnum3.Automation],
1001
+ tags: ["open-banking", TagsEnum3.Automation],
959
1002
  stability: StabilityEnum3.Experimental
960
1003
  },
961
- definition: {
962
- entryStepId: "store",
963
- steps: [
964
- {
965
- id: "store",
966
- type: "automation",
967
- label: "Store and Queue Ingestion",
968
- description: "Persist the document to storage and enqueue the knowledge ingestion pipeline.",
969
- action: {
970
- operation: { key: "pfo.documents.upload", version: "1.0.0" }
1004
+ config: {
1005
+ defaultRetentionDays: 180,
1006
+ defaultSamplingRate: 1
1007
+ },
1008
+ events: [
1009
+ {
1010
+ key: OPENBANKING_TELEMETRY_EVENTS2.accountsSynced,
1011
+ version: "1.0.0",
1012
+ semantics: {
1013
+ what: "Open banking account synchronisation completed.",
1014
+ why: "Refresh canonical account metadata for reporting and workflows."
1015
+ },
1016
+ privacy: "internal",
1017
+ properties: {
1018
+ ...commonProperties,
1019
+ syncedCount: {
1020
+ type: "number",
1021
+ description: "Number of accounts synced successfully."
971
1022
  },
972
- requiredIntegrations: ["primaryStorage", "primaryVectorDb"],
973
- retry: {
974
- maxAttempts: 3,
975
- backoff: "exponential",
976
- delayMs: 500
1023
+ failedCount: {
1024
+ type: "number",
1025
+ description: "Number of accounts that failed to sync."
1026
+ },
1027
+ durationMs: {
1028
+ type: "number",
1029
+ description: "Duration of the sync job in milliseconds."
977
1030
  }
978
- },
979
- {
980
- id: "review",
981
- type: "human",
982
- label: "Optional Human Classification",
983
- description: "Finance lead can categorise the document while ingestion completes."
984
1031
  }
985
- ],
986
- transitions: [
987
- {
988
- from: "store",
989
- to: "review"
1032
+ },
1033
+ {
1034
+ key: OPENBANKING_TELEMETRY_EVENTS2.transactionsSynced,
1035
+ version: "1.0.0",
1036
+ semantics: {
1037
+ what: "Open banking transaction synchronisation completed.",
1038
+ why: "Keep canonical transaction ledger in sync for analytics."
1039
+ },
1040
+ privacy: "internal",
1041
+ properties: {
1042
+ ...commonProperties,
1043
+ accountId: {
1044
+ type: "string",
1045
+ description: "Bank account identifier used during the sync.",
1046
+ pii: false
1047
+ },
1048
+ syncedCount: {
1049
+ type: "number",
1050
+ description: "Number of transactions synced successfully."
1051
+ },
1052
+ failedCount: {
1053
+ type: "number",
1054
+ description: "Number of transactions that failed to sync."
1055
+ },
1056
+ from: {
1057
+ type: "timestamp",
1058
+ description: "Start timestamp for the sync window."
1059
+ },
1060
+ to: {
1061
+ type: "timestamp",
1062
+ description: "End timestamp for the sync window."
1063
+ }
990
1064
  }
991
- ]
992
- }
993
- });
1065
+ },
1066
+ {
1067
+ key: OPENBANKING_TELEMETRY_EVENTS2.balancesRefreshed,
1068
+ version: "1.0.0",
1069
+ semantics: {
1070
+ what: "Open banking balances refreshed.",
1071
+ why: "Provide accurate cash position for dashboards and alerts."
1072
+ },
1073
+ privacy: "internal",
1074
+ properties: {
1075
+ ...commonProperties,
1076
+ accountId: piiSafeString("Bank account identifier."),
1077
+ balanceTypes: {
1078
+ type: "json",
1079
+ description: "Balance types included in the refresh."
1080
+ },
1081
+ refreshedAt: {
1082
+ type: "timestamp",
1083
+ description: "Timestamp when balances were refreshed."
1084
+ }
1085
+ }
1086
+ },
1087
+ {
1088
+ key: OPENBANKING_TELEMETRY_EVENTS2.overviewGenerated,
1089
+ version: "1.0.0",
1090
+ semantics: {
1091
+ what: "Derived financial overview generated.",
1092
+ why: "Persist cashflow and category summaries into knowledge space."
1093
+ },
1094
+ privacy: "internal",
1095
+ properties: {
1096
+ ...commonProperties,
1097
+ knowledgeEntryId: piiSafeString("Identifier of the knowledge document containing the overview."),
1098
+ period: {
1099
+ type: "string",
1100
+ description: "Aggregation period used (week, month, quarter)."
1101
+ },
1102
+ periodStart: {
1103
+ type: "timestamp",
1104
+ description: "Start timestamp for the aggregation window."
1105
+ },
1106
+ periodEnd: {
1107
+ type: "timestamp",
1108
+ description: "End timestamp for the aggregation window."
1109
+ }
1110
+ },
1111
+ tags: ["knowledge", "analytics"]
1112
+ }
1113
+ ]
1114
+ };
1115
+ var OPENBANKING_SENSITIVE_FIELDS = OPENBANKING_PII_FIELDS;
994
1116
 
995
- // src/workflows/upcoming-payments-reminder.ts
996
- import { defineWorkflow as defineWorkflow2 } from "@contractspec/lib.contracts-spec/workflow";
997
- import {
998
- OwnersEnum as OwnersEnum4,
999
- StabilityEnum as StabilityEnum4,
1000
- TagsEnum as TagsEnum4
1001
- } from "@contractspec/lib.contracts-spec";
1002
- var upcomingPaymentsReminderWorkflow = defineWorkflow2({
1117
+ // src/tenant.sample.ts
1118
+ var pocketFamilyOfficeTenantSample = {
1003
1119
  meta: {
1004
- key: "pfo.workflow.upcoming-payments-reminder",
1120
+ id: "tenant-pfo-sample",
1121
+ tenantId: "tenant.family-office",
1122
+ appId: "pocket-family-office",
1123
+ blueprintName: "pocket-family-office.app",
1124
+ blueprintVersion: "1.0.0",
1125
+ environment: "production",
1005
1126
  version: "1.0.0",
1006
- title: "Schedule Upcoming Payment Reminder",
1007
- description: "Collects payment metadata and schedules multi-channel reminders for bills that are due soon.",
1008
- domain: "finance",
1009
- owners: [OwnersEnum4.PlatformFinance],
1010
- tags: ["payments", "reminders", TagsEnum4.Automation],
1011
- stability: StabilityEnum4.Beta
1127
+ createdAt: new Date().toISOString(),
1128
+ updatedAt: new Date().toISOString(),
1129
+ status: "published"
1012
1130
  },
1013
- definition: {
1014
- entryStepId: "collect",
1015
- steps: [
1016
- {
1017
- id: "collect",
1018
- type: "human",
1019
- label: "Review Upcoming Bill",
1020
- description: "Confirm amount, due date, and preferred delivery channels before scheduling reminder."
1021
- },
1022
- {
1023
- id: "schedule",
1024
- type: "automation",
1025
- label: "Schedule Reminder",
1026
- action: {
1027
- operation: {
1028
- key: "pfo.reminders.schedule-payment",
1029
- version: "1.0.0"
1030
- }
1031
- },
1032
- requiredIntegrations: [
1033
- "emailOutbound",
1034
- "smsNotifications",
1035
- "calendarScheduling"
1036
- ],
1037
- retry: {
1038
- maxAttempts: 2,
1039
- backoff: "linear",
1040
- delayMs: 1000
1041
- }
1131
+ featureFlags: [
1132
+ {
1133
+ key: "voice-summaries",
1134
+ enabled: true,
1135
+ description: "Enable spoken ElevenLabs summaries for daily briefings."
1136
+ }
1137
+ ],
1138
+ integrations: [
1139
+ { slotId: "primaryLLM", connectionId: "conn-mistral-primary" },
1140
+ { slotId: "primaryVectorDb", connectionId: "conn-qdrant-finance" },
1141
+ { slotId: "primaryStorage", connectionId: "conn-gcs-documents" },
1142
+ { slotId: "primaryOpenBanking", connectionId: "conn-powens-primary" },
1143
+ { slotId: "emailInbound", connectionId: "conn-gmail-threads" },
1144
+ { slotId: "emailOutbound", connectionId: "conn-postmark-outbound" },
1145
+ { slotId: "calendarScheduling", connectionId: "conn-google-calendar" },
1146
+ { slotId: "voicePlayback", connectionId: "conn-elevenlabs-voice" },
1147
+ { slotId: "smsNotifications", connectionId: "conn-twilio-sms" },
1148
+ { slotId: "paymentsProcessing", connectionId: "conn-stripe-recurring" }
1149
+ ],
1150
+ knowledge: [
1151
+ {
1152
+ spaceKey: "knowledge.financial-docs",
1153
+ scope: {
1154
+ workflows: [
1155
+ "pfo.workflow.process-uploaded-document",
1156
+ "pfo.workflow.generate-financial-summary"
1157
+ ]
1042
1158
  }
1043
- ],
1044
- transitions: [
1045
- {
1046
- from: "collect",
1047
- to: "schedule",
1048
- condition: "output?.confirmed === true",
1049
- label: "Reminder confirmed"
1159
+ },
1160
+ {
1161
+ spaceKey: "knowledge.email-threads",
1162
+ scope: {
1163
+ workflows: ["pfo.workflow.ingest-email-threads"]
1050
1164
  }
1051
- ]
1052
- }
1053
- });
1165
+ },
1166
+ {
1167
+ spaceKey: "knowledge.financial-overview",
1168
+ scope: {
1169
+ workflows: [
1170
+ "pfo.workflow.sync-openbanking-transactions",
1171
+ "pfo.workflow.refresh-openbanking-balances",
1172
+ "pfo.workflow.generate-financial-summary",
1173
+ "pfo.workflow.generate-openbanking-overview"
1174
+ ]
1175
+ },
1176
+ required: false
1177
+ }
1178
+ ],
1179
+ locales: {
1180
+ defaultLocale: "en",
1181
+ enabledLocales: ["en"]
1182
+ },
1183
+ notes: "Sample tenant configuration for hackathon demos. Replace connection IDs with tenant-specific bindings when provisioning."
1184
+ };
1054
1185
 
1055
1186
  // src/workflows/generate-financial-summary.ts
1056
- import { defineWorkflow as defineWorkflow3 } from "@contractspec/lib.contracts-spec/workflow";
1057
1187
  import {
1058
- OwnersEnum as OwnersEnum5,
1059
- StabilityEnum as StabilityEnum5,
1060
- TagsEnum as TagsEnum5
1188
+ OwnersEnum as OwnersEnum4,
1189
+ StabilityEnum as StabilityEnum4,
1190
+ TagsEnum as TagsEnum4
1061
1191
  } from "@contractspec/lib.contracts-spec";
1062
- var generateFinancialSummaryWorkflow = defineWorkflow3({
1192
+ import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow";
1193
+ var generateFinancialSummaryWorkflow = defineWorkflow({
1063
1194
  meta: {
1064
1195
  key: "pfo.workflow.generate-financial-summary",
1065
1196
  version: "1.0.0",
1066
1197
  title: "Generate Financial Summary",
1067
1198
  description: "Retrieves the latest financial signals, generates an AI summary, and optionally distributes it by voice or email.",
1068
1199
  domain: "finance",
1069
- owners: [OwnersEnum5.PlatformFinance],
1070
- tags: ["summary", "ai", TagsEnum5.Automation],
1071
- stability: StabilityEnum5.Beta
1200
+ owners: [OwnersEnum4.PlatformFinance],
1201
+ tags: ["summary", "ai", TagsEnum4.Automation],
1202
+ stability: StabilityEnum4.Beta
1072
1203
  },
1073
1204
  definition: {
1074
1205
  entryStepId: "summarise",
@@ -1108,36 +1239,86 @@ var generateFinancialSummaryWorkflow = defineWorkflow3({
1108
1239
  }
1109
1240
  });
1110
1241
 
1111
- // src/workflows/ingest-email-threads.ts
1112
- import { defineWorkflow as defineWorkflow4 } from "@contractspec/lib.contracts-spec/workflow";
1242
+ // src/workflows/generate-openbanking-overview.ts
1113
1243
  import {
1114
- OwnersEnum as OwnersEnum6,
1115
- StabilityEnum as StabilityEnum6,
1116
- TagsEnum as TagsEnum6
1244
+ OwnersEnum as OwnersEnum5,
1245
+ StabilityEnum as StabilityEnum5,
1246
+ TagsEnum as TagsEnum5
1117
1247
  } from "@contractspec/lib.contracts-spec";
1118
- var ingestEmailThreadsWorkflow = defineWorkflow4({
1248
+ import { defineWorkflow as defineWorkflow2 } from "@contractspec/lib.contracts-spec/workflow";
1249
+ var OPEN_BANKING_CAPABILITIES = [
1250
+ { key: "openbanking.accounts.read", version: "1.0.0" },
1251
+ { key: "openbanking.transactions.read", version: "1.0.0" },
1252
+ { key: "openbanking.balances.read", version: "1.0.0" }
1253
+ ];
1254
+ var generateOpenBankingOverviewWorkflow = defineWorkflow2({
1119
1255
  meta: {
1120
- key: "pfo.workflow.ingest-email-threads",
1256
+ key: "pfo.workflow.generate-openbanking-overview",
1121
1257
  version: "1.0.0",
1122
- title: "Ingest Email Threads",
1123
- description: "Synchronises Gmail threads tagged with finance labels and indexes them into operational knowledge spaces.",
1124
- domain: "communications",
1125
- owners: [OwnersEnum6.PlatformMessaging],
1126
- tags: ["gmail", "knowledge", TagsEnum6.Automation],
1127
- stability: StabilityEnum6.Experimental
1258
+ title: "Generate Open Banking Overview",
1259
+ description: "Produces a derived financial overview and stores it in the operational knowledge space.",
1260
+ domain: "finance",
1261
+ owners: [OwnersEnum5.PlatformFinance],
1262
+ tags: ["open-banking", "summary", TagsEnum5.Automation],
1263
+ stability: StabilityEnum5.Experimental
1128
1264
  },
1129
1265
  definition: {
1130
- entryStepId: "sync",
1266
+ entryStepId: "generate-overview",
1131
1267
  steps: [
1132
1268
  {
1133
- id: "sync",
1269
+ id: "generate-overview",
1134
1270
  type: "automation",
1135
- label: "Sync Gmail Threads",
1136
- description: "Fetches Gmail threads and transforms them into knowledge fragments before vector indexing.",
1271
+ label: "Generate Overview",
1272
+ description: "Aggregate balances, cashflow, and category breakdowns into a knowledge entry.",
1137
1273
  action: {
1138
- operation: { key: "pfo.email.sync-threads", version: "1.0.0" }
1274
+ operation: {
1275
+ key: "pfo.openbanking.generate-overview",
1276
+ version: "1.0.0"
1277
+ }
1139
1278
  },
1140
- requiredIntegrations: ["emailInbound", "primaryVectorDb"],
1279
+ requiredIntegrations: ["primaryOpenBanking"],
1280
+ requiredCapabilities: OPEN_BANKING_CAPABILITIES,
1281
+ retry: {
1282
+ maxAttempts: 3,
1283
+ backoff: "exponential",
1284
+ delayMs: 1500
1285
+ }
1286
+ }
1287
+ ],
1288
+ transitions: []
1289
+ }
1290
+ });
1291
+
1292
+ // src/workflows/ingest-email-threads.ts
1293
+ import {
1294
+ OwnersEnum as OwnersEnum6,
1295
+ StabilityEnum as StabilityEnum6,
1296
+ TagsEnum as TagsEnum6
1297
+ } from "@contractspec/lib.contracts-spec";
1298
+ import { defineWorkflow as defineWorkflow3 } from "@contractspec/lib.contracts-spec/workflow";
1299
+ var ingestEmailThreadsWorkflow = defineWorkflow3({
1300
+ meta: {
1301
+ key: "pfo.workflow.ingest-email-threads",
1302
+ version: "1.0.0",
1303
+ title: "Ingest Email Threads",
1304
+ description: "Synchronises Gmail threads tagged with finance labels and indexes them into operational knowledge spaces.",
1305
+ domain: "communications",
1306
+ owners: [OwnersEnum6.PlatformMessaging],
1307
+ tags: ["gmail", "knowledge", TagsEnum6.Automation],
1308
+ stability: StabilityEnum6.Experimental
1309
+ },
1310
+ definition: {
1311
+ entryStepId: "sync",
1312
+ steps: [
1313
+ {
1314
+ id: "sync",
1315
+ type: "automation",
1316
+ label: "Sync Gmail Threads",
1317
+ description: "Fetches Gmail threads and transforms them into knowledge fragments before vector indexing.",
1318
+ action: {
1319
+ operation: { key: "pfo.email.sync-threads", version: "1.0.0" }
1320
+ },
1321
+ requiredIntegrations: ["emailInbound", "primaryVectorDb"],
1141
1322
  retry: {
1142
1323
  maxAttempts: 3,
1143
1324
  backoff: "exponential",
@@ -1162,165 +1343,155 @@ var ingestEmailThreadsWorkflow = defineWorkflow4({
1162
1343
  }
1163
1344
  });
1164
1345
 
1165
- // src/workflows/sync-openbanking-accounts.ts
1166
- import { defineWorkflow as defineWorkflow5 } from "@contractspec/lib.contracts-spec/workflow";
1346
+ // src/workflows/process-uploaded-document.ts
1167
1347
  import {
1168
1348
  OwnersEnum as OwnersEnum7,
1169
1349
  StabilityEnum as StabilityEnum7,
1170
1350
  TagsEnum as TagsEnum7
1171
1351
  } from "@contractspec/lib.contracts-spec";
1172
- var ACCOUNT_CAPABILITY = {
1173
- key: "openbanking.accounts.read",
1174
- version: "1.0.0"
1175
- };
1176
- var syncOpenBankingAccountsWorkflow = defineWorkflow5({
1352
+ import { defineWorkflow as defineWorkflow4 } from "@contractspec/lib.contracts-spec/workflow";
1353
+ var processUploadedDocumentWorkflow = defineWorkflow4({
1177
1354
  meta: {
1178
- key: "pfo.workflow.sync-openbanking-accounts",
1355
+ key: "pfo.workflow.process-uploaded-document",
1179
1356
  version: "1.0.0",
1180
- title: "Synchronise Open Banking Accounts",
1181
- description: "Validates Powens connectivity and synchronises bank account metadata into the canonical ledger.",
1357
+ title: "Process Uploaded Document",
1358
+ description: "Stores an uploaded invoice/contract, queues ingestion, and records any follow-up reminders.",
1182
1359
  domain: "finance",
1183
1360
  owners: [OwnersEnum7.PlatformFinance],
1184
- tags: ["open-banking", "powens", TagsEnum7.Automation],
1361
+ tags: ["documents", "ingestion", TagsEnum7.Automation],
1185
1362
  stability: StabilityEnum7.Experimental
1186
1363
  },
1187
1364
  definition: {
1188
- entryStepId: "sync-accounts",
1365
+ entryStepId: "store",
1189
1366
  steps: [
1190
1367
  {
1191
- id: "sync-accounts",
1368
+ id: "store",
1192
1369
  type: "automation",
1193
- label: "Sync Accounts",
1194
- description: "Refresh linked bank accounts via Powens and upsert canonical BankAccount records.",
1370
+ label: "Store and Queue Ingestion",
1371
+ description: "Persist the document to storage and enqueue the knowledge ingestion pipeline.",
1195
1372
  action: {
1196
- operation: { key: "openbanking.accounts.sync", version: "1.0.0" }
1373
+ operation: { key: "pfo.documents.upload", version: "1.0.0" }
1197
1374
  },
1198
- requiredIntegrations: ["primaryOpenBanking"],
1199
- requiredCapabilities: [ACCOUNT_CAPABILITY],
1375
+ requiredIntegrations: ["primaryStorage", "primaryVectorDb"],
1200
1376
  retry: {
1201
1377
  maxAttempts: 3,
1202
1378
  backoff: "exponential",
1203
- delayMs: 1000
1379
+ delayMs: 500
1204
1380
  }
1205
1381
  },
1206
1382
  {
1207
- id: "fetch-accounts",
1208
- type: "automation",
1209
- label: "Fetch Accounts",
1210
- description: "Retrieve the latest canonical account snapshot for downstream consumers.",
1211
- action: {
1212
- operation: { key: "openbanking.accounts.list", version: "1.0.0" }
1213
- },
1214
- requiredIntegrations: ["primaryOpenBanking"],
1215
- requiredCapabilities: [ACCOUNT_CAPABILITY],
1216
- retry: {
1217
- maxAttempts: 2,
1218
- backoff: "linear",
1219
- delayMs: 750
1220
- }
1383
+ id: "review",
1384
+ type: "human",
1385
+ label: "Optional Human Classification",
1386
+ description: "Finance lead can categorise the document while ingestion completes."
1221
1387
  }
1222
1388
  ],
1223
- transitions: [{ from: "sync-accounts", to: "fetch-accounts" }]
1389
+ transitions: [
1390
+ {
1391
+ from: "store",
1392
+ to: "review"
1393
+ }
1394
+ ]
1224
1395
  }
1225
1396
  });
1226
1397
 
1227
- // src/workflows/sync-openbanking-transactions.ts
1228
- import { defineWorkflow as defineWorkflow6 } from "@contractspec/lib.contracts-spec/workflow";
1398
+ // src/workflows/refresh-openbanking-balances.ts
1229
1399
  import {
1230
1400
  OwnersEnum as OwnersEnum8,
1231
1401
  StabilityEnum as StabilityEnum8,
1232
1402
  TagsEnum as TagsEnum8
1233
1403
  } from "@contractspec/lib.contracts-spec";
1234
- var TRANSACTION_CAPABILITY = {
1235
- key: "openbanking.transactions.read",
1404
+ import { defineWorkflow as defineWorkflow5 } from "@contractspec/lib.contracts-spec/workflow";
1405
+ var BALANCE_CAPABILITY = {
1406
+ key: "openbanking.balances.read",
1236
1407
  version: "1.0.0"
1237
1408
  };
1238
- var syncOpenBankingTransactionsWorkflow = defineWorkflow6({
1409
+ var refreshOpenBankingBalancesWorkflow = defineWorkflow5({
1239
1410
  meta: {
1240
- key: "pfo.workflow.sync-openbanking-transactions",
1411
+ key: "pfo.workflow.refresh-openbanking-balances",
1241
1412
  version: "1.0.0",
1242
- title: "Synchronise Open Banking Transactions",
1243
- description: "Fetches recent transactions from Powens for each linked account and stores them in the canonical ledger.",
1413
+ title: "Refresh Open Banking Balances",
1414
+ description: "Refreshes balances for synced accounts to surface the latest cash positions in dashboards.",
1244
1415
  domain: "finance",
1245
1416
  owners: [OwnersEnum8.PlatformFinance],
1246
1417
  tags: ["open-banking", "powens", TagsEnum8.Automation],
1247
1418
  stability: StabilityEnum8.Experimental
1248
1419
  },
1249
1420
  definition: {
1250
- entryStepId: "sync-transactions",
1421
+ entryStepId: "refresh-balances",
1251
1422
  steps: [
1252
1423
  {
1253
- id: "sync-transactions",
1424
+ id: "refresh-balances",
1254
1425
  type: "automation",
1255
- label: "Sync Transactions",
1256
- description: "Call the Powens provider to pull incremental transactions for active accounts.",
1426
+ label: "Refresh Balances",
1427
+ description: "Trigger the Powens provider to obtain current and available balances.",
1257
1428
  action: {
1258
- operation: { key: "openbanking.transactions.sync", version: "1.0.0" }
1429
+ operation: { key: "openbanking.balances.refresh", version: "1.0.0" }
1259
1430
  },
1260
1431
  requiredIntegrations: ["primaryOpenBanking"],
1261
- requiredCapabilities: [TRANSACTION_CAPABILITY],
1432
+ requiredCapabilities: [BALANCE_CAPABILITY],
1262
1433
  retry: {
1263
- maxAttempts: 4,
1434
+ maxAttempts: 3,
1264
1435
  backoff: "exponential",
1265
- delayMs: 1500
1436
+ delayMs: 1000
1266
1437
  }
1267
1438
  },
1268
1439
  {
1269
- id: "list-transactions",
1440
+ id: "fetch-balances",
1270
1441
  type: "automation",
1271
- label: "List Transactions",
1272
- description: "Retrieve the canonical transaction list for reporting and downstream analytics.",
1442
+ label: "Fetch Balances",
1443
+ description: "Load the canonical balance snapshots for downstream workflows and dashboards.",
1273
1444
  action: {
1274
- operation: { key: "openbanking.transactions.list", version: "1.0.0" }
1445
+ operation: { key: "openbanking.balances.get", version: "1.0.0" }
1275
1446
  },
1276
1447
  requiredIntegrations: ["primaryOpenBanking"],
1277
- requiredCapabilities: [TRANSACTION_CAPABILITY],
1448
+ requiredCapabilities: [BALANCE_CAPABILITY],
1278
1449
  retry: {
1279
1450
  maxAttempts: 2,
1280
1451
  backoff: "linear",
1281
- delayMs: 1000
1452
+ delayMs: 750
1282
1453
  }
1283
1454
  }
1284
1455
  ],
1285
- transitions: [{ from: "sync-transactions", to: "list-transactions" }]
1456
+ transitions: [{ from: "refresh-balances", to: "fetch-balances" }]
1286
1457
  }
1287
1458
  });
1288
1459
 
1289
- // src/workflows/refresh-openbanking-balances.ts
1290
- import { defineWorkflow as defineWorkflow7 } from "@contractspec/lib.contracts-spec/workflow";
1460
+ // src/workflows/sync-openbanking-accounts.ts
1291
1461
  import {
1292
1462
  OwnersEnum as OwnersEnum9,
1293
1463
  StabilityEnum as StabilityEnum9,
1294
1464
  TagsEnum as TagsEnum9
1295
1465
  } from "@contractspec/lib.contracts-spec";
1296
- var BALANCE_CAPABILITY = {
1297
- key: "openbanking.balances.read",
1466
+ import { defineWorkflow as defineWorkflow6 } from "@contractspec/lib.contracts-spec/workflow";
1467
+ var ACCOUNT_CAPABILITY = {
1468
+ key: "openbanking.accounts.read",
1298
1469
  version: "1.0.0"
1299
1470
  };
1300
- var refreshOpenBankingBalancesWorkflow = defineWorkflow7({
1471
+ var syncOpenBankingAccountsWorkflow = defineWorkflow6({
1301
1472
  meta: {
1302
- key: "pfo.workflow.refresh-openbanking-balances",
1473
+ key: "pfo.workflow.sync-openbanking-accounts",
1303
1474
  version: "1.0.0",
1304
- title: "Refresh Open Banking Balances",
1305
- description: "Refreshes balances for synced accounts to surface the latest cash positions in dashboards.",
1475
+ title: "Synchronise Open Banking Accounts",
1476
+ description: "Validates Powens connectivity and synchronises bank account metadata into the canonical ledger.",
1306
1477
  domain: "finance",
1307
1478
  owners: [OwnersEnum9.PlatformFinance],
1308
1479
  tags: ["open-banking", "powens", TagsEnum9.Automation],
1309
1480
  stability: StabilityEnum9.Experimental
1310
1481
  },
1311
1482
  definition: {
1312
- entryStepId: "refresh-balances",
1483
+ entryStepId: "sync-accounts",
1313
1484
  steps: [
1314
1485
  {
1315
- id: "refresh-balances",
1486
+ id: "sync-accounts",
1316
1487
  type: "automation",
1317
- label: "Refresh Balances",
1318
- description: "Trigger the Powens provider to obtain current and available balances.",
1488
+ label: "Sync Accounts",
1489
+ description: "Refresh linked bank accounts via Powens and upsert canonical BankAccount records.",
1319
1490
  action: {
1320
- operation: { key: "openbanking.balances.refresh", version: "1.0.0" }
1491
+ operation: { key: "openbanking.accounts.sync", version: "1.0.0" }
1321
1492
  },
1322
1493
  requiredIntegrations: ["primaryOpenBanking"],
1323
- requiredCapabilities: [BALANCE_CAPABILITY],
1494
+ requiredCapabilities: [ACCOUNT_CAPABILITY],
1324
1495
  retry: {
1325
1496
  maxAttempts: 3,
1326
1497
  backoff: "exponential",
@@ -1328,15 +1499,15 @@ var refreshOpenBankingBalancesWorkflow = defineWorkflow7({
1328
1499
  }
1329
1500
  },
1330
1501
  {
1331
- id: "fetch-balances",
1502
+ id: "fetch-accounts",
1332
1503
  type: "automation",
1333
- label: "Fetch Balances",
1334
- description: "Load the canonical balance snapshots for downstream workflows and dashboards.",
1504
+ label: "Fetch Accounts",
1505
+ description: "Retrieve the latest canonical account snapshot for downstream consumers.",
1335
1506
  action: {
1336
- operation: { key: "openbanking.balances.get", version: "1.0.0" }
1507
+ operation: { key: "openbanking.accounts.list", version: "1.0.0" }
1337
1508
  },
1338
1509
  requiredIntegrations: ["primaryOpenBanking"],
1339
- requiredCapabilities: [BALANCE_CAPABILITY],
1510
+ requiredCapabilities: [ACCOUNT_CAPABILITY],
1340
1511
  retry: {
1341
1512
  maxAttempts: 2,
1342
1513
  backoff: "linear",
@@ -1344,300 +1515,130 @@ var refreshOpenBankingBalancesWorkflow = defineWorkflow7({
1344
1515
  }
1345
1516
  }
1346
1517
  ],
1347
- transitions: [{ from: "refresh-balances", to: "fetch-balances" }]
1518
+ transitions: [{ from: "sync-accounts", to: "fetch-accounts" }]
1348
1519
  }
1349
1520
  });
1350
1521
 
1351
- // src/workflows/generate-openbanking-overview.ts
1352
- import { defineWorkflow as defineWorkflow8 } from "@contractspec/lib.contracts-spec/workflow";
1522
+ // src/workflows/sync-openbanking-transactions.ts
1353
1523
  import {
1354
1524
  OwnersEnum as OwnersEnum10,
1355
1525
  StabilityEnum as StabilityEnum10,
1356
1526
  TagsEnum as TagsEnum10
1357
1527
  } from "@contractspec/lib.contracts-spec";
1358
- var OPEN_BANKING_CAPABILITIES = [
1359
- { key: "openbanking.accounts.read", version: "1.0.0" },
1360
- { key: "openbanking.transactions.read", version: "1.0.0" },
1361
- { key: "openbanking.balances.read", version: "1.0.0" }
1362
- ];
1363
- var generateOpenBankingOverviewWorkflow = defineWorkflow8({
1528
+ import { defineWorkflow as defineWorkflow7 } from "@contractspec/lib.contracts-spec/workflow";
1529
+ var TRANSACTION_CAPABILITY = {
1530
+ key: "openbanking.transactions.read",
1531
+ version: "1.0.0"
1532
+ };
1533
+ var syncOpenBankingTransactionsWorkflow = defineWorkflow7({
1364
1534
  meta: {
1365
- key: "pfo.workflow.generate-openbanking-overview",
1535
+ key: "pfo.workflow.sync-openbanking-transactions",
1366
1536
  version: "1.0.0",
1367
- title: "Generate Open Banking Overview",
1368
- description: "Produces a derived financial overview and stores it in the operational knowledge space.",
1537
+ title: "Synchronise Open Banking Transactions",
1538
+ description: "Fetches recent transactions from Powens for each linked account and stores them in the canonical ledger.",
1369
1539
  domain: "finance",
1370
1540
  owners: [OwnersEnum10.PlatformFinance],
1371
- tags: ["open-banking", "summary", TagsEnum10.Automation],
1541
+ tags: ["open-banking", "powens", TagsEnum10.Automation],
1372
1542
  stability: StabilityEnum10.Experimental
1373
1543
  },
1374
1544
  definition: {
1375
- entryStepId: "generate-overview",
1545
+ entryStepId: "sync-transactions",
1376
1546
  steps: [
1377
1547
  {
1378
- id: "generate-overview",
1548
+ id: "sync-transactions",
1379
1549
  type: "automation",
1380
- label: "Generate Overview",
1381
- description: "Aggregate balances, cashflow, and category breakdowns into a knowledge entry.",
1550
+ label: "Sync Transactions",
1551
+ description: "Call the Powens provider to pull incremental transactions for active accounts.",
1382
1552
  action: {
1383
- operation: {
1384
- key: "pfo.openbanking.generate-overview",
1385
- version: "1.0.0"
1386
- }
1553
+ operation: { key: "openbanking.transactions.sync", version: "1.0.0" }
1387
1554
  },
1388
1555
  requiredIntegrations: ["primaryOpenBanking"],
1389
- requiredCapabilities: OPEN_BANKING_CAPABILITIES,
1556
+ requiredCapabilities: [TRANSACTION_CAPABILITY],
1390
1557
  retry: {
1391
- maxAttempts: 3,
1558
+ maxAttempts: 4,
1392
1559
  backoff: "exponential",
1393
1560
  delayMs: 1500
1394
1561
  }
1562
+ },
1563
+ {
1564
+ id: "list-transactions",
1565
+ type: "automation",
1566
+ label: "List Transactions",
1567
+ description: "Retrieve the canonical transaction list for reporting and downstream analytics.",
1568
+ action: {
1569
+ operation: { key: "openbanking.transactions.list", version: "1.0.0" }
1570
+ },
1571
+ requiredIntegrations: ["primaryOpenBanking"],
1572
+ requiredCapabilities: [TRANSACTION_CAPABILITY],
1573
+ retry: {
1574
+ maxAttempts: 2,
1575
+ backoff: "linear",
1576
+ delayMs: 1000
1577
+ }
1395
1578
  }
1396
1579
  ],
1397
- transitions: []
1580
+ transitions: [{ from: "sync-transactions", to: "list-transactions" }]
1398
1581
  }
1399
1582
  });
1400
- // src/telemetry.ts
1583
+
1584
+ // src/workflows/upcoming-payments-reminder.ts
1401
1585
  import {
1402
1586
  OwnersEnum as OwnersEnum11,
1403
1587
  StabilityEnum as StabilityEnum11,
1404
1588
  TagsEnum as TagsEnum11
1405
- } from "@contractspec/lib.contracts-spec/ownership";
1406
- import {
1407
- OPENBANKING_PII_FIELDS,
1408
- OPENBANKING_TELEMETRY_EVENTS as OPENBANKING_TELEMETRY_EVENTS2
1409
- } from "@contractspec/lib.contracts-integrations";
1410
- var commonProperties = {
1411
- tenantId: {
1412
- type: "string",
1413
- required: true,
1414
- description: "Tenant identifier for multi-tenant isolation."
1415
- },
1416
- appId: {
1417
- type: "string",
1418
- required: true,
1419
- description: "Application identifier associated with the event."
1420
- },
1421
- blueprint: {
1422
- type: "string",
1423
- required: true,
1424
- description: "Blueprint name@version emitting the telemetry."
1425
- },
1426
- configVersion: {
1427
- type: "number",
1428
- required: true,
1429
- description: "Resolved app config version when the event was generated."
1430
- },
1431
- slotId: {
1432
- type: "string",
1433
- required: true,
1434
- description: "Integration slot identifier (e.g., primaryOpenBanking)."
1435
- },
1436
- connectionId: {
1437
- type: "string",
1438
- required: true,
1439
- description: "Integration connection ID used for the sync."
1440
- }
1441
- };
1442
- function piiSafeString(description) {
1443
- return {
1444
- type: "string",
1445
- description,
1446
- pii: false
1447
- };
1448
- }
1449
- var pocketFamilyOfficeTelemetry = {
1589
+ } from "@contractspec/lib.contracts-spec";
1590
+ import { defineWorkflow as defineWorkflow8 } from "@contractspec/lib.contracts-spec/workflow";
1591
+ var upcomingPaymentsReminderWorkflow = defineWorkflow8({
1450
1592
  meta: {
1451
- key: "pfo.telemetry",
1593
+ key: "pfo.workflow.upcoming-payments-reminder",
1452
1594
  version: "1.0.0",
1453
- title: "Pocket Family Office Telemetry",
1454
- description: "Operational telemetry for Pocket Family Office workflows, including Powens open banking syncs.",
1595
+ title: "Schedule Upcoming Payment Reminder",
1596
+ description: "Collects payment metadata and schedules multi-channel reminders for bills that are due soon.",
1455
1597
  domain: "finance",
1456
1598
  owners: [OwnersEnum11.PlatformFinance],
1457
- tags: ["open-banking", TagsEnum11.Automation],
1458
- stability: StabilityEnum11.Experimental
1459
- },
1460
- config: {
1461
- defaultRetentionDays: 180,
1462
- defaultSamplingRate: 1
1599
+ tags: ["payments", "reminders", TagsEnum11.Automation],
1600
+ stability: StabilityEnum11.Beta
1463
1601
  },
1464
- events: [
1465
- {
1466
- key: OPENBANKING_TELEMETRY_EVENTS2.accountsSynced,
1467
- version: "1.0.0",
1468
- semantics: {
1469
- what: "Open banking account synchronisation completed.",
1470
- why: "Refresh canonical account metadata for reporting and workflows."
1471
- },
1472
- privacy: "internal",
1473
- properties: {
1474
- ...commonProperties,
1475
- syncedCount: {
1476
- type: "number",
1477
- description: "Number of accounts synced successfully."
1478
- },
1479
- failedCount: {
1480
- type: "number",
1481
- description: "Number of accounts that failed to sync."
1482
- },
1483
- durationMs: {
1484
- type: "number",
1485
- description: "Duration of the sync job in milliseconds."
1486
- }
1487
- }
1488
- },
1489
- {
1490
- key: OPENBANKING_TELEMETRY_EVENTS2.transactionsSynced,
1491
- version: "1.0.0",
1492
- semantics: {
1493
- what: "Open banking transaction synchronisation completed.",
1494
- why: "Keep canonical transaction ledger in sync for analytics."
1495
- },
1496
- privacy: "internal",
1497
- properties: {
1498
- ...commonProperties,
1499
- accountId: {
1500
- type: "string",
1501
- description: "Bank account identifier used during the sync.",
1502
- pii: false
1503
- },
1504
- syncedCount: {
1505
- type: "number",
1506
- description: "Number of transactions synced successfully."
1507
- },
1508
- failedCount: {
1509
- type: "number",
1510
- description: "Number of transactions that failed to sync."
1511
- },
1512
- from: {
1513
- type: "timestamp",
1514
- description: "Start timestamp for the sync window."
1515
- },
1516
- to: {
1517
- type: "timestamp",
1518
- description: "End timestamp for the sync window."
1519
- }
1520
- }
1521
- },
1522
- {
1523
- key: OPENBANKING_TELEMETRY_EVENTS2.balancesRefreshed,
1524
- version: "1.0.0",
1525
- semantics: {
1526
- what: "Open banking balances refreshed.",
1527
- why: "Provide accurate cash position for dashboards and alerts."
1602
+ definition: {
1603
+ entryStepId: "collect",
1604
+ steps: [
1605
+ {
1606
+ id: "collect",
1607
+ type: "human",
1608
+ label: "Review Upcoming Bill",
1609
+ description: "Confirm amount, due date, and preferred delivery channels before scheduling reminder."
1528
1610
  },
1529
- privacy: "internal",
1530
- properties: {
1531
- ...commonProperties,
1532
- accountId: piiSafeString("Bank account identifier."),
1533
- balanceTypes: {
1534
- type: "json",
1535
- description: "Balance types included in the refresh."
1611
+ {
1612
+ id: "schedule",
1613
+ type: "automation",
1614
+ label: "Schedule Reminder",
1615
+ action: {
1616
+ operation: {
1617
+ key: "pfo.reminders.schedule-payment",
1618
+ version: "1.0.0"
1619
+ }
1536
1620
  },
1537
- refreshedAt: {
1538
- type: "timestamp",
1539
- description: "Timestamp when balances were refreshed."
1621
+ requiredIntegrations: [
1622
+ "emailOutbound",
1623
+ "smsNotifications",
1624
+ "calendarScheduling"
1625
+ ],
1626
+ retry: {
1627
+ maxAttempts: 2,
1628
+ backoff: "linear",
1629
+ delayMs: 1000
1540
1630
  }
1541
1631
  }
1542
- },
1543
- {
1544
- key: OPENBANKING_TELEMETRY_EVENTS2.overviewGenerated,
1545
- version: "1.0.0",
1546
- semantics: {
1547
- what: "Derived financial overview generated.",
1548
- why: "Persist cashflow and category summaries into knowledge space."
1549
- },
1550
- privacy: "internal",
1551
- properties: {
1552
- ...commonProperties,
1553
- knowledgeEntryId: piiSafeString("Identifier of the knowledge document containing the overview."),
1554
- period: {
1555
- type: "string",
1556
- description: "Aggregation period used (week, month, quarter)."
1557
- },
1558
- periodStart: {
1559
- type: "timestamp",
1560
- description: "Start timestamp for the aggregation window."
1561
- },
1562
- periodEnd: {
1563
- type: "timestamp",
1564
- description: "End timestamp for the aggregation window."
1565
- }
1566
- },
1567
- tags: ["knowledge", "analytics"]
1568
- }
1569
- ]
1570
- };
1571
- var OPENBANKING_SENSITIVE_FIELDS = OPENBANKING_PII_FIELDS;
1572
-
1573
- // src/pocket-family-office.feature.ts
1574
- import { defineFeature } from "@contractspec/lib.contracts-spec";
1575
- var PocketFamilyOfficeFeature = defineFeature({
1576
- meta: {
1577
- key: "pocket-family-office",
1578
- version: "1.0.0",
1579
- title: "Pocket Family Office",
1580
- description: "Personal finance automation with document ingestion, open banking, and AI summaries",
1581
- domain: "finance",
1582
- owners: ["@platform.finance"],
1583
- tags: [
1584
- "finance",
1585
- "open-banking",
1586
- "documents",
1587
- "automation",
1588
- "family-office"
1589
1632
  ],
1590
- stability: "experimental"
1591
- },
1592
- operations: [
1593
- { key: "pfo.documents.upload", version: "1.0.0" },
1594
- { key: "pfo.reminders.schedule-payment", version: "1.0.0" },
1595
- { key: "pfo.summary.generate", version: "1.0.0" },
1596
- { key: "pfo.email.sync-threads", version: "1.0.0" },
1597
- { key: "pfo.summary.dispatch", version: "1.0.0" },
1598
- { key: "pfo.openbanking.generate-overview", version: "1.0.0" }
1599
- ],
1600
- events: [],
1601
- presentations: [],
1602
- opToPresentation: [],
1603
- presentationsTargets: [],
1604
- capabilities: {
1605
- provides: [{ key: "pocket-family-office", version: "1.0.0" }],
1606
- requires: [
1607
- { key: "identity", version: "1.0.0" },
1608
- { key: "openbanking", version: "1.0.0" }
1633
+ transitions: [
1634
+ {
1635
+ from: "collect",
1636
+ to: "schedule",
1637
+ condition: "output?.confirmed === true",
1638
+ label: "Reminder confirmed"
1639
+ }
1609
1640
  ]
1610
- },
1611
- workflows: [
1612
- { key: "pfo.workflow.sync-openbanking-accounts", version: "1.0.0" },
1613
- { key: "pfo.workflow.sync-openbanking-transactions", version: "1.0.0" },
1614
- { key: "pfo.workflow.refresh-openbanking-balances", version: "1.0.0" },
1615
- { key: "pfo.workflow.generate-openbanking-overview", version: "1.0.0" },
1616
- { key: "pfo.workflow.process-uploaded-document", version: "1.0.0" },
1617
- { key: "pfo.workflow.upcoming-payments-reminder", version: "1.0.0" },
1618
- { key: "pfo.workflow.generate-financial-summary", version: "1.0.0" },
1619
- { key: "pfo.workflow.ingest-email-threads", version: "1.0.0" }
1620
- ],
1621
- knowledge: [
1622
- { key: "knowledge.financial-docs", version: "1.0.0" },
1623
- { key: "knowledge.email-threads", version: "1.0.0" },
1624
- { key: "knowledge.financial-overview", version: "1.0.0" }
1625
- ],
1626
- telemetry: [{ key: "pfo.telemetry", version: "1.0.0" }],
1627
- policies: [{ key: "pfo.policy.tenancy", version: "1.0.0" }],
1628
- integrations: [
1629
- { key: "pfo.integration.openbanking", version: "1.0.0" },
1630
- { key: "pfo.integration.llm", version: "1.0.0" }
1631
- ],
1632
- jobs: [
1633
- { key: "pfo.job.doc-processing", version: "1.0.0" },
1634
- { key: "pfo.job.reminder-dispatch", version: "1.0.0" }
1635
- ],
1636
- docs: [
1637
- "docs.examples.pocket-family-office.goal",
1638
- "docs.examples.pocket-family-office.usage",
1639
- "docs.examples.pocket-family-office.reference"
1640
- ]
1641
+ }
1641
1642
  });
1642
1643
  export {
1643
1644
  uploadDocumentContract,