@wowok/agent-mcp 2.7.10 → 3.0.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.
Files changed (151) hide show
  1. package/dist/extensions/capability-manifest.d.ts +1 -82
  2. package/dist/extensions/capability-manifest.js +1 -1
  3. package/dist/extensions/constraint-registry.d.ts +6 -4
  4. package/dist/extensions/constraint-registry.js +1 -1
  5. package/dist/extensions/index.d.ts +4 -5
  6. package/dist/extensions/index.js +1 -1
  7. package/dist/extensions/industry-pack.js +1 -1
  8. package/dist/extensions/metric-registry.d.ts +6 -4
  9. package/dist/extensions/metric-registry.js +1 -1
  10. package/dist/extensions/mode-evaluator.d.ts +2 -3
  11. package/dist/extensions/mode-evaluator.js +1 -1
  12. package/dist/extensions/registry.d.ts +3 -25
  13. package/dist/extensions/registry.js +1 -1
  14. package/dist/extensions/types.d.ts +0 -68
  15. package/dist/goal/GoalEngine.d.ts +36 -1
  16. package/dist/goal/GoalEngine.js +1 -1
  17. package/dist/goal/types.d.ts +4 -0
  18. package/dist/knowledge/account-marks.d.ts +1 -0
  19. package/dist/knowledge/account-marks.js +1 -1
  20. package/dist/knowledge/fund-layer.d.ts +13 -9
  21. package/dist/knowledge/fund-layer.js +1 -1
  22. package/dist/knowledge/goal-completion.js +1 -1
  23. package/dist/knowledge/guard-bindings.d.ts +21 -0
  24. package/dist/knowledge/guard-bindings.js +1 -0
  25. package/dist/knowledge/index.d.ts +5 -3
  26. package/dist/knowledge/index.js +1 -1
  27. package/dist/knowledge/industry-registry.js +1 -1
  28. package/dist/knowledge/mcp-schema-audit-cli.js +1 -1
  29. package/dist/knowledge/mcp-schema-audit.js +1 -1
  30. package/dist/knowledge/reward-risk.d.ts +1 -1
  31. package/dist/knowledge/reward-risk.js +1 -1
  32. package/dist/knowledge/safety-rules.d.ts +2 -1
  33. package/dist/knowledge/safety-rules.js +1 -1
  34. package/dist/knowledge/scenario-topology.d.ts +43 -0
  35. package/dist/knowledge/scenario-topology.js +1 -0
  36. package/dist/knowledge/supply-chain.js +1 -1
  37. package/dist/knowledge/template-registry.js +1 -1
  38. package/dist/knowledge/workflow-guidance.d.ts +35 -0
  39. package/dist/knowledge/workflow-guidance.js +1 -1
  40. package/dist/knowledge/workspace-lists.d.ts +1 -0
  41. package/dist/knowledge/workspace-lists.js +1 -1
  42. package/dist/monitor/MonitorLoop.d.ts +2 -0
  43. package/dist/monitor/MonitorLoop.js +1 -1
  44. package/dist/monitor/ScopeResolver.js +1 -1
  45. package/dist/monitor/SuggestionBridge.d.ts +38 -0
  46. package/dist/monitor/SuggestionBridge.js +1 -0
  47. package/dist/participation/arbitrator-interest.d.ts +20 -0
  48. package/dist/participation/arbitrator-interest.js +1 -0
  49. package/dist/participation/demander-interest.d.ts +23 -0
  50. package/dist/participation/demander-interest.js +1 -0
  51. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  52. package/dist/playbooks/service-build/context-assembly.js +1 -1
  53. package/dist/playbooks/service-build/machine-nodes.js +1 -1
  54. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  55. package/dist/playbooks/service-build/merchant-guide.d.ts +20 -0
  56. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  57. package/dist/playbooks/service-build/mode-actions.d.ts +30 -6
  58. package/dist/playbooks/service-build/mode-actions.js +1 -1
  59. package/dist/playbooks/service-build/object-panorama.js +1 -1
  60. package/dist/playbooks/service-build/participation-radar.js +1 -1
  61. package/dist/playbooks/service-build/relationship-profile.d.ts +2 -0
  62. package/dist/playbooks/service-build/relationship-profile.js +1 -0
  63. package/dist/playbooks/service-build/semantic-graph.d.ts +5 -1
  64. package/dist/playbooks/service-build/semantic-graph.js +1 -1
  65. package/dist/playbooks/service-build/service-panorama.js +1 -1
  66. package/dist/relationship/derivation.d.ts +88 -0
  67. package/dist/relationship/derivation.js +1 -0
  68. package/dist/relationship/incentive.d.ts +38 -0
  69. package/dist/relationship/incentive.js +1 -0
  70. package/dist/relationship/index.d.ts +4 -0
  71. package/dist/relationship/index.js +1 -0
  72. package/dist/relationship/registry.d.ts +13 -0
  73. package/dist/relationship/registry.js +1 -0
  74. package/dist/relationship/types.d.ts +45 -0
  75. package/dist/relationship/types.js +1 -0
  76. package/dist/review/progress.js +1 -1
  77. package/dist/safety/confirm-gate.js +1 -1
  78. package/dist/safety/preview.js +1 -1
  79. package/dist/schema/call/bridge.d.ts +25 -3
  80. package/dist/schema/call/bridge.js +1 -1
  81. package/dist/schema/call/semantic.js +1 -1
  82. package/dist/schema/common/index.js +1 -1
  83. package/dist/schema/goal/index.d.ts +40 -14
  84. package/dist/schema/goal/index.js +1 -1
  85. package/dist/schema/goal/planning.d.ts +6 -6
  86. package/dist/schema/industry-pack/index.d.ts +58 -0
  87. package/dist/schema/industry-pack/index.js +1 -1
  88. package/dist/schema/industry-pack/modes.d.ts +59 -1
  89. package/dist/schema/industry-pack/modes.js +1 -1
  90. package/dist/schema/intent-radar/index.d.ts +19 -19
  91. package/dist/schema/local/index.d.ts +11 -0
  92. package/dist/schema/local/index.js +1 -1
  93. package/dist/schema/operations.d.ts +58 -16
  94. package/dist/schema/persona/index.d.ts +1 -1
  95. package/dist/schema/query/bi.d.ts +145 -16
  96. package/dist/schema/query/bi.js +1 -1
  97. package/dist/schema/query/index.d.ts +2 -2
  98. package/dist/schema/schema-version.js +1 -1
  99. package/dist/schema-query-impl/index.js +1 -1
  100. package/dist/schemas/account_operation.output.json +29 -0
  101. package/dist/schemas/account_operation.schema.json +6 -2
  102. package/dist/schemas/bridge_operation.output.json +24 -1
  103. package/dist/schemas/bridge_operation.schema.json +73 -1
  104. package/dist/schemas/goal_operation.schema.json +76 -0
  105. package/dist/schemas/index.json +1 -1
  106. package/dist/schemas/industry_pack_operation.output.json +176 -1
  107. package/dist/schemas/industry_pack_operation.schema.json +19 -0
  108. package/dist/schemas/onchain_events.output.json +1 -1
  109. package/dist/schemas/onchain_operations.schema.json +41 -41
  110. package/dist/schemas/onchain_operations_allocation.schema.json +4 -4
  111. package/dist/schemas/onchain_operations_arbitration.schema.json +3 -3
  112. package/dist/schemas/onchain_operations_contact.schema.json +2 -2
  113. package/dist/schemas/onchain_operations_demand.schema.json +2 -2
  114. package/dist/schemas/onchain_operations_machine.schema.json +2 -2
  115. package/dist/schemas/onchain_operations_order.schema.json +2 -2
  116. package/dist/schemas/onchain_operations_payment.schema.json +1 -1
  117. package/dist/schemas/onchain_operations_permission.schema.json +2 -2
  118. package/dist/schemas/onchain_operations_progress.schema.json +2 -2
  119. package/dist/schemas/onchain_operations_repository.schema.json +2 -2
  120. package/dist/schemas/onchain_operations_reward.schema.json +6 -6
  121. package/dist/schemas/onchain_operations_service.schema.json +7 -7
  122. package/dist/schemas/onchain_operations_treasury.schema.json +6 -6
  123. package/dist/schemas/onchain_table_data.output.json +53 -0
  124. package/dist/schemas/query_toolkit.output.json +240 -7
  125. package/dist/schemas/query_toolkit.schema.json +53 -0
  126. package/dist/task/ProcessStore.d.ts +18 -1
  127. package/dist/task/ProcessStore.js +1 -1
  128. package/dist/task/types.d.ts +24 -0
  129. package/dist/tools/handlers/config.js +1 -1
  130. package/dist/tools/handlers/evaluation.js +1 -1
  131. package/dist/tools/handlers/goal.js +1 -1
  132. package/dist/tools/handlers/industry-pack.js +1 -1
  133. package/dist/tools/handlers/local.d.ts +4 -3
  134. package/dist/tools/handlers/local.js +1 -1
  135. package/dist/tools/handlers/onchain.js +1 -1
  136. package/dist/tools/handlers/permission.js +1 -1
  137. package/dist/tools/handlers/query.js +1 -1
  138. package/dist/tools/handlers/workflow.js +1 -1
  139. package/dist/tools/index.js +1 -1
  140. package/dist/tools/rules-hook.d.ts +1 -0
  141. package/dist/tools/rules-hook.js +1 -1
  142. package/dist/tools/shared.js +1 -1
  143. package/package.json +2 -2
  144. package/dist/mode-market/index.d.ts +0 -3
  145. package/dist/mode-market/index.js +0 -1
  146. package/dist/mode-market/registry.d.ts +0 -53
  147. package/dist/mode-market/registry.js +0 -1
  148. package/dist/mode-market/review.d.ts +0 -27
  149. package/dist/mode-market/review.js +0 -1
  150. package/dist/mode-market/submission.d.ts +0 -25
  151. package/dist/mode-market/submission.js +0 -1
