@synapsor/runner 1.6.3 → 1.6.5

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 (98) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +94 -8
  3. package/CONTRIBUTING.md +10 -3
  4. package/README.md +90 -109
  5. package/SECURITY.md +7 -3
  6. package/THREAT_MODEL.md +37 -0
  7. package/dist/authoring.mjs +98 -13
  8. package/dist/cli.d.ts +12 -1
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/local-ui.d.ts +60 -0
  11. package/dist/local-ui.d.ts.map +1 -1
  12. package/dist/runner.mjs +7688 -2227
  13. package/dist/runtime.mjs +528 -51
  14. package/docs/README.md +14 -0
  15. package/docs/agent-guided-setup.md +13 -11
  16. package/docs/aggregate-reads.md +14 -5
  17. package/docs/app-owned-executors.md +5 -6
  18. package/docs/auto-boundary-and-scoped-explore.md +70 -14
  19. package/docs/capability-authoring.md +2 -2
  20. package/docs/client-recipes.md +41 -12
  21. package/docs/cloud-mode.md +7 -7
  22. package/docs/conformance.md +6 -3
  23. package/docs/current-scope.md +13 -2
  24. package/docs/cursor-plugin.md +3 -3
  25. package/docs/database-enforced-scope.md +6 -0
  26. package/docs/dsl-reference.md +12 -1
  27. package/docs/fresh-developer-usability.md +6 -6
  28. package/docs/getting-started-own-database.md +52 -50
  29. package/docs/guided-onboarding.md +104 -34
  30. package/docs/host-compatibility.md +24 -11
  31. package/docs/limitations.md +34 -14
  32. package/docs/local-mode.md +20 -20
  33. package/docs/mcp-audit.md +14 -14
  34. package/docs/mcp-client-setup.md +26 -14
  35. package/docs/mcp-clients.md +47 -11
  36. package/docs/migrating-to-synapsor-spec.md +5 -1
  37. package/docs/openai-agents-sdk.md +2 -2
  38. package/docs/proposal-evidence-freshness.md +7 -7
  39. package/docs/recipes.md +6 -6
  40. package/docs/release-notes.md +100 -10
  41. package/docs/release-policy.md +20 -7
  42. package/docs/reversible-change-sets.md +1 -1
  43. package/docs/reviewed-database-views.md +132 -0
  44. package/docs/reviewed-relationships.md +245 -0
  45. package/docs/rfcs/006-reviewed-reversible-change-sets.md +1 -1
  46. package/docs/runner-bundles.md +7 -7
  47. package/docs/schema-api-candidates.md +1 -1
  48. package/docs/security-boundary.md +30 -0
  49. package/docs/troubleshooting-first-run.md +63 -19
  50. package/docs/use-your-own-database.md +6 -4
  51. package/docs/workbench-ask.md +279 -0
  52. package/docs/writeback-executors.md +7 -7
  53. package/examples/auto-boundary-churn/README.md +1 -1
  54. package/examples/community-solar-clean-room/README.md +7 -0
  55. package/examples/community-solar-clean-room/docker-compose.yml +16 -0
  56. package/examples/community-solar-clean-room/package.json +15 -0
  57. package/examples/community-solar-clean-room/prisma/schema.prisma +171 -0
  58. package/examples/community-solar-clean-room/seed/postgres.sql +571 -0
  59. package/examples/fitflow-guided-onboarding/README.md +2 -2
  60. package/examples/openai-agents-http/Makefile +1 -1
  61. package/examples/openai-agents-http/README.md +1 -1
  62. package/examples/openai-agents-stdio/Makefile +1 -1
  63. package/examples/openai-agents-stdio/README.md +2 -2
  64. package/examples/openai-agents-stdio/agent.py +1 -4
  65. package/examples/reference-support-billing-app/README.md +16 -16
  66. package/examples/retail-clean-room/README.md +7 -0
  67. package/examples/retail-clean-room/docker-compose.yml +16 -0
  68. package/examples/retail-clean-room/package.json +9 -0
  69. package/examples/retail-clean-room/prisma/schema.prisma +239 -0
  70. package/examples/retail-clean-room/seed/postgres.sql +781 -0
  71. package/examples/retail-clean-room/view-recipe/average-retained-revenue.synapsor.sql +21 -0
  72. package/examples/retail-clean-room/view-recipe/synapsor.runner.json +25 -0
  73. package/examples/support-plan-credit/mcp-client-examples/claude-code.sh +1 -4
  74. package/examples/support-plan-credit/mcp-client-examples/claude-desktop.json +1 -4
  75. package/examples/support-plan-credit/mcp-client-examples/codex.config.toml +1 -4
  76. package/examples/support-plan-credit/mcp-client-examples/cursor-global.mcp.json +1 -4
  77. package/examples/support-plan-credit/mcp-client-examples/cursor-project.mcp.json +1 -4
  78. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.json +1 -4
  79. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.mjs +1 -1
  80. package/examples/support-plan-credit/mcp-client-examples/google-adk.py +1 -1
  81. package/examples/support-plan-credit/mcp-client-examples/langchain.mjs +1 -1
  82. package/examples/support-plan-credit/mcp-client-examples/llamaindex.py +1 -1
  83. package/examples/support-plan-credit/mcp-client-examples/openai-agents-stdio.ts +1 -1
  84. package/examples/support-plan-credit/mcp-client-examples/vscode.mcp.json +1 -4
  85. package/fixtures/compatibility/published-1.6.3/manifest.json +76 -0
  86. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
  87. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
  88. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
  89. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
  90. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
  91. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
  92. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
  93. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
  94. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
  95. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
  96. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
  97. package/llms.txt +10 -5
  98. package/package.json +9 -2
