openyida 2026.7.13 → 2026.7.14-1
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 --json
|
|
58
|
+
openyida agent-capabilities --summary-json
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
OpenYida
|
|
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.
|
|
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]` | Output one-shot agent capability snapshot |
|
|
460
|
+
| `openyida agent-capabilities [--json] [--summary-json\|--compact]` | 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,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const crypto = require('crypto');
|
|
3
4
|
const path = require('path');
|
|
4
5
|
const { version } = require('../../package.json');
|
|
5
6
|
const { t } = require('./i18n');
|
|
@@ -14,6 +15,79 @@ function redactLogin(login) {
|
|
|
14
15
|
return redacted;
|
|
15
16
|
}
|
|
16
17
|
|
|
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
|
+
|
|
17
91
|
function buildAgentCapabilities() {
|
|
18
92
|
const envSnapshot = buildEnvironmentSnapshot();
|
|
19
93
|
const loginStatus = redactLogin(checkLoginOnly({ includeSecrets: false }));
|
|
@@ -32,7 +106,8 @@ function buildAgentCapabilities() {
|
|
|
32
106
|
active: envSnapshot.active,
|
|
33
107
|
login: loginStatus,
|
|
34
108
|
recommended: {
|
|
35
|
-
preflight_command: 'openyida agent-capabilities --json',
|
|
109
|
+
preflight_command: 'openyida agent-capabilities --summary-json',
|
|
110
|
+
full_capabilities_command: 'openyida agent-capabilities --json',
|
|
36
111
|
mutation_guard: 'Run mutating commands only when login.status is ok or after a successful openyida login.',
|
|
37
112
|
workdir: projectRoot,
|
|
38
113
|
cache_dir: path.join(projectRoot, '.cache'),
|
|
@@ -58,7 +133,7 @@ function buildAgentCapabilities() {
|
|
|
58
133
|
},
|
|
59
134
|
sideEffects: {
|
|
60
135
|
read_only_preflight: [
|
|
61
|
-
'openyida agent-capabilities --json',
|
|
136
|
+
'openyida agent-capabilities --summary-json',
|
|
62
137
|
'openyida env --json',
|
|
63
138
|
'openyida login --check-only --json',
|
|
64
139
|
'openyida commands --json',
|
|
@@ -80,11 +155,20 @@ function buildAgentCapabilities() {
|
|
|
80
155
|
};
|
|
81
156
|
}
|
|
82
157
|
|
|
83
|
-
|
|
84
|
-
|
|
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));
|
|
85
167
|
}
|
|
86
168
|
|
|
87
169
|
module.exports = {
|
|
88
170
|
buildAgentCapabilities,
|
|
171
|
+
buildAgentCapabilitiesSummary,
|
|
172
|
+
buildCommandManifestDigest,
|
|
89
173
|
run,
|
|
90
174
|
};
|
|
@@ -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]', 'help.cmd_agent_capabilities', {
|
|
874
|
+
command('agent-capabilities', ['agent-capabilities'], 'agent-capabilities [--json] [--summary-json|--compact]', 'help.cmd_agent_capabilities', {
|
|
875
875
|
requiresLogin: false,
|
|
876
876
|
output: 'json',
|
|
877
877
|
}),
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -206,10 +206,14 @@ description: >
|
|
|
206
206
|
在执行任何会创建、修改或发布真实宜搭资源的操作前,先运行只读检查:
|
|
207
207
|
|
|
208
208
|
\`\`\`bash
|
|
209
|
-
openyida agent-capabilities --json
|
|
209
|
+
openyida agent-capabilities --summary-json
|
|
210
210
|
\`\`\`
|
|
211
211
|
|
|
212
|
-
|
|
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\`。
|
|
213
217
|
|
|
214
218
|
如果 \`openyida\` 不存在,先提醒用户需要安装,或在用户同意后执行:
|
|
215
219
|
|
package/yida-skills/SKILL.md
CHANGED
|
@@ -26,7 +26,11 @@ description: >
|
|
|
26
26
|
|
|
27
27
|
> ⚡ **前置门槛**:确认 openyida 已安装、Node/npm 依赖达标、登录态就绪。**未通过只读验证前,禁止创建应用/页面/表单或发布等任何真实资源操作。**
|
|
28
28
|
|
|
29
|
-
**怎么做**:优先跑一次 `openyida agent-capabilities --json
|
|
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`。
|
|
30
34
|
|
|
31
35
|
若当前 OpenYida 版本还没有 `agent-capabilities`,退回跑 `openyida env --json` 和 `openyida login --check-only --json`。旧版本地 agent 不需要认识 `skills-index.json`,也不需要支持 `agent-capabilities` 才能继续执行。
|
|
32
36
|
|
|
@@ -35,7 +39,7 @@ description: >
|
|
|
35
39
|
| 命令跑不了(`command not found`) | openyida 未安装 → `npm install -g openyida` |
|
|
36
40
|
| Node/npm 版本不达标 | 先升级 Node(≥16)再装/升级 openyida |
|
|
37
41
|
| `login.status` 不是 `ok` 且 `login.can_auto_use` 不是 true | 未登录 → `openyida login`(指定入口带 URL 或 flag) |
|
|
38
|
-
| `active.projectRootExists` 为 false | 无工作目录 → `openyida copy` 初始化 |
|
|
42
|
+
| `workdir_exists` / `active.projectRootExists` 为 false | 无工作目录 → `openyida copy` 初始化 |
|
|
39
43
|
|
|
40
44
|
**👉 环境异常、登录失败、悟空降级、Codex handoff 等特殊分支 → [references/setup-and-env.md](references/setup-and-env.md)。正常 `agent-capabilities` 通过时不要默认读取该 reference。**
|
|
41
45
|
|
|
@@ -32,7 +32,7 @@ metadata:
|
|
|
32
32
|
### 使用前置校验
|
|
33
33
|
|
|
34
34
|
1. 检查用户当前消息是否提供第一个词作为授权口令;同一会话首次通过脚本校验后可复用。
|
|
35
|
-
2. 运行 `openyida env --json`
|
|
35
|
+
2. 运行 `openyida env --json` 读取当前登录态 corpId;只需确认登录状态时可用 `openyida agent-capabilities --summary-json`。
|
|
36
36
|
3. corpId 必须精确匹配 `ding328fe145009a4328f2c783f7214b6d69`。
|
|
37
37
|
4. 任一校验失败,立即终止,不打开页面、不调用 API、不展示部分查询信息。
|
|
38
38
|
|