@xgent-ai/skills 0.7.7 → 0.7.9

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.
Files changed (74) hide show
  1. package/README.md +26 -39
  2. package/bin/xgent-skills.js +27 -56
  3. package/dist/phoenix-diagram/VERSION.json +18 -18
  4. package/dist/phoenix-diagram/bundle/ENGINE.json +18 -18
  5. package/dist/phoenix-diagram/bundle/manifest.json +4 -4
  6. package/dist/phoenix-diagram/bundle/references/migration.md +1 -1
  7. package/dist/phoenix-diagram/bundle/scripts/phoenix-bootstrap.cjs +4 -103
  8. package/dist/phoenix-ui/THIRD-PARTY.json +1 -1
  9. package/dist/phoenix-ui/VERSION.json +19 -19
  10. package/dist/phoenix-ui/bundle/blobs/{567c3f42394f9aee9b048a001016a7ba9d8773d78027f8c995c379886634e719 → 0c95d5c7163bc162cca460e2297ab146e331fd279a738a2055643b45b161c706} +1 -1
  11. package/dist/phoenix-ui/bundle/blobs/{f077545caeb3ecb9f51a3f703a09736ca924869f4b4345c1b1ffbd9bf927a287 → 14bd6a733ce89fcd02bf6dcf0f91378625cb7739a0baaca9cb7611c332ac4580} +1 -1
  12. package/dist/phoenix-ui/bundle/blobs/{125bc7030d7f2ba789d7b1d5f474af34f8902b764e7bc351b98f1f6f55779929 → 14f329a7925311958685a16ba370c4997e924d909091e0977e5d32b3e64ecc4f} +1 -1
  13. package/dist/phoenix-ui/bundle/blobs/{8078b804bea630ed9c4ea07ec2f8ac92aba4128725860a66599eda90390d98f6 → 2b168c9ff212b8daea0d4334c94810458a683cde62f26b985855f8bf3f959db7} +1 -1
  14. package/dist/phoenix-ui/bundle/blobs/{00f4a6a630f31eb05fbdd5725e4a294233d24574bd70f4f32f4597d8256a7c1c → 2fbbc46784d2ab789675941ce81d91822ac00bd5c3e144d06743d0b8ccaccc90} +2 -17
  15. package/dist/phoenix-ui/bundle/blobs/{90f8b07ec12b78e633e306322cda58415aea70d8e0f9ff85bd439361c01dabe1 → 35913e9a7ac47f91c8af70867c71d938aa7f200b562c867fa6a43c4a6209ef61} +1 -1
  16. package/dist/phoenix-ui/bundle/blobs/{0e684572eb98d24b39cd70fa23e66c163178f5a11756dcf8a98fe2335636b33f → 3b62a4d253765fe0bdb180581cf493434d15de94e1b31470c573c0a21ece9e31} +1 -1
  17. package/dist/phoenix-ui/bundle/blobs/{68b454a99ba72c3b9b93ed96c4267847297169f6a5bf321b20e60d637c271068 → 557baa7f9ea3d863f40602f37a85e9af09f9120cfa0669b0b95539774e87b9dc} +1 -1
  18. package/dist/phoenix-ui/bundle/blobs/{c0a70ab2889e5c16e1f09249aefad948ce352c42cfe2b5afb758a4524e1b21b6 → 67fc771aa87556ecc8236c44e76251a41fa4e1809c6ad8c6a1f8eb9de91bb2d7} +1 -1
  19. package/dist/phoenix-ui/bundle/blobs/{88b150cb804bc141b80a5687a091f61b99627155c465a27adb88546ef615af92 → 6b3068f23e684f8566e7f4b069a5554624f479d57ff9073610a0917fe5b5e5af} +1 -1
  20. package/dist/phoenix-ui/bundle/blobs/{61450dbef64859e3136cd17ae3e997134d5df5721d96985c4e07367f38522129 → 6f600dfa082ed593159d3906d108baff9f4cb6bf90817a47429d613a95771d6f} +1 -1
  21. package/dist/phoenix-ui/bundle/blobs/{36310febe3e7bd4c9b21407603f2a04afefdc87b7821758bb47098b1b2876765 → 7bff2e1985a347235ef84b783f801eb3f5872d6e2a8d0278fc8c52c3cd1ac4a4} +1 -1
  22. package/dist/phoenix-ui/bundle/blobs/{e46d63e5f8a6ead1d44c8b6302a0c7247af8585b975ab5715518381777622ede → 821bda87cb9fc9f4349cf5243e18d7b4afc899ee884e33b16007ca3f1f5c9de1} +1 -1
  23. package/dist/phoenix-ui/bundle/blobs/{cadc2daefcf238aab981fa56388381d3d5ab9c0686bb9dd8187035c9933dfcee → 8291ff7c0eef14199f7d209cb8eb5e6643034c1923805b5c7023c93010d7af6e} +1 -1
  24. package/dist/phoenix-ui/bundle/blobs/{6b8d4c71355429a0b16bf367163fea46103a0a99b4e34f87608a39d85b1b980a → 94e595bc8239f72e0f5389f83aa022b18541839fb651d87b5933e89c92836a15} +1 -1
  25. package/dist/phoenix-ui/bundle/blobs/{55277fa15eb4bd2f09bf7bb24c4e79df417b06654b1e10f502c7928b192fd7cc → ba015e8aac17711d7dfbcfce3e8c92190af383af595b9ca58b7df2c0c30ba579} +1 -1
  26. package/dist/phoenix-ui/bundle/blobs/{3625c5c2750f117021232ce81c1e39ac5ef7c21445729327b88cf54dfc937df0 → fddd4bd853ad367d7f755477ee7c5ac3d0d3965c81c8a8e20eb83edc9cb7d43b} +1 -1
  27. package/dist/phoenix-ui/bundle/manifest.json +34 -34
  28. package/docs/phoenix-diagram.md +8 -6
  29. package/{skills/review-ui/references/phoenix-review.md → docs/phoenix-ui-review.md} +7 -12
  30. package/docs/phoenix-ui.md +18 -20
  31. package/package.json +2 -1
  32. package/skills/agi-mode/evals/scenarios.md +7 -8
  33. package/skills/agi-mode/playbooks/sdlc.md +8 -12
  34. package/skills/agi-mode/playbooks/what-next.md +7 -8
  35. package/skills/apply-ui-review/SKILL.md +31 -23
  36. package/skills/apply-ui-review/agents/openai.yaml +2 -2
  37. package/skills/apply-ui-review/evals/scenarios.md +10 -7
  38. package/skills/apply-ui-review/references/record-contract.md +6 -6
  39. package/skills/crd/SKILL.md +36 -8
  40. package/skills/crd/assets/cr-template.md +10 -6
  41. package/skills/crd/evals/scenarios.md +12 -0
  42. package/skills/crd-respond/SKILL.md +22 -10
  43. package/skills/crd-respond/agents/openai.yaml +2 -2
  44. package/skills/crd-respond/assets/response-template.md +7 -6
  45. package/skills/crd-respond/evals/scenarios.md +10 -1
  46. package/skills/optimize-agents-md/SKILL.md +39 -21
  47. package/skills/optimize-agents-md/assets/coding-principles.md +78 -38
  48. package/skills/phoenix-diagram/ENGINE.json +18 -18
  49. package/skills/phoenix-diagram/references/migration.md +1 -1
  50. package/skills/phoenix-diagram/scripts/phoenix-bootstrap.cjs +4 -103
  51. package/skills/phoenix-ui/GENERATED.json +78 -78
  52. package/skills/phoenix-ui/SKILL.md +1 -1
  53. package/skills/phoenix-ui/scripts/ENGINE.json +19 -19
  54. package/skills/phoenix-ui/scripts/phoenix-bootstrap.cjs +2 -17
  55. package/skills/portal-external-app/SKILL.md +3 -2
  56. package/skills/portal-external-app/references/oauth-discovery.md +94 -0
  57. package/skills/portal-external-app/references/public-entrypoints.md +2 -0
  58. package/skills/portal-external-app/references/registration-and-onebox.md +3 -0
  59. package/skills/resolve-blocked/SKILL.md +292 -139
  60. package/skills/resolve-blocked/agents/openai.yaml +2 -2
  61. package/skills/resolve-blocked/evals/scenarios.md +10 -4
  62. package/skills/resolve-blocked/references/decisions-contract.md +2 -1
  63. package/skills/review-ui/SKILL.md +61 -95
  64. package/skills/review-ui/agents/openai.yaml +2 -2
  65. package/skills/review-ui/evals/fresh-context.md +14 -4
  66. package/skills/review-ui/evals/scenarios.md +19 -14
  67. package/skills/review-ui/references/judge.md +19 -20
  68. package/skills/review-ui/references/report-contract.md +18 -18
  69. package/skills/review-ui/references/target-and-capture.md +31 -11
  70. package/skills/xgent-app-release/SKILL.md +11 -2
  71. package/skills/xgent-app-release/references/public-delivery.md +64 -0
  72. package/skills/xgent-app-release/references/publish-api.md +5 -2
  73. package/skills/xgent-init/SKILL.md +1 -1
  74. package/skills/review-ui/references/rules.v1.json +0 -1853
