@clawos-dev/clawd 0.2.516 → 0.2.517
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.
|
@@ -21264,7 +21264,6 @@ var import_node_fs3 = require("fs");
|
|
|
21264
21264
|
var import_node_path5 = require("path");
|
|
21265
21265
|
|
|
21266
21266
|
// src/deploy/repo.ts
|
|
21267
|
-
var import_node_child_process2 = require("child_process");
|
|
21268
21267
|
var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
21269
21268
|
var import_node_path4 = __toESM(require("path"), 1);
|
|
21270
21269
|
|
|
@@ -21583,6 +21582,12 @@ var DeployRepoSchema = external_exports.object({
|
|
|
21583
21582
|
/** 本地领先远端几个提交 */
|
|
21584
21583
|
ahead: external_exports.number()
|
|
21585
21584
|
}).strict();
|
|
21585
|
+
var DeployGithubStatusSchema = external_exports.discriminatedUnion("status", [
|
|
21586
|
+
external_exports.object({ status: external_exports.literal("authorized"), login: external_exports.string().min(1), source: external_exports.enum(["git", "file"]) }).strict(),
|
|
21587
|
+
external_exports.object({ status: external_exports.literal("missing") }).strict(),
|
|
21588
|
+
external_exports.object({ status: external_exports.literal("invalid"), message: external_exports.string().min(1) }).strict(),
|
|
21589
|
+
external_exports.object({ status: external_exports.literal("pending"), authUrl: external_exports.string().url() }).strict()
|
|
21590
|
+
]);
|
|
21586
21591
|
var DeploySecretPresenceSchema = external_exports.object({
|
|
21587
21592
|
env: external_exports.string().min(1),
|
|
21588
21593
|
setAt: external_exports.number().optional()
|
|
@@ -21612,13 +21617,15 @@ var DeployRunSchema = external_exports.object({
|
|
|
21612
21617
|
}).strict();
|
|
21613
21618
|
var DeployStateSchema = external_exports.object({
|
|
21614
21619
|
personaId: external_exports.string().min(1),
|
|
21620
|
+
/** 本机 GitHub 身份。daemon 每次现算;老 daemon 不给(可选只为兼容),UI 缺席时按未知处理 */
|
|
21621
|
+
github: DeployGithubStatusSchema.optional(),
|
|
21615
21622
|
repo: DeployRepoSchema.optional(),
|
|
21616
21623
|
file: DeployFileSchema.optional(),
|
|
21617
21624
|
scan: DeployScanSchema.optional(),
|
|
21618
21625
|
/** 没仓库时缺席(查不了) */
|
|
21619
21626
|
secrets: external_exports.array(DeploySecretPresenceSchema).optional(),
|
|
21620
21627
|
/**
|
|
21621
|
-
*
|
|
21628
|
+
* 最新那次流水线走到哪了。**缺席是常态**:没推过、没授权 GitHub、GitHub 查不到、仓库还没有 run,
|
|
21622
21629
|
* 都不该让整页打不开——同 `secrets` 的处理。
|
|
21623
21630
|
*/
|
|
21624
21631
|
run: DeployRunSchema.optional(),
|
|
@@ -21656,6 +21663,14 @@ var DeployPutSecretArgsSchema = external_exports.object({
|
|
|
21656
21663
|
// 环境变量名 → 值。key 必须是该 secret 声明过的 env 之一,handler 校验。
|
|
21657
21664
|
values: external_exports.record(external_exports.string(), external_exports.string())
|
|
21658
21665
|
}).strict();
|
|
21666
|
+
var DeployGithubAuthorizeArgsSchema = external_exports.object({
|
|
21667
|
+
personaId: external_exports.string().min(1),
|
|
21668
|
+
token: external_exports.string().min(1)
|
|
21669
|
+
}).strict();
|
|
21670
|
+
var DeployGithubOauthStartArgsSchema = external_exports.object({
|
|
21671
|
+
personaId: external_exports.string().min(1),
|
|
21672
|
+
returnTo: external_exports.string().url().optional()
|
|
21673
|
+
}).strict();
|
|
21659
21674
|
var DeployRerunJobArgsSchema = external_exports.object({
|
|
21660
21675
|
personaId: external_exports.string().min(1),
|
|
21661
21676
|
/** GitHub 的 job databaseId。**是数字**——字符串会在拼命令时静默出错 */
|
|
@@ -24023,7 +24038,7 @@ var METHOD_DOCS = {
|
|
|
24023
24038
|
},
|
|
24024
24039
|
// ---- deploy:*(persona 上云:persona 目录 = git 仓库工作树,发布 = 推送触发仓库流水线)----
|
|
24025
24040
|
"deploy:start": {
|
|
24026
|
-
summary: "\u5BF9\u67D0\u4E2A persona \u8D77\u4E00\u6B21\u4E0A\u4E91\u626B\u63CF\u3002**\u6CA1\u4ED3\u5E93\u5148\u5EFA\u4ED3**\
|
|
24041
|
+
summary: "\u5BF9\u67D0\u4E2A persona \u8D77\u4E00\u6B21\u4E0A\u4E91\u626B\u63CF\u3002**\u6CA1\u4ED3\u5E93\u5148\u5EFA\u4ED3**\uFF08GitHub REST \u5EFA\u5728\u7EC4\u7EC7\u4E0B\u3001\u79C1\u6709\uFF0Cgit \u63A8\u9996\u4E2A\u63D0\u4EA4\uFF1Btoken \u6765\u81EA\u672C\u673A git \u7684\u8EAB\u4EFD\uFF0C\u6CA1\u6388\u6743\u5148\u62D2\uFF09\uFF0C\u518D\u8D77 persona-butler \u7684\u626B\u63CF\u4F1A\u8BDD\uFF0C\u7ED3\u679C\u5199\u8FDB persona \u76EE\u5F55\u7684 .clawd/deploy.json \uFF08\u73AF\u5883\u6E05\u5355\uFF0C\u8FDB\u4ED3\u5E93\uFF09\u4E0E .clawd/deploy-scan.json\uFF08\u8BC1\u636E\uFF0C\u4E0D\u8FDB\u4ED3\u5E93\uFF09\u3002\u5DF2\u7ECF\u5728\u626B\u7684\u8BDD\u539F\u6837\u8FD4\u56DE\u3001\u4E0D\u8D77\u7B2C\u4E8C\u4E2A\u626B\u63CF\u4F1A\u8BDD\uFF1Bowner-only",
|
|
24027
24042
|
args: DeployPersonaArgsSchema
|
|
24028
24043
|
},
|
|
24029
24044
|
"deploy:get": {
|
|
@@ -24035,7 +24050,7 @@ var METHOD_DOCS = {
|
|
|
24035
24050
|
args: DeployPatchArgsSchema
|
|
24036
24051
|
},
|
|
24037
24052
|
"deploy:putSecret": {
|
|
24038
|
-
summary: "\u628A\u4E00\u6761\u51ED\u636E\u7684\u503C\u5199\u8FDB\u4ED3\u5E93\u7684 GitHub Secrets\
|
|
24053
|
+
summary: "\u628A\u4E00\u6761\u51ED\u636E\u7684\u503C\u5199\u8FDB\u4ED3\u5E93\u7684 GitHub Secrets\uFF08GitHub REST\uFF0C\u503C\u7528\u4ED3\u5E93\u516C\u94A5\u5C01\u7BB1\u540E\u4E0A\u4F20\uFF09\u3002**\u8FD9\u662F\u503C\u552F\u4E00\u7684\u5165\u53E3**\uFF1A\u5165\u53C2\u4E0D\u8FDB\u65E5\u5FD7\u3001\u54CD\u5E94\u4E0D\u56DE\u663E\u503C\u3001\u672C\u673A\u4E0D\u843D\u76D8\u3002env \u540D\u5FC5\u987B\u662F\u8BE5\u51ED\u636E\u5728\u6E05\u5355\u91CC\u58F0\u660E\u8FC7\u7684\uFF1Bowner-only",
|
|
24039
24054
|
args: DeployPutSecretArgsSchema
|
|
24040
24055
|
},
|
|
24041
24056
|
"deploy:reportFinding": {
|
|
@@ -24051,9 +24066,17 @@ var METHOD_DOCS = {
|
|
|
24051
24066
|
args: DeployPersonaArgsSchema
|
|
24052
24067
|
},
|
|
24053
24068
|
"deploy:rerunJob": {
|
|
24054
|
-
summary: "\u539F\u6837\u91CD\u8DD1\u6700\u65B0\u90A3\u6761\u6D41\u6C34\u7EBF\u91CC\u5931\u8D25\u7684\u67D0\u4E00\u6BB5\
|
|
24069
|
+
summary: "\u539F\u6837\u91CD\u8DD1\u6700\u65B0\u90A3\u6761\u6D41\u6C34\u7EBF\u91CC\u5931\u8D25\u7684\u67D0\u4E00\u6BB5\uFF08GitHub REST rerun job\uFF09\u3002**\u540C\u4E00\u4E2A commit\u3001\u540C\u4E00\u4EFD\u8F93\u5165**\uFF0C\u4E0D\u4EA7\u751F\u65B0\u63D0\u4EA4\u2014\u2014\u6539\u4E86 persona \u5185\u5BB9\u6216\u51ED\u636E\u8981\u8D70 deploy:release\u3002jobId \u5FC5\u987B\u5C5E\u4E8E\u6700\u65B0\u90A3\u6761 run\uFF1Bowner-only",
|
|
24055
24070
|
args: DeployRerunJobArgsSchema
|
|
24056
24071
|
},
|
|
24072
|
+
"deploy:githubAuthorize": {
|
|
24073
|
+
summary: "\u628A\u7528\u6237\u7C98\u7684 GitHub token \u5B58\u6210\u672C\u673A git \u7684\u8EAB\u4EFD\uFF1A\u5148 GET /user \u9A8C\u8BC1\uFF0C\u518D git credential approve \u4EA4\u7ED9 git \u7684 helper \u5B58\uFF08git \u6CA1\u914D helper \u65F6\u9000\u5230\u672C\u673A\u51ED\u636E\u8868\uFF09\u3002\u4E0A\u4E91\u7684\u5EFA\u4ED3 / \u63A8\u9001 / \u5199 Secrets / \u67E5\u6D41\u6C34\u7EBF\u90FD\u7528\u5B83\u3002\u5165\u53C2\u4E0D\u8FDB\u65E5\u5FD7\u3001\u54CD\u5E94\u4E0D\u56DE\u663E token\uFF1Bowner-only",
|
|
24074
|
+
args: DeployGithubAuthorizeArgsSchema
|
|
24075
|
+
},
|
|
24076
|
+
"deploy:githubOauthStart": {
|
|
24077
|
+
summary: "\u4E0A\u4E91\u9875\u300C\u7528 GitHub \u6388\u6743\u300D\uFF1Adaemon \u5E26\u672C\u673A\u767B\u5F55\u51ED\u8BC1\u5411\u4E2D\u5FC3\u8981\u4E00\u6761 GitHub OAuth \u6388\u6743\u94FE\u63A5\u5E76\u56DE\u5728 DeployState.github\uFF08pending\uFF09\u91CC\uFF0C\u9875\u9762\u6253\u5F00\u5B83\uFF1B\u7528\u6237\u5728 GitHub \u70B9\u540C\u610F\u540E\u56DE\u8DF3\u4E2D\u5FC3\uFF0C\u4E2D\u5FC3\u6362\u597D token \u5B58\u4E00\u4EFD\uFF0Cdaemon \u5728\u4E4B\u540E\u7684 deploy:get \u91CC\u9886\u56DE\u6765\u5B58\u8FDB\u672C\u673A git\u3002\u4E2D\u5FC3\u5DF2\u6709\u672C\u4EBA\u7684 token \u65F6\u4E0D\u8DF3 GitHub\uFF0C\u76F4\u63A5\u9886\uFF1B\u8981\u767B\u5F55\u98DE\u4E66\uFF1Bowner-only",
|
|
24078
|
+
args: DeployGithubOauthStartArgsSchema
|
|
24079
|
+
},
|
|
24057
24080
|
// ---- cloud:connectors:*(云 persona 卡片上的连接器;design 2026-09-11-mcp-connector §3.8)----
|
|
24058
24081
|
"cloud:connectors:list": {
|
|
24059
24082
|
summary: "\u4E91\u4E0A persona \u5361\u7247\u4E0A\u7684\u8FDE\u63A5\u5668\u533A\uFF1A\u8FD9\u4E2A persona \u58F0\u660E\u7684\u3001**\u8981\u4F7F\u7528\u8005\u672C\u4EBA\u6388\u6743\u7684**\u8FDE\u63A5\u5668\u5404\u81EA\u8FDE\u6CA1\u8FDE\u4E0A\uFF08connected / missing / reauth\uFF09\u3001\u6309\u94AE\u662F\u5173\u8054\uFF08OAuth\uFF0C\u5E26\u73B0\u7B97\u7684 authUrl\uFF09\u8FD8\u662F\u7C98\u8D34 API key\uFF08\u5E26\u8981\u586B\u7684\u53D8\u91CF\uFF09\u3002daemon \u62FF gateway \u767B\u8BB0\u884C + \u672C\u673A\u767B\u5F55\u51ED\u8BC1\u5411\u4E2D\u5FC3\u4EE3\u67E5\uFF0C\u51ED\u8BC1\u4E0D\u51FA ws\uFF1Bowner-only",
|
|
@@ -24779,12 +24802,13 @@ var L = [
|
|
|
24779
24802
|
];
|
|
24780
24803
|
var WORKFLOW_TEMPLATE = L.join("\n");
|
|
24781
24804
|
|
|
24782
|
-
// src/deploy/
|
|
24783
|
-
var
|
|
24805
|
+
// src/deploy/exec.ts
|
|
24806
|
+
var import_node_child_process2 = require("child_process");
|
|
24784
24807
|
var DEFAULT_TIMEOUT_MS = 6e4;
|
|
24785
24808
|
var runCommand = (cmd, args, opts = {}) => new Promise((resolve) => {
|
|
24786
24809
|
const child = (0, import_node_child_process2.spawn)(cmd, args, {
|
|
24787
24810
|
cwd: opts.cwd,
|
|
24811
|
+
...opts.env ? { env: { ...process.env, ...opts.env } } : {},
|
|
24788
24812
|
stdio: [opts.stdin === void 0 ? "ignore" : "pipe", "pipe", "pipe"]
|
|
24789
24813
|
});
|
|
24790
24814
|
let stdout = "";
|
|
@@ -24815,6 +24839,9 @@ var runCommand = (cmd, args, opts = {}) => new Promise((resolve) => {
|
|
|
24815
24839
|
child.stdin.end(opts.stdin);
|
|
24816
24840
|
}
|
|
24817
24841
|
});
|
|
24842
|
+
|
|
24843
|
+
// src/deploy/repo.ts
|
|
24844
|
+
var DEPLOY_FILE_REL = DEPLOY_FILE.split(import_node_path4.default.sep).join("/");
|
|
24818
24845
|
async function git(exec, dir, args, opts) {
|
|
24819
24846
|
return exec("git", args, { cwd: dir, ...opts });
|
|
24820
24847
|
}
|