@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,452 @@
|
|
|
1
|
+
import { MAX_NAMED_OPERATOR_COUNT, MAX_NAMED_OPERATOR_ADDRESS_COUNT, MAX_CONTEXT_REPOSITORY_COUNT, } from "@wowok/wowok";
|
|
2
|
+
import { PROGRESS_PERMISSIONS, PROGRESS_LEDGER_VERSION, PROGRESS_CROSS_OBJECT_REFS, inferSceneFromIntent, getScenesByIndustry, getScenesByPhase, getAllBuiltinPermissions, getProgressScenesCount, validateNamedOperatorAddressList, validateNamedOperatorCount, validateContextRepositoryCount, } from "./progress-ledger.js";
|
|
3
|
+
import { initPuzzleFromIntent, checkPuzzleCompleteness, } from "./progress-puzzle.js";
|
|
4
|
+
import { PROGRESS_RISK_VERSION, assessProgressRisks, getAllProgressRiskRules, getProgressRiskRulesCount, } from "./progress-risk.js";
|
|
5
|
+
import { PROGRESS_TRANSLATION_VERSION, PROGRESS_SEMANTIC_TO_SCHEMA_RULES, PROGRESS_SCHEMA_TO_SEMANTIC_RULES, PROGRESS_CONSTRAINT_RULES, matchSemanticPattern, } from "./progress-translation.js";
|
|
6
|
+
import { PROGRESS_TEMPLATES, PROGRESS_TEMPLATES_VERSION, getProgressTemplatesByScene, listProgressTemplates, } from "./progress-templates.js";
|
|
7
|
+
import { PROGRESS_CONFIRM_VERSION, PROGRESS_OPERATION_CHECKLIST, PROGRESS_CONFIRMATION_QUESTIONS, } from "./progress-confirm.js";
|
|
8
|
+
export const PROGRESS_CONTEXT_VERSION = "1.0.0";
|
|
9
|
+
export function buildProgressContext(input) {
|
|
10
|
+
const max_length = input.max_length ?? 4000;
|
|
11
|
+
let matched_scene;
|
|
12
|
+
if (input.intent) {
|
|
13
|
+
matched_scene = inferSceneFromIntent(input.intent);
|
|
14
|
+
}
|
|
15
|
+
if (!matched_scene && input.target_phase) {
|
|
16
|
+
const phaseScenes = getScenesByPhase(input.target_phase);
|
|
17
|
+
if (phaseScenes.length > 0)
|
|
18
|
+
matched_scene = phaseScenes[0];
|
|
19
|
+
}
|
|
20
|
+
if (!matched_scene && input.target_industry) {
|
|
21
|
+
const industryScenes = getScenesByIndustry(input.target_industry);
|
|
22
|
+
if (industryScenes.length > 0)
|
|
23
|
+
matched_scene = industryScenes[0];
|
|
24
|
+
}
|
|
25
|
+
let matched_template;
|
|
26
|
+
if (matched_scene) {
|
|
27
|
+
const templates = getProgressTemplatesByScene(matched_scene.id);
|
|
28
|
+
if (templates.length > 0)
|
|
29
|
+
matched_template = templates[0];
|
|
30
|
+
}
|
|
31
|
+
let matched_pattern;
|
|
32
|
+
if (input.intent) {
|
|
33
|
+
const patterns = matchSemanticPattern(input.intent);
|
|
34
|
+
if (patterns.length > 0)
|
|
35
|
+
matched_pattern = patterns[0];
|
|
36
|
+
}
|
|
37
|
+
let puzzle_state;
|
|
38
|
+
let puzzle_completeness;
|
|
39
|
+
if (input.mode === "initial_design" && input.intent) {
|
|
40
|
+
puzzle_state = initPuzzleFromIntent({ rule_sentence: input.intent });
|
|
41
|
+
puzzle_completeness = checkPuzzleCompleteness(puzzle_state);
|
|
42
|
+
}
|
|
43
|
+
const relevant_risks = filterRiskRules(input.mode, input.stakeholder, matched_scene);
|
|
44
|
+
let risk_assessment;
|
|
45
|
+
if (input.mode === "pre_advance" && input.progress_json) {
|
|
46
|
+
const ctx = {
|
|
47
|
+
object: input.progress_json.object,
|
|
48
|
+
task: input.progress_json.task,
|
|
49
|
+
repository: input.progress_json.repository,
|
|
50
|
+
progress_namedOperator: input.progress_json.progress_namedOperator,
|
|
51
|
+
operate: input.progress_json.operate,
|
|
52
|
+
current_machine: input.current_machine,
|
|
53
|
+
machine_published: input.machine_published,
|
|
54
|
+
current_task: input.current_task,
|
|
55
|
+
current_named_operator_count: input.current_named_operator_count,
|
|
56
|
+
current_context_repository_count: input.current_context_repository_count,
|
|
57
|
+
current_node: input.current_node,
|
|
58
|
+
forward_already_accomplished: input.forward_already_accomplished,
|
|
59
|
+
holder_address: input.holder_address,
|
|
60
|
+
signer: input.signer,
|
|
61
|
+
forward_named_operator: input.forward_named_operator,
|
|
62
|
+
forward_permission_index: input.forward_permission_index,
|
|
63
|
+
forward_has_guard: input.forward_has_guard,
|
|
64
|
+
target_objects_types: input.target_objects_types,
|
|
65
|
+
};
|
|
66
|
+
risk_assessment = assessProgressRisks(ctx);
|
|
67
|
+
}
|
|
68
|
+
const relevant_checklist = filterChecklist(input.mode);
|
|
69
|
+
const relevant_questions = filterQuestions(input.mode);
|
|
70
|
+
const relevant_builtin_permissions = matched_scene
|
|
71
|
+
? matched_scene.builtin_indexes_consumed
|
|
72
|
+
: getAllBuiltinPermissions();
|
|
73
|
+
const cross_object_refs = buildCrossObjectRefs(input.target_phase, matched_scene);
|
|
74
|
+
const onchain_constraints = buildOnchainConstraints();
|
|
75
|
+
const rendering_hints = buildRenderingHints(input.mode, max_length, input.progress_json?.operate?.op === "adminUnhold", !!input.progress_json?.task);
|
|
76
|
+
return {
|
|
77
|
+
version: PROGRESS_CONTEXT_VERSION,
|
|
78
|
+
mode: input.mode,
|
|
79
|
+
stakeholder_perspective: input.stakeholder,
|
|
80
|
+
matched_scene,
|
|
81
|
+
matched_template,
|
|
82
|
+
matched_pattern,
|
|
83
|
+
puzzle_state,
|
|
84
|
+
puzzle_completeness,
|
|
85
|
+
relevant_risks,
|
|
86
|
+
risk_assessment,
|
|
87
|
+
relevant_checklist,
|
|
88
|
+
relevant_questions,
|
|
89
|
+
relevant_builtin_permissions,
|
|
90
|
+
cross_object_refs,
|
|
91
|
+
onchain_constraints,
|
|
92
|
+
rendering_hints,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function filterRiskRules(mode, stakeholder, scene) {
|
|
96
|
+
const allRules = getAllProgressRiskRules();
|
|
97
|
+
if (mode === "initial_design") {
|
|
98
|
+
return allRules.filter(r => r.category === "structural" || r.category === "lifecycle");
|
|
99
|
+
}
|
|
100
|
+
if (mode === "pre_advance") {
|
|
101
|
+
return allRules;
|
|
102
|
+
}
|
|
103
|
+
if (mode === "post_task_binding") {
|
|
104
|
+
return allRules.filter(r => r.id !== "R-PR-2-01");
|
|
105
|
+
}
|
|
106
|
+
if (mode === "stakeholder_review" && stakeholder) {
|
|
107
|
+
if (stakeholder === "owner") {
|
|
108
|
+
return allRules.filter(r => r.category === "permission" || r.category === "lifecycle" || r.category === "cross_object");
|
|
109
|
+
}
|
|
110
|
+
if (stakeholder === "named_operator") {
|
|
111
|
+
return allRules.filter(r => r.category === "permission" || r.id === "R-PR-4-02" || r.id === "R-PR-4-03");
|
|
112
|
+
}
|
|
113
|
+
if (stakeholder === "submitter") {
|
|
114
|
+
return allRules.filter(r => r.category === "semantic" || r.id === "R-PR-3-03" || r.id === "R-PR-4-02" || r.id === "R-PR-4-03");
|
|
115
|
+
}
|
|
116
|
+
if (stakeholder === "system") {
|
|
117
|
+
return allRules.filter(r => r.category === "cross_object" || r.category === "structural");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (mode === "apply_check") {
|
|
121
|
+
return allRules.filter(r => r.category === "cross_object" || r.id === "R-PR-4-01");
|
|
122
|
+
}
|
|
123
|
+
return allRules;
|
|
124
|
+
}
|
|
125
|
+
function filterChecklist(mode) {
|
|
126
|
+
if (mode === "initial_design") {
|
|
127
|
+
return PROGRESS_OPERATION_CHECKLIST.filter(i => ["C-PR-01", "C-PR-03", "C-PR-04", "C-PR-05"].includes(i.id));
|
|
128
|
+
}
|
|
129
|
+
if (mode === "post_task_binding") {
|
|
130
|
+
return PROGRESS_OPERATION_CHECKLIST.filter(i => i.id !== "C-PR-06");
|
|
131
|
+
}
|
|
132
|
+
if (mode === "stakeholder_review") {
|
|
133
|
+
return PROGRESS_OPERATION_CHECKLIST.filter(i => ["C-PR-01", "C-PR-02", "C-PR-07", "C-PR-09", "C-PR-10"].includes(i.id));
|
|
134
|
+
}
|
|
135
|
+
return PROGRESS_OPERATION_CHECKLIST;
|
|
136
|
+
}
|
|
137
|
+
function filterQuestions(mode) {
|
|
138
|
+
if (mode === "pre_advance") {
|
|
139
|
+
return PROGRESS_CONFIRMATION_QUESTIONS;
|
|
140
|
+
}
|
|
141
|
+
if (mode === "post_task_binding") {
|
|
142
|
+
return PROGRESS_CONFIRMATION_QUESTIONS.filter(q => q.id !== "QPR2");
|
|
143
|
+
}
|
|
144
|
+
if (mode === "initial_design") {
|
|
145
|
+
return PROGRESS_CONFIRMATION_QUESTIONS.filter(q => q.id === "QPR5");
|
|
146
|
+
}
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
function buildCrossObjectRefs(targetPhase, scene) {
|
|
150
|
+
const refs = PROGRESS_CROSS_OBJECT_REFS.map(r => ({
|
|
151
|
+
object: r.object,
|
|
152
|
+
phase: r.phase,
|
|
153
|
+
relationship: r.relationship,
|
|
154
|
+
description: r.relationship,
|
|
155
|
+
}));
|
|
156
|
+
if (targetPhase) {
|
|
157
|
+
return refs.filter(r => r.phase === targetPhase || r.phase === "universal");
|
|
158
|
+
}
|
|
159
|
+
if (scene) {
|
|
160
|
+
const scenePhases = scene.phases;
|
|
161
|
+
return refs.filter(r => r.phase === "universal" || scenePhases.includes(r.phase));
|
|
162
|
+
}
|
|
163
|
+
return refs;
|
|
164
|
+
}
|
|
165
|
+
function buildOnchainConstraints() {
|
|
166
|
+
return [
|
|
167
|
+
{
|
|
168
|
+
name: "MAX_NAMED_OPERATOR_COUNT",
|
|
169
|
+
value: MAX_NAMED_OPERATOR_COUNT,
|
|
170
|
+
description: "Maximum named_operator namespace entries per Progress",
|
|
171
|
+
error_code: "E_MAX_NAMED_OPERATOR_COUNT",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "MAX_NAMED_OPERATOR_ADDRESS_COUNT",
|
|
175
|
+
value: MAX_NAMED_OPERATOR_ADDRESS_COUNT,
|
|
176
|
+
description: "Maximum addresses per named_operator namespace entry",
|
|
177
|
+
error_code: "E_MAX_NAMED_OPERATOR_ADDRESS_COUNT",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "MAX_CONTEXT_REPOSITORY_COUNT",
|
|
181
|
+
value: MAX_CONTEXT_REPOSITORY_COUNT,
|
|
182
|
+
description: "Maximum context_repositories per Progress",
|
|
183
|
+
error_code: "E_MAX_CONTEXT_REPOSITORY_COUNT",
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "PROGRESS_NEW (220)",
|
|
187
|
+
value: 220,
|
|
188
|
+
description: "Builtin: create new Progress (asserted by progress::new / new_with_passport; bypassed by service::buy → new_imp)",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "PROGRESS_NAMED_OPERATOR (221)",
|
|
192
|
+
value: 221,
|
|
193
|
+
description: "Builtin: manage named_operator namespace (add/set/remove)",
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "PROGRESS_TASK (222)",
|
|
197
|
+
value: 222,
|
|
198
|
+
description: "Builtin: submit task (one-time, immutable — E_TASK_ALREADY_SET)",
|
|
199
|
+
error_code: "E_TASK_ALREADY_SET",
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "PROGRESS_CONTEXT_REPOSITORY (223)",
|
|
203
|
+
value: 223,
|
|
204
|
+
description: "Builtin: bind/unbind context Repository (≤ 30)",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "PROGRESS_UNHOLD (224)",
|
|
208
|
+
value: 224,
|
|
209
|
+
description: "Builtin: adminUnhold (force release, bypasses holder check)",
|
|
210
|
+
error_code: "E_NOT_THE_HOLDER",
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "PROGRESS_OWNER_RECEIVE (225)",
|
|
214
|
+
value: 225,
|
|
215
|
+
description: "Builtin: owner receive (unwrap Receiving<K> / CoinWrapper<T> at terminal node)",
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "E_MACHINE_NOT_MATCH",
|
|
219
|
+
value: 4,
|
|
220
|
+
description: "Move error: progress.machine ≠ machine.id_address (every op asserts this)",
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "E_FORWARD_ALREADY_ACCOMPLISHED",
|
|
224
|
+
value: 7,
|
|
225
|
+
description: "Move error: re-hold on completed forward is blocked",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: "E_NEED_PASSPORT",
|
|
229
|
+
value: 9,
|
|
230
|
+
description: "Move error: Forward.guard is Some but plain next() called — use *_with_passport variant",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: "E_ORDER_NOT_MATCH",
|
|
234
|
+
value: 10,
|
|
235
|
+
description: "Move error: order_next/order_hold called but progress.task ≠ order address",
|
|
236
|
+
},
|
|
237
|
+
];
|
|
238
|
+
}
|
|
239
|
+
function buildRenderingHints(mode, max_length, hasAdminUnhold, hasTaskSet) {
|
|
240
|
+
return {
|
|
241
|
+
include_puzzle_template: mode === "initial_design",
|
|
242
|
+
include_risk_details: mode === "pre_advance" || mode === "stakeholder_review",
|
|
243
|
+
include_questions: mode === "pre_advance",
|
|
244
|
+
include_immutability_warning: hasTaskSet || mode === "post_task_binding",
|
|
245
|
+
include_admin_unhold_warning: hasAdminUnhold,
|
|
246
|
+
include_cross_object_refs: mode === "apply_check" || mode === "initial_design",
|
|
247
|
+
include_terminal_node_note: mode === "post_task_binding" || mode === "pre_advance",
|
|
248
|
+
max_length,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
export function buildPromptFromProgressContext(bundle) {
|
|
252
|
+
const lines = [];
|
|
253
|
+
const h = bundle.rendering_hints;
|
|
254
|
+
lines.push(`═══ Progress Context (mode: ${bundle.mode}) ═══`);
|
|
255
|
+
lines.push("");
|
|
256
|
+
if (bundle.stakeholder_perspective) {
|
|
257
|
+
lines.push(`Stakeholder perspective: ${bundle.stakeholder_perspective}`);
|
|
258
|
+
lines.push("");
|
|
259
|
+
}
|
|
260
|
+
if (bundle.matched_scene) {
|
|
261
|
+
lines.push(`Scene: ${bundle.matched_scene.name}`);
|
|
262
|
+
lines.push(`Phases: ${bundle.matched_scene.phases.join(", ")}`);
|
|
263
|
+
lines.push(`Requires published Machine: ${bundle.matched_scene.requires_published_machine ? "YES" : "NO"}`);
|
|
264
|
+
lines.push(`Requires Order bound: ${bundle.matched_scene.requires_order_bound ? "YES" : "NO"}`);
|
|
265
|
+
lines.push(`Uses hold mechanism: ${bundle.matched_scene.uses_hold_mechanism ? "YES" : "NO"}`);
|
|
266
|
+
lines.push(`Uses adminUnhold: ${bundle.matched_scene.uses_admin_unhold ? "YES" : "NO"}`);
|
|
267
|
+
lines.push("");
|
|
268
|
+
}
|
|
269
|
+
if (bundle.matched_template) {
|
|
270
|
+
lines.push(`Suggested template: ${bundle.matched_template.id} — ${bundle.matched_template.name}`);
|
|
271
|
+
lines.push("");
|
|
272
|
+
}
|
|
273
|
+
if (bundle.matched_pattern) {
|
|
274
|
+
lines.push(`Matched pattern: ${bundle.matched_pattern.id} — ${bundle.matched_pattern.pattern_name}`);
|
|
275
|
+
lines.push(`Intent: ${bundle.matched_pattern.semantic_intent}`);
|
|
276
|
+
lines.push("");
|
|
277
|
+
}
|
|
278
|
+
if (h.include_puzzle_template && bundle.puzzle_completeness) {
|
|
279
|
+
const c = bundle.puzzle_completeness;
|
|
280
|
+
lines.push("─ Puzzle Completeness ──────────────");
|
|
281
|
+
lines.push(`Complete: ${c.complete ? "YES" : "NO"}`);
|
|
282
|
+
if (c.missing.length > 0) {
|
|
283
|
+
lines.push(`Missing dimensions: ${c.missing.join(", ")}`);
|
|
284
|
+
for (const md of c.missing_details) {
|
|
285
|
+
lines.push(` - ${md.dimension}: ${md.reason}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
lines.push(`Next: ${c.next_step}`);
|
|
289
|
+
lines.push("");
|
|
290
|
+
}
|
|
291
|
+
if (h.include_risk_details && bundle.relevant_risks.length > 0) {
|
|
292
|
+
lines.push(`─ Relevant Risk Rules (${bundle.relevant_risks.length}) ──────────────`);
|
|
293
|
+
for (const r of bundle.relevant_risks.slice(0, 6)) {
|
|
294
|
+
lines.push(` ${r.id} [${r.category}] — ${r.trigger}`);
|
|
295
|
+
}
|
|
296
|
+
if (bundle.relevant_risks.length > 6) {
|
|
297
|
+
lines.push(` ... and ${bundle.relevant_risks.length - 6} more`);
|
|
298
|
+
}
|
|
299
|
+
lines.push("");
|
|
300
|
+
}
|
|
301
|
+
if (bundle.risk_assessment) {
|
|
302
|
+
lines.push("─ Risk Assessment ──────────────");
|
|
303
|
+
lines.push(`Overall: ${bundle.risk_assessment.overall_risk}`);
|
|
304
|
+
lines.push(`Detected: ${bundle.risk_assessment.risks.length} risk(s)`);
|
|
305
|
+
if (bundle.risk_assessment.needs_human_review) {
|
|
306
|
+
lines.push("⚠️ Needs human review (HIGH/CRITICAL risks present)");
|
|
307
|
+
}
|
|
308
|
+
lines.push("");
|
|
309
|
+
}
|
|
310
|
+
if (bundle.relevant_builtin_permissions.length > 0) {
|
|
311
|
+
lines.push(`─ Builtin Permissions (${bundle.relevant_builtin_permissions.length}) ──────────────`);
|
|
312
|
+
for (const p of bundle.relevant_builtin_permissions) {
|
|
313
|
+
lines.push(` [${p.index}] ${p.name}: ${p.description}`);
|
|
314
|
+
}
|
|
315
|
+
lines.push("");
|
|
316
|
+
}
|
|
317
|
+
if (h.include_immutability_warning) {
|
|
318
|
+
lines.push("⚠️ TASK IMMUTABILITY: task_set is ONE-TIME. E_TASK_ALREADY_SET blocks any re-assignment.");
|
|
319
|
+
lines.push(" Once Progress.task is bound to an Order/Reward, it cannot be changed.");
|
|
320
|
+
lines.push("");
|
|
321
|
+
}
|
|
322
|
+
if (h.include_admin_unhold_warning) {
|
|
323
|
+
lines.push("⚠️ ADMINUNHOLD (224): Force-release bypasses holder check.");
|
|
324
|
+
lines.push(" Grant 224 only to dedicated recovery addresses; log every invocation.");
|
|
325
|
+
lines.push("");
|
|
326
|
+
}
|
|
327
|
+
if (h.include_cross_object_refs && bundle.cross_object_refs.length > 0) {
|
|
328
|
+
lines.push(`─ Cross-Object References (${bundle.cross_object_refs.length}) ──────────────`);
|
|
329
|
+
for (const ref of bundle.cross_object_refs.slice(0, 8)) {
|
|
330
|
+
lines.push(` ${ref.object} [${ref.phase}]: ${ref.relationship}`);
|
|
331
|
+
}
|
|
332
|
+
if (bundle.cross_object_refs.length > 8) {
|
|
333
|
+
lines.push(` ... and ${bundle.cross_object_refs.length - 8} more`);
|
|
334
|
+
}
|
|
335
|
+
lines.push("");
|
|
336
|
+
}
|
|
337
|
+
if (h.include_terminal_node_note) {
|
|
338
|
+
lines.push("─ Terminal Node Note ──────────────");
|
|
339
|
+
lines.push("At terminal nodes (completed/enforced/deposit_refunded/paid), use progress::owner_receive");
|
|
340
|
+
lines.push("to unwrap Receiving<K> / CoinWrapper<T> via Payment.unwrap_with_check.");
|
|
341
|
+
lines.push("Permission 225 (PROGRESS_OWNER_RECEIVE) required; recipient = Machine.permission owner.");
|
|
342
|
+
lines.push("");
|
|
343
|
+
}
|
|
344
|
+
if (bundle.onchain_constraints.length > 0) {
|
|
345
|
+
lines.push("─ On-chain Constraints ──────────────");
|
|
346
|
+
for (const c of bundle.onchain_constraints) {
|
|
347
|
+
const errPart = c.error_code ? ` (abort: ${c.error_code})` : "";
|
|
348
|
+
lines.push(` ${c.name} = ${c.value} — ${c.description}${errPart}`);
|
|
349
|
+
}
|
|
350
|
+
lines.push("");
|
|
351
|
+
}
|
|
352
|
+
return lines.join("\n");
|
|
353
|
+
}
|
|
354
|
+
export function getProgressContextSummary(bundle) {
|
|
355
|
+
const parts = [
|
|
356
|
+
`mode=${bundle.mode}`,
|
|
357
|
+
`scene=${bundle.matched_scene?.id ?? "none"}`,
|
|
358
|
+
`risks=${bundle.relevant_risks.length}`,
|
|
359
|
+
`permissions=${bundle.relevant_builtin_permissions.length}`,
|
|
360
|
+
`cross_refs=${bundle.cross_object_refs.length}`,
|
|
361
|
+
];
|
|
362
|
+
if (bundle.stakeholder_perspective)
|
|
363
|
+
parts.push(`stakeholder=${bundle.stakeholder_perspective}`);
|
|
364
|
+
if (bundle.risk_assessment)
|
|
365
|
+
parts.push(`overall_risk=${bundle.risk_assessment.overall_risk}`);
|
|
366
|
+
if (bundle.matched_template)
|
|
367
|
+
parts.push(`template=${bundle.matched_template.id}`);
|
|
368
|
+
if (bundle.matched_pattern)
|
|
369
|
+
parts.push(`pattern=${bundle.matched_pattern.id}`);
|
|
370
|
+
return parts.join(", ");
|
|
371
|
+
}
|
|
372
|
+
export function buildStakeholderContext(stakeholder, intent, progress_json) {
|
|
373
|
+
return buildProgressContext({
|
|
374
|
+
mode: "stakeholder_review",
|
|
375
|
+
intent,
|
|
376
|
+
progress_json,
|
|
377
|
+
stakeholder,
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
export function quickValidateProgressJson(progress_json, current_state = {}) {
|
|
381
|
+
const violations = [];
|
|
382
|
+
if (progress_json.progress_namedOperator) {
|
|
383
|
+
const check = validateNamedOperatorAddressList(progress_json.progress_namedOperator.operators);
|
|
384
|
+
if (!check.ok)
|
|
385
|
+
violations.push(...check.violations);
|
|
386
|
+
if ((progress_json.progress_namedOperator.op === "add" ||
|
|
387
|
+
progress_json.progress_namedOperator.op === "set") &&
|
|
388
|
+
current_state.current_named_operator_count !== undefined) {
|
|
389
|
+
const countCheck = validateNamedOperatorCount(current_state.current_named_operator_count);
|
|
390
|
+
if (!countCheck.ok)
|
|
391
|
+
violations.push(countCheck.violation);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (progress_json.repository &&
|
|
395
|
+
(progress_json.repository.op === "add" || progress_json.repository.op === "set")) {
|
|
396
|
+
const addCount = progress_json.repository.objects.length;
|
|
397
|
+
const current = current_state.current_context_repository_count ?? 0;
|
|
398
|
+
const repoCheck = validateContextRepositoryCount(current, addCount);
|
|
399
|
+
if (!repoCheck.ok)
|
|
400
|
+
violations.push(repoCheck.violation);
|
|
401
|
+
}
|
|
402
|
+
if (progress_json.task && current_state.current_task) {
|
|
403
|
+
violations.push(`task already set to ${current_state.current_task} — E_TASK_ALREADY_SET will abort`);
|
|
404
|
+
}
|
|
405
|
+
if (current_state.machine_published === false) {
|
|
406
|
+
violations.push("Machine not published — Progress requires published Machine");
|
|
407
|
+
}
|
|
408
|
+
return { ok: violations.length === 0, violations };
|
|
409
|
+
}
|
|
410
|
+
export function getProgressKnowledgeSnapshot() {
|
|
411
|
+
return {
|
|
412
|
+
version: {
|
|
413
|
+
ledger: PROGRESS_LEDGER_VERSION,
|
|
414
|
+
puzzle: "1.0.0",
|
|
415
|
+
risk: PROGRESS_RISK_VERSION,
|
|
416
|
+
translation: PROGRESS_TRANSLATION_VERSION,
|
|
417
|
+
templates: PROGRESS_TEMPLATES_VERSION,
|
|
418
|
+
confirm: PROGRESS_CONFIRM_VERSION,
|
|
419
|
+
context: PROGRESS_CONTEXT_VERSION,
|
|
420
|
+
},
|
|
421
|
+
scenes_count: getProgressScenesCount(),
|
|
422
|
+
builtin_permissions_count: PROGRESS_PERMISSIONS.length,
|
|
423
|
+
builtin_permissions: PROGRESS_PERMISSIONS.map(p => ({
|
|
424
|
+
index: p.index,
|
|
425
|
+
name: p.name,
|
|
426
|
+
sdk_exposed: p.sdk_exposed,
|
|
427
|
+
})),
|
|
428
|
+
templates_count: PROGRESS_TEMPLATES.length,
|
|
429
|
+
templates: listProgressTemplates(),
|
|
430
|
+
semantic_patterns_count: PROGRESS_SEMANTIC_TO_SCHEMA_RULES.length,
|
|
431
|
+
schema_rules_count: PROGRESS_SCHEMA_TO_SEMANTIC_RULES.length,
|
|
432
|
+
constraint_rules_count: PROGRESS_CONSTRAINT_RULES.length,
|
|
433
|
+
risk_rules_count: getProgressRiskRulesCount(),
|
|
434
|
+
checklist_count: PROGRESS_OPERATION_CHECKLIST.length,
|
|
435
|
+
confirmation_questions_count: PROGRESS_CONFIRMATION_QUESTIONS.length,
|
|
436
|
+
cross_object_refs_count: PROGRESS_CROSS_OBJECT_REFS.length,
|
|
437
|
+
onchain_limits: {
|
|
438
|
+
max_named_operator_count: MAX_NAMED_OPERATOR_COUNT,
|
|
439
|
+
max_named_operator_address_count: MAX_NAMED_OPERATOR_ADDRESS_COUNT,
|
|
440
|
+
max_context_repository_count: MAX_CONTEXT_REPOSITORY_COUNT,
|
|
441
|
+
},
|
|
442
|
+
injection_modes: [
|
|
443
|
+
"initial_design",
|
|
444
|
+
"mid_progress_review",
|
|
445
|
+
"pre_advance",
|
|
446
|
+
"post_task_binding",
|
|
447
|
+
"stakeholder_review",
|
|
448
|
+
"apply_check",
|
|
449
|
+
],
|
|
450
|
+
stakeholders: ["owner", "named_operator", "submitter", "system"],
|
|
451
|
+
};
|
|
452
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { MAX_NAMED_OPERATOR_COUNT, MAX_NAMED_OPERATOR_ADDRESS_COUNT, MAX_CONTEXT_REPOSITORY_COUNT } from "@wowok/wowok";
|
|
2
|
+
export { MAX_NAMED_OPERATOR_COUNT, MAX_NAMED_OPERATOR_ADDRESS_COUNT, MAX_CONTEXT_REPOSITORY_COUNT, };
|
|
3
|
+
export type ProgressPhase = "creation" | "task_binding" | "named_operator_mgmt" | "context_binding" | "forward_advance" | "hold_state" | "unhold_state" | "owner_receive" | "completed";
|
|
4
|
+
export interface ProgressBuiltinPermissionEntry {
|
|
5
|
+
index: 220 | 221 | 222 | 223 | 224 | 225;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
governed_operations: string[];
|
|
9
|
+
sdk_exposed: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ProgressScene {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
industry: string[];
|
|
15
|
+
scenario: string;
|
|
16
|
+
phases: ProgressPhase[];
|
|
17
|
+
requires_published_machine: true;
|
|
18
|
+
requires_order_bound: boolean;
|
|
19
|
+
named_operator_roles: {
|
|
20
|
+
role: string;
|
|
21
|
+
typical_count: number;
|
|
22
|
+
}[];
|
|
23
|
+
builtin_indexes_consumed: ProgressBuiltinPermissionEntry[];
|
|
24
|
+
typical_context_repository_count: number;
|
|
25
|
+
uses_hold_mechanism: boolean;
|
|
26
|
+
uses_admin_unhold: boolean;
|
|
27
|
+
common_patterns: string[];
|
|
28
|
+
recommended_templates: string[];
|
|
29
|
+
}
|
|
30
|
+
export declare const PROGRESS_NEW: ProgressBuiltinPermissionEntry;
|
|
31
|
+
export declare const PROGRESS_NAMED_OPERATOR: ProgressBuiltinPermissionEntry;
|
|
32
|
+
export declare const PROGRESS_TASK: ProgressBuiltinPermissionEntry;
|
|
33
|
+
export declare const PROGRESS_CONTEXT_REPOSITORY: ProgressBuiltinPermissionEntry;
|
|
34
|
+
export declare const PROGRESS_UNHOLD: ProgressBuiltinPermissionEntry;
|
|
35
|
+
export declare const PROGRESS_OWNER_RECEIVE: ProgressBuiltinPermissionEntry;
|
|
36
|
+
export declare const PROGRESS_PERMISSIONS: ProgressBuiltinPermissionEntry[];
|
|
37
|
+
export declare const PROGRESS_SCENES: ProgressScene[];
|
|
38
|
+
export declare const PROGRESS_LEDGER_VERSION = "1.0.0";
|
|
39
|
+
export declare function getScenesByPhase(phase: ProgressPhase): ProgressScene[];
|
|
40
|
+
export declare function findSceneById(id: string): ProgressScene | undefined;
|
|
41
|
+
export declare function getScenesByIndustry(industry: string): ProgressScene[];
|
|
42
|
+
export declare function getBuiltinPermissionByIndex(index: number): ProgressBuiltinPermissionEntry | undefined;
|
|
43
|
+
export declare function isProgressBuiltinPermission(index: number): boolean;
|
|
44
|
+
export declare function inferSceneFromIntent(intent: string): ProgressScene | undefined;
|
|
45
|
+
export declare function getAllBuiltinPermissions(): ProgressBuiltinPermissionEntry[];
|
|
46
|
+
export declare function getProgressScenesCount(): number;
|
|
47
|
+
export declare function validateNamedOperatorAddressList(addresses: string[]): {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
violations: string[];
|
|
50
|
+
};
|
|
51
|
+
export declare function validateNamedOperatorCount(currentNamedOperatorCount: number): {
|
|
52
|
+
ok: boolean;
|
|
53
|
+
violation?: string;
|
|
54
|
+
};
|
|
55
|
+
export declare function validateContextRepositoryCount(currentRepositoryCount: number, addCount: number): {
|
|
56
|
+
ok: boolean;
|
|
57
|
+
violation?: string;
|
|
58
|
+
};
|
|
59
|
+
export declare const PROGRESS_CROSS_OBJECT_REFS: Array<{
|
|
60
|
+
object: "Machine" | "Order" | "Repository" | "Permission" | "Service" | "Passport" | "Payment" | "Allocation";
|
|
61
|
+
phase: ProgressPhase | "universal";
|
|
62
|
+
relationship: string;
|
|
63
|
+
}>;
|