openyida 2026.8.12 → 2026.8.14
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 +4 -0
- package/docs/capabilities.md +21 -5
- package/lib/app/canvas-compile.js +0 -19
- package/lib/app/create-app.js +2 -0
- package/lib/app/import-app.js +2 -0
- package/lib/app/page-linter.js +0 -5
- package/lib/core/agent-capabilities.js +75 -20
- package/lib/core/locales/en.js +0 -1
- package/lib/core/locales/zh.js +0 -1
- package/package.json +1 -1
- package/yida-skills/SKILL.md +90 -200
- package/yida-skills/references/execution-rules.md +8 -0
- package/yida-skills/references/resource-context.md +81 -0
- package/yida-skills/references/routing-supplement.md +27 -0
- package/yida-skills/references/setup-and-env.md +31 -36
- package/yida-skills/skills/yida-app/SKILL.md +48 -306
- package/yida-skills/skills/yida-app/references/common-issues.md +49 -0
- package/yida-skills/skills/yida-app/workflow/step-1-resource-context.md +63 -0
- package/yida-skills/skills/yida-app/workflow/step-2-design.md +40 -0
- package/yida-skills/skills/yida-app/workflow/step-3-create-or-reuse-app.md +34 -0
- package/yida-skills/skills/yida-app/workflow/step-4-forms-processes.md +74 -0
- package/yida-skills/skills/yida-app/workflow/step-5-seed-records.md +44 -0
- package/yida-skills/skills/yida-app/workflow/step-6-main-page.md +35 -0
- package/yida-skills/skills/yida-app/workflow/step-7-page-code.md +50 -0
- package/yida-skills/skills/yida-app/workflow/step-8-publish-navigation.md +42 -0
- package/yida-skills/skills/yida-app/workflow/step-9-output-finish.md +82 -0
- package/yida-skills/skills/yida-canvas-custom-page/references/canvas-style-implementation-guide.md +2 -2
- package/yida-skills/skills/yida-canvas-custom-page/references/page-generation-guide.md +4 -4
- package/yida-skills/skills/yida-create-form-page/SKILL.md +4 -3
- package/yida-skills/skills/yida-design/SKILL.md +10 -10
- package/yida-skills/skills/yida-design/references/page-quality-gates.md +5 -5
- package/yida-skills/skills/yida-design/references/style-design-selection.md +29 -29
- package/yida-skills/skills/yida-design/references/style-designs/aqua-service-progress-dashboard.md +3 -3
- package/yida-skills/skills/yida-design/references/style-designs/blue-insight-operations-dashboard.md +3 -3
- package/yida-skills/skills/yida-design/references/style-designs/blue-productivity-insight-workbench.md +3 -3
- package/yida-skills/skills/yida-design/references/style-designs/command-filter-card-console.md +4 -4
- package/yida-skills/skills/yida-design/references/style-designs/contrast-command-analytics-workbench.md +4 -4
- package/yida-skills/skills/yida-design/references/style-designs/dark-stage-analytic-dashboard.md +8 -8
- package/yida-skills/skills/yida-design/references/style-designs/filterable-card-catalog.md +5 -5
- package/yida-skills/skills/yida-design/references/style-designs/green-timeline-progress-workbench.md +3 -3
- package/yida-skills/skills/yida-design/references/style-designs/registry.md +30 -30
- package/yida-skills/skills/yida-design/references/style-designs/soft-analytic-workbench.md +4 -4
- package/yida-skills/skills/yida-design/references/style-designs/soft-blue-grid-analytic-dashboard.md +1 -1
- package/yida-skills/skills/yida-design/references/style-designs/soft-bordered-analytic-workbench.md +4 -4
- package/yida-skills/skills/yida-design/references/style-designs/soft-curated-filter-gallery.md +4 -4
- package/yida-skills/skills/yida-design/references/style-designs/soft-modular-analytic-workbench.md +5 -5
- package/yida-skills/skills/yida-design/references/style-designs/soft-progress-analytics-workbench.md +4 -4
- package/yida-skills/skills/yida-design/references/style-designs/soft-timeline-analytics-workbench.md +8 -8
- package/yida-skills/skills/yida-design/references/style-designs/teal-rail-analytics-workbench.md +8 -8
- package/yida-skills/skills/yida-design/references/visual-scaffold-recipes.md +2 -2
- package/yida-skills/skills/yida-design/workflow/output-design.md +25 -19
- package/yida-skills/skills/yida-design/workflow/output-prd.md +14 -9
- package/yida-skills/skills/yida-design/workflow/step-1-positioning.md +1 -1
- package/yida-skills/skills/yida-design/workflow/step-2-theme-system.md +1 -1
- package/yida-skills/skills/yida-design/workflow/step-3-information-architecture.md +3 -3
- package/yida-skills/skills/yida-design/workflow/step-4-wireframe-interaction.md +4 -4
- package/yida-skills/skills/yida-design/workflow/step-5-visual-states.md +12 -12
- package/yida-skills/skills/yida-design/workflow/step-6-handoff.md +3 -3
- package/yida-skills/skills/yida-flash-note-to-prd/SKILL.md +31 -33
- package/yida-skills/skills/yida-flash-note-to-prd/references/flash-note-prd-template.md +1 -1
- package/yida-skills/skills/yida-form-detail/SKILL.md +7 -7
- package/yida-skills/skills/yida-login/SKILL.md +32 -31
- package/yida-skills/skills/yida-publish-page/SKILL.md +9 -6
- package/lib/app/page-richness-guard.js +0 -108
- package/yida-skills/references/development-rules.md +0 -85
- package/yida-skills/skills/yida-app/references/app-build-contract.md +0 -141
package/README.md
CHANGED
|
@@ -641,7 +641,9 @@ Latest contributors: [DDlixin1](https://github.com/DDlixin1), [fcloud](https://g
|
|
|
641
641
|
<p>
|
|
642
642
|
<a href="https://github.com/yize"><img src="https://github.com/yize.png?size=48" width="48" height="48" alt="九神" title="九神" /></a>
|
|
643
643
|
<a href="https://github.com/alex-mm"><img src="https://github.com/alex-mm.png?size=48" width="48" height="48" alt="天晟" title="天晟" /></a>
|
|
644
|
+
<a href="https://github.com/fryaninc"><img src="https://github.com/fryaninc.png?size=48" width="48" height="48" alt="New Core architecture, Core development, user issue support, skill maintenance and Help & Show Case Center 构建者" title="New Core architecture, Core development, user issue support, skill maintenance and Help & Show Case Center 构建者" /></a>
|
|
644
645
|
<a href="https://github.com/DDlixin1"><img src="https://github.com/DDlixin1.png?size=48" width="48" height="48" alt="DDlixin1" title="DDlixin1" /></a>
|
|
646
|
+
<a href="https://github.com/xhy-ali"><img src="https://github.com/xhy-ali.png?size=48" width="48" height="48" alt="登录态开发者" title="登录态开发者" /></a>
|
|
645
647
|
<a href="https://github.com/fcloud"><img src="https://github.com/fcloud.png?size=48" width="48" height="48" alt="Aiden Wu (fcloud)" title="Aiden Wu (fcloud)" /></a>
|
|
646
648
|
<a href="https://github.com/nicky1108"><img src="https://github.com/nicky1108.png?size=48" width="48" height="48" alt="nicky1108" title="nicky1108" /></a>
|
|
647
649
|
<a href="https://github.com/angelinheys"><img src="https://github.com/angelinheys.png?size=48" width="48" height="48" alt="angelinheys" title="angelinheys" /></a>
|
|
@@ -658,6 +660,8 @@ Latest contributors: [DDlixin1](https://github.com/DDlixin1), [fcloud](https://g
|
|
|
658
660
|
<a href="https://github.com/key-668"><img src="https://github.com/key-668.png?size=48" width="48" height="48" alt="再不喝汽水" title="再不喝汽水" /></a>
|
|
659
661
|
<a href="https://github.com/dongbeixiaohuo"><img src="https://github.com/dongbeixiaohuo.png?size=48" width="48" height="48" alt="dongbeixiaohuo" title="dongbeixiaohuo" /></a>
|
|
660
662
|
<a href="https://github.com/nandanadileep"><img src="https://github.com/nandanadileep.png?size=48" width="48" height="48" alt="nandanadileep" title="nandanadileep" /></a>
|
|
663
|
+
<a href="https://github.com/hj837990198"><img src="https://github.com/hj837990198.png?size=48" width="48" height="48" alt="skill 测试" title="skill 测试" /></a>
|
|
664
|
+
<a href="https://github.com/chengminchao-create"><img src="https://github.com/chengminchao-create.png?size=48" width="48" height="48" alt="skill共建" title="skill共建" /></a>
|
|
661
665
|
</p>
|
|
662
666
|
|
|
663
667
|
<!-- openyida-contributors:end -->
|
package/docs/capabilities.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# OpenYida 功能完整列表
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
这份清单面向宜搭使用者和 AI Agent,按本地 OpenYida `2026.8.12-1` 的 101 条命令和技能路由整理。参数细节可以继续查看 `openyida --help`、`openyida <command> --help` 或 `openyida commands --json`。
|
|
4
|
+
|
|
5
|
+
<Note>
|
|
6
|
+
日常使用建议先运行 `openyida agent-capabilities --summary-json`,它会轻量返回版本、登录态、组织、工作目录和命令清单摘要。只有排查命令契约、权限元数据或登录异常时,再使用完整的 `openyida agent-capabilities --json`。
|
|
7
|
+
</Note>
|
|
4
8
|
|
|
5
9
|
## 基础操作
|
|
6
10
|
|
|
@@ -27,6 +31,8 @@
|
|
|
27
31
|
| 查询我的应用 | `openyida app-list [--size N]` |
|
|
28
32
|
| 创建应用 | `openyida create-app "<应用名称>"` |
|
|
29
33
|
| 更新应用名称、布局、主题 | `openyida update-app <appType> [--name "..."] [--layout slide\|ver] [--theme deepBlue]` |
|
|
34
|
+
| 启用应用 / 上线应用 | `openyida app-online <appType> [--to-ding-app-center] [--show-app-center]` |
|
|
35
|
+
| 停用应用 / 下线应用 | `openyida app-offline <appType> [--to-ding-app-center] [--show-app-center]` |
|
|
30
36
|
| 导出应用迁移包 | `openyida export <appType> [output]` |
|
|
31
37
|
| 导入应用迁移包 | `openyida import <file> [name]` |
|
|
32
38
|
| 管理左侧导航分组 | `openyida nav-group <list\|create\|rename\|delete\|move\|order\|hide\|show> <appType> ...` |
|
|
@@ -43,6 +49,7 @@
|
|
|
43
49
|
| 功能 | 执行操作 |
|
|
44
50
|
|---|---|
|
|
45
51
|
| 创建表单 | `openyida create-form create <appType> ...` |
|
|
52
|
+
| 校验表单字段配置 | `openyida create-form validate-fields <fieldsJsonOrFile>` |
|
|
46
53
|
| 更新表单字段 | `openyida create-form update <appType> ...` |
|
|
47
54
|
| 用 patch 更新表单 | `openyida create-form patch <appType> <formUuid> <patchJsonOrFile>` |
|
|
48
55
|
| 配置表单联动规则 | `openyida create-form rule <appType> <formUuid> <rulesJsonOrFile>` |
|
|
@@ -54,6 +61,7 @@
|
|
|
54
61
|
| 获取表单 Schema | `openyida get-schema <appType> <formUuid>` |
|
|
55
62
|
| 获取应用全部 Schema | `openyida get-schema <appType> --all` |
|
|
56
63
|
| 导出 ER 关系图 | `openyida er <appType> [--format mermaid\|json] [--output file]` |
|
|
64
|
+
| 注入、移除或检查表单详情页样式 | `openyida form-detail-style <apply\|remove\|check> <appType> <formUuid> ...` |
|
|
57
65
|
| 管理聚合表 virtualView | `openyida aggregate-table <list\|create-empty\|inspect\|preview\|save\|publish\|status> <appType> ...` |
|
|
58
66
|
|
|
59
67
|
## 自定义页面与发布
|
|
@@ -62,6 +70,7 @@
|
|
|
62
70
|
|---|---|
|
|
63
71
|
| 创建自定义页面 | `openyida create-page <appType> "<页面名称>"` |
|
|
64
72
|
| 创建看板页 | `openyida create-page <appType> "<页面名称>" --mode dashboard` |
|
|
73
|
+
| 查看或输出自定义页面示例 | `openyida sample yida-canvas-custom-page <sample> --output project/pages/src/<name>.canvas.jsx` / `openyida sample yida-custom-page <sample> --output project/pages/src/<name>.oyd.jsx` |
|
|
65
74
|
| 构建宜搭兼容页面源码 | `openyida build-page <sourceFile> [--output file\|--write]` |
|
|
66
75
|
| 检查普通自定义页面 JSX 规范 | `openyida check-page <src> [--compat]` |
|
|
67
76
|
| 本地编译普通自定义页面 JSX | `openyida compile <src>` |
|
|
@@ -72,8 +81,8 @@
|
|
|
72
81
|
| 更新页面/表单配置 | `openyida update-form-config <appType> ...` |
|
|
73
82
|
| 查询页面/表单配置 | `openyida get-form-config <appType> <formUuid> [--json]` |
|
|
74
83
|
| 开发高级自定义页面、看板、图表或幻灯片 | 默认优先使用 Code Canvas 链路;明确要求普通自定义页面 JSX/Jsx,或强依赖普通自定义页实例桥时使用 `.oyd.jsx` + `check-page` / `compile` / `publish` |
|
|
75
|
-
| Code Canvas 页面使用成员/部门/上传等宜搭运行态组件 |
|
|
76
|
-
| Code Canvas 门户 +
|
|
84
|
+
| 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` |
|
|
85
|
+
| Code Canvas 门户 + 成员/部门/上传组件示例 | `openyida sample yida-canvas-custom-page portal-native-components --output pages/src/portal-native-components.canvas.jsx` |
|
|
77
86
|
| 普通自定义页面 JSX/Jsx 使用成员/部门组件 | 使用 `.oyd.jsx`,参考 `yida-custom-page/references/component-jsx-guide.md` |
|
|
78
87
|
| 普通自定义页面 JSX/Jsx 使用附件/图片上传 | 使用 `.oyd.jsx`,参考 `yida-custom-page/references/attachment-upload-guide.md` |
|
|
79
88
|
|
|
@@ -81,12 +90,16 @@
|
|
|
81
90
|
|
|
82
91
|
| 需求 | 推荐链路 |
|
|
83
92
|
|---|---|
|
|
84
|
-
| 现代 React、
|
|
93
|
+
| 现代 React、Hooks、官网、工作台、看板、列表、详情、可视化、AI 首次生成页面 | Code Canvas:`.canvas.jsx` / `.canvas.tsx` / `YidaCodeCanvas` |
|
|
85
94
|
| 需要成员、部门、附件上传、图片上传等宜搭运行态组件,且希望页面保持现代 React 体验 | Code Canvas + 原生组件桥;先跑 smoke 示例验证运行态组件,再做 fallback 和值归一化 |
|
|
86
95
|
| 用户明确要求普通自定义页面 JSX/Jsx 组件链路 | 普通自定义页面:`.oyd.jsx` / `Jsx` |
|
|
87
96
|
| 强依赖 `this.$(fieldId)`、`this.utils.yida.*`、`this.dataSourceMap`、表单提交或字段双向绑定 | 普通自定义页面:`.oyd.jsx` / `Jsx` |
|
|
88
97
|
| 已有普通 `.oyd.jsx` 页面要迁移到 Code Canvas | 参考 `yida-canvas-upgrade` 技能 |
|
|
89
98
|
|
|
99
|
+
<Tip>
|
|
100
|
+
新版自定义页面默认走 Code Canvas。`check-page` 和 `compile` 主要用于普通自定义页面 JSX;`.canvas.jsx` / `.canvas.tsx` 由 `openyida publish` 的 Canvas 编译阶段校验。
|
|
101
|
+
</Tip>
|
|
102
|
+
|
|
90
103
|
## 流程、审批与任务
|
|
91
104
|
|
|
92
105
|
| 功能 | 执行操作 |
|
|
@@ -123,7 +136,8 @@
|
|
|
123
136
|
|---|---|
|
|
124
137
|
| 创建宜搭原生报表 | `openyida create-report <appType> "<报表名称>" ...` |
|
|
125
138
|
| 向已有报表追加图表 | `openyida append-chart <appType> <reportId> ...` |
|
|
126
|
-
| 创建
|
|
139
|
+
| 创建 Recharts 高级看板 | 使用 Code Canvas + Recharts 示例,并执行 `openyida publish ...` |
|
|
140
|
+
| 维护 ECharts 复杂图表页面 | 使用普通自定义页面或 ECharts 兼容链路,并执行 `openyida publish ...` |
|
|
127
141
|
| 创建经营看板/管理驾驶舱/数据大屏 | 使用 `create-page`、数据源配置、报表命令和 `publish` 组合完成 |
|
|
128
142
|
|
|
129
143
|
## 连接器、集成与钉钉
|
|
@@ -164,6 +178,8 @@
|
|
|
164
178
|
| 解析并回填页面素材 | `openyida asset resolve [options]` |
|
|
165
179
|
| 生成 AI 图片素材 | `openyida asset generate [options]` |
|
|
166
180
|
| 检查宜搭公式 | `openyida formula evaluate <formula\|file> [--schema file]` |
|
|
181
|
+
| 读取钉钉文档并转为 Markdown | `openyida read-dingtalk-doc <docUrl> [--output <file>] [--json]` |
|
|
182
|
+
| 按 taskUuid 读取钉钉听记 | `openyida read-dingtalk-tingji <taskUuid> [--json]` |
|
|
167
183
|
| 闪记/会议纪要转 PRD | `openyida flash-to-prd --file <path> --name "<project>"` |
|
|
168
184
|
| 导出 AI 对话记录 | `openyida export-conversation [options]` |
|
|
169
185
|
| 整理 VOC 反馈材料 | 按故障、需求或性能问题整理成可提交材料 |
|
|
@@ -46,10 +46,6 @@ const {
|
|
|
46
46
|
findFormDetailLinkIssues,
|
|
47
47
|
formatFormDetailLinkMessage,
|
|
48
48
|
} = require('./form-detail-link-guard');
|
|
49
|
-
const {
|
|
50
|
-
findPageRichnessIssues,
|
|
51
|
-
formatPageRichnessMessage,
|
|
52
|
-
} = require('./page-richness-guard');
|
|
53
49
|
|
|
54
50
|
/**
|
|
55
51
|
* 依赖 → window 别名白名单,用于把 import 改写到运行时全局对象。
|
|
@@ -621,21 +617,6 @@ function compileCanvasLocal(source, options = {}) {
|
|
|
621
617
|
},
|
|
622
618
|
});
|
|
623
619
|
}
|
|
624
|
-
const richnessIssues = findPageRichnessIssues(source);
|
|
625
|
-
if (richnessIssues.length > 0) {
|
|
626
|
-
const firstIssue = richnessIssues[0];
|
|
627
|
-
throw new CliError(formatPageRichnessMessage(firstIssue), {
|
|
628
|
-
code: 'OPENYIDA_CANVAS_CONTENT_BLOCKS_TOO_FEW',
|
|
629
|
-
details: {
|
|
630
|
-
stage: 'canvas_compile',
|
|
631
|
-
sourcePath: options.sourcePath || '',
|
|
632
|
-
line: firstIssue.line,
|
|
633
|
-
scene: firstIssue.scene,
|
|
634
|
-
count: firstIssue.count,
|
|
635
|
-
min: firstIssue.min,
|
|
636
|
-
},
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
620
|
assertNoBareDependencyGlobals(source, options);
|
|
640
621
|
assertNoManualDependencyGlobals(source, options);
|
|
641
622
|
|
package/lib/app/create-app.js
CHANGED
|
@@ -269,6 +269,8 @@ function buildCreateAppPayload(params, auth, contentLocale, openExclusive, openP
|
|
|
269
269
|
openIsolationDatabase: 'n',
|
|
270
270
|
openExclusiveUnit: 'n',
|
|
271
271
|
group: 'ALL',
|
|
272
|
+
fromBuilderAi: 'y',
|
|
273
|
+
builderAiSource: 'local',
|
|
272
274
|
};
|
|
273
275
|
if (navTheme) {
|
|
274
276
|
payload.navTheme = navTheme;
|
package/lib/app/import-app.js
CHANGED
|
@@ -40,6 +40,8 @@ async function createApp(appName, authRef) {
|
|
|
40
40
|
openIsolationDatabase: 'n',
|
|
41
41
|
openExclusiveUnit: 'n',
|
|
42
42
|
group: 'ALL',
|
|
43
|
+
fromBuilderAi: 'y',
|
|
44
|
+
builderAiSource: 'local',
|
|
43
45
|
});
|
|
44
46
|
return httpPost(auth.baseUrl, '/query/app/registerApp.json', postData, auth.cookies);
|
|
45
47
|
}, authRef);
|
package/lib/app/page-linter.js
CHANGED
|
@@ -9,7 +9,6 @@ const {
|
|
|
9
9
|
const { findBareCjkJsxTextIdentifiers } = require('./jsx-text-guard');
|
|
10
10
|
const { findDirectFormOpenIssues } = require('./form-open-guard');
|
|
11
11
|
const { findFormDetailLinkIssues } = require('./form-detail-link-guard');
|
|
12
|
-
const { findPageRichnessIssues } = require('./page-richness-guard');
|
|
13
12
|
const Babel = require('@babel/standalone');
|
|
14
13
|
|
|
15
14
|
const THEN_CALLBACK_LINE_LIMIT = 50;
|
|
@@ -866,10 +865,6 @@ function lintYidaSource(sourceCode, filePath) {
|
|
|
866
865
|
findFormDetailLinkIssues(sourceCode, { parserOptions: PARSER_OPTIONS }).forEach((issue) => {
|
|
867
866
|
pushIssue(errors, issue.line, 'form-detail-link', t('publish.lint_form_detail_link'), disableMap);
|
|
868
867
|
});
|
|
869
|
-
findPageRichnessIssues(sourceCode).forEach((issue) => {
|
|
870
|
-
pushIssue(errors, issue.line, 'content-blocks-too-few', t('publish.lint_content_blocks_too_few', issue.count, issue.min), disableMap);
|
|
871
|
-
});
|
|
872
|
-
|
|
873
868
|
return { errors, warnings };
|
|
874
869
|
}
|
|
875
870
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const crypto = require('crypto');
|
|
4
|
+
const fs = require('fs');
|
|
4
5
|
const path = require('path');
|
|
5
6
|
const { version } = require('../../package.json');
|
|
6
7
|
const { t } = require('./i18n');
|
|
7
8
|
const { buildCommandManifest } = require('./command-manifest');
|
|
8
9
|
const { buildEnvironmentSnapshot } = require('./env');
|
|
9
|
-
const { getAuthStatus } = require('./utils');
|
|
10
|
+
const { findProjectRoot, getAuthStatus } = require('./utils');
|
|
10
11
|
|
|
11
12
|
function redactLogin(login) {
|
|
12
13
|
const redacted = { ...login };
|
|
@@ -35,6 +36,21 @@ function hasEnvTokenCredential(env = process.env) {
|
|
|
35
36
|
);
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
function hasRuntimeProvisionedAccessToken(env = process.env) {
|
|
40
|
+
return isTruthyEnv(env.YIDA_AUTH_ENABLED) &&
|
|
41
|
+
!!String(env.OPENYIDA_ACCESS_TOKEN || '').trim();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function buildRuntimeProvisionedLoginStatus() {
|
|
45
|
+
return {
|
|
46
|
+
ok: true,
|
|
47
|
+
auth_mode: 'token',
|
|
48
|
+
auth_source: 'env',
|
|
49
|
+
status: 'ok',
|
|
50
|
+
can_auto_use: true,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
38
54
|
const BUILDER_CORE_COMMAND_IDS = Object.freeze([
|
|
39
55
|
'agent-capabilities',
|
|
40
56
|
'commands',
|
|
@@ -84,8 +100,10 @@ function buildAuthPath(login, env = process.env) {
|
|
|
84
100
|
const envTokenPresent = hasEnvTokenCredential(env);
|
|
85
101
|
const authSource = login.auth_source || (hostInjectedTokenMode || envTokenPresent ? 'env' : 'token_session');
|
|
86
102
|
const hostTokenEnvDetected = hostInjectedTokenMode || envTokenPresent || authSource === 'env';
|
|
87
|
-
|
|
88
|
-
|
|
103
|
+
const runtimeAuthProvisioned = hasRuntimeProvisionedAccessToken(env) &&
|
|
104
|
+
authSource === 'env' &&
|
|
105
|
+
login.status === 'ok';
|
|
106
|
+
const authPath = {
|
|
89
107
|
mode: login.auth_mode || 'token',
|
|
90
108
|
source: authSource,
|
|
91
109
|
can_auto_use: login.can_auto_use === true,
|
|
@@ -109,6 +127,10 @@ function buildAuthPath(login, env = process.env) {
|
|
|
109
127
|
? 'STOP_AND_REQUEST_HOST_TOKEN'
|
|
110
128
|
: 'RUN_OPENYIDA_LOGIN_IF_USER_APPROVES',
|
|
111
129
|
};
|
|
130
|
+
if (runtimeAuthProvisioned) {
|
|
131
|
+
authPath.runtime_auth_provisioned = true;
|
|
132
|
+
}
|
|
133
|
+
return authPath;
|
|
112
134
|
}
|
|
113
135
|
|
|
114
136
|
function buildBuilderPath(login, projectRoot, manifest, env = process.env) {
|
|
@@ -218,26 +240,30 @@ function compactBuilderPath(builderPath) {
|
|
|
218
240
|
const commandContract = builderPath.command_contract;
|
|
219
241
|
const resourceContext = builderPath.resource_context_resolution;
|
|
220
242
|
const paths = builderPath.paths;
|
|
243
|
+
const auth = {
|
|
244
|
+
mode: builderPath.auth.mode,
|
|
245
|
+
source: builderPath.auth.source,
|
|
246
|
+
can_auto_use: builderPath.auth.can_auto_use,
|
|
247
|
+
host_injected_token_mode: builderPath.auth.host_injected_token_mode,
|
|
248
|
+
host_token_env_detected: builderPath.auth.host_token_env_detected,
|
|
249
|
+
env_token_present: builderPath.auth.env_token_present,
|
|
250
|
+
interactive_login_allowed: builderPath.auth.interactive_login_allowed,
|
|
251
|
+
browser_session_auth_allowed: builderPath.auth.browser_session_auth_allowed,
|
|
252
|
+
auth_runtime: builderPath.auth.auth_runtime,
|
|
253
|
+
cookie_auth_supported: builderPath.auth.cookie_auth_supported,
|
|
254
|
+
cookie_check_required: builderPath.auth.cookie_check_required,
|
|
255
|
+
playwright_cookie_check_required: builderPath.auth.playwright_cookie_check_required,
|
|
256
|
+
qr_login_required: builderPath.auth.qr_login_required,
|
|
257
|
+
missing_token_action: builderPath.auth.missing_token_action,
|
|
258
|
+
};
|
|
259
|
+
if (builderPath.auth.runtime_auth_provisioned === true) {
|
|
260
|
+
auth.runtime_auth_provisioned = true;
|
|
261
|
+
}
|
|
221
262
|
|
|
222
263
|
return {
|
|
223
264
|
schema_version: builderPath.schema_version,
|
|
224
265
|
preflight: builderPath.preflight,
|
|
225
|
-
auth
|
|
226
|
-
mode: builderPath.auth.mode,
|
|
227
|
-
source: builderPath.auth.source,
|
|
228
|
-
can_auto_use: builderPath.auth.can_auto_use,
|
|
229
|
-
host_injected_token_mode: builderPath.auth.host_injected_token_mode,
|
|
230
|
-
host_token_env_detected: builderPath.auth.host_token_env_detected,
|
|
231
|
-
env_token_present: builderPath.auth.env_token_present,
|
|
232
|
-
interactive_login_allowed: builderPath.auth.interactive_login_allowed,
|
|
233
|
-
browser_session_auth_allowed: builderPath.auth.browser_session_auth_allowed,
|
|
234
|
-
auth_runtime: builderPath.auth.auth_runtime,
|
|
235
|
-
cookie_auth_supported: builderPath.auth.cookie_auth_supported,
|
|
236
|
-
cookie_check_required: builderPath.auth.cookie_check_required,
|
|
237
|
-
playwright_cookie_check_required: builderPath.auth.playwright_cookie_check_required,
|
|
238
|
-
qr_login_required: builderPath.auth.qr_login_required,
|
|
239
|
-
missing_token_action: builderPath.auth.missing_token_action,
|
|
240
|
-
},
|
|
266
|
+
auth,
|
|
241
267
|
environment_check_simplification: {
|
|
242
268
|
minimal_probe_commands: environment.minimal_probe_commands,
|
|
243
269
|
can_skip_default_exploration_when_summary_ok: environment.can_skip_default_exploration_when_summary_ok,
|
|
@@ -319,8 +345,37 @@ function buildCommandManifestDigest(manifest) {
|
|
|
319
345
|
}
|
|
320
346
|
|
|
321
347
|
function buildAgentCapabilitiesSummary() {
|
|
322
|
-
const envSnapshot = buildEnvironmentSnapshot();
|
|
323
348
|
const manifest = buildCommandManifest({ t, version });
|
|
349
|
+
|
|
350
|
+
if (hasRuntimeProvisionedAccessToken(process.env)) {
|
|
351
|
+
const projectRoot = findProjectRoot();
|
|
352
|
+
const loginStatus = buildRuntimeProvisionedLoginStatus();
|
|
353
|
+
const builderPath = compactBuilderPath(
|
|
354
|
+
buildBuilderPath(loginStatus, projectRoot, manifest)
|
|
355
|
+
);
|
|
356
|
+
|
|
357
|
+
return {
|
|
358
|
+
schema_version: 1,
|
|
359
|
+
name: 'openyida-agent-capabilities-summary',
|
|
360
|
+
version,
|
|
361
|
+
login: compactLogin(loginStatus),
|
|
362
|
+
precheck: {
|
|
363
|
+
skipped: true,
|
|
364
|
+
reason: 'runtime_auth_provisioned',
|
|
365
|
+
},
|
|
366
|
+
workdir: projectRoot,
|
|
367
|
+
workdir_exists: fs.existsSync(projectRoot),
|
|
368
|
+
cache_dir: path.join(projectRoot, '.cache'),
|
|
369
|
+
openyida_task_cache_dir: path.join(projectRoot, '.cache', 'openyida'),
|
|
370
|
+
command_manifest_digest: buildCommandManifestDigest(manifest),
|
|
371
|
+
command_manifest_digest_algorithm: 'sha256',
|
|
372
|
+
command_count: manifest.summary.command_count,
|
|
373
|
+
full_capabilities_command: 'openyida agent-capabilities --json',
|
|
374
|
+
builder_path: builderPath,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const envSnapshot = buildEnvironmentSnapshot();
|
|
324
379
|
const projectRoot = envSnapshot.active.projectRoot;
|
|
325
380
|
const loginStatus = getAuthStatus({ projectRoot, includeSecrets: false });
|
|
326
381
|
const builderPath = compactBuilderPath(
|
package/lib/core/locales/en.js
CHANGED
|
@@ -1149,7 +1149,6 @@ Examples:
|
|
|
1149
1149
|
lint_iframe_self_navigation: 'Yida custom pages run in an iframe. Use target="_top"/target="_blank" or window.top.location for Yida page navigation to avoid nested pages.',
|
|
1150
1150
|
lint_form_open_container: 'Opening Yida form submission/detail pages from a custom page must use FormOpenContainer: a 50vw drawer iframe on desktop, and full/new page only on mobile. Button handlers should call openForm({ type: "submission" | "detail", ... }).',
|
|
1151
1151
|
lint_form_detail_link: 'Yida form detail pages must use a real formInstId: read row.formInstId first, and disable or warn when the instance id is missing instead of opening a formDetail link with an empty formInstId.',
|
|
1152
|
-
lint_content_blocks_too_few: 'Display pages must declare @openyida-content-blocks and include at least {1} business-purpose content blocks; KPI groups, quick-entry groups, and list groups each count as one block. Current count: {0}.',
|
|
1153
1152
|
lint_page_size_limit: 'pageSize={0} exceeds the Yida API limit of 100; use 100 or less',
|
|
1154
1153
|
lint_page_size_recommend: 'pageSize={0} is large; the recommended value is 50 (best performance, max 100). Prefer 10/20/50',
|
|
1155
1154
|
lint_searchformdata_http_path: 'A direct searchFormDatas.json call must use /dingtalk/web/<appType>/v1/form/searchFormDatas.json; /query/form/searchFormDatas.json is not a valid form data endpoint',
|
package/lib/core/locales/zh.js
CHANGED
|
@@ -1143,7 +1143,6 @@ openyida - 宜搭命令行工具
|
|
|
1143
1143
|
lint_iframe_self_navigation: '宜搭自定义页面运行在 iframe 中,跳转宜搭页面时请使用 target="_top"/target="_blank" 或 window.top.location,避免页面套娃',
|
|
1144
1144
|
lint_form_open_container: '自定义页内打开表单提交/详情只能使用 FormOpenContainer:PC 端用 50vw 抽屉 iframe,移动端才整页或新页打开。按钮事件请调用 openForm({ type: "submission" | "detail", ... })。',
|
|
1145
1145
|
lint_form_detail_link: '表单详情页必须使用真实 formInstId:优先读取 row.formInstId,缺少实例 ID 时禁用详情入口或提示,不能打开空 formInstId 的 formDetail 链接。',
|
|
1146
|
-
lint_content_blocks_too_few: '展示型页面必须声明 @openyida-content-blocks,且至少包含 {1} 个有业务目的的内容区块;KPI 组、快捷入口组、列表组各只算 1 个区块,当前只有 {0} 个。',
|
|
1147
1146
|
lint_page_size_limit: 'pageSize={0} 超过宜搭接口上限 100,请改为 100 或更小',
|
|
1148
1147
|
lint_page_size_recommend: 'pageSize={0} 偏大,推荐使用 50(性能最佳,最大 100),优先选择 10/20/50',
|
|
1149
1148
|
lint_searchformdata_http_path: '直连 searchFormDatas.json 必须使用 /dingtalk/web/<appType>/v1/form/searchFormDatas.json;/query/form/searchFormDatas.json 不是有效表单数据端点',
|