clawnify 0.22.1 → 0.22.3
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-XNVXQ7A5.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.3";
|
|
1781
1781
|
var BUNDLED_SKILLS = [
|
|
1782
1782
|
{
|
|
1783
1783
|
name: "build-a-clawnify-app",
|
|
@@ -4609,8 +4609,9 @@ async function workspaceConnectCommand(opts) {
|
|
|
4609
4609
|
then re-run \`clawnify workspace connect\`.`);
|
|
4610
4610
|
process.exit(1);
|
|
4611
4611
|
}
|
|
4612
|
-
const
|
|
4613
|
-
const
|
|
4612
|
+
const org = await resolveOrg({ org: opts?.org });
|
|
4613
|
+
const orgId = org.id;
|
|
4614
|
+
const orgOpt = { orgId };
|
|
4614
4615
|
let installs = await listInstallations(orgId);
|
|
4615
4616
|
if (installs.length === 0) {
|
|
4616
4617
|
console.log(`No GitHub account is connected to this workspace yet.
|
|
@@ -4649,6 +4650,41 @@ async function workspaceConnectCommand(opts) {
|
|
|
4649
4650
|
}
|
|
4650
4651
|
install = match;
|
|
4651
4652
|
}
|
|
4653
|
+
console.log(`Connecting ${org.name} (${org.slug}) via @${install.account}...`);
|
|
4654
|
+
let ws = await connectWholeWorkspace(install.id, orgOpt);
|
|
4655
|
+
if (ws.state === "needs-first-target" || ws.state === "unavailable") {
|
|
4656
|
+
const site = await connectWebsite(install, orgOpt);
|
|
4657
|
+
if (ws.state === "unavailable") {
|
|
4658
|
+
console.log(`
|
|
4659
|
+
\u2713 Workspace repo connected: ${site.repo} (branch ${site.branch ?? "main"})
|
|
4660
|
+
|
|
4661
|
+
Clone: git clone https://github.com/${site.repo}.git
|
|
4662
|
+
The website lives under ${site.subdir ?? "website"}/ \u2014 pushes to
|
|
4663
|
+
${site.branch ?? "main"} auto-deploy to the live site.
|
|
4664
|
+
|
|
4665
|
+
Run \`clawnify workspace\` any time for the full map + editing contract.`);
|
|
4666
|
+
return;
|
|
4667
|
+
}
|
|
4668
|
+
ws = await connectWholeWorkspace(install.id, orgOpt);
|
|
4669
|
+
}
|
|
4670
|
+
if (!ws.repo) failConnect(ws.error ?? "the workspace could not be connected", ws.needsReauth);
|
|
4671
|
+
console.log(`
|
|
4672
|
+
\u2713 Workspace connected to GitHub: ${ws.repo}
|
|
4673
|
+
${ws.state === "moved" ? "\n Its Clawnify git history moved there; Clawnify git keeps a copy.\n" : ""}
|
|
4674
|
+
Every app, the website and every agent (instructions, skills and flows)
|
|
4675
|
+
go into this repo. Anything not in it yet is added within minutes.
|
|
4676
|
+
Clone it from GitHub, or with \`npx clawnify@latest workspace clone\`:
|
|
4677
|
+
a push to either goes to GitHub and rebuilds what it changed.
|
|
4678
|
+
|
|
4679
|
+
Run \`clawnify workspace\` any time for the full map + editing contract.`);
|
|
4680
|
+
}
|
|
4681
|
+
async function connectWholeWorkspace(installationId, orgOpt) {
|
|
4682
|
+
const res = await api.post("/settings/github/connect-workspace", { installation_id: installationId }, orgOpt);
|
|
4683
|
+
const data = await res.json().catch(() => ({}));
|
|
4684
|
+
if (res.status === 404 && !data.state) return { state: "unavailable" };
|
|
4685
|
+
return data;
|
|
4686
|
+
}
|
|
4687
|
+
async function connectWebsite(install, orgOpt) {
|
|
4652
4688
|
const siteRes = await api.get("/v1/websites", orgOpt);
|
|
4653
4689
|
const site = siteRes.ok ? (await siteRes.json()).website ?? {} : {};
|
|
4654
4690
|
if (!site.id) {
|
|
@@ -4659,32 +4695,22 @@ async function workspaceConnectCommand(opts) {
|
|
|
4659
4695
|
process.exit(1);
|
|
4660
4696
|
}
|
|
4661
4697
|
console.log(`Connecting ${site.slug ?? "website"} via @${install.account}...`);
|
|
4662
|
-
const res = await api.post(
|
|
4663
|
-
"/settings/github/connect",
|
|
4664
|
-
{ website_id: site.id, installation_id: install.id },
|
|
4665
|
-
orgOpt
|
|
4666
|
-
);
|
|
4698
|
+
const res = await api.post("/settings/github/connect", { website_id: site.id, installation_id: install.id }, orgOpt);
|
|
4667
4699
|
const data = await res.json().catch(() => ({}));
|
|
4668
|
-
if (!res.ok || !data.repo) {
|
|
4669
|
-
|
|
4670
|
-
|
|
4700
|
+
if (!res.ok || !data.repo) failConnect(data.error ?? `HTTP ${res.status}`, data.needsReauth);
|
|
4701
|
+
return { repo: data.repo, branch: data.branch, subdir: data.subdir };
|
|
4702
|
+
}
|
|
4703
|
+
function failConnect(error, needsReauth) {
|
|
4704
|
+
if (needsReauth) {
|
|
4705
|
+
console.error(`GitHub authorization expired. Ask the user to reconnect (browser step):
|
|
4671
4706
|
|
|
4672
4707
|
https://app.clawnify.com/github/reauth?state=website
|
|
4673
4708
|
|
|
4674
4709
|
then re-run \`clawnify workspace connect\`.`);
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
}
|
|
4678
|
-
process.exit(1);
|
|
4710
|
+
} else {
|
|
4711
|
+
console.error(`Connect failed: ${error}`);
|
|
4679
4712
|
}
|
|
4680
|
-
|
|
4681
|
-
\u2713 Workspace repo connected: ${data.repo} (branch ${data.branch ?? "main"})
|
|
4682
|
-
|
|
4683
|
-
Clone: git clone https://github.com/${data.repo}.git
|
|
4684
|
-
The website lives under ${data.subdir ?? "website"}/ \u2014 pushes to
|
|
4685
|
-
${data.branch ?? "main"} auto-deploy to the live site.
|
|
4686
|
-
|
|
4687
|
-
Run \`clawnify workspace\` any time for the full map + editing contract.`);
|
|
4713
|
+
process.exit(1);
|
|
4688
4714
|
}
|
|
4689
4715
|
|
|
4690
4716
|
// src/commands/execute.ts
|
|
@@ -5197,7 +5223,7 @@ async function runCli() {
|
|
|
5197
5223
|
const workspace = program.command("workspace").description("Show the org's workspace: its repo (Clawnify git or GitHub), targets, and how to edit locally").option("--json", "Machine-readable output").action(workspaceStatusCommand);
|
|
5198
5224
|
workspace.command("clone [dir]").description("Clone the org's Clawnify git repo; git signs in with your Clawnify login").option("--org <slug-or-id>", "Org to clone (defaults to the folder's or only org)").action(workspaceCloneCommand);
|
|
5199
5225
|
workspace.command("init [dir]").description("Scaffold a workspace monorepo bound to an org").option("--org <slug-or-id>", "Org to bind the workspace to (defaults to active org)").option("--name <name>", "Workspace display name (defaults to the org name)").action(workspaceInitCommand);
|
|
5200
|
-
workspace.command("connect").description("
|
|
5226
|
+
workspace.command("connect").description("Connect the whole workspace to GitHub: every app, the website and every agent, in one repo").option("--org <slug-or-id>", "Org to connect (needed when you are in several)").option("--account <login-or-id>", "GitHub account to use when several are connected").action(workspaceConnectCommand);
|
|
5201
5227
|
const knowledge = program.command("knowledge").description("Company Knowledge on disk, for coding agents");
|
|
5202
5228
|
knowledge.command("pull [dir]").description("Write the org's published Company Knowledge as markdown into a git-ignored folder (default: knowledge/ at the workspace root)").option("--org <slug-or-id>", "Org to pull (defaults to the folder's org)").option("--project <id>", "Pull a Project's sources instead (default folder: knowledge/projects/<name>/)").option("--files", "Also pull the original Company files (kept on for later pulls)").option("--no-files", "Stop pulling the original files, and remove the ones pulled").option("--strict", "Exit non-zero when a file was left because it changed locally").option("-q, --quiet", "Print only what needs attention (the git hook uses it)").action(knowledgePullCommand);
|
|
5203
5229
|
program.command("git-credential <operation>", { hidden: true }).description("Git credential helper for Clawnify git (get, store, erase)").action(gitCredentialCommand);
|
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-SD3GOBCK.js");
|
|
6
6
|
await startMcpServer();
|
|
7
7
|
} else {
|
|
8
|
-
const { runCli } = await import("./cli-
|
|
8
|
+
const { runCli } = await import("./cli-EEW6EVW4.js");
|
|
9
9
|
await runCli();
|
|
10
10
|
}
|