clawnify 0.22.0 → 0.22.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.
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveOrgContext,
|
|
23
23
|
saveAuth,
|
|
24
24
|
saveProject
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CMR2WSTR.js";
|
|
26
26
|
|
|
27
27
|
// src/cli.ts
|
|
28
28
|
import { Command, Option } from "commander";
|
|
@@ -1777,7 +1777,7 @@ function agentByName(name) {
|
|
|
1777
1777
|
var ALL_AGENTS = DETECTORS.map((d) => d.agent);
|
|
1778
1778
|
|
|
1779
1779
|
// src/lib/skills/content.gen.ts
|
|
1780
|
-
var CLI_VERSION = "0.22.
|
|
1780
|
+
var CLI_VERSION = "0.22.2";
|
|
1781
1781
|
var BUNDLED_SKILLS = [
|
|
1782
1782
|
{
|
|
1783
1783
|
name: "build-a-clawnify-app",
|
|
@@ -4430,18 +4430,22 @@ ${WORKSPACE_GUIDE}`);
|
|
|
4430
4430
|
console.log(`Org: ${data.org_id}`);
|
|
4431
4431
|
if (state.git) {
|
|
4432
4432
|
const git2 = state.git;
|
|
4433
|
-
console.log(`
|
|
4433
|
+
console.log(git2.copy_of ? `
|
|
4434
|
+
Workspace repo: Clawnify git, a copy of ${git2.copy_of} on GitHub` : `
|
|
4434
4435
|
Workspace repo: Clawnify git`);
|
|
4435
4436
|
console.log(` Clone: npx clawnify@latest workspace clone`);
|
|
4436
4437
|
console.log(` Remote: ${git2.url} (git signs in with your Clawnify login)`);
|
|
4437
4438
|
for (const f of git2.folders) console.log(` ${(f.subdir || "(root)").padEnd(28)} ${targetLabel(f.target)}`);
|
|
4439
|
+
if (git2.copy_of) {
|
|
4440
|
+
console.log(` The same history as https://github.com/${git2.copy_of}.git: pull and push through either.`);
|
|
4441
|
+
}
|
|
4438
4442
|
console.log(
|
|
4439
|
-
git2.can_push ? " You can push. A push rebuilds only the folders it changed." : " You can clone and pull. Pushing needs an owner or admin of the org."
|
|
4443
|
+
git2.can_push ? git2.copy_of ? " You can push. A push here goes to GitHub, and rebuilds only the folders it changed." : " You can push. A push rebuilds only the folders it changed." : " You can clone and pull. Pushing needs an owner or admin of the org."
|
|
4440
4444
|
);
|
|
4441
4445
|
console.log(` Cloned some other way? Inside the clone, run:
|
|
4442
4446
|
git config --replace-all credential.https://${GIT_HOST}.helper ''
|
|
4443
4447
|
git config --add credential.https://${GIT_HOST}.helper '${GIT_HELPER}'`);
|
|
4444
|
-
for (const key of new Set(data.links.map((l) => `${l.repo}#${l.branch}`))) {
|
|
4448
|
+
for (const key of new Set(data.links.filter((l) => l.repo !== git2.copy_of).map((l) => `${l.repo}#${l.branch}`))) {
|
|
4445
4449
|
const [repo, branch] = key.split("#");
|
|
4446
4450
|
console.log(`
|
|
4447
4451
|
GitHub (separate): ${repo} (branch ${branch})`);
|
|
@@ -4645,6 +4649,41 @@ async function workspaceConnectCommand(opts) {
|
|
|
4645
4649
|
}
|
|
4646
4650
|
install = match;
|
|
4647
4651
|
}
|
|
4652
|
+
console.log(`Connecting the workspace via @${install.account}...`);
|
|
4653
|
+
let ws = await connectWholeWorkspace(install.id, orgOpt);
|
|
4654
|
+
if (ws.state === "needs-first-target" || ws.state === "unavailable") {
|
|
4655
|
+
const site = await connectWebsite(install, orgOpt);
|
|
4656
|
+
if (ws.state === "unavailable") {
|
|
4657
|
+
console.log(`
|
|
4658
|
+
\u2713 Workspace repo connected: ${site.repo} (branch ${site.branch ?? "main"})
|
|
4659
|
+
|
|
4660
|
+
Clone: git clone https://github.com/${site.repo}.git
|
|
4661
|
+
The website lives under ${site.subdir ?? "website"}/ \u2014 pushes to
|
|
4662
|
+
${site.branch ?? "main"} auto-deploy to the live site.
|
|
4663
|
+
|
|
4664
|
+
Run \`clawnify workspace\` any time for the full map + editing contract.`);
|
|
4665
|
+
return;
|
|
4666
|
+
}
|
|
4667
|
+
ws = await connectWholeWorkspace(install.id, orgOpt);
|
|
4668
|
+
}
|
|
4669
|
+
if (!ws.repo) failConnect(ws.error ?? "the workspace could not be connected", ws.needsReauth);
|
|
4670
|
+
console.log(`
|
|
4671
|
+
\u2713 Workspace connected to GitHub: ${ws.repo}
|
|
4672
|
+
${ws.state === "moved" ? "\n Its Clawnify git history moved there; Clawnify git keeps a copy.\n" : ""}
|
|
4673
|
+
Every app, the website and every agent (instructions, skills and flows)
|
|
4674
|
+
go into this repo. Anything not in it yet is added within minutes.
|
|
4675
|
+
Clone it from GitHub, or with \`npx clawnify@latest workspace clone\`:
|
|
4676
|
+
a push to either goes to GitHub and rebuilds what it changed.
|
|
4677
|
+
|
|
4678
|
+
Run \`clawnify workspace\` any time for the full map + editing contract.`);
|
|
4679
|
+
}
|
|
4680
|
+
async function connectWholeWorkspace(installationId, orgOpt) {
|
|
4681
|
+
const res = await api.post("/settings/github/connect-workspace", { installation_id: installationId }, orgOpt);
|
|
4682
|
+
const data = await res.json().catch(() => ({}));
|
|
4683
|
+
if (res.status === 404 && !data.state) return { state: "unavailable" };
|
|
4684
|
+
return data;
|
|
4685
|
+
}
|
|
4686
|
+
async function connectWebsite(install, orgOpt) {
|
|
4648
4687
|
const siteRes = await api.get("/v1/websites", orgOpt);
|
|
4649
4688
|
const site = siteRes.ok ? (await siteRes.json()).website ?? {} : {};
|
|
4650
4689
|
if (!site.id) {
|
|
@@ -4655,32 +4694,22 @@ async function workspaceConnectCommand(opts) {
|
|
|
4655
4694
|
process.exit(1);
|
|
4656
4695
|
}
|
|
4657
4696
|
console.log(`Connecting ${site.slug ?? "website"} via @${install.account}...`);
|
|
4658
|
-
const res = await api.post(
|
|
4659
|
-
"/settings/github/connect",
|
|
4660
|
-
{ website_id: site.id, installation_id: install.id },
|
|
4661
|
-
orgOpt
|
|
4662
|
-
);
|
|
4697
|
+
const res = await api.post("/settings/github/connect", { website_id: site.id, installation_id: install.id }, orgOpt);
|
|
4663
4698
|
const data = await res.json().catch(() => ({}));
|
|
4664
|
-
if (!res.ok || !data.repo) {
|
|
4665
|
-
|
|
4666
|
-
|
|
4699
|
+
if (!res.ok || !data.repo) failConnect(data.error ?? `HTTP ${res.status}`, data.needsReauth);
|
|
4700
|
+
return { repo: data.repo, branch: data.branch, subdir: data.subdir };
|
|
4701
|
+
}
|
|
4702
|
+
function failConnect(error, needsReauth) {
|
|
4703
|
+
if (needsReauth) {
|
|
4704
|
+
console.error(`GitHub authorization expired. Ask the user to reconnect (browser step):
|
|
4667
4705
|
|
|
4668
4706
|
https://app.clawnify.com/github/reauth?state=website
|
|
4669
4707
|
|
|
4670
4708
|
then re-run \`clawnify workspace connect\`.`);
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
}
|
|
4674
|
-
process.exit(1);
|
|
4709
|
+
} else {
|
|
4710
|
+
console.error(`Connect failed: ${error}`);
|
|
4675
4711
|
}
|
|
4676
|
-
|
|
4677
|
-
\u2713 Workspace repo connected: ${data.repo} (branch ${data.branch ?? "main"})
|
|
4678
|
-
|
|
4679
|
-
Clone: git clone https://github.com/${data.repo}.git
|
|
4680
|
-
The website lives under ${data.subdir ?? "website"}/ \u2014 pushes to
|
|
4681
|
-
${data.branch ?? "main"} auto-deploy to the live site.
|
|
4682
|
-
|
|
4683
|
-
Run \`clawnify workspace\` any time for the full map + editing contract.`);
|
|
4712
|
+
process.exit(1);
|
|
4684
4713
|
}
|
|
4685
4714
|
|
|
4686
4715
|
// src/commands/execute.ts
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
if (process.argv.includes("--mcp")) {
|
|
5
|
-
const { startMcpServer } = await import("./mcp-
|
|
5
|
+
const { startMcpServer } = await import("./mcp-NA5DIXTM.js");
|
|
6
6
|
await startMcpServer();
|
|
7
7
|
} else {
|
|
8
|
-
const { runCli } = await import("./cli-
|
|
8
|
+
const { runCli } = await import("./cli-5XEHE3DX.js");
|
|
9
9
|
await runCli();
|
|
10
10
|
}
|