@xdxer/dingtalk-agent 0.1.5-beta.1 → 0.1.5-beta.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/CHANGELOG.md +32 -0
- package/README.en.md +5 -2
- package/README.md +5 -2
- package/dist/bin/dingtalk-agent.js +16 -5
- package/dist/bin/dingtalk-agent.js.map +1 -1
- package/dist/src/agent-platform.js +0 -1
- package/dist/src/agent-platform.js.map +1 -1
- package/dist/src/development-workspace.js +25 -8
- package/dist/src/development-workspace.js.map +1 -1
- package/dist/src/doctor.js +6 -1
- package/dist/src/doctor.js.map +1 -1
- package/dist/src/multica-deploy.js +265 -50
- package/dist/src/multica-deploy.js.map +1 -1
- package/dist/src/multica-provider.js +1 -2
- package/dist/src/multica-provider.js.map +1 -1
- package/dist/src/opencode-provider.js +3 -1
- package/dist/src/opencode-provider.js.map +1 -1
- package/dist/src/skill-manager.js +2 -3
- package/dist/src/skill-manager.js.map +1 -1
- package/docs/ARCHITECTURE.md +12 -0
- package/docs/schemas/multica-deployment-receipt.schema.json +2 -2
- package/docs/schemas/multica-workspace-run-plan.schema.json +31 -0
- package/docs/schemas/multica-workspace-run.schema.json +44 -0
- package/docs/schemas/project.schema.json +10 -2
- package/lab/project-workspace/fake-multica-provider.mjs +39 -10
- package/lab/project-workspace/multica-readonly.fixture.json +0 -12
- package/lab/project-workspace/project.fixture.json +0 -4
- package/lab/robot-eval/suite.json +1 -1
- package/package.json +1 -2
- package/skills/README.md +0 -1
- package/skills/core/dingtalk-agent-compose/SKILL.md +5 -5
- package/skills/core/dingtalk-agent-compose/assets/AGENTS.template.md +1 -1
- package/skills/core/dingtalk-agent-compose/references/agent-definition-contract.md +1 -1
- package/skills/core/dingtalk-agent-eval/SKILL.md +1 -1
- package/skills/core/dingtalk-agent-eval/references/interactive-debug-channels.md +9 -3
- package/skills/core/dingtalk-basic-behavior/SKILL.md +15 -3
- package/skills/core/dingtalk-basic-behavior/references/perception-and-gates.md +54 -0
- package/skills/core/dingtalk-basic-behavior/references/truth-and-recovery.md +4 -2
- package/skills/platforms/multica-dingtalk/PLATFORM.md +6 -5
- package/skills/platforms/multica-dingtalk/dingtalk-agent-deploy-multica/SKILL.md +4 -4
- package/skills/platforms/multica-dingtalk/dingtalk-agent-deploy-multica/references/multica-deployment-contract.md +14 -6
- package/skills/platforms/multica-dingtalk/dingtalk-agent-boot-multica/SKILL.md +0 -40
|
@@ -19,7 +19,6 @@ export const MANAGED_AGENT_PLATFORMS = [
|
|
|
19
19
|
description: '钉钉 Multica 托管平台:供给、部署、钉钉机器人绑定、观测与调度。',
|
|
20
20
|
skills: [
|
|
21
21
|
{ role: 'deploy', name: 'dingtalk-agent-deploy-multica', purpose: '经 dta 稳定 CLI 受控部署/晋级/观测到 Multica' },
|
|
22
|
-
{ role: 'boot', name: 'dingtalk-agent-boot-multica', purpose: '部署产物在 Multica Host 内每次任务的启动协议' },
|
|
23
22
|
{ role: 'ops', name: 'multica-external', purpose: '平台运维执行体:供给/绑定机器人/观测/调度(纯 HTTPS)' },
|
|
24
23
|
],
|
|
25
24
|
commands: ['deploy', 'promote', 'observe'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-platform.js","sourceRoot":"","sources":["../../src/agent-platform.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,oCAAoC;AACpC,gEAAgE;AAChE,6DAA6D;AAC7D,oDAAoD;AACpD,wEAAwE;AAExE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACpG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,cAA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AC,GAAG,EAAE,YAAY,CAAC,CAAA;QACzC,IAAI,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,cAAc,EAAE;YAAE,OAAO,SAAS,CAAA;QACrF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,MAAM,KAAK,GAAG,IAAI,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI;YAAE,OAAO,IAAI,CAAA;QAC1D,GAAG,GAAG,MAAM,CAAA;IACd,CAAC;AACH,CAAC","sourcesContent":["// Managed Agent Platform 注册表与工作区归属解析。\n//\n// 一个 Agent 工作区归属于至多一个托管平台;归属解析顺序固定:\n// DTA_AGENT_PLATFORM 环境变量 > dingtalk-agent.json#agentPlatform\n// > .dingtalk-agent/agent-platform.json > 按 Provider 声明推断。\n// 平台相关的方法学不写进 CLI——它们随对应平台的 Skill 包分发,只在用户选择该平台时安装。\n// 平台命令(如 deploy/promote/observe)必须先通过归属门禁;coming-soon 平台一律 fail-closed。\n\nimport { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { dirname, join, parse, resolve } from 'node:path'\n\nimport { findAgentProjectRoot } from './development-workspace.js'\nimport { findExecutable } from './doctor.js'\nimport { installGlobalSkill, type GlobalSkillStatus } from './skill-manager.js'\n\nexport type AgentPlatformStatus = 'supported' | 'coming-soon'\n\nexport interface AgentPlatformSkillBinding {\n role: string\n name: string\n purpose: string\n}\n\nexport interface AgentPlatformDefinition {\n name: string\n label: string\n status: AgentPlatformStatus\n description: string\n skills: AgentPlatformSkillBinding[]\n commands: string[]\n // 建议 endpoint(不是静默默认直连:真实执行仍 fail-closed,见 resolveEndpoint)。\n // 已指向线上正式域名——正因为是生产环境,resolveEndpoint 仍返回 confirmed: false,用前必须显式确认。\n // 可被 MULTICA_SERVER_URL 环境变量 / 项目 config / 已登录 profile 覆盖。\n suggestedEndpoint?: string\n endpointEnv?: string\n}\n\nexport const MANAGED_AGENT_PLATFORMS: AgentPlatformDefinition[] = [\n {\n name: 'multica-dingtalk',\n label: 'Multica (DingTalk)',\n status: 'supported',\n description: '钉钉 Multica 托管平台:供给、部署、钉钉机器人绑定、观测与调度。',\n skills: [\n { role: 'deploy', name: 'dingtalk-agent-deploy-multica', purpose: '经 dta 稳定 CLI 受控部署/晋级/观测到 Multica' },\n { role: 'boot', name: 'dingtalk-agent-boot-multica', purpose: '部署产物在 Multica Host 内每次任务的启动协议' },\n { role: 'ops', name: 'multica-external', purpose: '平台运维执行体:供给/绑定机器人/观测/调度(纯 HTTPS)' },\n ],\n commands: ['deploy', 'promote', 'observe'],\n suggestedEndpoint: 'https://fde-workbench.dingtalk.com',\n endpointEnv: 'MULTICA_SERVER_URL',\n },\n {\n name: 'deap',\n label: 'DEAP',\n status: 'coming-soon',\n description: '敬请期待。',\n skills: [],\n commands: [],\n },\n]\n\nexport const AGENT_PLATFORM_FILE = '.dingtalk-agent/agent-platform.json'\nconst PROJECT_FILE = 'dingtalk-agent.json'\n\nexport type AgentPlatformSource = 'env' | 'project-manifest' | 'platform-file' | 'inferred' | 'none'\n\nexport interface AgentPlatformResolution {\n $schema: 'dingtalk-agent/agent-platform-resolution@1'\n platform: string | null\n source: AgentPlatformSource\n file: string\n definition: AgentPlatformDefinition | null\n platforms: AgentPlatformDefinition[]\n}\n\nexport interface AgentPlatformUseResult extends AgentPlatformResolution {\n written: string\n skillInstalls: GlobalSkillStatus[]\n}\n\nexport function agentPlatformDefinition(name: string): AgentPlatformDefinition | null {\n return MANAGED_AGENT_PLATFORMS.find((item) => item.name === name) || null\n}\n\nexport function resolveAgentPlatform(\n start = process.cwd(), env: NodeJS.ProcessEnv = process.env,\n): AgentPlatformResolution {\n const fromEnv = String(env.DTA_AGENT_PLATFORM || '').trim()\n if (fromEnv) return resolution(fromEnv, 'env', '')\n\n const projectRoot = findAgentProjectRoot(start)\n if (projectRoot) {\n const manifestPath = join(projectRoot, PROJECT_FILE)\n if (existsSync(manifestPath) && !lstatSync(manifestPath).isSymbolicLink()) {\n const manifest = readJsonOrNull(manifestPath)\n const declared = typeof manifest?.agentPlatform === 'string' ? manifest.agentPlatform.trim() : ''\n if (declared) return resolution(declared, 'project-manifest', manifestPath)\n }\n }\n\n const platformPath = findUp(start, AGENT_PLATFORM_FILE)\n if (platformPath) {\n const stored = readJsonOrNull(platformPath)\n const declared = typeof stored?.agentPlatform === 'string' ? stored.agentPlatform.trim() : ''\n if (declared) return resolution(declared, 'platform-file', platformPath)\n }\n\n if (projectRoot) {\n const manifest = readJsonOrNull(join(projectRoot, PROJECT_FILE))\n const providers = Object.values(manifest?.workspaces || {})\n .map((workspace: any) => workspace?.provider?.kind)\n if (providers.includes('multica')) {\n return resolution('multica-dingtalk', 'inferred', join(projectRoot, PROJECT_FILE))\n }\n }\n\n return resolution(null, 'none', '')\n}\n\nexport interface AgentPlatformUseOptions {\n packageRoot: string\n home?: string\n env?: NodeJS.ProcessEnv\n installSkills?: boolean\n}\n\nexport function useAgentPlatform(\n start: string, name: string, options: AgentPlatformUseOptions,\n): AgentPlatformUseResult {\n const definition = agentPlatformDefinition(name)\n if (!definition) {\n throw new Error(\n `未知 managed agent platform: ${name}\\n` +\n `可用: ${MANAGED_AGENT_PLATFORMS.map((item) => `${item.name}(${statusLabel(item.status)})`).join('、')}`,\n )\n }\n if (definition.status !== 'supported') {\n throw new Error(`${definition.label} 敬请期待——当前版本尚未开放该平台。`)\n }\n\n const projectRoot = findAgentProjectRoot(start)\n let written: string\n if (projectRoot && existsSync(join(projectRoot, PROJECT_FILE))) {\n const manifestPath = join(projectRoot, PROJECT_FILE)\n if (lstatSync(manifestPath).isSymbolicLink()) {\n throw new Error(`${PROJECT_FILE} 不能是符号链接`)\n }\n const manifest = readJsonOrNull(manifestPath)\n if (!manifest || typeof manifest !== 'object') {\n throw new Error(`${PROJECT_FILE} 不是合法 JSON,无法写入 agentPlatform 归属`)\n }\n manifest.agentPlatform = definition.name\n writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\\n')\n written = manifestPath\n } else {\n const target = join(resolve(start), AGENT_PLATFORM_FILE)\n mkdirSync(dirname(target), { recursive: true })\n writeFileSync(target, JSON.stringify(\n { $schema: 'dingtalk-agent/agent-platform@1', agentPlatform: definition.name }, null, 2,\n ) + '\\n')\n written = target\n }\n\n const skillInstalls: GlobalSkillStatus[] = []\n if (options.installSkills !== false) {\n for (const skill of definition.skills) {\n skillInstalls.push(installGlobalSkill(options.packageRoot, {\n name: skill.name, home: options.home, env: options.env,\n }))\n }\n }\n\n return { ...resolveAgentPlatform(start, options.env || process.env), written, skillInstalls }\n}\n\n/** deploy/promote/observe 等平台命令的归属门禁:未归属、未知或 coming-soon 一律 fail-closed。 */\nexport function requireSupportedAgentPlatform(\n command: string, start = process.cwd(), env: NodeJS.ProcessEnv = process.env,\n): AgentPlatformResolution {\n const resolved = resolveAgentPlatform(start, env)\n if (!resolved.platform) {\n throw new Error(\n `当前工作区未声明 managed agent platform,无法执行 \\`${command}\\`。\\n` +\n '先运行 `dta agent-platform use multica-dingtalk`,或设置 DTA_AGENT_PLATFORM 环境变量。',\n )\n }\n if (!resolved.definition) {\n throw new Error(\n `工作区声明了未知 platform: ${resolved.platform}(来源 ${resolved.source})。\\n` +\n `可用: ${MANAGED_AGENT_PLATFORMS.map((item) => item.name).join('、')}`,\n )\n }\n if (resolved.definition.status !== 'supported') {\n throw new Error(`${resolved.definition.label} 敬请期待——\\`${command}\\` 尚未在该平台开放。`)\n }\n if (!resolved.definition.commands.includes(command)) {\n throw new Error(`${resolved.definition.label} 不承接命令 \\`${command}\\`。`)\n }\n return resolved\n}\n\n/** dta 层的平台命令/角色(deploy、boot、ops…)关联到该平台内确切的 Skill 名。 */\nexport function platformSkillForRole(platformName: string, role: string): string | null {\n const definition = agentPlatformDefinition(platformName)\n return definition?.skills.find((item) => item.role === role)?.name || null\n}\n\nconst PLATFORM_DIRS: Record<string, string> = {\n 'multica-dingtalk': 'skills/platforms/multica-dingtalk',\n deap: 'skills/platforms/deap',\n}\n\n/** 平台说明文档(PLATFORM.md)在包内的路径;切换到该平台时应加载让维护者/Agent 知道各技能用途。 */\nexport function platformDocPath(packageRoot: string, platformName: string): string | null {\n const dir = PLATFORM_DIRS[platformName]\n if (!dir) return null\n const path = join(packageRoot, dir, 'PLATFORM.md')\n return existsSync(path) ? path : null\n}\n\nexport function readPlatformDoc(packageRoot: string, platformName: string): string {\n const path = platformDocPath(packageRoot, platformName)\n return path ? readFileSync(path, 'utf8') : ''\n}\n\nexport function statusLabel(status: AgentPlatformStatus): string {\n return status === 'supported' ? '已支持' : '敬请期待'\n}\n\nexport type EndpointSource = 'env' | 'project-config' | 'profile' | 'suggested' | 'ambiguous' | 'none'\n\nexport interface EndpointResolution {\n endpoint: string\n source: EndpointSource\n // confirmed=true 仅当来自真实来源(env / 项目 config / 恰好一个已登录 profile);\n // suggested(预发建议)与 ambiguous(多目标未选)均为 false —— 发布前仍需用户显式确认,不得据此直连。\n confirmed: boolean\n envVar: string\n candidates: string[]\n}\n\n/**\n * 解析平台 endpoint,与真实执行体(multica_ext.py 读 MULTICA_SERVER_URL/--profile)同源,\n * 不新造命名空间、不静默默认连预发。顺序:\n * MULTICA_SERVER_URL 环境变量 > 项目 config(dingtalk-agent.json#multicaEndpoint /\n * .dingtalk-agent/agent-platform.json.endpoint)> 恰好一个已登录 profile 的 server_url\n * (多个则 ambiguous,不自动挑)> suggestedEndpoint(仅建议,未确认)。\n */\nexport function resolveEndpoint(\n platformName: string, start = process.cwd(),\n env: NodeJS.ProcessEnv = process.env, home = homedir(),\n): EndpointResolution {\n const definition = agentPlatformDefinition(platformName)\n const envVar = definition?.endpointEnv || 'MULTICA_SERVER_URL'\n const base: Omit<EndpointResolution, 'endpoint' | 'source' | 'confirmed'> = { envVar, candidates: [] }\n\n const fromEnv = String(env[envVar] || '').trim()\n if (fromEnv) return { endpoint: fromEnv, source: 'env', confirmed: true, ...base }\n\n const fromConfig = projectEndpoint(start)\n if (fromConfig) return { endpoint: fromConfig, source: 'project-config', confirmed: true, ...base }\n\n const serverUrls = [...new Set(multicaTargets(home)\n .map((target) => target.serverUrl.trim()).filter(Boolean))]\n if (serverUrls.length === 1) {\n return { endpoint: serverUrls[0], source: 'profile', confirmed: true, ...base }\n }\n if (serverUrls.length > 1) {\n return { endpoint: '', source: 'ambiguous', confirmed: false, ...base, candidates: serverUrls }\n }\n\n if (definition?.suggestedEndpoint) {\n return { endpoint: definition.suggestedEndpoint, source: 'suggested', confirmed: false, ...base }\n }\n return { endpoint: '', source: 'none', confirmed: false, ...base }\n}\n\nfunction projectEndpoint(start: string): string {\n const projectRoot = findAgentProjectRoot(start)\n if (!projectRoot) return ''\n const manifest = readJsonOrNull(join(projectRoot, PROJECT_FILE))\n const fromManifest = typeof manifest?.multicaEndpoint === 'string' ? manifest.multicaEndpoint.trim() : ''\n if (fromManifest) return fromManifest\n const platform = readJsonOrNull(join(projectRoot, AGENT_PLATFORM_FILE))\n return typeof platform?.endpoint === 'string' ? platform.endpoint.trim() : ''\n}\n\nexport interface AgentPlatformReadinessCheck {\n id: string\n ok: boolean\n summary: string\n hint?: string\n}\n\n/**\n * 平台工具链就绪检查(只读,不阻断):选择/查看平台归属时提示用户缺什么、怎么补。\n * 强制门禁仍由 requireSupportedAgentPlatform 与各平台命令自身承担。\n */\nexport function agentPlatformReadiness(\n name: string, env: NodeJS.ProcessEnv = process.env, home = homedir(),\n start: string = process.cwd(),\n): AgentPlatformReadinessCheck[] {\n if (name !== 'multica-dingtalk') return []\n const checks: AgentPlatformReadinessCheck[] = []\n const cli = findExecutable('multica', env)\n checks.push(cli\n ? { id: 'multica-cli', ok: true, summary: `multica CLI 已安装(${cli})` }\n : {\n id: 'multica-cli', ok: false, summary: '未找到 multica CLI',\n hint: '安装:curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash',\n })\n const ep = resolveEndpoint(name, start, env, home)\n const loginTarget = ep.endpoint || '<endpoint>'\n const suffix = ep.confirmed ? '' : '(未确认,请核对是预发还是生产)'\n checks.push(hasMulticaToken(home)\n ? { id: 'multica-login', ok: true, summary: 'Multica 已登录(本地存在 token)' }\n : {\n id: 'multica-login', ok: false, summary: 'Multica 尚未登录',\n hint: `登录:multica login --server-url ${loginTarget} --token <你的 mul_ PAT>` +\n `(endpoint 来源 ${ep.source}${suffix};用 MULTICA_SERVER_URL 或登录别的 profile 可切换)`,\n })\n if (['HTTPS_PROXY', 'https_proxy', 'ALL_PROXY', 'all_proxy'].some((key) => env[key])) {\n checks.push({\n id: 'proxy-env', ok: false, summary: '检测到代理环境变量,可能阻断 Multica 直连',\n hint: '连接失败时用 env -u HTTPS_PROXY -u https_proxy -u ALL_PROXY -u all_proxy 运行 multica 与平台脚本',\n })\n }\n return checks\n}\n\nexport interface MulticaTarget {\n profile: string\n serverUrl: string\n workspaceId: string\n}\n\n/**\n * 本机已登录的 Multica 目标清单(default 配置 + 各 profile)。只暴露 endpoint 与\n * workspace 标识,不读取 token 内容。发布前必须把候选交给用户选择,绝不默默用默认配置。\n */\nexport function multicaTargets(home = homedir()): MulticaTarget[] {\n const targets: MulticaTarget[] = []\n const push = (profile: string, path: string) => {\n const config = readJsonOrNull(path)\n if (typeof config?.token === 'string' && config.token.trim()) {\n targets.push({\n profile,\n serverUrl: String(config.server_url || ''),\n workspaceId: String(config.workspace_id || ''),\n })\n }\n }\n push('default', join(home, '.multica', 'config.json'))\n try {\n for (const entry of readdirSync(join(home, '.multica', 'profiles'))) {\n push(entry, join(home, '.multica', 'profiles', entry, 'config.json'))\n }\n } catch { /* profiles 目录不存在 */ }\n return targets\n}\n\nfunction hasMulticaToken(home: string): boolean {\n const candidates = [join(home, '.multica', 'config.json')]\n try {\n for (const entry of readdirSync(join(home, '.multica', 'profiles'))) {\n candidates.push(join(home, '.multica', 'profiles', entry, 'config.json'))\n }\n } catch { /* profiles 目录不存在 */ }\n return candidates.some((path) => {\n const config = readJsonOrNull(path)\n return typeof config?.token === 'string' && config.token.trim().length > 0\n })\n}\n\nfunction resolution(\n name: string | null, source: AgentPlatformSource, file: string,\n): AgentPlatformResolution {\n return {\n $schema: 'dingtalk-agent/agent-platform-resolution@1',\n platform: name,\n source,\n file,\n definition: name ? agentPlatformDefinition(name) : null,\n platforms: MANAGED_AGENT_PLATFORMS,\n }\n}\n\nfunction readJsonOrNull(path: string): any {\n try { return JSON.parse(readFileSync(path, 'utf8')) } catch { return null }\n}\n\nfunction findUp(start: string, relativePath: string): string | null {\n let dir = resolve(start)\n while (true) {\n const candidate = join(dir, relativePath)\n if (existsSync(candidate) && !lstatSync(candidate).isSymbolicLink()) return candidate\n const parent = dirname(dir)\n if (parent === dir || dir === parse(dir).root) return null\n dir = parent\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agent-platform.js","sourceRoot":"","sources":["../../src/agent-platform.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,oCAAoC;AACpC,gEAAgE;AAChE,6DAA6D;AAC7D,oDAAoD;AACpD,wEAAwE;AAExE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACpG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAA0B,MAAM,oBAAoB,CAAA;AAwB/E,MAAM,CAAC,MAAM,uBAAuB,GAA8B;IAChE;QACE,IAAI,EAAE,kBAAkB;QACxB,KAAK,EAAE,oBAAoB;QAC3B,MAAM,EAAE,WAAW;QACnB,WAAW,EAAE,sCAAsC;QACnD,MAAM,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,CAAA;IACd,CAAC;AACH,CAAC","sourcesContent":["// Managed Agent Platform 注册表与工作区归属解析。\n//\n// 一个 Agent 工作区归属于至多一个托管平台;归属解析顺序固定:\n// DTA_AGENT_PLATFORM 环境变量 > dingtalk-agent.json#agentPlatform\n// > .dingtalk-agent/agent-platform.json > 按 Provider 声明推断。\n// 平台相关的方法学不写进 CLI——它们随对应平台的 Skill 包分发,只在用户选择该平台时安装。\n// 平台命令(如 deploy/promote/observe)必须先通过归属门禁;coming-soon 平台一律 fail-closed。\n\nimport { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { dirname, join, parse, resolve } from 'node:path'\n\nimport { findAgentProjectRoot } from './development-workspace.js'\nimport { findExecutable } from './doctor.js'\nimport { installGlobalSkill, type GlobalSkillStatus } from './skill-manager.js'\n\nexport type AgentPlatformStatus = 'supported' | 'coming-soon'\n\nexport interface AgentPlatformSkillBinding {\n role: string\n name: string\n purpose: string\n}\n\nexport interface AgentPlatformDefinition {\n name: string\n label: string\n status: AgentPlatformStatus\n description: string\n skills: AgentPlatformSkillBinding[]\n commands: string[]\n // 建议 endpoint(不是静默默认直连:真实执行仍 fail-closed,见 resolveEndpoint)。\n // 已指向线上正式域名——正因为是生产环境,resolveEndpoint 仍返回 confirmed: false,用前必须显式确认。\n // 可被 MULTICA_SERVER_URL 环境变量 / 项目 config / 已登录 profile 覆盖。\n suggestedEndpoint?: string\n endpointEnv?: string\n}\n\nexport const MANAGED_AGENT_PLATFORMS: AgentPlatformDefinition[] = [\n {\n name: 'multica-dingtalk',\n label: 'Multica (DingTalk)',\n status: 'supported',\n description: '钉钉 Multica 托管平台:供给、部署、钉钉机器人绑定、观测与调度。',\n skills: [\n { role: 'deploy', name: 'dingtalk-agent-deploy-multica', purpose: '经 dta 稳定 CLI 受控部署/晋级/观测到 Multica' },\n { role: 'ops', name: 'multica-external', purpose: '平台运维执行体:供给/绑定机器人/观测/调度(纯 HTTPS)' },\n ],\n commands: ['deploy', 'promote', 'observe'],\n suggestedEndpoint: 'https://fde-workbench.dingtalk.com',\n endpointEnv: 'MULTICA_SERVER_URL',\n },\n {\n name: 'deap',\n label: 'DEAP',\n status: 'coming-soon',\n description: '敬请期待。',\n skills: [],\n commands: [],\n },\n]\n\nexport const AGENT_PLATFORM_FILE = '.dingtalk-agent/agent-platform.json'\nconst PROJECT_FILE = 'dingtalk-agent.json'\n\nexport type AgentPlatformSource = 'env' | 'project-manifest' | 'platform-file' | 'inferred' | 'none'\n\nexport interface AgentPlatformResolution {\n $schema: 'dingtalk-agent/agent-platform-resolution@1'\n platform: string | null\n source: AgentPlatformSource\n file: string\n definition: AgentPlatformDefinition | null\n platforms: AgentPlatformDefinition[]\n}\n\nexport interface AgentPlatformUseResult extends AgentPlatformResolution {\n written: string\n skillInstalls: GlobalSkillStatus[]\n}\n\nexport function agentPlatformDefinition(name: string): AgentPlatformDefinition | null {\n return MANAGED_AGENT_PLATFORMS.find((item) => item.name === name) || null\n}\n\nexport function resolveAgentPlatform(\n start = process.cwd(), env: NodeJS.ProcessEnv = process.env,\n): AgentPlatformResolution {\n const fromEnv = String(env.DTA_AGENT_PLATFORM || '').trim()\n if (fromEnv) return resolution(fromEnv, 'env', '')\n\n const projectRoot = findAgentProjectRoot(start)\n if (projectRoot) {\n const manifestPath = join(projectRoot, PROJECT_FILE)\n if (existsSync(manifestPath) && !lstatSync(manifestPath).isSymbolicLink()) {\n const manifest = readJsonOrNull(manifestPath)\n const declared = typeof manifest?.agentPlatform === 'string' ? manifest.agentPlatform.trim() : ''\n if (declared) return resolution(declared, 'project-manifest', manifestPath)\n }\n }\n\n const platformPath = findUp(start, AGENT_PLATFORM_FILE)\n if (platformPath) {\n const stored = readJsonOrNull(platformPath)\n const declared = typeof stored?.agentPlatform === 'string' ? stored.agentPlatform.trim() : ''\n if (declared) return resolution(declared, 'platform-file', platformPath)\n }\n\n if (projectRoot) {\n const manifest = readJsonOrNull(join(projectRoot, PROJECT_FILE))\n const providers = Object.values(manifest?.workspaces || {})\n .map((workspace: any) => workspace?.provider?.kind)\n if (providers.includes('multica')) {\n return resolution('multica-dingtalk', 'inferred', join(projectRoot, PROJECT_FILE))\n }\n }\n\n return resolution(null, 'none', '')\n}\n\nexport interface AgentPlatformUseOptions {\n packageRoot: string\n home?: string\n env?: NodeJS.ProcessEnv\n installSkills?: boolean\n}\n\nexport function useAgentPlatform(\n start: string, name: string, options: AgentPlatformUseOptions,\n): AgentPlatformUseResult {\n const definition = agentPlatformDefinition(name)\n if (!definition) {\n throw new Error(\n `未知 managed agent platform: ${name}\\n` +\n `可用: ${MANAGED_AGENT_PLATFORMS.map((item) => `${item.name}(${statusLabel(item.status)})`).join('、')}`,\n )\n }\n if (definition.status !== 'supported') {\n throw new Error(`${definition.label} 敬请期待——当前版本尚未开放该平台。`)\n }\n\n const projectRoot = findAgentProjectRoot(start)\n let written: string\n if (projectRoot && existsSync(join(projectRoot, PROJECT_FILE))) {\n const manifestPath = join(projectRoot, PROJECT_FILE)\n if (lstatSync(manifestPath).isSymbolicLink()) {\n throw new Error(`${PROJECT_FILE} 不能是符号链接`)\n }\n const manifest = readJsonOrNull(manifestPath)\n if (!manifest || typeof manifest !== 'object') {\n throw new Error(`${PROJECT_FILE} 不是合法 JSON,无法写入 agentPlatform 归属`)\n }\n manifest.agentPlatform = definition.name\n writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\\n')\n written = manifestPath\n } else {\n const target = join(resolve(start), AGENT_PLATFORM_FILE)\n mkdirSync(dirname(target), { recursive: true })\n writeFileSync(target, JSON.stringify(\n { $schema: 'dingtalk-agent/agent-platform@1', agentPlatform: definition.name }, null, 2,\n ) + '\\n')\n written = target\n }\n\n const skillInstalls: GlobalSkillStatus[] = []\n if (options.installSkills !== false) {\n for (const skill of definition.skills) {\n skillInstalls.push(installGlobalSkill(options.packageRoot, {\n name: skill.name, home: options.home, env: options.env,\n }))\n }\n }\n\n return { ...resolveAgentPlatform(start, options.env || process.env), written, skillInstalls }\n}\n\n/** deploy/promote/observe 等平台命令的归属门禁:未归属、未知或 coming-soon 一律 fail-closed。 */\nexport function requireSupportedAgentPlatform(\n command: string, start = process.cwd(), env: NodeJS.ProcessEnv = process.env,\n): AgentPlatformResolution {\n const resolved = resolveAgentPlatform(start, env)\n if (!resolved.platform) {\n throw new Error(\n `当前工作区未声明 managed agent platform,无法执行 \\`${command}\\`。\\n` +\n '先运行 `dta agent-platform use multica-dingtalk`,或设置 DTA_AGENT_PLATFORM 环境变量。',\n )\n }\n if (!resolved.definition) {\n throw new Error(\n `工作区声明了未知 platform: ${resolved.platform}(来源 ${resolved.source})。\\n` +\n `可用: ${MANAGED_AGENT_PLATFORMS.map((item) => item.name).join('、')}`,\n )\n }\n if (resolved.definition.status !== 'supported') {\n throw new Error(`${resolved.definition.label} 敬请期待——\\`${command}\\` 尚未在该平台开放。`)\n }\n if (!resolved.definition.commands.includes(command)) {\n throw new Error(`${resolved.definition.label} 不承接命令 \\`${command}\\`。`)\n }\n return resolved\n}\n\n/** dta 层的平台命令/角色(deploy、boot、ops…)关联到该平台内确切的 Skill 名。 */\nexport function platformSkillForRole(platformName: string, role: string): string | null {\n const definition = agentPlatformDefinition(platformName)\n return definition?.skills.find((item) => item.role === role)?.name || null\n}\n\nconst PLATFORM_DIRS: Record<string, string> = {\n 'multica-dingtalk': 'skills/platforms/multica-dingtalk',\n deap: 'skills/platforms/deap',\n}\n\n/** 平台说明文档(PLATFORM.md)在包内的路径;切换到该平台时应加载让维护者/Agent 知道各技能用途。 */\nexport function platformDocPath(packageRoot: string, platformName: string): string | null {\n const dir = PLATFORM_DIRS[platformName]\n if (!dir) return null\n const path = join(packageRoot, dir, 'PLATFORM.md')\n return existsSync(path) ? path : null\n}\n\nexport function readPlatformDoc(packageRoot: string, platformName: string): string {\n const path = platformDocPath(packageRoot, platformName)\n return path ? readFileSync(path, 'utf8') : ''\n}\n\nexport function statusLabel(status: AgentPlatformStatus): string {\n return status === 'supported' ? '已支持' : '敬请期待'\n}\n\nexport type EndpointSource = 'env' | 'project-config' | 'profile' | 'suggested' | 'ambiguous' | 'none'\n\nexport interface EndpointResolution {\n endpoint: string\n source: EndpointSource\n // confirmed=true 仅当来自真实来源(env / 项目 config / 恰好一个已登录 profile);\n // suggested(预发建议)与 ambiguous(多目标未选)均为 false —— 发布前仍需用户显式确认,不得据此直连。\n confirmed: boolean\n envVar: string\n candidates: string[]\n}\n\n/**\n * 解析平台 endpoint,与真实执行体(multica_ext.py 读 MULTICA_SERVER_URL/--profile)同源,\n * 不新造命名空间、不静默默认连预发。顺序:\n * MULTICA_SERVER_URL 环境变量 > 项目 config(dingtalk-agent.json#multicaEndpoint /\n * .dingtalk-agent/agent-platform.json.endpoint)> 恰好一个已登录 profile 的 server_url\n * (多个则 ambiguous,不自动挑)> suggestedEndpoint(仅建议,未确认)。\n */\nexport function resolveEndpoint(\n platformName: string, start = process.cwd(),\n env: NodeJS.ProcessEnv = process.env, home = homedir(),\n): EndpointResolution {\n const definition = agentPlatformDefinition(platformName)\n const envVar = definition?.endpointEnv || 'MULTICA_SERVER_URL'\n const base: Omit<EndpointResolution, 'endpoint' | 'source' | 'confirmed'> = { envVar, candidates: [] }\n\n const fromEnv = String(env[envVar] || '').trim()\n if (fromEnv) return { endpoint: fromEnv, source: 'env', confirmed: true, ...base }\n\n const fromConfig = projectEndpoint(start)\n if (fromConfig) return { endpoint: fromConfig, source: 'project-config', confirmed: true, ...base }\n\n const serverUrls = [...new Set(multicaTargets(home)\n .map((target) => target.serverUrl.trim()).filter(Boolean))]\n if (serverUrls.length === 1) {\n return { endpoint: serverUrls[0], source: 'profile', confirmed: true, ...base }\n }\n if (serverUrls.length > 1) {\n return { endpoint: '', source: 'ambiguous', confirmed: false, ...base, candidates: serverUrls }\n }\n\n if (definition?.suggestedEndpoint) {\n return { endpoint: definition.suggestedEndpoint, source: 'suggested', confirmed: false, ...base }\n }\n return { endpoint: '', source: 'none', confirmed: false, ...base }\n}\n\nfunction projectEndpoint(start: string): string {\n const projectRoot = findAgentProjectRoot(start)\n if (!projectRoot) return ''\n const manifest = readJsonOrNull(join(projectRoot, PROJECT_FILE))\n const fromManifest = typeof manifest?.multicaEndpoint === 'string' ? manifest.multicaEndpoint.trim() : ''\n if (fromManifest) return fromManifest\n const platform = readJsonOrNull(join(projectRoot, AGENT_PLATFORM_FILE))\n return typeof platform?.endpoint === 'string' ? platform.endpoint.trim() : ''\n}\n\nexport interface AgentPlatformReadinessCheck {\n id: string\n ok: boolean\n summary: string\n hint?: string\n}\n\n/**\n * 平台工具链就绪检查(只读,不阻断):选择/查看平台归属时提示用户缺什么、怎么补。\n * 强制门禁仍由 requireSupportedAgentPlatform 与各平台命令自身承担。\n */\nexport function agentPlatformReadiness(\n name: string, env: NodeJS.ProcessEnv = process.env, home = homedir(),\n start: string = process.cwd(),\n): AgentPlatformReadinessCheck[] {\n if (name !== 'multica-dingtalk') return []\n const checks: AgentPlatformReadinessCheck[] = []\n const cli = findExecutable('multica', env)\n checks.push(cli\n ? { id: 'multica-cli', ok: true, summary: `multica CLI 已安装(${cli})` }\n : {\n id: 'multica-cli', ok: false, summary: '未找到 multica CLI',\n hint: '安装:curl -fsSL https://raw.githubusercontent.com/multica-ai/multica/main/scripts/install.sh | bash',\n })\n const ep = resolveEndpoint(name, start, env, home)\n const loginTarget = ep.endpoint || '<endpoint>'\n const suffix = ep.confirmed ? '' : '(未确认,请核对是预发还是生产)'\n checks.push(hasMulticaToken(home)\n ? { id: 'multica-login', ok: true, summary: 'Multica 已登录(本地存在 token)' }\n : {\n id: 'multica-login', ok: false, summary: 'Multica 尚未登录',\n hint: `登录:multica login --server-url ${loginTarget} --token <你的 mul_ PAT>` +\n `(endpoint 来源 ${ep.source}${suffix};用 MULTICA_SERVER_URL 或登录别的 profile 可切换)`,\n })\n if (['HTTPS_PROXY', 'https_proxy', 'ALL_PROXY', 'all_proxy'].some((key) => env[key])) {\n checks.push({\n id: 'proxy-env', ok: false, summary: '检测到代理环境变量,可能阻断 Multica 直连',\n hint: '连接失败时用 env -u HTTPS_PROXY -u https_proxy -u ALL_PROXY -u all_proxy 运行 multica 与平台脚本',\n })\n }\n return checks\n}\n\nexport interface MulticaTarget {\n profile: string\n serverUrl: string\n workspaceId: string\n}\n\n/**\n * 本机已登录的 Multica 目标清单(default 配置 + 各 profile)。只暴露 endpoint 与\n * workspace 标识,不读取 token 内容。发布前必须把候选交给用户选择,绝不默默用默认配置。\n */\nexport function multicaTargets(home = homedir()): MulticaTarget[] {\n const targets: MulticaTarget[] = []\n const push = (profile: string, path: string) => {\n const config = readJsonOrNull(path)\n if (typeof config?.token === 'string' && config.token.trim()) {\n targets.push({\n profile,\n serverUrl: String(config.server_url || ''),\n workspaceId: String(config.workspace_id || ''),\n })\n }\n }\n push('default', join(home, '.multica', 'config.json'))\n try {\n for (const entry of readdirSync(join(home, '.multica', 'profiles'))) {\n push(entry, join(home, '.multica', 'profiles', entry, 'config.json'))\n }\n } catch { /* profiles 目录不存在 */ }\n return targets\n}\n\nfunction hasMulticaToken(home: string): boolean {\n const candidates = [join(home, '.multica', 'config.json')]\n try {\n for (const entry of readdirSync(join(home, '.multica', 'profiles'))) {\n candidates.push(join(home, '.multica', 'profiles', entry, 'config.json'))\n }\n } catch { /* profiles 目录不存在 */ }\n return candidates.some((path) => {\n const config = readJsonOrNull(path)\n return typeof config?.token === 'string' && config.token.trim().length > 0\n })\n}\n\nfunction resolution(\n name: string | null, source: AgentPlatformSource, file: string,\n): AgentPlatformResolution {\n return {\n $schema: 'dingtalk-agent/agent-platform-resolution@1',\n platform: name,\n source,\n file,\n definition: name ? agentPlatformDefinition(name) : null,\n platforms: MANAGED_AGENT_PLATFORMS,\n }\n}\n\nfunction readJsonOrNull(path: string): any {\n try { return JSON.parse(readFileSync(path, 'utf8')) } catch { return null }\n}\n\nfunction findUp(start: string, relativePath: string): string | null {\n let dir = resolve(start)\n while (true) {\n const candidate = join(dir, relativePath)\n if (existsSync(candidate) && !lstatSync(candidate).isSymbolicLink()) return candidate\n const parent = dirname(dir)\n if (parent === dir || dir === parse(dir).root) return null\n dir = parent\n }\n}\n"]}
|
|
@@ -240,7 +240,7 @@ function validateProjectManifest(value, root) {
|
|
|
240
240
|
function validateDeclaredWorkspace(value, root, name) {
|
|
241
241
|
const input = objectValue(value, `Workspace ${name}`);
|
|
242
242
|
assertAllowedKeys(input, WORKSPACE_KEYS, `Workspace ${name}`);
|
|
243
|
-
for (const required of ['stage', 'provider'
|
|
243
|
+
for (const required of ['stage', 'provider']) {
|
|
244
244
|
if (!(required in input))
|
|
245
245
|
throw new Error(`Workspace ${name} 缺少字段: ${required}`);
|
|
246
246
|
}
|
|
@@ -275,10 +275,20 @@ function validateDeclaredWorkspace(value, root, name) {
|
|
|
275
275
|
else {
|
|
276
276
|
throw new Error(`Workspace ${name}.provider.kind 只支持 opencode / multica`);
|
|
277
277
|
}
|
|
278
|
-
const storageInput =
|
|
278
|
+
const storageInput = input.storage === undefined
|
|
279
|
+
? {} : objectValue(input.storage, `Workspace ${name}.storage`);
|
|
279
280
|
assertAllowedKeys(storageInput, STORAGE_KEYS, `Workspace ${name}.storage`);
|
|
280
|
-
|
|
281
|
-
|
|
281
|
+
if (provider.kind === 'opencode') {
|
|
282
|
+
for (const required of ['memory', 'knowledge']) {
|
|
283
|
+
if (!(required in storageInput)) {
|
|
284
|
+
throw new Error(`Workspace ${name}.storage 缺少字段: ${required}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const memory = storageInput.memory === undefined ? undefined
|
|
289
|
+
: storageRoute(storageInput.memory, ['local-md', 'dingtalk-doc'], `${name}.memory`, root);
|
|
290
|
+
const knowledge = storageInput.knowledge === undefined ? undefined
|
|
291
|
+
: storageRoute(storageInput.knowledge, ['local-md', 'dingtalk-doc'], `${name}.knowledge`, root);
|
|
282
292
|
const artifacts = storageInput.artifacts === undefined ? undefined
|
|
283
293
|
: storageRoute(storageInput.artifacts, ['local-dir'], `${name}.artifacts`, root);
|
|
284
294
|
let authority;
|
|
@@ -293,13 +303,20 @@ function validateDeclaredWorkspace(value, root, name) {
|
|
|
293
303
|
if (provider.kind === 'multica' && !authority) {
|
|
294
304
|
throw new Error(`Workspace ${name} 的 multica Provider 必须声明 authority env 来源`);
|
|
295
305
|
}
|
|
296
|
-
return { stage, provider, storage: {
|
|
306
|
+
return { stage, provider, storage: {
|
|
307
|
+
...(memory ? { memory } : {}),
|
|
308
|
+
...(knowledge ? { knowledge } : {}),
|
|
309
|
+
...(artifacts ? { artifacts } : {}),
|
|
310
|
+
},
|
|
297
311
|
...(authority ? { authority } : {}) };
|
|
298
312
|
}
|
|
299
313
|
function declaredView(loaded, name, workspace, currentWorkspace) {
|
|
300
|
-
const artifacts = workspace.storage.artifacts ||
|
|
301
|
-
`local-dir:.dingtalk-agent/artifacts/${name}
|
|
302
|
-
const storage = {
|
|
314
|
+
const artifacts = workspace.storage.artifacts || (workspace.provider.kind === 'opencode'
|
|
315
|
+
? `local-dir:.dingtalk-agent/artifacts/${name}` : undefined);
|
|
316
|
+
const storage = {
|
|
317
|
+
...workspace.storage,
|
|
318
|
+
...(artifacts ? { artifacts } : {}),
|
|
319
|
+
};
|
|
303
320
|
const sourceHash = projectSourceHash(loaded.root, loaded.manifest);
|
|
304
321
|
const desiredHash = digest(stableStringify({
|
|
305
322
|
project: loaded.manifest.name,
|