@@ -2643,7 +2643,7 @@
2643
2643
  "type": "string"
2644
2644
  }
2645
2645
  ],
2646
- "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
2646
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
2647
2647
  },
2648
2648
  {
2649
2649
  "type": "null"
@@ -4915,7 +4915,7 @@
4915
4915
  "type": "string"
4916
4916
  }
4917
4917
  ],
4918
- "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
4918
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
4919
4919
  },
4920
4920
  {
4921
4921
  "type": "null"
@@ -5332,7 +5332,7 @@
5332
5332
  "type": "string"
5333
5333
  }
5334
5334
  ],
5335
- "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
5335
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
5336
5336
  }
5337
5337
  },
5338
5338
  "required": [
@@ -7117,7 +7117,7 @@
7117
7117
  "type": "string"
7118
7118
  }
7119
7119
  ],
7120
- "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
7120
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
7121
7121
  }
7122
7122
  },
7123
7123
  "required": [
@@ -9261,7 +9261,7 @@
9261
9261
  "type": "string"
9262
9262
  }
9263
9263
  ],
9264
- "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
9264
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
9265
9265
  },
9266
9266
  {
9267
9267
  "type": "null"
@@ -15402,7 +15402,7 @@
15402
15402
  "type": "string"
15403
15403
  }
15404
15404
  ],
15405
- "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
15405
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
15406
15406
  },
15407
15407
  "token_type": {
15408
15408
  "type": "string",
@@ -15426,7 +15426,7 @@
15426
15426
  "type": "string"
15427
15427
  }
15428
15428
  ],
15429
- "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
15429
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05WOW\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is only within the safe integer range (±2^53); numbers outside it are REJECTED, use a numeric string instead. PRECISION RULE: for values exceeding 2^53 (9007199254740991), ALWAYS use format (1) or (2) — JS numbers lose integer precision silently and such inputs are blocked. Raw amounts must be plain non-negative integers; a decimal value without a token symbol (e.g. \"2.5\") is rejected — append the symbol (\"2.5WOW\") so the Fund Processing Layer converts it. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer, where the token's FULL type, decimals and raw amount are always visible. MULTIPLE ISSUERS: several on-chain tokens may legally share the same symbol (e.g. multiple \"USDT\" coins). When a bare symbol matches more than one token, the operation is BLOCKED and every candidate is listed with full details (type, name, decimals, verified tag) — present the list to the USER and let them choose (they may answer by number), then re-issue with the chosen token's FULL type string in type_parameter; never guess an issuer from the bare symbol. MISSING TOKEN INFO: when a token's precision cannot be resolved, the operation is REFUSED (raw u64 included — amount magnitude could not be verified). Recovery: provide the token's FULL type in package::module::Name form in type_parameter (a bare symbol like \"USDT\" cannot be resolved), and verify the WOW network is correct. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
15430
15430
  },
15431
15431
  "payment": {
15432
15432
  "type": "string",
@@ -17324,6 +17324,239 @@
17324
17324
  ],
17325
17325
  "additionalProperties": false
17326
17326
  },
