@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,345 +1 @@
|
|
|
1
|
-
import { LocalProject, } from "@wowok/wowok";
|
|
2
|
-
const FRESH_THRESHOLD_MS = 1 * 60 * 60 * 1000;
|
|
3
|
-
const STALE_THRESHOLD_MS = 24 * 60 * 60 * 1000;
|
|
4
|
-
export class SemanticAssembler {
|
|
5
|
-
localProject;
|
|
6
|
-
constructor() {
|
|
7
|
-
this.localProject = LocalProject.Instance();
|
|
8
|
-
}
|
|
9
|
-
async assemble(project, objects, edges, reputation) {
|
|
10
|
-
const objectContexts = await this.assembleObjects(objects);
|
|
11
|
-
const graphContext = this.assembleGraph(edges);
|
|
12
|
-
const reputationContexts = this.assembleReputation(objects, reputation);
|
|
13
|
-
const freshnessSummary = this.computeFreshnessSummary(objectContexts);
|
|
14
|
-
return {
|
|
15
|
-
project: {
|
|
16
|
-
prefix: project.prefix,
|
|
17
|
-
name: project.name,
|
|
18
|
-
description: project.description,
|
|
19
|
-
industry: project.industry,
|
|
20
|
-
perspective: project.perspective,
|
|
21
|
-
status: project.status,
|
|
22
|
-
network: project.network,
|
|
23
|
-
serviceAddress: project.serviceAddress,
|
|
24
|
-
currentVersion: project.currentVersion,
|
|
25
|
-
},
|
|
26
|
-
objects: objectContexts,
|
|
27
|
-
graph: graphContext,
|
|
28
|
-
reputation: reputationContexts,
|
|
29
|
-
freshnessSummary,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
async assembleObjects(objects) {
|
|
33
|
-
const result = [];
|
|
34
|
-
for (const obj of objects) {
|
|
35
|
-
const cached = await this.localProject.getCachedObject(obj.objectAddress);
|
|
36
|
-
const description = cached
|
|
37
|
-
? this.describeObject(obj, cached)
|
|
38
|
-
: `Object ${obj.objectAddress} (no cached on-chain data)`;
|
|
39
|
-
const keyFields = cached
|
|
40
|
-
? this.extractKeyFields(obj.objectType, cached)
|
|
41
|
-
: {};
|
|
42
|
-
const cacheFreshness = cached
|
|
43
|
-
? this.classifyFreshness(cached.fetchedAt)
|
|
44
|
-
: "unknown";
|
|
45
|
-
result.push({
|
|
46
|
-
address: obj.objectAddress,
|
|
47
|
-
name: obj.objectName,
|
|
48
|
-
objectType: obj.objectType,
|
|
49
|
-
role: obj.role,
|
|
50
|
-
description,
|
|
51
|
-
keyFields,
|
|
52
|
-
cacheFreshness,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
describeObject(obj, cached) {
|
|
58
|
-
const type = obj.objectType ?? "unknown";
|
|
59
|
-
const name = obj.objectName ?? abbreviateAddress(obj.objectAddress);
|
|
60
|
-
let desc = `${type} "${name}" at ${abbreviateAddress(obj.objectAddress)}`;
|
|
61
|
-
try {
|
|
62
|
-
const data = JSON.parse(cached.data);
|
|
63
|
-
switch (type) {
|
|
64
|
-
case "Service": {
|
|
65
|
-
const published = data.bPublished;
|
|
66
|
-
const paused = data.bPaused;
|
|
67
|
-
const sales = data.sales;
|
|
68
|
-
desc += published
|
|
69
|
-
? paused
|
|
70
|
-
? " (published but PAUSED)"
|
|
71
|
-
: " (published, active)"
|
|
72
|
-
: " (not yet published)";
|
|
73
|
-
if (sales && Array.isArray(sales) && sales.length > 0) {
|
|
74
|
-
desc += ` with ${sales.length} sale option(s)`;
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
case "Machine": {
|
|
79
|
-
const nodeCount = data.node_count ?? data.nodeCount;
|
|
80
|
-
const published = data.bPublished;
|
|
81
|
-
desc += published
|
|
82
|
-
? ` (published, ${nodeCount} nodes)`
|
|
83
|
-
: ` (draft, ${nodeCount} nodes)`;
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
case "Treasury": {
|
|
87
|
-
desc += " (compensation fund)";
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
case "Guard": {
|
|
91
|
-
desc += " (validation rules)";
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
default:
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
catch {
|
|
99
|
-
}
|
|
100
|
-
return desc;
|
|
101
|
-
}
|
|
102
|
-
extractKeyFields(objectType, cached) {
|
|
103
|
-
const fields = {};
|
|
104
|
-
try {
|
|
105
|
-
const data = JSON.parse(cached.data);
|
|
106
|
-
switch (objectType) {
|
|
107
|
-
case "Service":
|
|
108
|
-
fields.bPublished = data.bPublished;
|
|
109
|
-
fields.bPaused = data.bPaused;
|
|
110
|
-
fields.sales = data.sales;
|
|
111
|
-
fields.machine = data.machine;
|
|
112
|
-
fields.buy_guard = data.buy_guard;
|
|
113
|
-
fields.permission = data.permission;
|
|
114
|
-
fields.compensation_fund = data.compensation_fund;
|
|
115
|
-
fields.order_allocators = data.order_allocators;
|
|
116
|
-
fields.arbitrations = data.arbitrations;
|
|
117
|
-
fields.rewards = data.rewards;
|
|
118
|
-
fields.repositories = data.repositories;
|
|
119
|
-
break;
|
|
120
|
-
case "Machine":
|
|
121
|
-
fields.bPublished = data.bPublished;
|
|
122
|
-
fields.bPaused = data.bPaused;
|
|
123
|
-
fields.node_count = data.node_count ?? data.nodeCount;
|
|
124
|
-
fields.permission = data.permission;
|
|
125
|
-
break;
|
|
126
|
-
case "Treasury":
|
|
127
|
-
fields.permission = data.permission;
|
|
128
|
-
fields.guard = data.guard;
|
|
129
|
-
break;
|
|
130
|
-
case "Allocation":
|
|
131
|
-
case "Arbitration":
|
|
132
|
-
case "Reward":
|
|
133
|
-
case "Repository":
|
|
134
|
-
case "Demand":
|
|
135
|
-
fields.permission = data.permission;
|
|
136
|
-
fields.guard = data.guard;
|
|
137
|
-
break;
|
|
138
|
-
default:
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
}
|
|
144
|
-
return fields;
|
|
145
|
-
}
|
|
146
|
-
assembleGraph(edges) {
|
|
147
|
-
const edgesByType = {};
|
|
148
|
-
const edgesBySource = {};
|
|
149
|
-
const directDependencies = [];
|
|
150
|
-
const potentialGaps = [];
|
|
151
|
-
for (const edge of edges) {
|
|
152
|
-
edgesByType[edge.relationshipType] = (edgesByType[edge.relationshipType] ?? 0) + 1;
|
|
153
|
-
edgesBySource[edge.edgeSource] = (edgesBySource[edge.edgeSource] ?? 0) + 1;
|
|
154
|
-
if (edge.edgeSource === "internal" && edge.depth === 0) {
|
|
155
|
-
directDependencies.push({
|
|
156
|
-
target: edge.targetObject,
|
|
157
|
-
targetType: null,
|
|
158
|
-
fieldName: edge.fieldName,
|
|
159
|
-
relationshipType: edge.relationshipType,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
if (edge.edgeSource === "potential") {
|
|
163
|
-
const reason = edge.metadata?.reason;
|
|
164
|
-
potentialGaps.push({
|
|
165
|
-
target: edge.targetObject,
|
|
166
|
-
targetType: edge.metadata?.expected_target_type,
|
|
167
|
-
fieldName: edge.fieldName ?? "unknown",
|
|
168
|
-
reason: typeof reason === "string" ? reason : "expected_relationship_missing",
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
nodeCount: new Set([...edges.map((e) => e.sourceObject), ...edges.map((e) => e.targetObject)]).size,
|
|
174
|
-
edgeCount: edges.length,
|
|
175
|
-
edgesByType,
|
|
176
|
-
edgesBySource,
|
|
177
|
-
directDependencies,
|
|
178
|
-
potentialGaps,
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
assembleReputation(objects, reputation) {
|
|
182
|
-
if (!reputation || reputation.size === 0)
|
|
183
|
-
return [];
|
|
184
|
-
const result = [];
|
|
185
|
-
for (const obj of objects) {
|
|
186
|
-
const rep = reputation.get(obj.objectAddress);
|
|
187
|
-
if (!rep)
|
|
188
|
-
continue;
|
|
189
|
-
const total = rep.likes + rep.dislikes;
|
|
190
|
-
const sentimentScore = total > 0 ? rep.likes / total : 0.5;
|
|
191
|
-
result.push({
|
|
192
|
-
address: obj.objectAddress,
|
|
193
|
-
likes: rep.likes,
|
|
194
|
-
dislikes: rep.dislikes,
|
|
195
|
-
affiliations: rep.affiliations,
|
|
196
|
-
sentimentScore,
|
|
197
|
-
notableVoters: rep.voters.slice(0, 5).map((v) => ({
|
|
198
|
-
who: abbreviateAddress(v.who),
|
|
199
|
-
like: v.like,
|
|
200
|
-
dislike: v.dislike,
|
|
201
|
-
affiliation: v.affiliation,
|
|
202
|
-
})),
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
return result;
|
|
206
|
-
}
|
|
207
|
-
classifyFreshness(fetchedAt) {
|
|
208
|
-
const age = Date.now() - fetchedAt;
|
|
209
|
-
if (age < FRESH_THRESHOLD_MS)
|
|
210
|
-
return "fresh";
|
|
211
|
-
if (age < STALE_THRESHOLD_MS)
|
|
212
|
-
return "stale";
|
|
213
|
-
return "stale";
|
|
214
|
-
}
|
|
215
|
-
computeFreshnessSummary(objects) {
|
|
216
|
-
let freshCount = 0;
|
|
217
|
-
let staleCount = 0;
|
|
218
|
-
let unknownCount = 0;
|
|
219
|
-
let oldestFetch = null;
|
|
220
|
-
let newestFetch = null;
|
|
221
|
-
for (const obj of objects) {
|
|
222
|
-
switch (obj.cacheFreshness) {
|
|
223
|
-
case "fresh":
|
|
224
|
-
freshCount++;
|
|
225
|
-
break;
|
|
226
|
-
case "stale":
|
|
227
|
-
staleCount++;
|
|
228
|
-
break;
|
|
229
|
-
case "unknown":
|
|
230
|
-
unknownCount++;
|
|
231
|
-
break;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return { freshCount, staleCount, unknownCount, oldestFetch, newestFetch };
|
|
235
|
-
}
|
|
236
|
-
buildEvaluationPrompt(evaluationType, context) {
|
|
237
|
-
const criteria = this.getScoringCriteria(evaluationType);
|
|
238
|
-
const prompt = this.formatPrompt(evaluationType, context, criteria);
|
|
239
|
-
return {
|
|
240
|
-
evaluationType,
|
|
241
|
-
context,
|
|
242
|
-
prompt,
|
|
243
|
-
scoringCriteria: criteria,
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
getScoringCriteria(evaluationType) {
|
|
247
|
-
switch (evaluationType) {
|
|
248
|
-
case "risk":
|
|
249
|
-
return [
|
|
250
|
-
{ name: "structural_risk", description: "Risk from missing bindings, broken workflows, incomplete setup", weight: 0.3, minScore: 0, maxScore: 100 },
|
|
251
|
-
{ name: "fund_safety", description: "Risk from Treasury/Allocation misconfiguration, missing compensation fund", weight: 0.25, minScore: 0, maxScore: 100 },
|
|
252
|
-
{ name: "operational_risk", description: "Risk from Machine/Guard complexity, pause state, missing arbitration", weight: 0.25, minScore: 0, maxScore: 100 },
|
|
253
|
-
{ name: "governance_risk", description: "Risk from Permission setup, missing UM, overly permissive rules", weight: 0.2, minScore: 0, maxScore: 100 },
|
|
254
|
-
];
|
|
255
|
-
case "trust":
|
|
256
|
-
return [
|
|
257
|
-
{ name: "reputation", description: "Registrar like/dislike ratio and affiliation count", weight: 0.3, minScore: 0, maxScore: 100 },
|
|
258
|
-
{ name: "arbitration_coverage", description: "Presence and quality of arbitration arrangements", weight: 0.25, minScore: 0, maxScore: 100 },
|
|
259
|
-
{ name: "guard_quality", description: "Guard rule complexity and coverage of business scenarios", weight: 0.25, minScore: 0, maxScore: 100 },
|
|
260
|
-
{ name: "transparency", description: "Object descriptions, repository data, contact information availability", weight: 0.2, minScore: 0, maxScore: 100 },
|
|
261
|
-
];
|
|
262
|
-
case "worth_buying":
|
|
263
|
-
return [
|
|
264
|
-
{ name: "price_reasonableness", description: "Service pricing vs. comparable services and market norms", weight: 0.3, minScore: 0, maxScore: 100 },
|
|
265
|
-
{ name: "refund_protection", description: "Compensation fund balance, lock duration, refund workflow availability", weight: 0.25, minScore: 0, maxScore: 100 },
|
|
266
|
-
{ name: "risk_adjusted_value", description: "Value proposition adjusted for project risk score", weight: 0.25, minScore: 0, maxScore: 100 },
|
|
267
|
-
{ name: "trust_adjusted_value", description: "Value proposition adjusted for merchant trust score", weight: 0.2, minScore: 0, maxScore: 100 },
|
|
268
|
-
];
|
|
269
|
-
case "completeness":
|
|
270
|
-
return [
|
|
271
|
-
{ name: "object_coverage", description: "Expected objects present vs. missing (based on EXPECTED_RELATIONSHIPS)", weight: 0.3, minScore: 0, maxScore: 100 },
|
|
272
|
-
{ name: "binding_completeness", description: "Required bindings established (Service→Machine, Guard, Permission, etc.)", weight: 0.3, minScore: 0, maxScore: 100 },
|
|
273
|
-
{ name: "workflow_rationality", description: "Machine node topology is sound, no dangling nodes or cycles", weight: 0.2, minScore: 0, maxScore: 100 },
|
|
274
|
-
{ name: "deployment_readiness", description: "Service publishable, all prerequisites met", weight: 0.2, minScore: 0, maxScore: 100 },
|
|
275
|
-
];
|
|
276
|
-
case "value":
|
|
277
|
-
return [
|
|
278
|
-
{ name: "market_positioning", description: "Service differentiation and competitive positioning", weight: 0.3, minScore: 0, maxScore: 100 },
|
|
279
|
-
{ name: "revenue_potential", description: "Pricing strategy and revenue model viability", weight: 0.3, minScore: 0, maxScore: 100 },
|
|
280
|
-
{ name: "scalability", description: "Ability to handle growth (Machine capacity, Allocation flexibility)", weight: 0.2, minScore: 0, maxScore: 100 },
|
|
281
|
-
{ name: "ecosystem_fit", description: "Integration with WoWok ecosystem (rewards, demands, repositories)", weight: 0.2, minScore: 0, maxScore: 100 },
|
|
282
|
-
];
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
formatPrompt(evaluationType, context, criteria) {
|
|
286
|
-
const lines = [];
|
|
287
|
-
lines.push(`# Project Evaluation: ${evaluationType.toUpperCase()}`);
|
|
288
|
-
lines.push("");
|
|
289
|
-
lines.push(`## Project: ${context.project.name} (${context.project.prefix})`);
|
|
290
|
-
lines.push(`- Perspective: ${context.project.perspective}`);
|
|
291
|
-
lines.push(`- Status: ${context.project.status}`);
|
|
292
|
-
lines.push(`- Network: ${context.project.network}`);
|
|
293
|
-
lines.push(`- Industry: ${context.project.industry ?? "unspecified"}`);
|
|
294
|
-
lines.push(`- Service: ${context.project.serviceAddress ?? "not set"}`);
|
|
295
|
-
lines.push("");
|
|
296
|
-
lines.push("## Objects");
|
|
297
|
-
for (const obj of context.objects) {
|
|
298
|
-
lines.push(`- ${obj.description}`);
|
|
299
|
-
}
|
|
300
|
-
lines.push("");
|
|
301
|
-
lines.push("## Relationship Graph");
|
|
302
|
-
lines.push(`- Total nodes: ${context.graph.nodeCount}`);
|
|
303
|
-
lines.push(`- Total edges: ${context.graph.edgeCount}`);
|
|
304
|
-
lines.push(`- Edge sources: ${JSON.stringify(context.graph.edgesBySource)}`);
|
|
305
|
-
lines.push(`- Edge types: ${JSON.stringify(context.graph.edgesByType)}`);
|
|
306
|
-
lines.push(`- Direct dependencies: ${context.graph.directDependencies.length}`);
|
|
307
|
-
if (context.graph.potentialGaps.length > 0) {
|
|
308
|
-
lines.push(`- **Missing relationships (potential gaps): ${context.graph.potentialGaps.length}**`);
|
|
309
|
-
for (const gap of context.graph.potentialGaps.slice(0, 10)) {
|
|
310
|
-
lines.push(` - ${gap.fieldName} → ${gap.targetType ?? "unknown"} (${gap.reason})`);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
lines.push("");
|
|
314
|
-
if (context.reputation.length > 0) {
|
|
315
|
-
lines.push("## Reputation Data (from Registrar)");
|
|
316
|
-
for (const rep of context.reputation) {
|
|
317
|
-
lines.push(`- ${abbreviateAddress(rep.address)}: ${rep.likes} likes, ${rep.dislikes} dislikes, ${rep.affiliations} affiliations (sentiment: ${(rep.sentimentScore * 100).toFixed(0)}%)`);
|
|
318
|
-
}
|
|
319
|
-
lines.push("");
|
|
320
|
-
}
|
|
321
|
-
lines.push("## Cache Freshness");
|
|
322
|
-
lines.push(`- Fresh: ${context.freshnessSummary.freshCount}`);
|
|
323
|
-
lines.push(`- Stale: ${context.freshnessSummary.staleCount}`);
|
|
324
|
-
lines.push(`- Unknown: ${context.freshnessSummary.unknownCount}`);
|
|
325
|
-
lines.push("");
|
|
326
|
-
lines.push("## Scoring Criteria");
|
|
327
|
-
lines.push("Please score each criterion (0-100, higher = better) and provide a brief justification:");
|
|
328
|
-
for (const c of criteria) {
|
|
329
|
-
lines.push(`- **${c.name}** (weight: ${c.weight}): ${c.description}`);
|
|
330
|
-
}
|
|
331
|
-
lines.push("");
|
|
332
|
-
lines.push("## Instructions");
|
|
333
|
-
lines.push(`1. Analyze the project from the "${evaluationType}" perspective.`);
|
|
334
|
-
lines.push("2. Score each criterion above (0-100).");
|
|
335
|
-
lines.push("3. Compute a weighted overall score.");
|
|
336
|
-
lines.push("4. Provide a 1-2 sentence summary of your assessment.");
|
|
337
|
-
lines.push("5. Return the result as JSON: { score: number, summary: string, details: { criterion_scores: {...}, justification: string } }");
|
|
338
|
-
return lines.join("\n");
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
function abbreviateAddress(address) {
|
|
342
|
-
if (!address || address.length < 12)
|
|
343
|
-
return address;
|
|
344
|
-
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
345
|
-
}
|
|
1
|
+
import{LocalProject}from'@wowok/wowok';const FRESH_THRESHOLD_MS=0x1*0x3c*0x3c*0x3e8,STALE_THRESHOLD_MS=0x18*0x3c*0x3c*0x3e8;export class SemanticAssembler{['localProject'];constructor(){this['localProject']=LocalProject['Instance']();}async['assemble'](a,b,c,d){const e=await this['assembleObjects'](b),f=this['assembleGraph'](c),g=this['assembleReputation'](b,d),h=this['computeFreshnessSummary'](e);return{'project':{'prefix':a['prefix'],'name':a['name'],'description':a['description'],'industry':a['industry'],'perspective':a['perspective'],'status':a['status'],'network':a['network'],'serviceAddress':a['serviceAddress'],'currentVersion':a['currentVersion']},'objects':e,'graph':f,'reputation':g,'freshnessSummary':h};}async['assembleObjects'](a){const b=[];for(const c of a){const d=await this['localProject']['getCachedObject'](c['objectAddress']),e=d?this['describeObject'](c,d):'Object\x20'+c['objectAddress']+'\x20(no\x20cached\x20on-chain\x20data)',f=d?this['extractKeyFields'](c['objectType'],d):{},g=d?this['classifyFreshness'](d['fetchedAt']):'unknown';b['push']({'address':c['objectAddress'],'name':c['objectName'],'objectType':c['objectType'],'role':c['role'],'description':e,'keyFields':f,'cacheFreshness':g});}return b;}['describeObject'](a,b){const c=a['objectType']??'unknown',d=a['objectName']??abbreviateAddress(a['objectAddress']);let e=c+'\x20\x22'+d+'\x22\x20at\x20'+abbreviateAddress(a['objectAddress']);try{const f=JSON['parse'](b['data']);switch(c){case'Service':{const g=f['bPublished'],h=f['bPaused'],i=f['sales'];e+=g?h?'\x20(published\x20but\x20PAUSED)':'\x20(published,\x20active)':'\x20(not\x20yet\x20published)';i&&Array['isArray'](i)&&i['length']>0x0&&(e+='\x20with\x20'+i['length']+'\x20sale\x20option(s)');break;}case'Machine':{const j=f['node_count']??f['nodeCount'],k=f['bPublished'];e+=k?'\x20(published,\x20'+j+'\x20nodes)':'\x20(draft,\x20'+j+'\x20nodes)';break;}case'Treasury':{e+='\x20(compensation\x20fund)';break;}case'Guard':{e+='\x20(validation\x20rules)';break;}default:break;}}catch{}return e;}['extractKeyFields'](a,b){const c={};try{const d=JSON['parse'](b['data']);switch(a){case'Service':c['bPublished']=d['bPublished'],c['bPaused']=d['bPaused'],c['sales']=d['sales'],c['machine']=d['machine'],c['buy_guard']=d['buy_guard'],c['permission']=d['permission'],c['compensation_fund']=d['compensation_fund'],c['order_allocators']=d['order_allocators'],c['arbitrations']=d['arbitrations'],c['rewards']=d['rewards'],c['repositories']=d['repositories'];break;case'Machine':c['bPublished']=d['bPublished'],c['bPaused']=d['bPaused'],c['node_count']=d['node_count']??d['nodeCount'],c['permission']=d['permission'];break;case'Treasury':c['permission']=d['permission'],c['guard']=d['guard'];break;case'Allocation':case'Arbitration':case'Reward':case'Repository':case'Demand':c['permission']=d['permission'],c['guard']=d['guard'];break;default:break;}}catch{}return c;}['assembleGraph'](a){const b={},c={},d=[],e=[];for(const f of a){b[f['relationshipType']]=(b[f['relationshipType']]??0x0)+0x1,c[f['edgeSource']]=(c[f['edgeSource']]??0x0)+0x1;f['edgeSource']==='internal'&&f['depth']===0x0&&d['push']({'target':f['targetObject'],'targetType':null,'fieldName':f['fieldName'],'relationshipType':f['relationshipType']});if(f['edgeSource']==='potential'){const g=f['metadata']?.['reason'];e['push']({'target':f['targetObject'],'targetType':f['metadata']?.['expected_target_type'],'fieldName':f['fieldName']??'unknown','reason':typeof g==='string'?g:'expected_relationship_missing'});}}return{'nodeCount':new Set([...a['map'](h=>h['sourceObject']),...a['map'](h=>h['targetObject'])])['size'],'edgeCount':a['length'],'edgesByType':b,'edgesBySource':c,'directDependencies':d,'potentialGaps':e};}['assembleReputation'](a,b){if(!b||b['size']===0x0)return[];const c=[];for(const d of a){const e=b['get'](d['objectAddress']);if(!e)continue;const f=e['likes']+e['dislikes'],g=f>0x0?e['likes']/f:0.5;c['push']({'address':d['objectAddress'],'likes':e['likes'],'dislikes':e['dislikes'],'affiliations':e['affiliations'],'sentimentScore':g,'notableVoters':e['voters']['slice'](0x0,0x5)['map'](h=>({'who':abbreviateAddress(h['who']),'like':h['like'],'dislike':h['dislike'],'affiliation':h['affiliation']}))});}return c;}['classifyFreshness'](a){const b=Date['now']()-a;if(b<FRESH_THRESHOLD_MS)return'fresh';if(b<STALE_THRESHOLD_MS)return'stale';return'stale';}['computeFreshnessSummary'](a){let b=0x0,c=0x0,d=0x0,e=null,f=null;for(const g of a){switch(g['cacheFreshness']){case'fresh':b++;break;case'stale':c++;break;case'unknown':d++;break;}}return{'freshCount':b,'staleCount':c,'unknownCount':d,'oldestFetch':e,'newestFetch':f};}['buildEvaluationPrompt'](a,b){const c=this['getScoringCriteria'](a),d=this['formatPrompt'](a,b,c);return{'evaluationType':a,'context':b,'prompt':d,'scoringCriteria':c};}['getScoringCriteria'](a){switch(a){case'risk':return[{'name':'structural_risk','description':'Risk\x20from\x20missing\x20bindings,\x20broken\x20workflows,\x20incomplete\x20setup','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'fund_safety','description':'Risk\x20from\x20Treasury/Allocation\x20misconfiguration,\x20missing\x20compensation\x20fund','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'operational_risk','description':'Risk\x20from\x20Machine/Guard\x20complexity,\x20pause\x20state,\x20missing\x20arbitration','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'governance_risk','description':'Risk\x20from\x20Permission\x20setup,\x20missing\x20UM,\x20overly\x20permissive\x20rules','weight':0.2,'minScore':0x0,'maxScore':0x64}];case'trust':return[{'name':'reputation','description':'Registrar\x20like/dislike\x20ratio\x20and\x20affiliation\x20count','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'arbitration_coverage','description':'Presence\x20and\x20quality\x20of\x20arbitration\x20arrangements','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'guard_quality','description':'Guard\x20rule\x20complexity\x20and\x20coverage\x20of\x20business\x20scenarios','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'transparency','description':'Object\x20descriptions,\x20repository\x20data,\x20contact\x20information\x20availability','weight':0.2,'minScore':0x0,'maxScore':0x64}];case'worth_buying':return[{'name':'price_reasonableness','description':'Service\x20pricing\x20vs.\x20comparable\x20services\x20and\x20market\x20norms','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'refund_protection','description':'Compensation\x20fund\x20balance,\x20lock\x20duration,\x20refund\x20workflow\x20availability','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'risk_adjusted_value','description':'Value\x20proposition\x20adjusted\x20for\x20project\x20risk\x20score','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'trust_adjusted_value','description':'Value\x20proposition\x20adjusted\x20for\x20merchant\x20trust\x20score','weight':0.2,'minScore':0x0,'maxScore':0x64}];case'completeness':return[{'name':'object_coverage','description':'Expected\x20objects\x20present\x20vs.\x20missing\x20(based\x20on\x20EXPECTED_RELATIONSHIPS)','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'binding_completeness','description':'Required\x20bindings\x20established\x20(Service→Machine,\x20Guard,\x20Permission,\x20etc.)','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'workflow_rationality','description':'Machine\x20node\x20topology\x20is\x20sound,\x20no\x20dangling\x20nodes\x20or\x20cycles','weight':0.2,'minScore':0x0,'maxScore':0x64},{'name':'deployment_readiness','description':'Service\x20publishable,\x20all\x20prerequisites\x20met','weight':0.2,'minScore':0x0,'maxScore':0x64}];case'value':return[{'name':'market_positioning','description':'Service\x20differentiation\x20and\x20competitive\x20positioning','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'revenue_potential','description':'Pricing\x20strategy\x20and\x20revenue\x20model\x20viability','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'scalability','description':'Ability\x20to\x20handle\x20growth\x20(Machine\x20capacity,\x20Allocation\x20flexibility)','weight':0.2,'minScore':0x0,'maxScore':0x64},{'name':'ecosystem_fit','description':'Integration\x20with\x20WoWok\x20ecosystem\x20(rewards,\x20demands,\x20repositories)','weight':0.2,'minScore':0x0,'maxScore':0x64}];}}['formatPrompt'](a,b,d){const e=[];e['push']('#\x20Project\x20Evaluation:\x20'+a['toUpperCase']()),e['push'](''),e['push']('##\x20Project:\x20'+b['project']['name']+'\x20('+b['project']['prefix']+')'),e['push']('-\x20Perspective:\x20'+b['project']['perspective']),e['push']('-\x20Status:\x20'+b['project']['status']),e['push']('-\x20Network:\x20'+b['project']['network']),e['push']('-\x20Industry:\x20'+(b['project']['industry']??'unspecified')),e['push']('-\x20Service:\x20'+(b['project']['serviceAddress']??'not\x20set')),e['push'](''),e['push']('##\x20Objects');for(const f of b['objects']){e['push']('-\x20'+f['description']);}e['push'](''),e['push']('##\x20Relationship\x20Graph'),e['push']('-\x20Total\x20nodes:\x20'+b['graph']['nodeCount']),e['push']('-\x20Total\x20edges:\x20'+b['graph']['edgeCount']),e['push']('-\x20Edge\x20sources:\x20'+JSON['stringify'](b['graph']['edgesBySource'])),e['push']('-\x20Edge\x20types:\x20'+JSON['stringify'](b['graph']['edgesByType'])),e['push']('-\x20Direct\x20dependencies:\x20'+b['graph']['directDependencies']['length']);if(b['graph']['potentialGaps']['length']>0x0){e['push']('-\x20**Missing\x20relationships\x20(potential\x20gaps):\x20'+b['graph']['potentialGaps']['length']+'**');for(const g of b['graph']['potentialGaps']['slice'](0x0,0xa)){e['push']('\x20\x20-\x20'+g['fieldName']+'\x20→\x20'+(g['targetType']??'unknown')+'\x20('+g['reason']+')');}}e['push']('');if(b['reputation']['length']>0x0){e['push']('##\x20Reputation\x20Data\x20(from\x20Registrar)');for(const h of b['reputation']){e['push']('-\x20'+abbreviateAddress(h['address'])+':\x20'+h['likes']+'\x20likes,\x20'+h['dislikes']+'\x20dislikes,\x20'+h['affiliations']+'\x20affiliations\x20(sentiment:\x20'+(h['sentimentScore']*0x64)['toFixed'](0x0)+'%)');}e['push']('');}e['push']('##\x20Cache\x20Freshness'),e['push']('-\x20Fresh:\x20'+b['freshnessSummary']['freshCount']),e['push']('-\x20Stale:\x20'+b['freshnessSummary']['staleCount']),e['push']('-\x20Unknown:\x20'+b['freshnessSummary']['unknownCount']),e['push'](''),e['push']('##\x20Scoring\x20Criteria'),e['push']('Please\x20score\x20each\x20criterion\x20(0-100,\x20higher\x20=\x20better)\x20and\x20provide\x20a\x20brief\x20justification:');for(const i of d){e['push']('-\x20**'+i['name']+'**\x20(weight:\x20'+i['weight']+'):\x20'+i['description']);}return e['push'](''),e['push']('##\x20Instructions'),e['push']('1.\x20Analyze\x20the\x20project\x20from\x20the\x20\x22'+a+'\x22\x20perspective.'),e['push']('2.\x20Score\x20each\x20criterion\x20above\x20(0-100).'),e['push']('3.\x20Compute\x20a\x20weighted\x20overall\x20score.'),e['push']('4.\x20Provide\x20a\x201-2\x20sentence\x20summary\x20of\x20your\x20assessment.'),e['push']('5.\x20Return\x20the\x20result\x20as\x20JSON:\x20{\x20score:\x20number,\x20summary:\x20string,\x20details:\x20{\x20criterion_scores:\x20{...},\x20justification:\x20string\x20}\x20}'),e['join']('\x0a');}}function abbreviateAddress(a){if(!a||a['length']<0xc)return a;return a['slice'](0x0,0x6)+'...'+a['slice'](-0x4);}
|