@wowok/agent-mcp 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.js +1 -1
- package/dist/config/runtime.js +1 -238
- package/dist/customer/customer-advice.js +1 -130
- package/dist/customer/index.js +1 -11
- package/dist/customer/industry-risks.js +1 -438
- package/dist/customer/info-puzzle.js +1 -681
- package/dist/customer/order-monitor.js +1 -328
- package/dist/customer/order-strategy.js +1 -373
- package/dist/customer/post-purchase.js +1 -351
- package/dist/customer/preorder-compare.js +1 -34
- package/dist/customer/reminder-system.js +1 -316
- package/dist/customer/risk-assessment.js +1 -397
- package/dist/customer/types.js +1 -13
- package/dist/customer/user-preferences.js +1 -460
- package/dist/evaluation/arbitration-game.d.ts +9 -2
- package/dist/evaluation/arbitration-game.js +1 -48
- package/dist/evaluation/builtins/demand-match.js +1 -153
- package/dist/evaluation/builtins/index.js +1 -10
- package/dist/evaluation/builtins/service-risk.js +1 -55
- package/dist/evaluation/capability.js +1 -13
- package/dist/evaluation/composer.js +1 -40
- package/dist/evaluation/engine.js +1 -175
- package/dist/evaluation/extract.js +1 -115
- package/dist/evaluation/game-strategy.d.ts +27 -0
- package/dist/evaluation/game-strategy.js +1 -0
- package/dist/evaluation/gap.js +1 -100
- package/dist/evaluation/index.d.ts +1 -0
- package/dist/evaluation/index.js +1 -11
- package/dist/evaluation/node-game.d.ts +31 -3
- package/dist/evaluation/node-game.js +1 -57
- package/dist/evaluation/region.js +1 -36
- package/dist/evaluation/types.d.ts +1 -0
- package/dist/evaluation/types.js +1 -1
- package/dist/evaluation/user-injection.js +1 -27
- package/dist/experience/experience-reuse.js +1 -103
- package/dist/experience/index.js +1 -5
- package/dist/experience/intent-distill.js +1 -83
- package/dist/experience/realtime-feedback.js +1 -94
- package/dist/experience/types.js +1 -1
- package/dist/experience/user-profile.js +1 -171
- package/dist/extensions/business-modules.js +1 -287
- package/dist/extensions/capability-manifest.js +1 -781
- package/dist/extensions/constraint-registry.js +1 -198
- package/dist/extensions/index.js +1 -6
- package/dist/extensions/metric-registry.js +1 -257
- package/dist/extensions/mode-evaluator.js +1 -170
- package/dist/extensions/modes.js +1 -499
- package/dist/extensions/registry.js +1 -717
- package/dist/extensions/types.js +1 -1
- package/dist/harness/auto-escalation.js +1 -68
- package/dist/harness/checkpoint.js +1 -129
- package/dist/harness/index.js +1 -78
- package/dist/harness/plan.js +1 -315
- package/dist/harness/recover.js +1 -139
- package/dist/harness/types.js +1 -1
- package/dist/harness/verify.js +1 -237
- package/dist/index.js +1 -273
- package/dist/intent/enrich.js +1 -67
- package/dist/intent/index.js +1 -60
- package/dist/intent/matcher.js +1 -81
- package/dist/intent/store.js +1 -55
- package/dist/intent/types.js +1 -10
- package/dist/knowledge/acquisition-flywheel.js +1 -192
- package/dist/knowledge/allocation-confirm.js +1 -534
- package/dist/knowledge/allocation-context.js +1 -249
- package/dist/knowledge/allocation-ledger.js +1 -463
- package/dist/knowledge/allocation-puzzle.js +1 -298
- package/dist/knowledge/allocation-risk.js +1 -568
- package/dist/knowledge/allocation-templates.js +1 -970
- package/dist/knowledge/allocation-translation.js +1 -585
- package/dist/knowledge/arb-risk.js +1 -210
- package/dist/knowledge/arbitration-confirm.js +1 -559
- package/dist/knowledge/arbitration-context.js +1 -505
- package/dist/knowledge/arbitration-ledger.js +1 -521
- package/dist/knowledge/arbitration-puzzle.js +1 -304
- package/dist/knowledge/arbitration-risk.js +1 -423
- package/dist/knowledge/arbitration-templates.js +1 -276
- package/dist/knowledge/arbitration-translation.js +1 -487
- package/dist/knowledge/arbitration-trust.js +1 -117
- package/dist/knowledge/audit-rules.js +1 -141
- package/dist/knowledge/bridge-risk.js +1 -263
- package/dist/knowledge/contact-risk.js +1 -200
- package/dist/knowledge/contact-templates.js +1 -60
- package/dist/knowledge/demand-confirm.js +1 -206
- package/dist/knowledge/demand-matching.js +1 -132
- package/dist/knowledge/demand-risk.js +1 -240
- package/dist/knowledge/demand-translation.js +1 -354
- package/dist/knowledge/deployment-scanner.js +1 -823
- package/dist/knowledge/dynamic-pricing.js +1 -87
- package/dist/knowledge/examples-scanner-cli.js +1 -26
- package/dist/knowledge/examples-scanner.js +1 -843
- package/dist/knowledge/flywheel-loop.js +1 -404
- package/dist/knowledge/fund-layer.js +1 -973
- package/dist/knowledge/glossary.js +1 -211
- package/dist/knowledge/guard-confirm.js +1 -406
- package/dist/knowledge/guard-context.js +1 -287
- package/dist/knowledge/guard-design-patterns.js +1 -360
- package/dist/knowledge/guard-ledger.js +1 -260
- package/dist/knowledge/guard-lint.js +1 -670
- package/dist/knowledge/guard-migration.js +1 -228
- package/dist/knowledge/guard-puzzle.js +1 -805
- package/dist/knowledge/guard-render.js +1 -700
- package/dist/knowledge/guard-risk.js +1 -1879
- package/dist/knowledge/guard-submission-prompt.js +1 -171
- package/dist/knowledge/guard-templates.js +1 -1105
- package/dist/knowledge/guard-translation.js +1 -1119
- package/dist/knowledge/index.js +1 -436
- package/dist/knowledge/industry-evolution.js +1 -323
- package/dist/knowledge/industry-generalizer.js +1 -381
- package/dist/knowledge/industry-registry.js +1 -174
- package/dist/knowledge/intent-metrics.d.ts +4 -3
- package/dist/knowledge/intent-metrics.js +1 -566
- package/dist/knowledge/machine-confirm.js +1 -559
- package/dist/knowledge/machine-context.js +1 -833
- package/dist/knowledge/machine-ledger.js +1 -338
- package/dist/knowledge/machine-puzzle.js +1 -494
- package/dist/knowledge/machine-render.js +1 -565
- package/dist/knowledge/machine-risk.js +1 -669
- package/dist/knowledge/machine-templates.js +1 -1597
- package/dist/knowledge/machine-topology.js +1 -234
- package/dist/knowledge/machine-translation.js +1 -513
- package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
- package/dist/knowledge/mcp-schema-audit.js +1 -777
- package/dist/knowledge/onchain-constants.js +1 -35
- package/dist/knowledge/order-confirm.js +1 -573
- package/dist/knowledge/order-context.js +1 -390
- package/dist/knowledge/order-ledger.js +1 -341
- package/dist/knowledge/order-puzzle.js +1 -255
- package/dist/knowledge/order-risk.js +1 -653
- package/dist/knowledge/order-templates.js +1 -368
- package/dist/knowledge/order-translation.js +1 -550
- package/dist/knowledge/overrides-loader.js +1 -65
- package/dist/knowledge/passport-confirm.js +1 -531
- package/dist/knowledge/passport-context.js +1 -306
- package/dist/knowledge/passport-ledger.js +1 -282
- package/dist/knowledge/passport-puzzle.js +1 -333
- package/dist/knowledge/passport-risk.js +1 -450
- package/dist/knowledge/passport-templates.js +1 -568
- package/dist/knowledge/passport-translation.js +1 -516
- package/dist/knowledge/payment-risk.js +1 -249
- package/dist/knowledge/permission-confirm.js +1 -426
- package/dist/knowledge/permission-context.js +1 -224
- package/dist/knowledge/permission-ledger.js +1 -403
- package/dist/knowledge/permission-puzzle.js +1 -173
- package/dist/knowledge/permission-risk.js +1 -411
- package/dist/knowledge/permission-templates.js +1 -234
- package/dist/knowledge/permission-translation.js +1 -350
- package/dist/knowledge/personal-risk.js +1 -212
- package/dist/knowledge/process-model.js +1 -160
- package/dist/knowledge/progress-confirm.js +1 -456
- package/dist/knowledge/progress-context.js +1 -452
- package/dist/knowledge/progress-ledger.js +1 -330
- package/dist/knowledge/progress-puzzle.js +1 -219
- package/dist/knowledge/progress-risk.js +1 -461
- package/dist/knowledge/progress-templates.js +1 -228
- package/dist/knowledge/progress-translation.js +1 -405
- package/dist/knowledge/proof-confirm.js +1 -187
- package/dist/knowledge/proof-risk.js +1 -207
- package/dist/knowledge/proof-translation.js +1 -283
- package/dist/knowledge/registrar-risk.js +1 -217
- package/dist/knowledge/repository-confirm.js +1 -286
- package/dist/knowledge/repository-risk.js +1 -373
- package/dist/knowledge/repository-translation.js +1 -445
- package/dist/knowledge/reputation-rules.js +1 -99
- package/dist/knowledge/resource-risk.js +1 -157
- package/dist/knowledge/reward-confirm.js +1 -526
- package/dist/knowledge/reward-context.js +1 -504
- package/dist/knowledge/reward-ledger.js +1 -502
- package/dist/knowledge/reward-puzzle.js +1 -300
- package/dist/knowledge/reward-risk.js +1 -627
- package/dist/knowledge/reward-templates.js +1 -197
- package/dist/knowledge/reward-translation.js +1 -501
- package/dist/knowledge/safety-rules.js +1 -404
- package/dist/knowledge/scenario-modes.js +1 -321
- package/dist/knowledge/service-confirm.js +1 -807
- package/dist/knowledge/service-context.js +1 -403
- package/dist/knowledge/service-ledger.js +1 -609
- package/dist/knowledge/service-puzzle.js +1 -236
- package/dist/knowledge/service-risk.js +1 -651
- package/dist/knowledge/service-templates.js +1 -456
- package/dist/knowledge/service-translation.js +1 -622
- package/dist/knowledge/template-registry.js +1 -353
- package/dist/knowledge/tool-constraints.js +1 -195
- package/dist/knowledge/tools-reference.js +1 -178
- package/dist/knowledge/treasury-confirm.js +1 -512
- package/dist/knowledge/treasury-context.js +1 -363
- package/dist/knowledge/treasury-ledger.js +1 -300
- package/dist/knowledge/treasury-puzzle.js +1 -216
- package/dist/knowledge/treasury-risk.js +1 -440
- package/dist/knowledge/treasury-templates.js +1 -358
- package/dist/knowledge/treasury-translation.js +1 -498
- package/dist/knowledge/trust-metrics.js +1 -198
- package/dist/knowledge/util-risk.js +1 -135
- package/dist/loop-engineering/aggregate.js +1 -132
- package/dist/loop-engineering/context-collect.js +1 -83
- package/dist/loop-engineering/diagnose.js +1 -273
- package/dist/loop-engineering/improve.js +1 -405
- package/dist/loop-engineering/index.js +1 -4
- package/dist/loop-engineering/pipeline.js +1 -56
- package/dist/mode-market/index.js +1 -3
- package/dist/mode-market/registry.js +1 -124
- package/dist/mode-market/review.js +1 -214
- package/dist/mode-market/submission.js +1 -85
- package/dist/participation/collaborator-interest.d.ts +23 -0
- package/dist/participation/collaborator-interest.js +1 -0
- package/dist/participation/customer-interest.d.ts +25 -0
- package/dist/participation/customer-interest.js +1 -0
- package/dist/participation/merchant-interest.js +1 -100
- package/dist/participation/radar-core.d.ts +13 -3
- package/dist/participation/radar-core.js +1 -269
- package/dist/participation/supplier-interest.d.ts +25 -0
- package/dist/participation/supplier-interest.js +1 -0
- package/dist/persona/analyzer.js +1 -66
- package/dist/persona/bridge.js +1 -86
- package/dist/persona/defaults.js +1 -195
- package/dist/persona/experience-bridge.js +1 -23
- package/dist/persona/index.js +1 -71
- package/dist/persona/model.js +1 -111
- package/dist/persona/store.js +1 -62
- package/dist/persona/types.d.ts +3 -1
- package/dist/persona/types.js +1 -5
- package/dist/project/business-puzzle.js +1 -383
- package/dist/project/context-assembly.js +1 -254
- package/dist/project/deployment-bridge.js +1 -120
- package/dist/project/deployment-doc.js +1 -1126
- package/dist/project/edit-planner.js +1 -1342
- package/dist/project/evaluation.js +1 -2011
- package/dist/project/game-theory.js +1 -177
- package/dist/project/graph-builder.js +1 -656
- package/dist/project/graph.js +1 -340
- package/dist/project/handlers.js +1 -1784
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +1 -301
- package/dist/project/intent-analyzer.js +1 -149
- package/dist/project/machine-nodes.js +1 -36
- package/dist/project/merchant-guide.js +1 -264
- package/dist/project/migration.js +1 -125
- package/dist/project/mode-actions.js +1 -309
- package/dist/project/namespace.js +1 -206
- package/dist/project/participation-radar.js +1 -428
- package/dist/project/pipeline-actions.js +1 -109
- package/dist/project/project-store.js +1 -422
- package/dist/project/query.js +1 -153
- package/dist/project/reverse-mapping.d.ts +34 -0
- package/dist/project/reverse-mapping.js +1 -0
- package/dist/project/risk-aggregator.js +1 -295
- package/dist/project/rollback-policy.js +1 -290
- package/dist/project/semantic-assembler.js +1 -345
- package/dist/project/semantic-graph.js +1 -292
- package/dist/project/stage-gate.js +1 -369
- package/dist/project/substep-trace.js +1 -332
- package/dist/project/task-tracker.js +1 -78
- package/dist/role/derivation.d.ts +18 -0
- package/dist/role/derivation.js +1 -0
- package/dist/role/index.d.ts +5 -0
- package/dist/role/index.js +1 -0
- package/dist/role/model.d.ts +8 -0
- package/dist/role/model.js +1 -0
- package/dist/role/resolution.d.ts +11 -0
- package/dist/role/resolution.js +1 -0
- package/dist/role/types.d.ts +11 -0
- package/dist/role/types.js +1 -0
- package/dist/rules.js +1 -52
- package/dist/safety/confirm-gate.js +1 -88
- package/dist/safety/index.js +1 -3
- package/dist/safety/preview.js +1 -52
- package/dist/schema/call/allocation.js +1 -34
- package/dist/schema/call/arbitration.js +1 -113
- package/dist/schema/call/base.d.ts +15 -15
- package/dist/schema/call/base.js +1 -370
- package/dist/schema/call/bridge-handler.js +1 -265
- package/dist/schema/call/bridge.d.ts +7 -7
- package/dist/schema/call/bridge.js +1 -458
- package/dist/schema/call/contact.js +1 -37
- package/dist/schema/call/demand.js +1 -47
- package/dist/schema/call/guard.js +1 -161
- package/dist/schema/call/handler.js +1 -322
- package/dist/schema/call/index.js +1 -20
- package/dist/schema/call/machine.js +1 -193
- package/dist/schema/call/order.js +1 -35
- package/dist/schema/call/payment.js +1 -37
- package/dist/schema/call/permission-handler.js +1 -54
- package/dist/schema/call/permission.js +1 -105
- package/dist/schema/call/personal.js +1 -78
- package/dist/schema/call/progress.js +1 -47
- package/dist/schema/call/proof.js +1 -33
- package/dist/schema/call/repository.js +1 -77
- package/dist/schema/call/reward.js +1 -30
- package/dist/schema/call/semantic.js +1 -1679
- package/dist/schema/call/service.js +1 -184
- package/dist/schema/call/treasury.js +1 -71
- package/dist/schema/common/index.js +1 -407
- package/dist/schema/config/index.js +1 -68
- package/dist/schema/evaluation/index.d.ts +213 -16
- package/dist/schema/evaluation/index.js +1 -356
- package/dist/schema/index.js +1 -17
- package/dist/schema/intent-radar/index.d.ts +13 -13
- package/dist/schema/intent-radar/index.js +1 -89
- package/dist/schema/local/index.d.ts +21 -21
- package/dist/schema/local/index.js +1 -927
- package/dist/schema/local/wip.js +1 -187
- package/dist/schema/messenger/index.d.ts +7 -7
- package/dist/schema/messenger/index.js +1 -475
- package/dist/schema/operations.d.ts +7 -7
- package/dist/schema/operations.js +1 -520
- package/dist/schema/persona/index.d.ts +54 -54
- package/dist/schema/persona/index.js +1 -148
- package/dist/schema/project/index.d.ts +94 -48
- package/dist/schema/project/index.js +1 -2057
- package/dist/schema/query/index.d.ts +423 -7
- package/dist/schema/query/index.js +1 -1646
- package/dist/schema/schema-query/index.js +1 -104
- package/dist/schema/schema-version.js +1 -76
- package/dist/schema/sync-layer4.js +1 -286
- package/dist/schema/task-status.js +1 -36
- package/dist/schema/trust/index.js +1 -314
- package/dist/schema/utils/guard-parser.js +1 -419
- package/dist/schema/utils/guard-query-utils.js +1 -46
- package/dist/schema/utils/node-parser.js +1 -369
- package/dist/schema/utils/object-type-utils.js +1 -35
- package/dist/schema/utils/permission-index-utils.js +1 -7
- package/dist/schema/utils/permission-machine-check.js +1 -121
- package/dist/schema/utils/skills-recommendation.js +1 -77
- package/dist/schema-query/index.js +1 -810
- package/dist/schemas/account_operation.output.json +5 -2
- package/dist/schemas/bridge_operation.output.json +5 -2
- package/dist/schemas/evaluation_operation.output.json +112 -7
- package/dist/schemas/evaluation_operation.schema.json +93 -6
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +4 -1
- package/dist/schemas/intent_radar.schema.json +4 -1
- package/dist/schemas/local_info_operation.output.json +5 -2
- package/dist/schemas/local_mark_operation.output.json +5 -2
- package/dist/schemas/messenger_operation.output.json +5 -2
- package/dist/schemas/onchain_events.output.json +5 -2
- package/dist/schemas/onchain_operations.output.json +5 -2
- package/dist/schemas/onchain_operations.schema.json +4 -4
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +2 -2
- package/dist/schemas/onchain_operations_service.schema.json +1 -1
- package/dist/schemas/onchain_table_data.output.json +6 -3
- package/dist/schemas/persona_operation.output.json +4 -1
- package/dist/schemas/persona_operation.schema.json +4 -1
- package/dist/schemas/project_operation.output.json +28 -8
- package/dist/schemas/query_toolkit.output.json +8 -5
- package/dist/schemas/wowok_buildin_info.output.json +132 -0
- package/dist/schemas/wowok_buildin_info.schema.json +14 -0
- package/dist/telemetry/index.js +1 -112
- package/dist/telemetry/redact.js +1 -23
- package/dist/telemetry/storage.js +1 -80
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/config.js +1 -74
- package/dist/tools/handlers/evaluation.js +1 -123
- package/dist/tools/handlers/file-export.js +1 -90
- package/dist/tools/handlers/intent-radar.js +1 -76
- package/dist/tools/handlers/local.js +1 -53
- package/dist/tools/handlers/messenger.js +1 -188
- package/dist/tools/handlers/onchain.js +1 -1180
- package/dist/tools/handlers/persona.js +1 -89
- package/dist/tools/handlers/project.js +1 -211
- package/dist/tools/handlers/query.js +1 -434
- package/dist/tools/handlers/schema-query.js +1 -176
- package/dist/tools/handlers/task-status.js +1 -26
- package/dist/tools/handlers/trust.js +1 -380
- package/dist/tools/handlers/wip.js +1 -90
- package/dist/tools/index.js +1 -1382
- package/dist/tools/retry.js +1 -85
- package/dist/tools/rules-hook.js +1 -23
- package/dist/tools/shared.js +1 -130
- package/dist/tools/types.js +1 -1
- package/dist/tools/upgrade-check.d.ts +19 -0
- package/dist/tools/upgrade-check.js +1 -0
- package/dist/tools/wip-deploy-assist.js +1 -306
- package/dist/tools/wrap.js +1 -500
- package/package.json +4 -2
|
@@ -1,269 +1 @@
|
|
|
1
|
-
const DEFAULT_ANNOTATIONS = {
|
|
2
|
-
completed: ["complete", "completed", "done", "finish", "finished", "delivered", "accepted"],
|
|
3
|
-
refunded: ["refund", "refunded", "cancelled", "canceled", "lost", "closed"],
|
|
4
|
-
};
|
|
5
|
-
export function analyzeOrderParticipation(input) {
|
|
6
|
-
const annotations = {
|
|
7
|
-
completed: input.node_annotations?.completed ?? DEFAULT_ANNOTATIONS.completed,
|
|
8
|
-
refunded: input.node_annotations?.refunded ?? DEFAULT_ANNOTATIONS.refunded,
|
|
9
|
-
};
|
|
10
|
-
const current = input.current_node ?? "";
|
|
11
|
-
const isOrderHolder = !!input.order_holder && input.order_holder === input.account;
|
|
12
|
-
const heldIndexes = new Set();
|
|
13
|
-
if (input.permission?.entityPermissions) {
|
|
14
|
-
for (const [entity, indexes] of input.permission.entityPermissions) {
|
|
15
|
-
if (entity === input.account) {
|
|
16
|
-
for (const idx of indexes)
|
|
17
|
-
heldIndexes.add(idx);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const perspective = isOrderHolder
|
|
22
|
-
? "customer"
|
|
23
|
-
: heldIndexes.size > 0
|
|
24
|
-
? "operator"
|
|
25
|
-
: "observer";
|
|
26
|
-
const operable = [];
|
|
27
|
-
const waiting = [];
|
|
28
|
-
const workflowUnknown = !input.machine_nodes;
|
|
29
|
-
if (input.machine_nodes) {
|
|
30
|
-
for (const node of input.machine_nodes) {
|
|
31
|
-
for (const pair of node.pairs ?? []) {
|
|
32
|
-
if (pair.prev_node !== current)
|
|
33
|
-
continue;
|
|
34
|
-
for (const fwd of pair.forwards ?? []) {
|
|
35
|
-
const rf = resolveForward(fwd, node.name, input, isOrderHolder, heldIndexes, annotations);
|
|
36
|
-
if (rf.execution_path === "not_available") {
|
|
37
|
-
const role = fwd.permissionIndex != null
|
|
38
|
-
? `permission index ${fwd.permissionIndex}`
|
|
39
|
-
: fwd.namedOperator === ""
|
|
40
|
-
? "OrderHolder (customer)"
|
|
41
|
-
: `named operator '${fwd.namedOperator}'`;
|
|
42
|
-
const entry = waiting.find(w => w.role === role);
|
|
43
|
-
if (entry)
|
|
44
|
-
entry.forwards.push(rf.name);
|
|
45
|
-
else
|
|
46
|
-
waiting.push({ role, forwards: [rf.name] });
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
operable.push(rf);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const roles = [];
|
|
56
|
-
if (isOrderHolder) {
|
|
57
|
-
roles.push({
|
|
58
|
-
label: "OrderHolder (customer)",
|
|
59
|
-
can_act_now: operable.some(f => f.execution_path === "order_holder"),
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
for (const idx of [...heldIndexes].sort((a, b) => a - b)) {
|
|
63
|
-
roles.push({
|
|
64
|
-
label: `permission index ${idx}`,
|
|
65
|
-
can_act_now: operable.some(f => f.permission_index === idx),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (input.named_accounts) {
|
|
69
|
-
for (const [name, addr] of Object.entries(input.named_accounts)) {
|
|
70
|
-
if (nameResolvesTo(addr, input.account)) {
|
|
71
|
-
roles.push({
|
|
72
|
-
label: `named operator '${name}'`,
|
|
73
|
-
can_act_now: operable.some(f => f.named_operator === name),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
let branchChoice;
|
|
79
|
-
if (operable.length > 1) {
|
|
80
|
-
branchChoice = {
|
|
81
|
-
message: `${operable.length} operations are available to you at node '${current || "(entry)"}'. ` +
|
|
82
|
-
`Each leads to a different outcome — review the consequences and choose; no one else can make this decision for you.`,
|
|
83
|
-
options: operable.map(f => ({
|
|
84
|
-
forward: f.name,
|
|
85
|
-
to_node: f.to_node,
|
|
86
|
-
consequence: f.consequence,
|
|
87
|
-
})),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
const claims = [];
|
|
91
|
-
for (const r of input.claimable_rewards ?? []) {
|
|
92
|
-
if (r.already_claimed)
|
|
93
|
-
continue;
|
|
94
|
-
claims.push({
|
|
95
|
-
kind: "reward",
|
|
96
|
-
label: r.description ?? `Reward ${r.address}`,
|
|
97
|
-
how: `onchain_operations reward op='claim' (object='${r.address}')`,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
if (input.pending_compensation) {
|
|
101
|
-
claims.push({
|
|
102
|
-
kind: "compensation",
|
|
103
|
-
label: input.pending_compensation.note ?? "Arbitration indemnity awarded to you",
|
|
104
|
-
how: `onchain_operations service op='compensation_claim' (arbitration='${input.pending_compensation.arbitration}') — paid directly from the Service compensation_fund`,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (input.discount_available) {
|
|
108
|
-
claims.push({
|
|
109
|
-
kind: "discount",
|
|
110
|
-
label: input.discount_available,
|
|
111
|
-
how: "Mention the discount when placing the next order (reward discount config applies at purchase)",
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
if (input.rating_pending) {
|
|
115
|
-
claims.push({
|
|
116
|
-
kind: "rating",
|
|
117
|
-
label: "Rate this transaction (like/dislike) — builds on-chain reputation for both sides",
|
|
118
|
-
how: "onchain_operations operation_type='personal', data.mark={op:'like'|'dislike', address:'<merchant address>'} — votes through registrar::like/dislike into the PUBLIC aggregate count",
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
const hints = buildInterestHints(input, perspective, operable, waiting, current);
|
|
122
|
-
const summary = buildSummary(input, perspective, roles, operable, waiting, claims, workflowUnknown, current);
|
|
123
|
-
return {
|
|
124
|
-
account: input.account,
|
|
125
|
-
progress: input.progress_address,
|
|
126
|
-
order: input.order_address,
|
|
127
|
-
current_node: current,
|
|
128
|
-
perspective,
|
|
129
|
-
roles,
|
|
130
|
-
operable,
|
|
131
|
-
branch_choice: branchChoice,
|
|
132
|
-
waiting_on: waiting,
|
|
133
|
-
pending_claims: claims,
|
|
134
|
-
interest_hints: hints,
|
|
135
|
-
workflow_unknown: workflowUnknown,
|
|
136
|
-
summary,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
export function aggregateRadar(results, unreadTotal) {
|
|
140
|
-
const actionable = results
|
|
141
|
-
.filter(r => r.operable.length > 0 || r.pending_claims.length > 0)
|
|
142
|
-
.sort((a, b) => (a.perspective === "customer" ? 0 : 1) - (b.perspective === "customer" ? 0 : 1));
|
|
143
|
-
const waiting = results.filter(r => r.operable.length === 0 && r.pending_claims.length === 0);
|
|
144
|
-
const allClaims = results.flatMap(r => r.pending_claims.map(c => ({ ...c, progress: r.progress })));
|
|
145
|
-
const summary = results.length === 0
|
|
146
|
-
? "No in-flight orders found for this account."
|
|
147
|
-
: `${results.length} in-flight order(s): ${actionable.length} need your action or have claims, ${waiting.length} are waiting on other roles. ` +
|
|
148
|
-
(allClaims.length > 0 ? `${allClaims.length} unclaimed benefit(s) detected. ` : "") +
|
|
149
|
-
(actionable.length > 0 ? `Top priority: ${actionable[0].summary}` : "Nothing requires your action right now.");
|
|
150
|
-
return {
|
|
151
|
-
account: results[0]?.account ?? "",
|
|
152
|
-
orders_analyzed: results.length,
|
|
153
|
-
actionable,
|
|
154
|
-
waiting,
|
|
155
|
-
all_pending_claims: allClaims,
|
|
156
|
-
unread_messages_total: unreadTotal ?? 0,
|
|
157
|
-
summary,
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
function nameResolvesTo(value, account) {
|
|
161
|
-
if (!value)
|
|
162
|
-
return false;
|
|
163
|
-
return Array.isArray(value) ? value.includes(account) : value === account;
|
|
164
|
-
}
|
|
165
|
-
export function isConsequenceNode(nodeName, kind, annotations) {
|
|
166
|
-
const list = annotations?.[kind] ?? DEFAULT_ANNOTATIONS[kind];
|
|
167
|
-
const lower = (nodeName ?? "").toLowerCase();
|
|
168
|
-
return list.some(n => lower.includes(n));
|
|
169
|
-
}
|
|
170
|
-
function resolveForward(fwd, nodeName, input, isOrderHolder, heldIndexes, annotations) {
|
|
171
|
-
let path = "not_available";
|
|
172
|
-
if (fwd.permissionIndex != null) {
|
|
173
|
-
if (heldIndexes.has(fwd.permissionIndex))
|
|
174
|
-
path = "permission";
|
|
175
|
-
}
|
|
176
|
-
else if (fwd.namedOperator === "") {
|
|
177
|
-
if (isOrderHolder)
|
|
178
|
-
path = "order_holder";
|
|
179
|
-
}
|
|
180
|
-
else if (fwd.namedOperator != null) {
|
|
181
|
-
const resolved = input.named_accounts?.[fwd.namedOperator];
|
|
182
|
-
if (nameResolvesTo(resolved, input.account))
|
|
183
|
-
path = "named_operator";
|
|
184
|
-
}
|
|
185
|
-
const toNode = nodeName;
|
|
186
|
-
const semantics = describeForward(fwd.name ?? "", toNode, path, fwd.permissionIndex, fwd.namedOperator);
|
|
187
|
-
const consequence = consequenceOf(toNode, annotations);
|
|
188
|
-
return {
|
|
189
|
-
name: fwd.name ?? "(unnamed)",
|
|
190
|
-
to_node: toNode,
|
|
191
|
-
execution_path: path,
|
|
192
|
-
permission_index: fwd.permissionIndex ?? undefined,
|
|
193
|
-
named_operator: fwd.namedOperator ?? undefined,
|
|
194
|
-
guard: fwd.guard ?? undefined,
|
|
195
|
-
semantics,
|
|
196
|
-
consequence,
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
function describeForward(name, toNode, path, permissionIndex, namedOperator) {
|
|
200
|
-
const gate = permissionIndex != null
|
|
201
|
-
? `requires permission index ${permissionIndex}`
|
|
202
|
-
: namedOperator === ""
|
|
203
|
-
? "executable by the order holder (customer)"
|
|
204
|
-
: `executable by named operator '${namedOperator}'`;
|
|
205
|
-
const access = path === "not_available" ? "You CANNOT execute this" : "You CAN execute this";
|
|
206
|
-
return `'${name}' advances the order to node '${toNode}' (${gate}). ${access}.`;
|
|
207
|
-
}
|
|
208
|
-
function consequenceOf(toNode, annotations) {
|
|
209
|
-
if (isConsequenceNode(toNode, "completed", annotations)) {
|
|
210
|
-
return "Completion path — funds are released to the merchant per the Allocation waterfall; refunds become harder after this point.";
|
|
211
|
-
}
|
|
212
|
-
if (isConsequenceNode(toNode, "refunded", annotations)) {
|
|
213
|
-
return "Refund/cancellation path — escrowed funds return to the buyer per the Allocation configuration.";
|
|
214
|
-
}
|
|
215
|
-
return undefined;
|
|
216
|
-
}
|
|
217
|
-
function buildInterestHints(input, perspective, operable, waiting, current) {
|
|
218
|
-
const hints = [];
|
|
219
|
-
const now = input.now ?? Date.now();
|
|
220
|
-
const stalledHours = input.last_progress_at != null
|
|
221
|
-
? (now - input.last_progress_at) / 3_600_000
|
|
222
|
-
: undefined;
|
|
223
|
-
if (perspective === "customer") {
|
|
224
|
-
if (operable.length > 0) {
|
|
225
|
-
hints.push("Your confirmation is the fund-release trigger: escrowed money stays locked until YOU act — only confirm when the deliverable matches the agreement.");
|
|
226
|
-
}
|
|
227
|
-
if (waiting.some(w => w.role !== "OrderHolder (customer)")) {
|
|
228
|
-
hints.push("Delivery depends on the merchant-side roles listed in waiting_on; if they stall, Messenger first, then consider dispute via the bound Arbitration.");
|
|
229
|
-
}
|
|
230
|
-
if (stalledHours != null && stalledHours > 24) {
|
|
231
|
-
hints.push(`Order has not advanced for ${Math.round(stalledHours)}h. Your leverage: compensation_fund (if any) + arbitration + on-chain reputation (dislike) — in that order.`);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
else if (perspective === "operator") {
|
|
235
|
-
const myBlocking = waiting.filter(w => w.role.startsWith("permission index"));
|
|
236
|
-
if (operable.length > 0) {
|
|
237
|
-
hints.push("Advancing the workflow NOW improves flow efficiency and shortens your fund-settlement cycle; stalled orders degrade your on-chain reputation metrics (dispute rate, stall statistics).");
|
|
238
|
-
}
|
|
239
|
-
if (myBlocking.length > 0) {
|
|
240
|
-
hints.push("Nodes waiting on YOUR permission indexes are your responsibility surface: prolonged inaction may trigger timeout penalties or disputes recorded permanently on-chain.");
|
|
241
|
-
}
|
|
242
|
-
if (current && operable.length === 0) {
|
|
243
|
-
hints.push("Nothing for you to execute at this node — monitor only; avoid unnecessary interference that creates semantic responsibility.");
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
hints.push("You hold no operative role on this order (observer). On-chain data remains transparent to you for auditing.");
|
|
248
|
-
}
|
|
249
|
-
if ((input.unread_messages ?? 0) > 0) {
|
|
250
|
-
hints.push(`${input.unread_messages} unread Messenger message(s) — negotiation evidence (WTS) forms the arbitration record; timely replies protect your position.`);
|
|
251
|
-
}
|
|
252
|
-
return hints;
|
|
253
|
-
}
|
|
254
|
-
function buildSummary(input, perspective, roles, operable, waiting, claims, workflowUnknown, current) {
|
|
255
|
-
const roleText = roles.length > 0
|
|
256
|
-
? roles.map(r => r.label).join(", ")
|
|
257
|
-
: "no operative role";
|
|
258
|
-
const nodeText = current === "" ? "(entry, not started)" : `'${current}'`;
|
|
259
|
-
if (workflowUnknown) {
|
|
260
|
-
return `Order ${input.progress_address} is at ${nodeText}; you are ${perspective} (${roleText}). Machine workflow data unavailable — fetch the bound Machine to see executable operations.`;
|
|
261
|
-
}
|
|
262
|
-
const actionText = operable.length > 0
|
|
263
|
-
? `you can execute: ${operable.map(f => `'${f.name}'→'${f.to_node}'`).join(", ")}`
|
|
264
|
-
: waiting.length > 0
|
|
265
|
-
? `waiting on ${waiting.map(w => w.role).join(", ")}`
|
|
266
|
-
: "no pending operations at this node";
|
|
267
|
-
const claimText = claims.length > 0 ? ` ${claims.length} unclaimed benefit(s).` : "";
|
|
268
|
-
return `Order at ${nodeText}; you are ${perspective} (${roleText}) — ${actionText}.${claimText}`;
|
|
269
|
-
}
|
|
1
|
+
import{deriveCommercialRole}from'../role/derivation.js';const DEFAULT_ANNOTATIONS={'completed':['complete','completed','done','finish','finished','delivered','accepted'],'refunded':['refund','refunded','cancelled','canceled','lost','closed']};export function analyzeOrderParticipation(a){const b={'completed':a['node_annotations']?.['completed']??DEFAULT_ANNOTATIONS['completed'],'refunded':a['node_annotations']?.['refunded']??DEFAULT_ANNOTATIONS['refunded']},c=a['current_node']??'',d=!!a['order_holder']&&a['order_holder']===a['account'],e=new Set();if(a['permission']?.['entityPermissions'])for(const [t,u]of a['permission']['entityPermissions']){if(t===a['account']){for(const v of u)e['add'](v);}}const f=[];if(a['named_accounts'])for(const [w,x]of Object['entries'](a['named_accounts'])){if(nameResolvesTo(x,a['account']))f['push'](w);}const g=deriveCommercialRole({'account':a['account'],'order_holder':a['order_holder'],'held_permission_indexes':Array['from'](e),'named_operator_names':f,'service_builder':a['service_builder'],'demand_presenters':a['demand_presenters'],'has_active_order':!![]}),h=g['role'],i=g['collaborator_kind'],j=[],k=[],l=!a['machine_nodes'];let m;if(a['machine_nodes'])for(const y of a['machine_nodes']){for(const z of y['pairs']??[]){if(z['prev_node']!==c)continue;m=z['threshold'];for(const A of z['forwards']??[]){const B=resolveForward(A,y['name'],a,d,e,b);if(B['execution_path']==='not_available'){const C=A['permissionIndex']!=null?'permission\x20index\x20'+A['permissionIndex']:A['namedOperator']===''?'OrderHolder\x20(customer)':'named\x20operator\x20\x27'+A['namedOperator']+'\x27',D=k['find'](E=>E['role']===C);if(D)D['forwards']['push'](B['name']);else k['push']({'role':C,'forwards':[B['name']]});}else j['push'](B);}}}const n=[];d&&n['push']({'label':'OrderHolder\x20(customer)','can_act_now':j['some'](E=>E['execution_path']==='order_holder')});for(const E of[...e]['sort']((F,G)=>F-G)){n['push']({'label':'permission\x20index\x20'+E,'can_act_now':j['some'](F=>F['permission_index']===E)});}if(a['named_accounts'])for(const [F,G]of Object['entries'](a['named_accounts'])){nameResolvesTo(G,a['account'])&&n['push']({'label':'named\x20operator\x20\x27'+F+'\x27','can_act_now':j['some'](H=>H['named_operator']===F)});}let o;j['length']>0x1&&(o={'message':j['length']+'\x20operations\x20are\x20available\x20to\x20you\x20at\x20node\x20\x27'+(c||'(entry)')+'\x27.\x20'+'Each\x20leads\x20to\x20a\x20different\x20outcome\x20—\x20review\x20the\x20consequences\x20and\x20choose;\x20no\x20one\x20else\x20can\x20make\x20this\x20decision\x20for\x20you.','options':j['map'](H=>({'forward':H['name'],'to_node':H['to_node'],'consequence':H['consequence']}))});const p=[];for(const H of a['claimable_rewards']??[]){if(H['already_claimed'])continue;p['push']({'kind':'reward','label':H['description']??'Reward\x20'+H['address'],'how':'onchain_operations\x20reward\x20op=\x27claim\x27\x20(object=\x27'+H['address']+'\x27)'});}a['pending_compensation']&&p['push']({'kind':'compensation','label':a['pending_compensation']['note']??'Arbitration\x20indemnity\x20awarded\x20to\x20you','how':'onchain_operations\x20service\x20op=\x27compensation_claim\x27\x20(arbitration=\x27'+a['pending_compensation']['arbitration']+'\x27)\x20—\x20paid\x20directly\x20from\x20the\x20Service\x20compensation_fund'});a['discount_available']&&p['push']({'kind':'discount','label':a['discount_available'],'how':'Mention\x20the\x20discount\x20when\x20placing\x20the\x20next\x20order\x20(reward\x20discount\x20config\x20applies\x20at\x20purchase)'});a['rating_pending']&&p['push']({'kind':'rating','label':'Rate\x20this\x20transaction\x20(like/dislike)\x20—\x20builds\x20on-chain\x20reputation\x20for\x20both\x20sides','how':'onchain_operations\x20operation_type=\x27personal\x27,\x20data.mark={op:\x27like\x27|\x27dislike\x27,\x20address:\x27<merchant\x20address>\x27}\x20—\x20votes\x20through\x20registrar::like/dislike\x20into\x20the\x20PUBLIC\x20aggregate\x20count'});const q=buildInterestHints(a,h,j,k,c),s=buildSummary(a,h,n,j,k,p,l,c);return{'account':a['account'],'progress':a['progress_address'],'order':a['order_address'],'current_node':c,'perspective':h,'collaborator_kind':i,'roles':n,'operable':j,'branch_choice':o,'waiting_on':k,'pending_claims':p,'interest_hints':q,'workflow_unknown':l,'threshold':m,'summary':s};}export function aggregateRadar(a,b){const c=a['filter'](g=>g['operable']['length']>0x0||g['pending_claims']['length']>0x0)['sort']((g,h)=>(g['perspective']==='customer'?0x0:0x1)-(h['perspective']==='customer'?0x0:0x1)),d=a['filter'](g=>g['operable']['length']===0x0&&g['pending_claims']['length']===0x0),e=a['flatMap'](g=>g['pending_claims']['map'](h=>({...h,'progress':g['progress']}))),f=a['length']===0x0?'No\x20in-flight\x20orders\x20found\x20for\x20this\x20account.':a['length']+'\x20in-flight\x20order(s):\x20'+c['length']+'\x20need\x20your\x20action\x20or\x20have\x20claims,\x20'+d['length']+'\x20are\x20waiting\x20on\x20other\x20roles.\x20'+(e['length']>0x0?e['length']+'\x20unclaimed\x20benefit(s)\x20detected.\x20':'')+(c['length']>0x0?'Top\x20priority:\x20'+c[0x0]['summary']:'Nothing\x20requires\x20your\x20action\x20right\x20now.');return{'account':a[0x0]?.['account']??'','orders_analyzed':a['length'],'actionable':c,'waiting':d,'all_pending_claims':e,'unread_messages_total':b??0x0,'summary':f};}function nameResolvesTo(a,b){if(!a)return![];return Array['isArray'](a)?a['includes'](b):a===b;}export function isConsequenceNode(a,b,c){const d=c?.[b]??DEFAULT_ANNOTATIONS[b],e=(a??'')['toLowerCase']();return d['some'](f=>e['includes'](f));}function resolveForward(a,b,c,d,e,f){let g='not_available';if(a['permissionIndex']!=null){if(e['has'](a['permissionIndex']))g='permission';}else{if(a['namedOperator']===''){if(d)g='order_holder';}else{if(a['namedOperator']!=null){const k=c['named_accounts']?.[a['namedOperator']];if(nameResolvesTo(k,c['account']))g='named_operator';}}}const h=b,i=describeForward(a['name']??'',h,g,a['permissionIndex'],a['namedOperator']),j=consequenceOf(h,f);return{'name':a['name']??'(unnamed)','to_node':h,'execution_path':g,'permission_index':a['permissionIndex']??undefined,'named_operator':a['namedOperator']??undefined,'guard':a['guard']??undefined,'semantics':i,'consequence':j,'weight':a['weight']??undefined};}function describeForward(a,b,c,d,e){const f=d!=null?'requires\x20permission\x20index\x20'+d:e===''?'executable\x20by\x20the\x20order\x20holder\x20(customer)':'executable\x20by\x20named\x20operator\x20\x27'+e+'\x27',g=c==='not_available'?'You\x20CANNOT\x20execute\x20this':'You\x20CAN\x20execute\x20this';return'\x27'+a+'\x27\x20advances\x20the\x20order\x20to\x20node\x20\x27'+b+'\x27\x20('+f+').\x20'+g+'.';}function consequenceOf(a,b){if(isConsequenceNode(a,'completed',b))return'Completion\x20path\x20—\x20funds\x20are\x20released\x20to\x20the\x20merchant\x20per\x20the\x20Allocation\x20waterfall;\x20refunds\x20become\x20harder\x20after\x20this\x20point.';if(isConsequenceNode(a,'refunded',b))return'Refund/cancellation\x20path\x20—\x20escrowed\x20funds\x20return\x20to\x20the\x20buyer\x20per\x20the\x20Allocation\x20configuration.';return undefined;}function buildInterestHints(a,b,c,d,e){const f=[],g=a['now']??Date['now'](),h=a['last_progress_at']!=null?(g-a['last_progress_at'])/0x36ee80:undefined;if(b==='customer')c['length']>0x0&&f['push']('Your\x20confirmation\x20is\x20the\x20fund-release\x20trigger:\x20escrowed\x20money\x20stays\x20locked\x20until\x20YOU\x20act\x20—\x20only\x20confirm\x20when\x20the\x20deliverable\x20matches\x20the\x20agreement.'),d['some'](i=>i['role']!=='OrderHolder\x20(customer)')&&f['push']('Delivery\x20depends\x20on\x20the\x20merchant-side\x20roles\x20listed\x20in\x20waiting_on;\x20if\x20they\x20stall,\x20Messenger\x20first,\x20then\x20consider\x20dispute\x20via\x20the\x20bound\x20Arbitration.'),h!=null&&h>0x18&&f['push']('Order\x20has\x20not\x20advanced\x20for\x20'+Math['round'](h)+'h.\x20Your\x20leverage:\x20compensation_fund\x20(if\x20any)\x20+\x20arbitration\x20+\x20on-chain\x20reputation\x20(dislike)\x20—\x20in\x20that\x20order.');else{if(b==='supplier')c['length']>0x0&&f['push']('Advancing\x20your\x20sub-order\x20NOW\x20unlocks\x20YOUR\x20settlement\x20—\x20upload\x20delivery\x20evidence\x20first\x20to\x20protect\x20your\x20payment\x20claim\x20against\x20the\x20upstream\x20merchant.'),d['some'](i=>i['role']!=='OrderHolder\x20(customer)')&&f['push']('Your\x20settlement\x20depends\x20on\x20upstream\x20roles\x20in\x20waiting_on;\x20if\x20they\x20stall,\x20a\x20Messenger\x20nudge\x20first,\x20then\x20arbitration\x20via\x20the\x20bound\x20Arbitration.'),h!=null&&h>0x30&&f['push']('Sub-order\x20stalled\x20'+Math['round'](h)+'h:\x20your\x20claim\x20erodes\x20with\x20time\x20—\x20evidence\x20+\x20a\x20Messenger\x20nudge\x20are\x20your\x20cheapest\x20protections.');else{if(b==='collaborator'||b==='merchant'){const i=d['filter'](j=>j['role']['startsWith']('permission\x20index'));c['length']>0x0&&f['push']('Advancing\x20the\x20workflow\x20NOW\x20improves\x20flow\x20efficiency\x20and\x20shortens\x20your\x20fund-settlement\x20cycle;\x20stalled\x20orders\x20degrade\x20your\x20on-chain\x20reputation\x20metrics\x20(dispute\x20rate,\x20stall\x20statistics).'),i['length']>0x0&&f['push']('Nodes\x20waiting\x20on\x20YOUR\x20permission\x20indexes\x20are\x20your\x20responsibility\x20surface:\x20prolonged\x20inaction\x20may\x20trigger\x20timeout\x20penalties\x20or\x20disputes\x20recorded\x20permanently\x20on-chain.'),e&&c['length']===0x0&&f['push']('Nothing\x20for\x20you\x20to\x20execute\x20at\x20this\x20node\x20—\x20monitor\x20only;\x20avoid\x20unnecessary\x20interference\x20that\x20creates\x20semantic\x20responsibility.');}else f['push']('You\x20hold\x20no\x20operative\x20role\x20on\x20this\x20order\x20(prospect).\x20On-chain\x20data\x20remains\x20transparent\x20to\x20you\x20for\x20auditing.');}}return(a['unread_messages']??0x0)>0x0&&f['push'](a['unread_messages']+'\x20unread\x20Messenger\x20message(s)\x20—\x20negotiation\x20evidence\x20(WTS)\x20forms\x20the\x20arbitration\x20record;\x20timely\x20replies\x20protect\x20your\x20position.'),f;}function buildSummary(a,b,c,d,e,f,g,h){const i=c['length']>0x0?c['map'](m=>m['label'])['join'](',\x20'):'no\x20operative\x20role',j=h===''?'(entry,\x20not\x20started)':'\x27'+h+'\x27';if(g)return'Order\x20'+a['progress_address']+'\x20is\x20at\x20'+j+';\x20you\x20are\x20'+b+'\x20('+i+').\x20Machine\x20workflow\x20data\x20unavailable\x20—\x20fetch\x20the\x20bound\x20Machine\x20to\x20see\x20executable\x20operations.';const k=d['length']>0x0?'you\x20can\x20execute:\x20'+d['map'](m=>'\x27'+m['name']+'\x27→\x27'+m['to_node']+'\x27')['join'](',\x20'):e['length']>0x0?'waiting\x20on\x20'+e['map'](m=>m['role'])['join'](',\x20'):'no\x20pending\x20operations\x20at\x20this\x20node',l=f['length']>0x0?'\x20'+f['length']+'\x20unclaimed\x20benefit(s).':'';return'Order\x20at\x20'+j+';\x20you\x20are\x20'+b+'\x20('+i+')\x20—\x20'+k+'.'+l;}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RadarForward } from "./radar-core.js";
|
|
2
|
+
export interface SupplierInterestInput {
|
|
3
|
+
account: string;
|
|
4
|
+
current_node: string;
|
|
5
|
+
operable: RadarForward[];
|
|
6
|
+
waiting_on: Array<{
|
|
7
|
+
role: string;
|
|
8
|
+
forwards: string[];
|
|
9
|
+
}>;
|
|
10
|
+
order_amount?: string;
|
|
11
|
+
token_type?: string;
|
|
12
|
+
arbitration_bound: boolean;
|
|
13
|
+
compensation_fund?: string;
|
|
14
|
+
terminal?: "completed" | "refunded" | null;
|
|
15
|
+
stalled_hours?: number;
|
|
16
|
+
unread_messages?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface SupplierInterestAnalysis {
|
|
19
|
+
fund_flow: string[];
|
|
20
|
+
responsibility: string[];
|
|
21
|
+
leverage: string[];
|
|
22
|
+
stakes: string[];
|
|
23
|
+
summary: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function analyzeSupplierInterest(input: SupplierInterestInput): SupplierInterestAnalysis;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function analyzeSupplierInterest(a){const b=[],c=[],d=[],e=[],f=a['token_type']?'\x20('+a['token_type']+')':'';if(a['terminal']==='completed')b['push']('Sub-order\x20reached\x20a\x20completion\x20terminal:\x20your\x20settlement\x20is\x20released\x20through\x20the\x20allocation\x20waterfall.\x20'+'Verify\x20your\x20share\x20arrived\x20(query\x20your\x20sub-order\x27s\x20Allocation/Treasury\x20objects)\x20—\x20the\x20upstream\x20hop\x20must\x20pay\x20out\x20too.');else{if(a['terminal']==='refunded')b['push']('Sub-order\x20reached\x20a\x20refund\x20terminal:\x20the\x20sub-order\x27s\x20escrow\x20is\x20returned,\x20not\x20settled.\x20'+'No\x20settlement\x20remains\x20for\x20this\x20sub-order;\x20any\x20completed\x20work\x20may\x20be\x20unrecoverable\x20absent\x20a\x20dispute.');else a['order_amount']!=null&&b['push'](a['order_amount']+'\x20raw\x20units'+f+'\x20are\x20owed\x20to\x20YOU\x20for\x20this\x20sub-order\x20—\x20'+'released\x20ONLY\x20when\x20the\x20sub-order\x20advances\x20to\x20completion;\x20your\x20claim\x20is\x20against\x20the\x20upstream\x20merchant\x27s\x20settlement,\x20not\x20a\x20platform.');}a['compensation_fund']!=null&&a['compensation_fund']!=='0'?b['push']('The\x20upstream\x20merchant\x27s\x20compensation_fund\x20holds\x20'+a['compensation_fund']+'\x20raw\x20units'+f+'\x20—\x20'+'your\x20recourse\x20if\x20the\x20merchant\x20withholds\x20your\x20share\x20and\x20arbitration\x20awards\x20indemnity\x20(paid\x20FROM\x20it).'):b['push']('The\x20upstream\x20merchant\x27s\x20compensation_fund\x20is\x20EMPTY\x20—\x20your\x20only\x20recourse\x20for\x20unpaid\x20work\x20is\x20the\x20refund\x20path\x20+\x20on-chain\x20reputation.');a['operable']['length']>0x0&&c['push']('YOU\x20can\x20execute\x20'+a['operable']['map'](j=>'\x27'+j['name']+'\x27')['join'](',\x20')+'\x20on\x20your\x20sub-order\x20right\x20now\x20—\x20'+'your\x20delivery\x20is\x20what\x20unlocks\x20your\x20settlement;\x20only\x20advance\x20when\x20the\x20deliverable\x20is\x20actually\x20ready.');a['terminal']==null&&a['operable']['length']===0x0&&a['waiting_on']['length']>0x0&&c['push']('No\x20forward\x20is\x20yours\x20on\x20this\x20sub-order\x20at\x20this\x20node\x20—\x20you\x20carry\x20no\x20execution\x20responsibility\x20here;\x20'+'your\x20settlement\x20depends\x20on\x20the\x20roles\x20in\x20waiting_on.');a['operable']['length']>0x0&&a['terminal']==null&&d['push']('Uploading\x20delivery\x20evidence\x20(Repository/proof)\x20BEFORE\x20advancing\x20your\x20sub-order\x20protects\x20your\x20payment\x20claim\x20'+'and\x20pre-builds\x20your\x20arbitration\x20defense\x20if\x20the\x20upstream\x20merchant\x20disputes.');const g=a['waiting_on']['some'](j=>j['role']!=='OrderHolder\x20(customer)');g&&a['terminal']==null&&d['push']('Your\x20settlement\x20waits\x20on\x20upstream\x20roles:\x20a\x20Messenger\x20nudge\x20accelerates\x20collection,\x20'+'and\x20the\x20conversation\x20is\x20recorded\x20as\x20WTS\x20evidence\x20protecting\x20your\x20claim.');a['arbitration_bound']&&a['terminal']==null&&d['push']('A\x20dispute\x20path\x20exists:\x20if\x20the\x20upstream\x20merchant\x20withholds\x20your\x20share,\x20open\x20arbitration\x20—\x20'+'your\x20evidence\x20(WTS\x20+\x20WIP\x20hash)\x20decides\x20the\x20outcome.');(a['unread_messages']??0x0)>0x0&&d['push'](a['unread_messages']+'\x20unread\x20Messenger\x20message(s)\x20—\x20timely\x20replies\x20protect\x20your\x20position\x20(WTS\x20record).');a['order_amount']!=null&&a['terminal']==null&&e['push'](a['order_amount']+'\x20raw\x20units'+f+'\x20of\x20your\x20settlement\x20are\x20at\x20risk:\x20'+'if\x20you\x20under-deliver\x20you\x20lose\x20the\x20claim;\x20if\x20the\x20upstream\x20merchant\x20stalls\x20you\x20are\x20left\x20waiting\x20—\x20'+'pursue\x20evidence\x20+\x20Messenger\x20+\x20arbitration\x20rather\x20than\x20letting\x20the\x20sub-order\x20stall\x20indefinitely.');a['stalled_hours']!=null&&a['stalled_hours']>0x30&&a['terminal']==null&&e['push']('Sub-order\x20stalled\x20'+Math['round'](a['stalled_hours'])+'h:\x20prolonged\x20stall\x20erodes\x20your\x20claim\x20and\x20'+'invites\x20dispute\x20—\x20evidence\x20+\x20a\x20Messenger\x20nudge\x20are\x20your\x20two\x20cheapest\x20protections.');a['terminal']==='refunded'&&e['push']('Refund\x20executed:\x20settlement\x20lost\x20for\x20this\x20sub-order.\x20Completed\x20work\x20may\x20be\x20unrecoverable\x20—\x20'+'a\x20professional\x20Messenger\x20close-out\x20+\x20evidence\x20archive\x20is\x20your\x20residual\x20protection\x20for\x20any\x20dispute.');const h=a['terminal']==='completed'?'sub-order\x20completed\x20—\x20settlement\x20released\x20(verify\x20your\x20share\x20arrived)':a['terminal']==='refunded'?'sub-order\x20refunded\x20—\x20settlement\x20lost':a['operable']['length']>0x0?'YOU\x20can\x20advance\x20'+a['operable']['length']+'\x20forward(s)\x20—\x20delivery\x20unlocks\x20your\x20settlement':'waiting\x20on\x20'+(a['waiting_on']['map'](j=>j['role'])['join'](',\x20')||'others')+'\x20—\x20monitor\x20and\x20nudge',i='Supplier\x20interest\x20at\x20node\x20\x27'+(a['current_node']||'(entry)')+'\x27:\x20'+h+'.\x20'+'All\x20options\x20above\x20are\x20informational\x20—\x20the\x20decision\x20is\x20yours.';return{'fund_flow':b,'responsibility':c,'leverage':d,'stakes':e,'summary':i};}
|
package/dist/persona/analyzer.js
CHANGED
|
@@ -1,66 +1 @@
|
|
|
1
|
-
const INDUSTRY_KEYWORDS = {
|
|
2
|
-
freelance: ["freelance", "upwork"],
|
|
3
|
-
rental: ["rental", "airbnb"],
|
|
4
|
-
education: ["education", "coursera"],
|
|
5
|
-
travel: ["travel", "booking"],
|
|
6
|
-
subscription: ["subscription", "patreon"],
|
|
7
|
-
retail: ["retail", "amazon"],
|
|
8
|
-
};
|
|
9
|
-
const ROLE_KEYWORDS = {
|
|
10
|
-
merchant: ["merchant", "seller", "provider"],
|
|
11
|
-
user: ["user", "buyer", "customer"],
|
|
12
|
-
arbitrator: ["arbitrator"],
|
|
13
|
-
};
|
|
14
|
-
const RISK_KEYWORDS = {
|
|
15
|
-
conservative: ["conservative"],
|
|
16
|
-
aggressive: ["aggressive"],
|
|
17
|
-
};
|
|
18
|
-
export function analyzePersonaContext(context) {
|
|
19
|
-
const lower = context.toLowerCase();
|
|
20
|
-
const analysis = {
|
|
21
|
-
industries: [],
|
|
22
|
-
preferences: {},
|
|
23
|
-
requirements: [],
|
|
24
|
-
rules: [],
|
|
25
|
-
suggestions: [],
|
|
26
|
-
confidence: 0,
|
|
27
|
-
};
|
|
28
|
-
for (const [role, kws] of Object.entries(ROLE_KEYWORDS)) {
|
|
29
|
-
if (kws.some((k) => lower.includes(k))) {
|
|
30
|
-
analysis.role = role;
|
|
31
|
-
analysis.suggestions.push({ field: "role", value: role, reason: "role keyword matched" });
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
for (const [ind, kws] of Object.entries(INDUSTRY_KEYWORDS)) {
|
|
36
|
-
if (kws.some((k) => lower.includes(k))) {
|
|
37
|
-
analysis.industries.push(ind);
|
|
38
|
-
analysis.suggestions.push({ field: "industries", value: ind, reason: "industry keyword matched" });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (RISK_KEYWORDS.conservative.some((k) => lower.includes(k))) {
|
|
42
|
-
analysis.preferences.risk_appetite = "conservative";
|
|
43
|
-
analysis.suggestions.push({ field: "preferences.risk_appetite", value: "conservative", reason: "conservative keyword" });
|
|
44
|
-
}
|
|
45
|
-
else if (RISK_KEYWORDS.aggressive.some((k) => lower.includes(k))) {
|
|
46
|
-
analysis.preferences.risk_appetite = "aggressive";
|
|
47
|
-
analysis.suggestions.push({ field: "preferences.risk_appetite", value: "aggressive", reason: "aggressive keyword" });
|
|
48
|
-
}
|
|
49
|
-
const reqKeywords = ["must", "forbid", "never", "require"];
|
|
50
|
-
const ruleKeywords = ["learned", "avoid"];
|
|
51
|
-
for (const raw of context.split(/[;.\n]/)) {
|
|
52
|
-
const s = raw.trim();
|
|
53
|
-
if (!s)
|
|
54
|
-
continue;
|
|
55
|
-
if (reqKeywords.some((k) => s.toLowerCase().includes(k.toLowerCase()))) {
|
|
56
|
-
analysis.requirements.push(s);
|
|
57
|
-
analysis.suggestions.push({ field: "requirements", value: s, reason: "red-line keyword" });
|
|
58
|
-
}
|
|
59
|
-
else if (ruleKeywords.some((k) => s.toLowerCase().includes(k.toLowerCase()))) {
|
|
60
|
-
analysis.rules.push(s);
|
|
61
|
-
analysis.suggestions.push({ field: "rules", value: s, reason: "experience keyword" });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
analysis.confidence = Math.min(1, analysis.suggestions.length * 0.2);
|
|
65
|
-
return analysis;
|
|
66
|
-
}
|
|
1
|
+
const INDUSTRY_KEYWORDS={'freelance':['freelance','upwork'],'rental':['rental','airbnb'],'education':['education','coursera'],'travel':['travel','booking'],'subscription':['subscription','patreon'],'retail':['retail','amazon']},ROLE_KEYWORDS={'merchant':['merchant','seller','provider'],'customer':['customer','buyer'],'prospect':['prospect','considering\x20a\x20purchase','shopping\x20for'],'supplier':['supplier','subcontractor','sub-order'],'collaborator':['collaborator','operator','staff','named\x20operator'],'arbitrator':['arbitrator','arbiter','judge']},RISK_KEYWORDS={'conservative':['conservative'],'aggressive':['aggressive']};export function analyzePersonaContext(a){const b=a['toLowerCase'](),c={'industries':[],'preferences':{},'requirements':[],'rules':[],'suggestions':[],'confidence':0x0};for(const [f,g]of Object['entries'](ROLE_KEYWORDS)){if(g['some'](h=>b['includes'](h))){c['role']=f,c['suggestions']['push']({'field':'role','value':f,'reason':'role\x20keyword\x20matched'});break;}}for(const [h,i]of Object['entries'](INDUSTRY_KEYWORDS)){i['some'](j=>b['includes'](j))&&(c['industries']['push'](h),c['suggestions']['push']({'field':'industries','value':h,'reason':'industry\x20keyword\x20matched'}));}if(RISK_KEYWORDS['conservative']['some'](j=>b['includes'](j)))c['preferences']['risk_appetite']='conservative',c['suggestions']['push']({'field':'preferences.risk_appetite','value':'conservative','reason':'conservative\x20keyword'});else RISK_KEYWORDS['aggressive']['some'](j=>b['includes'](j))&&(c['preferences']['risk_appetite']='aggressive',c['suggestions']['push']({'field':'preferences.risk_appetite','value':'aggressive','reason':'aggressive\x20keyword'}));const d=['must','forbid','never','require'],e=['learned','avoid'];for(const j of a['split'](/[;.\n]/)){const k=j['trim']();if(!k)continue;if(d['some'](l=>k['toLowerCase']()['includes'](l['toLowerCase']())))c['requirements']['push'](k),c['suggestions']['push']({'field':'requirements','value':k,'reason':'red-line\x20keyword'});else e['some'](l=>k['toLowerCase']()['includes'](l['toLowerCase']()))&&(c['rules']['push'](k),c['suggestions']['push']({'field':'rules','value':k,'reason':'experience\x20keyword'}));}return c['confidence']=Math['min'](0x1,c['suggestions']['length']*0.2),c;}
|
package/dist/persona/bridge.js
CHANGED
|
@@ -1,86 +1 @@
|
|
|
1
|
-
const REQUIREMENT_RULE_MAP = [
|
|
2
|
-
{ keywords: ["arbitration", "arb"], rule_id: "r_trust" },
|
|
3
|
-
{ keywords: ["compensation", "fund"], rule_id: "r_fund" },
|
|
4
|
-
{ keywords: ["region", "location"], rule_id: "r_region" },
|
|
5
|
-
{ keywords: ["price", "budget"], rule_id: "r_price" },
|
|
6
|
-
{ keywords: ["industry"], rule_id: "r_industry" },
|
|
7
|
-
{ keywords: ["capability"], rule_id: "r_capabilities" },
|
|
8
|
-
{ keywords: ["trust", "score"], rule_id: "r_trust" },
|
|
9
|
-
];
|
|
10
|
-
const FORBID_KEYWORDS = ["forbid", "never", "no "];
|
|
11
|
-
function mapRequirement(req) {
|
|
12
|
-
const lower = req.toLowerCase();
|
|
13
|
-
const forbid = FORBID_KEYWORDS.some((k) => lower.includes(k));
|
|
14
|
-
for (const m of REQUIREMENT_RULE_MAP) {
|
|
15
|
-
if (m.keywords.some((k) => lower.includes(k))) {
|
|
16
|
-
return { rule_id: m.rule_id, condition: forbid ? "forbid" : "require", note: req };
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return { rule_id: "r_trust", condition: forbid ? "forbid" : "require", note: req };
|
|
20
|
-
}
|
|
21
|
-
export function personaToInjection(effective) {
|
|
22
|
-
const requirements = (effective.layer.requirements ?? []).map(mapRequirement);
|
|
23
|
-
const intent = [
|
|
24
|
-
`role=${effective.role}`,
|
|
25
|
-
effective.industries.length ? `industries=${effective.industries.join(",")}` : "",
|
|
26
|
-
effective.layer.identity?.self_description ?? "",
|
|
27
|
-
].filter(Boolean).join("; ");
|
|
28
|
-
return {
|
|
29
|
-
intent,
|
|
30
|
-
preferences: effective.layer.preferences ?? {},
|
|
31
|
-
requirements: requirements.length ? requirements : undefined,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export function personaToContextText(effective) {
|
|
35
|
-
const lines = [];
|
|
36
|
-
lines.push(`# Effective Persona (role=${effective.role}, industries=${effective.industries.join(",") || "any"})`);
|
|
37
|
-
const id = effective.layer.identity;
|
|
38
|
-
if (id) {
|
|
39
|
-
if (id.self_description)
|
|
40
|
-
lines.push(`- self: ${id.self_description}`);
|
|
41
|
-
if (id.region)
|
|
42
|
-
lines.push(`- region: ${id.region}`);
|
|
43
|
-
if (id.languages?.length)
|
|
44
|
-
lines.push(`- languages: ${id.languages.join(", ")}`);
|
|
45
|
-
}
|
|
46
|
-
if (effective.layer.strategy?.length) {
|
|
47
|
-
lines.push("- strategy:");
|
|
48
|
-
for (const s of effective.layer.strategy)
|
|
49
|
-
lines.push(` - ${s}`);
|
|
50
|
-
}
|
|
51
|
-
if (effective.layer.rules?.length) {
|
|
52
|
-
lines.push("- rules:");
|
|
53
|
-
for (const r of effective.layer.rules)
|
|
54
|
-
lines.push(` - ${r}`);
|
|
55
|
-
}
|
|
56
|
-
if (effective.layer.requirements?.length) {
|
|
57
|
-
lines.push("- requirements:");
|
|
58
|
-
for (const r of effective.layer.requirements)
|
|
59
|
-
lines.push(` - ${r}`);
|
|
60
|
-
}
|
|
61
|
-
if (effective.layer.spec) {
|
|
62
|
-
lines.push("- spec:");
|
|
63
|
-
lines.push(effective.layer.spec);
|
|
64
|
-
}
|
|
65
|
-
return lines.join("\n");
|
|
66
|
-
}
|
|
67
|
-
export function mergeInjections(base, override) {
|
|
68
|
-
if (!base && !override)
|
|
69
|
-
return undefined;
|
|
70
|
-
if (!base)
|
|
71
|
-
return override ?? undefined;
|
|
72
|
-
if (!override)
|
|
73
|
-
return base;
|
|
74
|
-
return {
|
|
75
|
-
intent: override.intent ?? base.intent,
|
|
76
|
-
preferences: { ...(base.preferences ?? {}), ...(override.preferences ?? {}) },
|
|
77
|
-
requirements: [...(base.requirements ?? []), ...(override.requirements ?? [])],
|
|
78
|
-
overrides: {
|
|
79
|
-
rules: { ...(base.overrides?.rules ?? {}), ...(override.overrides?.rules ?? {}) },
|
|
80
|
-
data_sources: {
|
|
81
|
-
...(base.overrides?.data_sources ?? {}),
|
|
82
|
-
...(override.overrides?.data_sources ?? {}),
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
}
|
|
1
|
+
const REQUIREMENT_RULE_MAP=[{'keywords':['arbitration','arb'],'rule_id':'r_trust'},{'keywords':['compensation','fund'],'rule_id':'r_fund'},{'keywords':['region','location'],'rule_id':'r_region'},{'keywords':['price','budget'],'rule_id':'r_price'},{'keywords':['industry'],'rule_id':'r_industry'},{'keywords':['capability'],'rule_id':'r_capabilities'},{'keywords':['trust','score'],'rule_id':'r_trust'}],FORBID_KEYWORDS=['forbid','never','no\x20'];function mapRequirement(a){const b=a['toLowerCase'](),c=FORBID_KEYWORDS['some'](d=>b['includes'](d));for(const d of REQUIREMENT_RULE_MAP){if(d['keywords']['some'](e=>b['includes'](e)))return{'rule_id':d['rule_id'],'condition':c?'forbid':'require','note':a};}return{'rule_id':'r_trust','condition':c?'forbid':'require','note':a};}export function personaToInjection(a){const b=(a['layer']['requirements']??[])['map'](mapRequirement),c=['role='+a['role'],a['industries']['length']?'industries='+a['industries']['join'](','):'',a['layer']['identity']?.['self_description']??'']['filter'](Boolean)['join'](';\x20');return{'intent':c,'preferences':a['layer']['preferences']??{},'requirements':b['length']?b:undefined};}export function personaToContextText(a){const b=[];b['push']('#\x20Effective\x20Persona\x20(role='+a['role']+',\x20industries='+(a['industries']['join'](',')||'any')+')');const c=a['layer']['identity'];if(c){if(c['self_description'])b['push']('-\x20self:\x20'+c['self_description']);if(c['region'])b['push']('-\x20region:\x20'+c['region']);if(c['languages']?.['length'])b['push']('-\x20languages:\x20'+c['languages']['join'](',\x20'));}if(a['layer']['strategy']?.['length']){b['push']('-\x20strategy:');for(const d of a['layer']['strategy'])b['push']('\x20\x20-\x20'+d);}if(a['layer']['rules']?.['length']){b['push']('-\x20rules:');for(const e of a['layer']['rules'])b['push']('\x20\x20-\x20'+e);}if(a['layer']['requirements']?.['length']){b['push']('-\x20requirements:');for(const f of a['layer']['requirements'])b['push']('\x20\x20-\x20'+f);}return a['layer']['spec']&&(b['push']('-\x20spec:'),b['push'](a['layer']['spec'])),b['join']('\x0a');}export function mergeInjections(a,b){if(!a&&!b)return undefined;if(!a)return b??undefined;if(!b)return a;return{'intent':b['intent']??a['intent'],'preferences':{...a['preferences']??{},...b['preferences']??{}},'requirements':[...a['requirements']??[],...b['requirements']??[]],'overrides':{'rules':{...a['overrides']?.['rules']??{},...b['overrides']?.['rules']??{}},'data_sources':{...a['overrides']?.['data_sources']??{},...b['overrides']?.['data_sources']??{}}}};}
|