17327
+ {
17328
+ "type": "object",
17329
+ "properties": {
17330
+ "query_type": {
17331
+ "type": "string",
17332
+ "const": "relationship_profile"
17333
+ },
17334
+ "result": {
17335
+ "type": "object",
17336
+ "properties": {
17337
+ "action": {
17338
+ "type": "string",
17339
+ "const": "relationship_profile"
17340
+ },
17341
+ "account": {
17342
+ "type": "string",
17343
+ "description": "Resolved anchor account address (any distributed account, not only local)."
17344
+ },
17345
+ "edges": {
17346
+ "type": "array",
17347
+ "items": {
17348
+ "type": "object",
17349
+ "properties": {
17350
+ "anchor": {
17351
+ "type": "string"
17352
+ },
17353
+ "counterparty": {
17354
+ "type": "string",
17355
+ "description": "The other side of this relationship edge."
17356
+ },
17357
+ "kind": {
17358
+ "type": "string",
17359
+ "description": "Relationship kind: employment (merchant×staff, principal-agent) | process_operation (machine node operators) | agency (order owner×agents) | transaction (customer×merchant) | supply (demander×presenters) | arbitration_delegation | dispute_resolution | value_distribution (payer×allocation recipients) | contact_membership."
17360
+ },
17361
+ "power": {
17362
+ "type": "object",
17363
+ "properties": {
17364
+ "role_bits": {
17365
+ "type": "number",
17366
+ "description": "Permission role bits: 1=owner, 2=admin, 4=entity."
17367
+ },
17368
+ "perm_indices": {
17369
+ "type": "array",
17370
+ "items": {
17371
+ "type": "number"
17372
+ }
17373
+ },
17374
+ "objects": {
17375
+ "type": "array",
17376
+ "items": {
17377
+ "type": "object",
17378
+ "properties": {
17379
+ "object_type": {
17380
+ "type": "string"
17381
+ },
17382
+ "address": {
17383
+ "type": "string"
17384
+ },
17385
+ "capacity": {
17386
+ "type": "string",
17387
+ "description": "The anchor's capacity on this object."
17388
+ }
17389
+ },
17390
+ "required": [
17391
+ "object_type",
17392
+ "address",
17393
+ "capacity"
17394
+ ],
17395
+ "additionalProperties": false
17396
+ },
17397
+ "description": "On-chain objects this relationship spans (power carriers)."
17398
+ },
17399
+ "carrier": {
17400
+ "type": "string",
17401
+ "description": "Which carrier produced the edge (permission/machine_forward/order/...)."
17402
+ }
17403
+ },
17404
+ "required": [
17405
+ "role_bits",
17406
+ "perm_indices",
17407
+ "objects",
17408
+ "carrier"
17409
+ ],
17410
+ "additionalProperties": false
17411
+ },
17412
+ "interest": {
17413
+ "type": "object",
17414
+ "properties": {
17415
+ "gains": {
17416
+ "type": "array",
17417
+ "items": {
17418
+ "type": "string"
17419
+ }
17420
+ },
17421
+ "exposures": {
17422
+ "type": "array",
17423
+ "items": {
17424
+ "type": "string"
17425
+ }
17426
+ }
17427
+ },
17428
+ "required": [
17429
+ "gains",
17430
+ "exposures"
17431
+ ],
17432
+ "additionalProperties": false
17433
+ },
17434
+ "value_flows": {
17435
+ "type": "array",
17436
+ "items": {
17437
+ "type": "object",
17438
+ "properties": {
17439
+ "from": {
17440
+ "type": "string"
17441
+ },
17442
+ "to": {
17443
+ "type": "string"
17444
+ },
17445
+ "carrier_object": {
17446
+ "type": "string"
17447
+ },
17448
+ "carrier_type": {
17449
+ "type": "string"
17450
+ },
17451
+ "amount": {
17452
+ "type": "string"
17453
+ },
17454
+ "trigger": {
17455
+ "type": "string"
17456
+ }
17457
+ },
17458
+ "required": [
17459
+ "from",
17460
+ "to",
17461
+ "carrier_object",
17462
+ "carrier_type",
17463
+ "trigger"
17464
+ ],
17465
+ "additionalProperties": false
17466
+ },
17467
+ "description": "Value flows crossing this edge (escrow/allocation/payment/reward/indemnity)."
17468
+ },
17469
+ "tension": {
17470
+ "description": "Registry-declared goal tension (present when the two sides' goals diverge).",
17471
+ "type": "object",
17472
+ "properties": {
17473
+ "anchor_goal": {
17474
+ "type": "string"
17475
+ },
17476
+ "counterparty_goal": {
17477
+ "type": "string"
17478
+ },
17479
+ "divergence": {
17480
+ "type": "string"
17481
+ },
17482
+ "alignment_mechanisms": {
17483
+ "type": "array",
17484
+ "items": {
17485
+ "type": "string"
17486
+ }
17487
+ }
17488
+ },
17489
+ "required": [
17490
+ "anchor_goal",
17491
+ "counterparty_goal",
17492
+ "divergence",
17493
+ "alignment_mechanisms"
17494
+ ],
17495
+ "additionalProperties": false
17496
+ }
17497
+ },
17498
+ "required": [
17499
+ "anchor",
17500
+ "counterparty",
17501
+ "kind",
17502
+ "power",
17503
+ "interest",
17504
+ "value_flows"
17505
+ ],
17506
+ "additionalProperties": false
17507
+ },
17508
+ "description": "Relationship edges of the anchor, one per (counterparty, kind)."
17509
+ },
17510
+ "by_counterparty": {
17511
+ "type": "object",
17512
+ "propertyNames": {
17513
+ "type": "string"
17514
+ },
17515
+ "additionalProperties": {
17516
+ "type": "array",
17517
+ "items": {
17518
+ "type": "string"
17519
+ }
17520
+ },
17521
+ "description": "Counterparty address → kinds present."
17522
+ },
17523
+ "notes": {
17524
+ "type": "array",
17525
+ "items": {
17526
+ "type": "string"
17527
+ },
17528
+ "description": "Registry notes: goal tensions and mechanism summaries for present kinds."
17529
+ },
17530
+ "data_gaps": {
17531
+ "type": "array",
17532
+ "items": {
17533
+ "type": "string"
17534
+ },
17535
+ "description": "Graceful degradation notes (unreadable objects, skipped carriers)."
17536
+ },
17537
+ "summary": {
17538
+ "type": "string",
17539
+ "description": "One-paragraph relationship web summary."
17540
+ }
17541
+ },
17542
+ "required": [
17543
+ "action",
17544
+ "account",
17545
+ "edges",
17546
+ "by_counterparty",
17547
+ "notes",
17548
+ "data_gaps",
17549
+ "summary"
17550
+ ],
17551
+ "additionalProperties": false
17552
+ }
17553
+ },
17554
+ "required": [
17555
+ "query_type",
17556
+ "result"
17557
+ ],
17558
+ "additionalProperties": false
17559
+ },
17327
17560
  {
17328
17561
  "type": "object",
17329
17562
  "properties": {
@@ -1193,6 +1193,51 @@
1193
1193
  "additionalProperties": false,
1194
1194
  "description": "In-flight order participation analysis for ONE account (GLM6/94): customer / operator / observer perspective derived from on-chain permission matching (never caller-asserted) — per-order operable forwards (branch choices), waiting_on roles, pending claims (reward/discount/compensation/rating), perspective-specific interest hints, aggregated account dashboard. Read-only."
1195
1195
  },
1196
+ {
1197
+ "type": "object",
1198
+ "properties": {
1199
+ "query_type": {
1200
+ "type": "string",
1201
+ "const": "relationship_profile"
1202
+ },
1203
+ "radar_account": {
1204
+ "description": "Anchor account to analyze — address (0x...) or LocalMark name. Required when query_type='relationship_profile'. ANY distributed account works (not only local accounts): the anchor is just an address; all relationships derive from on-chain power carriers.",
1205
+ "type": "string"
1206
+ },
1207
+ "relation_kinds": {
1208
+ "description": "Filter to specific relationship kinds (default: all). employment = merchant × staff (principal-agent); process_operation = machine node operators; agency = order owner × agents; transaction = customer × merchant; supply = demander × presenters; arbitration_delegation = service owner × arbitrators; dispute_resolution = arbitrator × disputants; value_distribution = payer × allocation recipients; contact_membership = communication channel members.",
1209
+ "type": "array",
1210
+ "items": {
1211
+ "type": "string",
1212
+ "enum": [
1213
+ "employment",
1214
+ "process_operation",
1215
+ "agency",
1216
+ "transaction",
1217
+ "supply",
1218
+ "arbitration_delegation",
1219
+ "dispute_resolution",
1220
+ "value_distribution",
1221
+ "contact_membership"
1222
+ ]
1223
+ }
1224
+ },
1225
+ "context_network": {
1226
+ "type": "string",
1227
+ "enum": [
1228
+ "testnet",
1229
+ "mainnet",
1230
+ "localnet"
1231
+ ],
1232
+ "description": "Network for the query. Defaults to 'testnet' if omitted. 'localnet' is for internal test use against a local fullnode."
1233
+ }
1234
+ },
1235
+ "required": [
1236
+ "query_type"
1237
+ ],
1238
+ "additionalProperties": false,
1239
+ "description": "Business Relationship Graph (K3/19): derive ONE account's full relationship web from on-chain power carriers (Permission memberships, Machine forwards, Orders, Demand presenters, Allocation sharing, Arbitration bindings, Contact ims). Each edge carries the three dimensions — 权属 power (what each side CAN do, and where that power lives on-chain), 利益 interest (gains/exposures, with registry-declared goal tensions like principal-agent divergence), and 价值交互 value flows (escrow → allocation → payment chains). Read-only; roles are DERIVED from chain data, never asserted."
1240
+ },
1196
1241
  {
1197
1242
  "type": "object",
1198
1243
  "properties": {
@@ -1216,6 +1261,10 @@
1216
1261
  "account": {
1217
1262
  "description": "Scope the aggregation to ONE account address (the client's current account). Omit to aggregate across ALL local accounts.",
1218
1263
  "type": "string"
1264
+ },
1265
+ "light": {
1266
+ "description": "Set to true for the fast first-paint phase: rows carry address / type / name / time only, skipping the per-object enrichment (dead-object probe, registrar votes, per-family extras). Used for progressive list loading; the client merges the full result afterwards.",
1267
+ "type": "boolean"
1219
1268
  }
1220
1269
  },
1221
1270
  "required": [
@@ -1247,6 +1296,10 @@
1247
1296
  "account": {
1248
1297
  "description": "Scope to ONE account address (the client's current account). Omit to merge across ALL local accounts.",
1249
1298
  "type": "string"
1299
+ },
1300
+ "light": {
1301
+ "description": "Set to true for the fast first-paint phase: rows carry address / type only (vote_kinds is empty until the full result), skipping the per-target registrar-vote reads + object enrichment. Used for progressive list loading; the client merges the full result afterwards.",
1302
+ "type": "boolean"
1250
1303
  }
1251
1304
  },
1252
1305
  "required": [
@@ -1,4 +1,4 @@
1
- import { type DecisionRecord, type FeedbackRecord, type ProblemRecord, type ProcessEvent, type ProcessManifest, type ProcessStageState, type SubstepRecord, type StageMeta } from "./types.js";
1
+ import { type DecisionRecord, type FeedbackRecord, type ProblemRecord, type ProcessEvent, type ProcessManifest, type ProcessStageState, type SubstepRecord, type SuggestionRecord, type StageMeta } from "./types.js";
2
2
  export declare function processesRootDir(): string;
3
3
  export declare function processDir(id: string): string;
4
4
  export declare function deleteProcessDir(dir: string): void;
@@ -32,6 +32,22 @@ export declare function updateProblem(dir: string, id: string, patch: Partial<Pi
32
32
  export declare function listProblems(dir: string, filter?: {
33
33
  status?: ProblemRecord["status"];
34
34
  }): ProblemRecord[];
35
+ export declare function addSuggestion(dir: string, input: {
36
+ object?: string;
37
+ kind: SuggestionRecord["kind"];
38
+ stage?: string;
39
+ objects?: {
40
+ type: string;
41
+ object: string;
42
+ }[];
43
+ title: string;
44
+ detail?: string;
45
+ origin?: SuggestionRecord["origin"];
46
+ }): SuggestionRecord;
47
+ export declare function updateSuggestion(dir: string, id: string, patch: Partial<Pick<SuggestionRecord, "status" | "resolution_note" | "applied" | "stage" | "object">>): SuggestionRecord;
48
+ export declare function listSuggestions(dir: string, filter?: {
49
+ status?: SuggestionRecord["status"];
50
+ }): SuggestionRecord[];
35
51
  export declare function addFeedback(dir: string, input: {
36
52
  source: FeedbackRecord["source"];
37
53
  sentiment: FeedbackRecord["sentiment"];
@@ -58,6 +74,7 @@ export interface ProcessBundle {
58
74
  stage?: ProcessStageState;
59
75
  events: ProcessEvent[];
60
76
  problems: ProblemRecord[];
77
+ suggestions: SuggestionRecord[];
61
78
  feedback: FeedbackRecord[];
62
79
  decisions: DecisionRecord[];
63
80
  substeps: Record<string, SubstepRecord[]>;
@@ -1 +1 @@
1
- import{appendFileSync,copyFileSync,existsSync,mkdirSync,readFileSync,readdirSync,rmSync,statSync,writeFileSync}from'fs';import{basename,dirname,join,relative,sep}from'path';import{getWowMcpDir}from'@wowok/wowok';import{PROCESS_SCHEMA_VERSION}from'./types.js';export function processesRootDir(){return join(getWowMcpDir(),'processes');}export function processDir(a){return join(processesRootDir(),a);}export function deleteProcessDir(a){rmSync(a,{'recursive':!![],'force':!![]});}function manifestPath(a){return join(a,'manifest.json');}function stageStatePath(a){return join(a,'stage.json');}function eventsPath(a){return join(a,'events.jsonl');}function problemsPath(a){return join(a,'problems.jsonl');}function feedbackPath(a){return join(a,'feedback.jsonl');}function decisionsPath(a){return join(a,'decisions.jsonl');}function netKey(a){return(a||'default')['replace'](/[^a-zA-Z0-9_-]/g,'_');}function substepsPath(a,b){return join(a,'substeps-'+netKey(b)+'.jsonl');}function relKey(a,b){return relative(a,b)['split'](sep)['join']('/');}function zeroStageMeta(){return{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0};}function newRecordId(a){return a+'_'+Date['now']()['toString'](0x24)+'_'+Math['random']()['toString'](0x24)['slice'](0x2,0x8);}export function initProcess(a,b,c){if(c['length']===0x0)throw new Error('initProcess\x20requires\x20a\x20non-empty\x20stage\x20sequence');mkdirSync(a,{'recursive':!![]}),writeFileSync(manifestPath(a),JSON['stringify'](b,null,0x2),'utf-8');const d={};for(const e of c)d[e]=zeroStageMeta();return saveStageState(a,{'stages':[...c],'current_stage':c[0x0],'stage_meta':d,'updated_at':Date['now']()}),appendEvent(a,{'timestamp':b['created_at'],'event':'process_init','stage':c[0x0],'reason':'process\x20initialized\x20(playbook:\x20'+b['playbook']+')','data':{'playbook':b['playbook'],'stages':[...c]}}),b;}export function loadManifest(a){const b=manifestPath(a);if(!existsSync(b))throw new Error('process\x20not\x20initialized:\x20'+a+'\x20(missing\x20manifest.json)');return JSON['parse'](readFileSync(b,'utf-8'));}export function saveManifest(a,b){b['updated_at']=new Date()['toISOString'](),writeFileSync(manifestPath(a),JSON['stringify'](b,null,0x2),'utf-8');}export function loadStageState(a){const b=stageStatePath(a);if(!existsSync(b))return undefined;return JSON['parse'](readFileSync(b,'utf-8'));}export function saveStageState(a,b){b['updated_at']=Date['now'](),mkdirSync(a,{'recursive':!![]}),writeFileSync(stageStatePath(a),JSON['stringify'](b,null,0x2),'utf-8');}export function advanceStage(a,b,c={}){const d=loadStageState(a);if(!d)throw new Error('process\x20not\x20initialized:\x20'+a+'\x20(missing\x20stage.json)');const e=d['stages']['indexOf'](b);if(e<0x0)throw new Error('unknown\x20stage\x20\x27'+b+'\x27\x20(stages:\x20'+d['stages']['join']('\x20→\x20')+')');const f=d['stages']['indexOf'](d['current_stage']);if(b===d['current_stage'])return d;if(e<f)throw new Error('invalid\x20stage\x20transition:\x20'+d['current_stage']+'\x20→\x20'+b+'\x20(forward-only)');if(e>f+0x1&&!c['allowSkip'])throw new Error('invalid\x20stage\x20transition:\x20'+d['current_stage']+'\x20→\x20'+b+'\x20(skips\x20'+d['stages'][f+0x1]+';\x20pass\x20allowSkip\x20to\x20jump)');const g=d['current_stage'],h=d['stage_meta'][g]??zeroStageMeta();return d['stage_meta'][g]={...h,'committed':!![],'committed_at':h['committed_at']??Date['now'](),'completion':h['committed']?h['completion']:0x64},d['current_stage']=b,saveStageState(a,d),appendEvent(a,{'timestamp':new Date()['toISOString'](),'event':'stage_commit','stage':g,'reason':'stage\x20\x27'+g+'\x27\x20committed;\x20advanced\x20to\x20\x27'+b+'\x27','data':{'from':g,'to':b}}),d;}export function updateStageMeta(a,b,c){const d=loadStageState(a);if(!d)throw new Error('process\x20not\x20initialized:\x20'+a+'\x20(missing\x20stage.json)');if(!d['stages']['includes'](b))throw new Error('unknown\x20stage\x20\x27'+b+'\x27\x20(stages:\x20'+d['stages']['join']('\x20→\x20')+')');const e={...d['stage_meta'][b]??zeroStageMeta(),...c};return d['stage_meta'][b]=e,saveStageState(a,d),e;}export function appendEvent(a,b){mkdirSync(a,{'recursive':!![]}),appendFileSync(eventsPath(a),JSON['stringify'](b)+'\x0a','utf-8');}export function readEvents(a){return readJsonl(eventsPath(a));}function readJsonl(a){if(!existsSync(a))return[];return readFileSync(a,'utf-8')['split']('\x0a')['filter'](b=>b['trim']()['length']>0x0)['map'](b=>JSON['parse'](b));}function appendJsonlRecord(a,b){mkdirSync(dirname(a),{'recursive':!![]}),appendFileSync(a,JSON['stringify'](b)+'\x0a','utf-8');}function foldLatest(a){const b=new Map();for(const c of a)b['set'](c['id'],c);return[...b['values']()];}export function addProblem(a,b){const c={'id':newRecordId('prob'),'created_at':new Date()['toISOString'](),...b['stage']?{'stage':b['stage']}:{},...b['object']?{'object':b['object']}:{},'severity':b['severity'],'status':'open','title':b['title'],...b['detail']?{'detail':b['detail']}:{},'notes':b['note']?[{'at':new Date()['toISOString'](),'by':b['note']['by'],'text':b['note']['text']}]:[],...b['origin']?{'origin':b['origin']}:{}};return appendJsonlRecord(problemsPath(a),c),c;}export function updateProblem(a,b,c,d){const e=foldLatest(readJsonl(problemsPath(a)))['find'](g=>g['id']===b);if(!e)throw new Error('problem\x20not\x20found:\x20'+b);const f={...e,...Object['fromEntries'](Object['entries'](c)['filter'](([,g])=>g!==undefined)),'notes':d?[...e['notes'],{'at':new Date()['toISOString'](),'by':d['by'],'text':d['text']}]:e['notes']};return appendJsonlRecord(problemsPath(a),f),f;}export function listProblems(a,b={}){const c=foldLatest(readJsonl(problemsPath(a)));return b['status']?c['filter'](d=>d['status']===b['status']):c;}export function addFeedback(a,b){const c={'id':newRecordId('fb'),'at':new Date()['toISOString'](),'source':b['source'],'sentiment':b['sentiment'],'comment':b['comment'],...b['refs']?{'refs':b['refs']}:{}};return appendJsonlRecord(feedbackPath(a),c),c;}export function listFeedback(a){return readJsonl(feedbackPath(a));}export function addDecision(a,b){const c={'id':newRecordId('dec'),'at':new Date()['toISOString'](),...b['stage']?{'stage':b['stage']}:{},'by':b['by'],'decision':b['decision'],...b['rationale']?{'rationale':b['rationale']}:{},'reversible':b['reversible']};return appendJsonlRecord(decisionsPath(a),c),c;}export function listDecisions(a){return readJsonl(decisionsPath(a));}export function appendSubstep(a,b,c){appendJsonlRecord(substepsPath(a,b),c);}export function readSubsteps(a,b){return readJsonl(substepsPath(a,b));}export function savePayload(a,b,c){const d=join(a,b);return mkdirSync(dirname(d),{'recursive':!![]}),writeFileSync(d,JSON['stringify'](c,null,0x2),'utf-8'),d;}export function loadPayload(a,b){const c=join(a,b);if(!existsSync(c))return undefined;return JSON['parse'](readFileSync(c,'utf-8'));}export function exportBundle(a){const b=loadManifest(a),c={},d={};function e(f){if(!existsSync(f))return;for(const g of readdirSync(f,{'withFileTypes':!![]})){const h=join(f,g['name']);if(g['isDirectory']())e(h);else{if(g['isFile']()){const i=relKey(a,h);if(i==='manifest.json'||i==='stage.json')continue;if(g['name']['endsWith']('.json'))try{c[i]=JSON['parse'](readFileSync(h,'utf-8'));}catch{}else{const j=g['name']['match'](/^substeps-(.+)\.jsonl$/);if(j)d[j[0x1]]=readJsonl(h);}}}}}return e(a),{'schema_version':PROCESS_SCHEMA_VERSION,'exported_at':new Date()['toISOString'](),'manifest':b,'stage':loadStageState(a),'events':readEvents(a),'problems':listProblems(a),'feedback':listFeedback(a),'decisions':listDecisions(a),'substeps':d,'payloads':c};}function remapDeep(a,b,c){if(typeof a==='string'){const d=b[a];if(d!==undefined)return c['n']+=0x1,d;return a;}if(Array['isArray'](a))return a['map'](e=>remapDeep(e,b,c));if(a!==null&&typeof a==='object'){const e={};for(const [f,g]of Object['entries'](a)){e[f]=remapDeep(g,b,c);}return e;}return a;}export function importBundle(a,b,c={}){const g=c['remap']??{},h={'n':0x0};mkdirSync(a,{'recursive':!![]});const i=remapDeep(b['manifest'],g,h);i['updated_at']=new Date()['toISOString'](),writeFileSync(manifestPath(a),JSON['stringify'](i,null,0x2),'utf-8');b['stage']&&writeFileSync(stageStatePath(a),JSON['stringify'](b['stage'],null,0x2),'utf-8');for(const j of b['events'])appendJsonlRecord(eventsPath(a),j);for(const k of b['problems'])appendJsonlRecord(problemsPath(a),k);for(const l of b['feedback'])appendJsonlRecord(feedbackPath(a),l);for(const m of b['decisions'])appendJsonlRecord(decisionsPath(a),m);for(const [n,o]of Object['entries'](b['substeps'])){for(const q of o){appendJsonlRecord(substepsPath(a,n),remapDeep(q,g,h));}}for(const [s,t]of Object['entries'](b['payloads'])){savePayload(a,s,remapDeep(t,g,h));}return appendEvent(a,{'timestamp':new Date()['toISOString'](),'event':'process_imported','reason':'process\x20imported\x20from\x20bundle\x20(exported_at\x20'+b['exported_at']+')','data':{'remapped':h['n']}}),i;}export function forkProcess(a,b){const c=loadManifest(a);mkdirSync(b,{'recursive':!![]});function d(f,g){for(const h of readdirSync(f,{'withFileTypes':!![]})){const i=join(f,h['name']),j=join(g,h['name']);if(h['isDirectory']())mkdirSync(j,{'recursive':!![]}),d(i,j);else h['isFile']()&&copyFileSync(i,j);}}d(a,b);const e={...c,'process_id':basename(b),'forked_from':c['process_id'],'archived':![],'updated_at':new Date()['toISOString']()};return writeFileSync(manifestPath(b),JSON['stringify'](e,null,0x2),'utf-8'),appendEvent(b,{'timestamp':new Date()['toISOString'](),'event':'process_forked','reason':'forked\x20from\x20'+c['process_id']+'\x20('+a+')','data':{'source_dir':a,'source_process':c['process_id']}}),e;}export function listProcesses(a=processesRootDir()){if(!existsSync(a))return[];const b=[];for(const c of readdirSync(a,{'withFileTypes':!![]})){if(!c['isDirectory']())continue;const d=join(a,c['name']);if(!existsSync(manifestPath(d)))continue;const f={'dir_name':c['name'],'path':d,'archived':![],'mtime':0x0};try{f['manifest']=loadManifest(d),f['archived']=f['manifest']['archived'];}catch{}try{const g=loadStageState(d);g&&(f['current_stage']=g['current_stage'],f['stages']=g['stages'],f['committed_stages']=g['stages']['filter'](h=>g['stage_meta'][h]?.['committed']));}catch{}try{f['mtime']=statSync(d)['mtimeMs'];}catch{}b['push'](f);}return b['sort']((h,i)=>i['mtime']-h['mtime']);}
1
+ import{appendFileSync,copyFileSync,existsSync,mkdirSync,readFileSync,readdirSync,rmSync,statSync,writeFileSync}from'fs';import{basename,dirname,join,relative,sep}from'path';import{getWowMcpDir}from'@wowok/wowok';import{PROCESS_SCHEMA_VERSION}from'./types.js';export function processesRootDir(){return join(getWowMcpDir(),'processes');}export function processDir(a){return join(processesRootDir(),a);}export function deleteProcessDir(a){rmSync(a,{'recursive':!![],'force':!![]});}function manifestPath(a){return join(a,'manifest.json');}function stageStatePath(a){return join(a,'stage.json');}function eventsPath(a){return join(a,'events.jsonl');}function problemsPath(a){return join(a,'problems.jsonl');}function suggestionsPath(a){return join(a,'suggestions.jsonl');}function feedbackPath(a){return join(a,'feedback.jsonl');}function decisionsPath(a){return join(a,'decisions.jsonl');}function netKey(a){return(a||'default')['replace'](/[^a-zA-Z0-9_-]/g,'_');}function substepsPath(a,b){return join(a,'substeps-'+netKey(b)+'.jsonl');}function relKey(a,b){return relative(a,b)['split'](sep)['join']('/');}function zeroStageMeta(){return{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0};}function newRecordId(a){return a+'_'+Date['now']()['toString'](0x24)+'_'+Math['random']()['toString'](0x24)['slice'](0x2,0x8);}export function initProcess(a,b,c){if(c['length']===0x0)throw new Error('initProcess\x20requires\x20a\x20non-empty\x20stage\x20sequence');mkdirSync(a,{'recursive':!![]}),writeFileSync(manifestPath(a),JSON['stringify'](b,null,0x2),'utf-8');const d={};for(const e of c)d[e]=zeroStageMeta();return saveStageState(a,{'stages':[...c],'current_stage':c[0x0],'stage_meta':d,'updated_at':Date['now']()}),appendEvent(a,{'timestamp':b['created_at'],'event':'process_init','stage':c[0x0],'reason':'process\x20initialized\x20(playbook:\x20'+b['playbook']+')','data':{'playbook':b['playbook'],'stages':[...c]}}),b;}export function loadManifest(a){const b=manifestPath(a);if(!existsSync(b))throw new Error('process\x20not\x20initialized:\x20'+a+'\x20(missing\x20manifest.json)');return JSON['parse'](readFileSync(b,'utf-8'));}export function saveManifest(a,b){b['updated_at']=new Date()['toISOString'](),writeFileSync(manifestPath(a),JSON['stringify'](b,null,0x2),'utf-8');}export function loadStageState(a){const b=stageStatePath(a);if(!existsSync(b))return undefined;return JSON['parse'](readFileSync(b,'utf-8'));}export function saveStageState(a,b){b['updated_at']=Date['now'](),mkdirSync(a,{'recursive':!![]}),writeFileSync(stageStatePath(a),JSON['stringify'](b,null,0x2),'utf-8');}export function advanceStage(a,b,c={}){const d=loadStageState(a);if(!d)throw new Error('process\x20not\x20initialized:\x20'+a+'\x20(missing\x20stage.json)');const e=d['stages']['indexOf'](b);if(e<0x0)throw new Error('unknown\x20stage\x20\x27'+b+'\x27\x20(stages:\x20'+d['stages']['join']('\x20→\x20')+')');const f=d['stages']['indexOf'](d['current_stage']);if(b===d['current_stage'])return d;if(e<f)throw new Error('invalid\x20stage\x20transition:\x20'+d['current_stage']+'\x20→\x20'+b+'\x20(forward-only)');if(e>f+0x1&&!c['allowSkip'])throw new Error('invalid\x20stage\x20transition:\x20'+d['current_stage']+'\x20→\x20'+b+'\x20(skips\x20'+d['stages'][f+0x1]+';\x20pass\x20allowSkip\x20to\x20jump)');const g=d['current_stage'],h=d['stage_meta'][g]??zeroStageMeta();return d['stage_meta'][g]={...h,'committed':!![],'committed_at':h['committed_at']??Date['now'](),'completion':h['committed']?h['completion']:0x64},d['current_stage']=b,saveStageState(a,d),appendEvent(a,{'timestamp':new Date()['toISOString'](),'event':'stage_commit','stage':g,'reason':'stage\x20\x27'+g+'\x27\x20committed;\x20advanced\x20to\x20\x27'+b+'\x27','data':{'from':g,'to':b}}),d;}export function updateStageMeta(a,b,c){const d=loadStageState(a);if(!d)throw new Error('process\x20not\x20initialized:\x20'+a+'\x20(missing\x20stage.json)');if(!d['stages']['includes'](b))throw new Error('unknown\x20stage\x20\x27'+b+'\x27\x20(stages:\x20'+d['stages']['join']('\x20→\x20')+')');const e={...d['stage_meta'][b]??zeroStageMeta(),...c};return d['stage_meta'][b]=e,saveStageState(a,d),e;}export function appendEvent(a,b){mkdirSync(a,{'recursive':!![]}),appendFileSync(eventsPath(a),JSON['stringify'](b)+'\x0a','utf-8');}export function readEvents(a){return readJsonl(eventsPath(a));}function readJsonl(a){if(!existsSync(a))return[];return readFileSync(a,'utf-8')['split']('\x0a')['filter'](b=>b['trim']()['length']>0x0)['map'](b=>JSON['parse'](b));}function appendJsonlRecord(a,b){mkdirSync(dirname(a),{'recursive':!![]}),appendFileSync(a,JSON['stringify'](b)+'\x0a','utf-8');}function foldLatest(a){const b=new Map();for(const c of a)b['set'](c['id'],c);return[...b['values']()];}export function addProblem(a,b){const c={'id':newRecordId('prob'),'created_at':new Date()['toISOString'](),...b['stage']?{'stage':b['stage']}:{},...b['object']?{'object':b['object']}:{},'severity':b['severity'],'status':'open','title':b['title'],...b['detail']?{'detail':b['detail']}:{},'notes':b['note']?[{'at':new Date()['toISOString'](),'by':b['note']['by'],'text':b['note']['text']}]:[],...b['origin']?{'origin':b['origin']}:{}};return appendJsonlRecord(problemsPath(a),c),c;}export function updateProblem(a,b,c,d){const e=foldLatest(readJsonl(problemsPath(a)))['find'](g=>g['id']===b);if(!e)throw new Error('problem\x20not\x20found:\x20'+b);const f={...e,...Object['fromEntries'](Object['entries'](c)['filter'](([,g])=>g!==undefined)),'notes':d?[...e['notes'],{'at':new Date()['toISOString'](),'by':d['by'],'text':d['text']}]:e['notes']};return appendJsonlRecord(problemsPath(a),f),f;}export function listProblems(a,b={}){const c=foldLatest(readJsonl(problemsPath(a)));return b['status']?c['filter'](d=>d['status']===b['status']):c;}export function addSuggestion(a,b){const c={'id':newRecordId('sug'),'created_at':new Date()['toISOString'](),...b['object']?{'object':b['object']}:{},'kind':b['kind'],...b['stage']?{'stage':b['stage']}:{},...b['objects']?{'objects':b['objects']}:{},'title':b['title'],...b['detail']?{'detail':b['detail']}:{},'status':'pending',...b['origin']?{'origin':b['origin']}:{}};return appendJsonlRecord(suggestionsPath(a),c),c;}export function updateSuggestion(a,b,c){const d=foldLatest(readJsonl(suggestionsPath(a)))['find'](f=>f['id']===b);if(!d)throw new Error('suggestion\x20not\x20found:\x20'+b);if(d['status']!=='pending'&&c['status']&&c['status']!==d['status'])throw new Error('suggestion\x20'+b+'\x20already\x20resolved\x20('+d['status']+')');const e={...d,...Object['fromEntries'](Object['entries'](c)['filter'](([,f])=>f!==undefined)),...c['status']&&c['status']!=='pending'?{'resolved_at':new Date()['toISOString']()}:{}};return appendJsonlRecord(suggestionsPath(a),e),e;}export function listSuggestions(a,b={}){const c=foldLatest(readJsonl(suggestionsPath(a)));return b['status']?c['filter'](d=>d['status']===b['status']):c;}export function addFeedback(a,b){const c={'id':newRecordId('fb'),'at':new Date()['toISOString'](),'source':b['source'],'sentiment':b['sentiment'],'comment':b['comment'],...b['refs']?{'refs':b['refs']}:{}};return appendJsonlRecord(feedbackPath(a),c),c;}export function listFeedback(a){return readJsonl(feedbackPath(a));}export function addDecision(a,b){const c={'id':newRecordId('dec'),'at':new Date()['toISOString'](),...b['stage']?{'stage':b['stage']}:{},'by':b['by'],'decision':b['decision'],...b['rationale']?{'rationale':b['rationale']}:{},'reversible':b['reversible']};return appendJsonlRecord(decisionsPath(a),c),c;}export function listDecisions(a){return readJsonl(decisionsPath(a));}export function appendSubstep(a,b,c){appendJsonlRecord(substepsPath(a,b),c);}export function readSubsteps(a,b){return readJsonl(substepsPath(a,b));}export function savePayload(a,b,c){const d=join(a,b);return mkdirSync(dirname(d),{'recursive':!![]}),writeFileSync(d,JSON['stringify'](c,null,0x2),'utf-8'),d;}export function loadPayload(a,b){const c=join(a,b);if(!existsSync(c))return undefined;return JSON['parse'](readFileSync(c,'utf-8'));}export function exportBundle(a){const b=loadManifest(a),c={},d={};function e(f){if(!existsSync(f))return;for(const g of readdirSync(f,{'withFileTypes':!![]})){const h=join(f,g['name']);if(g['isDirectory']())e(h);else{if(g['isFile']()){const i=relKey(a,h);if(i==='manifest.json'||i==='stage.json')continue;if(g['name']['endsWith']('.json'))try{c[i]=JSON['parse'](readFileSync(h,'utf-8'));}catch{}else{const j=g['name']['match'](/^substeps-(.+)\.jsonl$/);if(j)d[j[0x1]]=readJsonl(h);}}}}}return e(a),{'schema_version':PROCESS_SCHEMA_VERSION,'exported_at':new Date()['toISOString'](),'manifest':b,'stage':loadStageState(a),'events':readEvents(a),'problems':listProblems(a),'suggestions':listSuggestions(a),'feedback':listFeedback(a),'decisions':listDecisions(a),'substeps':d,'payloads':c};}function remapDeep(a,b,c){if(typeof a==='string'){const d=b[a];if(d!==undefined)return c['n']+=0x1,d;return a;}if(Array['isArray'](a))return a['map'](e=>remapDeep(e,b,c));if(a!==null&&typeof a==='object'){const e={};for(const [f,g]of Object['entries'](a)){e[f]=remapDeep(g,b,c);}return e;}return a;}export function importBundle(a,b,c={}){const g=c['remap']??{},h={'n':0x0};mkdirSync(a,{'recursive':!![]});const i=remapDeep(b['manifest'],g,h);i['updated_at']=new Date()['toISOString'](),writeFileSync(manifestPath(a),JSON['stringify'](i,null,0x2),'utf-8');b['stage']&&writeFileSync(stageStatePath(a),JSON['stringify'](b['stage'],null,0x2),'utf-8');for(const j of b['events'])appendJsonlRecord(eventsPath(a),j);for(const k of b['problems'])appendJsonlRecord(problemsPath(a),k);for(const l of b['suggestions']??[])appendJsonlRecord(suggestionsPath(a),l);for(const m of b['feedback'])appendJsonlRecord(feedbackPath(a),m);for(const n of b['decisions'])appendJsonlRecord(decisionsPath(a),n);for(const [o,q]of Object['entries'](b['substeps'])){for(const t of q){appendJsonlRecord(substepsPath(a,o),remapDeep(t,g,h));}}for(const [u,v]of Object['entries'](b['payloads'])){savePayload(a,u,remapDeep(v,g,h));}return appendEvent(a,{'timestamp':new Date()['toISOString'](),'event':'process_imported','reason':'process\x20imported\x20from\x20bundle\x20(exported_at\x20'+b['exported_at']+')','data':{'remapped':h['n']}}),i;}export function forkProcess(a,b){const c=loadManifest(a);mkdirSync(b,{'recursive':!![]});function d(f,g){for(const h of readdirSync(f,{'withFileTypes':!![]})){const i=join(f,h['name']),j=join(g,h['name']);if(h['isDirectory']())mkdirSync(j,{'recursive':!![]}),d(i,j);else h['isFile']()&&copyFileSync(i,j);}}d(a,b);const e={...c,'process_id':basename(b),'forked_from':c['process_id'],'archived':![],'updated_at':new Date()['toISOString']()};return writeFileSync(manifestPath(b),JSON['stringify'](e,null,0x2),'utf-8'),appendEvent(b,{'timestamp':new Date()['toISOString'](),'event':'process_forked','reason':'forked\x20from\x20'+c['process_id']+'\x20('+a+')','data':{'source_dir':a,'source_process':c['process_id']}}),e;}export function listProcesses(a=processesRootDir()){if(!existsSync(a))return[];const b=[];for(const c of readdirSync(a,{'withFileTypes':!![]})){if(!c['isDirectory']())continue;const d=join(a,c['name']);if(!existsSync(manifestPath(d)))continue;const f={'dir_name':c['name'],'path':d,'archived':![],'mtime':0x0};try{f['manifest']=loadManifest(d),f['archived']=f['manifest']['archived'];}catch{}try{const g=loadStageState(d);g&&(f['current_stage']=g['current_stage'],f['stages']=g['stages'],f['committed_stages']=g['stages']['filter'](h=>g['stage_meta'][h]?.['committed']));}catch{}try{f['mtime']=statSync(d)['mtimeMs'];}catch{}b['push'](f);}return b['sort']((h,i)=>i['mtime']-h['mtime']);}
@@ -58,6 +58,30 @@ export interface ProblemRecord {
58
58
  event_type: string;
59
59
  };
60
60
  }
61
+ export type SuggestionKind = "advance_stage" | "complete_goal" | "register_object" | "note";
62
+ export interface SuggestionRecord {
63
+ id: string;
64
+ created_at: string;
65
+ object?: string;
66
+ kind: SuggestionKind;
67
+ stage?: string;
68
+ objects?: {
69
+ type: string;
70
+ object: string;
71
+ }[];
72
+ title: string;
73
+ detail?: string;
74
+ status: "pending" | "confirmed" | "dismissed";
75
+ resolved_at?: string;
76
+ resolution_note?: string;
77
+ applied?: boolean;
78
+ origin?: {
79
+ source: "monitor";
80
+ network: string;
81
+ event_id: string;
82
+ event_type: string;
83
+ };
84
+ }
61
85
  export interface FeedbackRecord {
62
86
  id: string;
63
87
  at: string;
@@ -1 +1 @@
1
- import{listServices,getServiceInfo,toggle as a384a,setEnabled as a384b,reset as a384c}from'../../config/index.js';import{strictParse}from'../../schema/index.js';import{ConfigOperationInputSchema}from'../../schema/config/index.js';export async function handleConfigOperation(a){const b=strictParse(ConfigOperationInputSchema,a,'config_operation\x20input'),{action:c,service:d}=b;let e;switch(c){case'list':e={'action':'list','services':listServices()};break;case'toggle':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20toggle');const f=d,g=getServiceInfo(f);if(!g)throw new Error('Unknown\x20service:\x20'+f+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');const h=a384a(f);e={'action':'toggle','service':f,'enabled':h,'reminder':g['reminder']};break;}case'enable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20enable');const i=d,j=getServiceInfo(i);if(!j)throw new Error('Unknown\x20service:\x20'+i+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a384b(i,!![]),e={'action':'enable','service':i,'enabled':!![],'reminder':j['reminder']};break;}case'disable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20disable');const k=d,l=getServiceInfo(k);if(!l)throw new Error('Unknown\x20service:\x20'+k+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a384b(k,![]),e={'action':'disable','service':k,'enabled':![],'reminder':l['reminder']};break;}case'reset':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20reset');const m=d,n=getServiceInfo(m);if(!n)throw new Error('Unknown\x20service:\x20'+m+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a384c(m),e={'action':'reset','service':m,'enabled':getServiceInfo(m)?.['enabled'],'reminder':n['reminder'],'reset':!![]};break;}case'info':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20info');const o=d,p=getServiceInfo(o);if(!p)throw new Error('Unknown\x20service:\x20'+o+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');e={'action':'info',...p};break;}default:throw new Error('Unknown\x20config_operation\x20action:\x20'+String(c));}return{'content':[{'type':'text','text':JSON['stringify']({'result':e})}],'structuredContent':{'result':e}};}
1
+ import{listServices,getServiceInfo,toggle as a391a,setEnabled as a391b,reset as a391c}from'../../config/index.js';import{strictParse}from'../../schema/index.js';import{ConfigOperationInputSchema}from'../../schema/config/index.js';export async function handleConfigOperation(a){const b=strictParse(ConfigOperationInputSchema,a,'config_operation\x20input'),{action:c,service:d}=b;let e;switch(c){case'list':e={'action':'list','services':listServices()};break;case'toggle':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20toggle');const f=d,g=getServiceInfo(f);if(!g)throw new Error('Unknown\x20service:\x20'+f+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');const h=a391a(f);e={'action':'toggle','service':f,'enabled':h,'reminder':g['reminder']};break;}case'enable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20enable');const i=d,j=getServiceInfo(i);if(!j)throw new Error('Unknown\x20service:\x20'+i+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a391b(i,!![]),e={'action':'enable','service':i,'enabled':!![],'reminder':j['reminder']};break;}case'disable':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20disable');const k=d,l=getServiceInfo(k);if(!l)throw new Error('Unknown\x20service:\x20'+k+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a391b(k,![]),e={'action':'disable','service':k,'enabled':![],'reminder':l['reminder']};break;}case'reset':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20reset');const m=d,n=getServiceInfo(m);if(!n)throw new Error('Unknown\x20service:\x20'+m+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');a391c(m),e={'action':'reset','service':m,'enabled':getServiceInfo(m)?.['enabled'],'reminder':n['reminder'],'reset':!![]};break;}case'info':{if(!d)throw new Error('\x27service\x27\x20param\x20is\x20required\x20for\x20info');const o=d,p=getServiceInfo(o);if(!p)throw new Error('Unknown\x20service:\x20'+o+'.\x20Use\x20action=\x27list\x27\x20to\x20see\x20all\x20valid\x20services.');e={'action':'info',...p};break;}default:throw new Error('Unknown\x20config_operation\x20action:\x20'+String(c));}return{'content':[{'type':'text','text':JSON['stringify']({'result':e})}],'structuredContent':{'result':e}};}