@nexusclawhq/cli 0.2.3 → 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.
- package/CHANGELOG.md +11 -0
- package/README.md +5 -0
- package/dist/build-info.json +5 -5
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/agent-executable-assets/cli-contract.types.d.ts +1 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/ai-employee-cognition/cognitive-policy.types.d.ts +19 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/en-US.d.ts +686 -95
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/en-US.js +19426 -18705
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/en-US.js.map +1 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/index.d.ts +1372 -190
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/zh-CN.d.ts +686 -95
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/zh-CN.js +19467 -18789
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/locales/zh-CN.js.map +1 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/platform-admin-route-readiness/index.js +2 -11
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/platform-admin-route-readiness/index.js.map +1 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/package.json +5 -1
- package/dist/nexus-cli/src/cli.js +2 -0
- package/dist/nexus-cli/src/cli.js.map +1 -1
- package/dist/nexus-cli/src/commands/ai/help.test.js +11 -29
- package/dist/nexus-cli/src/commands/ai/help.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/commands.test.js +81 -1
- package/dist/nexus-cli/src/commands/commands.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/employee/deploy.js +35 -9
- package/dist/nexus-cli/src/commands/employee/deploy.js.map +1 -1
- package/dist/nexus-cli/src/commands/org/index.js +2 -0
- package/dist/nexus-cli/src/commands/org/index.js.map +1 -1
- package/dist/nexus-cli/src/commands/org/login-web.d.ts +7 -0
- package/dist/nexus-cli/src/commands/org/login-web.js +31 -4
- package/dist/nexus-cli/src/commands/org/login-web.js.map +1 -1
- package/dist/nexus-cli/src/commands/org/login-web.test.js +15 -0
- package/dist/nexus-cli/src/commands/org/login-web.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/org/step-up.d.ts +2 -0
- package/dist/nexus-cli/src/commands/org/step-up.js +75 -0
- package/dist/nexus-cli/src/commands/org/step-up.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/approval.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/approval.js +60 -0
- package/dist/nexus-cli/src/commands/workforce/approval.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/cognition.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/cognition.js +62 -0
- package/dist/nexus-cli/src/commands/workforce/cognition.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/constitution.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/constitution.js +37 -0
- package/dist/nexus-cli/src/commands/workforce/constitution.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/guardrail.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/guardrail.js +67 -0
- package/dist/nexus-cli/src/commands/workforce/guardrail.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/index.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/index.js +43 -0
- package/dist/nexus-cli/src/commands/workforce/index.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/knowledge.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/knowledge.js +143 -0
- package/dist/nexus-cli/src/commands/workforce/knowledge.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/learning.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/learning.js +146 -0
- package/dist/nexus-cli/src/commands/workforce/learning.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/observe.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/observe.js +152 -0
- package/dist/nexus-cli/src/commands/workforce/observe.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/orchestration.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/orchestration.js +199 -0
- package/dist/nexus-cli/src/commands/workforce/orchestration.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/permission.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/permission.js +113 -0
- package/dist/nexus-cli/src/commands/workforce/permission.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/prompt.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/prompt.js +137 -0
- package/dist/nexus-cli/src/commands/workforce/prompt.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/provider.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/provider.js +152 -0
- package/dist/nexus-cli/src/commands/workforce/provider.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/rehearsal.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/rehearsal.js +71 -0
- package/dist/nexus-cli/src/commands/workforce/rehearsal.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/release.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/release.js +24 -0
- package/dist/nexus-cli/src/commands/workforce/release.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/shared.d.ts +8 -0
- package/dist/nexus-cli/src/commands/workforce/shared.js +86 -0
- package/dist/nexus-cli/src/commands/workforce/shared.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/sop.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/sop.js +86 -0
- package/dist/nexus-cli/src/commands/workforce/sop.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/task.d.ts +4 -0
- package/dist/nexus-cli/src/commands/workforce/task.js +67 -0
- package/dist/nexus-cli/src/commands/workforce/task.js.map +1 -0
- package/dist/nexus-cli/src/commands/workforce/test-case.d.ts +2 -0
- package/dist/nexus-cli/src/commands/workforce/test-case.js +121 -0
- package/dist/nexus-cli/src/commands/workforce/test-case.js.map +1 -0
- package/dist/nexus-cli/src/config/platform-seed-registry.json +134 -0
- package/dist/nexus-cli/src/contracts/command-contract.guard.js +25 -2
- package/dist/nexus-cli/src/contracts/command-contract.guard.js.map +1 -1
- package/dist/nexus-cli/src/contracts/command-contract.registry.js +2 -0
- package/dist/nexus-cli/src/contracts/command-contract.registry.js.map +1 -1
- package/dist/nexus-cli/src/contracts/contracts.test.js +40 -54
- package/dist/nexus-cli/src/contracts/contracts.test.js.map +1 -1
- package/dist/nexus-cli/src/contracts/workforce-contracts.d.ts +2 -0
- package/dist/nexus-cli/src/contracts/workforce-contracts.js +175 -0
- package/dist/nexus-cli/src/contracts/workforce-contracts.js.map +1 -0
- package/dist/nexus-cli/src/services/api-client.d.ts +37 -1
- package/dist/nexus-cli/src/services/api-client.js +120 -34
- package/dist/nexus-cli/src/services/api-client.js.map +1 -1
- package/dist/nexus-cli/src/services/api-client.test.js +87 -0
- package/dist/nexus-cli/src/services/api-client.test.js.map +1 -1
- package/dist/nexus-cli/src/services/package-self-containment.js +1 -0
- package/dist/nexus-cli/src/services/package-self-containment.js.map +1 -1
- package/dist/nexus-cli/src/services/step-up-helper.d.ts +43 -0
- package/dist/nexus-cli/src/services/step-up-helper.js +98 -0
- package/dist/nexus-cli/src/services/step-up-helper.js.map +1 -0
- package/dist/nexus-cli/src/services/step-up-helper.test.d.ts +1 -0
- package/dist/nexus-cli/src/services/step-up-helper.test.js +176 -0
- package/dist/nexus-cli/src/services/step-up-helper.test.js.map +1 -0
- package/dist/nexus-cli/src/services/step-up-interactive.d.ts +2 -0
- package/dist/nexus-cli/src/services/step-up-interactive.js +69 -0
- package/dist/nexus-cli/src/services/step-up-interactive.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-cognition-remote.d.ts +27 -0
- package/dist/nexus-cli/src/services/workforce-cognition-remote.js +48 -0
- package/dist/nexus-cli/src/services/workforce-cognition-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-common.d.ts +2 -0
- package/dist/nexus-cli/src/services/workforce-common.js +20 -0
- package/dist/nexus-cli/src/services/workforce-common.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-config-remote.d.ts +127 -0
- package/dist/nexus-cli/src/services/workforce-config-remote.js +205 -0
- package/dist/nexus-cli/src/services/workforce-config-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-distillation-remote.d.ts +118 -0
- package/dist/nexus-cli/src/services/workforce-distillation-remote.js +171 -0
- package/dist/nexus-cli/src/services/workforce-distillation-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-guardrail-knowledge-remote.d.ts +105 -0
- package/dist/nexus-cli/src/services/workforce-guardrail-knowledge-remote.js +174 -0
- package/dist/nexus-cli/src/services/workforce-guardrail-knowledge-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-learning-remote.d.ts +131 -0
- package/dist/nexus-cli/src/services/workforce-learning-remote.js +179 -0
- package/dist/nexus-cli/src/services/workforce-learning-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-observe-remote.d.ts +97 -0
- package/dist/nexus-cli/src/services/workforce-observe-remote.js +207 -0
- package/dist/nexus-cli/src/services/workforce-observe-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-ops-remote.d.ts +94 -0
- package/dist/nexus-cli/src/services/workforce-ops-remote.js +176 -0
- package/dist/nexus-cli/src/services/workforce-ops-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-orchestration-remote.d.ts +132 -0
- package/dist/nexus-cli/src/services/workforce-orchestration-remote.js +244 -0
- package/dist/nexus-cli/src/services/workforce-orchestration-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-permission-remote.d.ts +72 -0
- package/dist/nexus-cli/src/services/workforce-permission-remote.js +130 -0
- package/dist/nexus-cli/src/services/workforce-permission-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-provider-remote.d.ts +82 -0
- package/dist/nexus-cli/src/services/workforce-provider-remote.js +129 -0
- package/dist/nexus-cli/src/services/workforce-provider-remote.js.map +1 -0
- package/dist/nexus-cli/src/services/workforce-test-remote.d.ts +85 -0
- package/dist/nexus-cli/src/services/workforce-test-remote.js +134 -0
- package/dist/nexus-cli/src/services/workforce-test-remote.js.map +1 -0
- package/dist/nexus-cli/src/templates/project/template-manifest.json +11 -5
- package/dist/nexus-cli/src/templates/project/templates/base-crm/README.md.tpl +4 -3
- package/dist/nexus-cli/src/templates/project/templates/base-crm/nexus-project.json.tpl +77 -13
- package/dist/nexus-cli/src/templates/project/templates/base-crm/nexus-project.yaml.tpl +68 -0
- package/dist/nexus-cli/src/templates/project/templates/demo-public-channel-store-delivery/README.md.tpl +4 -4
- package/dist/nexus-cli/src/templates/project/templates/demo-public-channel-store-delivery/nexus-project.json.tpl +77 -13
- package/dist/nexus-cli/src/templates/project/templates/demo-public-channel-store-delivery/nexus-project.yaml.tpl +71 -0
- package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/README.md.tpl +4 -4
- 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
- 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
- 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
- package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-project.json.tpl +61 -7
- package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-project.yaml.tpl +58 -0
- package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/preview/drill-code-extension-page.html +1 -1
- package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/scripts/build-component.mjs +1 -1
- package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/scripts/deploy-drill.mjs +1 -1
- package/dist/nexus-cli/src/templates/project/templates/empty/README.md.tpl +3 -2
- package/dist/nexus-cli/src/templates/project/templates/empty/nexus-project.json.tpl +79 -13
- package/dist/nexus-cli/src/templates/project/templates/empty/nexus-project.yaml.tpl +67 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/agent-instructions/claude.md +6 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/agent-instructions/codex.md +6 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/agent-instructions/generic.md +6 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/agent-instructions/glm-5.2.md +6 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/authoring/code-sdk.d.ts +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/authoring/command-order.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/authoring/flow-node-catalog.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/ai-policies.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/approval-policies.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/connectors.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/invokable-units.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/catalogs/objects.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/cli-contract.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/context-lock.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/context-manifest.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/code/minimal-action.cases.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/code/minimal-action.input.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/code/minimal-action.output.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/code/minimal-action.ts +3 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/examples/flow/minimal-manual-flow.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/agent-code-tool-catalog-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/ai-workforce-executable-bundle-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/approval-policy-authoring-catalog-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/code-action-cases-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/code-extension-governance-v2.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/employee-package-v2.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/flow-package-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/flows-payload-v2.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/object-authoring-catalog-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/workforce-bundle-lock-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/workforce-release-evidence-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/workforce-runtime-bindings-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/schemas/workspace-authoring-contract-v1.schema.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/.nexusclaw/context/workspace-contract.json +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/README.md.tpl +41 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/nexus-project.json.tpl +86 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/nexus-project.yaml.tpl +61 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/package.json.tpl +25 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/.nexusclaw/scaffold.json +12 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/agent-tools.json +53 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/code/genericLookup.ts +5 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/package.yaml +28 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/schemas/genericLookup.input.schema.json +6 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/schemas/genericLookup.output.schema.json +6 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-action/tests/genericLookup.cases.json +26 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/packages/generic-flow/GenericFollowUp.flow.yaml +10 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/scripts/init-bundle.mjs +25 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/tsconfig.json.tpl +10 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-education/README.md.tpl +7 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-education/nexus-project.json.tpl +77 -14
- package/dist/nexus-cli/src/templates/project/templates/industry-education/nexus-project.yaml.tpl +69 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-finance/README.md.tpl +7 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-finance/nexus-project.json.tpl +77 -14
- package/dist/nexus-cli/src/templates/project/templates/industry-finance/nexus-project.yaml.tpl +69 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-healthcare/README.md.tpl +7 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-healthcare/nexus-project.json.tpl +77 -14
- package/dist/nexus-cli/src/templates/project/templates/industry-healthcare/nexus-project.yaml.tpl +69 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-partner-cloud/README.md.tpl +4 -4
- package/dist/nexus-cli/src/templates/project/templates/industry-partner-cloud/nexus-project.json.tpl +77 -13
- package/dist/nexus-cli/src/templates/project/templates/industry-partner-cloud/nexus-project.yaml.tpl +69 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-retail/README.md.tpl +7 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-retail/nexus-project.json.tpl +77 -14
- package/dist/nexus-cli/src/templates/project/templates/industry-retail/nexus-project.yaml.tpl +69 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workforceProviderCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
|
+
const workforce_provider_remote_1 = require("../../services/workforce-provider-remote");
|
|
7
|
+
const logger_1 = require("../../utils/logger");
|
|
8
|
+
exports.workforceProviderCommand = new commander_1.Command('provider')
|
|
9
|
+
.description('模型治理 — LLM provider config(需 step-up)');
|
|
10
|
+
exports.workforceProviderCommand.command('create')
|
|
11
|
+
.description('创建 provider 配置(需 provider_config_admin step-up)')
|
|
12
|
+
.requiredOption('--target-org <alias>')
|
|
13
|
+
.requiredOption('--provider-name <name>')
|
|
14
|
+
.requiredOption('--api-key <key>', '明文 apiKey(服务端加密存储)')
|
|
15
|
+
.requiredOption('--default-model <model>')
|
|
16
|
+
.option('--api-endpoint <url>')
|
|
17
|
+
.option('--priority <n>')
|
|
18
|
+
.option('--is-enabled <bool>', '默认 true')
|
|
19
|
+
.option('--capabilities <cap...>')
|
|
20
|
+
.option('--metadata <json|@file>')
|
|
21
|
+
.option('--factor-id <id>', '非交互:指定已验证因素 id')
|
|
22
|
+
.option('--factor-type <type>', '非交互:按类型选因素(默认 totp)')
|
|
23
|
+
.option('--credential <code>', '非交互:step-up 凭据(TOTP/恢复码/OTP)')
|
|
24
|
+
.option('--json')
|
|
25
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.provider.create', (await (0, workforce_provider_remote_1.createProviderConfigRemote)({
|
|
26
|
+
targetOrg: options.targetOrg,
|
|
27
|
+
providerName: options.providerName,
|
|
28
|
+
apiKey: options.apiKey,
|
|
29
|
+
defaultModel: options.defaultModel,
|
|
30
|
+
apiEndpoint: options.apiEndpoint,
|
|
31
|
+
priority: options.priority ? Number(options.priority) : undefined,
|
|
32
|
+
isEnabled: options.isEnabled === undefined ? undefined : options.isEnabled === 'true',
|
|
33
|
+
capabilities: options.capabilities,
|
|
34
|
+
metadata: await (0, shared_1.parseJsonOption)(options.metadata),
|
|
35
|
+
resolveCredential: (0, shared_1.buildStepUpResolverFromOptions)({
|
|
36
|
+
factorId: options.factorId,
|
|
37
|
+
factorType: options.factorType,
|
|
38
|
+
credential: options.credential,
|
|
39
|
+
}),
|
|
40
|
+
})).data, options.json));
|
|
41
|
+
exports.workforceProviderCommand.command('update')
|
|
42
|
+
.description('更新 provider 配置(需 step-up;系统 provider 仅允许改 isEnabled)')
|
|
43
|
+
.requiredOption('--target-org <alias>')
|
|
44
|
+
.requiredOption('--id <id>')
|
|
45
|
+
.option('--provider-name <name>')
|
|
46
|
+
.option('--api-endpoint <url>')
|
|
47
|
+
.option('--api-key <key>')
|
|
48
|
+
.option('--default-model <model>')
|
|
49
|
+
.option('--priority <n>')
|
|
50
|
+
.option('--is-enabled <bool>')
|
|
51
|
+
.option('--capabilities <cap...>')
|
|
52
|
+
.option('--metadata <json|@file>')
|
|
53
|
+
.option('--factor-id <id>', '非交互:指定已验证因素 id')
|
|
54
|
+
.option('--factor-type <type>', '非交互:按类型选因素(默认 totp)')
|
|
55
|
+
.option('--credential <code>', '非交互:step-up 凭据(TOTP/恢复码/OTP)')
|
|
56
|
+
.option('--json')
|
|
57
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.provider.update', (await (0, workforce_provider_remote_1.updateProviderConfigRemote)({
|
|
58
|
+
targetOrg: options.targetOrg,
|
|
59
|
+
id: options.id,
|
|
60
|
+
providerName: options.providerName,
|
|
61
|
+
apiEndpoint: options.apiEndpoint,
|
|
62
|
+
apiKey: options.apiKey,
|
|
63
|
+
defaultModel: options.defaultModel,
|
|
64
|
+
priority: options.priority ? Number(options.priority) : undefined,
|
|
65
|
+
isEnabled: options.isEnabled === undefined ? undefined : options.isEnabled === 'true',
|
|
66
|
+
capabilities: options.capabilities,
|
|
67
|
+
metadata: await (0, shared_1.parseJsonOption)(options.metadata),
|
|
68
|
+
resolveCredential: (0, shared_1.buildStepUpResolverFromOptions)({
|
|
69
|
+
factorId: options.factorId,
|
|
70
|
+
factorType: options.factorType,
|
|
71
|
+
credential: options.credential,
|
|
72
|
+
}),
|
|
73
|
+
})).data, options.json));
|
|
74
|
+
exports.workforceProviderCommand.command('delete')
|
|
75
|
+
.description('删除 provider 配置(需 step-up;系统 provider 不可删)')
|
|
76
|
+
.requiredOption('--target-org <alias>')
|
|
77
|
+
.requiredOption('--id <id>')
|
|
78
|
+
.option('--factor-id <id>', '非交互:指定已验证因素 id')
|
|
79
|
+
.option('--factor-type <type>', '非交互:按类型选因素(默认 totp)')
|
|
80
|
+
.option('--credential <code>', '非交互:step-up 凭据(TOTP/恢复码/OTP)')
|
|
81
|
+
.option('--json')
|
|
82
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.provider.delete', (await (0, workforce_provider_remote_1.deleteProviderConfigRemote)({
|
|
83
|
+
targetOrg: options.targetOrg,
|
|
84
|
+
id: options.id,
|
|
85
|
+
resolveCredential: (0, shared_1.buildStepUpResolverFromOptions)({
|
|
86
|
+
factorId: options.factorId,
|
|
87
|
+
factorType: options.factorType,
|
|
88
|
+
credential: options.credential,
|
|
89
|
+
}),
|
|
90
|
+
})).data, options.json));
|
|
91
|
+
exports.workforceProviderCommand.command('set-default')
|
|
92
|
+
.description('设为默认 provider(需 step-up;id 可为 env-<name> 形式)')
|
|
93
|
+
.requiredOption('--target-org <alias>')
|
|
94
|
+
.requiredOption('--id <id>')
|
|
95
|
+
.option('--factor-id <id>', '非交互:指定已验证因素 id')
|
|
96
|
+
.option('--factor-type <type>', '非交互:按类型选因素(默认 totp)')
|
|
97
|
+
.option('--credential <code>', '非交互:step-up 凭据(TOTP/恢复码/OTP)')
|
|
98
|
+
.option('--json')
|
|
99
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.provider.set_default', (await (0, workforce_provider_remote_1.setDefaultProviderConfigRemote)({
|
|
100
|
+
targetOrg: options.targetOrg,
|
|
101
|
+
id: options.id,
|
|
102
|
+
resolveCredential: (0, shared_1.buildStepUpResolverFromOptions)({
|
|
103
|
+
factorId: options.factorId,
|
|
104
|
+
factorType: options.factorType,
|
|
105
|
+
credential: options.credential,
|
|
106
|
+
}),
|
|
107
|
+
})).data, options.json));
|
|
108
|
+
exports.workforceProviderCommand.command('test')
|
|
109
|
+
.description('测试 provider 连通性(需 step-up)')
|
|
110
|
+
.requiredOption('--target-org <alias>')
|
|
111
|
+
.requiredOption('--id <id>')
|
|
112
|
+
.option('--factor-id <id>', '非交互:指定已验证因素 id')
|
|
113
|
+
.option('--factor-type <type>', '非交互:按类型选因素(默认 totp)')
|
|
114
|
+
.option('--credential <code>', '非交互:step-up 凭据(TOTP/恢复码/OTP)')
|
|
115
|
+
.option('--json')
|
|
116
|
+
.action(async (options) => {
|
|
117
|
+
const result = (await (0, workforce_provider_remote_1.testProviderConnectionRemote)({
|
|
118
|
+
targetOrg: options.targetOrg,
|
|
119
|
+
id: options.id,
|
|
120
|
+
resolveCredential: (0, shared_1.buildStepUpResolverFromOptions)({
|
|
121
|
+
factorId: options.factorId,
|
|
122
|
+
factorType: options.factorType,
|
|
123
|
+
credential: options.credential,
|
|
124
|
+
}),
|
|
125
|
+
})).data;
|
|
126
|
+
if (!options.json) {
|
|
127
|
+
const tag = result.success ? logger_1.logger.success : logger_1.logger.warn;
|
|
128
|
+
tag(`provider 连通测试: ${result.success ? '成功' : '失败'} (${result.latencyMs}ms)${result.error ? ` error=${result.error}` : ''}`);
|
|
129
|
+
}
|
|
130
|
+
(0, shared_1.emitWorkforceResult)('workforce.provider.test', result, options.json);
|
|
131
|
+
});
|
|
132
|
+
const scenarioCommand = exports.workforceProviderCommand.command('scenario')
|
|
133
|
+
.description('场景路由分配(upsertScenarioAssignment / delete)');
|
|
134
|
+
scenarioCommand.command('upsert')
|
|
135
|
+
.requiredOption('--target-org <alias>')
|
|
136
|
+
.requiredOption('--scenario <key>')
|
|
137
|
+
.requiredOption('--provider-id <id>')
|
|
138
|
+
.option('--json')
|
|
139
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.provider.scenario.upsert', await (0, workforce_provider_remote_1.upsertScenarioAssignmentRemote)({
|
|
140
|
+
targetOrg: options.targetOrg,
|
|
141
|
+
scenario: options.scenario,
|
|
142
|
+
providerId: options.providerId,
|
|
143
|
+
}), options.json));
|
|
144
|
+
scenarioCommand.command('delete')
|
|
145
|
+
.requiredOption('--target-org <alias>')
|
|
146
|
+
.requiredOption('--id <id>')
|
|
147
|
+
.option('--json')
|
|
148
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.provider.scenario.delete', await (0, workforce_provider_remote_1.deleteScenarioAssignmentRemote)({
|
|
149
|
+
targetOrg: options.targetOrg,
|
|
150
|
+
id: options.id,
|
|
151
|
+
}), options.json));
|
|
152
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/provider.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,qCAAgG;AAChG,wFAQkD;AAClD,+CAA4C;AAiB/B,QAAA,wBAAwB,GAAG,IAAI,mBAAO,CAAC,UAAU,CAAC;KAC5D,WAAW,CAAC,uCAAuC,CAAC,CAAC;AAExD,gCAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC;KACvC,WAAW,CAAC,iDAAiD,CAAC;KAC9D,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,wBAAwB,CAAC;KACxC,cAAc,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;KACvD,cAAc,CAAC,yBAAyB,CAAC;KACzC,MAAM,CAAC,sBAAsB,CAAC;KAC9B,MAAM,CAAC,gBAAgB,CAAC;KACxB,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC;KACxC,MAAM,CAAC,yBAAyB,CAAC;KACjC,MAAM,CAAC,yBAAyB,CAAC;KACjC,MAAM,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;KAC5C,MAAM,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;KACrD,MAAM,CAAC,qBAAqB,EAAE,8BAA8B,CAAC;KAC7D,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,2BAA2B,EAC3B,CAAC,MAAM,IAAA,sDAA0B,EAAC;IAChC,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;IAClC,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,YAAY,EAAE,OAAO,CAAC,YAAY;IAClC,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,QAAQ,EAAE,OAA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C,sBAAsB,CAAC;KACtC,cAAc,CAAC,kBAAkB,CAAC;KAClC,cAAc,CAAC,oBAAoB,CAAC;KACpC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,oCAAoC,EACpC,MAAM,IAAA,0DAA8B,EAAC;IACnC,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;IAC1B,UAAU,EAAE,OAAO,CAAC,UAAU;CAC/B,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC;AAEL,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;KAC9B,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,WAAW,CAAC;KAC3B,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,oCAAoC,EACpC,MAAM,IAAA,0DAA8B,EAAC;IACnC,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,EAAE,EAAE,OAAO,CAAC,EAAE;CACf,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workforceRehearsalCommand = 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
|
+
const logger_1 = require("../../utils/logger");
|
|
8
|
+
exports.workforceRehearsalCommand = new commander_1.Command('rehearsal')
|
|
9
|
+
.description('演练证据登记 + demo 预检');
|
|
10
|
+
exports.workforceRehearsalCommand.command('register-metadata')
|
|
11
|
+
.description('登记元数据安装证据(registerMetadataInstall)')
|
|
12
|
+
.requiredOption('--target-org <alias>')
|
|
13
|
+
.requiredOption('--package-name <name>')
|
|
14
|
+
.requiredOption('--version <ver>')
|
|
15
|
+
.requiredOption('--installed-state-id <id>')
|
|
16
|
+
.requiredOption('--compatible-core-sha <sha>')
|
|
17
|
+
.option('--audit-id <id>')
|
|
18
|
+
.option('--source-uri <uri>')
|
|
19
|
+
.option('--json')
|
|
20
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.rehearsal.register_metadata', await (0, workforce_ops_remote_1.registerMetadataInstallRemote)({
|
|
21
|
+
targetOrg: options.targetOrg,
|
|
22
|
+
packageName: options.packageName,
|
|
23
|
+
version: options.version,
|
|
24
|
+
installedStateId: options.installedStateId,
|
|
25
|
+
compatibleCoreSha: options.compatibleCoreSha,
|
|
26
|
+
auditId: options.auditId,
|
|
27
|
+
sourceUri: options.sourceUri,
|
|
28
|
+
}), options.json));
|
|
29
|
+
exports.workforceRehearsalCommand.command('register-business')
|
|
30
|
+
.description('登记业务数据安装证据(registerBusinessDataInstall)')
|
|
31
|
+
.requiredOption('--target-org <alias>')
|
|
32
|
+
.requiredOption('--contract-name <name>')
|
|
33
|
+
.requiredOption('--contract-version <ver>')
|
|
34
|
+
.requiredOption('--compatible-core-sha <sha>')
|
|
35
|
+
.option('--source-uri <uri>')
|
|
36
|
+
.option('--audit-id <id>')
|
|
37
|
+
.option('--summary <json|@file>')
|
|
38
|
+
.option('--json')
|
|
39
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.rehearsal.register_business', await (0, workforce_ops_remote_1.registerBusinessDataInstallRemote)({
|
|
40
|
+
targetOrg: options.targetOrg,
|
|
41
|
+
contractName: options.contractName,
|
|
42
|
+
contractVersion: options.contractVersion,
|
|
43
|
+
compatibleCoreSha: options.compatibleCoreSha,
|
|
44
|
+
sourceUri: options.sourceUri,
|
|
45
|
+
auditId: options.auditId,
|
|
46
|
+
summary: await (0, shared_1.parseJsonOption)(options.summary),
|
|
47
|
+
}), options.json));
|
|
48
|
+
exports.workforceRehearsalCommand.command('preflight')
|
|
49
|
+
.description('运行 demo 预检(runRuntimeDemoPreflight;返回 REHEARSAL_READY/BLOCKED)')
|
|
50
|
+
.requiredOption('--target-org <alias>')
|
|
51
|
+
.option('--expected-core-sha <sha>')
|
|
52
|
+
.option('--image-evidence <json|@file>', '{backendImageSha,frontendImageSha,mobileImageSha,cliImageSha}')
|
|
53
|
+
.option('--json')
|
|
54
|
+
.action(async (options) => {
|
|
55
|
+
const report = await (0, workforce_ops_remote_1.runRuntimeDemoPreflightRemote)({
|
|
56
|
+
targetOrg: options.targetOrg,
|
|
57
|
+
expectedCoreSha: options.expectedCoreSha,
|
|
58
|
+
imageEvidence: await (0, shared_1.parseJsonOption)(options.imageEvidence),
|
|
59
|
+
});
|
|
60
|
+
if (!options.json) {
|
|
61
|
+
const tag = report.ready ? logger_1.logger.success : logger_1.logger.warn;
|
|
62
|
+
tag(`demo 预检: ${report.status} (ready=${report.ready})`);
|
|
63
|
+
if (report.blockers?.length) {
|
|
64
|
+
for (const blocker of report.blockers) {
|
|
65
|
+
logger_1.logger.warn(` blocker: ${blocker.code ?? ''} ${blocker.message ?? ''}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
(0, shared_1.emitWorkforceResult)('workforce.rehearsal.preflight', report, options.json);
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=rehearsal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rehearsal.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/rehearsal.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,qCAAgE;AAChE,8EAI6C;AAC7C,+CAA4C;AAM/B,QAAA,yBAAyB,GAAG,IAAI,mBAAO,CAAC,WAAW,CAAC;KAC9D,WAAW,CAAC,kBAAkB,CAAC,CAAC;AAEnC,iCAAyB,CAAC,OAAO,CAAC,mBAAmB,CAAC;KACnD,WAAW,CAAC,oCAAoC,CAAC;KACjD,c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;YAC3E,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAA,4BAAmB,EAAC,+BAA+B,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7E,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workforceReleaseCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
exports.workforceReleaseCommand = new commander_1.Command('release')
|
|
6
|
+
.description('workforce 发布生命周期(指向 employee bundle;promote/rollback/revoke 需 step-up)')
|
|
7
|
+
.argument('[verb]', 'bundle 子命令(test/deploy/gate/promote/rollback/revoke-action/...)')
|
|
8
|
+
.option('--json')
|
|
9
|
+
.allowExcessArguments()
|
|
10
|
+
.action(() => {
|
|
11
|
+
process.stdout.write([
|
|
12
|
+
'workforce release 是 employee bundle 的治理别名。请使用:',
|
|
13
|
+
'',
|
|
14
|
+
' nexus employee bundle <verb> [options]',
|
|
15
|
+
'',
|
|
16
|
+
'可用动词: init | validate | lock | test | deploy | approval-request |',
|
|
17
|
+
' approval-status | gate | promote | rollback | revoke-action',
|
|
18
|
+
'',
|
|
19
|
+
'promote / rollback / revoke-action 需要 --step-up-challenge-id。',
|
|
20
|
+
'获取 step-up: nexus org step-up --target-org <alias> --list-factors',
|
|
21
|
+
'',
|
|
22
|
+
].join('\n') + '\n');
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/release.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAuBvB,QAAA,uBAAuB,GAAG,IAAI,mBAAO,CAAC,SAAS,CAAC;KAC1D,WAAW,CAAC,wEAAwE,CAAC;KACrF,QAAQ,CAAC,QAAQ,EAAE,iEAAiE,CAAC;KACrF,MAAM,CAAC,QAAQ,CAAC;KAChB,oBAAoB,EAAE;KACtB,MAAM,CAAC,GAAG,EAAE;IACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB;QACE,gDAAgD;QAChD,EAAE;QACF,0CAA0C;QAC1C,EAAE;QACF,mEAAmE;QACnE,uEAAuE;QACvE,EAAE;QACF,+DAA+D;QAC/D,mEAAmE;QACnE,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CACpB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function emitWorkforceResult(command: string, data: unknown, json?: boolean, phase?: 'complete' | 'partial'): void;
|
|
2
|
+
export declare function resolveContentOption(raw: string): Promise<string>;
|
|
3
|
+
export declare function parseJsonOption(raw: string | undefined): Promise<unknown | undefined>;
|
|
4
|
+
export declare function buildStepUpResolverFromOptions(options: {
|
|
5
|
+
factorId?: string;
|
|
6
|
+
factorType?: string;
|
|
7
|
+
credential?: string;
|
|
8
|
+
}): import("../../services/step-up-helper").StepUpCredentialResolver;
|
|
@@ -0,0 +1,86 @@
|
|
|
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.emitWorkforceResult = emitWorkforceResult;
|
|
37
|
+
exports.resolveContentOption = resolveContentOption;
|
|
38
|
+
exports.parseJsonOption = parseJsonOption;
|
|
39
|
+
exports.buildStepUpResolverFromOptions = buildStepUpResolverFromOptions;
|
|
40
|
+
const shared_1 = require("@nexusclaw/shared");
|
|
41
|
+
const contracts_1 = require("../../contracts");
|
|
42
|
+
const step_up_helper_1 = require("../../services/step-up-helper");
|
|
43
|
+
const step_up_interactive_1 = require("../../services/step-up-interactive");
|
|
44
|
+
function emitWorkforceResult(command, data, json, phase = 'complete') {
|
|
45
|
+
if (json) {
|
|
46
|
+
(0, contracts_1.emitCliResult)((0, contracts_1.buildCliResult)({
|
|
47
|
+
command,
|
|
48
|
+
phase,
|
|
49
|
+
contractVersion: shared_1.CLI_COMMAND_CONTRACT_SCHEMA_VERSION,
|
|
50
|
+
ok: true,
|
|
51
|
+
data: data,
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
process.stdout.write(`${JSON.stringify(data, null, 2)}\n`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function resolveContentOption(raw) {
|
|
59
|
+
if (raw.startsWith('@')) {
|
|
60
|
+
const filePath = raw.slice(1);
|
|
61
|
+
const fs = await Promise.resolve().then(() => __importStar(require('node:fs/promises')));
|
|
62
|
+
return fs.readFile(filePath, 'utf-8');
|
|
63
|
+
}
|
|
64
|
+
return raw;
|
|
65
|
+
}
|
|
66
|
+
async function parseJsonOption(raw) {
|
|
67
|
+
if (raw === undefined)
|
|
68
|
+
return undefined;
|
|
69
|
+
const text = await resolveContentOption(raw);
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(text);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
throw new Error(`JSON_PARSE_INVALID: ${error.message}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function buildStepUpResolverFromOptions(options) {
|
|
78
|
+
return options.factorId || options.credential
|
|
79
|
+
? (0, step_up_helper_1.buildNonInteractiveCredentialResolver)({
|
|
80
|
+
factorId: options.factorId,
|
|
81
|
+
factorType: options.factorType,
|
|
82
|
+
credential: options.credential,
|
|
83
|
+
})
|
|
84
|
+
: (0, step_up_interactive_1.buildInteractiveResolver)();
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/shared.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,kDAmBC;AAOD,oDAOC;AAWD,0CAQC;AAQD,wEAYC;AAvFD,8CAAwE;AAExE,+CAAgE;AAChE,kEAAsF;AACtF,4EAA8E;AAW9E,SAAgB,mBAAmB,CACjC,OAAe,EACf,IAAa,EACb,IAAc,EACd,QAAgC,UAAU;IAE1C,IAAI,IAAI,EAAE,CAAC;QACT,IAAA,yBAAa,EACX,IAAA,0BAAc,EAAC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U;SAC/B,CAAC;QACJ,CAAC,CAAC,IAAA,8CAAwB,GAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workforceSopCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
|
+
const workforce_distillation_remote_1 = require("../../services/workforce-distillation-remote");
|
|
7
|
+
exports.workforceSopCommand = new commander_1.Command('sop')
|
|
8
|
+
.description('作业规范(SOP)文档 CRUD + 状态转换');
|
|
9
|
+
exports.workforceSopCommand.command('create')
|
|
10
|
+
.requiredOption('--target-org <alias>')
|
|
11
|
+
.requiredOption('--title <title>')
|
|
12
|
+
.option('--category <category>')
|
|
13
|
+
.option('--applicable-objects <objs...>')
|
|
14
|
+
.option('--steps <json|@file>')
|
|
15
|
+
.option('--json')
|
|
16
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.sop.create', await (0, workforce_distillation_remote_1.createSOPRemote)({
|
|
17
|
+
targetOrg: options.targetOrg,
|
|
18
|
+
title: options.title,
|
|
19
|
+
category: options.category,
|
|
20
|
+
applicableObjects: options.applicableObjects,
|
|
21
|
+
steps: await (0, shared_1.parseJsonOption)(options.steps),
|
|
22
|
+
}), options.json));
|
|
23
|
+
exports.workforceSopCommand.command('update')
|
|
24
|
+
.requiredOption('--target-org <alias>')
|
|
25
|
+
.requiredOption('--id <id>')
|
|
26
|
+
.option('--title <title>')
|
|
27
|
+
.option('--category <category>')
|
|
28
|
+
.option('--applicable-objects <objs...>')
|
|
29
|
+
.option('--steps <json|@file>')
|
|
30
|
+
.option('--json')
|
|
31
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.sop.update', await (0, workforce_distillation_remote_1.updateSOPRemote)({
|
|
32
|
+
targetOrg: options.targetOrg,
|
|
33
|
+
id: options.id,
|
|
34
|
+
title: options.title,
|
|
35
|
+
category: options.category,
|
|
36
|
+
applicableObjects: options.applicableObjects,
|
|
37
|
+
steps: options.steps ? await (0, shared_1.parseJsonOption)(options.steps) : undefined,
|
|
38
|
+
}), options.json));
|
|
39
|
+
exports.workforceSopCommand.command('transition')
|
|
40
|
+
.description('状态转换(transitionSOPStatus;注意是 targetStatus 不是 newStatus)')
|
|
41
|
+
.requiredOption('--target-org <alias>')
|
|
42
|
+
.requiredOption('--id <id>')
|
|
43
|
+
.requiredOption('--target-status <status>')
|
|
44
|
+
.option('--json')
|
|
45
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.sop.transition', await (0, workforce_distillation_remote_1.transitionSOPStatusRemote)({
|
|
46
|
+
targetOrg: options.targetOrg,
|
|
47
|
+
id: options.id,
|
|
48
|
+
targetStatus: options.targetStatus,
|
|
49
|
+
}), options.json));
|
|
50
|
+
exports.workforceSopCommand.command('list')
|
|
51
|
+
.requiredOption('--target-org <alias>')
|
|
52
|
+
.option('--page <n>')
|
|
53
|
+
.option('--page-size <n>')
|
|
54
|
+
.option('--status <status>')
|
|
55
|
+
.option('--category <category>')
|
|
56
|
+
.option('--source-type <type>')
|
|
57
|
+
.option('--json')
|
|
58
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.sop.list', await (0, workforce_distillation_remote_1.listSOPRemote)({
|
|
59
|
+
targetOrg: options.targetOrg,
|
|
60
|
+
page: options.page ? Number(options.page) : undefined,
|
|
61
|
+
pageSize: options.pageSize ? Number(options.pageSize) : undefined,
|
|
62
|
+
status: options.status,
|
|
63
|
+
category: options.category,
|
|
64
|
+
sourceType: options.sourceType,
|
|
65
|
+
}), options.json));
|
|
66
|
+
exports.workforceSopCommand.command('detail')
|
|
67
|
+
.requiredOption('--target-org <alias>')
|
|
68
|
+
.requiredOption('--id <id>')
|
|
69
|
+
.option('--json')
|
|
70
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.sop.detail', await (0, workforce_distillation_remote_1.getSOPDetailRemote)({ targetOrg: options.targetOrg, id: options.id }), options.json));
|
|
71
|
+
exports.workforceSopCommand.command('effectiveness')
|
|
72
|
+
.description('SOP 有效性指标(sopEffectiveness)')
|
|
73
|
+
.requiredOption('--target-org <alias>')
|
|
74
|
+
.requiredOption('--sop-id <id>')
|
|
75
|
+
.option('--json')
|
|
76
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.sop.effectiveness', await (0, workforce_distillation_remote_1.getSOPEffectivenessRemote)({ targetOrg: options.targetOrg, sopId: options.sopId }), options.json));
|
|
77
|
+
exports.workforceSopCommand.command('behavior-analytics')
|
|
78
|
+
.description('行为分析 Top performers(behaviorAnalytics,默认 topN=20)')
|
|
79
|
+
.requiredOption('--target-org <alias>')
|
|
80
|
+
.option('--top-n <n>')
|
|
81
|
+
.option('--json')
|
|
82
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.sop.behavior_analytics', await (0, workforce_distillation_remote_1.getBehaviorAnalyticsRemote)({
|
|
83
|
+
targetOrg: options.targetOrg,
|
|
84
|
+
topN: options.topN ? Number(options.topN) : undefined,
|
|
85
|
+
}), options.json));
|
|
86
|
+
//# sourceMappingURL=sop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sop.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/sop.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,qCAAgE;AAChE,gGAQsD;AAWzC,QAAA,mBAAmB,GAAG,IAAI,mBAAO,CAAC,KAAK,CAAC;KAClD,WAAW,CAAC,yBAAyB,CAAC,CAAC;AAE1C,2BAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC;KAClC,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,iBAAiB,CAAC;KACjC,MAAM,CAAC,uBAAuB,CAAC;KAC/B,MAAM,CAAC,gCAAgC,CAAC;KACxC,MAAM,CAAC,sBAAsB,CAAC;KAC9B,MAAM,CAAC,QAAQ,CAAC;K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S;CACtD,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workforceFeedbackCommand = exports.workforceExecutionCommand = exports.workforceTaskCommand = 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
|
+
const logger_1 = require("../../utils/logger");
|
|
8
|
+
exports.workforceTaskCommand = new commander_1.Command('task')
|
|
9
|
+
.description('工作派发(dispatch / test-run)');
|
|
10
|
+
exports.workforceTaskCommand.command('dispatch')
|
|
11
|
+
.description('按 intent 路由派发(dispatchAgentTask;userId 自动解析为 caller)')
|
|
12
|
+
.requiredOption('--target-org <alias>')
|
|
13
|
+
.requiredOption('--input <text|@file>', '意图文本')
|
|
14
|
+
.option('--json')
|
|
15
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.task.dispatch', await (0, workforce_ops_remote_1.dispatchAgentTaskRemote)({
|
|
16
|
+
targetOrg: options.targetOrg,
|
|
17
|
+
input: await (0, shared_1.resolveContentOption)(options.input),
|
|
18
|
+
}), options.json));
|
|
19
|
+
exports.workforceTaskCommand.command('test-run')
|
|
20
|
+
.description('对指定 agent 跑一次 builder-test 执行(testAgentRun)')
|
|
21
|
+
.requiredOption('--target-org <alias>')
|
|
22
|
+
.requiredOption('--agent-id <id>')
|
|
23
|
+
.requiredOption('--input <text|@file>')
|
|
24
|
+
.option('--json')
|
|
25
|
+
.action(async (options) => (0, shared_1.emitWorkforceResult)('workforce.task.test_run', await (0, workforce_ops_remote_1.testAgentRunRemote)({
|
|
26
|
+
targetOrg: options.targetOrg,
|
|
27
|
+
agentId: options.agentId,
|
|
28
|
+
input: await (0, shared_1.resolveContentOption)(options.input),
|
|
29
|
+
}), options.json));
|
|
30
|
+
exports.workforceExecutionCommand = new commander_1.Command('execution')
|
|
31
|
+
.description('执行控制(cancel)');
|
|
32
|
+
exports.workforceExecutionCommand.command('cancel')
|
|
33
|
+
.description('取消执行(仅 pending/running/guardrail_pending 状态;未找到/不可取消都返回 false)')
|
|
34
|
+
.requiredOption('--target-org <alias>')
|
|
35
|
+
.requiredOption('--execution-id <id>')
|
|
36
|
+
.option('--json')
|
|
37
|
+
.action(async (options) => {
|
|
38
|
+
const cancelled = await (0, workforce_ops_remote_1.cancelAgentExecutionRemote)({
|
|
39
|
+
targetOrg: options.targetOrg,
|
|
40
|
+
executionId: options.executionId,
|
|
41
|
+
});
|
|
42
|
+
if (!options.json && !cancelled) {
|
|
43
|
+
logger_1.logger.warn('cancel 返回 false:执行可能未找到,或状态不在 {pending,running,guardrail_pending}。');
|
|
44
|
+
}
|
|
45
|
+
(0, shared_1.emitWorkforceResult)('workforce.execution.cancel', { cancelled }, options.json);
|
|
46
|
+
});
|
|
47
|
+
exports.workforceFeedbackCommand = new commander_1.Command('feedback')
|
|
48
|
+
.description('执行反馈提交(append-only,喂行为学习回路)');
|
|
49
|
+
exports.workforceFeedbackCommand.command('submit')
|
|
50
|
+
.requiredOption('--target-org <alias>')
|
|
51
|
+
.requiredOption('--execution-id <id>')
|
|
52
|
+
.requiredOption('--rating <rating>', 'up|down|neutral')
|
|
53
|
+
.option('--reviewer-feedback <text>', '最长 2000 字')
|
|
54
|
+
.option('--json')
|
|
55
|
+
.action(async (options) => {
|
|
56
|
+
const rating = options.rating;
|
|
57
|
+
if (!['up', 'down', 'neutral'].includes(rating)) {
|
|
58
|
+
throw new Error('RATING_INVALID: --rating 必须是 up|down|neutral');
|
|
59
|
+
}
|
|
60
|
+
(0, shared_1.emitWorkforceResult)('workforce.feedback.submit', await (0, workforce_ops_remote_1.submitFeedbackRemote)({
|
|
61
|
+
targetOrg: options.targetOrg,
|
|
62
|
+
executionId: options.executionId,
|
|
63
|
+
rating,
|
|
64
|
+
reviewerFeedback: options.reviewerFeedback,
|
|
65
|
+
}), options.json);
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../../../../src/commands/workforce/task.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC,qCAAqE;AACrE,8EAK6C;AAC7C,+CAA4C;AAa/B,QAAA,oBAAoB,GAAG,IAAI,mBAAO,CAAC,MAAM,CAAC;KACpD,WAAW,CAAC,2BAA2B,CAAC,CAAC;AAE5C,4BAAoB,CAAC,OAAO,CAAC,UAAU,CAAC;KACrC,WAAW,CAAC,sDAAsD,CAAC;KACnE,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,sBAAsB,EAAE,MAAM,CAAC;KAC9C,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,yBAAyB,EACzB,MAAM,IAAA,8CAAuB,EAAC;IAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,KAAK,EAAE,MAAM,IAAA,6BAAoB,EAAC,OAAO,CAAC,KAAK,CAAC;CACjD,CAAC,EACF,OAAO,CAAC,IAAI,CACb,CAAC,CAAC;AAEL,4BAAoB,CAAC,OAAO,CAAC,UAAU,CAAC;KACrC,WAAW,CAAC,6CAA6C,CAAC;KAC1D,cAAc,CAAC,sBAAsB,CAAC;KACtC,cAAc,CAAC,iBAAiB,CAAC;KACjC,cAAc,CAAC,sBAAsB,CAAC;KACtC,MAAM,CAAC,QAAQ,CAAC;KAChB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAmB,EAC5C,yBAAyB,EACzB,MAAM,IAAA,yCAAkB,EAAC;IACvB,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,KAAK,EAAE,MAAM,IAAA,6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