@wowok/agent-mcp 2.4.1 → 2.5.0
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/runtime.d.ts +4 -0
- package/dist/config/runtime.js +29 -5
- package/dist/harness/auto-escalation.d.ts +27 -0
- package/dist/harness/auto-escalation.js +68 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -1621
- package/dist/knowledge/allocation-confirm.d.ts +115 -0
- package/dist/knowledge/allocation-confirm.js +534 -0
- package/dist/knowledge/allocation-context.d.ts +58 -0
- package/dist/knowledge/allocation-context.js +249 -0
- package/dist/knowledge/allocation-ledger.d.ts +67 -0
- package/dist/knowledge/allocation-ledger.js +463 -0
- package/dist/knowledge/allocation-puzzle.d.ts +135 -0
- package/dist/knowledge/allocation-puzzle.js +298 -0
- package/dist/knowledge/allocation-risk.d.ts +78 -0
- package/dist/knowledge/allocation-risk.js +568 -0
- package/dist/knowledge/allocation-templates.d.ts +38 -0
- package/dist/knowledge/allocation-templates.js +970 -0
- package/dist/knowledge/allocation-translation.d.ts +72 -0
- package/dist/knowledge/allocation-translation.js +585 -0
- package/dist/knowledge/arb-risk.d.ts +37 -0
- package/dist/knowledge/arb-risk.js +210 -0
- package/dist/knowledge/arbitration-confirm.d.ts +135 -0
- package/dist/knowledge/arbitration-confirm.js +559 -0
- package/dist/knowledge/arbitration-context.d.ts +81 -0
- package/dist/knowledge/arbitration-context.js +505 -0
- package/dist/knowledge/arbitration-ledger.d.ts +62 -0
- package/dist/knowledge/arbitration-ledger.js +521 -0
- package/dist/knowledge/arbitration-puzzle.d.ts +84 -0
- package/dist/knowledge/arbitration-puzzle.js +304 -0
- package/dist/knowledge/arbitration-risk.d.ts +112 -0
- package/dist/knowledge/arbitration-risk.js +433 -0
- package/dist/knowledge/arbitration-templates.d.ts +38 -0
- package/dist/knowledge/arbitration-templates.js +276 -0
- package/dist/knowledge/arbitration-translation.d.ts +91 -0
- package/dist/knowledge/arbitration-translation.js +487 -0
- package/dist/knowledge/bridge-risk.d.ts +36 -0
- package/dist/knowledge/bridge-risk.js +263 -0
- package/dist/knowledge/contact-risk.d.ts +32 -0
- package/dist/knowledge/contact-risk.js +200 -0
- package/dist/knowledge/demand-confirm.d.ts +32 -0
- package/dist/knowledge/demand-confirm.js +206 -0
- package/dist/knowledge/demand-risk.d.ts +30 -0
- package/dist/knowledge/demand-risk.js +240 -0
- package/dist/knowledge/demand-translation.d.ts +55 -0
- package/dist/knowledge/demand-translation.js +354 -0
- package/dist/knowledge/deployment-scanner.d.ts +63 -0
- package/dist/knowledge/deployment-scanner.js +762 -0
- package/dist/knowledge/examples-scanner-cli.d.ts +1 -0
- package/dist/knowledge/examples-scanner-cli.js +26 -0
- package/dist/knowledge/examples-scanner.d.ts +121 -0
- package/dist/knowledge/examples-scanner.js +825 -0
- package/dist/knowledge/flywheel-loop.d.ts +3 -0
- package/dist/knowledge/flywheel-loop.js +32 -3
- package/dist/knowledge/glossary.js +3 -1
- package/dist/knowledge/guard-confirm.d.ts +86 -0
- package/dist/knowledge/guard-confirm.js +406 -0
- package/dist/knowledge/guard-context.d.ts +56 -0
- package/dist/knowledge/guard-context.js +287 -0
- package/dist/knowledge/guard-design-patterns.d.ts +37 -0
- package/dist/knowledge/guard-design-patterns.js +257 -0
- package/dist/knowledge/guard-ledger.js +14 -0
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +83 -3
- package/dist/knowledge/guard-migration.d.ts +48 -0
- package/dist/knowledge/guard-migration.js +228 -0
- package/dist/knowledge/guard-puzzle.js +3 -2
- package/dist/knowledge/guard-risk.d.ts +3 -1
- package/dist/knowledge/guard-risk.js +832 -64
- package/dist/knowledge/guard-templates.d.ts +1 -0
- package/dist/knowledge/guard-templates.js +278 -2
- package/dist/knowledge/guard-translation.js +6 -5
- package/dist/knowledge/index.d.ts +342 -0
- package/dist/knowledge/index.js +344 -0
- package/dist/knowledge/machine-confirm.d.ts +102 -0
- package/dist/knowledge/machine-confirm.js +559 -0
- package/dist/knowledge/machine-context.d.ts +160 -0
- package/dist/knowledge/machine-context.js +812 -0
- package/dist/knowledge/machine-ledger.d.ts +41 -0
- package/dist/knowledge/machine-ledger.js +315 -0
- package/dist/knowledge/machine-puzzle.d.ts +206 -0
- package/dist/knowledge/machine-puzzle.js +494 -0
- package/dist/knowledge/machine-risk.d.ts +75 -0
- package/dist/knowledge/machine-risk.js +644 -0
- package/dist/knowledge/machine-templates.d.ts +92 -0
- package/dist/knowledge/machine-templates.js +1592 -0
- package/dist/knowledge/machine-topology.d.ts +57 -0
- package/dist/knowledge/machine-topology.js +234 -0
- package/dist/knowledge/machine-translation.d.ts +96 -0
- package/dist/knowledge/machine-translation.js +513 -0
- package/dist/knowledge/mcp-schema-audit-cli.d.ts +1 -0
- package/dist/knowledge/mcp-schema-audit-cli.js +45 -0
- package/dist/knowledge/mcp-schema-audit.d.ts +90 -0
- package/dist/knowledge/mcp-schema-audit.js +772 -0
- package/dist/knowledge/onchain-constants.d.ts +4 -0
- package/dist/knowledge/onchain-constants.js +35 -0
- package/dist/knowledge/order-confirm.d.ts +115 -0
- package/dist/knowledge/order-confirm.js +573 -0
- package/dist/knowledge/order-context.d.ts +66 -0
- package/dist/knowledge/order-context.js +390 -0
- package/dist/knowledge/order-ledger.d.ts +69 -0
- package/dist/knowledge/order-ledger.js +341 -0
- package/dist/knowledge/order-puzzle.d.ts +159 -0
- package/dist/knowledge/order-puzzle.js +255 -0
- package/dist/knowledge/order-risk.d.ts +66 -0
- package/dist/knowledge/order-risk.js +653 -0
- package/dist/knowledge/order-templates.d.ts +50 -0
- package/dist/knowledge/order-templates.js +368 -0
- package/dist/knowledge/order-translation.d.ts +78 -0
- package/dist/knowledge/order-translation.js +550 -0
- package/dist/knowledge/passport-confirm.d.ts +130 -0
- package/dist/knowledge/passport-confirm.js +531 -0
- package/dist/knowledge/passport-context.d.ts +59 -0
- package/dist/knowledge/passport-context.js +306 -0
- package/dist/knowledge/passport-ledger.d.ts +48 -0
- package/dist/knowledge/passport-ledger.js +282 -0
- package/dist/knowledge/passport-puzzle.d.ts +108 -0
- package/dist/knowledge/passport-puzzle.js +333 -0
- package/dist/knowledge/passport-risk.d.ts +70 -0
- package/dist/knowledge/passport-risk.js +450 -0
- package/dist/knowledge/passport-templates.d.ts +40 -0
- package/dist/knowledge/passport-templates.js +568 -0
- package/dist/knowledge/passport-translation.d.ts +68 -0
- package/dist/knowledge/passport-translation.js +516 -0
- package/dist/knowledge/payment-risk.d.ts +33 -0
- package/dist/knowledge/payment-risk.js +182 -0
- package/dist/knowledge/permission-confirm.d.ts +110 -0
- package/dist/knowledge/permission-confirm.js +426 -0
- package/dist/knowledge/permission-context.d.ts +58 -0
- package/dist/knowledge/permission-context.js +224 -0
- package/dist/knowledge/permission-ledger.d.ts +38 -0
- package/dist/knowledge/permission-ledger.js +403 -0
- package/dist/knowledge/permission-puzzle.d.ts +122 -0
- package/dist/knowledge/permission-puzzle.js +173 -0
- package/dist/knowledge/permission-risk.d.ts +76 -0
- package/dist/knowledge/permission-risk.js +411 -0
- package/dist/knowledge/permission-templates.d.ts +38 -0
- package/dist/knowledge/permission-templates.js +234 -0
- package/dist/knowledge/permission-translation.d.ts +57 -0
- package/dist/knowledge/permission-translation.js +350 -0
- package/dist/knowledge/personal-risk.d.ts +36 -0
- package/dist/knowledge/personal-risk.js +212 -0
- package/dist/knowledge/progress-confirm.d.ts +108 -0
- package/dist/knowledge/progress-confirm.js +456 -0
- package/dist/knowledge/progress-context.d.ts +123 -0
- package/dist/knowledge/progress-context.js +452 -0
- package/dist/knowledge/progress-ledger.d.ts +63 -0
- package/dist/knowledge/progress-ledger.js +327 -0
- package/dist/knowledge/progress-puzzle.d.ts +82 -0
- package/dist/knowledge/progress-puzzle.js +219 -0
- package/dist/knowledge/progress-risk.d.ts +74 -0
- package/dist/knowledge/progress-risk.js +461 -0
- package/dist/knowledge/progress-templates.d.ts +38 -0
- package/dist/knowledge/progress-templates.js +228 -0
- package/dist/knowledge/progress-translation.d.ts +52 -0
- package/dist/knowledge/progress-translation.js +401 -0
- package/dist/knowledge/proof-confirm.d.ts +31 -0
- package/dist/knowledge/proof-confirm.js +187 -0
- package/dist/knowledge/proof-risk.d.ts +33 -0
- package/dist/knowledge/proof-risk.js +207 -0
- package/dist/knowledge/proof-translation.d.ts +52 -0
- package/dist/knowledge/proof-translation.js +283 -0
- package/dist/knowledge/registrar-risk.d.ts +34 -0
- package/dist/knowledge/registrar-risk.js +217 -0
- package/dist/knowledge/repository-confirm.d.ts +36 -0
- package/dist/knowledge/repository-confirm.js +242 -0
- package/dist/knowledge/repository-risk.d.ts +40 -0
- package/dist/knowledge/repository-risk.js +312 -0
- package/dist/knowledge/repository-translation.d.ts +58 -0
- package/dist/knowledge/repository-translation.js +422 -0
- package/dist/knowledge/resource-risk.d.ts +32 -0
- package/dist/knowledge/resource-risk.js +157 -0
- package/dist/knowledge/reward-confirm.d.ts +113 -0
- package/dist/knowledge/reward-confirm.js +496 -0
- package/dist/knowledge/reward-context.d.ts +127 -0
- package/dist/knowledge/reward-context.js +504 -0
- package/dist/knowledge/reward-ledger.d.ts +96 -0
- package/dist/knowledge/reward-ledger.js +502 -0
- package/dist/knowledge/reward-puzzle.d.ts +97 -0
- package/dist/knowledge/reward-puzzle.js +288 -0
- package/dist/knowledge/reward-risk.d.ts +84 -0
- package/dist/knowledge/reward-risk.js +545 -0
- package/dist/knowledge/reward-translation.d.ts +58 -0
- package/dist/knowledge/reward-translation.js +501 -0
- package/dist/knowledge/safety-rules.js +11 -3
- package/dist/knowledge/scenario-modes.d.ts +53 -0
- package/dist/knowledge/scenario-modes.js +302 -0
- package/dist/knowledge/service-confirm.d.ts +152 -0
- package/dist/knowledge/service-confirm.js +699 -0
- package/dist/knowledge/service-context.d.ts +66 -0
- package/dist/knowledge/service-context.js +403 -0
- package/dist/knowledge/service-ledger.d.ts +71 -0
- package/dist/knowledge/service-ledger.js +609 -0
- package/dist/knowledge/service-puzzle.d.ts +158 -0
- package/dist/knowledge/service-puzzle.js +236 -0
- package/dist/knowledge/service-risk.d.ts +108 -0
- package/dist/knowledge/service-risk.js +615 -0
- package/dist/knowledge/service-templates.d.ts +39 -0
- package/dist/knowledge/service-templates.js +418 -0
- package/dist/knowledge/service-translation.d.ts +103 -0
- package/dist/knowledge/service-translation.js +622 -0
- package/dist/knowledge/tools-reference.d.ts +17 -0
- package/dist/knowledge/tools-reference.js +151 -0
- package/dist/knowledge/treasury-confirm.d.ts +133 -0
- package/dist/knowledge/treasury-confirm.js +512 -0
- package/dist/knowledge/treasury-context.d.ts +64 -0
- package/dist/knowledge/treasury-context.js +363 -0
- package/dist/knowledge/treasury-ledger.d.ts +42 -0
- package/dist/knowledge/treasury-ledger.js +300 -0
- package/dist/knowledge/treasury-puzzle.d.ts +163 -0
- package/dist/knowledge/treasury-puzzle.js +216 -0
- package/dist/knowledge/treasury-risk.d.ts +86 -0
- package/dist/knowledge/treasury-risk.js +440 -0
- package/dist/knowledge/treasury-templates.d.ts +38 -0
- package/dist/knowledge/treasury-templates.js +316 -0
- package/dist/knowledge/treasury-translation.d.ts +78 -0
- package/dist/knowledge/treasury-translation.js +498 -0
- package/dist/knowledge/util-risk.d.ts +30 -0
- package/dist/knowledge/util-risk.js +135 -0
- package/dist/project/business-puzzle.d.ts +47 -0
- package/dist/project/business-puzzle.js +372 -0
- package/dist/project/deployment-doc.d.ts +61 -0
- package/dist/project/deployment-doc.js +432 -0
- package/dist/project/graph.d.ts +1 -0
- package/dist/project/graph.js +27 -1
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +39 -2
- package/dist/project/namespace.d.ts +11 -1
- package/dist/project/namespace.js +27 -2
- package/dist/project/query.d.ts +2 -0
- package/dist/project/query.js +56 -15
- package/dist/project/risk-aggregator.d.ts +50 -0
- package/dist/project/risk-aggregator.js +280 -0
- package/dist/project/substep-trace.d.ts +130 -0
- package/dist/project/substep-trace.js +332 -0
- package/dist/rules.d.ts +12 -0
- package/dist/rules.js +9 -0
- package/dist/schema/call/allocation.d.ts +44 -44
- package/dist/schema/call/arbitration.d.ts +141 -141
- package/dist/schema/call/base.d.ts +386 -386
- package/dist/schema/call/base.js +6 -6
- package/dist/schema/call/bridge-handler.d.ts +5 -2
- package/dist/schema/call/bridge.d.ts +159 -159
- package/dist/schema/call/contact.d.ts +110 -110
- package/dist/schema/call/demand.d.ts +76 -76
- package/dist/schema/call/handler.d.ts +2 -3
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +96 -96
- package/dist/schema/call/order.d.ts +98 -110
- package/dist/schema/call/permission-handler.d.ts +5 -0
- package/dist/schema/call/permission-handler.js +54 -0
- package/dist/schema/call/permission.d.ts +108 -108
- package/dist/schema/call/personal.d.ts +14 -14
- package/dist/schema/call/progress.d.ts +57 -72
- package/dist/schema/call/progress.js +7 -4
- package/dist/schema/call/proof.d.ts +18 -18
- package/dist/schema/call/proof.js +12 -7
- package/dist/schema/call/repository.d.ts +154 -154
- package/dist/schema/call/reward.d.ts +55 -55
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +238 -238
- package/dist/schema/call/treasury.d.ts +93 -93
- package/dist/schema/config/index.d.ts +178 -5
- package/dist/schema/config/index.js +52 -1
- package/dist/schema/local/index.d.ts +3554 -836
- package/dist/schema/local/index.js +2 -1
- package/dist/schema/messenger/index.d.ts +162 -162
- package/dist/schema/operations.d.ts +1102 -1118
- package/dist/schema/operations.js +7 -1
- package/dist/schema/project/index.d.ts +1392 -6
- package/dist/schema/project/index.js +426 -2
- package/dist/schema/query/index.d.ts +818 -818
- package/dist/schema/query/index.js +15 -9
- package/dist/schema/schema-query/index.d.ts +23 -3
- package/dist/schema/schema-query/index.js +13 -2
- package/dist/schema/sync-layer4.d.ts +21 -0
- package/dist/schema/sync-layer4.js +261 -0
- package/dist/schema/trust/index.d.ts +26 -26
- package/dist/schema/utils/guard-query-utils.d.ts +7 -0
- package/dist/schema/utils/guard-query-utils.js +14 -1
- package/dist/schemas/account_operation.output.json +718 -0
- package/dist/schemas/bridge_operation.output.json +1 -1
- package/dist/schemas/config_operation.output.json +173 -0
- package/dist/schemas/index.json +9 -1
- package/dist/schemas/local_info_operation.output.json +718 -0
- package/dist/schemas/local_mark_operation.output.json +718 -0
- package/dist/schemas/messenger_operation.output.json +1 -1
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +5 -4
- package/dist/schemas/onchain_operations.schema.json +1813 -333
- package/dist/schemas/onchain_operations_allocation.schema.json +9 -11
- package/dist/schemas/onchain_operations_arbitration.schema.json +2 -1
- package/dist/schemas/onchain_operations_contact.schema.json +2 -1
- package/dist/schemas/onchain_operations_demand.schema.json +2 -1
- package/dist/schemas/onchain_operations_gen_passport.schema.json +878 -872
- package/dist/schemas/onchain_operations_gen_proof.schema.json +273 -0
- package/dist/schemas/onchain_operations_guard.schema.json +584 -70
- package/dist/schemas/onchain_operations_machine.schema.json +4 -6
- package/dist/schemas/onchain_operations_order.schema.json +13 -9
- package/dist/schemas/onchain_operations_payment.schema.json +2 -1
- package/dist/schemas/onchain_operations_permission.schema.json +2 -1
- package/dist/schemas/onchain_operations_personal.schema.json +2 -1
- package/dist/schemas/onchain_operations_progress.schema.json +14 -10
- package/dist/schemas/onchain_operations_proof.schema.json +699 -0
- package/dist/schemas/onchain_operations_repository.schema.json +2 -1
- package/dist/schemas/onchain_operations_reward.schema.json +2 -1
- package/dist/schemas/onchain_operations_service.schema.json +4 -6
- package/dist/schemas/onchain_operations_treasury.schema.json +2 -1
- package/dist/schemas/onchain_table_data.output.json +6 -12
- package/dist/schemas/onchain_table_data.schema.json +32 -1
- package/dist/schemas/project_operation.output.json +879 -0
- package/dist/schemas/project_operation.schema.json +473 -2
- package/dist/schemas/query_toolkit.output.json +14906 -6
- package/dist/schemas/schema_query.output.json +38 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/tools/handlers/bridge.d.ts +1 -0
- package/dist/tools/handlers/bridge.js +1 -0
- package/dist/tools/handlers/config.d.ts +2 -0
- package/dist/tools/handlers/config.js +74 -0
- package/dist/tools/handlers/file-export.d.ts +3 -0
- package/dist/tools/handlers/file-export.js +90 -0
- package/dist/tools/handlers/local.d.ts +3 -0
- package/dist/tools/handlers/local.js +38 -0
- package/dist/tools/handlers/messenger.d.ts +16 -0
- package/dist/tools/handlers/messenger.js +188 -0
- package/dist/tools/handlers/onchain.d.ts +2 -0
- package/dist/tools/handlers/onchain.js +248 -0
- package/dist/tools/handlers/project.d.ts +2 -0
- package/dist/tools/handlers/project.js +293 -0
- package/dist/tools/handlers/query.d.ts +5 -0
- package/dist/tools/handlers/query.js +256 -0
- package/dist/tools/handlers/schema-query.d.ts +2 -0
- package/dist/tools/handlers/schema-query.js +93 -0
- package/dist/tools/handlers/trust.d.ts +2 -0
- package/dist/tools/handlers/trust.js +194 -0
- package/dist/tools/handlers/wip.d.ts +2 -0
- package/dist/tools/handlers/wip.js +44 -0
- package/dist/tools/index.d.ts +13 -0
- package/dist/tools/index.js +526 -0
- package/dist/tools/rules-hook.d.ts +2 -0
- package/dist/tools/rules-hook.js +23 -0
- package/dist/tools/shared.d.ts +20 -0
- package/dist/tools/shared.js +130 -0
- package/dist/tools/types.d.ts +35 -0
- package/dist/tools/types.js +1 -0
- package/dist/tools/wrap.d.ts +14 -0
- package/dist/tools/wrap.js +267 -0
- package/package.json +20 -6
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type PersonalRiskLevel = "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "INFO";
|
|
2
|
+
export type PersonalRiskCategory = "structural" | "semantic" | "lifecycle" | "cross_object" | "knowledge";
|
|
3
|
+
export type PersonalStakeholder = "user" | "consumer" | "system";
|
|
4
|
+
export interface PersonalRisk {
|
|
5
|
+
id: string;
|
|
6
|
+
level: PersonalRiskLevel;
|
|
7
|
+
category: PersonalRiskCategory;
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
affected_stakeholders: PersonalStakeholder[];
|
|
11
|
+
scenario: string;
|
|
12
|
+
mitigation: string;
|
|
13
|
+
evidence?: string;
|
|
14
|
+
related_move_error?: string;
|
|
15
|
+
auto_fixable: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface PersonalRiskCheckContext {
|
|
18
|
+
information_entries?: Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
value: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
is_mark_destroy?: boolean;
|
|
23
|
+
has_referrer?: boolean;
|
|
24
|
+
is_mark_transfer?: boolean;
|
|
25
|
+
information_count?: number;
|
|
26
|
+
expects_dedicated_move_struct?: boolean;
|
|
27
|
+
singleton_enforced?: boolean;
|
|
28
|
+
constants_synced?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare const PERSONAL_RISK_RULES: {
|
|
31
|
+
rule: PersonalRisk;
|
|
32
|
+
check: (ctx: PersonalRiskCheckContext) => PersonalRisk | null;
|
|
33
|
+
}[];
|
|
34
|
+
export declare const PERSONAL_RISK_VERSION = "1.0.0";
|
|
35
|
+
export declare function checkPersonalRisks(ctx: PersonalRiskCheckContext): PersonalRisk[];
|
|
36
|
+
export declare function getPersonalRiskById(id: string): PersonalRisk | undefined;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { MAX_ADDRESS_COUNT, MAX_RECORD_COUNT_REGISTRAR, MAX_RECORD_LENGTH, MAX_TAGS_COUNT, } from "@wowok/wowok";
|
|
2
|
+
function detectSensitiveInformation(entries) {
|
|
3
|
+
const hits = [];
|
|
4
|
+
for (const e of entries) {
|
|
5
|
+
const v = typeof e.value === "string" ? e.value : String(e.value ?? "");
|
|
6
|
+
const lower = v.toLowerCase();
|
|
7
|
+
if (/^\+?\d{10,15}$/.test(v))
|
|
8
|
+
hits.push(`${e.name}=phone-like`);
|
|
9
|
+
if (/[^\s@]+@[^\s@]+\.[^\s@]+/.test(v))
|
|
10
|
+
hits.push(`${e.name}=email-like`);
|
|
11
|
+
if (/^(0x)?[0-9a-fA-F]{64}$/.test(v))
|
|
12
|
+
hits.push(`${e.name}=private-key-like`);
|
|
13
|
+
if (/^([a-z]{3,8}\s){11,23}[a-z]{3,8}$/.test(v.trim()))
|
|
14
|
+
hits.push(`${e.name}=mnemonic-like`);
|
|
15
|
+
if (/private[_-]?key|secret|mnemonic|seed/i.test(e.name))
|
|
16
|
+
hits.push(`${e.name}=secret-named`);
|
|
17
|
+
void lower;
|
|
18
|
+
}
|
|
19
|
+
return hits;
|
|
20
|
+
}
|
|
21
|
+
const R_PE_01 = {
|
|
22
|
+
rule: {
|
|
23
|
+
id: "R-PERSONAL-01",
|
|
24
|
+
level: "HIGH",
|
|
25
|
+
category: "semantic",
|
|
26
|
+
title: "Sensitive information leakage — on-chain data is permanent",
|
|
27
|
+
description: "information is stored via Entity.info_add as on-chain Records. The schema description " +
|
|
28
|
+
"warns 'NEVER: phone, address, private keys' but the Move layer does not validate " +
|
|
29
|
+
"content. Once a phone number, physical address, email, or private key is written " +
|
|
30
|
+
"on-chain, it is permanent and publicly readable — there is no delete (info_remove " +
|
|
31
|
+
"only removes the named entry from the user's record; the data remains in the " +
|
|
32
|
+
"transaction history).",
|
|
33
|
+
affected_stakeholders: ["user"],
|
|
34
|
+
scenario: "User adds information {name: 'phone', value: '+8613800000000'}; number is public forever",
|
|
35
|
+
mitigation: "MCP schema description MUST warn. AI agents MUST re-confirm before adding any " +
|
|
36
|
+
"information entry. Business layer should run a sensitive-data regex (phone/email/" +
|
|
37
|
+
"private-key/mnemonic) and reject matches. Use the 'local' tool for private data.",
|
|
38
|
+
auto_fixable: false,
|
|
39
|
+
},
|
|
40
|
+
check: (ctx) => {
|
|
41
|
+
if (!ctx.information_entries || ctx.information_entries.length === 0)
|
|
42
|
+
return null;
|
|
43
|
+
const hits = detectSensitiveInformation(ctx.information_entries);
|
|
44
|
+
if (hits.length === 0)
|
|
45
|
+
return null;
|
|
46
|
+
return { ...R_PE_01.rule, evidence: `sensitive patterns: ${hits.join("; ")}` };
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
const R_PE_02 = {
|
|
50
|
+
rule: {
|
|
51
|
+
id: "R-PERSONAL-02",
|
|
52
|
+
level: "MEDIUM",
|
|
53
|
+
category: "lifecycle",
|
|
54
|
+
title: "mark destroy is irreversible — identity mark permanently lost",
|
|
55
|
+
description: "The 'destroy' mark op permanently deletes the Resource object backing the user's " +
|
|
56
|
+
"identity mark. There is no archive, no event, and no rollback. After destroy, the " +
|
|
57
|
+
"user has no on-chain identity mark until they create a new one, and any external " +
|
|
58
|
+
"system keyed on the old Resource address breaks.",
|
|
59
|
+
affected_stakeholders: ["user", "consumer"],
|
|
60
|
+
scenario: "User destroys their mark; downstream services keyed on the old Resource address fail",
|
|
61
|
+
mitigation: "Require explicit confirmation before destroy. SDK should refuse destroy if any " +
|
|
62
|
+
"live consumer still references the mark. Provide a 'replace' alternative that " +
|
|
63
|
+
"swaps the underlying Resource without losing continuity.",
|
|
64
|
+
auto_fixable: false,
|
|
65
|
+
},
|
|
66
|
+
check: (ctx) => {
|
|
67
|
+
if (!ctx.is_mark_destroy)
|
|
68
|
+
return null;
|
|
69
|
+
return { ...R_PE_02.rule, evidence: "is_mark_destroy=true (irreversible)" };
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
const R_PE_03 = {
|
|
73
|
+
rule: {
|
|
74
|
+
id: "R-PERSONAL-03",
|
|
75
|
+
level: "MEDIUM",
|
|
76
|
+
category: "semantic",
|
|
77
|
+
title: "referrer chain can be abused to fabricate trust signals",
|
|
78
|
+
description: "When registering, a user may specify any referrer address. There is no on-chain " +
|
|
79
|
+
"verification that the referrer actually invited the user. A sybil attacker can " +
|
|
80
|
+
"register many accounts chained to a reputable address, fabricating an affiliation " +
|
|
81
|
+
"to borrow trust. The Registrar records referrer but does not validate consent.",
|
|
82
|
+
affected_stakeholders: ["user", "consumer"],
|
|
83
|
+
scenario: "Attacker registers 100 accounts all citing a reputable merchant as referrer",
|
|
84
|
+
mitigation: "Business layer should treat referrer as a self-attested hint, not a verified trust " +
|
|
85
|
+
"signal. Audit referrer chains off-chain; require the referrer to co-sign if used for " +
|
|
86
|
+
"trust scoring.",
|
|
87
|
+
auto_fixable: false,
|
|
88
|
+
},
|
|
89
|
+
check: (ctx) => {
|
|
90
|
+
if (!ctx.has_referrer)
|
|
91
|
+
return null;
|
|
92
|
+
return { ...R_PE_03.rule, evidence: "has_referrer=true (self-attested, unverified)" };
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
const R_PE_04 = {
|
|
96
|
+
rule: {
|
|
97
|
+
id: "R-PERSONAL-04",
|
|
98
|
+
level: "LOW",
|
|
99
|
+
category: "structural",
|
|
100
|
+
title: `information inherits MAX_RECORD_COUNT_REGISTRAR=${MAX_RECORD_COUNT_REGISTRAR} — permissive`,
|
|
101
|
+
description: `Personal does not define its own record cap; it inherits Entity's ` +
|
|
102
|
+
`MAX_RECORD_COUNT_REGISTRAR=${MAX_RECORD_COUNT_REGISTRAR} (registrar.move) and ` +
|
|
103
|
+
`MAX_RECORD_LENGTH=${MAX_RECORD_LENGTH} per record. ${MAX_RECORD_COUNT_REGISTRAR} records ` +
|
|
104
|
+
`per user is generous and can bloat on-chain storage if users add many entries. ` +
|
|
105
|
+
`MAX_ADDRESS_COUNT=${MAX_ADDRESS_COUNT} and MAX_TAGS_COUNT=${MAX_TAGS_COUNT} also apply via Entity/Resource.`,
|
|
106
|
+
affected_stakeholders: ["user", "system"],
|
|
107
|
+
scenario: "User adds 1000 information entries; Entity record storage is heavy and slow to read",
|
|
108
|
+
mitigation: "Business layer should self-limit information count (e.g. ≤50). For bulk profile data, " +
|
|
109
|
+
"store off-chain and reference via a Repository or Proof.",
|
|
110
|
+
auto_fixable: false,
|
|
111
|
+
},
|
|
112
|
+
check: (ctx) => {
|
|
113
|
+
if (ctx.information_count === undefined)
|
|
114
|
+
return null;
|
|
115
|
+
if (ctx.information_count < MAX_RECORD_COUNT_REGISTRAR)
|
|
116
|
+
return null;
|
|
117
|
+
return {
|
|
118
|
+
...R_PE_04.rule,
|
|
119
|
+
evidence: `information_count=${ctx.information_count}, limit=${MAX_RECORD_COUNT_REGISTRAR}`,
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
const R_PE_05 = {
|
|
124
|
+
rule: {
|
|
125
|
+
id: "R-PERSONAL-05",
|
|
126
|
+
level: "MEDIUM",
|
|
127
|
+
category: "lifecycle",
|
|
128
|
+
title: "mark transfer loses identity mark at the source address",
|
|
129
|
+
description: "The 'transfer' mark op moves the Resource backing the identity mark to a new address. " +
|
|
130
|
+
"After transfer, the source address has no mark — any service that keyed identity on " +
|
|
131
|
+
"the source address loses the binding. There is no automatic forwarding stub left behind.",
|
|
132
|
+
affected_stakeholders: ["user", "consumer"],
|
|
133
|
+
scenario: "User transfers mark to a new wallet; old-wallet-based logins all break",
|
|
134
|
+
mitigation: "Surface a 'transfer will detach the mark from this address' warning. Consumers should " +
|
|
135
|
+
"track marks by Resource address, not by user address. Provide a migration window " +
|
|
136
|
+
"where both addresses are valid.",
|
|
137
|
+
auto_fixable: false,
|
|
138
|
+
},
|
|
139
|
+
check: (ctx) => {
|
|
140
|
+
if (!ctx.is_mark_transfer)
|
|
141
|
+
return null;
|
|
142
|
+
return { ...R_PE_05.rule, evidence: "is_mark_transfer=true (source loses mark)" };
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
const R_PE_06 = {
|
|
146
|
+
rule: {
|
|
147
|
+
id: "R-PERSONAL-06",
|
|
148
|
+
level: "LOW",
|
|
149
|
+
category: "cross_object",
|
|
150
|
+
title: "Personal has no dedicated Move struct — depends entirely on Entity + Resource",
|
|
151
|
+
description: "Personal is an SDK-layer construct: there is no personal.move. The SDK composes " +
|
|
152
|
+
"Entity (information/description) and Resource (mark) on behalf of the user. Any " +
|
|
153
|
+
"breaking change in Entity or Resource directly affects Personal. The MCP layer " +
|
|
154
|
+
"cannot fix Personal bugs without touching Entity/Resource.",
|
|
155
|
+
affected_stakeholders: ["system"],
|
|
156
|
+
scenario: "Entity schema changes; Personal.information silently breaks",
|
|
157
|
+
mitigation: "Track Entity and Resource changelogs as first-order dependencies of Personal. Add " +
|
|
158
|
+
"integration tests that exercise Personal flows whenever Entity/Resource change.",
|
|
159
|
+
auto_fixable: false,
|
|
160
|
+
},
|
|
161
|
+
check: (ctx) => {
|
|
162
|
+
if (!ctx.expects_dedicated_move_struct)
|
|
163
|
+
return null;
|
|
164
|
+
return { ...R_PE_06.rule, evidence: "expects_dedicated_move_struct=true (none exists)" };
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
const R_PE_07 = {
|
|
168
|
+
rule: {
|
|
169
|
+
id: "R-PERSONAL-07",
|
|
170
|
+
level: "MEDIUM",
|
|
171
|
+
category: "lifecycle",
|
|
172
|
+
title: "Singleton assumption — if violated, multiple Personal instances conflict",
|
|
173
|
+
description: "Personal assumes each account has exactly one Entity record (and one Resource mark). " +
|
|
174
|
+
"The Move layer enforces this via entity_register's idempotency (returns the existing " +
|
|
175
|
+
"Resource for already-registered users). But if the SDK ever bypasses entity_register " +
|
|
176
|
+
"and creates duplicates (e.g. via entity_register_with_resource_forced), downstream " +
|
|
177
|
+
"code that assumes a singleton would see inconsistent state.",
|
|
178
|
+
affected_stakeholders: ["user", "consumer"],
|
|
179
|
+
scenario: "SDK calls entity_register_with_resource_forced; user now has two Resource marks",
|
|
180
|
+
mitigation: "SDK MUST enforce the singleton invariant: refuse to call entity_register_with_resource_forced " +
|
|
181
|
+
"unless the user explicitly opts in. Document that forced re-registration invalidates " +
|
|
182
|
+
"the old Resource address.",
|
|
183
|
+
auto_fixable: false,
|
|
184
|
+
},
|
|
185
|
+
check: (ctx) => {
|
|
186
|
+
if (ctx.singleton_enforced)
|
|
187
|
+
return null;
|
|
188
|
+
return { ...R_PE_07.rule, evidence: "singleton_enforced=false (needs SDK guard)" };
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
export const PERSONAL_RISK_RULES = [
|
|
192
|
+
R_PE_01,
|
|
193
|
+
R_PE_02,
|
|
194
|
+
R_PE_03,
|
|
195
|
+
R_PE_04,
|
|
196
|
+
R_PE_05,
|
|
197
|
+
R_PE_06,
|
|
198
|
+
R_PE_07,
|
|
199
|
+
];
|
|
200
|
+
export const PERSONAL_RISK_VERSION = "1.0.0";
|
|
201
|
+
export function checkPersonalRisks(ctx) {
|
|
202
|
+
const risks = [];
|
|
203
|
+
for (const rule of PERSONAL_RISK_RULES) {
|
|
204
|
+
const r = rule.check(ctx);
|
|
205
|
+
if (r)
|
|
206
|
+
risks.push(r);
|
|
207
|
+
}
|
|
208
|
+
return risks;
|
|
209
|
+
}
|
|
210
|
+
export function getPersonalRiskById(id) {
|
|
211
|
+
return PERSONAL_RISK_RULES.find(r => r.rule.id === id)?.rule;
|
|
212
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type ProgressRiskAssessment } from "./progress-risk.js";
|
|
2
|
+
export type ProgressConfirmGateStatus = "approved" | "blocked_checklist" | "blocked_risk" | "blocked_user" | "blocked_environment";
|
|
3
|
+
export interface ProgressConfirmGateResult {
|
|
4
|
+
status: ProgressConfirmGateStatus;
|
|
5
|
+
checklist_result: ProgressChecklistResult;
|
|
6
|
+
risk_result?: ProgressRiskAssessment;
|
|
7
|
+
user_confirmation?: ProgressUserConfirmation;
|
|
8
|
+
environment_result?: ProgressEnvironmentResult;
|
|
9
|
+
confirmation_text?: string;
|
|
10
|
+
block_reason?: string;
|
|
11
|
+
decision_record: ProgressDecisionRecord;
|
|
12
|
+
}
|
|
13
|
+
export interface ProgressChecklistResult {
|
|
14
|
+
all_passed: boolean;
|
|
15
|
+
items: ProgressChecklistItem[];
|
|
16
|
+
}
|
|
17
|
+
export interface ProgressChecklistItem {
|
|
18
|
+
id: string;
|
|
19
|
+
description: string;
|
|
20
|
+
passed: boolean;
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ProgressUserConfirmation {
|
|
24
|
+
questions_asked: ProgressConfirmationQuestion[];
|
|
25
|
+
responses: ProgressConfirmationResponse[];
|
|
26
|
+
all_confirmed: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface ProgressConfirmationQuestion {
|
|
29
|
+
id: string;
|
|
30
|
+
question: string;
|
|
31
|
+
requires_explicit_yes: boolean;
|
|
32
|
+
related_risk_ids?: string[];
|
|
33
|
+
}
|
|
34
|
+
export interface ProgressConfirmationResponse {
|
|
35
|
+
question_id: string;
|
|
36
|
+
response: "yes" | "no" | "skip";
|
|
37
|
+
}
|
|
38
|
+
export interface ProgressEnvironmentResult {
|
|
39
|
+
passed: boolean;
|
|
40
|
+
checks: {
|
|
41
|
+
name: string;
|
|
42
|
+
passed: boolean;
|
|
43
|
+
message: string;
|
|
44
|
+
}[];
|
|
45
|
+
}
|
|
46
|
+
export interface ProgressDecisionRecord {
|
|
47
|
+
timestamp: string;
|
|
48
|
+
gate_version: string;
|
|
49
|
+
final_status: ProgressConfirmGateStatus;
|
|
50
|
+
layers_passed: string[];
|
|
51
|
+
layers_failed: string[];
|
|
52
|
+
}
|
|
53
|
+
export interface ProgressJsonForConfirm {
|
|
54
|
+
object?: string | null;
|
|
55
|
+
task?: string;
|
|
56
|
+
repository?: {
|
|
57
|
+
op: "add" | "set";
|
|
58
|
+
objects: string[];
|
|
59
|
+
} | {
|
|
60
|
+
op: "remove";
|
|
61
|
+
objects: string[];
|
|
62
|
+
} | {
|
|
63
|
+
op: "clear";
|
|
64
|
+
};
|
|
65
|
+
progress_namedOperator?: {
|
|
66
|
+
op: "add" | "set" | "remove";
|
|
67
|
+
name: string;
|
|
68
|
+
operators: string[];
|
|
69
|
+
};
|
|
70
|
+
operate?: {
|
|
71
|
+
operation: {
|
|
72
|
+
next_node_name: string;
|
|
73
|
+
forward: string;
|
|
74
|
+
};
|
|
75
|
+
op?: "next" | "hold" | "unhold" | "adminUnhold";
|
|
76
|
+
message?: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export interface ProgressConfirmGateInput {
|
|
80
|
+
progress_json: ProgressJsonForConfirm;
|
|
81
|
+
intent?: string;
|
|
82
|
+
target_objects_types?: string[];
|
|
83
|
+
current_machine?: string;
|
|
84
|
+
machine_published?: boolean;
|
|
85
|
+
current_task?: string | null;
|
|
86
|
+
current_named_operator_count?: number;
|
|
87
|
+
current_context_repository_count?: number;
|
|
88
|
+
current_node?: string;
|
|
89
|
+
forward_already_accomplished?: boolean;
|
|
90
|
+
holder_address?: string | null;
|
|
91
|
+
signer?: string;
|
|
92
|
+
forward_named_operator?: string;
|
|
93
|
+
forward_permission_index?: number | null;
|
|
94
|
+
forward_has_guard?: boolean;
|
|
95
|
+
skip_user_confirmation?: boolean;
|
|
96
|
+
skip_environment_check?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export declare const PROGRESS_OPERATION_CHECKLIST: ProgressChecklistItem[];
|
|
99
|
+
export declare const PROGRESS_CONFIRMATION_QUESTIONS: ProgressConfirmationQuestion[];
|
|
100
|
+
export declare const PROGRESS_CONFIRM_VERSION = "1.0.0";
|
|
101
|
+
export declare function runProgressConfirmGate(input: ProgressConfirmGateInput): ProgressConfirmGateResult;
|
|
102
|
+
export interface ProgressiveProgressCheckResult {
|
|
103
|
+
stage: "checklist" | "risk" | "confirmation" | "environment" | "complete";
|
|
104
|
+
status: "pass" | "fail" | "pending";
|
|
105
|
+
message: string;
|
|
106
|
+
next_action?: string;
|
|
107
|
+
}
|
|
108
|
+
export declare function progressiveProgressCheck(input: ProgressConfirmGateInput): ProgressiveProgressCheckResult;
|