openyida 2026.11.1 → 2026.11.2-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
@@ -472,7 +472,7 @@ When preparing a PR that needs a personal Fork, or when you ask how to support t
472
472
  | `openyida login [--qwenwork] [target-url] [--env <name>\|--intl\|--overseas\|--global\|--yidaapps\|--alibaba] [--client-id <clientId>] [--endpoint <url>] [--no-browser]` | Login with OAuth token mode |
473
473
  | `openyida logout` | Logout / unbind current project auth |
474
474
  | `openyida auth <status\|login\|refresh\|logout\|profiles\|profile switch\|qwenwork user-info> [--json]` | Token login state and profile management |
475
- | `openyida org <list\|switch> [--json] [--corp-id <corpId>]` | Organization management (list / switch existing profiles first) |
475
+ | `openyida org <list\|switch> [--json] [--corp-id <corpId>] [--no-browser]` | Organization management (list / switch existing profiles first) |
476
476
  | `openyida env [--json\|setup\|list\|show\|switch\|add\|remove] [options]` | Detect AI tool environment & token login state |
477
477
 
478
478
  ### App Management
@@ -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.
@@ -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) {
@@ -698,7 +698,7 @@ function runDingtalkLoopback(options = {}) {
698
698
  prompt: options.prompt,
699
699
  });
700
700
  const callerOwnsBrowser = callerOwnsLoginBrowser(options);
