openyida 2026.7.14-1 → 2026.7.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 CHANGED
@@ -55,10 +55,10 @@ If Codex is already installed, OpenYida also imports a local Codex plugin during
55
55
  Run this from the AI coding workspace where you want OpenYida to operate:
56
56
 
57
57
  ```bash
58
- openyida agent-capabilities --summary-json
58
+ openyida agent-capabilities --json
59
59
  ```
60
60
 
61
- OpenYida returns a compact machine-readable summary with the version, login state, workspace/cache paths, and command manifest digest. `openyida agent-capabilities --json` is the full diagnostic snapshot, where compact `workdir` maps to `active.projectRoot` and `workdir_exists` maps to `active.projectRootExists`. `openyida commands --json` remains available when an agent only needs the command manifest.
61
+ OpenYida detects the active agent environment, workspace path, login state, organization context, command manifest, and side-effect hints in one machine-readable snapshot. `openyida commands --json` remains available when an agent only needs the command manifest.
62
62
 
63
63
  ### 3. Log In
64
64
 
@@ -457,7 +457,7 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
457
457
  | Command | Description |
458
458
  |---------|-------------|
459
459
  | `openyida commands [--json]` | Output machine-readable command manifest |
460
- | `openyida agent-capabilities [--json] [--summary-json\|--compact]` | Output one-shot agent capability snapshot |
460
+ | `openyida agent-capabilities [--json]` | Output one-shot agent capability snapshot |
461
461
  | `openyida a2a <serve\|agent-card> [options]` | Start local read-only A2A adapter or print Agent Card |
462
462
  | `openyida bridge start [--token <pair-token>] [--port 6736] [--origin https://demo.aliwork.com] [--open\|--no-open]` | Start OpenYida local web bridge service |
463
463
  | `openyida copy [--force]` | Copy project working directory |
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const crypto = require('crypto');
4
3
  const path = require('path');
5
4
  const { version } = require('../../package.json');
6
5
  const { t } = require('./i18n');
@@ -15,79 +14,6 @@ function redactLogin(login) {
15
14
  return redacted;
16
15
  }
17
16
 
