openyida 2026.10.31 → 2026.11.2

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 CHANGED
@@ -659,6 +659,8 @@ When preparing a PR that needs a personal Fork, or when you ask how to support t
659
659
 
660
660
  <!-- OPENYIDA_COMMANDS_END -->
661
661
 
662
+ `update-form-config` changes only the resolved content locale (`--locale` overrides the usual environment/domain selection), preserving other translations and title metadata. Use `keep` to retain navigation. Unchanged title and navigation skip saving; title-only changes use the dedicated title endpoint. Navigation changes require a complete supported configuration snapshot: null/missing fields or empty defaulted fields cause `CONFIG_PRESERVATION_UNSUPPORTED` before saving. In that case, change navigation in the platform. An unreadable localized title causes `CONFIG_READ_FAILED` without saving.
663
+
662
664
  ### Personal tasks and process progress
663
665
 
664
666
  Query application tasks with `openyida data query tasks <appType> --type todo --normalized`; `created`, `done`, and `cc` select the other personal task lists. Use `openyida task-center capabilities --json` for supported filters and the page configuration example.
@@ -137,6 +137,7 @@ function materializeBundle(runtime, config, options = {}) {
137
137
  const sources = [];
138
138
  const sourceTrees = [];
139
139
  const destinations = new Set();
140
+ const dependencySources = new Map();
140
141
  let totalBytes = 0;
141
142
  let published = false;
142
143
  let runtimePackage;
@@ -175,12 +176,20 @@ function materializeBundle(runtime, config, options = {}) {
175
176
  copy();
176
177
  sourceTrees.push({ source, skip, files: treeFiles.sort() });
177
178
  }
178
- function copyDependencies(source, target, ancestors = []) {
179
- if (ancestors.length > 50) {throw bundleError();}
179
+ function copiedDependency(target, name) {
180
+ for (let current = target; ; current = path.posix.dirname(current)) {
181
+ const candidate = `${current}/node_modules/${name}`;
182
+ if (dependencySources.has(candidate)) {return dependencySources.get(candidate);}
183
+ if (current === path.posix.dirname(current)) {return null;}
184
+ }
185
+ }
186
+ function copyDependencies(source, target, depth = 0) {
187
+ if (depth > 50) {throw bundleError();}
180
188
  const metadata = packageMetadata(source);
181
189
  const optional = metadata.optionalDependencies || {};
182
190
  const peers = metadata.peerDependencies || {};
183
191
  const dependencies = { ...peers, ...metadata.dependencies, ...optional };
192
+ const pendingDependencies = [];
184
193
  for (const name of Object.keys(dependencies).sort()) {
185
194
  // Runtime is copied from the verified bytes, never from optional node_modules.
186
195
  if (source === sourceRoot && name === runtimePackage) {continue;}
@@ -190,11 +199,17 @@ function materializeBundle(runtime, config, options = {}) {
190
199
  throw bundleError('AGENT_BUNDLE_DEPENDENCY_MISSING');
191
200
  }
192
201
  if (packageMetadata(resolved).name !== name) {throw bundleError();}
193
- // An ancestor copy already satisfies cycles using normal Node resolution.
194
- if (ancestors.includes(resolved)) {continue;}
202
+ // Reuse only the nearest Node-visible copy of this exact source package.
203
+ // A nested version with the same name must still shadow its ancestor.
204
+ if (copiedDependency(target, name) === resolved) {continue;}
195
205
  const destination = `${target}/node_modules/${name}`;
206
+ dependencySources.set(destination, resolved);
196
207
  copyTree(resolved, destination, (relative) => ['node_modules', '.git', '.cache'].includes(relative.split('/')[0]));
197
- copyDependencies(resolved, destination, [...ancestors, resolved]);
208
+ pendingDependencies.push({ resolved, destination });
209
+ }
210
+ // Reserve all siblings before traversing shared dependencies or peer cycles.
211
+ for (const { resolved, destination } of pendingDependencies) {
212
+ copyDependencies(resolved, destination, depth + 1);
198
213
  }
199
214
  }
200
215
  try {
@@ -213,7 +228,7 @@ function materializeBundle(runtime, config, options = {}) {
213
228
  if (fs.existsSync(prd)) {
214
229
  for (const name of fs.readdirSync(prd).sort()) {if (/^demo-.*\.md$/.test(name)) {copyFile(path.join(prd, name), `openyida/project/prd/${name}`);}}
215
230
  }
216
- copyDependencies(sourceRoot, 'openyida', [sourceRoot]);
231
+ copyDependencies(sourceRoot, 'openyida');
217
232
  // An npm replacement during copying must not produce an internally mixed
218
233
  // CLI/skills snapshot. Recheck source content and tree membership before
219
234
  // publishing. Once published, execution never consults these source paths.
@@ -28,7 +28,7 @@
28
28
  * 把 export default 改写成画布入口 `YidaComp` → UglifyJS 压缩 → 正则抽出依赖包名。
29
29
  */
30
30
 
31
- const Babel = require('@babel/standalone');
31
+ const Babel = require('../core/babel');
32
32
  const globals = require('globals');
33
33
  const UglifyJS = require('uglify-js');
34
34
  const {
@@ -273,8 +273,8 @@ function findSelfReferentialDependencyBindingIssues(source) {
273
273
  Babel.transform(source, {
274
274
  filename: 'canvas.tsx',
275
275
  presets: [
276
- ['typescript', { allExtensions: true, isTSX: true, allowDeclareFields: true }],
277
- ['react', { runtime: 'classic' }],
276
+ [Babel.presets.typescript, { allExtensions: true, isTSX: true, allowDeclareFields: true }],
277
+ [Babel.presets.react, { runtime: 'classic' }],
278
278
  ],
279
279
  plugins: [guardPlugin],
280
280
  sourceType: 'module',
@@ -396,8 +396,8 @@ function findBareDependencyGlobalIssues(source) {
396
396
  Babel.transform(source, {
397
397
  filename: 'canvas.tsx',
398
398
  presets: [
399
- ['typescript', { allExtensions: true, isTSX: true, allowDeclareFields: true }],
400
- ['react', { runtime: 'classic' }],
399
+ [Babel.presets.typescript, { allExtensions: true, isTSX: true, allowDeclareFields: true }],
400
+ [Babel.presets.react, { runtime: 'classic' }],
401
401
  ],
402
402
  plugins: [guardPlugin],
403
403
  sourceType: 'module',
@@ -460,8 +460,8 @@ function findUnboundIdentifierIssues(source, options = {}) {
460
460
  Babel.transform(source, {
461
461
  filename: 'canvas.tsx',
462
462
  presets: [
463
- ['typescript', { allExtensions: true, isTSX: true, allowDeclareFields: true }],
464
- ['react', { runtime: 'classic' }],
463
+ [Babel.presets.typescript, { allExtensions: true, isTSX: true, allowDeclareFields: true }],
464
+ [Babel.presets.react, { runtime: 'classic' }],
465
465
  ],
466
466
  plugins: [guardPlugin],
467
467
  sourceType: 'module',
@@ -559,8 +559,8 @@ function findUnavailableCanvasInstanceApiIssues(source) {
559
559
  Babel.transform(source, {
560
560
  filename: 'canvas.tsx',
561
561
  presets: [
562
- ['typescript', { allExtensions: true, isTSX: true, allowDeclareFields: true }],
563
- ['react', { runtime: 'classic' }],
562
+ [Babel.presets.typescript, { allExtensions: true, isTSX: true, allowDeclareFields: true }],
563
+ [Babel.presets.react, { runtime: 'classic' }],
564
564
  ],
565
565
  plugins: [guardPlugin],
566
566
  sourceType: 'module',
@@ -998,8 +998,8 @@ function compileCanvasLocal(source, options = {}) {
998
998
  const stage1 = Babel.transform(source, {
999
999
  filename: 'canvas.tsx',
1000
1000
  presets: [
1001
- ['typescript', { allExtensions: true, isTSX: true, allowDeclareFields: true }],
1002
- ['react', { runtime: 'classic' }],
1001
+ [Babel.presets.typescript, { allExtensions: true, isTSX: true, allowDeclareFields: true }],
1002
+ [Babel.presets.react, { runtime: 'classic' }],
1003
1003
  ],
1004
1004
  sourceType: 'module',
1005
1005
  compact: false,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
  const { CliError } = require('../core/cli-error');
5
5
  const { t } = require('../core/i18n');
6
6
  const { packages } = require('./canvas-icon-exports.json');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
  const { CliError } = require('../core/cli-error');
5
5
  const { t } = require('../core/i18n');
6
6
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
  const { CliError } = require('../core/cli-error');
5
5
  const { t } = require('../core/i18n');
6
6
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
  const { CliError } = require('../core/cli-error');
5
5
  const { warn } = require('../core/chalk');
6
6
  const { t } = require('../core/i18n');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
  const { collectFixedBrandViolations } = require('./canvas-theme-guard');
5
5
 
6
6
  // Use parser tokens to remove separators without treating comments as syntax.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
  const traverse = Babel.packages.traverse.default || Babel.packages.traverse;
5
5
  const { CliError } = require('../core/cli-error');
6
6
  const { t } = require('../core/i18n');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
 
5
5
  const parser = Babel.packages.parser;
6
6
  const traverse = Babel.packages.traverse.default || Babel.packages.traverse;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
  const { t } = require('../core/i18n');
5
5
 
6
6
  const parser = Babel.packages.parser;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
  const { CliError } = require('../core/cli-error');
5
5
  const { t } = require('../core/i18n');
6
6
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const Babel = require('@babel/standalone');
3
+ const Babel = require('../core/babel');
4
4
 
5
5
  const parser = Babel.packages.parser;
6
6
  const traverse = Babel.packages.traverse.default || Babel.packages.traverse;
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- const Babel = require('@babel/standalone');
5
+ const Babel = require('../core/babel');
6
6
  const { findProjectRoot } = require('../core/utils');
7
7
  const { lintYidaSource } = require('./page-linter');
8
8
  const { warnLargePageSource } = require('./page-size-guard');
@@ -10,7 +10,7 @@ const { findBareCjkJsxTextIdentifiers } = require('./jsx-text-guard');
10
10
  const { findDirectFormOpenIssues } = require('./form-open-guard');
11
11
  const { findFormDetailLinkIssues } = require('./form-detail-link-guard');
12
12
  const { findResponsiveLayoutIssues } = require('./responsive-layout-guard');
13
- const Babel = require('@babel/standalone');
13
+ const Babel = require('../core/babel');
14
14
 
15
15
  const THEN_CALLBACK_LINE_LIMIT = 50;
16
16
  const CALLBACK_SCAN_LINE_LIMIT = 80;
@@ -2,7 +2,7 @@ const querystring = require('querystring');
2
2
 
3
3
  const { loadAuthData, triggerLogin, resolveBaseUrl, httpPost, requestWithAutoLogin } = require('../core/utils');
4
4
  const { t } = require('../core/i18n');
5
- const { buildYidaTitleI18n, normalizeYidaLocale, resolveContentLocale } = require('../core/yida-i18n');
5
+ const { normalizeYidaLocale, resolveContentLocale } = require('../core/yida-i18n');
6
6
  const { banner, step, label, success, fail, warn, info, error, result, usage } = require('../core/chalk');
7
7
  const { throwCommandError, throwUsage } = require('../core/command-errors');
8
8
  const { readRenderNav } = require('./application-entry-urls');
@@ -12,10 +12,10 @@ function parseArgs(inputArgs = process.argv.slice(2)) {
12
12
  let locale = null;
13
13
  for (let i = 0; i < args.length; i++) {
14
14
  const arg = args[i];
15
- if ((arg === '--locale' || arg === '--content-locale' || arg === '--lang') && args[i + 1]) {
15
+ if (arg === '--locale' || arg === '--content-locale' || arg === '--lang') {
16
16
  locale = args[i + 1];
17
17
  if (!normalizeYidaLocale(locale)) {
18
- error(`Unsupported locale: ${locale}`);
18
+ throwUsage(t('update_form_config.usage'), t('update_form_config.example'));
19
19
  }
20
20
  args.splice(i, 2);
21
21
  i--;
@@ -28,6 +28,9 @@ function parseArgs(inputArgs = process.argv.slice(2)) {
28
28
  label(t('update_form_config.param_title'), '');
29
29
  throwUsage(t('update_form_config.usage'), t('update_form_config.example'));
30
30
  }
31
+ if (!['true', 'false', 'keep'].includes(args[2])) {
32
+ throwUsage(t('update_form_config.usage'), t('update_form_config.example'));
33
+ }
31
34
  return {
32
35
  appType: args[0],
33
36
  formUuid: args[1],
@@ -37,8 +40,8 @@ function parseArgs(inputArgs = process.argv.slice(2)) {
37
40
  };
38
41
  }
39
42
 
40
- // Only round-trip supported fields that actually exist. Filling absent values
41
- // with defaults changes unrelated settings on sparse/new forms.
43
+ // The broad endpoint can fill defaults for omitted fields. A navigation write
44
+ // requires a complete supported snapshot; title-only writes bypass this path.
42
45
  const CONFIG_FIELDS = [
43
46
  'relateUuid', 'icon', 'pageType', 'showNav', 'isInner', 'url', 'isNew',
44
47
  'showRemark', 'showDelete', 'showDetail', 'showOperationLog',
@@ -85,31 +88,48 @@ async function fetchFormSchemaInfo(authRef, appType, formUuid) {
85
88
  return resp.content || resp.result || resp.data || null;
86
89
  }
87
90
 
88
- // 读-改-写:以当前配置为基底,仅覆盖 title 与 isRenderNav,其余字段保留不变。
89
- function buildPostData(csrfToken, formUuid, isRenderNav, title, currentConfig) {
90
- const titleJson = JSON.stringify(buildYidaTitleI18n(title, {
91
- en_US: title,
92
- ja_JP: title,
93
- }));
91
+ function readCurrentTitle(currentConfig) {
92
+ let currentTitle = currentConfig.title;
93
+ if (typeof currentTitle === 'string') {
94
+ try { currentTitle = JSON.parse(currentTitle); } catch { currentTitle = null; }
95
+ }
96
+ if (!currentTitle || typeof currentTitle !== 'object' || Array.isArray(currentTitle)) {
97
+ throwCommandError(t('get_form_config.read_failed', t('common.request_failed_label')), {
98
+ code: 'CONFIG_READ_FAILED',
99
+ });
100
+ }
101
+ return currentTitle;
102
+ }
103
+
104
+ // Request binding may replace empty values on these defaulted fields as well.
105
+ const DEFAULTED_FIELDS = new Set([
106
+ 'pageType', 'showNav', 'isInner', 'isNew', 'showRemark', 'showDelete',
107
+ 'showDetail', 'showOperationLog', 'showTerminate', 'showStash', 'isAgent',
108
+ 'showAgent', 'defaultManager', 'showDingGroup', 'reStart', 'isEncrypt',
109
+ ]);
94
110
 
111
+ function buildPostData(csrfToken, formUuid, isRenderNav, title, currentConfig, locale = 'zh_CN') {
95
112
  requireCurrentConfig(currentConfig);
113
+ const titleJson = JSON.stringify({ ...readCurrentTitle(currentConfig), [locale]: title });
96
114
  const preservedConfig = {};
97
115
  for (const key of CONFIG_FIELDS) {
98
- const value = currentConfig[key];
99
- if (value !== null && value !== undefined) {
100
- // The read API exposes needReportLine as a boolean, while the write
101
- // API stores a y/n flag. Sending literal true silently turns it off.
102
- preservedConfig[key] = key === 'needReportLine' && typeof value === 'boolean'
103
- ? (value ? 'y' : 'n')
104
- : (typeof value === 'object' ? JSON.stringify(value) : value);
116
+ const sourceKey = key === 'relateUuid' && Object.prototype.hasOwnProperty.call(currentConfig, 'relateFormUuid')
117
+ ? 'relateFormUuid' : key;
118
+ const value = currentConfig[sourceKey];
119
+ if (value === null || value === undefined || (value === '' && DEFAULTED_FIELDS.has(key))) {
120
+ throwCommandError(t('update_form_config.preservation_unsupported', sourceKey), {
121
+ code: 'CONFIG_PRESERVATION_UNSUPPORTED', details: { field: sourceKey },
122
+ });
105
123
  }
106
- }
107
- if (currentConfig.relateFormUuid !== null && currentConfig.relateFormUuid !== undefined) {
108
- preservedConfig.relateUuid = currentConfig.relateFormUuid;
124
+ // The read API exposes needReportLine as a boolean; the write API stores y/n.
125
+ preservedConfig[key] = key === 'needReportLine' && typeof value === 'boolean'
126
+ ? (value ? 'y' : 'n')
127
+ : (typeof value === 'object' ? JSON.stringify(value) : value);
109
128
  }
110
129
 
111
130
  return querystring.stringify({
112
131
  _api: 'Form.updateFormSchemaInfo',
132
+ _csrf_token: csrfToken,
113
133
  _locale_time_zone_offset: '28800000',
114
134
  formUuid,
115
135
  ...preservedConfig,
@@ -149,11 +169,12 @@ async function run(args = process.argv.slice(2)) {
149
169
  };
150
170
  const baseUrl = authRef.baseUrl;
151
171
  success(t('common.login_ready', baseUrl));
152
- label('Locale:', resolveContentLocale({ locale, baseUrl }));
172
+ const contentLocale = resolveContentLocale({ locale, baseUrl });
173
+ label('Locale:', contentLocale);
153
174
 
154
175
  // Step 2:读取当前配置,保证除 title/isRenderNav 外的设置不被覆盖
155
176
  step(2, t('update_form_config.step_read'));
156
- info(t('update_form_config.sending_request'));
177
+ info(t('get_form_config.sending_request'));
157
178
  const currentConfig = await fetchFormSchemaInfo(authRef, appType, formUuid);
158
179
  requireCurrentConfig(currentConfig);
159
180
  success(t('update_form_config.read_ok'));
@@ -167,19 +188,39 @@ async function run(args = process.argv.slice(2)) {
167
188
  }
168
189
  // The read API exposes renderNav; the write API still accepts isRenderNav.
169
190
  const effectiveNav = keepNav ? String(currentRenderNav) : isRenderNav;
191
+ const currentTitle = readCurrentTitle(currentConfig);
192
+ const expectedTitle = { ...currentTitle, [contentLocale]: title };
193
+ const navChanged = currentRenderNav === null || String(currentRenderNav) !== effectiveNav;
194
+ const navMessage = keepNav
195
+ ? t('update_form_config.nav_kept')
196
+ : (effectiveNav === 'true' ? t('update_form_config.nav_shown') : t('update_form_config.nav_hidden'));
197
+
198
+ // Check before the broad-write guard: unchanged sparse forms need no save.
199
+ if (!navChanged && currentTitle[contentLocale] === title) {
200
+ const message = t('update_form_config.unchanged');
201
+ result(true, message);
202
+ console.log(JSON.stringify({
203
+ success: true, changed: false, mutationPerformed: false,
204
+ isRenderNav: effectiveNav === 'true', navKept: keepNav, configPreserved: true, message,
205
+ }, null, 2));
206
+ return;
207
+ }
170
208
 
171
209
  step(3, t('update_form_config.step_update'));
172
- info(t('update_form_config.sending_request'));
210
+ const endpoint = navChanged ? 'updateFormSchemaInfo.json' : 'updateFormTitle.json';
211
+ info(t('update_form_config.sending_request', endpoint));
212
+ // buildPostData rejects unsafe snapshots before sendPostRequest is called.
213
+ // Never fall back from a failed title-only write to a broad configuration save.
173
214
  const apiResult = await requestWithAutoLogin((ref) => sendPostRequest(
174
215
  ref.baseUrl,
175
- `/dingtalk/web/${appType}/query/formdesign/updateFormSchemaInfo.json`,
176
- buildPostData(ref.csrfToken, formUuid, effectiveNav, title, currentConfig)
216
+ `/dingtalk/web/${appType}/query/formdesign/${endpoint}`,
217
+ navChanged ? buildPostData(ref.csrfToken, formUuid, effectiveNav, title, currentConfig, contentLocale)
218
+ : querystring.stringify({
219
+ _api: 'Form.updateTitle', _csrf_token: ref.csrfToken, _locale_time_zone_offset: '28800000',
220
+ formUuid, title: JSON.stringify(expectedTitle),
221
+ })
177
222
  ), authRef);
178
223
 
179
- const navMessage = keepNav
180
- ? t('update_form_config.nav_kept')
181
- : (effectiveNav === 'true' ? t('update_form_config.nav_shown') : t('update_form_config.nav_hidden'));
182
-
183
224
  if (apiResult && !apiResult.__needLogin && !apiResult.__csrfExpired) {
184
225
 
185
226
  if (apiResult.success) {
@@ -32,7 +32,7 @@ function parseThemeContext(html, wanted = ['appType', 'corpId', 'agentAppType'])
32
32
  for (const match of html.matchAll(/<script\b[^>]*>([\s\S]*?)<\/script\s*>/gi)) {
33
33
  if (!match[1].includes('window.pageConfig')) { continue; }
34
34
  let ast;
35
- try { ast = require('@babel/standalone').transform(match[1], { ast: true, code: false }).ast; }
35
+ try { ast = require('../core/babel').transform(match[1], { ast: true, code: false }).ast; }
36
36
  catch (_) { return fail(); }
37
37
  for (const statement of ast.program.body) {
38
38
  const expr = statement.expression;
@@ -133,6 +133,34 @@ function buildAssetCapabilities(runtime, env = process.env) {
133
133
  return buildHostAssetCapabilities({ runtime, env });
134
134
  }
135
135
 
136
+ function buildLinkPresentationPolicy(runtime = {}) {
137
+ if (runtime.tool !== 'qwenwork') {
138
+ return { mode: 'host_default' };
139
+ }
140
+ return {
141
+ mode: 'host_show_link',
142
+ applies_to: 'developer_admin_link_at_end_of_each_turn',
143
+ timing: 'before_final_reply',
144
+ max_calls_per_turn: 1,
145
+ target: 'current_application_confirmed_adminUrl',
146
+ target_path: '/admin',
147
+ other_links: 'preserve_existing_delivery_and_workflow',
148
+ requires_host_tool_inventory_check: true,
149
+ tool_availability: 'unknown_until_declared_by_host',
150
+ preferred_tool: runtime.subtype === 'qwenwork_web' ? 'show_link'
151
+ : runtime.subtype === 'qwenwork_desktop' ? 'artifact_show_link' : null,
152
+ tool_selection: 'In QwenWork cloud, prefer show_link; on desktop, prefer artifact_show_link. Otherwise use an available link presentation tool and its declared parameters and supported resources.',
153
+ input: 'Use the current application confirmed adminUrl from create-app or app-list, unchanged. Never substitute a frontend, workbench or page URL.',
154
+ required_action: 'Keep the existing YiDA workflow and ordinary link delivery. Only before the final reply of each turn, call the available link presentation tool once for the current application confirmed /admin developer administration URL. Repeat once in each new turn, not for every link. Respect explicit user exclusions.',
155
+ scope: 'Only the current YiDA application developer administration entry.',
156
+ fallback: 'If the application or adminUrl is unconfirmed, do not guess or create resources. If the tool is unavailable or fails, keep the completed work and clickable admin link without repeated calls or business writes.',
157
+ user_facing_guidance: 'Explain only the business result, what the link opens and any action the user needs to take. Do not describe tool names, parameters or background processing unless the user asks for technical details.',
158
+ success_means: 'presentation_request_accepted_only_not_registration_or_rendering',
159
+ cli_urls: 'preserve_original_fields',
160
+ reference: 'references/qwenwork-link-presentation.md',
161
+ };
162
+ }
163
+
136
164
  const BUILDER_CORE_COMMAND_IDS = Object.freeze([
137
165
  'agent-capabilities',
138
166
  'commands',
@@ -713,6 +741,7 @@ function buildAgentCapabilitiesSummary() {
713
741
  full_capabilities_command: 'openyida agent-capabilities --json',
714
742
  full_app_artifact_route: buildFullAppArtifactRoute(manifest),
715
743
  application_entry_policy: applicationEntryPolicy,
744
+ link_presentation_policy: buildLinkPresentationPolicy(runtime),
716
745
  runtime,
717
746
  asset_capabilities: assetCapabilities,
718
747
  builder_path: builderPath,
@@ -754,6 +783,7 @@ function buildAgentCapabilities() {
754
783
  asset_capabilities: assetCapabilities,
755
784
  login: loginStatus,
756
785
  application_entry_policy: applicationEntryPolicy,
786
+ link_presentation_policy: buildLinkPresentationPolicy(runtime),
757
787
  recommended: {
758
788
  preflight_command: 'openyida agent-capabilities --summary-json',
759
789
  full_capabilities_command: 'openyida agent-capabilities --json',
@@ -830,6 +860,7 @@ module.exports = {
830
860
  buildAgentCapabilitiesSummary,
831
861
  buildApplicationEntryPolicy,
832
862
  buildAssetCapabilities,
863
+ buildLinkPresentationPolicy,
833
864
  compactBuilderPath,
834
865
  buildCommandManifestDigest,
835
866
  buildIdentity,
@@ -19,8 +19,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
19
19
  function _toPropertyKey(arg) { const key = _toPrimitive(arg, 'string'); return _typeof(key) === 'symbol' ? key : String(key); }
20
20
  function _toPrimitive(input, hint) { if (_typeof(input) !== 'object' || input === null) {return input;} const prim = input[Symbol.toPrimitive]; if (prim !== undefined) { const res = prim.call(input, hint || 'default'); if (_typeof(res) !== 'object') {return res;} throw new TypeError('@@toPrimitive must return a primitive value.'); } return (hint === 'string' ? String : Number)(input); }
21
21
  function _typeof(obj) { '@babel/helpers - typeof'; return _typeof = 'function' === typeof Symbol && 'symbol' === typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && 'function' === typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; }, _typeof(obj); }
22
- // should not use import Babel from 'babel-standalone';
23
- const Babel = require('@babel/standalone');
22
+ const Babel = require('../babel');
24
23
  let RE_VERSION = '4.0.0';
25
24
  // 区分浏览器还是node环境
26
25
  if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object') {
@@ -107,13 +106,13 @@ function compile() {
107
106
  decoSource = 'var __compiledFunc__ = '.concat(source, ';');
108
107
  }
109
108
  try {
110
- const presets = parseInt(Babel.version, 10) > 6 ? ['react', ['env', {
109
+ const presets = [Babel.presets.react, [Babel.presets.env, {
111
110
  'loose': true,
112
111
  'spec': true,
113
112
  targets: {
114
113
  browsers: ['ie >= 11', 'chrome >= 62']
115
114
  }
116
- }]] : ['react', 'es2015-loose', 'stage-0'];
115
+ }]];
117
116
  if (parseFloat(env.RE_VERSION, 10) < 7.0) {
118
117
  const result = Babel.transform(decoSource, _objectSpread({
119
118
  presets: presets,
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ const { transformSync } = require('@babel/core');
4
+
5
+ // Compile user page source without loading Babel configuration from its project.
6
+ function transform(source, options = {}) {
7
+ return transformSync(source, { ...options, babelrc: false, configFile: false });
8
+ }
9
+
10
+ module.exports = {
11
+ transform,
12
+ presets: {
13
+ // AST guards and Canvas compilation do not need the legacy env preset.
14
+ get env() { return require('@babel/preset-env'); },
15
+ get react() { return require('@babel/preset-react'); },
16
+ get typescript() { return require('@babel/preset-typescript'); },
17
+ },
18
+ packages: {
19
+ parser: require('@babel/parser'),
20
+ traverse: require('@babel/traverse'),
21
+ generator: require('@babel/generator'),
22
+ types: require('@babel/types'),
23
+ },
24
+ };
@@ -2425,7 +2425,7 @@ function summarizeLocalizedCommands(commands) {
2425
2425
  product_design_policy: 'yida-requirement-analysis owns shared facts and first-time intake. yida-prd owns business planning; yida-design owns visual design. Reuse the same confirmed brief and supplied details. Prepare business and base visuals concurrently, then bind visuals to settled page tasks. yida-app merges and checks the artifacts before creating resources. Plan authors scope, data and rules, page organization, business interactions and acceptance once. Ordered blocks {name,purpose} supply default priority and content layers; explicit designs remain authoritative. Project-specific acceptance criteria are merged with generated resource checks. Plan uses the compact authoring contract and selected theme context; the CLI reads full templates and renders all artifacts. Fast, Plan and single-page design share yida-design/templates/design-themes and visual_decision_policy: infer directly from supplied style intent or extracted reference DNA, and use the shared three-direction rule only when comparison is needed. Theme templates declare application-global variables from basic-tokens.json with fixed typography, spacing and Tooltip colors, plus scoped custom-page variables; component recipes consume those variables. Each selected template is the authority for navTheme, its six navigation color tokens, and its selected-item shadow token; free-creative authors its own navigation tone and tokens. Explicit project customization stays in visualStyle.tokens. The CLI declares each fixed application palette once in a shared :root and platform-mode selector block. The CLI preserves mode-independent navigation appearance tokens. Light, dark, white and gray mode classes consume the same project tokens; navTheme remains platform metadata, not a second palette. Legacy generated mode blocks are consolidated on update, while unrelated custom CSS is preserved.',
2426
2426
  ui_guidance_policy: 'Page implementation consumes yida-prd prd.md for positioning, information architecture, page prototype, native form entry policy, material strategy, business-specific checks, resource creation order, page implementation delivery order, navigation order, and acceptance criteria; it consumes yida-design design.md for app custom theme CSS delivery, themeColor/navTheme, visual states, visualScaffold, surface material, rounded rules, density rules, components, state styling, and page-level imageNeed. When a page is imageNeed=required, or beneficial with declared image slots, yida-image-assets prepares a traceable asset manifest alongside page layout and interaction work; wait for final images only at that page\'s image binding and acceptance. imageNeed=none skips the branch. prd.md and design.md remain the only design sources of truth. Page implementation may extract page-spec.json as a derived implementation handoff from prd.md + design.md; conflicts are resolved by sending business conflicts to yida-prd and visual conflicts to yida-design before regenerating the spec. Core normal forms default to 1-3 business sample records before page implementation, followed by query readback. An explicit opt-out, configuration dictionary, sensitive data, or lack of safely constructible values requires a recorded skip reason. Screenshots, public sharing, data-source deep binding, and fine navigation grouping are optional after explicit user request or PRD acceptance criteria.',
2427
2427
  default_nav_order_policy: 'For application-wide custom navigation, implement each entry menu and verify app/page navigation hiding. A standalone frontend preserves platform navigation for the management workspace; frontend-only delivery skips platform ordering. After all scoped resources and page publications finish, perform exactly one navigation order operation. Use management tasks and their default destination, without creating a homepage or putting a frontend page first. When execution.entryRecommendation exists, derive navigationOrder from its management/workspace menus. Call openyida nav-group order <appType> <items...> for an explicit order; otherwise call openyida nav-group auto-order <appType> once for legacy single-workspace plans. Do not use openyida publish ... --auto-nav-order for per-page application builds. Explicit and automatic ordering are mutually exclusive; never generate per-item move loops.',
2428
- final_link_policy: 'Return up to three verified application entry URLs in frontend, business management, developer admin order; default complete delivery includes runtime access and developer admin. Never emit one artifact or link card per form, process, report, schema, manifest, PRD, design file, or intermediate artifact. Include one verified management entry when a management or unified workspace is in scope: the app workbench URL or a planned workbench/formUuid URL with its real viewUuid. Backend-only returns its verified business backend entry and developer admin URL without adding a frontend. Native management does not require a display homepage; frontend-only delivery includes its verified frontend entry and developer admin URL, without inventing a business backend. For scoped service frontend pages, infer standalone when entryMode is missing; preserve an explicit platform-shell choice and its verified workbenchUrl. Add the clean custom page URL only for standalone pages when get-form-config readback confirms renderNav=false (fallback to isRenderNav only when renderNav is absent). agent-capabilities application_entry_policy.entries.admin=include is independent of auth runtime. Read adminUrl from create-app or app-list results; route construction does not verify recipient permissions. Explicit user exclusions take precedence; single-page tasks retain their scope. QwenWork owns link, file and result presentation; return the verified summary and URLs without prescribing styles, card counts, display tools or update identifiers. Other hosts may use their terminal delivery artifact description; return the same concise content when no delivery tool is available. Summarize business resources by capability or count, but every resource count, seed-record count, and completed/verified claim must come from that resource\'s own successful result or readback. When the user or caller explicitly requests a resource manifest, resource UUIDs/IDs, publish status, or test-data summary, include one concise verified delivery manifest in that description (or the final response when no delivery tool is available).',
2428
+ final_link_policy: 'Return up to three verified application entry URLs in frontend, business management, developer admin order; default complete delivery includes runtime access and developer admin. Never emit one artifact or link card per form, process, report, schema, manifest, PRD, design file, or intermediate artifact. Include one verified management entry when a management or unified workspace is in scope: the app workbench URL or a planned workbench/formUuid URL with its real viewUuid. Backend-only returns its verified business backend entry and developer admin URL without adding a frontend. Native management does not require a display homepage; frontend-only delivery includes its verified frontend entry and developer admin URL, without inventing a business backend. For scoped service frontend pages, infer standalone when entryMode is missing; preserve an explicit platform-shell choice and its verified workbenchUrl. Add the clean custom page URL only for standalone pages when get-form-config readback confirms renderNav=false (fallback to isRenderNav only when renderNav is absent). agent-capabilities application_entry_policy.entries.admin=include is independent of auth runtime. Read adminUrl from create-app or app-list results; route construction does not verify recipient permissions. Explicit user exclusions take precedence; single-page tasks retain their scope. QwenWork keeps the existing YiDA workflow and ordinary delivery of frontend, business management, developer administration and in-conversation links. Only before the final reply of each turn, follow references/qwenwork-link-presentation.md and agent-capabilities link_presentation_policy to call a link presentation tool once with the current application confirmed adminUrl (/admin developer administration). Prefer show_link in QwenWork cloud and artifact_show_link on desktop; otherwise use an available link presentation tool. Do not use this additional call for frontend, workbench or page URLs. Keep all otherwise required entries in the ordinary delivery; this one call does not replace them. If the current application or adminUrl is unconfirmed, do not guess a URL or create resources for presentation; respect explicit user exclusions. If presentation is unavailable or fails, keep the clickable admin link without repeated calls or business writes. Apply this once again in each new turn when the application and adminUrl are confirmed. Explain only business results, entry purposes and required actions. Other hosts may use their terminal delivery artifact description; return the same concise content when no delivery tool is available. Summarize business resources by capability or count, but every resource count, seed-record count, and completed/verified claim must come from that resource\'s own successful result or readback. When the user or caller explicitly requests a resource manifest, resource UUIDs/IDs, publish status, or test-data summary, include one concise verified delivery manifest in that description (or the final response when no delivery tool is available).',
2429
2429
  entry_navigation_contract: {
2430
2430
  reference: 'yida-skills/skills/yida-app/references/entry-navigation.md',
2431
2431
  brief_path: 'entryRecommendation',
@@ -1382,6 +1382,8 @@ Examples:
1382
1382
  },
1383
1383
 
1384
1384
  update_form_config: {
1385
+ unchanged: 'Title and navigation are unchanged; no save request was sent.',
1386
+ preservation_unsupported: 'Cannot preserve configuration field {0} exactly. Save refused; change navigation in the platform.',
1385
1387
  usage: 'Usage: openyida update-form-config <appType> <formUuid> <isRenderNav> <title>',
1386
1388
  example: 'Example: openyida update-form-config "APP_XXX" "FORM_XXX" "keep" "My Page"',
1387
1389
  params_label: 'Parameters:',
@@ -1396,7 +1398,7 @@ Examples:
1396
1398
  read_ok: ' ✅ Current config loaded; settings other than title/nav will be preserved',
1397
1399
  read_failed_fallback: ' ⚠️ Failed to read current config; falling back to defaults (may reset some untouched settings)',
1398
1400
  step_update: '\n💾 Step 3: Update form config',
1399
- sending_request: ' Sending updateFormSchemaInfo request...',
1401
+ sending_request: ' Sending {0} request...',
1400
1402
  update_ok: ' ✅ Config updated successfully!',
1401
1403
  nav_shown: 'Top nav shown',
1402
1404
  nav_hidden: 'Top nav hidden',
@@ -1355,6 +1355,8 @@ openyida - 宜搭命令行工具
1355
1355
  },
1356
1356
 
1357
1357
  update_form_config: {
1358
+ unchanged: '标题和导航未变化,未发送保存请求。',
1359
+ preservation_unsupported: '无法保证配置字段 {0} 的值原样保留,已拒绝保存;请在平台中调整导航。',
1358
1360
  usage: '用法: openyida update-form-config <appType> <formUuid> <isRenderNav> <title>',
1359
1361
  example: '示例: openyida update-form-config "APP_XXX" "FORM_XXX" "keep" "我的页面"',
1360
1362
  params_label: '参数说明:',
@@ -1369,7 +1371,7 @@ openyida - 宜搭命令行工具
1369
1371
  read_ok: ' ✅ 已读取当前配置,将保留除标题/导航外的其它设置',
1370
1372
  read_failed_fallback: ' ⚠️ 读取当前配置失败,将使用默认配置回退(可能重置部分未传入的设置)',
1371
1373
  step_update: '\n💾 Step 3: 更新表单配置',
1372
- sending_request: ' 发送 updateFormSchemaInfo 请求...',
1374
+ sending_request: ' 发送 {0} 请求...',
1373
1375
  update_ok: ' ✅ 配置更新成功!',
1374
1376
  nav_shown: '已显示顶部导航',
1375
1377
  nav_hidden: '已隐藏顶部导航',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openyida",
3
- "version": "2026.10.31",
3
+ "version": "2026.11.2",
4
4
  "description": "OpenYida CLI - 宜搭低代码 AI 开发工具(安装即用,零配置)",
5
5
  "bin": {
6
6
  "openyida": "bin/yida.js",
@@ -87,13 +87,21 @@
87
87
  },
88
88
  "homepage": "https://github.com/openyida/openyida#readme",
89
89
  "dependencies": {
90
- "@babel/standalone": "^7.15.1",
90
+ "@babel/core": "^7.29.7",
91
+ "@babel/generator": "^7.29.12",
92
+ "@babel/parser": "^7.29.12",
93
+ "@babel/preset-env": "^7.29.7",
94
+ "@babel/preset-react": "^7.29.7",
95
+ "@babel/preset-typescript": "^7.29.7",
96
+ "@babel/traverse": "^7.29.12",
97
+ "@babel/types": "^7.29.11",
91
98
  "esprima": "4.0.1",
92
99
  "globals": "^17.11.0",
93
100
  "js-yaml": "^4.3.2",
94
101
  "uglify-js": "^3.19.3"
95
102
  },
96
103
  "devDependencies": {
104
+ "@babel/plugin-transform-modules-commonjs": "^7.29.7",
97
105
  "eslint": "^8.50.0",
98
106
  "eslint-plugin-import": "^2.32.0",
99
107
  "jest": "^29.7.0",
@@ -87,6 +87,10 @@ Fast / Plan 选定的主题和主色属于整个应用:导航、原生页、
87
87
 
88
88
  每项待办对应一个阶段,直接使用上方短标题。创建应用、表单、数据、图片、页面和发布分别展示。执行中保持标题与列表顺序稳定,完成后标记完成并保留记录。图片准备与表单、页面搭建可同时进行,列表顺序仅用于展示。业务细节写在进度消息中,任务编号、命令、路径、授权依据和耗时写入内部执行记录;用户要求的耗时统计集中放入报告。素材采集与应用创建同时进行时,进度描述统一为“素材采集&应用创建”;单独进行时使用对应阶段名称。图片数量、用途及任务详情归入内部执行记录。
89
89
 
90
+ ## 千问办公链接展示
91
+
92
+ 千问办公中的宜搭操作和链接交付沿用原有规则。只在每轮回复结束前,按[开发者后台展示规则](references/qwenwork-link-presentation.md)使用一次展示链接工具,展示当前应用已确认的 `/admin` 开发者管理后台。前台、业务后台和过程中的链接保持原来的处理方式;工具不可用或失败时保留开发者后台的可点击链接。
93
+
90
94
  ## 千问办公网页态的后台登录
91
95
 
92
96
  当前快照为 `runtime.tool=qwenwork`、`runtime.subtype=qwenwork_web` 且 `interactive_login.mode=cloud_token` 时,按[云端免登与普通登录回退规则](references/qwenwork-cloud-login.md)执行快照推荐命令。CLI 优先消费沙箱凭据,免登认证失败后由同一进程回退普通 OAuth;需要授权时按 `interactive_login.oauth_fallback` 处理 CLI 输出的 URL,不读取或展示凭据。桌面态继续使用桌面换票。
@@ -0,0 +1,24 @@
1
+ # 千问办公开发者后台链接展示
2
+
3
+ 前台、业务后台、开发者管理后台的正常交付方式,以及对话中的宜搭操作和链接处理,都沿用原有规则。
4
+
5
+ 只在每轮回复结束前,使用一次展示链接工具,展示当前宜搭应用的 `/admin` 开发者管理后台。
6
+
7
+ ## 选择展示工具
8
+
9
+ 千问办公云端优先使用 `show_link` 工具,桌面端优先使用 `artifact_show_link` 工具。首选工具不可用时,使用当前会话可用的展示链接工具。
10
+
11
+ ## 展示规则
12
+
13
+ 1. 确认本轮正在处理的宜搭应用,使用创建应用或查询应用结果中已确认的 `adminUrl`,不自行拼接地址。
14
+ 2. 先按原有方式处理本轮业务和所需链接。前台、业务后台和过程中的链接不因本规则改成工具展示。
15
+ 3. 本轮结束前,只对当前应用的开发者管理后台调用一次展示链接工具。不要把前台、工作台或某个页面的地址作为这次展示的目标。
16
+ 4. 每轮最多调用一次。后续新一轮对话仍按本规则处理,不因为上轮已经展示过而省略。
17
+ 5. 当前应用或开发者后台链接尚未确认时,保留本轮已完成的结果,不猜地址、不额外创建应用。用户明确排除开发者后台时,遵从用户要求。
18
+ 6. 工具不可用或展示失败时,保留开发者后台的可点击链接,不反复调用或重新创建内容。
19
+
20
+ ## 回复用户
21
+
22
+ 只说明本轮完成了什么、入口用于什么,以及用户需要做什么。工具名称、参数和后台处理过程不写进用户回复;用户明确询问技术细节时再按需说明。
23
+
24
+ 展示开发者后台不替代本轮原本需要交付的前台、业务后台或其他入口,也不代表已经验证用户的管理权限。
@@ -40,6 +40,10 @@
40
40
  | 保存结果待确认 | 订单是否保存成功待确认,我会先核对处理结果。 |
41
41
  | 查询发布进度 | 页面待发布。 |
42
42
 
43
+ ## 链接展示
44
+
45
+ 千问办公中的前台、业务后台、开发者管理后台和过程中的链接,按原有方式提供。每轮回复结束前,再按[开发者后台展示规则](qwenwork-link-presentation.md)使用一次展示链接工具,展示当前应用已确认的 `/admin` 开发者管理后台。工具不可用或失败时保留该入口的可点击链接。回复只说明业务结果、入口用途和必要操作,不解释工具和后台处理过程。其他环境沿用原有方式。
46
+
43
47
  ## 完成总结
44
48
 
45
49
  默认用 1–3 句说明本轮改了什么和实际结果,简单修改一句即可。只有确实影响使用时才补充未完成项,需要用户操作时才说明必要下一步。按事实自然成句,省略固定的“改动 / 发布 / 环境说明”分段和逐项验证清单。入口按任务范围和对应技能的交付要求提供,用业务名称标注;宿主已展示同一入口时复用其交付机制。无需用户操作的成功结果直接收尾,不追加确认或刷新要求。
@@ -142,7 +142,7 @@ PRD 保留 `applicationTheme`:themeColor 取最终 `--color-brand1-6`,navThe
142
142
  ## 结果输出格式
143
143
 
144
144
  - 准备简短业务交付总结,简单修改一句即可;按“访问态前台、业务后台、开发者后台”提供最多三类已核验入口。完整应用默认同时提供适用的业务访问入口与开发者后台,每个入口使用用途清楚的名称。
145
- - 通过宿主现有交付机制传递业务总结和真实入口。全部适用入口已提供才算完成;部分失败时保留成功项,说明缺项与影响。
145
+ - 通过当前可用的展示方式提供简短业务总结和真实入口。前台、业务后台、开发者管理后台以及其他所需链接沿用原有交付方式。千问办公仅在本轮回复结束前,按[开发者后台展示规则](../../../references/qwenwork-link-presentation.md)使用一次展示链接工具,展示当前应用已确认的 `adminUrl`(`/admin` 开发者管理后台);不要逐个展示前台、业务后台或页面链接。工具不可用或失败时保留该入口的可点击链接,不重复创建内容。全部需要的入口已提供才算完成;缺少入口时说明影响。
146
146
  - 同一应用的后续交付复用已有资源和已验证 URL;资源变更只按用户本轮明确要求执行,多个用途共用同一 URL 时去重并说明用途。
147
147
  - 业务资源在总结中按能力或数量概述;修改、修复、美化只写本轮变化与结果,不重述完整应用或字段表。核验细节留在内部,影响使用的未完成项用一句话说明。
148
148
  - 用户或调用方明确要求资源清单、资源 UUID/ID、发布状态或测试数据摘要时,在本轮业务结果中附简洁交付清单,只含真实返回值/readback;未知项标记未核验。面向用户的清单使用业务名称、状态和数量,内部编号按明确的编号或技术需求提供。