bpmax-cli 0.2.1-beta.3 → 0.2.1-beta.31
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/README.md +7 -1
- package/dist/bin.js +16002 -7768
- package/dist/bin.js.map +1 -1
- package/package.json +6 -3
- package/scripts/run-source-cli.mjs +121 -0
- package/skills/bpmax-ai-taskbook/SKILL.md +2 -1
- package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
- package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
- package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
- package/skills/bpmax-approval-matrix/SKILL.md +54 -2
- package/skills/bpmax-blueprint-doc-workflow/SKILL.md +87 -0
- package/skills/bpmax-blueprint-doc-workflow/agents/openai.yaml +4 -0
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +60 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +98 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-forbidden-term.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-mermaid-codeblock.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-boundary.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-whiteboard.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +55 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +257 -0
- package/skills/bpmax-bug-reporting/SKILL.md +72 -0
- package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
- package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
- package/skills/bpmax-cli/SKILL.md +39 -0
- package/skills/bpmax-config-latest/SKILL.md +4 -0
- package/skills/bpmax-console-template-editor/SKILL.md +109 -523
- package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
- package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
- package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +65 -78
- package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +86 -30
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +125 -594
- package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
- package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
- package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
- package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
- package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
- package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
- package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
- package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-template-editor/SKILL.md +113 -777
- package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
- package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
- package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
- package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
- package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
- package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
- package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +8 -4
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +126 -533
- package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +0 -1
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +123 -9
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +6 -5
- package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +564 -0
- package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
- package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
- package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
- package/skills/bpmax-filter-template-editor/SKILL.md +110 -551
- package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
- package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
- package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
- package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
- package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
- package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
- package/skills/bpmax-flow-template-editor/SKILL.md +113 -1084
- package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
- package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
- package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +2 -1
- package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1157 -0
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +3 -3
- package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
- package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
- package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +2 -2
- package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
- package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
- package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
- package/skills/bpmax-form-template-editor/SKILL.md +112 -1104
- package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
- package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1108 -0
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
- package/skills/bpmax-form-template-editor/references/payload-checklist.md +1 -1
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
- package/skills/bpmax-group-model-editor/SKILL.md +24 -0
- package/skills/bpmax-list-template-editor/SKILL.md +116 -466
- package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-list-template-editor/references/content-config-shape.md +16 -4
- package/skills/bpmax-list-template-editor/references/full-detail-guide.md +458 -0
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
- package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-list-template-editor/references/special-formats.md +5 -2
- package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
- package/skills/bpmax-memory-protocol/SKILL.md +7 -6
- package/skills/bpmax-nav-config-editor/SKILL.md +13 -17
- package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
- package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
- package/skills/bpmax-plugin-config/SKILL.md +20 -4
- package/skills/bpmax-project/SKILL.md +35 -0
- package/skills/bpmax-project-detail-template-editor/SKILL.md +13 -39
- package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-role-editor/SKILL.md +7 -30
- package/skills/bpmax-shared/SKILL.md +11 -9
- package/skills/bpmax-team-editor/SKILL.md +27 -0
- package/skills/bpmax-user/SKILL.md +33 -1
- package/skills/bpmax-user-mock-operator/SKILL.md +20 -48
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
- package/skills/bpmax-user-model-editor/SKILL.md +24 -0
- package/skills/form-control-library/references/form-template-submit-schema.md +1 -1
- package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
- package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
- package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
- `搜索前后处理` -> `pre_process_script` / `post_process_script` / `process_script_tag`
|
|
19
19
|
|
|
20
20
|
## 状态操作
|
|
21
|
+
以下为 typed adapter 背后的后端契约说明,不是 Agent 直接调用入口;实际写操作必须使用 `bpmax-cli config dataset publish|pause|cancel-refresh|refresh|reindex`。
|
|
21
22
|
- `应用/发布` -> `POST /bpmax/data-set/publish/:id`
|
|
22
23
|
- `暂停` -> `POST /bpmax/data-set/pause/:id`
|
|
23
24
|
- `取消刷新` -> `POST /bpmax/data-set/cancel-refresh/:id`
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
- `meta/<stem>.json.basicTableAudit`
|
|
72
72
|
- `meta/<stem>.json.customKeyReferences`
|
|
73
73
|
- 第二次确认只看 `work -> submit` diff 和提交摘要,确认“最终提交体是否正确”
|
|
74
|
-
- 未完成两次明确确认,不允许执行
|
|
75
|
-
- 只有显式携带 `--confirm
|
|
74
|
+
- 未完成两次明确确认,不允许执行 typed CLI submit
|
|
75
|
+
- 只有显式携带 typed CLI 要求的精确 `--confirm` 文本才允许提交
|
|
76
76
|
|
|
77
77
|
## 回读验收
|
|
78
78
|
- `result/*.verify.json` 至少校验:
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
print(
|
|
7
|
+
"Legacy dataset network scripts are disabled in bpmax-cli. Use `bpmax-cli config dataset lint/verify` and typed readback so capability, dry-run, confirmation, audit, and baseline checks are enforced.",
|
|
8
|
+
file=sys.stderr,
|
|
9
|
+
)
|
|
10
|
+
sys.exit(2)
|
|
11
|
+
|
|
4
12
|
import argparse
|
|
5
13
|
|
|
6
14
|
from dataset_editor_common import (
|
|
@@ -21,7 +29,6 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
21
29
|
p.add_argument("--workspace")
|
|
22
30
|
p.add_argument("--base-url")
|
|
23
31
|
p.add_argument("--language", default="zhCN")
|
|
24
|
-
p.add_argument("--cookie-header")
|
|
25
32
|
p.add_argument("--timeout", type=float, default=30)
|
|
26
33
|
p.add_argument("--insecure", action="store_true")
|
|
27
34
|
return p
|
|
@@ -4,11 +4,6 @@ from __future__ import annotations
|
|
|
4
4
|
import json
|
|
5
5
|
import subprocess
|
|
6
6
|
import sys
|
|
7
|
-
import ssl
|
|
8
|
-
import urllib.error
|
|
9
|
-
import urllib.parse
|
|
10
|
-
import urllib.request
|
|
11
|
-
from dataclasses import dataclass
|
|
12
7
|
from datetime import datetime, timezone
|
|
13
8
|
from difflib import unified_diff
|
|
14
9
|
from pathlib import Path
|
|
@@ -558,93 +553,17 @@ def require_confirm_token(token: str) -> None:
|
|
|
558
553
|
raise SystemExit(f"refusing to submit: --confirm-token must equal {DEFAULT_CONFIRM_TOKEN}")
|
|
559
554
|
|
|
560
555
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
cookie_header: str
|
|
567
|
-
timeout: float
|
|
568
|
-
insecure: bool = False
|
|
569
|
-
|
|
570
|
-
def _build_url(self, path: str) -> str:
|
|
571
|
-
suffix = f"$workspace={urllib.parse.quote(self.workspace)}&$language={urllib.parse.quote(self.language)}"
|
|
572
|
-
joiner = "&" if "?" in path else "?"
|
|
573
|
-
return self.base_url.rstrip("/") + path + joiner + suffix
|
|
574
|
-
|
|
575
|
-
def request(self, method: str, path: str, body: Optional[dict] = None) -> dict:
|
|
576
|
-
headers = {
|
|
577
|
-
"content-type": "application/json",
|
|
578
|
-
"cookie": self.cookie_header,
|
|
579
|
-
"accept": "application/json, text/plain, */*",
|
|
580
|
-
}
|
|
581
|
-
data = None if body is None else json.dumps(body, ensure_ascii=False).encode("utf-8")
|
|
582
|
-
req = urllib.request.Request(self._build_url(path), data=data, headers=headers, method=method)
|
|
583
|
-
context = ssl._create_unverified_context() if self.insecure else None
|
|
584
|
-
try:
|
|
585
|
-
with urllib.request.urlopen(req, timeout=self.timeout, context=context) as resp:
|
|
586
|
-
raw = resp.read().decode("utf-8", "replace")
|
|
587
|
-
except urllib.error.HTTPError as err:
|
|
588
|
-
raw = err.read().decode("utf-8", "replace")
|
|
589
|
-
raise SystemExit(f"HTTP {err.code} {path}: {raw}") from err
|
|
590
|
-
except urllib.error.URLError as err:
|
|
591
|
-
raise SystemExit(f"Request failed {path}: {err}") from err
|
|
592
|
-
payload = json.loads(raw)
|
|
593
|
-
if payload.get("code") != 0:
|
|
594
|
-
raise SystemExit(f"API error {path}: {raw}")
|
|
595
|
-
return payload
|
|
596
|
-
|
|
597
|
-
def get_dataset(self, dataset_id: int) -> dict:
|
|
598
|
-
return self.request("GET", f"/bpmax/data-set/{dataset_id}")
|
|
599
|
-
|
|
600
|
-
def list_datasets(
|
|
601
|
-
self,
|
|
602
|
-
flow_type: str,
|
|
603
|
-
flow_key: str = "",
|
|
604
|
-
*,
|
|
605
|
-
page: int = 1,
|
|
606
|
-
page_size: int = DEFAULT_LIST_PAGE_SIZE,
|
|
607
|
-
include_relations: bool = True,
|
|
608
|
-
include_progress: bool = True,
|
|
609
|
-
is_del: int = 0,
|
|
610
|
-
) -> dict:
|
|
611
|
-
payload: Dict[str, Any] = {
|
|
612
|
-
"is_del": is_del,
|
|
613
|
-
"flow_type": flow_type,
|
|
614
|
-
"flow_key": flow_key,
|
|
615
|
-
"includeRelations": include_relations,
|
|
616
|
-
"includeProgress": include_progress,
|
|
617
|
-
}
|
|
618
|
-
return self.request("POST", f"/bpmax/data-set/list?page_size={page_size}&page={page}", payload)
|
|
556
|
+
LEGACY_NETWORK_DISABLED_MESSAGE = (
|
|
557
|
+
"Legacy dataset network helpers are disabled in bpmax-cli. Use `bpmax-cli config dataset "
|
|
558
|
+
"export/lint/build/submit/verify` and lifecycle subcommands so capability, dry-run, "
|
|
559
|
+
"confirmation, audit, and baseline checks are enforced."
|
|
560
|
+
)
|
|
619
561
|
|
|
620
|
-
def create_dataset(self, payload: dict) -> dict:
|
|
621
|
-
return self.request("POST", "/bpmax/data-set", payload)
|
|
622
562
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
def get_flow_fields(self, flow_type: str, flow_key: str = "") -> dict:
|
|
627
|
-
query = f"/bpmax/data-set-field/getBatchByFlow?flow_type={urllib.parse.quote(flow_type)}"
|
|
628
|
-
if flow_key not in ("", None):
|
|
629
|
-
query += f"&flow_key={urllib.parse.quote(flow_key)}"
|
|
630
|
-
return self.request("GET", query)
|
|
631
|
-
|
|
632
|
-
def get_dataset_es_data(self, dataset_id: int) -> dict:
|
|
633
|
-
return self.request("GET", f"/bpmax/data-set/esData/{dataset_id}")
|
|
563
|
+
class ApiClient:
|
|
564
|
+
def __init__(self, *_args: Any, **_kwargs: Any) -> None:
|
|
565
|
+
raise SystemExit(LEGACY_NETWORK_DISABLED_MESSAGE)
|
|
634
566
|
|
|
635
567
|
|
|
636
568
|
def build_client(args: Any) -> ApiClient:
|
|
637
|
-
|
|
638
|
-
cookie_header = getattr(args, "cookie_header", None)
|
|
639
|
-
if not workspace:
|
|
640
|
-
raise SystemExit("--workspace is required")
|
|
641
|
-
if not cookie_header:
|
|
642
|
-
raise SystemExit("--cookie-header is required")
|
|
643
|
-
return ApiClient(
|
|
644
|
-
base_url=resolve_base_url(getattr(args, "base_url", None)),
|
|
645
|
-
workspace=workspace,
|
|
646
|
-
language=getattr(args, "language", None) or DEFAULT_LANGUAGE,
|
|
647
|
-
cookie_header=cookie_header,
|
|
648
|
-
timeout=float(getattr(args, "timeout", 30)),
|
|
649
|
-
insecure=bool(getattr(args, "insecure", False)),
|
|
650
|
-
)
|
|
569
|
+
raise SystemExit(LEGACY_NETWORK_DISABLED_MESSAGE)
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
print(
|
|
7
|
+
"Legacy dataset network scripts are disabled in bpmax-cli. Use `bpmax-cli config dataset export` or `bpmax-cli config dataset build` so capability, dry-run, confirmation, audit, and baseline checks are enforced.",
|
|
8
|
+
file=sys.stderr,
|
|
9
|
+
)
|
|
10
|
+
sys.exit(2)
|
|
11
|
+
|
|
4
12
|
import argparse
|
|
5
13
|
|
|
6
14
|
from dataset_editor_common import (
|
|
@@ -27,7 +35,6 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
27
35
|
p.add_argument("--workspace")
|
|
28
36
|
p.add_argument("--base-url")
|
|
29
37
|
p.add_argument("--language", default="zhCN")
|
|
30
|
-
p.add_argument("--cookie-header")
|
|
31
38
|
p.add_argument("--timeout", type=float, default=30)
|
|
32
39
|
p.add_argument("--insecure", action="store_true")
|
|
33
40
|
p.add_argument("--create-skeleton", action="store_true")
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
print(
|
|
7
|
+
"Legacy dataset network scripts are disabled in bpmax-cli. Use `bpmax-cli config dataset export` or typed readback/resolve commands so capability, dry-run, confirmation, audit, and baseline checks are enforced.",
|
|
8
|
+
file=sys.stderr,
|
|
9
|
+
)
|
|
10
|
+
sys.exit(2)
|
|
11
|
+
|
|
4
12
|
import argparse
|
|
5
13
|
|
|
6
14
|
from dataset_editor_common import build_client, dump_json, paths_for, resolve_dataset_candidates
|
|
@@ -15,7 +23,6 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
15
23
|
p.add_argument("--workspace")
|
|
16
24
|
p.add_argument("--base-url")
|
|
17
25
|
p.add_argument("--language", default="zhCN")
|
|
18
|
-
p.add_argument("--cookie-header")
|
|
19
26
|
p.add_argument("--timeout", type=float, default=30)
|
|
20
27
|
p.add_argument("--insecure", action="store_true")
|
|
21
28
|
return p
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
import sys
|
|
5
5
|
|
|
6
6
|
print(
|
|
7
|
-
"Legacy
|
|
7
|
+
"Legacy dataset network scripts are disabled in bpmax-cli. Use `bpmax-cli config dataset submit` so capability, dry-run, confirmation, audit, and baseline checks are enforced.",
|
|
8
8
|
file=sys.stderr,
|
|
9
9
|
)
|
|
10
10
|
sys.exit(2)
|
|
@@ -33,7 +33,6 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
33
33
|
p.add_argument("--workspace")
|
|
34
34
|
p.add_argument("--base-url")
|
|
35
35
|
p.add_argument("--language", default="zhCN")
|
|
36
|
-
p.add_argument("--cookie-header")
|
|
37
36
|
p.add_argument("--timeout", type=float, default=30)
|
|
38
37
|
p.add_argument("--insecure", action="store_true")
|
|
39
38
|
p.add_argument(
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
print(
|
|
7
|
+
"Legacy dataset network scripts are disabled in bpmax-cli. Use `bpmax-cli config dataset verify` or `bpmax-cli config readback dataset` so capability, dry-run, confirmation, audit, and baseline checks are enforced.",
|
|
8
|
+
file=sys.stderr,
|
|
9
|
+
)
|
|
10
|
+
sys.exit(2)
|
|
11
|
+
|
|
4
12
|
import argparse
|
|
5
13
|
|
|
6
14
|
from dataset_editor_common import (
|
|
@@ -20,7 +28,6 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
20
28
|
p.add_argument("--workspace")
|
|
21
29
|
p.add_argument("--base-url")
|
|
22
30
|
p.add_argument("--language", default="zhCN")
|
|
23
|
-
p.add_argument("--cookie-header")
|
|
24
31
|
p.add_argument("--timeout", type=float, default=30)
|
|
25
32
|
p.add_argument("--insecure", action="store_true")
|
|
26
33
|
return p
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
print(
|
|
7
|
+
"Legacy dataset network scripts are disabled in bpmax-cli. Use `bpmax-cli config dataset publish|pause|cancel-refresh|refresh|reindex` and typed readback so capability, dry-run, confirmation, audit, and baseline checks are enforced.",
|
|
8
|
+
file=sys.stderr,
|
|
9
|
+
)
|
|
10
|
+
sys.exit(2)
|
|
11
|
+
|
|
4
12
|
import argparse
|
|
5
13
|
|
|
6
14
|
from dataset_editor_common import build_client, dump_json, paths_for, summarize_publish_health
|
|
@@ -12,7 +20,6 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
12
20
|
p.add_argument("--workspace")
|
|
13
21
|
p.add_argument("--base-url")
|
|
14
22
|
p.add_argument("--language", default="zhCN")
|
|
15
|
-
p.add_argument("--cookie-header")
|
|
16
23
|
p.add_argument("--timeout", type=float, default=30)
|
|
17
24
|
p.add_argument("--insecure", action="store_true")
|
|
18
25
|
p.add_argument("--with-es-data", action="store_true")
|
|
@@ -2,7 +2,6 @@ import sys
|
|
|
2
2
|
import tempfile
|
|
3
3
|
import unittest
|
|
4
4
|
from pathlib import Path
|
|
5
|
-
from unittest import mock
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
SCRIPT_DIR = Path(__file__).resolve().parents[1] / "scripts"
|
|
@@ -10,7 +9,6 @@ if str(SCRIPT_DIR) not in sys.path:
|
|
|
10
9
|
sys.path.insert(0, str(SCRIPT_DIR))
|
|
11
10
|
|
|
12
11
|
from dataset_editor_common import ( # noqa: E402
|
|
13
|
-
ApiClient,
|
|
14
12
|
build_client,
|
|
15
13
|
build_create_skeleton,
|
|
16
14
|
build_dataset_lint_report,
|
|
@@ -199,54 +197,22 @@ class DatasetEditorCommonTests(unittest.TestCase):
|
|
|
199
197
|
self.assertEqual(verify["checks"]["fields"]["actual"]["count"], 1)
|
|
200
198
|
self.assertFalse(verify["checks"]["refresh_setting"]["match"])
|
|
201
199
|
|
|
202
|
-
def
|
|
203
|
-
client = ApiClient(
|
|
204
|
-
base_url="https://bpmax.example.com",
|
|
205
|
-
workspace="store_mgr",
|
|
206
|
-
language="zhCN",
|
|
207
|
-
cookie_header="token=demo",
|
|
208
|
-
timeout=30,
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
self.assertEqual(
|
|
212
|
-
client._build_url("/bpmax/data-set/relationFields/620"),
|
|
213
|
-
"https://bpmax.example.com/bpmax/data-set/relationFields/620?$workspace=store_mgr&$language=zhCN",
|
|
214
|
-
)
|
|
215
|
-
|
|
216
|
-
def test_build_client_uses_environment_base_url(self) -> None:
|
|
217
|
-
args = type(
|
|
218
|
-
"Args",
|
|
219
|
-
(),
|
|
220
|
-
{
|
|
221
|
-
"base_url": None,
|
|
222
|
-
"workspace": "store_mgr",
|
|
223
|
-
"language": "zhCN",
|
|
224
|
-
"cookie_header": "token=demo",
|
|
225
|
-
"timeout": 30,
|
|
226
|
-
"insecure": False,
|
|
227
|
-
},
|
|
228
|
-
)()
|
|
229
|
-
with mock.patch.dict(__import__("os").environ, {"BPMAX_BASE_URL": "https://bpmax.example.com/"}, clear=False):
|
|
230
|
-
client = build_client(args)
|
|
231
|
-
self.assertEqual(client.base_url, "https://bpmax.example.com")
|
|
232
|
-
|
|
233
|
-
def test_build_client_requires_runtime_origin_when_not_explicitly_configured(self) -> None:
|
|
200
|
+
def test_legacy_network_client_is_disabled(self) -> None:
|
|
234
201
|
args = type(
|
|
235
202
|
"Args",
|
|
236
203
|
(),
|
|
237
204
|
{
|
|
238
|
-
"base_url":
|
|
205
|
+
"base_url": "https://bpmax.example.com",
|
|
239
206
|
"workspace": "store_mgr",
|
|
240
207
|
"language": "zhCN",
|
|
241
|
-
"cookie_header": "token=demo",
|
|
242
208
|
"timeout": 30,
|
|
243
209
|
"insecure": False,
|
|
244
210
|
},
|
|
245
211
|
)()
|
|
246
|
-
with
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
self.assertIn("
|
|
212
|
+
with self.assertRaises(SystemExit) as ctx:
|
|
213
|
+
build_client(args)
|
|
214
|
+
self.assertIn("Legacy dataset network helpers are disabled", str(ctx.exception))
|
|
215
|
+
self.assertIn("bpmax-cli config dataset export/lint/build/submit/verify", str(ctx.exception))
|
|
250
216
|
|
|
251
217
|
def test_basic_table_audit_flags_project_vs_think_project(self) -> None:
|
|
252
218
|
audit = summarize_basic_table_audit(
|
|
@@ -31,17 +31,20 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
31
31
|
- 这是编排型 skill,不重复实现各子 skill 的具体执行细节;它负责调研、计划、编排顺序、停机条件和结果闭环。
|
|
32
32
|
- 默认先进入计划模式;如果当前环境不能自动切换到计划模式,必须明确要求用户手动切换到计划模式,然后再继续。
|
|
33
33
|
- 不直接开始执行。先把流程需求讲清楚,再把本次要做的配置面讲清楚,再看是否还缺高影响信息。
|
|
34
|
-
-
|
|
35
|
-
-
|
|
34
|
+
- typed CLI 线上回读、实时接口返回和只读页面验收优先级高于本地 `think_*` 配置镜像;本地仓库只作为候选检索和结构参考。
|
|
35
|
+
- 每完成一个配置面,默认先做 typed CLI verify/readback 和只读页面验收,再进入下一面;不要把上一步的陈旧草稿或本地镜像误当成当前线上事实继续往下串。
|
|
36
36
|
- 新建主流程时必须通过 typed CLI 让平台创建流程壳,拿到 `flow<number>` 格式的真实 `flow_type` 后再继续配置;不得把业务名、测试 marker 或语义 key 拼成 `flow_type`。语义标识只能放在 `testMarker`、配置备注、测试 profile 或 metadata 中。
|
|
37
37
|
- “没有相关流程,需要创建新表单、新流程并绑定到工作区”时,默认首选端到端 typed 命令:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
+
bpmax-cli config flow-app lint --workspace <workspace> --form-work <form-work-file> --flow-work <flow-work-file> --name <name> --format json
|
|
40
41
|
bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-file> --flow-work <flow-work-file> --name <name>
|
|
41
42
|
bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-file> --flow-work <flow-work-file> --name <name> --confirm "create flow-app <name> in <workspace>" --evidence-out .codex/tmp/target-context.csv --response-out .codex/tmp/flow-app-create.response.json
|
|
42
43
|
```
|
|
43
44
|
|
|
45
|
+
- `flow-app lint` 是新建应用的聚合前置 gate;需要单独校验 pre-create flow work 时,使用 `config flow-template lint --mode create`,此时 `flow_type` 仍由平台分配,不得伪造。
|
|
44
46
|
- `flow-app create` 的 dry-run 必须展示完整 operation plan:创建表单、发布表单、创建流程壳、绑定 `data.meta.form_template=<published_id>`、保存/发布流程、绑定工作区、回读验证。缺任何关键步骤都不得确认执行。
|
|
47
|
+
- dry-run 中 `operation_plan.save_flow_draft.payload_summary.data.meta.form_template` 必须显示 `<published-form-id>`,否则不能确认执行。
|
|
45
48
|
- 确认文本不得猜:dry-run JSON 必须包含 `required_confirm`,真实执行时直接复制该值;若确认文本不匹配,必须视为失败,不得把 dry-run JSON 当成功结果。
|
|
46
49
|
- 确认执行必须同时保留 `--response-out` 和 `--evidence-out`:前者保存完整响应、created IDs 和恢复上下文,后者保存给后续配置面复用的 target context。不得只保留 shell 重定向输出。
|
|
47
50
|
- 新建或迁移流程进入 dataset/list/filter/nav 任一后续阶段前,必须先取得 target context evidence:
|
|
@@ -173,7 +176,7 @@ bpmax-cli taskbook lint-prompt --prompt-source .codex/tmp/TASK_PROMPT.md
|
|
|
173
176
|
- 哪些子 skill 会被调用
|
|
174
177
|
- 是否需要 `bpmax-ai-taskbook`,以及任务书 lint、prompt lint、进度 CSV 的路径
|
|
175
178
|
- 哪些页面必须先在浏览器中打开
|
|
176
|
-
-
|
|
179
|
+
- 哪些地方以 typed CLI 线上回读和只读页面验收为准
|
|
177
180
|
- 新建场景使用哪个 typed create 命令、确认文本是什么、失败后停止在哪一步
|
|
178
181
|
|
|
179
182
|
### 6. 计划后的执行编排
|
|
@@ -197,6 +200,7 @@ bpmax-cli taskbook lint-prompt --prompt-source .codex/tmp/TASK_PROMPT.md
|
|
|
197
200
|
- `bpmax-cli flow list --workspace <workspace> --format json`
|
|
198
201
|
- 结果中应能看到新建流程
|
|
199
202
|
- 打开目标工作区创建页确认表单加载
|
|
203
|
+
- 如果 `project_after_create_path` 跳到 `/project?flow_type=...`,创建真实项目后必须验证列表页能发现该项目;若列表显示空但 `project get` 能读到项目,不得宣称“完整入口/列表可用”,应回到列表、数据集或默认模板配置修复。
|
|
200
204
|
- 浏览器中表单如果打不开、空白或创建页报错,必须优先检查 Console 和 Network;如果错误指向 `form_template`、控件脚本、字段 schema 或表单模板发布态 ID,优先回到表单模板修复,不要先改流程或导航。
|
|
201
205
|
- 阶段性完成或被打断时,写一条 `session_state`,保证下轮能从当前编排状态继续。
|
|
202
206
|
|
|
@@ -220,7 +224,7 @@ bpmax-cli taskbook lint-prompt --prompt-source .codex/tmp/TASK_PROMPT.md
|
|
|
220
224
|
- 在执行阶段,优先告诉用户:
|
|
221
225
|
- 当前正在做哪个配置面
|
|
222
226
|
- 当前调用的是哪个子 skill
|
|
223
|
-
-
|
|
227
|
+
- 当前依据的是 typed CLI 线上回读还是本地候选配置
|
|
224
228
|
- 若停下,具体停在哪一步、为什么停
|
|
225
229
|
|
|
226
230
|
## 参考资料
|