@@ -7,7 +7,7 @@ metadata:
7
7
  internal: true
8
8
  version: 0.1.0
9
9
  source: skills/phoenix-ui/src
10
- source_sha256: 91409c0e7e0eb2e3b013f79a49bc0e897da22cd1adef8fb3eed370a834a79fc9
10
+ source_sha256: 3a90920fc0c5443a5a657a49d83dfc899503fe8f237b5f8272d4143195e62d63
11
11
  ---
12
12
 
13
13
  Phoenix UI provides local design tools for any UI project, including standalone sites, applications, and embedded interfaces. Follow the target project's product truth, accepted direction, and design rules; derive platform and host constraints from that project's own context. Use the command references to create complete, accessible interfaces with a clear visual direction.
@@ -2,38 +2,38 @@
2
2
  "schemaVersion": 1,
3
3
  "distribution": "release",
4
4
  "toolVersion": "0.1.0",
5
- "npmPackageVersion": "0.7.7",
6
- "sourceCommit": "6a01c326c1f3dd0390151882e6e03205ea1dc6b8",
7
- "sourceTree": "34fecf8ada60947a681e278760e30fd658211b91",
5
+ "npmPackageVersion": "0.7.9",
6
+ "sourceCommit": "7229a8ba08f7d37bc37530e00e4d933903f1b5cf",
7
+ "sourceTree": "8f59135bcd1e6ef1cb1db6974fae9dffac0ff0c7",
8
8
  "sourceState": "dirty",
