@nexusclawhq/cli 0.2.4 → 0.3.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 (228) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +5 -0
  3. package/dist/build-info.json +5 -5
  4. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/agent-executable-assets/cli-contract.types.d.ts +1 -1
  5. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/cognitive-policy.types.d.ts +19 -1
  6. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/en-US.d.ts +686 -95
  7. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/en-US.js +19426 -18705
  8. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/en-US.js.map +1 -1
  9. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/index.d.ts +1372 -190
  10. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/zh-CN.d.ts +686 -95
  11. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/zh-CN.js +19467 -18789
  12. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/zh-CN.js.map +1 -1
  13. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/platform-admin-route-readiness/index.js +2 -11
  14. package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/platform-admin-route-readiness/index.js.map +1 -1
  15. package/dist/nexus-cli/node_modules/@nexusclaw/shared/package.json +5 -1
  16. package/dist/nexus-cli/src/cli.js +2 -0
  17. package/dist/nexus-cli/src/cli.js.map +1 -1
  18. package/dist/nexus-cli/src/commands/ai/help.test.js +11 -29
  19. package/dist/nexus-cli/src/commands/ai/help.test.js.map +1 -1
  20. package/dist/nexus-cli/src/commands/commands.test.js +81 -1
  21. package/dist/nexus-cli/src/commands/commands.test.js.map +1 -1
  22. package/dist/nexus-cli/src/commands/employee/deploy.js +35 -9
  23. package/dist/nexus-cli/src/commands/employee/deploy.js.map +1 -1
  24. package/dist/nexus-cli/src/commands/org/index.js +2 -0
  25. package/dist/nexus-cli/src/commands/org/index.js.map +1 -1
  26. package/dist/nexus-cli/src/commands/org/step-up.d.ts +2 -0
  27. package/dist/nexus-cli/src/commands/org/step-up.js +75 -0
  28. package/dist/nexus-cli/src/commands/org/step-up.js.map +1 -0
  29. package/dist/nexus-cli/src/commands/workforce/approval.d.ts +2 -0
  30. package/dist/nexus-cli/src/commands/workforce/approval.js +60 -0
  31. package/dist/nexus-cli/src/commands/workforce/approval.js.map +1 -0
  32. package/dist/nexus-cli/src/commands/workforce/cognition.d.ts +2 -0
  33. package/dist/nexus-cli/src/commands/workforce/cognition.js +62 -0
  34. package/dist/nexus-cli/src/commands/workforce/cognition.js.map +1 -0
  35. package/dist/nexus-cli/src/commands/workforce/constitution.d.ts +2 -0
  36. package/dist/nexus-cli/src/commands/workforce/constitution.js +37 -0
  37. package/dist/nexus-cli/src/commands/workforce/constitution.js.map +1 -0
  38. package/dist/nexus-cli/src/commands/workforce/guardrail.d.ts +2 -0
  39. package/dist/nexus-cli/src/commands/workforce/guardrail.js +67 -0
  40. package/dist/nexus-cli/src/commands/workforce/guardrail.js.map +1 -0
  41. package/dist/nexus-cli/src/commands/workforce/index.d.ts +2 -0
  42. package/dist/nexus-cli/src/commands/workforce/index.js +43 -0
  43. package/dist/nexus-cli/src/commands/workforce/index.js.map +1 -0
  44. package/dist/nexus-cli/src/commands/workforce/knowledge.d.ts +2 -0
  45. package/dist/nexus-cli/src/commands/workforce/knowledge.js +143 -0
  46. package/dist/nexus-cli/src/commands/workforce/knowledge.js.map +1 -0
  47. package/dist/nexus-cli/src/commands/workforce/learning.d.ts +2 -0
  48. package/dist/nexus-cli/src/commands/workforce/learning.js +146 -0
  49. package/dist/nexus-cli/src/commands/workforce/learning.js.map +1 -0
  50. package/dist/nexus-cli/src/commands/workforce/observe.d.ts +2 -0
  51. package/dist/nexus-cli/src/commands/workforce/observe.js +152 -0
  52. package/dist/nexus-cli/src/commands/workforce/observe.js.map +1 -0
  53. package/dist/nexus-cli/src/commands/workforce/orchestration.d.ts +2 -0
  54. package/dist/nexus-cli/src/commands/workforce/orchestration.js +199 -0
  55. package/dist/nexus-cli/src/commands/workforce/orchestration.js.map +1 -0
  56. package/dist/nexus-cli/src/commands/workforce/permission.d.ts +2 -0
  57. package/dist/nexus-cli/src/commands/workforce/permission.js +113 -0
  58. package/dist/nexus-cli/src/commands/workforce/permission.js.map +1 -0
  59. package/dist/nexus-cli/src/commands/workforce/prompt.d.ts +2 -0
  60. package/dist/nexus-cli/src/commands/workforce/prompt.js +137 -0
  61. package/dist/nexus-cli/src/commands/workforce/prompt.js.map +1 -0
  62. package/dist/nexus-cli/src/commands/workforce/provider.d.ts +2 -0
  63. package/dist/nexus-cli/src/commands/workforce/provider.js +152 -0
  64. package/dist/nexus-cli/src/commands/workforce/provider.js.map +1 -0
  65. package/dist/nexus-cli/src/commands/workforce/rehearsal.d.ts +2 -0
  66. package/dist/nexus-cli/src/commands/workforce/rehearsal.js +71 -0
  67. package/dist/nexus-cli/src/commands/workforce/rehearsal.js.map +1 -0
  68. package/dist/nexus-cli/src/commands/workforce/release.d.ts +2 -0
  69. package/dist/nexus-cli/src/commands/workforce/release.js +24 -0
  70. package/dist/nexus-cli/src/commands/workforce/release.js.map +1 -0
  71. package/dist/nexus-cli/src/commands/workforce/shared.d.ts +8 -0
  72. package/dist/nexus-cli/src/commands/workforce/shared.js +86 -0
  73. package/dist/nexus-cli/src/commands/workforce/shared.js.map +1 -0
  74. package/dist/nexus-cli/src/commands/workforce/sop.d.ts +2 -0
  75. package/dist/nexus-cli/src/commands/workforce/sop.js +86 -0
  76. package/dist/nexus-cli/src/commands/workforce/sop.js.map +1 -0
  77. package/dist/nexus-cli/src/commands/workforce/task.d.ts +4 -0
  78. package/dist/nexus-cli/src/commands/workforce/task.js +67 -0
  79. package/dist/nexus-cli/src/commands/workforce/task.js.map +1 -0
  80. package/dist/nexus-cli/src/commands/workforce/test-case.d.ts +2 -0
  81. package/dist/nexus-cli/src/commands/workforce/test-case.js +121 -0
  82. package/dist/nexus-cli/src/commands/workforce/test-case.js.map +1 -0
  83. package/dist/nexus-cli/src/config/platform-seed-registry.json +134 -0
  84. package/dist/nexus-cli/src/contracts/command-contract.guard.js +25 -2
  85. package/dist/nexus-cli/src/contracts/command-contract.guard.js.map +1 -1
  86. package/dist/nexus-cli/src/contracts/command-contract.registry.js +2 -0
  87. package/dist/nexus-cli/src/contracts/command-contract.registry.js.map +1 -1
  88. package/dist/nexus-cli/src/contracts/contracts.test.js +40 -54
  89. package/dist/nexus-cli/src/contracts/contracts.test.js.map +1 -1
  90. package/dist/nexus-cli/src/contracts/workforce-contracts.d.ts +2 -0
  91. package/dist/nexus-cli/src/contracts/workforce-contracts.js +175 -0
  92. package/dist/nexus-cli/src/contracts/workforce-contracts.js.map +1 -0
  93. package/dist/nexus-cli/src/services/api-client.d.ts +37 -1
  94. package/dist/nexus-cli/src/services/api-client.js +120 -34
  95. package/dist/nexus-cli/src/services/api-client.js.map +1 -1
  96. package/dist/nexus-cli/src/services/api-client.test.js +87 -0
  97. package/dist/nexus-cli/src/services/api-client.test.js.map +1 -1
  98. package/dist/nexus-cli/src/services/package-self-containment.js +1 -0
  99. package/dist/nexus-cli/src/services/package-self-containment.js.map +1 -1
  100. package/dist/nexus-cli/src/services/step-up-helper.d.ts +43 -0
  101. package/dist/nexus-cli/src/services/step-up-helper.js +98 -0
  102. package/dist/nexus-cli/src/services/step-up-helper.js.map +1 -0
  103. package/dist/nexus-cli/src/services/step-up-helper.test.d.ts +1 -0
  104. package/dist/nexus-cli/src/services/step-up-helper.test.js +176 -0
  105. package/dist/nexus-cli/src/services/step-up-helper.test.js.map +1 -0
  106. package/dist/nexus-cli/src/services/step-up-interactive.d.ts +2 -0
  107. package/dist/nexus-cli/src/services/step-up-interactive.js +69 -0
  108. package/dist/nexus-cli/src/services/step-up-interactive.js.map +1 -0
  109. package/dist/nexus-cli/src/services/workforce-cognition-remote.d.ts +27 -0
  110. package/dist/nexus-cli/src/services/workforce-cognition-remote.js +48 -0
  111. package/dist/nexus-cli/src/services/workforce-cognition-remote.js.map +1 -0
  112. package/dist/nexus-cli/src/services/workforce-common.d.ts +2 -0
  113. package/dist/nexus-cli/src/services/workforce-common.js +20 -0
  114. package/dist/nexus-cli/src/services/workforce-common.js.map +1 -0
  115. package/dist/nexus-cli/src/services/workforce-config-remote.d.ts +127 -0
  116. package/dist/nexus-cli/src/services/workforce-config-remote.js +205 -0
  117. package/dist/nexus-cli/src/services/workforce-config-remote.js.map +1 -0
  118. package/dist/nexus-cli/src/services/workforce-distillation-remote.d.ts +118 -0
  119. package/dist/nexus-cli/src/services/workforce-distillation-remote.js +171 -0
  120. package/dist/nexus-cli/src/services/workforce-distillation-remote.js.map +1 -0
  121. package/dist/nexus-cli/src/services/workforce-guardrail-knowledge-remote.d.ts +105 -0
  122. package/dist/nexus-cli/src/services/workforce-guardrail-knowledge-remote.js +174 -0
  123. package/dist/nexus-cli/src/services/workforce-guardrail-knowledge-remote.js.map +1 -0
  124. package/dist/nexus-cli/src/services/workforce-learning-remote.d.ts +131 -0
  125. package/dist/nexus-cli/src/services/workforce-learning-remote.js +179 -0
  126. package/dist/nexus-cli/src/services/workforce-learning-remote.js.map +1 -0
  127. package/dist/nexus-cli/src/services/workforce-observe-remote.d.ts +97 -0
  128. package/dist/nexus-cli/src/services/workforce-observe-remote.js +207 -0
  129. package/dist/nexus-cli/src/services/workforce-observe-remote.js.map +1 -0
  130. package/dist/nexus-cli/src/services/workforce-ops-remote.d.ts +94 -0
  131. package/dist/nexus-cli/src/services/workforce-ops-remote.js +176 -0
  132. package/dist/nexus-cli/src/services/workforce-ops-remote.js.map +1 -0
  133. package/dist/nexus-cli/src/services/workforce-orchestration-remote.d.ts +132 -0
  134. package/dist/nexus-cli/src/services/workforce-orchestration-remote.js +244 -0
  135. package/dist/nexus-cli/src/services/workforce-orchestration-remote.js.map +1 -0
  136. package/dist/nexus-cli/src/services/workforce-permission-remote.d.ts +72 -0
  137. package/dist/nexus-cli/src/services/workforce-permission-remote.js +130 -0
  138. package/dist/nexus-cli/src/services/workforce-permission-remote.js.map +1 -0
  139. package/dist/nexus-cli/src/services/workforce-provider-remote.d.ts +82 -0
  140. package/dist/nexus-cli/src/services/workforce-provider-remote.js +129 -0
  141. package/dist/nexus-cli/src/services/workforce-provider-remote.js.map +1 -0
  142. package/dist/nexus-cli/src/services/workforce-test-remote.d.ts +85 -0
  143. package/dist/nexus-cli/src/services/workforce-test-remote.js +134 -0
  144. package/dist/nexus-cli/src/services/workforce-test-remote.js.map +1 -0
  145. package/dist/nexus-cli/src/templates/project/template-manifest.json +11 -5
  146. package/dist/nexus-cli/src/templates/project/templates/base-crm/README.md.tpl +4 -3
  147. package/dist/nexus-cli/src/templates/project/templates/base-crm/nexus-project.json.tpl +77 -13
  148. package/dist/nexus-cli/src/templates/project/templates/base-crm/nexus-project.yaml.tpl +68 -0
  149. package/dist/nexus-cli/src/templates/project/templates/demo-public-channel-store-delivery/README.md.tpl +4 -4
  150. package/dist/nexus-cli/src/templates/project/templates/demo-public-channel-store-delivery/nexus-project.json.tpl +77 -13
  151. package/dist/nexus-cli/src/templates/project/templates/demo-public-channel-store-delivery/nexus-project.yaml.tpl +71 -0
  152. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/README.md.tpl +4 -4
  153. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-app/main/default/isolated/drill-code-extension-page.manifest.json +63 -0
  154. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-app/main/default/nwc/drill-code-extension-page/index.js +70 -0
  155. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-app/main/default/tests/drill-code-extension-page.assertions.json +13 -0
  156. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-project.json.tpl +61 -7
  157. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-project.yaml.tpl +58 -0
  158. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/preview/drill-code-extension-page.html +1 -1
  159. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/scripts/build-component.mjs +1 -1
  160. package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/scripts/deploy-drill.mjs +1 -1
  161. package/dist/nexus-cli/src/templates/project/templates/empty/README.md.tpl +3 -2
  162. package/dist/nexus-cli/src/templates/project/templates/empty/nexus-project.json.tpl +79 -13
  163. package/dist/nexus-cli/src/templates/project/templates/empty/nexus-project.yaml.tpl +67 -0
  164. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/agent-instructions/claude.md +6 -0
  165. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/agent-instructions/codex.md +6 -0
  166. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/agent-instructions/generic.md +6 -0
  167. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/agent-instructions/glm-5.2.md +6 -0
  168. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/authoring/code-sdk.d.ts +1 -0
  169. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/authoring/command-order.json +1 -0
  170. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/authoring/flow-node-catalog.json +1 -0
  171. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/ai-policies.json +1 -0
  172. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/approval-policies.json +1 -0
  173. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/connectors.json +1 -0
  174. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/invokable-units.json +1 -0
  175. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/objects.json +1 -0
  176. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/cli-contract.json +1 -0
  177. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/context-lock.json +1 -0
  178. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/context-manifest.json +1 -0
  179. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/code/minimal-action.cases.json +1 -0
  180. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/code/minimal-action.input.schema.json +1 -0
  181. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/code/minimal-action.output.schema.json +1 -0
  182. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/code/minimal-action.ts +3 -0
  183. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/flow/minimal-manual-flow.json +1 -0
  184. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/agent-code-tool-catalog-v1.schema.json +1 -0
  185. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/ai-workforce-executable-bundle-v1.schema.json +1 -0
  186. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/approval-policy-authoring-catalog-v1.schema.json +1 -0
  187. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/code-action-cases-v1.schema.json +1 -0
  188. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/code-extension-governance-v2.schema.json +1 -0
  189. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/employee-package-v2.schema.json +1 -0
  190. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/flow-package-v1.schema.json +1 -0
  191. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/flows-payload-v2.schema.json +1 -0
  192. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/object-authoring-catalog-v1.schema.json +1 -0
  193. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/workforce-bundle-lock-v1.schema.json +1 -0
  194. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/workforce-release-evidence-v1.schema.json +1 -0
  195. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/workforce-runtime-bindings-v1.schema.json +1 -0
  196. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/workspace-authoring-contract-v1.schema.json +1 -0
  197. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/workspace-contract.json +1 -0
  198. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/README.md.tpl +41 -0
  199. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/nexus-project.json.tpl +86 -0
  200. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/nexus-project.yaml.tpl +61 -0
  201. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/package.json.tpl +25 -0
  202. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/.nexusclaw/scaffold.json +12 -0
  203. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/agent-tools.json +53 -0
  204. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/code/genericLookup.ts +5 -0
  205. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/package.yaml +28 -0
  206. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/schemas/genericLookup.input.schema.json +6 -0
  207. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/schemas/genericLookup.output.schema.json +6 -0
  208. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/tests/genericLookup.cases.json +26 -0
  209. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-flow/GenericFollowUp.flow.yaml +10 -0
  210. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/scripts/init-bundle.mjs +25 -0
  211. package/dist/nexus-cli/src/templates/project/templates/executable-workforce/tsconfig.json.tpl +10 -0
  212. package/dist/nexus-cli/src/templates/project/templates/industry-education/README.md.tpl +7 -1
  213. package/dist/nexus-cli/src/templates/project/templates/industry-education/nexus-project.json.tpl +77 -14
  214. package/dist/nexus-cli/src/templates/project/templates/industry-education/nexus-project.yaml.tpl +69 -0
  215. package/dist/nexus-cli/src/templates/project/templates/industry-finance/README.md.tpl +7 -1
  216. package/dist/nexus-cli/src/templates/project/templates/industry-finance/nexus-project.json.tpl +77 -14
  217. package/dist/nexus-cli/src/templates/project/templates/industry-finance/nexus-project.yaml.tpl +69 -0
  218. package/dist/nexus-cli/src/templates/project/templates/industry-healthcare/README.md.tpl +7 -1
  219. package/dist/nexus-cli/src/templates/project/templates/industry-healthcare/nexus-project.json.tpl +77 -14
  220. package/dist/nexus-cli/src/templates/project/templates/industry-healthcare/nexus-project.yaml.tpl +69 -0
  221. package/dist/nexus-cli/src/templates/project/templates/industry-partner-cloud/README.md.tpl +4 -4
  222. package/dist/nexus-cli/src/templates/project/templates/industry-partner-cloud/nexus-project.json.tpl +77 -13
  223. package/dist/nexus-cli/src/templates/project/templates/industry-partner-cloud/nexus-project.yaml.tpl +69 -0
  224. package/dist/nexus-cli/src/templates/project/templates/industry-retail/README.md.tpl +7 -1
  225. package/dist/nexus-cli/src/templates/project/templates/industry-retail/nexus-project.json.tpl +77 -14
  226. package/dist/nexus-cli/src/templates/project/templates/industry-retail/nexus-project.yaml.tpl +69 -0
  227. package/dist/tsconfig.tsbuildinfo +1 -1
  228. package/package.json +1 -1
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workforceApprovalCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const shared_1 = require("./shared");
6
+ const workforce_ops_remote_1 = require("../../services/workforce-ops-remote");
7
+ exports.workforceApprovalCommand = new commander_1.Command('approval')
8
+ .description('审批实例操作(submit / approve / reject / recall / delegate)');
9
+ exports.workforceApprovalCommand.command('submit')
10
+ .description('提交记录进入审批流程(submitForApproval)')
11
+ .requiredOption('--target-org <alias>')
12
+ .requiredOption('--record-id <id>')
13
+ .requiredOption('--process-id <id>')
14
+ .option('--json')
15
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.approval.submit', await (0, workforce_ops_remote_1.submitForApprovalRemote)({
16
+ targetOrg: options.targetOrg,
17
+ recordId: options.recordId,
18
+ processId: options.processId,
19
+ }), options.json));
20
+ exports.workforceApprovalCommand.command('approve')
21
+ .requiredOption('--target-org <alias>')
22
+ .requiredOption('--instance-id <id>')
23
+ .option('--comments <text>')
24
+ .option('--json')
25
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.approval.approve', await (0, workforce_ops_remote_1.approveInstanceRemote)({
26
+ targetOrg: options.targetOrg,
27
+ instanceId: options.instanceId,
28
+ comments: options.comments,
29
+ }), options.json));
30
+ exports.workforceApprovalCommand.command('reject')
31
+ .requiredOption('--target-org <alias>')
32
+ .requiredOption('--instance-id <id>')
33
+ .option('--comments <text>')
34
+ .option('--json')
35
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.approval.reject', await (0, workforce_ops_remote_1.rejectInstanceRemote)({
36
+ targetOrg: options.targetOrg,
37
+ instanceId: options.instanceId,
38
+ comments: options.comments,
39
+ }), options.json));
40
+ exports.workforceApprovalCommand.command('recall')
41
+ .description('撤回审批(v2 subject 实例后端会抛 409 APPROVAL_SUBJECT_RECALL_FORBIDDEN)')
42
+ .requiredOption('--target-org <alias>')
43
+ .requiredOption('--instance-id <id>')
44
+ .option('--json')
45
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.approval.recall', await (0, workforce_ops_remote_1.recallInstanceRemote)({
46
+ targetOrg: options.targetOrg,
47
+ instanceId: options.instanceId,
48
+ }), options.json));
49
+ exports.workforceApprovalCommand.command('delegate')
50
+ .description('委派审批(v2 subject 实例后端会抛 409 APPROVAL_SUBJECT_DELEGATION_FORBIDDEN)')
51
+ .requiredOption('--target-org <alias>')
52
+ .requiredOption('--instance-id <id>')
53
+ .requiredOption('--delegate-user-id <id>')
54
+ .option('--json')
55
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.approval.delegate', await (0, workforce_ops_remote_1.delegateApprovalRemote)({
56
+ targetOrg: options.targetOrg,
57
+ instanceId: options.instanceId,
58
+ delegateUserId: options.delegateUserId,
59
+ }), options.json));
60
+ //# sourceMappingURL=approval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/approval.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,qCAA+C;AAC/C,8EAM6C;AAWhC,QAAA,wBAAwB,GAAG,IAAI,mBAAO,CAAC,UAAU,CAAC;KAC5D,WAAW,CAAC,uDAAuD,CAAC,CAAC;AAExE,gCAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC;KACvC,WAAW,CAAC,+BAA+B,CAAC;KAC5C,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,kBAAkB,CAAC;KAClC,cAAc,CAAC,mBAAmB,CAAC;KACnC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,2BAA2B,EAC3B,MAAM,IAAA,8CAAuB,EAAC;IAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;IAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;CAC7B,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC;AAEL,gCAAwB,CAAC,OAAO,CAAC,SAAS,CAAC;KACxC,cAAc,CAAC,sBAAsB,CAAC;KACt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AC,IAAI,CACb,CAAC,CAAC;AAEL,gCAAwB,CAAC,OAAO,CAAC,UAAU,CAAC;KACzC,WAAW,CAAC,mEAAmE,CAAC;KAChF,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,oBAAoB,CAAC;KACpC,cAAc,CAAC,yBAAyB,CAAC;KACzC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,6BAA6B,EAC7B,MAAM,IAAA,6CAAsB,EAAC;IAC3B,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;CACvC,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare const workforceCognitionCommand: Command;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workforceCognitionCommand = void 0;
4
+ const node_crypto_1 = require("node:crypto");
5
+ const commander_1 = require("commander");
6
+ const shared_1 = require("./shared");
7
+ const workforce_cognition_remote_1 = require("../../services/workforce-cognition-remote");
8
+ exports.workforceCognitionCommand = new commander_1.Command('cognition')
9
+ .description('认知面 mutate:机会确认/拒绝 + 记忆转换');
10
+ const opportunityCommand = exports.workforceCognitionCommand.command('opportunity')
11
+ .description('主动履职机会确认/拒绝');
12
+ opportunityCommand.command('confirm')
13
+ .description('确认机会并派发执行(confirmAiWorkforceOpportunity;STALE_PROPOSAL 需重取投影)')
14
+ .requiredOption('--target-org <alias>')
15
+ .requiredOption('--proposal-id <id>')
16
+ .requiredOption('--proposal-digest <digest>')
17
+ .requiredOption('--state-fingerprint <fingerprint>')
18
+ .option('--json')
19
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.cognition.opportunity.confirm', await (0, workforce_cognition_remote_1.confirmOpportunityRemote)({
20
+ targetOrg: options.targetOrg,
21
+ proposalId: options.proposalId,
22
+ proposalDigest: options.proposalDigest,
23
+ stateFingerprint: options.stateFingerprint,
24
+ }), options.json));
25
+ opportunityCommand.command('reject')
26
+ .requiredOption('--target-org <alias>')
27
+ .requiredOption('--proposal-id <id>')
28
+ .requiredOption('--proposal-digest <digest>')
29
+ .requiredOption('--reason-code <code>')
30
+ .option('--json')
31
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.cognition.opportunity.reject', await (0, workforce_cognition_remote_1.rejectOpportunityRemote)({
32
+ targetOrg: options.targetOrg,
33
+ proposalId: options.proposalId,
34
+ proposalDigest: options.proposalDigest,
35
+ reasonCode: options.reasonCode,
36
+ }), options.json));
37
+ const memoryCommand = exports.workforceCognitionCommand.command('memory')
38
+ .description('员工记忆状态转换(乐观锁;procedural 类禁转)');
39
+ memoryCommand.command('transition')
40
+ .description('转换记忆状态(transitionAiWorkforceMemory;toStatus ∈ active|archived|revoked)')
41
+ .requiredOption('--target-org <alias>')
42
+ .requiredOption('--memory-item-id <id>')
43
+ .requiredOption('--expected-generation <n>', '乐观锁:当前 revision')
44
+ .requiredOption('--to-status <status>', 'active|archived|revoked')
45
+ .requiredOption('--reason-code <code>')
46
+ .option('--idempotency-key <key>', '不传则自动生成')
47
+ .option('--json')
48
+ .action(async (options) => {
49
+ const toStatus = options.toStatus;
50
+ if (!['active', 'archived', 'revoked'].includes(toStatus)) {
51
+ throw new Error('TO_STATUS_INVALID: --to-status 必须是 active|archived|revoked');
52
+ }
53
+ (0, shared_1.emitWorkforceResult)('workforce.cognition.memory.transition', await (0, workforce_cognition_remote_1.transitionMemoryRemote)({
54
+ targetOrg: options.targetOrg,
55
+ memoryItemId: options.memoryItemId,
56
+ expectedGeneration: Number(options.expectedGeneration),
57
+ toStatus,
58
+ reasonCode: options.reasonCode,
59
+ idempotencyKey: options.idempotencyKey ?? (0, node_crypto_1.randomUUID)(),
60
+ }), options.json);
61
+ });
62
+ //# sourceMappingURL=cognition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cognition.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/cognition.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,yCAAoC;AAEpC,qCAA+C;AAC/C,0FAImD;AAgBtC,QAAA,yBAAyB,GAAG,IAAI,mBAAO,CAAC,WAAW,CAAC;KAC9D,WAAW,CAAC,2BAA2B,CAAC,CAAC;AAE5C,MAAM,kBAAkB,GAAG,iCAAyB,CAAC,OAAO,CAAC,aAAa,CAAC;KACxE,WAAW,CAAC,aAAa,CAAC,CAAC;AAE9B,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAAC;KAClC,WAAW,CAAC,+DAA+D,CAAC;KAC5E,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,oBAAoB,CAAC;KACpC,cAAc,CAAC,4BAA4B,CAAC;KAC5C,cAAc,CAAC,mCAAmC,CAAC;KACnD,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,yCAAyC,EACzC,MAAM,IAAA,qDAAwB,EAAC;IAC7B,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;IACtC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;CAC3C,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC;AAEL,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC;KACjC,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,oBAAoB,CAAC;KACpC,cAAc,CAAC,4BAA4B,CAAC;KAC5C,cAAc,CAAC,sBAAsB,CAAC;KACtC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5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O,CAAC,cAAc,IAAI,IAAA,wBAAU,GAAE;KACvD,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare const workforceConstitutionCommand: Command;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workforceConstitutionCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const shared_1 = require("./shared");
6
+ const workforce_config_remote_1 = require("../../services/workforce-config-remote");
7
+ exports.workforceConstitutionCommand = new commander_1.Command('constitution')
8
+ .description('工作区行为准则(publishWorkspaceConstitution / rollback)');
9
+ exports.workforceConstitutionCommand.command('publish')
10
+ .description('发布行为准则新版本(publishWorkspaceConstitution)')
11
+ .requiredOption('--target-org <alias>')
12
+ .requiredOption('--content <text>', '准则正文(可传 @file 读文件)')
13
+ .option('--json')
14
+ .action(async (options) => {
15
+ const content = await (0, shared_1.resolveContentOption)(options.content);
16
+ (0, shared_1.emitWorkforceResult)('workforce.constitution.publish', await (0, workforce_config_remote_1.publishConstitutionRemote)({ targetOrg: options.targetOrg, content }), options.json);
17
+ });
18
+ exports.workforceConstitutionCommand.command('rollback')
19
+ .description('回滚到指定版本(rollbackWorkspaceConstitution)')
20
+ .requiredOption('--target-org <alias>')
21
+ .requiredOption('--target-version-number <n>')
22
+ .option('--json')
23
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.constitution.rollback', await (0, workforce_config_remote_1.rollbackConstitutionRemote)({
24
+ targetOrg: options.targetOrg,
25
+ targetVersionNumber: Number(options.targetVersionNumber),
26
+ }), options.json));
27
+ exports.workforceConstitutionCommand.command('get')
28
+ .description('读取当前生效的行为准则')
29
+ .requiredOption('--target-org <alias>')
30
+ .option('--json')
31
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.constitution.get', await (0, workforce_config_remote_1.getConstitutionRemote)({ targetOrg: options.targetOrg }), options.json));
32
+ exports.workforceConstitutionCommand.command('versions')
33
+ .description('列出所有历史版本')
34
+ .requiredOption('--target-org <alias>')
35
+ .option('--json')
36
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.constitution.versions', await (0, workforce_config_remote_1.listConstitutionVersionsRemote)({ targetOrg: options.targetOrg }), options.json));
37
+ //# sourceMappingURL=constitution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constitution.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/constitution.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,qCAAqE;AACrE,oFAKgD;AAOnC,QAAA,4BAA4B,GAAG,IAAI,mBAAO,CAAC,cAAc,CAAC;KACpE,WAAW,CAAC,kDAAkD,CAAC,CAAC;AAEnE,oCAA4B,CAAC,OAAO,CAAC,SAAS,CAAC;KAC5C,WAAW,CAAC,yCAAyC,CAAC;KACtD,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,kBAAkB,EAAE,oBAAoB,CAAC;KACxD,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,MAAM,OAAO,GAAG,MAAM,IAAA,6BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5D,IAAA,4BAAmB,EACjB,gCAAgC,EAChC,MAAM,IAAA,mDAAyB,EAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAC1E,OAAO,CAAC,IAAI,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,oCAA4B,CAAC,OAAO,CAAC,UAAU,CAAC;KAC7C,WAAW,CAAC,wCAAwC,CAAC;KACrD,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,6BAA6B,CAAC;KAC7C,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,iCAAiC,EACjC,MAAM,IAAA,oDAA0B,EAAC;IAC/B,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,mBAAmB,EAAE,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC;CACzD,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC;AAEL,oCAA4B,CAAC,OAAO,CAAC,KAAK,CAAC;KACxC,WAAW,CAAC,aAAa,CAAC;KAC1B,cAAc,CAAC,sBAAsB,CAAC;KACtC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,4BAA4B,EAC5B,MAAM,IAAA,+CAAqB,EAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EAC7D,OAAO,CAAC,IAAI,CACb,CAAC,CAAC;AAEL,oCAA4B,CAAC,OAAO,CAAC,UAAU,CAAC;KAC7C,WAAW,CAAC,UAAU,CAAC;KACvB,cAAc,CAAC,sBAAsB,CAAC;KACtC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,iCAAiC,EACjC,MAAM,IAAA,wDAA8B,EAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EACtE,OAAO,CAAC,IAAI,CACb,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare const workforceGuardrailCommand: Command;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workforceGuardrailCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const shared_1 = require("./shared");
6
+ const workforce_guardrail_knowledge_remote_1 = require("../../services/workforce-guardrail-knowledge-remote");
7
+ exports.workforceGuardrailCommand = new commander_1.Command('guardrail')
8
+ .description('风险护栏 CRUD / toggle / reorder');
9
+ exports.workforceGuardrailCommand.command('create')
10
+ .requiredOption('--target-org <alias>')
11
+ .requiredOption('--name <name>')
12
+ .requiredOption('--conditions <json|@file>')
13
+ .requiredOption('--risk-level <level>', '如 L0|L1|L2|L3|L4')
14
+ .requiredOption('--action <json|@file>')
15
+ .option('--description <text>')
16
+ .option('--priority <n>')
17
+ .option('--json')
18
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.guardrail.create', await (0, workforce_guardrail_knowledge_remote_1.createGuardrailRemote)({
19
+ targetOrg: options.targetOrg,
20
+ name: options.name,
21
+ description: options.description,
22
+ conditions: await (0, shared_1.parseJsonOption)(options.conditions),
23
+ riskLevel: options.riskLevel,
24
+ action: await (0, shared_1.parseJsonOption)(options.action),
25
+ priority: options.priority ? Number(options.priority) : undefined,
26
+ }), options.json));
27
+ exports.workforceGuardrailCommand.command('update')
28
+ .requiredOption('--target-org <alias>')
29
+ .requiredOption('--id <id>')
30
+ .option('--name <name>')
31
+ .option('--description <text>')
32
+ .option('--conditions <json|@file>')
33
+ .option('--risk-level <level>')
34
+ .option('--action <json|@file>')
35
+ .option('--priority <n>')
36
+ .option('--json')
37
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.guardrail.update', await (0, workforce_guardrail_knowledge_remote_1.updateGuardrailRemote)({
38
+ targetOrg: options.targetOrg,
39
+ id: options.id,
40
+ name: options.name,
41
+ description: options.description,
42
+ conditions: options.conditions ? await (0, shared_1.parseJsonOption)(options.conditions) : undefined,
43
+ riskLevel: options.riskLevel,
44
+ action: options.action ? await (0, shared_1.parseJsonOption)(options.action) : undefined,
45
+ priority: options.priority ? Number(options.priority) : undefined,
46
+ }), options.json));
47
+ exports.workforceGuardrailCommand.command('delete')
48
+ .requiredOption('--target-org <alias>')
49
+ .requiredOption('--id <id>')
50
+ .option('--json')
51
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.guardrail.delete', await (0, workforce_guardrail_knowledge_remote_1.deleteGuardrailRemote)({ targetOrg: options.targetOrg, id: options.id }), options.json));
52
+ exports.workforceGuardrailCommand.command('toggle')
53
+ .description('切换启用状态(toggleGuardrailRuleActive)')
54
+ .requiredOption('--target-org <alias>')
55
+ .requiredOption('--id <id>')
56
+ .option('--json')
57
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.guardrail.toggle', await (0, workforce_guardrail_knowledge_remote_1.toggleGuardrailRemote)({ targetOrg: options.targetOrg, id: options.id }), options.json));
58
+ exports.workforceGuardrailCommand.command('reorder')
59
+ .description('按给定顺序重排(reorderGuardrailRules)')
60
+ .requiredOption('--target-org <alias>')
61
+ .requiredOption('--ordered-ids <id...>')
62
+ .option('--json')
63
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.guardrail.reorder', await (0, workforce_guardrail_knowledge_remote_1.reorderGuardrailsRemote)({
64
+ targetOrg: options.targetOrg,
65
+ orderedIds: options.orderedIds,
66
+ }), options.json));
67
+ //# sourceMappingURL=guardrail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardrail.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/guardrail.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,qCAAgE;AAChE,8GAM6D;AAQhD,QAAA,yBAAyB,GAAG,IAAI,mBAAO,CAAC,WAAW,CAAC;KAC9D,WAAW,CAAC,8BAA8B,CAAC,CAAC;AAE/C,iCAAyB,CAAC,OAAO,CAAC,QAAQ,CAAC;KACxC,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,eAAe,CAAC;KAC/B,cAAc,CAAC,2BAA2B,CAAC;KAC3C,cAAc,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;KAC1D,cAAc,CAAC,uBAAuB,CAAC;KACvC,MAAM,CAAC,sBAAsB,CAAC;KAC9B,MAAM,CAAC,gBAAgB,CAAC;KACxB,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5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AsB,CAAC;KACtC,cAAc,CAAC,uBAAuB,CAAC;KACvC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,6BAA6B,EAC7B,MAAM,IAAA,8DAAuB,EAAC;IAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;CAC/B,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerWorkforceCommands(program: Command): void;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerWorkforceCommands = registerWorkforceCommands;
4
+ const approval_1 = require("./approval");
5
+ const cognition_1 = require("./cognition");
6
+ const constitution_1 = require("./constitution");
7
+ const task_1 = require("./task");
8
+ const guardrail_1 = require("./guardrail");
9
+ const knowledge_1 = require("./knowledge");
10
+ const learning_1 = require("./learning");
11
+ const orchestration_1 = require("./orchestration");
12
+ const observe_1 = require("./observe");
13
+ const permission_1 = require("./permission");
14
+ const prompt_1 = require("./prompt");
15
+ const provider_1 = require("./provider");
16
+ const rehearsal_1 = require("./rehearsal");
17
+ const release_1 = require("./release");
18
+ const sop_1 = require("./sop");
19
+ const test_case_1 = require("./test-case");
20
+ function registerWorkforceCommands(program) {
21
+ const workforceCommand = program
22
+ .command('workforce')
23
+ .description('AI 数字员工训练 / 治理 CLI(脱离 UI 的全量操作面)');
24
+ workforceCommand.addCommand(learning_1.workforceLearningCommand);
25
+ workforceCommand.addCommand(sop_1.workforceSopCommand);
26
+ workforceCommand.addCommand(cognition_1.workforceCognitionCommand);
27
+ workforceCommand.addCommand(constitution_1.workforceConstitutionCommand);
28
+ workforceCommand.addCommand(prompt_1.workforcePromptCommand);
29
+ workforceCommand.addCommand(guardrail_1.workforceGuardrailCommand);
30
+ workforceCommand.addCommand(knowledge_1.workforceKnowledgeCommand);
31
+ workforceCommand.addCommand(provider_1.workforceProviderCommand);
32
+ workforceCommand.addCommand(permission_1.workforcePermissionCommand);
33
+ workforceCommand.addCommand(test_case_1.workforceTestCaseCommand);
34
+ workforceCommand.addCommand(release_1.workforceReleaseCommand);
35
+ workforceCommand.addCommand(task_1.workforceTaskCommand);
36
+ workforceCommand.addCommand(task_1.workforceExecutionCommand);
37
+ workforceCommand.addCommand(task_1.workforceFeedbackCommand);
38
+ workforceCommand.addCommand(approval_1.workforceApprovalCommand);
39
+ workforceCommand.addCommand(rehearsal_1.workforceRehearsalCommand);
40
+ workforceCommand.addCommand(orchestration_1.workforceOrchestrationCommand);
41
+ workforceCommand.addCommand(observe_1.workforceObserveCommand);
42
+ }
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/index.ts"],"names":[],"mappings":";;AAgCA,8DAgCC;AA9DD,yCAAsD;AACtD,2CAAwD;AACxD,iDAA8D;AAC9D,iCAAmG;AACnG,2CAAwD;AACxD,2CAAwD;AACxD,yCAAsD;AACtD,mDAAgE;AAChE,uCAAoD;AACpD,6CAA0D;AAC1D,qCAAkD;AAClD,yCAAsD;AACtD,2CAAwD;AACxD,uCAAoD;AACpD,+BAA4C;AAC5C,2CAAuD;AAevD,SAAgB,yBAAyB,CAAC,OAAgB;IACxD,MAAM,gBAAgB,GAAG,OAAO;SAC7B,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,kCAAkC,CAAC,CAAC;IAGnD,gBAAgB,CAAC,UAAU,CAAC,mCAAwB,CAAC,CAAC;IAEtD,gBAAgB,CAAC,UAAU,CAAC,yBAAmB,CAAC,CAAC;IAEjD,gBAAgB,CAAC,UAAU,CAAC,qCAAyB,CAAC,CAAC;IAEvD,gBAAgB,CAAC,UAAU,CAAC,2CAA4B,CAAC,CAAC;IAC1D,gBAAgB,CAAC,UAAU,CAAC,+BAAsB,CAAC,CAAC;IACpD,gBAAgB,CAAC,UAAU,CAAC,qCAAyB,CAAC,CAAC;IACvD,gBAAgB,CAAC,UAAU,CAAC,qCAAyB,CAAC,CAAC;IACvD,gBAAgB,CAAC,UAAU,CAAC,mCAAwB,CAAC,CAAC;IACtD,gBAAgB,CAAC,UAAU,CAAC,uCAA0B,CAAC,CAAC;IAExD,gBAAgB,CAAC,UAAU,CAAC,oCAAwB,CAAC,CAAC;IAEtD,gBAAgB,CAAC,UAAU,CAAC,iCAAuB,CAAC,CAAC;IAErD,gBAAgB,CAAC,UAAU,CAAC,2BAAoB,CAAC,CAAC;IAClD,gBAAgB,CAAC,UAAU,CAAC,gCAAyB,CAAC,CAAC;IACvD,gBAAgB,CAAC,UAAU,CAAC,+BAAwB,CAAC,CAAC;IACtD,gBAAgB,CAAC,UAAU,CAAC,mCAAwB,CAAC,CAAC;IACtD,gBAAgB,CAAC,UAAU,CAAC,qCAAyB,CAAC,CAAC;IAEvD,gBAAgB,CAAC,UAAU,CAAC,6CAA6B,CAAC,CAAC;IAE3D,gBAAgB,CAAC,UAAU,CAAC,iCAAuB,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare const workforceKnowledgeCommand: Command;
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.workforceKnowledgeCommand = void 0;
37
+ const node_fs_1 = require("node:fs");
38
+ const commander_1 = require("commander");
39
+ const shared_1 = require("./shared");
40
+ const workforce_guardrail_knowledge_remote_1 = require("../../services/workforce-guardrail-knowledge-remote");
41
+ exports.workforceKnowledgeCommand = new commander_1.Command('knowledge')
42
+ .description('知识资产 ingestion(chunk / document / file / url)');
43
+ exports.workforceKnowledgeCommand.command('chunk-create')
44
+ .description('直接创建一条知识 chunk')
45
+ .requiredOption('--target-org <alias>')
46
+ .requiredOption('--title <title>')
47
+ .requiredOption('--content <text|@file>')
48
+ .option('--content-type <type>', '默认 text')
49
+ .option('--source-type <type>')
50
+ .option('--source-object <apiName>')
51
+ .option('--source-record-id <id>')
52
+ .option('--org-node-id <id>')
53
+ .option('--access-level <level>', 'private|public')
54
+ .option('--metadata <json|@file>')
55
+ .option('--json')
56
+ .action(async (options) => {
57
+ const { parseJsonOption } = await Promise.resolve().then(() => __importStar(require('./shared')));
58
+ (0, shared_1.emitWorkforceResult)('workforce.knowledge.chunk_create', await (0, workforce_guardrail_knowledge_remote_1.createKnowledgeChunkRemote)({
59
+ targetOrg: options.targetOrg,
60
+ title: options.title,
61
+ content: await (0, shared_1.resolveContentOption)(options.content),
62
+ contentType: options.contentType,
63
+ sourceType: options.sourceType,
64
+ sourceObject: options.sourceObject,
65
+ sourceRecordId: options.sourceRecordId,
66
+ orgNodeId: options.orgNodeId,
67
+ accessLevel: options.accessLevel,
68
+ metadata: await parseJsonOption(options.metadata),
69
+ }), options.json);
70
+ });
71
+ exports.workforceKnowledgeCommand.command('ingest-document')
72
+ .description('文本文档切分+embedding(ingestDocument)')
73
+ .requiredOption('--target-org <alias>')
74
+ .requiredOption('--title <title>')
75
+ .requiredOption('--content <text|@file>')
76
+ .option('--source-type <type>')
77
+ .option('--source-object <apiName>')
78
+ .option('--source-record-id <id>')
79
+ .option('--org-node-id <id>')
80
+ .option('--access-level <level>')
81
+ .option('--metadata <json|@file>')
82
+ .option('--json')
83
+ .action(async (options) => {
84
+ const { parseJsonOption } = await Promise.resolve().then(() => __importStar(require('./shared')));
85
+ (0, shared_1.emitWorkforceResult)('workforce.knowledge.ingest_document', await (0, workforce_guardrail_knowledge_remote_1.ingestDocumentRemote)({
86
+ targetOrg: options.targetOrg,
87
+ title: options.title,
88
+ content: await (0, shared_1.resolveContentOption)(options.content),
89
+ sourceType: options.sourceType,
90
+ sourceObject: options.sourceObject,
91
+ sourceRecordId: options.sourceRecordId,
92
+ orgNodeId: options.orgNodeId,
93
+ accessLevel: options.accessLevel,
94
+ metadata: await parseJsonOption(options.metadata),
95
+ }), options.json);
96
+ });
97
+ exports.workforceKnowledgeCommand.command('ingest-file')
98
+ .description('PDF/DOCX/TXT 文件切分+embedding(ingestKnowledgeFile)')
99
+ .requiredOption('--target-org <alias>')
100
+ .requiredOption('--file <path>', '本地文件路径(PDF/DOCX/TXT)')
101
+ .option('--access-level <level>')
102
+ .option('--org-node-id <id>')
103
+ .option('--json')
104
+ .action(async (options) => {
105
+ const bytes = (0, node_fs_1.readFileSync)(options.file);
106
+ const fileName = options.file.split('/').pop() ?? options.file;
107
+ const contentBase64 = bytes.toString('base64');
108
+ (0, shared_1.emitWorkforceResult)('workforce.knowledge.ingest_file', await (0, workforce_guardrail_knowledge_remote_1.ingestKnowledgeFileRemote)({
109
+ targetOrg: options.targetOrg,
110
+ fileName,
111
+ contentBase64,
112
+ accessLevel: options.accessLevel,
113
+ orgNodeId: options.orgNodeId,
114
+ }), options.json);
115
+ });
116
+ exports.workforceKnowledgeCommand.command('ingest-url')
117
+ .description('URL 抓取切分+embedding(ingestKnowledgeUrl,后端 SSRF 守卫+2MB cap)')
118
+ .requiredOption('--target-org <alias>')
119
+ .requiredOption('--url <url>')
120
+ .option('--title <title>')
121
+ .option('--access-level <level>')
122
+ .option('--json')
123
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.knowledge.ingest_url', await (0, workforce_guardrail_knowledge_remote_1.ingestKnowledgeUrlRemote)({
124
+ targetOrg: options.targetOrg,
125
+ url: options.url,
126
+ title: options.title,
127
+ accessLevel: options.accessLevel,
128
+ }), options.json));
129
+ exports.workforceKnowledgeCommand.command('delete')
130
+ .description('按 sourceRecordId 删除知识文档(deleteKnowledgeDocument)')
131
+ .requiredOption('--target-org <alias>')
132
+ .requiredOption('--source-record-id <id>')
133
+ .option('--json')
134
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.knowledge.delete', await (0, workforce_guardrail_knowledge_remote_1.deleteKnowledgeDocumentRemote)({
135
+ targetOrg: options.targetOrg,
136
+ sourceRecordId: options.sourceRecordId,
137
+ }), options.json));
138
+ exports.workforceKnowledgeCommand.command('reembed-failed')
139
+ .description('重新 embedding 失败 chunk(reembedFailedChunks)')
140
+ .requiredOption('--target-org <alias>')
141
+ .option('--json')
142
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.knowledge.reembed_failed', await (0, workforce_guardrail_knowledge_remote_1.reembedFailedChunksRemote)({ targetOrg: options.targetOrg }), options.json));
143
+ //# sourceMappingURL=knowledge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/knowledge.ts"],"names":[],"mappings":";;;;;;;;;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AAO,CAAC,WAAW;CACjC,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC;AAEL,iCAAyB,CAAC,OAAO,CAAC,QAAQ,CAAC;KACxC,WAAW,CAAC,kDAAkD,CAAC;KAC/D,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,yBAAyB,CAAC;KACzC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,4BAA4B,EAC5B,MAAM,IAAA,oEAA6B,EAAC;IAClC,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,cAAc,EAAE,OAAO,CAAC,cAAc;CACvC,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC;AAEL,iCAAyB,CAAC,OAAO,CAAC,gBAAgB,CAAC;KAChD,WAAW,CAAC,4CAA4C,CAAC;KACzD,cAAc,CAAC,sBAAsB,CAAC;KACtC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,oCAAoC,EACpC,MAAM,IAAA,gEAAyB,EAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EACjE,OAAO,CAAC,IAAI,CACb,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare const workforceLearningCommand: Command;
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workforceLearningCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const shared_1 = require("./shared");
6
+ const workforce_learning_remote_1 = require("../../services/workforce-learning-remote");
7
+ const logger_1 = require("../../utils/logger");
8
+ exports.workforceLearningCommand = new commander_1.Command('learning')
9
+ .description('行为学习回路 A:extract → draft → apply → simulate → publish');
10
+ exports.workforceLearningCommand.command('extract')
11
+ .description('对单条执行抽取学习信号(extractExecutionLearning,幂等)')
12
+ .requiredOption('--execution-id <id>')
13
+ .requiredOption('--target-org <alias>')
14
+ .option('--json')
15
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.learning.extract', await (0, workforce_learning_remote_1.extractExecutionLearningRemote)({
16
+ targetOrg: options.targetOrg,
17
+ executionId: options.executionId,
18
+ }), options.json));
19
+ exports.workforceLearningCommand.command('pipeline-run')
20
+ .description('增量批处理抽取(runLearningPipeline,推进共享 watermark 游标)')
21
+ .requiredOption('--target-org <alias>')
22
+ .option('--limit <n>', '处理上限 1-5000')
23
+ .option('--json')
24
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.learning.pipeline_run', await (0, workforce_learning_remote_1.runLearningPipelineRemote)({
25
+ targetOrg: options.targetOrg,
26
+ limit: options.limit ? Number(options.limit) : undefined,
27
+ }), options.json));
28
+ const draftCommand = exports.workforceLearningCommand.command('draft')
29
+ .description('学习草稿操作');
30
+ draftCommand.command('generate')
31
+ .description('为候选生成草稿内容(仅 llm_patch posture 类型)')
32
+ .requiredOption('--candidate-id <id>')
33
+ .requiredOption('--target-org <alias>')
34
+ .option('--force', '覆盖已生成状态(仅 reasonCode=already_generated_requires_force 时使用)')
35
+ .option('--json')
36
+ .action(async (options) => {
37
+ const result = await (0, workforce_learning_remote_1.generateLearningDraftContentRemote)({
38
+ targetOrg: options.targetOrg,
39
+ candidateId: options.candidateId,
40
+ force: options.force ? true : undefined,
41
+ });
42
+ if (!options.json && result.reasonCode) {
43
+ logger_1.logger.warn(`draft generate 返回 reasonCode=${result.reasonCode}${result.reason ? ` (${result.reason})` : ''}`);
44
+ }
45
+ (0, shared_1.emitWorkforceResult)('workforce.learning.draft_generate', result, options.json);
46
+ });
47
+ exports.workforceLearningCommand.command('apply')
48
+ .description('把草稿应用到候选(applyDraft,幂等状态转换)')
49
+ .requiredOption('--candidate-id <id>')
50
+ .requiredOption('--target-org <alias>')
51
+ .option('--json')
52
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.learning.apply', await (0, workforce_learning_remote_1.applyDraftRemote)({
53
+ targetOrg: options.targetOrg,
54
+ candidateId: options.candidateId,
55
+ }), options.json));
56
+ exports.workforceLearningCommand.command('simulate')
57
+ .description('对候选跑仿真(runSimulation,物化生成测试并运行)')
58
+ .requiredOption('--candidate-id <id>')
59
+ .requiredOption('--target-org <alias>')
60
+ .option('--json')
61
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.learning.simulate', await (0, workforce_learning_remote_1.runSimulationRemote)({
62
+ targetOrg: options.targetOrg,
63
+ candidateId: options.candidateId,
64
+ }), options.json));
65
+ exports.workforceLearningCommand.command('request-approval')
66
+ .description('为候选请求审批(skippedReason=missing_approval_process 是真实跳过)')
67
+ .requiredOption('--candidate-id <id>')
68
+ .requiredOption('--target-org <alias>')
69
+ .option('--approval-process-id <id>')
70
+ .option('--json')
71
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.learning.request_approval', await (0, workforce_learning_remote_1.requestApprovalRemote)({
72
+ targetOrg: options.targetOrg,
73
+ candidateId: options.candidateId,
74
+ approvalProcessId: options.approvalProcessId,
75
+ }), options.json));
76
+ exports.workforceLearningCommand.command('publish')
77
+ .description('发布候选(过 release-gate → dispatchPublication)')
78
+ .requiredOption('--candidate-id <id>')
79
+ .requiredOption('--target-org <alias>')
80
+ .option('--json')
81
+ .action(async (options) => {
82
+ const result = await (0, workforce_learning_remote_1.publishLearningRemote)({
83
+ targetOrg: options.targetOrg,
84
+ candidateId: options.candidateId,
85
+ });
86
+ if (!options.json && (!result.publishEligible || !result.wired)) {
87
+ logger_1.logger.warn(`publish 未生效:publishEligible=${result.publishEligible} wired=${result.wired}` +
88
+ `${result.reason ? ` reason=${result.reason}` : ''}`);
89
+ }
90
+ (0, shared_1.emitWorkforceResult)('workforce.learning.publish', result, options.json);
91
+ });
92
+ exports.workforceLearningCommand.command('rollback')
93
+ .description('回滚已发布产物(rollbackLearningPublication,不重跑闸门)')
94
+ .requiredOption('--publication-event-id <id>')
95
+ .requiredOption('--reason-code <code>')
96
+ .requiredOption('--target-org <alias>')
97
+ .option('--json')
98
+ .action(async (options) => {
99
+ const result = await (0, workforce_learning_remote_1.rollbackLearningPublicationRemote)({
100
+ targetOrg: options.targetOrg,
101
+ publicationEventId: options.publicationEventId,
102
+ reasonCode: options.reasonCode,
103
+ });
104
+ if (!options.json && result.wired && result.reasonCode === 'rollback_audit_record_write_failed') {
105
+ logger_1.logger.warn('⚠️ rollback 已执行但审计行写入失败(reasonCode=rollback_audit_record_write_failed),请人工核对,不要盲目重试。');
106
+ }
107
+ (0, shared_1.emitWorkforceResult)('workforce.learning.rollback', result, options.json);
108
+ });
109
+ exports.workforceLearningCommand.command('publications')
110
+ .description('列出已发布产物历史(aiWorkforceLearningPublicationEvents)')
111
+ .requiredOption('--target-org <alias>')
112
+ .option('--target-artifact-type <type>')
113
+ .option('--artifact-candidate-id <id>')
114
+ .option('--recommendation-id <id>')
115
+ .option('--release-gate-record-id <id>')
116
+ .option('--limit <n>')
117
+ .option('--offset <n>')
118
+ .option('--json')
119
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.learning.publications', await (0, workforce_learning_remote_1.listLearningPublicationsRemote)({
120
+ targetOrg: options.targetOrg,
121
+ targetArtifactType: options.targetArtifactType,
122
+ artifactCandidateId: options.artifactCandidateId,
123
+ recommendationId: options.recommendationId,
124
+ releaseGateRecordId: options.releaseGateRecordId,
125
+ limit: options.limit ? Number(options.limit) : undefined,
126
+ offset: options.offset ? Number(options.offset) : undefined,
127
+ }), options.json));
128
+ const settingsCommand = exports.workforceLearningCommand.command('settings')
129
+ .description('工作区学习设置(retention / opt-out)');
130
+ settingsCommand.command('get')
131
+ .requiredOption('--target-org <alias>')
132
+ .option('--json')
133
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.learning.settings_get', await (0, workforce_learning_remote_1.getLearningSettingsRemote)({ targetOrg: options.targetOrg }), options.json));
134
+ settingsCommand.command('set')
135
+ .requiredOption('--target-org <alias>')
136
+ .option('--retention-days <n>', 'behaviorEventRetentionDays (30-3650)')
137
+ .option('--opt-out <bool>', 'learningOptOut (true|false)')
138
+ .option('--disabled-event-types <types...>', 'learningCaptureDisabledEventTypes(最多 32)')
139
+ .option('--json')
140
+ .action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.learning.settings_set', await (0, workforce_learning_remote_1.updateLearningSettingsRemote)({
141
+ targetOrg: options.targetOrg,
142
+ behaviorEventRetentionDays: options.retentionDays ? Number(options.retentionDays) : undefined,
143
+ learningOptOut: options.optOut === undefined ? undefined : options.optOut === 'true',
144
+ learningCaptureDisabledEventTypes: options.disabledEventTypes,
145
+ }), options.json));
146
+ //# sourceMappingURL=learning.js.map