@wowok/agent-mcp 2.4.3 → 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.js +21 -0
- 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-puzzle.js +3 -2
- package/dist/knowledge/guard-risk.d.ts +1 -1
- package/dist/knowledge/guard-risk.js +12 -14
- package/dist/knowledge/guard-templates.js +1 -1
- 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/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/schema/call/allocation.d.ts +34 -34
- package/dist/schema/call/arbitration.d.ts +141 -141
- package/dist/schema/call/base.d.ts +386 -386
- package/dist/schema/call/base.js +3 -3
- 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 +58 -58
- 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/service.d.ts +231 -231
- 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 +1058 -1074
- 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 +672 -672
- 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/schemas/account_operation.output.json +718 -0
- 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/onchain_operations.output.json +3 -2
- package/dist/schemas/onchain_operations.schema.json +1802 -313
- package/dist/schemas/onchain_operations_allocation.schema.json +2 -1
- 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 +2 -1
- 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 +2 -1
- package/dist/schemas/onchain_operations_treasury.schema.json +2 -1
- 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/config.d.ts +1 -1
- package/dist/tools/handlers/config.js +21 -18
- package/dist/tools/handlers/file-export.d.ts +2 -2
- package/dist/tools/handlers/local.d.ts +3 -30
- package/dist/tools/handlers/local.js +14 -3
- package/dist/tools/handlers/messenger.d.ts +1 -1
- package/dist/tools/handlers/messenger.js +2 -1
- package/dist/tools/handlers/onchain.d.ts +1 -1
- package/dist/tools/handlers/onchain.js +24 -22
- package/dist/tools/handlers/project.d.ts +1 -1
- package/dist/tools/handlers/project.js +258 -18
- package/dist/tools/handlers/query.d.ts +4 -4
- package/dist/tools/handlers/schema-query.d.ts +1 -1
- package/dist/tools/handlers/schema-query.js +21 -20
- package/dist/tools/handlers/trust.d.ts +1 -1
- package/dist/tools/handlers/trust.js +2 -2
- package/dist/tools/handlers/wip.d.ts +1 -1
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +55 -8
- package/dist/tools/rules-hook.d.ts +1 -1
- package/dist/tools/rules-hook.js +3 -2
- package/dist/tools/shared.d.ts +13 -22
- package/dist/tools/types.d.ts +5 -5
- package/dist/tools/wrap.d.ts +10 -2
- package/dist/tools/wrap.js +212 -0
- package/package.json +3 -3
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { USER_DEFINED_PERM_INDEX_START, MAX_ENTITY_COUNT, MAX_PERM_FOR_ENTITY, MAX_ADMIN_COUNT, } from "@wowok/wowok";
|
|
2
|
+
import { isBuiltinPermission, findSceneByPermissionIndex, } from "./permission-ledger.js";
|
|
3
|
+
import { assessPermissionRisks, } from "./permission-risk.js";
|
|
4
|
+
export const PERMISSION_PUBLISH_CHECKLIST = [
|
|
5
|
+
{ id: "C-P-01", description: "Custom permissionIndex >= 1000 (USER_DEFINED_PERM_INDEX_START)", passed: false, message: "" },
|
|
6
|
+
{ id: "C-P-02", description: "Entity count <= MAX_ENTITY_COUNT (1000)", passed: false, message: "" },
|
|
7
|
+
{ id: "C-P-03", description: "Per-entity permission count <= MAX_PERM_FOR_ENTITY (1000)", passed: false, message: "" },
|
|
8
|
+
{ id: "C-P-04", description: "Admin count <= MAX_ADMIN_COUNT (500)", passed: false, message: "" },
|
|
9
|
+
{ id: "C-P-05", description: "Owner address valid (if transfer)", passed: false, message: "" },
|
|
10
|
+
{ id: "C-P-06", description: "Admin addresses valid", passed: false, message: "" },
|
|
11
|
+
{ id: "C-P-07", description: "Entity addresses valid", passed: false, message: "" },
|
|
12
|
+
{ id: "C-P-08", description: "UM address valid (Contact object) or null", passed: false, message: "" },
|
|
13
|
+
{ id: "C-P-09", description: "apply object types match permission indexes", passed: false, message: "" },
|
|
14
|
+
{ id: "C-P-10", description: "All custom permissions (>= 1000) have remark", passed: false, message: "" },
|
|
15
|
+
{ id: "C-P-11", description: "Ownership transfer double-confirmed", passed: false, message: "" },
|
|
16
|
+
];
|
|
17
|
+
function runStaticChecklist(input) {
|
|
18
|
+
const items = PERMISSION_PUBLISH_CHECKLIST.map(c => ({ ...c }));
|
|
19
|
+
const data = input.permission_json;
|
|
20
|
+
if (data.table && "index" in data.table && typeof data.table.index === "number") {
|
|
21
|
+
const idx = data.table.index;
|
|
22
|
+
const valid = idx < USER_DEFINED_PERM_INDEX_START ? isBuiltinPermission(idx) : true;
|
|
23
|
+
const item = items.find(i => i.id === "C-P-01");
|
|
24
|
+
item.passed = valid;
|
|
25
|
+
item.message = valid ? "" : `Permission index ${idx} is < ${USER_DEFINED_PERM_INDEX_START} and not builtin`;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
items.find(i => i.id === "C-P-01").passed = true;
|
|
29
|
+
}
|
|
30
|
+
const entityCount = input.current_entity_count ?? 0;
|
|
31
|
+
const cp02 = items.find(i => i.id === "C-P-02");
|
|
32
|
+
cp02.passed = entityCount <= MAX_ENTITY_COUNT;
|
|
33
|
+
cp02.message = cp02.passed ? "" : `Entity count ${entityCount} > ${MAX_ENTITY_COUNT}`;
|
|
34
|
+
if (data.table && "index" in data.table && Array.isArray(data.table.index)) {
|
|
35
|
+
const valid = data.table.index.length <= MAX_PERM_FOR_ENTITY;
|
|
36
|
+
const cp03 = items.find(i => i.id === "C-P-03");
|
|
37
|
+
cp03.passed = valid;
|
|
38
|
+
cp03.message = valid ? "" : `Per-entity perm count ${data.table.index.length} > ${MAX_PERM_FOR_ENTITY}`;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
items.find(i => i.id === "C-P-03").passed = true;
|
|
42
|
+
}
|
|
43
|
+
if (data.admin) {
|
|
44
|
+
const count = data.admin.op === "set" ? data.admin.addresses.length : (input.current_admin_count ?? 0);
|
|
45
|
+
const valid = count <= MAX_ADMIN_COUNT;
|
|
46
|
+
const cp04 = items.find(i => i.id === "C-P-04");
|
|
47
|
+
cp04.passed = valid;
|
|
48
|
+
cp04.message = valid ? "" : `Admin count ${count} > ${MAX_ADMIN_COUNT}`;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
items.find(i => i.id === "C-P-04").passed = true;
|
|
52
|
+
}
|
|
53
|
+
if (data.builder) {
|
|
54
|
+
const valid = data.builder.startsWith("0x") && data.builder.length >= 40;
|
|
55
|
+
const cp05 = items.find(i => i.id === "C-P-05");
|
|
56
|
+
cp05.passed = valid;
|
|
57
|
+
cp05.message = valid ? "" : `New owner address ${data.builder} invalid`;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
items.find(i => i.id === "C-P-05").passed = true;
|
|
61
|
+
}
|
|
62
|
+
if (data.admin) {
|
|
63
|
+
const valid = data.admin.addresses.every(a => a.startsWith("0x") && a.length >= 40);
|
|
64
|
+
const cp06 = items.find(i => i.id === "C-P-06");
|
|
65
|
+
cp06.passed = valid;
|
|
66
|
+
cp06.message = valid ? "" : `Some admin address invalid`;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
items.find(i => i.id === "C-P-06").passed = true;
|
|
70
|
+
}
|
|
71
|
+
if (data.table) {
|
|
72
|
+
const entities = "entity" in data.table
|
|
73
|
+
? (Array.isArray(data.table.entity) ? data.table.entity : [data.table.entity])
|
|
74
|
+
: [];
|
|
75
|
+
const valid = entities.every(a => a.startsWith("0x") && a.length >= 40);
|
|
76
|
+
const cp07 = items.find(i => i.id === "C-P-07");
|
|
77
|
+
cp07.passed = valid;
|
|
78
|
+
cp07.message = valid ? "" : `Some entity address invalid`;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
items.find(i => i.id === "C-P-07").passed = true;
|
|
82
|
+
}
|
|
83
|
+
if (data.um !== undefined) {
|
|
84
|
+
const valid = data.um === null || (data.um.startsWith("0x") && data.um.length >= 40);
|
|
85
|
+
const cp08 = items.find(i => i.id === "C-P-08");
|
|
86
|
+
cp08.passed = valid;
|
|
87
|
+
cp08.message = valid ? "" : `UM address ${data.um} invalid`;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
items.find(i => i.id === "C-P-08").passed = true;
|
|
91
|
+
}
|
|
92
|
+
if (data.apply && data.apply.length > 0 && data.table && "index" in data.table && typeof data.table.index === "number") {
|
|
93
|
+
const scene = findSceneByPermissionIndex(data.table.index);
|
|
94
|
+
if (scene && input.target_objects_types) {
|
|
95
|
+
const mismatched = input.target_objects_types.filter(t => t !== scene.host_object);
|
|
96
|
+
const cp09 = items.find(i => i.id === "C-P-09");
|
|
97
|
+
cp09.passed = mismatched.length === 0;
|
|
98
|
+
cp09.message = mismatched.length === 0 ? "" : `Index ${data.table.index} expects ${scene.host_object}, got ${mismatched.join(",")}`;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
items.find(i => i.id === "C-P-09").passed = true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
items.find(i => i.id === "C-P-09").passed = true;
|
|
106
|
+
}
|
|
107
|
+
if (data.table && "index" in data.table && typeof data.table.index === "number" && data.table.index >= USER_DEFINED_PERM_INDEX_START) {
|
|
108
|
+
const hasRemark = data.remark && "remark" in data.remark && data.remark.index === data.table.index;
|
|
109
|
+
const cp10 = items.find(i => i.id === "C-P-10");
|
|
110
|
+
cp10.passed = !!hasRemark;
|
|
111
|
+
cp10.message = hasRemark ? "" : `Custom permission ${data.table.index} has no remark`;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
items.find(i => i.id === "C-P-10").passed = true;
|
|
115
|
+
}
|
|
116
|
+
if (data.builder) {
|
|
117
|
+
items.find(i => i.id === "C-P-11").passed = false;
|
|
118
|
+
items.find(i => i.id === "C-P-11").message = "Pending user confirmation in Layer 3";
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
items.find(i => i.id === "C-P-11").passed = true;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
all_passed: items.filter(i => i.id !== "C-P-11").every(i => i.passed),
|
|
125
|
+
items,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function adaptRiskAssessment(input, checklist) {
|
|
129
|
+
const ctx = {
|
|
130
|
+
object: input.permission_json.object,
|
|
131
|
+
description: input.permission_json.description,
|
|
132
|
+
admin: input.permission_json.admin,
|
|
133
|
+
table: input.permission_json.table,
|
|
134
|
+
entity: input.permission_json.entity,
|
|
135
|
+
remark: input.permission_json.remark,
|
|
136
|
+
apply: input.permission_json.apply,
|
|
137
|
+
builder: input.permission_json.builder,
|
|
138
|
+
um: input.permission_json.um,
|
|
139
|
+
current_admin_count: input.current_admin_count,
|
|
140
|
+
current_entity_count: input.current_entity_count,
|
|
141
|
+
target_objects_types: input.target_objects_types,
|
|
142
|
+
};
|
|
143
|
+
return assessPermissionRisks(ctx);
|
|
144
|
+
}
|
|
145
|
+
export const PERMISSION_CONFIRMATION_QUESTIONS = [
|
|
146
|
+
{
|
|
147
|
+
id: "QP1",
|
|
148
|
+
question: "Are all admin addresses correctly verified as trusted parties?",
|
|
149
|
+
requires_explicit_yes: true,
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "QP2",
|
|
153
|
+
question: "Are all entity addresses (users/Guards) correctly assigned to their intended permission indexes?",
|
|
154
|
+
requires_explicit_yes: true,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "QP3",
|
|
158
|
+
question: "If using custom permission indexes (>= 1000), are all remarks documented?",
|
|
159
|
+
requires_explicit_yes: true,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: "QP4",
|
|
163
|
+
question: "If applying to target objects, have you verified the target object types match the permission indexes used?",
|
|
164
|
+
requires_explicit_yes: true,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: "QP5",
|
|
168
|
+
question: "⚠️ If transferring ownership: do you confirm the new owner address is correct? This operation is IRREVERSIBLE.",
|
|
169
|
+
requires_explicit_yes: true,
|
|
170
|
+
related_risk_ids: ["R-P-4-01"],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: "QP6",
|
|
174
|
+
question: "Have you exported the current Permission JSON as a backup before this operation?",
|
|
175
|
+
requires_explicit_yes: false,
|
|
176
|
+
},
|
|
177
|
+
];
|
|
178
|
+
function processUserConfirmation(input, assessment) {
|
|
179
|
+
const questions = [...PERMISSION_CONFIRMATION_QUESTIONS];
|
|
180
|
+
if (!input.permission_json.builder) {
|
|
181
|
+
const idx = questions.findIndex(q => q.id === "QP5");
|
|
182
|
+
if (idx >= 0)
|
|
183
|
+
questions.splice(idx, 1);
|
|
184
|
+
}
|
|
185
|
+
if (input.skip_user_confirmation) {
|
|
186
|
+
return {
|
|
187
|
+
questions_asked: questions,
|
|
188
|
+
responses: questions.map(q => ({ question_id: q.id, response: "yes" })),
|
|
189
|
+
all_confirmed: true,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
questions_asked: questions,
|
|
194
|
+
responses: [],
|
|
195
|
+
all_confirmed: false,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function verifyEnvironment(input) {
|
|
199
|
+
const checks = [];
|
|
200
|
+
if (input.permission_json.object) {
|
|
201
|
+
checks.push({
|
|
202
|
+
name: "object_exists",
|
|
203
|
+
passed: true,
|
|
204
|
+
message: `Permission object ${input.permission_json.object} assumed to exist`,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
if (input.permission_json.builder || input.permission_json.um !== undefined) {
|
|
208
|
+
checks.push({
|
|
209
|
+
name: "signer_is_owner",
|
|
210
|
+
passed: true,
|
|
211
|
+
message: "Signer must be owner for transfer/um_set operations",
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
else if (input.permission_json.admin || input.permission_json.table || input.permission_json.remark) {
|
|
215
|
+
checks.push({
|
|
216
|
+
name: "signer_is_admin",
|
|
217
|
+
passed: true,
|
|
218
|
+
message: "Signer must be admin for table/remark/admin operations",
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
if (input.permission_json.apply && input.permission_json.apply.length > 0) {
|
|
222
|
+
checks.push({
|
|
223
|
+
name: "apply_targets_exist_and_owned",
|
|
224
|
+
passed: true,
|
|
225
|
+
message: `Signer must be owner of ${input.permission_json.apply.length} target object(s)`,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
const allPassed = checks.every(c => c.passed);
|
|
229
|
+
return { passed: allPassed, checks };
|
|
230
|
+
}
|
|
231
|
+
export const PERMISSION_CONFIRM_VERSION = "1.0.0";
|
|
232
|
+
export function runPermissionConfirmGate(input) {
|
|
233
|
+
const layersPassed = [];
|
|
234
|
+
const layersFailed = [];
|
|
235
|
+
const checklist = runStaticChecklist(input);
|
|
236
|
+
if (!checklist.all_passed) {
|
|
237
|
+
layersFailed.push("L1_checklist");
|
|
238
|
+
return {
|
|
239
|
+
status: "blocked_checklist",
|
|
240
|
+
checklist_result: checklist,
|
|
241
|
+
confirmation_text: generateConfirmationText(input, checklist),
|
|
242
|
+
block_reason: `Checklist failed: ${checklist.items.filter(i => !i.passed).map(i => i.id).join(", ")}`,
|
|
243
|
+
decision_record: {
|
|
244
|
+
timestamp: new Date().toISOString(),
|
|
245
|
+
gate_version: PERMISSION_CONFIRM_VERSION,
|
|
246
|
+
final_status: "blocked_checklist",
|
|
247
|
+
layers_passed: layersPassed,
|
|
248
|
+
layers_failed: layersFailed,
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
layersPassed.push("L1_checklist");
|
|
253
|
+
const assessment = adaptRiskAssessment(input, checklist);
|
|
254
|
+
const hasCritical = assessment.risks.some(r => r.level === "CRITICAL");
|
|
255
|
+
if (hasCritical) {
|
|
256
|
+
layersFailed.push("L2_risk");
|
|
257
|
+
return {
|
|
258
|
+
status: "blocked_risk",
|
|
259
|
+
checklist_result: checklist,
|
|
260
|
+
risk_result: assessment,
|
|
261
|
+
confirmation_text: generateConfirmationText(input, checklist, assessment),
|
|
262
|
+
block_reason: `CRITICAL risks: ${assessment.risks.filter(r => r.level === "CRITICAL").map(r => r.id).join(", ")}`,
|
|
263
|
+
decision_record: {
|
|
264
|
+
timestamp: new Date().toISOString(),
|
|
265
|
+
gate_version: PERMISSION_CONFIRM_VERSION,
|
|
266
|
+
final_status: "blocked_risk",
|
|
267
|
+
layers_passed: layersPassed,
|
|
268
|
+
layers_failed: layersFailed,
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
layersPassed.push("L2_risk");
|
|
273
|
+
const userConf = processUserConfirmation(input, assessment);
|
|
274
|
+
if (!userConf.all_confirmed) {
|
|
275
|
+
if (input.permission_json.builder) {
|
|
276
|
+
const cp11 = checklist.items.find(i => i.id === "C-P-11");
|
|
277
|
+
if (cp11) {
|
|
278
|
+
const qp5 = userConf.responses.find(r => r.question_id === "QP5");
|
|
279
|
+
cp11.passed = qp5?.response === "yes";
|
|
280
|
+
cp11.message = cp11.passed ? "" : "Transfer not confirmed by user";
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (!checklist.all_passed && input.permission_json.builder) {
|
|
284
|
+
const cp11 = checklist.items.find(i => i.id === "C-P-11");
|
|
285
|
+
if (cp11 && !cp11.passed) {
|
|
286
|
+
layersFailed.push("L3_user");
|
|
287
|
+
return {
|
|
288
|
+
status: "blocked_user",
|
|
289
|
+
checklist_result: checklist,
|
|
290
|
+
risk_result: assessment,
|
|
291
|
+
user_confirmation: userConf,
|
|
292
|
+
confirmation_text: generateConfirmationText(input, checklist, assessment),
|
|
293
|
+
block_reason: "User did not confirm ownership transfer",
|
|
294
|
+
decision_record: {
|
|
295
|
+
timestamp: new Date().toISOString(),
|
|
296
|
+
gate_version: PERMISSION_CONFIRM_VERSION,
|
|
297
|
+
final_status: "blocked_user",
|
|
298
|
+
layers_passed: layersPassed,
|
|
299
|
+
layers_failed: layersFailed,
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
layersPassed.push("L3_user");
|
|
306
|
+
if (input.skip_environment_check) {
|
|
307
|
+
layersPassed.push("L4_environment");
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
const env = verifyEnvironment(input);
|
|
311
|
+
if (!env.passed) {
|
|
312
|
+
layersFailed.push("L4_environment");
|
|
313
|
+
return {
|
|
314
|
+
status: "blocked_environment",
|
|
315
|
+
checklist_result: checklist,
|
|
316
|
+
risk_result: assessment,
|
|
317
|
+
user_confirmation: userConf,
|
|
318
|
+
environment_result: env,
|
|
319
|
+
confirmation_text: generateConfirmationText(input, checklist, assessment),
|
|
320
|
+
block_reason: `Environment check failed: ${env.checks.filter(c => !c.passed).map(c => c.name).join(", ")}`,
|
|
321
|
+
decision_record: {
|
|
322
|
+
timestamp: new Date().toISOString(),
|
|
323
|
+
gate_version: PERMISSION_CONFIRM_VERSION,
|
|
324
|
+
final_status: "blocked_environment",
|
|
325
|
+
layers_passed: layersPassed,
|
|
326
|
+
layers_failed: layersFailed,
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
layersPassed.push("L4_environment");
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
status: "approved",
|
|
334
|
+
checklist_result: checklist,
|
|
335
|
+
risk_result: assessment,
|
|
336
|
+
user_confirmation: userConf,
|
|
337
|
+
confirmation_text: generateConfirmationText(input, checklist, assessment),
|
|
338
|
+
decision_record: {
|
|
339
|
+
timestamp: new Date().toISOString(),
|
|
340
|
+
gate_version: PERMISSION_CONFIRM_VERSION,
|
|
341
|
+
final_status: "approved",
|
|
342
|
+
layers_passed: layersPassed,
|
|
343
|
+
layers_failed: layersFailed,
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function generateConfirmationText(input, checklist, assessment) {
|
|
348
|
+
const lines = [];
|
|
349
|
+
const data = input.permission_json;
|
|
350
|
+
lines.push("═══ Permission Confirmation ═══");
|
|
351
|
+
lines.push("");
|
|
352
|
+
if (data.object) {
|
|
353
|
+
lines.push(`Permission: ${data.object}`);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
lines.push("Permission: NEW (to be created)");
|
|
357
|
+
}
|
|
358
|
+
if (data.description)
|
|
359
|
+
lines.push(`Description: ${data.description}`);
|
|
360
|
+
lines.push("");
|
|
361
|
+
lines.push("─ Checklist ──────────────────");
|
|
362
|
+
for (const item of checklist.items) {
|
|
363
|
+
const mark = item.passed ? "✓" : "✗";
|
|
364
|
+
lines.push(` ${mark} ${item.id}: ${item.description}${item.message ? " — " + item.message : ""}`);
|
|
365
|
+
}
|
|
366
|
+
lines.push("");
|
|
367
|
+
if (assessment) {
|
|
368
|
+
lines.push("─ Risk Assessment ──────────────────");
|
|
369
|
+
lines.push(`Overall: ${assessment.overall_risk}`);
|
|
370
|
+
lines.push(`Detected: ${assessment.risks.length} risk(s)`);
|
|
371
|
+
for (const r of assessment.risks) {
|
|
372
|
+
lines.push(` [${r.level}] ${r.id}: ${r.title}`);
|
|
373
|
+
}
|
|
374
|
+
lines.push("");
|
|
375
|
+
}
|
|
376
|
+
lines.push("─ Operations ──────────────────");
|
|
377
|
+
if (data.admin)
|
|
378
|
+
lines.push(`- Admin ${data.admin.op}: ${data.admin.addresses.length} address(es)`);
|
|
379
|
+
if (data.table)
|
|
380
|
+
lines.push(`- Table op: ${data.table.op}`);
|
|
381
|
+
if (data.entity)
|
|
382
|
+
lines.push(`- Entity op: ${data.entity.op}`);
|
|
383
|
+
if (data.remark)
|
|
384
|
+
lines.push(`- Remark op: ${data.remark.op}`);
|
|
385
|
+
if (data.apply)
|
|
386
|
+
lines.push(`- Apply to: ${data.apply.length} object(s)`);
|
|
387
|
+
if (data.builder)
|
|
388
|
+
lines.push(`- ⚠️ TRANSFER to: ${data.builder}`);
|
|
389
|
+
if (data.um !== undefined)
|
|
390
|
+
lines.push(`- UM: ${data.um ?? "(revoke)"}`);
|
|
391
|
+
lines.push("");
|
|
392
|
+
return lines.join("\n");
|
|
393
|
+
}
|
|
394
|
+
export function progressivePermissionCheck(input) {
|
|
395
|
+
const checklist = runStaticChecklist(input);
|
|
396
|
+
if (!checklist.all_passed) {
|
|
397
|
+
return {
|
|
398
|
+
stage: "checklist",
|
|
399
|
+
status: "fail",
|
|
400
|
+
message: `Checklist failed: ${checklist.items.filter(i => !i.passed).map(i => i.id).join(", ")}`,
|
|
401
|
+
next_action: "Fix failing checklist items",
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
const assessment = adaptRiskAssessment(input, checklist);
|
|
405
|
+
if (assessment.risks.some(r => r.level === "CRITICAL")) {
|
|
406
|
+
return {
|
|
407
|
+
stage: "risk",
|
|
408
|
+
status: "fail",
|
|
409
|
+
message: `CRITICAL risks: ${assessment.risks.filter(r => r.level === "CRITICAL").map(r => r.id).join(", ")}`,
|
|
410
|
+
next_action: "Resolve CRITICAL risks before proceeding",
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
if (assessment.needs_human_review) {
|
|
414
|
+
return {
|
|
415
|
+
stage: "confirmation",
|
|
416
|
+
status: "pending",
|
|
417
|
+
message: "Human review required for HIGH risks",
|
|
418
|
+
next_action: "Confirm risk acceptance",
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
return {
|
|
422
|
+
stage: "complete",
|
|
423
|
+
status: "pass",
|
|
424
|
+
message: "All checks passed",
|
|
425
|
+
};
|
|
426
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type PermissionScene, type BuiltinPermissionEntry } from "./permission-ledger.js";
|
|
2
|
+
import { type PermissionTemplate } from "./permission-templates.js";
|
|
3
|
+
import { type SemanticToSchemaRule } from "./permission-translation.js";
|
|
4
|
+
import { type RiskRule, type PermissionRiskAssessment, type PermissionStakeholder } from "./permission-risk.js";
|
|
5
|
+
import { type PermissionPuzzle, type PuzzleCompleteness } from "./permission-puzzle.js";
|
|
6
|
+
import { PERMISSION_PUBLISH_CHECKLIST, PERMISSION_CONFIRMATION_QUESTIONS, type PermissionJsonForConfirm } from "./permission-confirm.js";
|
|
7
|
+
export declare const PERMISSION_CONTEXT_VERSION = "1.0.0";
|
|
8
|
+
export type PermissionInjectionMode = "initial_design" | "mid_design_review" | "pre_publish" | "post_publish_modify" | "stakeholder_review" | "apply_check";
|
|
9
|
+
export type PermissionStakeholderPerspective = PermissionStakeholder | "system";
|
|
10
|
+
export interface PermissionContextBundle {
|
|
11
|
+
version: string;
|
|
12
|
+
mode: PermissionInjectionMode;
|
|
13
|
+
stakeholder_perspective?: PermissionStakeholderPerspective;
|
|
14
|
+
matched_scene?: PermissionScene;
|
|
15
|
+
matched_template?: PermissionTemplate;
|
|
16
|
+
matched_pattern?: SemanticToSchemaRule;
|
|
17
|
+
puzzle_state?: PermissionPuzzle;
|
|
18
|
+
puzzle_completeness?: PuzzleCompleteness;
|
|
19
|
+
relevant_risks: RiskRule[];
|
|
20
|
+
risk_assessment?: PermissionRiskAssessment;
|
|
21
|
+
relevant_checklist: typeof PERMISSION_PUBLISH_CHECKLIST;
|
|
22
|
+
relevant_questions: typeof PERMISSION_CONFIRMATION_QUESTIONS;
|
|
23
|
+
relevant_builtin_permissions: BuiltinPermissionEntry[];
|
|
24
|
+
cross_object_refs: PermissionCrossObjectRef[];
|
|
25
|
+
onchain_constraints: PermissionOnchainConstraint[];
|
|
26
|
+
rendering_hints: PermissionRenderingHints;
|
|
27
|
+
}
|
|
28
|
+
export interface PermissionCrossObjectRef {
|
|
29
|
+
object: "Service" | "Machine" | "Treasury" | "Arbitration" | "Repository" | "Reward" | "Progress" | "Demand" | "Contact" | "Allocation";
|
|
30
|
+
field: string;
|
|
31
|
+
scene_id: string;
|
|
32
|
+
description: string;
|
|
33
|
+
}
|
|
34
|
+
export interface PermissionOnchainConstraint {
|
|
35
|
+
name: string;
|
|
36
|
+
value: string | number;
|
|
37
|
+
description: string;
|
|
38
|
+
}
|
|
39
|
+
export interface PermissionRenderingHints {
|
|
40
|
+
include_puzzle_template: boolean;
|
|
41
|
+
include_risk_details: boolean;
|
|
42
|
+
include_questions: boolean;
|
|
43
|
+
include_immutability_warning: boolean;
|
|
44
|
+
include_transfer_warning: boolean;
|
|
45
|
+
max_length: number;
|
|
46
|
+
}
|
|
47
|
+
export interface BuildPermissionContextInput {
|
|
48
|
+
mode: PermissionInjectionMode;
|
|
49
|
+
intent?: string;
|
|
50
|
+
permission_json?: PermissionJsonForConfirm;
|
|
51
|
+
stakeholder?: PermissionStakeholderPerspective;
|
|
52
|
+
target_host_object?: PermissionScene["host_object"];
|
|
53
|
+
target_permission_index?: number;
|
|
54
|
+
max_length?: number;
|
|
55
|
+
}
|
|
56
|
+
export declare function buildPermissionContext(input: BuildPermissionContextInput): PermissionContextBundle;
|
|
57
|
+
export declare function buildPromptFromPermissionContext(bundle: PermissionContextBundle): string;
|
|
58
|
+
export declare function getPermissionContextSummary(bundle: PermissionContextBundle): string;
|