9
- "sourceInputSha256": "466dc76c552ee4b79049cbe41852d84dc010c25f31ecf3062b79605f5d557e31",
9
+ "sourceInputSha256": "3088d11390806058b527f5bbc4b0a4860f34c7cdd52a104d7806f8c46fccf310",
10
10
  "bundleSchema": 1,
11
- "bundleSha256": "637ec2dbcaad98d0765bf0d73fd2fc5935004212288c69f3f5798a13fb584c78",
11
+ "bundleSha256": "edc5115dbdd52a5b834ae242ffd46c76d76e6c24ae10ec2dfc6a13cc0ac28921",
12
12
  "reviewSchema": 1,
13
13
  "engines": {
14
14
  "darwin-arm64": {
15
15
  "asset": "phoenix-ui-darwin-arm64",
16
- "sha256": "b688b6d70b37270a451cfd8002c6139ade3197cc3458da54201d4764cf77fd95",
17
- "size": 18350288,
18
- "url": "https://download.xgent.ai/vendor/phoenix-ui/v0.7.6/darwin-arm64/phoenix-ui-darwin-arm64"
16
+ "size": 18366832,
17
+ "sha256": "b843dce661874b9ab7a4799c529193a6cdc7415e6a0a78a5a28e5c87072df0eb",
18
+ "url": "https://download.xgent.ai/vendor/phoenix-ui/v0.7.9/ci-41410951647/darwin-arm64/phoenix-ui-darwin-arm64"
19
19
  },
20
20
  "darwin-x64": {
21
21
  "asset": "phoenix-ui-darwin-x64",
22
- "sha256": "f8b59faf9bda40347ce9fec8abd2001414aa22b705cddb01e6ed30df487bb15c",
23
- "size": 20838208,
24
- "url": "https://download.xgent.ai/vendor/phoenix-ui/v0.7.6/darwin-x64/phoenix-ui-darwin-x64"
25
- },
26
- "linux-x64": {
27
- "asset": "phoenix-ui-linux-x64",
28
- "sha256": "c233dd554bc033d339aa568704e136d6d0d949f8fc8e8ea0a3e3ab69d5cb329b",
29
- "size": 22931072,
30
- "url": "https://download.xgent.ai/vendor/phoenix-ui/v0.7.6/linux-x64/phoenix-ui-linux-x64"
22
+ "size": 20858712,
23
+ "sha256": "9af56bc51bdf6096228fe36ffe7096b85ce0653a21a29554938d94f596d48681",
24
+ "url": "https://download.xgent.ai/vendor/phoenix-ui/v0.7.9/ci-41410951647/darwin-x64/phoenix-ui-darwin-x64"
31
25
  },
32
26
  "linux-arm64": {
33
27
  "asset": "phoenix-ui-linux-arm64",
34
- "sha256": "6f846f717e7403d419fcab253057ab35355fd00ee8b247235fe63c2fb2d65548",
35
28
  "size": 19768520,
36
- "url": "https://download.xgent.ai/vendor/phoenix-ui/v0.7.6/linux-arm64/phoenix-ui-linux-arm64"
29
+ "sha256": "174507b2150985556544ba7cfb61613d054e9908750defb123b981c54b3ec297",
30
+ "url": "https://download.xgent.ai/vendor/phoenix-ui/v0.7.9/ci-41410951647/linux-arm64/phoenix-ui-linux-arm64"
31
+ },
32
+ "linux-x64": {
33
+ "asset": "phoenix-ui-linux-x64",
34
+ "size": 22950336,
35
+ "sha256": "ec268516406c0660116c9a1c912bad46580916e8645778dccea2942b8f4cb3a2",
36
+ "url": "https://download.xgent.ai/vendor/phoenix-ui/v0.7.9/ci-41410951647/linux-x64/phoenix-ui-linux-x64"
37
37
  }
38
38
  }
