planar 0.9.3__py3-none-any.whl → 0.11.0__py3-none-any.whl

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 (76) hide show
  1. planar/ai/agent.py +2 -1
  2. planar/ai/agent_base.py +24 -5
  3. planar/ai/state.py +17 -0
  4. planar/app.py +18 -1
  5. planar/data/connection.py +108 -0
  6. planar/data/dataset.py +11 -104
  7. planar/data/utils.py +89 -0
  8. planar/db/alembic/env.py +25 -1
  9. planar/files/storage/azure_blob.py +1 -1
  10. planar/registry_items.py +2 -0
  11. planar/routers/dataset_router.py +213 -0
  12. planar/routers/info.py +79 -36
  13. planar/routers/models.py +1 -0
  14. planar/routers/workflow.py +2 -0
  15. planar/scaffold_templates/pyproject.toml.j2 +1 -1
  16. planar/security/authorization.py +31 -3
  17. planar/security/default_policies.cedar +25 -0
  18. planar/testing/fixtures.py +34 -1
  19. planar/testing/planar_test_client.py +1 -1
  20. planar/workflows/decorators.py +2 -1
  21. planar/workflows/wrappers.py +1 -0
  22. {planar-0.9.3.dist-info → planar-0.11.0.dist-info}/METADATA +9 -1
  23. {planar-0.9.3.dist-info → planar-0.11.0.dist-info}/RECORD +25 -72
  24. {planar-0.9.3.dist-info → planar-0.11.0.dist-info}/WHEEL +1 -1
  25. planar/ai/test_agent_serialization.py +0 -229
  26. planar/ai/test_agent_tool_step_display.py +0 -78
  27. planar/data/test_dataset.py +0 -354
  28. planar/files/storage/test_azure_blob.py +0 -435
  29. planar/files/storage/test_local_directory.py +0 -162
  30. planar/files/storage/test_s3.py +0 -299
  31. planar/files/test_files.py +0 -282
  32. planar/human/test_human.py +0 -385
  33. planar/logging/test_formatter.py +0 -327
  34. planar/modeling/mixins/test_auditable.py +0 -97
  35. planar/modeling/mixins/test_timestamp.py +0 -134
  36. planar/modeling/mixins/test_uuid_primary_key.py +0 -52
  37. planar/routers/test_agents_router.py +0 -174
  38. planar/routers/test_files_router.py +0 -49
  39. planar/routers/test_object_config_router.py +0 -367
  40. planar/routers/test_routes_security.py +0 -168
  41. planar/routers/test_rule_router.py +0 -470
  42. planar/routers/test_workflow_router.py +0 -539
  43. planar/rules/test_data/account_dormancy_management.json +0 -223
  44. planar/rules/test_data/airline_loyalty_points_calculator.json +0 -262
  45. planar/rules/test_data/applicant_risk_assessment.json +0 -435
  46. planar/rules/test_data/booking_fraud_detection.json +0 -407
  47. planar/rules/test_data/cellular_data_rollover_system.json +0 -258
  48. planar/rules/test_data/clinical_trial_eligibility_screener.json +0 -437
  49. planar/rules/test_data/customer_lifetime_value.json +0 -143
  50. planar/rules/test_data/import_duties_calculator.json +0 -289
  51. planar/rules/test_data/insurance_prior_authorization.json +0 -443
  52. planar/rules/test_data/online_check_in_eligibility_system.json +0 -254
  53. planar/rules/test_data/order_consolidation_system.json +0 -375
  54. planar/rules/test_data/portfolio_risk_monitor.json +0 -471
  55. planar/rules/test_data/supply_chain_risk.json +0 -253
  56. planar/rules/test_data/warehouse_cross_docking.json +0 -237
  57. planar/rules/test_rules.py +0 -1494
  58. planar/security/tests/test_auth_middleware.py +0 -162
  59. planar/security/tests/test_authorization_context.py +0 -78
  60. planar/security/tests/test_cedar_basics.py +0 -41
  61. planar/security/tests/test_cedar_policies.py +0 -158
  62. planar/security/tests/test_jwt_principal_context.py +0 -179
  63. planar/test_app.py +0 -142
  64. planar/test_cli.py +0 -394
  65. planar/test_config.py +0 -515
  66. planar/test_object_config.py +0 -527
  67. planar/test_object_registry.py +0 -14
  68. planar/test_sqlalchemy.py +0 -193
  69. planar/test_utils.py +0 -105
  70. planar/testing/test_memory_storage.py +0 -143
  71. planar/workflows/test_concurrency_detection.py +0 -120
  72. planar/workflows/test_lock_timeout.py +0 -140
  73. planar/workflows/test_serialization.py +0 -1203
  74. planar/workflows/test_suspend_deserialization.py +0 -231
  75. planar/workflows/test_workflow.py +0 -2005
  76. {planar-0.9.3.dist-info → planar-0.11.0.dist-info}/entry_points.txt +0 -0