701
- if (!options.quiet || callerOwnsBrowser) {
701
+ if (!options.quiet || callerOwnsBrowser || options.showAuthUrl) {
702
702
  process.stderr.write(`Open this URL to login:\n${authUrl}\n`);
703
703
  }
704
704
  if (!options.quiet) {
package/lib/auth/org.js CHANGED
@@ -235,6 +235,7 @@ async function switchOrganization(targetCorpId, options = {}) {
235
235
  endpoint: options.endpoint || (currentSession && currentSession.base_url),
236
236
  clientId: options.clientId || (currentSession && currentSession.client_id),
237
237
  corpId: targetCorpId,
238
+ showAuthUrl: true,
238
239
  };
239
240
 
240
241
  const cloud = isQwenWorkWebRuntime(options.runtime || detectRuntimeCapabilities({ env: options.env || process.env }));
@@ -322,6 +323,7 @@ async function run(args = []) {
322
323
  const json = hasFlag(args, '--json');
323
324
  const options = {
324
325
  quiet: hasFlag(args, '--quiet') || json,
326
+ noBrowser: hasFlag(args, '--no-browser'),
325
327
  clientId: getArgValue(args, '--client-id'),
326
328
  authProfile: getArgValue(args, '--profile'),
327
329
  userId: getArgValue(args, '--user-id'),
@@ -336,6 +336,7 @@ async function tokenLogin(options = {}) {
336
336
  port: options.port,
337
337
  quiet: options.quiet,
338
338
  noBrowser: options.noBrowser,
339
+ showAuthUrl: options.showAuthUrl,
339
340
  timeoutMs: options.timeoutMs,
340
341
  });
341
342
 
@@ -133,6 +133,48 @@ 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: 'current_yida_entry_at_end_of_each_turn',
143
+ timing: 'before_final_reply',
144
+ max_calls_per_turn: 1,
145
+ target: 'single_updated_page_workbench_entry_otherwise_adminUrl',
146
+ target_selection: {
147
+ single_page_update: {
148
+ condition: 'Only one existing page was successfully modified in this turn, with no other resource or application changes.',
149
+ count_by: 'distinct_appType_and_formUuid_in_this_turn',
150
+ repeated_updates: 'count_same_page_once',
151
+ read_only_operations: 'do_not_count',
152
+ target: 'modified_page_confirmed_workbench_entry',
153
+ target_path: '/workbench/{formUuid}',
154
+ },
155
+ otherwise: {
156
+ target: 'current_application_confirmed_adminUrl',
157
+ target_path: '/admin',
158
+ includes: 'New applications or pages, multiple modified pages, other resource or application changes, no page modification, or unconfirmed single-page scope or workbenchUrl.',
159
+ },
160
+ },
161
+ other_links: 'preserve_existing_delivery_and_workflow',
162
+ requires_host_tool_inventory_check: true,
163
+ tool_availability: 'unknown_until_declared_by_host',
164
+ preferred_tool: runtime.subtype === 'qwenwork_web' ? 'show_link'
165
+ : runtime.subtype === 'qwenwork_desktop' ? 'artifact_show_link' : null,
166
+ 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.',
167
+ input: 'For a single-page update, use the modified page confirmed workbench entry from a successful result or targeted readback, preferring workbenchUrl; formUrl or url is also eligible when its path is /{appType}/workbench/{formUuid} for that verified page. Otherwise use the current application confirmed adminUrl from create-app or app-list. Preserve the selected URL unchanged; do not substitute a standalone /custom/ URL or hard-code example resources.',
168
+ required_action: 'Keep the existing YiDA workflow and ordinary link delivery. Before the final reply of each turn, select the single updated page workbenchUrl or otherwise the application adminUrl according to target_selection, and call the available link presentation tool once. Repeat once in each new turn, not for every link. Respect explicit user exclusions.',
169
+ scope: 'The single updated existing page entry when eligible; otherwise the current YiDA application developer administration entry.',
170
+ fallback: 'If the single-page scope or its workbenchUrl is unconfirmed, use the confirmed application adminUrl. If no eligible URL is confirmed, do not guess or create resources. If the tool is unavailable or fails, keep the completed work and selected clickable link without repeated calls or business writes.',
171
+ 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.',
172
+ success_means: 'presentation_request_accepted_only_not_registration_or_rendering',
173
+ cli_urls: 'preserve_original_fields',
174
+ reference: 'references/qwenwork-link-presentation.md',
175
+ };
176
+ }
177
+
136
178
  const BUILDER_CORE_COMMAND_IDS = Object.freeze([
137
179
  'agent-capabilities',
138
180
  'commands',
@@ -713,6 +755,7 @@ function buildAgentCapabilitiesSummary() {
713
755
  full_capabilities_command: 'openyida agent-capabilities --json',
714
756
  full_app_artifact_route: buildFullAppArtifactRoute(manifest),
715
757
  application_entry_policy: applicationEntryPolicy,
758
+ link_presentation_policy: buildLinkPresentationPolicy(runtime),
716
759
  runtime,
717
760
  asset_capabilities: assetCapabilities,
718
761
  builder_path: builderPath,
@@ -754,6 +797,7 @@ function buildAgentCapabilities() {
754
797
  asset_capabilities: assetCapabilities,
755
798
  login: loginStatus,
756
799
  application_entry_policy: applicationEntryPolicy,
800
+ link_presentation_policy: buildLinkPresentationPolicy(runtime),
757
801
  recommended: {
758
802
  preflight_command: 'openyida agent-capabilities --summary-json',
759
803
  full_capabilities_command: 'openyida agent-capabilities --json',
@@ -830,6 +874,7 @@ module.exports = {
830
874
  buildAgentCapabilitiesSummary,
831
875
  buildApplicationEntryPolicy,
832
876
  buildAssetCapabilities,
877
+ buildLinkPresentationPolicy,
833
878
  compactBuilderPath,
834
879
  buildCommandManifestDigest,
835
880
  buildIdentity,
@@ -1201,7 +1201,7 @@ const COMMAND_GROUPS = [
1201
1201
  command('login-qwenwork', ['login-qwenwork'], 'login-qwenwork --exchange-ticket <ticket> --ticket-context <json> [--json]', 'help.cmd_login_qwenwork', { managedRun: { scope: 'denied', reason: 'identity_exchange' }, requiresLogin: false, output: 'json', hidden: true }),
1202
1202
  command('logout', ['logout'], 'logout', 'help.cmd_logout', { managedRun: { scope: 'denied', reason: 'scope_not_audited' }, requiresLogin: false }),
1203
1203
  command('auth', ['auth'], 'auth <status|login|refresh|logout|profiles|profile switch|qwenwork user-info> [--json]', 'help.cmd_auth', { managedRun: { scope: 'actions', actions: { status: { scope: 'local', allowedFlags: ['--json', '--quiet'] }, qwenwork: { scope: 'denied', reason: 'identity_exchange' } } }, requiresLogin: false }),
1204
- command('org', ['org'], 'org <list|switch> [--json] [--corp-id <corpId>]', 'help.cmd_org', { managedRun: { scope: 'denied', reason: 'scope_not_audited' } }),
1204
+ command('org', ['org'], 'org <list|switch> [--json] [--corp-id <corpId>] [--no-browser]', 'help.cmd_org', { managedRun: { scope: 'denied', reason: 'scope_not_audited' } }),
1205
1205
  command('env', ['env'], 'env [--json|setup|list|show|switch|add|remove] [options]', 'help.cmd_env', { managedRun: { scope: 'local', allowedFlags: ['--json', '--quiet'] },
1206
1206
  requiresLogin: false,
1207
1207
  output: 'text|json',
@@ -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. 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. When this turn only successfully modifies one existing page, with no other resource or application changes, show that page confirmed workbench entry (/workbench/{formUuid}) from its successful result or targeted readback, preferring workbenchUrl; formUrl or url is also eligible when its path matches that verified application and page. Use this workbench entry even if the page also has a standalone /custom/ URL. Count distinct appType and formUuid pairs in this turn: repeated updates to the same page count once, and read-only operations do not count. In all other cases, including new applications or pages, multiple modified pages, other resource or application changes, no page modification, or unconfirmed single-page scope or workbenchUrl, show the current application confirmed adminUrl (/admin). Preserve the selected URL unchanged and do not hard-code example resources. Prefer show_link in QwenWork cloud and artifact_show_link on desktop; otherwise use an available link presentation tool. Keep all otherwise required entries in the ordinary delivery; this one call does not replace them. If no eligible URL is confirmed, do not guess a URL or create resources for presentation; respect explicit user exclusions. If presentation is unavailable or fails, keep the selected clickable link without repeated calls or business writes. Select again from the actual changes in each new turn. 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',
@@ -527,7 +527,7 @@ Examples:
527
527
  login_unsupported_option: 'Removed legacy login option is no longer supported: {0}. Use token/OAuth login; env token mode reads only OPENYIDA_* tokens.',
528
528
  auth_usage: 'Usage: openyida auth <status|login|refresh|logout|profiles|profile switch|qwenwork user-info> [--json]',
529
529
  auth_example: 'Examples:\n openyida auth status # View login status\n openyida auth profiles # List existing login profiles\n openyida auth profile switch <auth_profile> # Switch current project to an existing profile\n openyida auth login # Add a profile when the target does not exist\n openyida auth refresh # Refresh login session\n openyida auth logout # Unbind current project auth\n openyida auth logout --profile <auth_profile> # Delete a shared profile explicitly',
530
- org_usage: 'Usage: openyida org <list|switch> [--json] [--corp-id <corpId>]',
530
+ org_usage: 'Usage: openyida org <list|switch> [--json] [--corp-id <corpId>] [--no-browser]',
531
531
  org_example: 'Examples:\n openyida org list --json # List accessible organizations\n openyida org switch --corp-id dingXXX # Switch existing profiles first; login to add one if missing',
532
532
  first_run_title: ' 🤖 OpenYida - AI Conversation Mode Activated! ',
533
533
  first_run_welcome: " {0}Welcome to OpenYida!{1} Here's a quick start guide:",
@@ -1183,7 +1183,7 @@ Examples:
1183
1183
  exec_failed: '\n❌ Execution failed: {0}',
1184
1184
  auth_usage: 'Usage: openyida auth <status|login|refresh|logout|profiles|profile switch|qwenwork user-info> [--json]',
1185
1185
  auth_example: 'Examples:\n openyida auth status # View login status\n openyida auth profiles # List existing login profiles\n openyida auth profile switch <auth_profile> # Switch current project to an existing profile\n openyida auth login # Add a profile when the target does not exist\n openyida auth refresh # Refresh login session\n openyida auth logout # Unbind current project auth\n openyida auth logout --profile <auth_profile> # Delete a shared profile explicitly',
1186
- org_usage: 'Usage: openyida org <list|switch> [--json] [--corp-id <corpId>]',
1186
+ org_usage: 'Usage: openyida org <list|switch> [--json] [--corp-id <corpId>] [--no-browser]',
1187
1187
  org_example: 'Examples:\n openyida org list --json # List accessible organizations\n openyida org switch --corp-id dingXXX # Switch existing profiles first; login to add one if missing',
1188
1188
  title: ' openyida import - Yida App Import Tool',
1189
1189
 
@@ -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',
@@ -1155,7 +1155,7 @@ openyida - 宜搭命令行工具
1155
1155
  exec_failed: '\n❌ 执行失败: {0}',
1156
1156
  auth_usage: '用法: openyida auth <status|login|refresh|logout|profiles|profile switch|qwenwork user-info> [--json]',
1157
1157
  auth_example: '示例:\n openyida auth status # 查看登录状态\n openyida auth profiles # 列出已有登录 profile\n openyida auth profile switch <auth_profile> # 切换当前项目到已有 profile\n openyida auth login # 目标 profile 不存在时登录新增\n openyida auth refresh # 刷新登录态\n openyida auth logout # 解绑当前项目登录态\n openyida auth logout --profile <auth_profile> # 删除指定共享 profile',
1158
- org_usage: '用法: openyida org <list|switch> [--json] [--corp-id <corpId>]',
1158
+ org_usage: '用法: openyida org <list|switch> [--json] [--corp-id <corpId>] [--no-browser]',
1159
1159
  org_example: '示例:\n openyida org list --json # 列出可访问的组织\n openyida org switch --corp-id dingXXX # 优先切换已有 profile;不存在时登录新增',
1160
1160
  title: ' openyida import - 宜搭应用导入工具',
1161
1161
 
@@ -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: '已隐藏顶部导航',
@@ -41,7 +41,6 @@ function resolvePermissionPage(location, baseUrl) {
41
41
  }
42
42
 
43
43
  function createPermissionError(response, options = {}) {
44
- if (options.tool !== 'qwenwork') { return null; }
45
44
  let payload = response;
46
45
  if (typeof payload === 'string') {
47
46
  try { payload = JSON.parse(payload); } catch { payload = {}; }
@@ -60,17 +59,18 @@ function createPermissionError(response, options = {}) {
60
59
  if (!failed) { return null; }
61
60
  let page = resolvePermissionPage(options.location || payload.__location, options.baseUrl);
62
61
  const legacyDenied = /^(?:TIANSHU_)?000006$/.test(code);
63
- if (!page && legacyDenied) {
64
- const normalized = normalizeMessage(message);
65
- if (normalized === '已升级宜搭你未在授权范围内因此无法使用如要使用请联系管理员授权') {
66
- page = resolvePermissionPage('/defaultPage.html?type=unauth', options.baseUrl);
67
- } else if (normalized === '管理员暂未为您分配权限请联系管理员授权'
68
- && /^\/query\/app\/registerApp(?:\.json)?(?:\?|$)/.test(options.requestPath || '')) {
69
- // 000006 被多个权限检查共用,只有已核实的创建接口及文案组合才可归类。
70
- page = resolvePermissionPage('/defaultPage.html?type=noAppCreationAuth', options.baseUrl);
71
- }
62
+ const normalized = normalizeMessage(message);
63
+ const creationDenied = /^\/query\/app\/registerApp(?:\.json)?(?:\?|$)/.test(options.requestPath || '')
64
+ && (legacyDenied || !code || code === '403')
65
+ && ['没有权限', '无权限', '暂无权限', '管理员暂未为您分配权限请联系管理员授权'].includes(normalized);
66
+ if (!page && creationDenied) {
67
+ page = resolvePermissionPage('/defaultPage.html?type=noAppCreationAuth', options.baseUrl);
68
+ }
69
+ if (!page && legacyDenied && normalized === '已升级宜搭你未在授权范围内因此无法使用如要使用请联系管理员授权') {
70
+ page = resolvePermissionPage('/defaultPage.html?type=unauth', options.baseUrl);
72
71
  }
73
72
  if (!page && !legacyDenied && httpStatus !== 403 && code !== '403' && status !== '403') { return null; }
73
+ if (!page && options.tool !== 'qwenwork') { return null; }
74
74
  const permissionType = page ? page.permissionType : 'unknown';
75
75
  const label = page ? t(`permission_guidance.${permissionType}_link`) : '';
76
76
  const details = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openyida",
3
- "version": "2026.11.1",
3
+ "version": "2026.11.2-2",
4
4
  "description": "OpenYida CLI - 宜搭低代码 AI 开发工具(安装即用,零配置)",
5
5
  "bin": {
6
6
  "openyida": "bin/yida.js",
@@ -87,6 +87,10 @@ Fast / Plan 选定的主题和主色属于整个应用:导航、原生页、
87
87
 
88
88
  每项待办对应一个阶段,直接使用上方短标题。创建应用、表单、数据、图片、页面和发布分别展示。执行中保持标题与列表顺序稳定,完成后标记完成并保留记录。图片准备与表单、页面搭建可同时进行,列表顺序仅用于展示。业务细节写在进度消息中,任务编号、命令、路径、授权依据和耗时写入内部执行记录;用户要求的耗时统计集中放入报告。素材采集与应用创建同时进行时,进度描述统一为“素材采集&应用创建”;单独进行时使用对应阶段名称。图片数量、用途及任务详情归入内部执行记录。
89
89
 
90
+ ## 千问办公链接展示
91
+
92
+ 千问办公中的宜搭操作和链接交付沿用原有规则。每轮回复结束前,按[收尾链接展示规则](references/qwenwork-link-presentation.md)使用一次展示链接工具:本轮只修改一个已有页面时,展示该页面已确认的 `/workbench/{formUuid}`;其他情况展示当前应用已确认的 `/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,26 @@
1
+ # 千问办公收尾链接展示
2
+
3
+ 前台、业务后台、开发者管理后台的正常交付方式,以及对话中的宜搭操作和链接处理,都沿用原有规则。
4
+
5
+ 每轮回复结束前,使用一次展示链接工具。本轮只修改一个已有页面时,展示该页面的 `/workbench/{formUuid}` 链接;其他情况展示当前应用的 `/admin` 开发者管理后台。
6
+
7
+ ## 选择展示工具
8
+
9
+ 千问办公云端优先使用 `show_link` 工具,桌面端优先使用 `artifact_show_link` 工具。首选工具不可用时,使用当前会话可用的展示链接工具。
10
+
11
+ ## 选择展示链接
12
+
13
+ 1. 按本轮实际成功修改的范围选择链接,不根据提到、读取或交付的链接数量判断。同一应用的同一页面多次修改仍算一个页面,只读取其他页面不计入修改。
14
+ 2. 本轮仅修改一个已有页面,且没有其他资源或应用级修改时,使用该页面修改成功结果或回读中已确认的工作台链接。地址应为当前应用的 `/workbench/{formUuid}`,其中 `formUuid` 必须对应本轮修改的页面;即使该页另有独立访问链接,这次也使用工作台链接。
15
+ 3. 新建应用或页面、修改多个页面、修改其他资源或应用设置、没有修改页面时,使用创建应用或查询应用结果中已确认的 `adminUrl`。无法确认单页修改范围或该页工作台链接时,也使用已确认的开发者后台链接。
16
+ 4. 使用真实结果中的完整链接,不套用示例应用或页面,不自行猜测地址。没有已确认的可用链接时,保留本轮已完成的结果,不为展示链接额外创建或修改资源。用户明确排除的入口不展示。
17
+
18
+ ## 展示与回复
19
+
20
+ 先按原有方式处理本轮业务和所需链接,结束前只展示上面选中的一个链接。每轮最多调用一次,后续新一轮对话重新按本轮修改范围选择,不因为上轮已经展示过而省略。
21
+
22
+ 工具不可用或展示失败时,保留选中入口的可点击链接,不反复调用或重新创建内容。
23
+
24
+ 回复只说明本轮完成了什么、入口用于什么,以及用户需要做什么。工具名称、参数和后台处理过程不写进用户回复;用户明确询问技术细节时再按需说明。
25
+
26
+ 这次展示不替代本轮原本需要交付的其他入口,也不代表已经验证用户的访问权限。
@@ -40,6 +40,10 @@
40
40
  | 保存结果待确认 | 订单是否保存成功待确认,我会先核对处理结果。 |
41
41
  | 查询发布进度 | 页面待发布。 |
42
42
 
43
+ ## 链接展示
44
+
45
+ 千问办公中的前台、业务后台、开发者管理后台和过程中的链接,按原有方式提供。每轮回复结束前,按[收尾链接展示规则](qwenwork-link-presentation.md)使用一次展示链接工具:本轮只修改一个已有页面时,展示该页面已确认的 `/workbench/{formUuid}`;其他情况展示当前应用已确认的 `/admin` 开发者管理后台。工具不可用或失败时保留选中入口的可点击链接。回复只说明业务结果、入口用途和必要操作,不解释工具和后台处理过程。其他环境沿用原有方式。
46
+
43
47
  ## 完成总结
44
48
 
45
49
  默认用 1–3 句说明本轮改了什么和实际结果,简单修改一句即可。只有确实影响使用时才补充未完成项,需要用户操作时才说明必要下一步。按事实自然成句,省略固定的“改动 / 发布 / 环境说明”分段和逐项验证清单。入口按任务范围和对应技能的交付要求提供,用业务名称标注;宿主已展示同一入口时复用其交付机制。无需用户操作的成功结果直接收尾,不追加确认或刷新要求。
@@ -18,7 +18,7 @@ Fast / Plan 已选主题是全应用决定,本步骤必须保存同一份应
18
18
 
19
19
  1. 已有 `appType`、应用 URL 或已绑定 app → 直接复用该 app。
20
20
  2. 缺少 app 且 Step 1 判定 `allowCreate=true` → 执行 `use_skill("yida-create-app", "按 PRD 创建应用并获取 appType")`,再按 PRD 创建应用。执行创建前按[创建应用时的提示](../../../references/user-facing-summary.md#创建应用时的提示)告知一次“当前在{组织名称}组织下为您创建{应用名称}应用”;名称取已确认的当前组织与应用,不附带登录或准备说明。
21
- 千问办公返回 `status=permission_required` 时,按 [权限处理](../../yida-create-app/SKILL.md#千问办公权限处理) 展示 CLI 指引并暂停后续步骤,等待用户处理并要求继续。
21
+ `status=permission_required` 时按 [权限处理](../../yida-create-app/SKILL.md#创建权限不足时的处理) 展示申请链接、保留已有结果并暂停,不自动换组织。
22
22
  3. 创建或复用后提取真实 `appType`,写入 `.cache/<项目名>-schema.json` 或当前任务资源上下文。
23
23
  - Step 2 已确认的 `requirement-brief.json`、PRD 与 design 保持不变;不得仅因拿到真实 `appType` 回写需求文件或重新生成 PRD 和视觉设计。
24
24
  4. 用户确认计划或主题且 `constraints.prohibitedActions` 不含 `theme-file` 时立即准备 CSS,不等表单或页面完成。创建完整应用时,Plan 复用 `materialize` 返回的 `outputs.theme`。其他场景用以下命令生成或更新主题:
@@ -142,7 +142,7 @@ PRD 保留 `applicationTheme`:themeColor 取最终 `--color-brand1-6`,navThe
142
142
  ## 结果输出格式
143
143
 
144
144
  - 准备简短业务交付总结,简单修改一句即可;按“访问态前台、业务后台、开发者后台”提供最多三类已核验入口。完整应用默认同时提供适用的业务访问入口与开发者后台,每个入口使用用途清楚的名称。
145
- - 通过宿主现有交付机制传递业务总结和真实入口。全部适用入口已提供才算完成;部分失败时保留成功项,说明缺项与影响。
145
+ - 通过当前可用的展示方式提供简短业务总结和真实入口。前台、业务后台、开发者管理后台以及其他所需链接沿用原有交付方式。千问办公在本轮回复结束前,按[收尾链接展示规则](../../../references/qwenwork-link-presentation.md)使用一次展示链接工具:本轮只修改一个已有页面时,展示该页面已确认的工作台链接(`/workbench/{formUuid}`);其他情况展示当前应用已确认的 `adminUrl`(`/admin` 开发者管理后台)。工具不可用或失败时保留该入口的可点击链接,不重复创建内容。全部需要的入口已提供才算完成;缺少入口时说明影响。
146
146
  - 同一应用的后续交付复用已有资源和已验证 URL;资源变更只按用户本轮明确要求执行,多个用途共用同一 URL 时去重并说明用途。
147
147
  - 业务资源在总结中按能力或数量概述;修改、修复、美化只写本轮变化与结果,不重述完整应用或字段表。核验细节留在内部,影响使用的未完成项用一句话说明。
148
148
  - 用户或调用方明确要求资源清单、资源 UUID/ID、发布状态或测试数据摘要时,在本轮业务结果中附简洁交付清单,只含真实返回值/readback;未知项标记未核验。面向用户的清单使用业务名称、状态和数量,内部编号按明确的编号或技术需求提供。
@@ -164,11 +164,13 @@ CLI 校验主题文件完整声明平台实际生成的 `--color-brand1-1/2/3/5/
164
164
  - 自定义页面源码默认使用 `.canvas.jsx`,完成编写后发布。
165
165
  - 造测试数据或修旧数据时,可以用 Python 或 JS 编写 `.cache/` 下的一次性脚本;优先选择更快更清晰的方式,但字段 ID 和记录 ID 必须来自真实查询。
166
166
 
167
- ## 千问办公权限处理
167
+ ## 创建权限不足时的处理
168
168
 
169
169
  执行 `openyida create-app`,以 CLI 返回的权限结果和申请指引为准。
170
170
 
171
- 返回 `status=permission_required` 时,暂停后续搭建,展示 CLI 的错误说明和 `nextStep` 中的具名申请链接;未返回链接时保留原因。仅提供指引,等待用户处理并要求继续后再执行,不因权限不足重新登录或重复创建。
171
+ `status=permission_required` 时暂停,展示 `nextAction` / `details.permissionUrl` 或 `nextStep` 的具名申请链接;缺少链接不自行拼接。应用管理员不等于组织级创建者。
172
+
173
+ 保留已有文件,用户处理后要求继续时核对组织与权限。不重新登录、重复创建或枚举组织;用户选了其他组织才按 `yida-login` 切换,组织列表不证明创建权限。
172
174
 
173
175
  ## 异常处理
174
176
 
@@ -168,3 +168,9 @@ openyida auth qwenwork user-info --json
168
168
 
169
169
  - Login/auth snapshot 返回可用登录态;或
170
170
  - 运行环境注入 token 模式返回明确停止原因,交由宿主修复。
171
+
172
+ ## 用户明确要求切换组织
173
+
174
+ 用户选定目标后,千问办公与 env Token 由宿主切换;受管拒绝时停止。
175
+
176
+ 本地 OAuth 使用 `openyida org switch --corp-id <corpId> --json`;`--quiet` 仍向 stderr 输出 URL。加 `--no-browser` 由调用方按上方规则打开;工具不可用时给出链接并保持原进程运行。最终 `ok=true`、`can_auto_use=true` 且 `corp_id` 匹配才续做。