39
39
  }
@@ -67,25 +67,13 @@ function projectRoot(start) {
67
67
  const initial = fs.realpathSync(path.resolve(start));
68
68
  let dir = initial;
69
69
  for (;;) {
70
- if (fs.existsSync(path.join(dir, '.phoenix-ui/install/active.json')) || fs.existsSync(path.join(dir, '.git'))) return dir;
70
+ if (['.agents', '.claude', '.cursor', '.gemini', '.github', '.grok'].some(provider => fs.existsSync(path.join(dir, provider, 'skills/phoenix-ui/scripts/ENGINE.json'))) || fs.existsSync(path.join(dir, '.git'))) return dir;
71
71
  const parent = path.dirname(dir);
72
72
  if (parent === dir) return initial;
73
73
  dir = parent;
74
74
  }
75
75
  }
76
76
 
77
- // The transactional installer writes this receipt last. It names the package and
78
- // bundle, not a platform, so one project serves every supported engine target.
79
- function verifyReceipt(project, manifest) {
80
- const file = path.join(project, '.phoenix-ui/install/active.json');
81
- if (!fs.existsSync(file)) return;
82
- const receipt = JSON.parse(fs.readFileSync(file, 'utf8'));
83
- if (receipt.schema_version !== 1 || receipt.manifest?.version !== manifest.data.npmPackageVersion
84
- || receipt.manifest?.sha256 !== manifest.data.bundleSha256) {
85
- throw failure(`Project receipt requires a different Phoenix package. Run @xgent-ai/skills@${receipt.manifest?.version || manifest.data.npmPackageVersion} for this project.`);
86
- }
87
- }
88
-
89
77
  function verifyEngine(file, manifest, target, env = process.env) {
90
78
  const meta = manifest.data.engines[target];
91
79
  if (!meta) throw failure(`This development package has no verified engine for ${target}.`);
@@ -313,13 +301,10 @@ async function main(args, options = {}) {
313
301
  }
314
302
  else releaseDir = path.resolve(args[i]);
315
303
  }
316
- verifyReceipt(project, manifest);
317
304
  const binary = await installEngine(manifest, target, project, releaseDir, env);
318
305
  process.stdout.write(json ? `${JSON.stringify({ status: 'installed', toolVersion: manifest.data.toolVersion, target, binary })}\n` : `Phoenix UI ${manifest.data.toolVersion} ready: ${binary}\n`);