@@ -1,289 +0,0 @@
1
- {
2
- "nodes": [
3
- {
4
- "type": "inputNode",
5
- "content": {
6
- "schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"product\": {\n \"type\": \"object\",\n \"properties\": {\n \"category\": {\n \"type\": \"string\",\n \"description\": \"Product category\"\n },\n \"value\": {\n \"type\": \"number\",\n \"description\": \"Product value in USD\"\n },\n \"weight\": {\n \"type\": \"number\",\n \"description\": \"Product weight in kg\"\n },\n \"hsCode\": {\n \"type\": \"string\",\n \"description\": \"Harmonized System code\"\n }\n }\n },\n \"origin\": {\n \"type\": \"object\",\n \"properties\": {\n \"country\": {\n \"type\": \"string\",\n \"description\": \"Country of origin\"\n },\n \"hasFTA\": {\n \"type\": \"boolean\",\n \"description\": \"Has free trade agreement\"\n },\n \"preferentialTreatment\": {\n \"type\": \"boolean\",\n \"description\": \"Eligible for preferential treatment\"\n }\n }\n },\n \"destination\": {\n \"type\": \"object\",\n \"properties\": {\n \"country\": {\n \"type\": \"string\",\n \"description\": \"Destination country\"\n }\n }\n }\n }\n}"
7
- },
8
- "id": "input",
9
- "name": "request",
10
- "position": {
11
- "x": 110,
12
- "y": 114
13
- }
14
- },
15
- {
16
- "type": "decisionTableNode",
17
- "content": {
18
- "hitPolicy": "first",
19
- "rules": [
20
- {
21
- "_id": "pc-1",
22
- "i-category": "'electronics'",
23
- "i-hsCode": "startsWith($, '85')",
24
- "o-baseRate": "0.15",
25
- "o-category": "'High-Tech Electronics'"
26
- },
27
- {
28
- "_id": "pc-2",
29
- "i-category": "'electronics'",
30
- "i-hsCode": "startsWith($, '90')",
31
- "o-baseRate": "0.12",
32
- "o-category": "'Precision Electronics'"
33
- },
34
- {
35
- "_id": "pc-3",
36
- "i-category": "'textiles'",
37
- "i-hsCode": "startsWith($, '61'), startsWith($, '62')",
38
- "o-baseRate": "0.20",
39
- "o-category": "'Clothing'"
40
- },
41
- {
42
- "_id": "pc-4",
43
- "i-category": "'textiles'",
44
- "i-hsCode": "startsWith($, '63')",
45
- "o-baseRate": "0.18",
46
- "o-category": "'Home Textiles'"
47
- },
48
- {
49
- "_id": "pc-5",
50
- "i-category": "'food'",
51
- "i-hsCode": "startsWith($, '02'), startsWith($, '03'), startsWith($, '04')",
52
- "o-baseRate": "0.22",
53
- "o-category": "'Perishable Food'"
54
- },
55
- {
56
- "_id": "pc-6",
57
- "i-category": "'food'",
58
- "i-hsCode": "startsWith($, '19'), startsWith($, '20'), startsWith($, '21')",
59
- "o-baseRate": "0.16",
60
- "o-category": "'Processed Food'"
61
- },
62
- {
63
- "_id": "pc-7",
64
- "i-category": "'automotive'",
65
- "i-hsCode": "startsWith($, '87')",
66
- "o-baseRate": "0.25",
67
- "o-category": "'Vehicles'"
68
- },
69
- {
70
- "_id": "pc-8",
71
- "i-category": "",
72
- "i-hsCode": "",
73
- "o-baseRate": "0.18",
74
- "o-category": "'General Merchandise'"
75
- }
76
- ],
77
- "inputs": [
78
- {
79
- "id": "i-category",
80
- "name": "Product Category",
81
- "field": "product.category"
82
- },
83
- {
84
- "id": "i-hsCode",
85
- "name": "HS Code",
86
- "field": "product.hsCode"
87
- }
88
- ],
89
- "outputs": [
90
- {
91
- "id": "o-baseRate",
92
- "name": "Base Duty Rate",
93
- "field": "classification.baseRate"
94
- },
95
- {
96
- "id": "o-category",
97
- "name": "Product Classification",
98
- "field": "classification.category"
99
- }
100
- ],
101
- "passThrough": true,
102
- "inputField": null,
103
- "outputPath": null,
104
- "executionMode": "single"
105
- },
106
- "id": "product_classification",
107
- "name": "product_classification",
108
- "position": {
109
- "x": 430,
110
- "y": 114
111
- }
112
- },
113
- {
114
- "type": "decisionTableNode",
115
- "content": {
116
- "hitPolicy": "first",
117
- "rules": [
118
- {
119
- "_id": "cr-1",
120
- "i-origin": "'CN'",
121
- "i-destination": "'US'",
122
- "i-hasFTA": "false",
123
- "o-countryMultiplier": "1.25",
124
- "o-hasSanctions": "false"
125
- },
126
- {
127
- "_id": "cr-2",
128
- "i-origin": "'MX'",
129
- "i-destination": "'US'",
130
- "i-hasFTA": "true",
131
- "o-countryMultiplier": "0.0",
132
- "o-hasSanctions": "false"
133
- },
134
- {
135
- "_id": "cr-3",
136
- "i-origin": "'CA'",
137
- "i-destination": "'US'",
138
- "i-hasFTA": "true",
139
- "o-countryMultiplier": "0.0",
140
- "o-hasSanctions": "false"
141
- },
142
- {
143
- "_id": "cr-4",
144
- "i-origin": "'GB', 'DE', 'FR', 'IT', 'ES'",
145
- "i-destination": "'US'",
146
- "i-hasFTA": "false",
147
- "o-countryMultiplier": "0.8",
148
- "o-hasSanctions": "false"
149
- },
150
- {
151
- "_id": "cr-5",
152
- "i-origin": "'KP', 'IR'",
153
- "i-destination": "'US'",
154
- "i-hasFTA": "",
155
- "o-countryMultiplier": "3.0",
156
- "o-hasSanctions": "true"
157
- },
158
- {
159
- "_id": "cr-6",
160
- "i-origin": "'VN'",
161
- "i-destination": "'US'",
162
- "i-hasFTA": "false",
163
- "o-countryMultiplier": "0.9",
164
- "o-hasSanctions": "false"
165
- },
166
- {
167
- "_id": "cr-7",
168
- "i-origin": "",
169
- "i-destination": "",
170
- "i-hasFTA": "",
171
- "o-countryMultiplier": "1.0",
172
- "o-hasSanctions": "false"
173
- }
174
- ],
175
- "inputs": [
176
- {
177
- "id": "i-origin",
178
- "name": "Origin Country",
179
- "field": "origin.country"
180
- },
181
- {
182
- "id": "i-destination",
183
- "name": "Destination Country",
184
- "field": "destination.country"
185
- },
186
- {
187
- "id": "i-hasFTA",
188
- "name": "Has FTA",
189
- "field": "origin.hasFTA"
190
- }
191
- ],
192
- "outputs": [
193
- {
194
- "id": "o-countryMultiplier",
195
- "name": "Country Multiplier",
196
- "field": "countryRules.multiplier"
197
- },
198
- {
199
- "id": "o-hasSanctions",
200
- "name": "Has Sanctions",
201
- "field": "countryRules.hasSanctions"
202
- }
203
- ],
204
- "passThrough": true,
205
- "inputField": null,
206
- "outputPath": null,
207
- "executionMode": "single"
208
- },
209
- "id": "country_rules",
210
- "name": "country_rules",
211
- "position": {
212
- "x": 750,
213
- "y": 114
214
- }
215
- },
216
- {
217
- "type": "expressionNode",
218
- "content": {
219
- "expressions": [
220
- {
221
- "id": "expr1",
222
- "key": "baseDuty",
223
- "value": "product.value * number(classification.baseRate)"
224
- },
225
- {
226
- "id": "expr2",
227
- "key": "countryAdjustment",
228
- "value": "$.baseDuty * number(countryRules.multiplier)"
229
- },
230
- {
231
- "id": "expr3",
232
- "key": "additionalFees",
233
- "value": "countryRules.hasSanctions == true ? product.value * 0.1 : 0"
234
- },
235
- {
236
- "id": "expr4",
237
- "key": "preferentialDiscount",
238
- "value": "origin.preferentialTreatment == true ? $.countryAdjustment * 0.8 : $.countryAdjustment"
239
- },
240
- {
241
- "id": "expr5",
242
- "key": "minDuty",
243
- "value": "$.countryAdjustment > 0 ? max([10, $.preferentialDiscount]) : 0"
244
- },
245
- {
246
- "id": "expr6",
247
- "key": "totalDuty",
248
- "value": "$.minDuty + $.additionalFees"
249
- },
250
- {
251
- "id": "expr7",
252
- "key": "dutyRate",
253
- "value": "$.totalDuty / product.value"
254
- }
255
- ],
256
- "passThrough": false,
257
- "inputField": null,
258
- "outputPath": null,
259
- "executionMode": "single"
260
- },
261
- "id": "duty_calculation",
262
- "name": "duty_calculation",
263
- "position": {
264
- "x": 1070,
265
- "y": 114
266
- }
267
- }
268
- ],
269
- "edges": [
270
- {
271
- "id": "edge1",
272
- "sourceId": "input",
273
- "targetId": "product_classification",
274
- "type": "edge"
275
- },
276
- {
277
- "id": "edge2",
278
- "sourceId": "product_classification",
279
- "targetId": "country_rules",
280
- "type": "edge"
281
- },
282
- {
283
- "id": "edge3",
284
- "sourceId": "country_rules",
285
- "targetId": "duty_calculation",
286
- "type": "edge"
287
- }
288
- ]
289
- }