18
- function compactLogin(login) {
19
- return {
20
- status: login.status,
21
- can_auto_use: login.can_auto_use === true,
22
- };
23
- }
24
-
25
- function canonicalize(value) {
26
- if (Array.isArray(value)) {
27
- return value.map(canonicalize);
28
- }
29
- if (!value || typeof value !== 'object') {
30
- return value;
31
- }
32
-
33
- return Object.keys(value)
34
- .sort()
35
- .reduce((result, key) => {
36
- result[key] = canonicalize(value[key]);
37
- return result;
38
- }, {});
39
- }
40
-
41
- function buildCommandManifestDigest(manifest) {
42
- const digestPayload = {
43
- schema_version: manifest.schema_version,
44
- command_prefix: manifest.command_prefix,
45
- summary: {
46
- command_count: manifest.summary.command_count,
47
- group_count: manifest.summary.group_count,
48
- side_effect_counts: manifest.summary.side_effect_counts,
49
- permission_mode_counts: manifest.summary.permission_mode_counts,
50
- core_workflows: manifest.summary.core_workflows,
51
- },
52
- commands: manifest.commands.map(entry => ({
53
- id: entry.id,
54
- usage: entry.usage,
55
- requires_login: entry.requires_login,
56
- output: entry.output,
57
- side_effect_kind: entry.side_effect && entry.side_effect.kind,
58
- permission_mode: entry.permission && entry.permission.mode,
59
- permission_effect: entry.permission && entry.permission.effect,
60
- })),
61
- };
62
-
63
- return crypto
64
- .createHash('sha256')
65
- .update(JSON.stringify(canonicalize(digestPayload)))
66
- .digest('hex');
67
- }
68
-
69
- function buildAgentCapabilitiesSummary() {
70
- const envSnapshot = buildEnvironmentSnapshot();
71
- const loginStatus = checkLoginOnly({ includeSecrets: false });
72
- const manifest = buildCommandManifest({ t, version });
73
- const projectRoot = envSnapshot.active.projectRoot;
74
-
75
- return {
76
- schema_version: 1,
77
- name: 'openyida-agent-capabilities-summary',
78
- version,
79
- login: compactLogin(loginStatus),
80
- workdir: projectRoot,
81
- workdir_exists: !!envSnapshot.active.projectRootExists,
82
- cache_dir: path.join(projectRoot, '.cache'),
83
- openyida_task_cache_dir: path.join(projectRoot, '.cache', 'openyida'),
84
- command_manifest_digest: buildCommandManifestDigest(manifest),
85
- command_manifest_digest_algorithm: 'sha256',
86
- command_count: manifest.summary.command_count,
87
- full_capabilities_command: 'openyida agent-capabilities --json',
88
- };
89
- }
90
-
91
17
  function buildAgentCapabilities() {
92
18
  const envSnapshot = buildEnvironmentSnapshot();
93
19
  const loginStatus = redactLogin(checkLoginOnly({ includeSecrets: false }));
@@ -106,8 +32,7 @@ function buildAgentCapabilities() {
106
32
  active: envSnapshot.active,
107
33
  login: loginStatus,
108
34
  recommended: {
109
- preflight_command: 'openyida agent-capabilities --summary-json',
110
- full_capabilities_command: 'openyida agent-capabilities --json',
35
+ preflight_command: 'openyida agent-capabilities --json',
111
36
  mutation_guard: 'Run mutating commands only when login.status is ok or after a successful openyida login.',
112
37
  workdir: projectRoot,
113
38
  cache_dir: path.join(projectRoot, '.cache'),
@@ -133,7 +58,7 @@ function buildAgentCapabilities() {
133
58
  },
134
59
  sideEffects: {
135
60
  read_only_preflight: [
136
- 'openyida agent-capabilities --summary-json',
61
+ 'openyida agent-capabilities --json',
137
62
  'openyida env --json',
138
63
  'openyida login --check-only --json',
139
64
  'openyida commands --json',
@@ -155,20 +80,11 @@ function buildAgentCapabilities() {
155
80
  };
156
81
  }
157
82
 
158
- function shouldUseSummary(args = []) {
159
- return args.includes('--summary-json') || args.includes('--compact');
160
- }
161
-
162
- async function run(args = []) {
163
- const payload = shouldUseSummary(args)
164
- ? buildAgentCapabilitiesSummary()
165
- : buildAgentCapabilities();
166
- console.log(JSON.stringify(payload, null, 2));
83
+ async function run() {
84
+ console.log(JSON.stringify(buildAgentCapabilities(), null, 2));
167
85
  }
168
86
 
169
87
  module.exports = {
170
88
  buildAgentCapabilities,
171
- buildAgentCapabilitiesSummary,
172
- buildCommandManifestDigest,
173
89
  run,
174
90
  };
@@ -871,7 +871,7 @@ const COMMAND_GROUPS = [
871
871
  requiresLogin: false,
872
872
  output: 'json',
873
873
  }),
874
- command('agent-capabilities', ['agent-capabilities'], 'agent-capabilities [--json] [--summary-json|--compact]', 'help.cmd_agent_capabilities', {
874
+ command('agent-capabilities', ['agent-capabilities'], 'agent-capabilities [--json]', 'help.cmd_agent_capabilities', {
875
875
  requiresLogin: false,
876
876
  output: 'json',
877
877
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openyida",
3
- "version": "2026.7.14-1",
3
+ "version": "2026.7.14",
4
4
  "description": "OpenYida CLI - 宜搭低代码 AI 开发工具(安装即用,零配置)",
5
5
  "bin": {
6
6
  "openyida": "bin/yida.js",
@@ -206,14 +206,10 @@ description: >
206
206
  在执行任何会创建、修改或发布真实宜搭资源的操作前,先运行只读检查:
207
207
 
208
208
  \`\`\`bash
209
- openyida agent-capabilities --summary-json
209
+ openyida agent-capabilities --json
210
210
  \`\`\`
211
211
 
212
- compact 命令一次返回版本、登录态摘要、工作目录、缓存目录和命令 manifest digest,避免大 JSON 被宿主 offload,也避免反复探测 \`which\`、\`--version\`、\`--help\`、\`env\` 和 \`login --check-only\`。
213
-
214
- \`openyida agent-capabilities --json\` 是 full capabilities,只用于命令契约排障或深度诊断;不要放进完整应用 \`fast_build\` 默认链路。
215
-
216
- 字段映射:compact 输出的 \`workdir\` 对应 full capabilities 的 \`active.projectRoot\`;\`workdir_exists\` 对应 \`active.projectRootExists\`。
212
+ 该命令一次返回版本、当前工作目录、AI 工具环境、登录态摘要和命令清单,避免反复探测 \`which\`、\`--version\`、\`--help\`、\`env\` 和 \`login --check-only\`。
217
213
 
218
214
  如果 \`openyida\` 不存在,先提醒用户需要安装,或在用户同意后执行:
219
215
 
@@ -26,11 +26,7 @@ description: >
26
26
 
27
27
  > ⚡ **前置门槛**:确认 openyida 已安装、Node/npm 依赖达标、登录态就绪。**未通过只读验证前,禁止创建应用/页面/表单或发布等任何真实资源操作。**
28
28
 
29
- **怎么做**:优先跑一次 `openyida agent-capabilities --summary-json`。该 compact 命令只返回 version、`login.status`、`login.can_auto_use`、`workdir`、`workdir_exists`、`cache_dir`、`openyida_task_cache_dir`、`command_count` `command_manifest_digest` agent 必需字段,避免 stdout 过大导致宿主 offload 或误判未读到结果,也避免反复 `which openyida`、`openyida --version`、`openyida --help`、`openyida env`、`login --check-only`。
30
-
31
- `openyida agent-capabilities --json` 是 full capabilities,只在命令契约排障、manifest 差异诊断或深度调试时使用;不要把 full capabilities 放进 `fast_build` 默认链路。
32
-
33
- 字段映射:compact 输出的 `workdir` 对应 full capabilities 的 `active.projectRoot`;`workdir_exists` 对应 `active.projectRootExists`。
29
+ **怎么做**:优先跑一次 `openyida agent-capabilities --json`。该命令一次返回 version、cwd、AI 工具环境、推荐工作目录、登录态摘要、commands、command count、sideEffects 和默认 `fast_build` 契约,避免反复 `which openyida`、`openyida --version`、`openyida --help`、`openyida env`、`login --check-only`。
34
30
 
35
31
  若当前 OpenYida 版本还没有 `agent-capabilities`,退回跑 `openyida env --json` 和 `openyida login --check-only --json`。旧版本地 agent 不需要认识 `skills-index.json`,也不需要支持 `agent-capabilities` 才能继续执行。
36
32
 
@@ -39,7 +35,7 @@ description: >
39
35
  | 命令跑不了(`command not found`) | openyida 未安装 → `npm install -g openyida` |
40
36
  | Node/npm 版本不达标 | 先升级 Node(≥16)再装/升级 openyida |
41
37
  | `login.status` 不是 `ok` 且 `login.can_auto_use` 不是 true | 未登录 → `openyida login`(指定入口带 URL 或 flag) |
42
- | `workdir_exists` / `active.projectRootExists` 为 false | 无工作目录 → `openyida copy` 初始化 |
38
+ | `active.projectRootExists` 为 false | 无工作目录 → `openyida copy` 初始化 |
43
39
 
44
40
  **👉 环境异常、登录失败、悟空降级、Codex handoff 等特殊分支 → [references/setup-and-env.md](references/setup-and-env.md)。正常 `agent-capabilities` 通过时不要默认读取该 reference。**
45
41
 
@@ -32,7 +32,7 @@ metadata:
32
32
  ### 使用前置校验
33
33
 
34
34
  1. 检查用户当前消息是否提供第一个词作为授权口令;同一会话首次通过脚本校验后可复用。
35
- 2. 运行 `openyida env --json` 读取当前登录态 corpId;只需确认登录状态时可用 `openyida agent-capabilities --summary-json`。
35
+ 2. 运行 `openyida env --json` `openyida agent-capabilities --json`,读取当前登录态 corpId。
36
36
  3. corpId 必须精确匹配 `ding328fe145009a4328f2c783f7214b6d69`。
37
37
  4. 任一校验失败,立即终止,不打开页面、不调用 API、不展示部分查询信息。
38
38