319
306
  return 0;
320
307
  }
321
- // Installer verbs replace or roll back the installed package themselves.
322
- if (!['install', 'migrate'].includes(args[0])) verifyReceipt(project, manifest);
323
308
  const binary = verifyEngine(enginePath(manifest, target, env), manifest, target, env);
324
309
  clearReminders(project, manifest, env);
325
310
  const childEnv = { ...env, PHOENIX_UI_SELF: options.self || process.argv[1], PHOENIX_UI_SKILL_DIR: options.skillDir || path.resolve(__dirname, '..') };
@@ -365,5 +350,5 @@ async function main(args, options = {}) {
365
350
  }
366
351
  }
367
352
 
368
- module.exports = { TARGETS, platformTarget, manifestAt, enginePath, verifyEngine, verifyReceipt, setupCommand, shellQuote, proxyFor, installEngine, sha256, main };
353
+ module.exports = { TARGETS, platformTarget, manifestAt, enginePath, verifyEngine, setupCommand, shellQuote, proxyFor, installEngine, sha256, main };
369
354
  if (require.main === module) main(process.argv.slice(2)).then(code => { process.exitCode = code; }).catch(error => { process.stderr.write(`${error.message}\n`); process.exitCode = 4; });
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: portal-external-app
3
- description: '用于把独立仓库、以 Docker 镜像交付的外部服务接入 XGENT 门户或评审交付物。覆盖 manifest、注册、鉴权、成员客户端与终端用户身份、/svc 路由、健康检查与一盒联调。'
3
+ description: '用于把独立仓库、以 Docker 镜像交付的外部服务接入 XGENT 门户或评审交付物。覆盖 manifest、注册、鉴权、MCP OAuth 发现、成员客户端与终端用户身份、/svc 路由、健康检查与一盒联调。'
4
4
  when_to_use: "用户会说「把我们服务接进门户」「manifest 怎么填」「/svc 路由不通」时。"
5
5
  ---
6
6
 
@@ -25,7 +25,8 @@ when_to_use: "用户会说「把我们服务接进门户」「manifest 怎么填
25
25
  | 服务账号写进应用空间的文件,要让作者本人在文件管理里看得到 | [references/files-member-docs.md](references/files-member-docs.md):`onBehalfOf` 署名、成员只读可见、成员内容隐私开关 |
26
26
  | 门户成员的原生客户端(iOS/Android/桌面)登录与刷新、设备凭证、停用后失效时效、服务端成员查询与事件 | [references/native-clients.md](references/native-clients.md) |
27
27
  | 顾客/学生等终端用户的完整能力、租户用户中心、托管注册登录、账号与隐私治理 | [references/end-users.md](references/end-users.md):先区分成员与终端身份,再按任务读认证协议或生命周期接口 |
28
- | 用户以 CLI、MCP、个人自动化调用 App,或接入门户多服务用户密钥与服务发现 | [references/cli-user-keys.md](references/cli-user-keys.md):受审 `cliAccess` 声明、标准绑定与通用目录;不改门户业务代码 |
28
+ | CLI、MCP、个人自动化使用门户用户访问密钥,或接入多服务用户密钥目录 | [references/cli-user-keys.md](references/cli-user-keys.md):受审 `cliAccess` 声明、标准绑定与通用目录 |
29
+ | MCP/OAuth 客户端发现元数据,或标准 `/.well-known/…/svc/<key>` 返回 HTML/404 | [references/oauth-discovery.md](references/oauth-discovery.md):`oauthDiscovery` 声明、匿名元数据、审批、固定提案交付与撤销 |
29
30
  | 为外部服务写/审对接契约文档 | [references/contract-doc-template.md](references/contract-doc-template.md) |
30
31
  | 有「每租户最多几个 X」的配额诉求(选模型、数值谁配、已用怎么来) | [references/quota-and-seats.md](references/quota-and-seats.md) |
31
32
  | 一个配置项该放哪(环境变量 / 平台级或租户级管理页 / 应用内设置 / 用户偏好),`requiredEnvNotes`、`adminPages` 与 service `tenantConfig` 怎么写 | [references/config-placement.md](references/config-placement.md) |
