@clawos-dev/clawd 0.2.630 → 0.2.631
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/dist/cli.cjs +52 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -61953,6 +61953,56 @@ function lookupDebianPackage(fetchFn = fetch) {
|
|
|
61953
61953
|
// src/handlers/deploy.ts
|
|
61954
61954
|
init_protocol();
|
|
61955
61955
|
|
|
61956
|
+
// src/deploy/publishing-config.ts
|
|
61957
|
+
async function requireIntegrationPublishingConfig(api, slug) {
|
|
61958
|
+
const base = `/repos/${slug}`;
|
|
61959
|
+
async function rows(path107, field, absentEnvironment = false) {
|
|
61960
|
+
const result = [];
|
|
61961
|
+
for (let page = 1; page <= 30; page++) {
|
|
61962
|
+
let raw;
|
|
61963
|
+
try {
|
|
61964
|
+
raw = await api.getJsonStrict(`${path107}?per_page=100&page=${page}`);
|
|
61965
|
+
} catch (error) {
|
|
61966
|
+
if (absentEnvironment && page === 1 && error instanceof GithubApiError && error.status === 404) return [];
|
|
61967
|
+
throw error;
|
|
61968
|
+
}
|
|
61969
|
+
const data = raw;
|
|
61970
|
+
const list = data?.[field];
|
|
61971
|
+
if (!Array.isArray(list) || list.some((r2) => !r2 || typeof r2.name !== "string" || field === "variables" && typeof r2.value !== "string")) {
|
|
61972
|
+
throw new Error("\u65E0\u6CD5\u5B8C\u6574\u8BFB\u53D6\u516C\u5171\u6D4B\u8BD5\u53D1\u5E03\u914D\u7F6E\u540D\u5355\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
61973
|
+
}
|
|
61974
|
+
result.push(...list);
|
|
61975
|
+
if (list.length < 100 && (data?.total_count === void 0 || result.length >= data.total_count)) return result;
|
|
61976
|
+
}
|
|
61977
|
+
throw new Error("\u516C\u5171\u6D4B\u8BD5\u53D1\u5E03\u914D\u7F6E\u540D\u5355\u672A\u5B8C\u6574\u8BFB\u5230\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
61978
|
+
}
|
|
61979
|
+
const [orgVars, repoVars, envVars, orgSecrets, repoSecrets, envSecrets] = await Promise.all([
|
|
61980
|
+
rows(`${base}/actions/organization-variables`, "variables"),
|
|
61981
|
+
rows(`${base}/actions/variables`, "variables"),
|
|
61982
|
+
rows(`${base}/environments/integration/variables`, "variables", true),
|
|
61983
|
+
rows(`${base}/actions/organization-secrets`, "secrets"),
|
|
61984
|
+
api.listSecrets(slug),
|
|
61985
|
+
api.listSecrets(slug, "integration")
|
|
61986
|
+
]);
|
|
61987
|
+
const variables = new Map([...orgVars, ...repoVars, ...envVars].map((v3) => [v3.name, v3.value]));
|
|
61988
|
+
const inheritedSecrets = orgSecrets.map((s2) => s2.name).sort().slice(0, 100);
|
|
61989
|
+
const secrets = /* @__PURE__ */ new Set([...inheritedSecrets, ...repoSecrets.map((s2) => s2.env), ...envSecrets.map((s2) => s2.env)]);
|
|
61990
|
+
const missing = [];
|
|
61991
|
+
const endpoint = variables.get("CLAWD_INT_GATEWAY_URL");
|
|
61992
|
+
if (!endpoint?.trim()) missing.push("\u6D4B\u8BD5\u7F51\u5173\u5730\u5740\uFF08CLAWD_INT_GATEWAY_URL\uFF09");
|
|
61993
|
+
if (!secrets.has("CLAWD_INT_GATEWAY_ADMIN_KEY")) missing.push("\u6D4B\u8BD5\u7F51\u5173\u7BA1\u7406\u51ED\u636E\uFF08CLAWD_INT_GATEWAY_ADMIN_KEY\uFF09");
|
|
61994
|
+
if (missing.length) throw new Error(`\u516C\u5171\u6D4B\u8BD5\u53D1\u5E03\u914D\u7F6E\u7F3A\u5C11\uFF1A${missing.join("\u3001")}\u3002\u8BF7\u7531\u7EC4\u7EC7\u7BA1\u7406\u5458\u7EDF\u4E00\u914D\u7F6E\u5E76\u5F00\u653E\u7ED9\u6B64\u4ED3\u5E93\uFF0C\u65E0\u9700\u6BCF\u4E2A Persona \u5355\u72EC\u586B\u5199\u3002`);
|
|
61995
|
+
let url;
|
|
61996
|
+
try {
|
|
61997
|
+
url = new URL(endpoint);
|
|
61998
|
+
} catch {
|
|
61999
|
+
throw new Error("\u516C\u5171\u6D4B\u8BD5\u53D1\u5E03\u914D\u7F6E\u4E2D\u7684\u7F51\u5173\u5730\u5740\u65E0\u6548\uFF0C\u8BF7\u7531\u7EC4\u7EC7\u7BA1\u7406\u5458\u68C0\u67E5");
|
|
62000
|
+
}
|
|
62001
|
+
if (url.origin !== DEPLOY_TARGETS.integration.gateway || url.username || url.password || url.search || url.hash || url.pathname !== "/") {
|
|
62002
|
+
throw new Error("\u516C\u5171\u6D4B\u8BD5\u53D1\u5E03\u914D\u7F6E\u4E2D\u7684\u7F51\u5173\u5730\u5740\u4E0D\u662F\u5E73\u53F0\u6D4B\u8BD5\u73AF\u5883\uFF0C\u8BF7\u68C0\u67E5\u4ED3\u5E93\u6216\u73AF\u5883\u4E2D\u7684\u540C\u540D\u8986\u76D6\u914D\u7F6E");
|
|
62003
|
+
}
|
|
62004
|
+
}
|
|
62005
|
+
|
|
61956
62006
|
// src/deploy/scan-base.ts
|
|
61957
62007
|
function pickScanBase(args) {
|
|
61958
62008
|
if (args.want === "hard") return { kind: "hard" };
|
|
@@ -62676,6 +62726,7 @@ function buildDeployHandlers(deps) {
|
|
|
62676
62726
|
return view(personaId2);
|
|
62677
62727
|
};
|
|
62678
62728
|
const configureTestIdentity = async (api, slug) => {
|
|
62729
|
+
await requireIntegrationPublishingConfig(api, slug);
|
|
62679
62730
|
await api.putSecret(slug, "CLAWD_INT_TEST_LOGIN_PASS", await deps.testLoginPass(), "integration");
|
|
62680
62731
|
};
|
|
62681
62732
|
const releaseHandler = async (frame, _client, ctx) => {
|
|
@@ -73600,7 +73651,7 @@ function computeMethodAccess(args) {
|
|
|
73600
73651
|
}
|
|
73601
73652
|
|
|
73602
73653
|
// src/version.ts
|
|
73603
|
-
var version = "0.2.
|
|
73654
|
+
var version = "0.2.631".length > 0 ? "0.2.631" : "dev";
|
|
73604
73655
|
|
|
73605
73656
|
// src/cli-probe/probe.ts
|
|
73606
73657
|
var fs84 = __toESM(require("fs"), 1);
|