@@ -0,0 +1,171 @@
1
+ generator client {
2
+ provider = "prisma-client-js"
3
+ }
4
+
5
+ datasource db {
6
+ provider = "postgresql"
7
+ url = env("DATABASE_URL")
8
+ }
9
+
10
+ model Cooperative {
11
+ id String @id
12
+ name String
13
+ regions Region[]
14
+ teams TechnicianTeam[]
15
+ technicians Technician[]
16
+ sites SolarSite[]
17
+ models InverterModel[]
18
+ workOrders WorkOrder[]
19
+ incidents Incident[]
20
+
21
+ @@map("cooperatives")
22
+ }
23
+
24
+ model Region {
25
+ id String @id
26
+ cooperativeId String @map("cooperative_id")
27
+ name String
28
+ climateZone String @map("climate_zone")
29
+ cooperative Cooperative @relation(fields: [cooperativeId], references: [id])
30
+ sites SolarSite[]
31
+ workOrders WorkOrder[]
32
+ incidents Incident[]
33
+
34
+ @@unique([cooperativeId, name])
35
+ @@map("regions")
36
+ }
37
+
38
+ model TechnicianTeam {
39
+ id String @id
40
+ cooperativeId String @map("cooperative_id")
41
+ name String
42
+ cooperative Cooperative @relation(fields: [cooperativeId], references: [id])
43
+ technicians Technician[]
44
+ workOrders WorkOrder[]
45
+
46
+ @@unique([cooperativeId, name])
47
+ @@map("technician_teams")
48
+ }
49
+
50
+ model Technician {
51
+ id String @id
52
+ cooperativeId String @map("cooperative_id")
53
+ teamId String @map("team_id")
54
+ displayName String @map("display_name")
55
+ privateNotes String @map("private_technician_notes")
56
+ cooperative Cooperative @relation(fields: [cooperativeId], references: [id])
57
+ team TechnicianTeam @relation(fields: [teamId], references: [id])
58
+ workOrders WorkOrder[]
59
+
60
+ @@map("technicians")
61
+ }
62
+
63
+ model SolarSite {
64
+ id String @id
65
+ cooperativeId String @map("cooperative_id")
66
+ regionId String @map("region_id")
67
+ name String
68
+ siteGroup String @map("site_group")
69
+ cooperative Cooperative @relation(fields: [cooperativeId], references: [id])
70
+ region Region @relation(fields: [regionId], references: [id])
71
+ inverters Inverter[]
72
+ workOrders WorkOrder[]
73
+ incidents Incident[]
74
+
75
+ @@unique([cooperativeId, name])
76
+ @@map("solar_sites")
77
+ }
78
+
79
+ model InverterModel {
80
+ id String @id
81
+ cooperativeId String @map("cooperative_id")
82
+ manufacturer String
83
+ modelName String @map("model_name")
84
+ cooperative Cooperative @relation(fields: [cooperativeId], references: [id])
85
+ inverters Inverter[]
86
+ workOrders WorkOrder[]
87
+ incidents Incident[]
88
+
89
+ @@unique([cooperativeId, manufacturer, modelName])
90
+ @@map("inverter_models")
91
+ }
92
+
93
+ model Inverter {
94
+ id String @id
95
+ cooperativeId String @map("cooperative_id")
96
+ siteId String @map("site_id")
97
+ inverterModelId String @map("inverter_model_id")
98
+ serialNumber String @map("serial_number")
99
+ accessToken String @map("access_token")
100
+ panelPosition String @map("panel_position")
101
+ site SolarSite @relation(fields: [siteId], references: [id])
102
+ model InverterModel @relation(fields: [inverterModelId], references: [id])
103
+
104
+ @@unique([cooperativeId, serialNumber])
105
+ @@map("inverters")
106
+ }
107
+
108
+ model FaultCategory {
109
+ id String @id
110
+ cooperativeId String @map("cooperative_id")
111
+ name String
112
+ severity String
113
+ incidents Incident[]
114
+ workOrders WorkOrder[]
115
+
116
+ @@unique([cooperativeId, name])
117
+ @@map("fault_categories")
118
+ }
119
+
120
+ model WorkOrder {
121
+ id String @id
122
+ cooperativeId String @map("cooperative_id")
123
+ siteId String @map("site_id")
124
+ regionId String @map("region_id")
125
+ inverterModelId String @map("inverter_model_id")
126
+ faultCategoryId String @map("fault_category_id")
127
+ assignedTechnicianId String @map("assigned_technician_id")
128
+ technicianTeamId String @map("technician_team_id")
129
+ status String
130
+ openedAt DateTime @map("opened_at") @db.Timestamptz(6)
131
+ completedAt DateTime? @map("completed_at") @db.Timestamptz(6)
132
+ downtimeMinutes Int @map("downtime_minutes")
133
+ repairDurationMinutes Int @map("repair_duration_minutes")
134
+ estimatedEnergyLossWh Int @map("estimated_energy_loss_wh")
135
+ lostRevenueCents Int @map("lost_revenue_cents")
136
+ inspectionFailed Boolean @map("inspection_failed")
137
+ version Int
138
+ privateTechnicianNotes String @map("private_technician_notes")
139
+ cooperative Cooperative @relation(fields: [cooperativeId], references: [id])
140
+ site SolarSite @relation(fields: [siteId], references: [id])
141
+ region Region @relation(fields: [regionId], references: [id])
142
+ inverterModel InverterModel @relation(fields: [inverterModelId], references: [id])
143
+ faultCategory FaultCategory @relation(fields: [faultCategoryId], references: [id])
144
+ assignedTechnician Technician @relation(fields: [assignedTechnicianId], references: [id])
145
+ technicianTeam TechnicianTeam @relation(fields: [technicianTeamId], references: [id])
146
+
147
+ @@index([cooperativeId, assignedTechnicianId, openedAt])
148
+ @@map("work_orders")
149
+ }
150
+
151
+ model Incident {
152
+ id String @id
153
+ cooperativeId String @map("cooperative_id")
154
+ siteId String @map("site_id")
155
+ regionId String @map("region_id")
156
+ inverterModelId String @map("inverter_model_id")
157
+ faultCategoryId String @map("fault_category_id")
158
+ status String
159
+ occurredAt DateTime @map("occurred_at") @db.Timestamptz(6)
160
+ resolvedAt DateTime? @map("resolved_at") @db.Timestamptz(6)
161
+ downtimeMinutes Int @map("downtime_minutes")
162
+ estimatedEnergyLossWh Int @map("estimated_energy_loss_wh")
163
+ cooperative Cooperative @relation(fields: [cooperativeId], references: [id])
164
+ site SolarSite @relation(fields: [siteId], references: [id])
165
+ region Region @relation(fields: [regionId], references: [id])
166
+ inverterModel InverterModel @relation(fields: [inverterModelId], references: [id])
167
+ faultCategory FaultCategory @relation(fields: [faultCategoryId], references: [id])
168
+
169
+ @@index([cooperativeId, occurredAt])
170
+ @@map("incidents")
171
+ }