@@ -0,0 +1,94 @@
1
+ # MCP / OAuth 标准发现接入
2
+
3
+ 适用于 App 自己提供 OAuth 元数据,客户端从门户 origin 查找标准发现地址的场景。
4
+ `oauthDiscovery` 只配置路由;门户透明转发,不生成 JSON,不实现 App 的授权、token、scope 或客户端回调。
5
+ 门户用户访问密钥与多服务目录使用 `cliAccess`,见 [CLI 用户密钥](cli-user-keys.md),两者不能互相替代。
6
+
7
+ ## 前置与声明
8
+
9
+ 目标门户须已部署 OAuth 发现迁移、API/controller 和统一 v2 网关模板(container/process 均支持)。
10
+ 不支持 v1;不依赖 `PUBLIC_SITES_ENABLED`、Sites 权益或 CSP strict 开关。安装新版 SDK、
11
+ whoami 成功、后端 healthy 都不能证明这些平台前置已满足;能力未部署时交平台升级,不逐 App 手改 Caddy。
12
+ 需要 TypeScript 契约时,`@xgent/shared` 从 0.11.1 提供 `OAuthDiscovery`。
13
+
14
+ 将以下片段合入 App 自己的完整 `app.manifest.json`,递增 `version`:
15
+
16
+ ```json
17
+ {
18
+ "oauthDiscovery": {
19
+ "authorizationServer": true,
20
+ "protectedResources": ["/mcp"]
21
+ }
22
+ }
23
+ ```
24
+
25
+ - 非空声明要求最终清单有 `deployDescriptor` 或 `serviceBaseUrl`,服务须可用。需要常驻时在既有 descriptor 设置 `alwaysOn: true`。
26
+ - 只接受 `authorizationServer`(布尔值,省略为 false)与 `protectedResources`(路径数组,省略为空)。仅资源服务器可以只声明后者。
27
+ - 路径从 App 服务根起算,填 `/mcp`,不填 `/svc/<key>/mcp`。`/` 表示根资源;其他路径由非空的字母、数字、`.`、`_`、`~`、`-` 段组成。单独的 `.`/`..` 段、空段、尾斜线、URL、百分号编码、query、fragment、空白、通配符均拒绝。
28
+ - 路径去重并排序;声明中不能指定 issuer、resource、域名或 upstream。这些元数据值由 App 的响应提供。
29
+
30
+ ## 路径与元数据
31
+
32
+ 下表标准入口位于门户 origin;后端路径是不带 `/svc/<key>` 的 App 内部路径。
33
+
34
+ | 声明 | 标准入口 | 后端匿名 GET/HEAD 路径 |
35
+ | --- | --- | --- |
36
+ | `authorizationServer: true` | `/.well-known/oauth-authorization-server/svc/<key>` | `/.well-known/oauth-authorization-server` |
37
+ | 资源 `/mcp` | `/.well-known/oauth-protected-resource/svc/<key>/mcp` | `/.well-known/oauth-protected-resource/mcp` |
38
+ | 资源 `/` | `/.well-known/oauth-protected-resource/svc/<key>` | `/.well-known/oauth-protected-resource` |
39
+
40
+ 设门户 origin 为 `$PORTAL_ORIGIN`(无尾斜线),App key 为 `$LISTING_KEY`:issuer 应为
41
+ `$PORTAL_ORIGIN/svc/$LISTING_KEY`;根资源的 resource 与之相同,`/mcp` 资源在其后加 `/mcp`。
42
+ OAuth authorize/token/register 等端点继续使用 App 既有外部地址。原 `/svc/<key>/.well-known/…`
43
+ 嵌套地址继续可用;网关保留方法、query、Host、响应内容与状态,App 错误不会被修补为有效元数据。
44
+
45
+ ## 提交、审批与生效
46
+
47
+ 1. 使用 App 的发布令牌及目标配置;已有 `.xgent-registry.env` 时让 CLI 自行读取,不打印令牌。缺少配置时从目标门户「开发者应用 → 本 App → 凭证 → 生成配置文件」取得,确认含 LISTING_KEY、TARGET_XGENT_PLATFORM、XGENT_RELEASE_TOKEN,chmod 600 并加入 gitignore。按 [注册与一盒](registration-and-onebox.md) 准备完整清单,再提交:
48
+
49
+ ```bash
50
+ npx @xgent/release-cli publish --manifest app.manifest.json
51
+ ```
52
+
53
+ HTTP 发布也只能通过 `manifest` 字段携带完整清单,不能提交独立 `oauthDiscovery` 表单字段。
54
+ 2. 保存 `proposalId`。新增、修改和撤销均按实际差异进治理审核;等价重排/去重不制造差异。待审不改变已批准路由,由平台管理员核对并批准;发布令牌不能代替管理员审批。
55
+ 3. 用 release-cli ≥0.7.0 查询这一次提案:
56
+
57
+ ```bash
58
+ npx @xgent/release-cli status --proposal-id <proposalId> --wait
59
+ ```
60
+
61
+ `delivery.state=applied` 才表示本次后端与网关目标已确认。`pending` 等待,`failed` 按失败阶段交平台处理,`superseded` 追踪取代它的新提案;`unknown` 或缺少 delivery 均不能报生效。`publish --wait` 不等待人工审批;需要连审批一起等时用 `--wait-review`。
62
+ 4. 再做真实 HTTP 与客户端验收。发布成功、清单 applied、后端 ready 均不能代替此步骤。
63
+
64
+ 仅改发现声明不触发后端重部署;网关失败由平台管理员重试网关并核对本提案 revision,不用重发相同镜像。完整发布命令及凭据准备可使用 `xgent-app-release` skill;本参考的契约不要求访问门户源码。
65
+
66
+ ## 验收与排错
67
+
68
+ 从可信的目标配置取得 `PORTAL_ORIGIN`、`LISTING_KEY`,以下请求不携带登录 cookie 或 Bearer token。
69
+ 按实际声明替换资源路径;`/mcp` 示例:
70
+
71
+ ```bash
72
+ curl -i "$PORTAL_ORIGIN/.well-known/oauth-authorization-server/svc/$LISTING_KEY"
73
+ curl -I "$PORTAL_ORIGIN/.well-known/oauth-authorization-server/svc/$LISTING_KEY"
74
+ curl -i "$PORTAL_ORIGIN/.well-known/oauth-protected-resource/svc/$LISTING_KEY/mcp"
75
+ curl -I "$PORTAL_ORIGIN/.well-known/oauth-protected-resource/svc/$LISTING_KEY/mcp"
76
+ curl -i "$PORTAL_ORIGIN/svc/$LISTING_KEY/.well-known/oauth-authorization-server"
77
+ curl -i "$PORTAL_ORIGIN/svc/$LISTING_KEY/.well-known/oauth-protected-resource/mcp"
78
+ ```
79
+
80
+ - 标准与原嵌套地址 GET 均为 200 JSON,字段相同;HEAD 同状态、JSON Content-Type、无正文。核对 issuer/resource 和既有 OAuth 端点,不只检查 HTTP 200。
81
+ - 已声明标准入口的 POST/PUT/OPTIONS 为 405,含 `Allow: GET, HEAD`;未声明、撤销、额外尾段为 404。使用门户 origin,站点域名继续走自己的站点上下文。
82
+ - 标准地址 404:先查实际获批声明、本次 delivery、服务是否已停止/下架;文件已保存或平台已升级不等于声明已批准。返回 Portal HTML:核对目标 v2 模板及实际加载版本。旧嵌套地址也失败、或返回非 JSON:检查 App 元数据端点。
83
+ - MCP 原匿名请求应继续返回约定的 401 与 `WWW-Authenticate`。元数据 HTTP 通过后,还须用目标客户端走通授权页与回调;WorkBuddy / WorkBuddy AI 等不同回调由 App 负责,不能用网关或夹具检查冒称客户端验收。
84
+
85
+ 交付记录包含目标环境、版本、proposalId、delivery、标准/旧路径 HTTP 和客户端结果;不提供凭据或内部 upstream。
86
+
87
+ ## 替换、撤销与生命周期
88
+
89
+ 省略整个 `oauthDiscovery` 保留已批准值;`null` 或 `{}` 明确清空;对象整体替换,未列出的资源被撤销。
90
+ 递增版本、提交完整清单并批准,等待本次 delivery applied,再确认被撤销的标准 URL 为 404。
91
+ 撤销发现不删除 App 原元数据端点;移除后端配置时须同时撤销声明。恢复旧声明也须新版本和审批。
92
+
93
+ 声明属于全局 listing,单租户卸载不撤销它。停止服务、下架或删除 listing 会随新网关代撤销路由;
94
+ 恢复服务后可恢复获批声明。后端换址时发现与 `/svc` 使用同一运行上游,无需在 App 清单硬编码主机或端口。
@@ -9,11 +9,13 @@
9
9
  | 匿名 SPA、分享页面 | `/apps/<listingKey>/…` | 匿名页不先强制 SDK 登录;读取的数据仍需业务授权 |
