openyida 2026.7.18 → 2026.7.19
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 +23 -2
- package/bin/yida.js +6 -0
- package/docs/capabilities.md +202 -0
- package/lib/agent-center/agent-center.js +2 -3
- package/lib/app/app-list.js +3 -4
- package/lib/app/build-page.js +13 -6
- package/lib/app/check-page.js +16 -6
- package/lib/app/compile.js +17 -7
- package/lib/app/create-app.js +2 -1
- package/lib/app/create-form/api-path.js +25 -0
- package/lib/app/create-form/commands.js +4 -0
- package/lib/app/create-form/definition-reader.js +23 -23
- package/lib/app/create-form/field-normalizers.js +26 -7
- package/lib/app/create-form/schema-patch.js +4 -1
- package/lib/app/create-form.js +1 -1
- package/lib/app/create-page.js +2 -1
- package/lib/app/generate-page.js +20 -1
- package/lib/app/get-form-config.js +2 -1
- package/lib/app/get-schema.js +2 -1
- package/lib/app/import-app.js +2 -1
- package/lib/app/list-forms.js +4 -8
- package/lib/app/page-ir.js +140 -0
- package/lib/app/update-app.js +4 -3
- package/lib/app/update-form-config.js +4 -2
- package/lib/asset/asset-cmd.js +19 -6
- package/lib/auth/oauth-loopback.js +376 -15
- package/lib/basic-info/basic-info.js +2 -1
- package/lib/bridge/bridge.js +6 -13
- package/lib/core/command-errors.js +38 -0
- package/lib/core/command-manifest.js +19 -1
- package/lib/core/copy.js +12 -0
- package/lib/core/i18n.js +66 -8
- package/lib/core/locales/en.js +30 -0
- package/lib/core/locales/zh.js +22 -0
- package/lib/core/sample.js +11 -1
- package/lib/core/yida-client.js +4 -2
- package/lib/corp-efficiency/corp-efficiency.js +2 -2
- package/lib/corp-manager/corp-manager.js +3 -3
- package/lib/formula/evaluate.js +3 -2
- package/lib/i18n-management/i18n-management.js +2 -3
- package/lib/process/preview-process.js +20 -8
- package/lib/samples/yida-canvas-custom-page/dashboard-starter.canvas.jsx +5 -2
- package/lib/samples/yida-canvas-custom-page/portal-shell-home.canvas.jsx +2 -2
- package/lib/samples/yida-canvas-custom-page/split-pane-detail.canvas.jsx +2 -2
- package/lib/samples/yida-custom-page/data-management.oyd.jsx +14 -3
- package/lib/samples/yida-custom-page/design-tokens.js +2 -2
- package/lib/samples/yida-custom-page/detail-profile.oyd.jsx +1 -1
- package/lib/samples/yida-custom-page/portal-shell-home.oyd.jsx +7 -2
- package/lib/samples/yida-custom-page/split-pane-detail.oyd.jsx +2 -1
- package/package.json +9 -7
- package/scripts/check-release-risks.js +254 -0
- package/scripts/generate-command-docs.js +6 -1
- package/scripts/i18n-baseline.json +11 -11
- package/scripts/validate-ci.sh +15 -11
- package/scripts/validate-i18n.js +30 -9
- package/scripts/validate-package-size.js +4 -1
- package/scripts/validate-skills.js +4 -0
- package/scripts/validate-structure.js +15 -0
- package/yida-skills/SKILL.md +3 -1
- package/yida-skills/skills/yida-app/SKILL.md +19 -4
- package/yida-skills/skills/yida-canvas-custom-page/references/page-generation-guide.md +9 -0
- package/yida-skills/skills/yida-report/SKILL.md +2 -234
- package/yida-skills/skills/yida-report/references/schema-builder-details.md +239 -0
- package/yida-skills/skills/yida-skill-evaluator/SKILL.md +170 -0
- package/yida-skills/skills-index.json +226 -10
- package/lib/core/locales/ar.js +0 -834
- package/lib/core/locales/de.js +0 -834
- package/lib/core/locales/es.js +0 -834
- package/lib/core/locales/fr.js +0 -834
- package/lib/core/locales/hi.js +0 -834
- package/lib/core/locales/ja.js +0 -1227
- package/lib/core/locales/ko.js +0 -836
- package/lib/core/locales/pt.js +0 -834
- package/lib/core/locales/vi.js +0 -834
- package/lib/core/locales/zh-HK.js +0 -1263
- package/project/pages/src/demo-birthday-game.oyd.jsx +0 -832
- package/project/pages/src/demo-chip-insight.oyd.jsx +0 -983
- package/project/pages/src/demo-compat-smoke.oyd.jsx +0 -58
- package/project/pages/src/demo-crm-batch-entry.oyd.jsx +0 -805
- package/project/pages/src/demo-crm-dashboard.oyd.jsx +0 -677
- package/project/pages/src/demo-future-vision-2026.oyd.jsx +0 -1102
- package/project/pages/src/demo-ppt.oyd.jsx +0 -1192
- package/project/pages/src/demo-salary-calculator.oyd.jsx +0 -904
- package/project/pages/src/openyida-knowledge-doc.oyd.jsx +0 -1714
package/README.md
CHANGED
|
@@ -149,7 +149,7 @@ openyida/
|
|
|
149
149
|
├── bin/yida.js # CLI entry and command routing
|
|
150
150
|
├── lib/
|
|
151
151
|
│ ├── app/ # Application, form, page, import/export commands
|
|
152
|
-
│ ├── auth/ #
|
|
152
|
+
│ ├── auth/ # OAuth token login, token session storage, organization switch
|
|
153
153
|
│ ├── connector/ # HTTP connector lifecycle and smart creation
|
|
154
154
|
│ ├── core/ # Environment detection, i18n, diagnostics, data commands
|
|
155
155
|
│ ├── process/ # Process form creation, configuration, preview
|
|
@@ -277,6 +277,20 @@ The E2E paths above prove the *CLI* works. The eval harness under `scripts/eval/
|
|
|
277
277
|
# the selected sub-skill against the golden set.
|
|
278
278
|
npm run eval:routing
|
|
279
279
|
|
|
280
|
+
# Doc quality — static analysis of all SKILL.md files (standards + maintainability).
|
|
281
|
+
npm run eval:doc-quality
|
|
282
|
+
|
|
283
|
+
# Safety — credential leak detection, command whitelist, corpId consistency.
|
|
284
|
+
npm run eval:safety
|
|
285
|
+
|
|
286
|
+
# Coverage — how much of the skill/category/reference space is covered by scenarios.
|
|
287
|
+
npm run eval:coverage
|
|
288
|
+
|
|
289
|
+
# Comprehensive — 10-dimension scorecard for a single skill (doc quality, routing,
|
|
290
|
+
# safety, step completeness, output validity, efficiency, stability, coverage).
|
|
291
|
+
# Outputs a JSON scorecard, SVG radar chart, and trend analysis.
|
|
292
|
+
npm run eval:comprehensive -- --skill yida-dashboard
|
|
293
|
+
|
|
280
294
|
# Tool-pipeline baseline (end-to-end) — wraps the real-environment runner for one
|
|
281
295
|
# sub-skill, adds guardrail assertions, screenshots the published page, and writes a
|
|
282
296
|
# human scoring template. Runs deterministic CLI commands (no agent) so it serves as
|
|
@@ -302,15 +316,19 @@ OPENYIDA_E2E=1 npm run eval:all -- --skill yida-dashboard --screenshot
|
|
|
302
316
|
# that runs the tasks above on click. Binds to 127.0.0.1 only; tasks are a fixed
|
|
303
317
|
# whitelist. Use the Node version you start it with, so run `nvm use 20` first.
|
|
304
318
|
npm run eval:dashboard # http://127.0.0.1:4500
|
|
319
|
+
|
|
320
|
+
# You can also run eval directly via the CLI:
|
|
321
|
+
openyida eval --mode comprehensive --skill yida-dashboard
|
|
305
322
|
```
|
|
306
323
|
|
|
307
324
|
Configuration precedence is `CLI flag > env (OPENYIDA_EVAL_*) > scripts/eval/eval.config.json > defaults`.
|
|
308
325
|
|
|
309
326
|
| Flag | Purpose |
|
|
310
327
|
|------|---------|
|
|
311
|
-
| `--mode e2e\|routing\|generate\|all` | Which evals to run (default `e2e
|
|
328
|
+
| `--mode e2e\|routing\|generate\|doc-quality\|safety\|coverage\|comprehensive\|all` | Which evals to run (default `e2e`) |
|
|
312
329
|
| `--skill <name>` | Restrict the e2e run to one sub-skill; stages are reverse-looked-up from the `SKILL_COVERAGE` matrix |
|
|
313
330
|
| `--stages a,b` | Explicit stage list, overriding the skill reverse-lookup |
|
|
331
|
+
| `--runs N` | Multi-run stability: repeat routing N times, report consistency rate |
|
|
314
332
|
| `--screenshot` / `--no-screenshot` | Capture the published page (default on; skipped gracefully if Playwright is absent) |
|
|
315
333
|
| `--auto-score` / `--no-auto-score` | Score screenshots with the local `claude -p` agent (default off → human template only) |
|
|
316
334
|
| `--scenarios <dir>` | Routing golden-set directory (default `scripts/eval/scenarios`) |
|
|
@@ -468,6 +486,7 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
|
|
|
468
486
|
| `openyida copy [--force]` | Copy project working directory |
|
|
469
487
|
| `openyida sample [--list]` | Output code samples/templates |
|
|
470
488
|
| `openyida doctor [--fix]` | Environment diagnostics & auto-fix |
|
|
489
|
+
| `openyida eval --mode <mode> [--skill <name>] [--runs N]` | Multi-dimensional skill evaluation (doc quality, routing accuracy, safety, etc.) |
|
|
471
490
|
| `openyida db-seq-fix [--fix]` | Detect and repair PostgreSQL sequence drift |
|
|
472
491
|
| `openyida formula evaluate <formula\|file> [--schema file]` | Static-check Yida formula syntax and field refs |
|
|
473
492
|
| `openyida update` | Check and update to latest version |
|
|
@@ -493,6 +512,8 @@ Environment selectors such as `--env intl`, `--intl`, `--overseas`, `--global`,
|
|
|
493
512
|
|
|
494
513
|
For overseas apps, pass `--locale en_US` or `--locale ja_JP` on creation commands, or set `OPENYIDA_CONTENT_LOCALE`. OpenYida writes YiDA resource names with `zh_CN`, `en_US`, and `ja_JP` values so Global YiDA does not fall back to Chinese-only metadata.
|
|
495
514
|
|
|
515
|
+
The CLI package ships the core UI languages `zh` and `en` by default. Other CLI UI language packs are optional: keep or install files such as `ja.js` / `fr.js` in an external directory and point `OPENYIDA_LOCALE_DIR` to that directory, then set `OPENYIDA_LANG=ja`. If an optional language pack is unavailable, OpenYida falls back through `en -> zh`.
|
|
516
|
+
|
|
496
517
|
#### Forms and Pages
|
|
497
518
|
|
|
498
519
|
Form field definitions can include `alias` or `componentAlias` to populate Yida designer component aliases, stored as `pages[0].componentAlias.items`. Yida runtime resolves these aliases in page JS, so `this.$('phone')` can be used instead of `this.$('textField_xxx')`; OpenYida form rules, validations, and `openyida data ... --resolve-aliases` JSON inputs also accept aliases as field references. For server-side DingTalk OpenAPI calls, use `GET /v2.0/yida/forms/component/alias/{appType}/{formUuid}` to read the `{ fieldId, alias }` mapping, then translate aliases before sending form data/search JSON. That endpoint requires `systemToken`, `userId`, an access token, and the Yida form data read permission; grant that permission in DingTalk developer console API permissions and publish the DingTalk app. Yida app code and app secret are available under app settings > deployment/maintenance.
|
package/bin/yida.js
CHANGED
|
@@ -1051,6 +1051,12 @@ async function main() {
|
|
|
1051
1051
|
break;
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
|
+
case 'eval': {
|
|
1055
|
+
const { main: evalMain } = require('../scripts/eval/runner');
|
|
1056
|
+
await evalMain(args);
|
|
1057
|
+
break;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1054
1060
|
default: {
|
|
1055
1061
|
throwCliUsage(t('cli.unknown_command', command), t('cli.run_help'));
|
|
1056
1062
|
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# OpenYida 功能完整列表
|
|
2
|
+
|
|
3
|
+
这份清单面向宜搭使用者,说明 OpenYida 支持的功能,以及对应可以执行的 `openyida` 命令。参数细节可以继续查看 `openyida --help`、`openyida <command> --help` 或 `openyida commands --json`。
|
|
4
|
+
|
|
5
|
+
## 基础操作
|
|
6
|
+
|
|
7
|
+
| 功能 | 执行操作 |
|
|
8
|
+
|---|---|
|
|
9
|
+
| 查看当前环境和登录态 | `openyida env` / `openyida env --json` |
|
|
10
|
+
| 登录宜搭 | `openyida login` |
|
|
11
|
+
| 指定入口登录 | `openyida login <target-url>` |
|
|
12
|
+
| 只检查是否已登录 | `openyida login --check-only --json` |
|
|
13
|
+
| 查看可切换组织 | `openyida org list` |
|
|
14
|
+
| 交互式切换组织 | `openyida org switch` |
|
|
15
|
+
| 切换到指定组织 | `openyida org switch --corp-id <corpId>` |
|
|
16
|
+
| 退出登录 | `openyida logout` |
|
|
17
|
+
| 管理 token 登录态 | `openyida auth <status\|login\|refresh\|logout>` |
|
|
18
|
+
| 查看全部命令清单 | `openyida commands --json` |
|
|
19
|
+
| 查看 Agent 一次性能力快照 | `openyida agent-capabilities --json` / `openyida agent-capabilities --summary-json` |
|
|
20
|
+
|
|
21
|
+
## 应用与组织管理
|
|
22
|
+
|
|
23
|
+
| 功能 | 执行操作 |
|
|
24
|
+
|---|---|
|
|
25
|
+
| 查询我的应用 | `openyida app-list [--size N]` |
|
|
26
|
+
| 创建应用 | `openyida create-app "<应用名称>"` |
|
|
27
|
+
| 更新应用名称、布局、主题 | `openyida update-app <appType> [--name "..."] [--layout slide\|ver] [--theme deepBlue]` |
|
|
28
|
+
| 导出应用迁移包 | `openyida export <appType> [output]` |
|
|
29
|
+
| 导入应用迁移包 | `openyida import <file> [name]` |
|
|
30
|
+
| 管理左侧导航分组 | `openyida nav-group <list\|create\|rename\|delete\|move\|order\|hide\|show> <appType> ...` |
|
|
31
|
+
| 管理应用管理员 | `openyida app-permission <get\|set\|add\|remove\|search-user> ...` |
|
|
32
|
+
| 管理应用多语言 | `openyida i18n <overview\|config\|languages\|list\|upsert\|delete\|translate\|translate-all\|upgrade> <appType> ...` |
|
|
33
|
+
| 查询组织基础信息、容量、额度、域名 | `openyida basic-info <overview\|commodity\|grant\|capacity\|quota\|abs-path\|dataflow\|i18n\|domain>` |
|
|
34
|
+
| 查询企业效能 | `openyida corp-efficiency [overview\|details\|detail\|groups\|notify] [options]` |
|
|
35
|
+
| 管理平台管理员和通讯录权限 | `openyida corp-manager <search-user\|list\|add\|remove\|address-book> ...` |
|
|
36
|
+
|
|
37
|
+
说明:CLI 界面语言默认内置 `zh` / `en`。其他语言包可通过 `OPENYIDA_LOCALE_DIR` 按需加载;应用内多语言仍使用 `openyida i18n` 管理宜搭应用文案。
|
|
38
|
+
|
|
39
|
+
## 表单与数据模型
|
|
40
|
+
|
|
41
|
+
| 功能 | 执行操作 |
|
|
42
|
+
|---|---|
|
|
43
|
+
| 创建表单 | `openyida create-form create <appType> ...` |
|
|
44
|
+
| 更新表单字段 | `openyida create-form update <appType> ...` |
|
|
45
|
+
| 用 patch 更新表单 | `openyida create-form patch <appType> <formUuid> <patchJsonOrFile>` |
|
|
46
|
+
| 配置表单联动规则 | `openyida create-form rule <appType> <formUuid> <rulesJsonOrFile>` |
|
|
47
|
+
| 配置字段校验 | `openyida create-form validation <appType> <formUuid> <validationsJsonOrFile>` |
|
|
48
|
+
| 快速新增字段校验 | `openyida add-validation <appType> <formUuid> --field <labelOrId> --type <phone\|regex\|idCard\|email\|...>` |
|
|
49
|
+
| 绑定字段远程数据源 | `openyida create-form bind-datasource <appType> <formUuid> <fieldLabelOrId> <dataSourceJsonOrFile>` |
|
|
50
|
+
| 给选项字段追加选项 | `openyida create-form add-option <appType> <formUuid> <fieldLabel> <option1> [option2] ...` |
|
|
51
|
+
| 查询应用内表单/页面 | `openyida list-forms <appType> [--keyword <text>]` |
|
|
52
|
+
| 获取表单 Schema | `openyida get-schema <appType> <formUuid>` |
|
|
53
|
+
| 获取应用全部 Schema | `openyida get-schema <appType> --all` |
|
|
54
|
+
| 导出 ER 关系图 | `openyida er <appType> [--format mermaid\|json] [--output file]` |
|
|
55
|
+
| 管理聚合表 virtualView | `openyida aggregate-table <list\|create-empty\|inspect\|preview\|save\|publish\|status> <appType> ...` |
|
|
56
|
+
|
|
57
|
+
## 自定义页面与发布
|
|
58
|
+
|
|
59
|
+
| 功能 | 执行操作 |
|
|
60
|
+
|---|---|
|
|
61
|
+
| 创建自定义页面 | `openyida create-page <appType> "<页面名称>"` |
|
|
62
|
+
| 创建看板页 | `openyida create-page <appType> "<页面名称>" --mode dashboard` |
|
|
63
|
+
| 从模板生成页面源码 | `openyida generate-page <template>` |
|
|
64
|
+
| 构建宜搭兼容页面源码 | `openyida build-page <sourceFile> [--output file\|--write]` |
|
|
65
|
+
| 检查普通自定义页面 JSX 规范 | `openyida check-page <src> [--compat]` |
|
|
66
|
+
| 本地编译普通自定义页面 JSX | `openyida compile <src>` |
|
|
67
|
+
| 发布普通自定义页面 JSX | `openyida publish project/pages/src/home.oyd.jsx <appType> <formUuid>` |
|
|
68
|
+
| 发布 Code Canvas 页面 | `openyida publish project/pages/src/home.canvas.jsx <appType> <formUuid>`(`.canvas.jsx` / `.canvas.tsx` 自动启用 Canvas 编译,生成 `runtimeCode` + `importedModules` 并保存为 `YidaCodeCanvas` Schema) |
|
|
69
|
+
| 显式按 Code Canvas 链路发布 | `openyida publish <src> <appType> <formUuid> --canvas` |
|
|
70
|
+
| 发布并做健康检查 | `openyida publish <src> <appType> <formUuid> --health-check` |
|
|
71
|
+
| 更新页面/表单配置 | `openyida update-form-config <appType> ...` |
|
|
72
|
+
| 查询页面/表单配置 | `openyida get-form-config <appType> <formUuid> [--json]` |
|
|
73
|
+
| 开发高级自定义页面、看板、图表或幻灯片 | 默认优先使用 Code Canvas 链路;明确要求普通自定义页面 JSX/Jsx,或强依赖普通自定义页实例桥时使用 `.oyd.jsx` + `check-page` / `compile` / `publish` |
|
|
74
|
+
| Code Canvas 页面使用成员/部门/上传等宜搭运行态组件 | `openyida sample yida-canvas-custom-page native-components-smoke --output pages/src/native-components-smoke.canvas.jsx`;再参考 `yida-canvas-custom-page/references/native-components-bridge.md` |
|
|
75
|
+
| Code Canvas 门户 + 成员/部门/上传组件示例 | `openyida sample yida-canvas-custom-page portal-native-components --output pages/src/portal-native-components.canvas.jsx` |
|
|
76
|
+
| 普通自定义页面 JSX/Jsx 使用成员/部门组件 | 使用 `.oyd.jsx`,参考 `yida-custom-page/references/component-jsx-guide.md` |
|
|
77
|
+
| 普通自定义页面 JSX/Jsx 使用附件/图片上传 | 使用 `.oyd.jsx`,参考 `yida-custom-page/references/attachment-upload-guide.md` |
|
|
78
|
+
|
|
79
|
+
### 自定义页面链路选择
|
|
80
|
+
|
|
81
|
+
| 需求 | 推荐链路 |
|
|
82
|
+
|---|---|
|
|
83
|
+
| 现代 React、hooks、官网、工作台、看板、列表、详情、可视化、AI 首次生成页面 | Code Canvas:`.canvas.jsx` / `YidaCodeCanvas` |
|
|
84
|
+
| 需要成员、部门、附件上传、图片上传等宜搭运行态组件,且希望页面保持现代 React 体验 | Code Canvas + 原生组件桥;先跑 smoke 示例验证运行态组件,再做 fallback 和值归一化 |
|
|
85
|
+
| 用户明确要求普通自定义页面 JSX/Jsx 组件链路 | 普通自定义页面:`.oyd.jsx` / `Jsx` |
|
|
86
|
+
| 强依赖 `this.$(fieldId)`、`this.utils.yida.*`、`this.dataSourceMap`、表单提交或字段双向绑定 | 普通自定义页面:`.oyd.jsx` / `Jsx` |
|
|
87
|
+
| 已有普通 `.oyd.jsx` 页面要迁移到 Code Canvas | 参考 `yida-canvas-upgrade` 技能 |
|
|
88
|
+
|
|
89
|
+
## 流程、审批与任务
|
|
90
|
+
|
|
91
|
+
| 功能 | 执行操作 |
|
|
92
|
+
|---|---|
|
|
93
|
+
| 创建流程表单并配置流程 | `openyida create-process <appType> ...` |
|
|
94
|
+
| 配置并发布流程规则 | `openyida configure-process <appType> ...` |
|
|
95
|
+
| 预览流程实例 | `openyida process preview <appType> <processInstanceId> [--output <path>]` |
|
|
96
|
+
| 查询 AI 审批提示配置 | `openyida ai-form-setting get <appType> <formUuid>` |
|
|
97
|
+
| 查询 AI 审批可用字段 | `openyida ai-form-setting fields <appType> <formUuid>` |
|
|
98
|
+
| 查询 AI 审批模型 | `openyida ai-form-setting models <appType>` |
|
|
99
|
+
| 开启或关闭 AI 审批提示 | `openyida ai-form-setting <enable\|disable> <appType> <formUuid>` |
|
|
100
|
+
| 保存 AI 审批提示配置 | `openyida ai-form-setting save <appType> <formUuid> <config.json>` |
|
|
101
|
+
| 查询任务中心 | `openyida task-center <type> [options]` |
|
|
102
|
+
| 管理流程代理/离职代理 | `openyida agent-center <list\|create\|update\|cancel\|range\|search-user> ...` |
|
|
103
|
+
|
|
104
|
+
## 数据、权限与分享
|
|
105
|
+
|
|
106
|
+
| 功能 | 执行操作 |
|
|
107
|
+
|---|---|
|
|
108
|
+
| 查询表单数据 | `openyida data query form <appType> <formUuid> [options]` |
|
|
109
|
+
| 新增表单数据 | `openyida data create form <appType> <formUuid> --data-file <file>` |
|
|
110
|
+
| 更新表单数据 | `openyida data update form <appType> <formUuid> <formInstId> --data-file <file>` |
|
|
111
|
+
| 查询流程/任务/子表数据 | `openyida data <action> <resource> [args]` |
|
|
112
|
+
| 查询表单权限 | `openyida get-permission <appType> <formUuid>` |
|
|
113
|
+
| 保存表单权限 | `openyida save-permission <appType> <formUuid> ...` |
|
|
114
|
+
| 验证短链接 | `openyida verify-short-url <appType> ...` |
|
|
115
|
+
| 保存公开访问/分享配置 | `openyida save-share-config <appType> ...` |
|
|
116
|
+
| 查询页面分享配置 | `openyida get-page-config <appType> <formUuid>` |
|
|
117
|
+
| 规划公开表单镜像字段 | `openyida externalize-form <appType> <formUuid> [--schema-file file]` |
|
|
118
|
+
|
|
119
|
+
## 报表、看板与可视化
|
|
120
|
+
|
|
121
|
+
| 功能 | 执行操作 |
|
|
122
|
+
|---|---|
|
|
123
|
+
| 创建宜搭原生报表 | `openyida create-report <appType> "<报表名称>" ...` |
|
|
124
|
+
| 向已有报表追加图表 | `openyida append-chart <appType> <reportId> ...` |
|
|
125
|
+
| 创建 ECharts 高级报表 | 使用自定义页面开发链路,并执行 `openyida publish ...` |
|
|
126
|
+
| 创建经营看板/管理驾驶舱/数据大屏 | 使用 `create-page`、数据源配置、报表命令和 `publish` 组合完成 |
|
|
127
|
+
|
|
128
|
+
## 连接器、集成与钉钉
|
|
129
|
+
|
|
130
|
+
| 功能 | 执行操作 |
|
|
131
|
+
|---|---|
|
|
132
|
+
| 查询 HTTP 连接器 | `openyida connector list` |
|
|
133
|
+
| 创建 HTTP 连接器 | `openyida connector create "name" "domain" ...` |
|
|
134
|
+
| 查看连接器详情 | `openyida connector detail <id>` |
|
|
135
|
+
| 删除连接器 | `openyida connector delete <id>` |
|
|
136
|
+
| 添加连接器动作 | `openyida connector add-action --operations <file> --connector-id <id>` |
|
|
137
|
+
| 查询连接器动作 | `openyida connector list-actions <id>` |
|
|
138
|
+
| 删除连接器动作 | `openyida connector delete-action <id> <operation-id>` |
|
|
139
|
+
| 测试连接器动作 | `openyida connector test --connector-id <id> --action <actionId>` |
|
|
140
|
+
| 查询连接器鉴权账号 | `openyida connector list-connections <id>` |
|
|
141
|
+
| 创建连接器鉴权账号 | `openyida connector create-connection <id> <name>` |
|
|
142
|
+
| 从 cURL 智能创建连接器 | `openyida connector smart-create --curl "..."` |
|
|
143
|
+
| 解析 API 文档/接口信息 | `openyida connector parse-api [options]` |
|
|
144
|
+
| 生成 API 文档模板 | `openyida connector gen-template [output]` |
|
|
145
|
+
| 创建集成自动化 | `openyida integration create <appType> ... [--spec file.json]` |
|
|
146
|
+
| 查询集成自动化 | `openyida integration list <appType> [--form-uuid <uuid>]` |
|
|
147
|
+
| 启用集成自动化 | `openyida integration enable <appType> <formUuid> <processCode>` |
|
|
148
|
+
| 停用集成自动化 | `openyida integration disable <appType> <formUuid> <processCode>` |
|
|
149
|
+
| 检查集成异常日志 | `openyida integration check <appType...>` |
|
|
150
|
+
| 诊断集成配置问题 | `openyida integration diagnose (--text <text>\|--file <path>\|--rules)` |
|
|
151
|
+
| 调用钉钉 CLI | `openyida dws <command> [args]` |
|
|
152
|
+
| 搜索钉钉联系人 | `openyida dws contact user search --keyword <text>` |
|
|
153
|
+
| 生成钉钉 AppLink | `openyida dingtalk-link <url> [--target fullScreen]` |
|
|
154
|
+
|
|
155
|
+
## AI、公式与知识整理
|
|
156
|
+
|
|
157
|
+
| 功能 | 执行操作 |
|
|
158
|
+
|---|---|
|
|
159
|
+
| 宜搭 AI 文生文 | `openyida ai text [options]` |
|
|
160
|
+
| 宜搭 AI 识图 | `openyida ai image [options]` |
|
|
161
|
+
| 检测素材能力 | `openyida asset status [options]` |
|
|
162
|
+
| 校验图片 URL | `openyida asset verify-url <url> [options]` |
|
|
163
|
+
| 解析并回填页面素材 | `openyida asset resolve [options]` |
|
|
164
|
+
| 生成 AI 图片素材 | `openyida asset generate [options]` |
|
|
165
|
+
| 检查宜搭公式 | `openyida formula evaluate <formula\|file> [--schema file]` |
|
|
166
|
+
| 闪记/会议纪要转 PRD | `openyida flash-to-prd --file <path> --name "<project>"` |
|
|
167
|
+
| 导出 AI 对话记录 | `openyida export-conversation [options]` |
|
|
168
|
+
| 整理 VOC 反馈材料 | 按故障、需求或性能问题整理成可提交材料 |
|
|
169
|
+
| 配置体验反馈入口 | `openyida feedback <setup\|url\|dismiss\|status> [options]` |
|
|
170
|
+
|
|
171
|
+
## 本地开发、诊断与运维
|
|
172
|
+
|
|
173
|
+
| 功能 | 执行操作 |
|
|
174
|
+
|---|---|
|
|
175
|
+
| 初始化 project 工作目录 | `openyida copy [--force]` |
|
|
176
|
+
| 查看/输出示例模板 | `openyida sample [--list]` |
|
|
177
|
+
| 环境诊断与自动修复 | `openyida doctor [--fix]` |
|
|
178
|
+
| 批量执行命令文件 | `openyida batch <file> [--stop-on-error] [--json]` |
|
|
179
|
+
| 批量执行内联命令 | `openyida batch --commands "cmd1 ; cmd2" [--stop-on-error] [--json]` |
|
|
180
|
+
| 检查并更新 OpenYida | `openyida update` |
|
|
181
|
+
| 配置 CDN/OSS 上传 | `openyida cdn-config [options]` |
|
|
182
|
+
| 上传图片到 CDN | `openyida cdn-upload <image-path>` |
|
|
183
|
+
| 刷新 CDN 缓存 | `openyida cdn-refresh [options]` |
|
|
184
|
+
| 检测/修复 PostgreSQL Sequence 漂移 | `openyida db-seq-fix [--fix]` |
|
|
185
|
+
| 启动 MCP 服务 | `openyida mcp` |
|
|
186
|
+
| 启动 A2A adapter 或输出 Agent Card | `openyida a2a <serve\|agent-card> [options]` |
|
|
187
|
+
| 启动本地 Web bridge | `openyida bridge start [--token <pair-token>] [--port 6736]` |
|
|
188
|
+
| 输出机器可读命令清单 | `openyida commands --json` |
|
|
189
|
+
| 输出 Agent 能力快照 | `openyida agent-capabilities --json` |
|
|
190
|
+
| 运行技能评测 | `openyida eval --mode <mode> [--skill <name>] [--runs N]` |
|
|
191
|
+
|
|
192
|
+
## Agent 能力、评测与安全提示
|
|
193
|
+
|
|
194
|
+
| 功能 | 执行操作 |
|
|
195
|
+
|---|---|
|
|
196
|
+
| 快速判断当前工作区、登录态、组织和命令能力 | `openyida agent-capabilities --summary-json` |
|
|
197
|
+
| 获取完整命令 Manifest、副作用和权限元数据 | `openyida commands --json` |
|
|
198
|
+
| 运行无副作用路由评测 | `openyida eval --mode routing [--skill <name>]` |
|
|
199
|
+
| 运行文档质量 / 安全 / 覆盖率评测 | `openyida eval --mode <doc-quality\|safety\|coverage\|comprehensive>` |
|
|
200
|
+
| 运行真实端到端评测 | `OPENYIDA_E2E=1 openyida eval --mode <e2e\|generate>` |
|
|
201
|
+
|
|
202
|
+
`commands --json` 中的 `sideEffect` 和 `permission` 是 Agent 执行前的重要依据。`mixed` 命令需要继续查看具体子命令或参数:例如 `data query` 是读操作,`data delete` 是删除;`nav-group list` 是读操作,`nav-group delete` 需要确认。
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
|
+
const { throwUsage } = require('../core/command-errors');
|
|
4
5
|
|
|
5
6
|
const {
|
|
6
7
|
listAgentTasks,
|
|
@@ -44,9 +45,7 @@ Examples:
|
|
|
44
45
|
`;
|
|
45
46
|
|
|
46
47
|
function fail(message) {
|
|
47
|
-
|
|
48
|
-
console.error(USAGE);
|
|
49
|
-
process.exit(1);
|
|
48
|
+
throwUsage(message, USAGE);
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
function parseCliOptions(tokens) {
|
package/lib/app/app-list.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
const { createAuthRef, createYidaClient } = require('../core/yida-client');
|
|
15
|
+
const { throwCommandError } = require('../core/command-errors');
|
|
15
16
|
|
|
16
17
|
const API_PATH = '/query/app/getAppList.json';
|
|
17
18
|
|
|
@@ -115,14 +116,12 @@ async function run(args) {
|
|
|
115
116
|
try {
|
|
116
117
|
apps = await fetchAllApps(authRef, pageSize);
|
|
117
118
|
} catch (err) {
|
|
118
|
-
|
|
119
|
-
process.exit(1);
|
|
119
|
+
throwCommandError(`查询应用列表失败:${err.message}`);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
// 如果重试后仍然返回登录失效标记,说明登录态确实不可用
|
|
123
123
|
if (apps && apps.__needLogin) {
|
|
124
|
-
|
|
125
|
-
process.exit(1);
|
|
124
|
+
throwCommandError('登录态已失效,请重新登录', { code: 'CLI_AUTH_REQUIRED' });
|
|
126
125
|
}
|
|
127
126
|
|
|
128
127
|
if (!apps || apps.length === 0) {
|
package/lib/app/build-page.js
CHANGED
|
@@ -4,8 +4,9 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const { buildPageFile } = require('./page-compat');
|
|
6
6
|
const { printLintResult } = require('./page-linter');
|
|
7
|
-
const { warn,
|
|
7
|
+
const { warn, success, result, label, hint } = require('../core/chalk');
|
|
8
8
|
const { t } = require('../core/i18n');
|
|
9
|
+
const { throwCommandError, throwUsage } = require('../core/command-errors');
|
|
9
10
|
|
|
10
11
|
function parseArgs(args) {
|
|
11
12
|
const options = {
|
|
@@ -45,14 +46,17 @@ function parseArgs(args) {
|
|
|
45
46
|
async function run(args) {
|
|
46
47
|
const options = parseArgs(args || []);
|
|
47
48
|
if (!options.sourceFile) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
throwUsage(t('cli.build_page_usage'), t('cli.build_page_example'), {
|
|
50
|
+
code: 'BUILD_PAGE_INVALID_ARGUMENTS',
|
|
51
|
+
});
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
const sourcePath = path.resolve(options.sourceFile);
|
|
54
55
|
if (!fs.existsSync(sourcePath)) {
|
|
55
|
-
|
|
56
|
+
throwCommandError(t('publish.source_not_found', sourcePath), {
|
|
57
|
+
code: 'BUILD_PAGE_SOURCE_NOT_FOUND',
|
|
58
|
+
details: { sourcePath },
|
|
59
|
+
});
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
const buildResult = buildPageFile(sourcePath, {
|
|
@@ -88,7 +92,10 @@ async function run(args) {
|
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
if (!buildResult.ok) {
|
|
91
|
-
|
|
95
|
+
throwCommandError(t('build_page.failed'), {
|
|
96
|
+
code: 'BUILD_PAGE_FAILED',
|
|
97
|
+
details: { errors: buildResult.errors },
|
|
98
|
+
});
|
|
92
99
|
}
|
|
93
100
|
|
|
94
101
|
if (!options.json) {
|
package/lib/app/check-page.js
CHANGED
|
@@ -6,7 +6,8 @@ const { lintYidaSource, printLintResult } = require('./page-linter');
|
|
|
6
6
|
const { buildPageSource, shouldBuildPageSource } = require('./page-compat');
|
|
7
7
|
const { warnLargePageSource } = require('./page-size-guard');
|
|
8
8
|
const { t } = require('../core/i18n');
|
|
9
|
-
const { warn,
|
|
9
|
+
const { warn, hint } = require('../core/chalk');
|
|
10
|
+
const { throwCommandError, throwUsage } = require('../core/command-errors');
|
|
10
11
|
|
|
11
12
|
function parseArgs(args) {
|
|
12
13
|
return {
|
|
@@ -20,14 +21,17 @@ async function run(args) {
|
|
|
20
21
|
const options = parseArgs(args || []);
|
|
21
22
|
|
|
22
23
|
if (!options.sourceFile) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
throwUsage(t('cli.check_page_usage'), t('cli.check_page_example'), {
|
|
25
|
+
code: 'CHECK_PAGE_INVALID_ARGUMENTS',
|
|
26
|
+
});
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
const sourcePath = path.resolve(options.sourceFile);
|
|
29
30
|
if (!fs.existsSync(sourcePath)) {
|
|
30
|
-
|
|
31
|
+
throwCommandError(t('publish.source_not_found', sourcePath), {
|
|
32
|
+
code: 'CHECK_PAGE_SOURCE_NOT_FOUND',
|
|
33
|
+
details: { sourcePath },
|
|
34
|
+
});
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
const sourceCode = fs.readFileSync(sourcePath, 'utf-8');
|
|
@@ -63,7 +67,13 @@ async function run(args) {
|
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
if (!ok) {
|
|
66
|
-
|
|
70
|
+
throwCommandError(t('check_page.failed'), {
|
|
71
|
+
code: 'CHECK_PAGE_FAILED',
|
|
72
|
+
details: {
|
|
73
|
+
errors: lintResult.errors,
|
|
74
|
+
buildErrors,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
67
77
|
}
|
|
68
78
|
}
|
|
69
79
|
|
package/lib/app/compile.js
CHANGED
|
@@ -7,7 +7,8 @@ const { runLintCheck } = require('./page-linter');
|
|
|
7
7
|
const { buildPageFile, shouldBuildPageSource } = require('./page-compat');
|
|
8
8
|
const { warnLargePageSource } = require('./page-size-guard');
|
|
9
9
|
const { t } = require('../core/i18n');
|
|
10
|
-
const { warn,
|
|
10
|
+
const { warn, info, step } = require('../core/chalk');
|
|
11
|
+
const { throwCommandError, throwUsage } = require('../core/command-errors');
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* compile 命令:只编译自定义页面源码,不发布到宜搭。
|
|
@@ -15,9 +16,9 @@ const { warn, error, info, step } = require('../core/chalk');
|
|
|
15
16
|
*/
|
|
16
17
|
async function run(args) {
|
|
17
18
|
if (!args || args.length < 1) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
throwUsage(t('cli.compile_usage'), t('cli.compile_example'), {
|
|
20
|
+
code: 'COMPILE_INVALID_ARGUMENTS',
|
|
21
|
+
});
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const skipLint = args.includes('--skip-lint');
|
|
@@ -25,7 +26,10 @@ async function run(args) {
|
|
|
25
26
|
const filteredArgs = args.filter(arg => arg !== '--skip-lint' && arg !== '--compat' && arg !== '--modern');
|
|
26
27
|
let sourcePath = path.resolve(filteredArgs[0]);
|
|
27
28
|
if (!fs.existsSync(sourcePath)) {
|
|
28
|
-
|
|
29
|
+
throwCommandError(t('publish.source_not_found', sourcePath), {
|
|
30
|
+
code: 'COMPILE_SOURCE_NOT_FOUND',
|
|
31
|
+
details: { sourcePath },
|
|
32
|
+
});
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
const initialSourceCode = fs.readFileSync(sourcePath, 'utf-8');
|
|
@@ -35,7 +39,10 @@ async function run(args) {
|
|
|
35
39
|
const buildResult = buildPageFile(sourcePath, { modern: compat, skipSizeWarning: true });
|
|
36
40
|
if (!buildResult.ok) {
|
|
37
41
|
buildResult.errors.forEach((issue) => warn(`${issue.code}: ${issue.message}`));
|
|
38
|
-
|
|
42
|
+
throwCommandError(t('build_page.failed'), {
|
|
43
|
+
code: 'COMPILE_BUILD_PAGE_FAILED',
|
|
44
|
+
details: { errors: buildResult.errors },
|
|
45
|
+
});
|
|
39
46
|
}
|
|
40
47
|
sourcePath = buildResult.outputPath;
|
|
41
48
|
info(t('build_page.output', sourcePath));
|
|
@@ -46,7 +53,10 @@ async function run(args) {
|
|
|
46
53
|
const sourceCode = fs.readFileSync(sourcePath, 'utf-8');
|
|
47
54
|
const lintPassed = runLintCheck(sourceCode, sourcePath);
|
|
48
55
|
if (!lintPassed) {
|
|
49
|
-
|
|
56
|
+
throwCommandError(t('check_page.failed'), {
|
|
57
|
+
code: 'COMPILE_LINT_FAILED',
|
|
58
|
+
details: { sourcePath },
|
|
59
|
+
});
|
|
50
60
|
}
|
|
51
61
|
} else {
|
|
52
62
|
info(t('publish.lint_skipped'));
|
package/lib/app/create-app.js
CHANGED
|
@@ -17,6 +17,7 @@ const { createAuthRef } = require('../core/yida-client');
|
|
|
17
17
|
const { t } = require('../core/i18n');
|
|
18
18
|
const { buildYidaI18n, normalizeYidaLocale, resolveContentLocale } = require('../core/yida-i18n');
|
|
19
19
|
const { parseOpenOption, withBrowserHandoff } = require('../core/browser-handoff');
|
|
20
|
+
const { throwCommandError } = require('../core/command-errors');
|
|
20
21
|
const { assertPresetThemeKey } = require('./theme-presets');
|
|
21
22
|
|
|
22
23
|
const DEFAULT_APP_OPTIONS = {
|
|
@@ -370,7 +371,7 @@ async function run(args) {
|
|
|
370
371
|
const errorMsg = response ? response.errorMsg || t('common.unknown_error') : t('common.request_failed');
|
|
371
372
|
chalkResult(false, t('create_app.failed', errorMsg));
|
|
372
373
|
console.log(JSON.stringify({ success: false, error: errorMsg }));
|
|
373
|
-
|
|
374
|
+
throwCommandError(errorMsg);
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
377
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* create-form/api-path.js
|
|
5
|
+
*
|
|
6
|
+
* 接口路径生成:构建宜搭表单设计相关的 API 请求路径。
|
|
7
|
+
*
|
|
8
|
+
* @param {string} appType 应用标识(appType)
|
|
9
|
+
* @param {string} apiName 接口名称(不含扩展名),如 saveFormSchema
|
|
10
|
+
* @param {object} [options] 可选项
|
|
11
|
+
* @param {string} [options.prefix] 额外的路径前缀(会以 / 拼接)
|
|
12
|
+
* @param {string} [options.namespace] 命名空间,默认 dingtalk
|
|
13
|
+
* @param {boolean} [options.addTimestamp] 是否追加 _stamp 时间戳查询参数
|
|
14
|
+
* @returns {string} 拼接完成的 API 请求路径
|
|
15
|
+
*/
|
|
16
|
+
function buildApiPath(appType, apiName, options = {}) {
|
|
17
|
+
const { prefix = '', namespace = 'dingtalk', addTimestamp = false } = options;
|
|
18
|
+
const prefixPath = prefix ? `/${prefix}` : '';
|
|
19
|
+
const timestamp = addTimestamp ? `?_stamp=${Date.now()}` : '';
|
|
20
|
+
return `/${namespace}/web/${appType}${prefixPath}/query/formdesign/${apiName}.json${timestamp}`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = {
|
|
24
|
+
buildApiPath,
|
|
25
|
+
};
|
|
@@ -17,7 +17,11 @@ function dispatchCreateFormCommand(parsedArgs, authContext, handlers) {
|
|
|
17
17
|
case 'add-option':
|
|
18
18
|
return handlers.addOption(...args);
|
|
19
19
|
case 'create':
|
|
20
|
+
return handlers.create(...args);
|
|
20
21
|
default:
|
|
22
|
+
if (parsedArgs.mode && parsedArgs.mode !== 'create') {
|
|
23
|
+
throw new Error('Unknown create-form mode: ' + parsedArgs.mode);
|
|
24
|
+
}
|
|
21
25
|
return handlers.create(...args);
|
|
22
26
|
}
|
|
23
27
|
}
|