@clawos-dev/clawd 0.2.494 → 0.2.496
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.
|
@@ -21409,7 +21409,14 @@ var DeployRepoSchema = external_exports.object({
|
|
|
21409
21409
|
url: external_exports.string().min(1),
|
|
21410
21410
|
branch: external_exports.string().min(1),
|
|
21411
21411
|
head: external_exports.string().min(1),
|
|
21412
|
-
/**
|
|
21412
|
+
/**
|
|
21413
|
+
* persona 的**内容**有没有未提交的改动。
|
|
21414
|
+
*
|
|
21415
|
+
* **`.clawd/deploy.json` 不算**(daemon 侧 `repoInfo` 把它排出了 pathspec):那个文件是
|
|
21416
|
+
* 对 persona 的**断言**——扫描在写、页面上编辑清单也在写。算进来的话每扫一次就把自己
|
|
21417
|
+
* 弄脏一次,`isScanFresh` 永远为假、发布再也点不亮。排除的只有这一个文件,
|
|
21418
|
+
* `.clawd/` 下别的(persona.json 等)照旧算。
|
|
21419
|
+
*/
|
|
21413
21420
|
dirty: external_exports.boolean(),
|
|
21414
21421
|
/** 本地领先远端几个提交 */
|
|
21415
21422
|
ahead: external_exports.number()
|
package/dist/cli.cjs
CHANGED
|
@@ -6104,7 +6104,14 @@ var init_deploy_schemas = __esm({
|
|
|
6104
6104
|
url: external_exports.string().min(1),
|
|
6105
6105
|
branch: external_exports.string().min(1),
|
|
6106
6106
|
head: external_exports.string().min(1),
|
|
6107
|
-
/**
|
|
6107
|
+
/**
|
|
6108
|
+
* persona 的**内容**有没有未提交的改动。
|
|
6109
|
+
*
|
|
6110
|
+
* **`.clawd/deploy.json` 不算**(daemon 侧 `repoInfo` 把它排出了 pathspec):那个文件是
|
|
6111
|
+
* 对 persona 的**断言**——扫描在写、页面上编辑清单也在写。算进来的话每扫一次就把自己
|
|
6112
|
+
* 弄脏一次,`isScanFresh` 永远为假、发布再也点不亮。排除的只有这一个文件,
|
|
6113
|
+
* `.clawd/` 下别的(persona.json 等)照旧算。
|
|
6114
|
+
*/
|
|
6108
6115
|
dirty: external_exports.boolean(),
|
|
6109
6116
|
/** 本地领先远端几个提交 */
|
|
6110
6117
|
ahead: external_exports.number()
|
|
@@ -55330,6 +55337,7 @@ var L = [
|
|
|
55330
55337
|
var WORKFLOW_TEMPLATE = L.join("\n");
|
|
55331
55338
|
|
|
55332
55339
|
// src/deploy/repo.ts
|
|
55340
|
+
var DEPLOY_FILE_REL = DEPLOY_FILE.split(import_node_path32.default.sep).join("/");
|
|
55333
55341
|
var DEFAULT_TIMEOUT_MS3 = 6e4;
|
|
55334
55342
|
var runCommand = (cmd, args, opts = {}) => new Promise((resolve9) => {
|
|
55335
55343
|
const child = (0, import_node_child_process8.spawn)(cmd, args, {
|
|
@@ -55408,8 +55416,8 @@ async function repoInfo(exec, dir) {
|
|
|
55408
55416
|
const url = origin.stdout.trim();
|
|
55409
55417
|
const branch = (await git(exec, dir, ["rev-parse", "--abbrev-ref", "HEAD"])).stdout.trim() || "main";
|
|
55410
55418
|
const head = (await git(exec, dir, ["rev-parse", "HEAD"])).stdout.trim() || "(\u8FD8\u6CA1\u6709\u63D0\u4EA4)";
|
|
55411
|
-
const status = await git(exec, dir, ["status", "--porcelain"]);
|
|
55412
|
-
const dirty = status.stdout.trim().length > 0;
|
|
55419
|
+
const status = await git(exec, dir, ["status", "--porcelain", "--", ".", `:(exclude)${DEPLOY_FILE_REL}`]);
|
|
55420
|
+
const dirty = status.spawnError !== void 0 || status.code !== 0 || status.stdout.trim().length > 0;
|
|
55413
55421
|
const aheadRaw = await git(exec, dir, ["rev-list", "--count", "@{u}..HEAD"]);
|
|
55414
55422
|
const ahead = aheadRaw.code === 0 ? Number(aheadRaw.stdout.trim()) || 0 : 0;
|
|
55415
55423
|
return { url, branch, head, dirty, ahead };
|
|
@@ -55461,9 +55469,17 @@ async function ensureRepo(exec, args) {
|
|
|
55461
55469
|
}
|
|
55462
55470
|
throw new RepoError(`\u5EFA\u4ED3\u5E93\u6CA1\u6210\uFF08gh repo create \u9000\u51FA\u7801 ${r.code}\uFF09\uFF1A${err}`);
|
|
55463
55471
|
}
|
|
55472
|
+
await enableActions(exec, slug);
|
|
55464
55473
|
const info = await repoInfo(exec, dir);
|
|
55465
55474
|
return { created: true, url: info?.url ?? `https://github.com/${slug}` };
|
|
55466
55475
|
}
|
|
55476
|
+
async function enableActions(exec, slug) {
|
|
55477
|
+
await exec(
|
|
55478
|
+
"gh",
|
|
55479
|
+
["api", "--method", "PUT", `repos/${slug}/actions/permissions`, "-F", "enabled=true", "-f", "allowed_actions=all"],
|
|
55480
|
+
{ timeoutMs: 3e4 }
|
|
55481
|
+
);
|
|
55482
|
+
}
|
|
55467
55483
|
async function setSecret(exec, args) {
|
|
55468
55484
|
const info = await repoInfo(exec, args.dir);
|
|
55469
55485
|
if (!info) throw new RepoError("\u8FD8\u6CA1\u6709\u4ED3\u5E93\uFF0CSecrets \u6CA1\u5730\u65B9\u5199");
|
|
@@ -55513,6 +55529,7 @@ async function commitAndPush(exec, args) {
|
|
|
55513
55529
|
async function release(exec, args) {
|
|
55514
55530
|
const info = await repoInfo(exec, args.dir);
|
|
55515
55531
|
if (!info) throw new RepoError("\u8FD8\u6CA1\u6709\u4ED3\u5E93\uFF0C\u5148\u70B9\u4E00\u6B21\u300C\u53D1\u5E03\u5230\u4E91\u4E0A\u300D\u5EFA\u4ED3");
|
|
55532
|
+
await enableActions(exec, repoSlug(info.url));
|
|
55516
55533
|
await writeTemplates(args.dir);
|
|
55517
55534
|
const identity = await identityArgs(exec, args.dir);
|
|
55518
55535
|
await mustGit(exec, args.dir, ["add", "-A"], "\u6682\u5B58\u6587\u4EF6");
|
|
@@ -55777,7 +55794,6 @@ function buildDeployHandlers(deps) {
|
|
|
55777
55794
|
hasUsableManifest: prevManifest !== void 0 && current?.status === "done",
|
|
55778
55795
|
releasedHead: await hasCommit(deps.exec, dir, current?.releasedHead) ? current?.releasedHead : void 0
|
|
55779
55796
|
});
|
|
55780
|
-
if (scanBase.kind === "hard") await writeDeployFile(dir, emptyDeployFile());
|
|
55781
55797
|
const startedAt = deps.now();
|
|
55782
55798
|
const base = {
|
|
55783
55799
|
evidence: scanBase.kind === "hard" ? [] : current?.evidence ?? [],
|
|
@@ -55797,6 +55813,7 @@ function buildDeployHandlers(deps) {
|
|
|
55797
55813
|
...scanBase.base ? { base: scanBase.base } : {}
|
|
55798
55814
|
};
|
|
55799
55815
|
await writeScan(dir, { status: "scanning", ...base });
|
|
55816
|
+
if (scanBase.kind === "hard") await writeDeployFile(dir, emptyDeployFile());
|
|
55800
55817
|
const started = deps.startScan(personaId2, scanBase);
|
|
55801
55818
|
if ("sessionId" in started) {
|
|
55802
55819
|
await writeScan(dir, { status: "scanning", scanSessionId: started.sessionId, ...base });
|
|
@@ -65603,7 +65620,7 @@ function computeMethodAccess(args) {
|
|
|
65603
65620
|
}
|
|
65604
65621
|
|
|
65605
65622
|
// src/version.ts
|
|
65606
|
-
var version = "0.2.
|
|
65623
|
+
var version = "0.2.496".length > 0 ? "0.2.496" : "dev";
|
|
65607
65624
|
|
|
65608
65625
|
// src/cli-probe/probe.ts
|
|
65609
65626
|
var fs72 = __toESM(require("fs"), 1);
|
|
@@ -21402,7 +21402,14 @@ var DeployRepoSchema = external_exports.object({
|
|
|
21402
21402
|
url: external_exports.string().min(1),
|
|
21403
21403
|
branch: external_exports.string().min(1),
|
|
21404
21404
|
head: external_exports.string().min(1),
|
|
21405
|
-
/**
|
|
21405
|
+
/**
|
|
21406
|
+
* persona 的**内容**有没有未提交的改动。
|
|
21407
|
+
*
|
|
21408
|
+
* **`.clawd/deploy.json` 不算**(daemon 侧 `repoInfo` 把它排出了 pathspec):那个文件是
|
|
21409
|
+
* 对 persona 的**断言**——扫描在写、页面上编辑清单也在写。算进来的话每扫一次就把自己
|
|
21410
|
+
* 弄脏一次,`isScanFresh` 永远为假、发布再也点不亮。排除的只有这一个文件,
|
|
21411
|
+
* `.clawd/` 下别的(persona.json 等)照旧算。
|
|
21412
|
+
*/
|
|
21406
21413
|
dirty: external_exports.boolean(),
|
|
21407
21414
|
/** 本地领先远端几个提交 */
|
|
21408
21415
|
ahead: external_exports.number()
|