10
10
  | 后端直接返回 HTML、公开回调 | `/svc/<listingKey>/…` | 平台去掉服务前缀;App 自己区分匿名与受保护路由,公开服务应常驻 |
11
11
  | 租户站点、独立域名 | `publicEntrypoints` + Sites 服务 | 入口声明、服务特权、平台站点配置、租户权益及路由就绪 |
12
+ | MCP/OAuth 标准元数据发现 | `oauthDiscovery` → 门户 origin 的精确 `/.well-known/…/svc/<key>` | 已部署发现能力的 v2 网关、获批声明及匿名后端元数据;见 [OAuth 发现](oauth-discovery.md) |
12
13
 
13
14
  前两条已经是正式接入方式,不需要为了每个新 App 请求门户增加根级路径。
14
15
  `publicEntrypoints` 是**站点可以绑定的后端入口目录**,不是“在门户根路径新增一条代理”。
15
16
  仅声明它,不会让门户根级 `/v`、`/share` 等路径指向你的服务。
16
17
  历史根路径属于兼容契约,需要与平台约定数据迁移和切换,不可自行复用或覆盖。
18
+ OAuth 发现只开放声明生成的精确 GET/HEAD 路径,不提供任意根路径代理,也不要求打开 `PUBLIC_SITES_ENABLED`。
17
19
 
18
20
  ## 2. 后端直出页必须认识外部路径
19
21
 
@@ -14,6 +14,7 @@
14
14
  `privilegedServiceScopes` 里的,租户面**一条也勾不到**(见 integration-contract.md §3.1)。
15
15
  `scopeLabels` 同时是那个勾选列表的正文——不写就只显示裸 scope 串。
16
16
  - 关系:`dependencies`、`exchangeTargets`、`serviceBaseUrl`(`/svc/<listingKey>`)
17
+ - OAuth 标准发现:`oauthDiscovery`(`authorizationServer` 与 `protectedResources`),非空声明要求后端;新增、修改及撤销经治理审批。路径映射、省略/null 语义与真实 HTTP 验收见 [OAuth 发现](oauth-discovery.md)。
17
18
  - 终端身份:`endUserRealms:{"mode":"fixed","siteKeys":["customers"]}` 或 `{"mode":"dynamic"}`,
18
19
  声明本 App 的身份空间范围;不创建托管 profile/client、不授额度,也不是成员的 publicClient。
19
20
  顾客/学生认证与生命周期按 [终端用户接入](end-users.md) 配置;endusers.* 等服务权限经特权审批申请。
@@ -47,6 +48,8 @@
47
48
 
48
49
  CLI / MCP / 个人自动化使用用户访问密钥时,还须声明独立的 `cliAccess`,不能把整份 `scopes` 当作用户密钥上限。新增、修改和撤回经过发布审批;绑定与发现按 [CLI 用户密钥契约](cli-user-keys.md),无需在门户登记 App 专属权限分支。先确认目标门户已部署此能力。
49
50
 
51
+ MCP 客户端通过 App 自有 OAuth 授权服务器发现元数据时,使用独立的 `oauthDiscovery`;它只声明标准发现路由,不配置用户密钥、OAuth 身份或客户端回调。不能用 `cliAccess`、`publicEntrypoints` 或 `publicClient` 代替。
52
+
50
53
  ⚠️ 规则 3 **读写不分**:背书的是整个命名空间,`files.write` 与 `files.read` 同一条待遇,
51
54
  没有「写要额外批一次」这回事。别人的 App 只声明了读,那是它自己的业务选择(它的写面不
52
55
  代表用户),不是平台对你的限制 —— 照抄别人的清单当规矩用,会把一个本来合法的功能砍掉。