clawnify 0.22.1 → 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.
@@ -658,7 +658,7 @@ async function pollUntilReady(resourceId, options = {}) {
658
658
  }
659
659
 
660
660
  // src/version.ts
661
- var VERSION = "0.22.1";
661
+ var VERSION = "0.22.2";
662
662
 
663
663
  export {
664
664
  OAUTH_CLIENT_ID,
@@ -22,7 +22,7 @@ import {
22
22
  resolveOrgContext,
23
23
  saveAuth,
24
24
  saveProject
25
- } from "./chunk-ZK77YX65.js";
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.1";
1780
+ var CLI_VERSION = "0.22.2";
1781
1781
  var BUNDLED_SKILLS = [
1782
1782
  {
1783
1783
  name: "build-a-clawnify-app",
@@ -4649,6 +4649,41 @@ async function workspaceConnectCommand(opts) {
4649
4649
  }
4650
4650
  install = match;
4651
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) {
4652
4687
  const siteRes = await api.get("/v1/websites", orgOpt);
4653
4688
  const site = siteRes.ok ? (await siteRes.json()).website ?? {} : {};
4654
4689
  if (!site.id) {
@@ -4659,32 +4694,22 @@ async function workspaceConnectCommand(opts) {
4659
4694
  process.exit(1);
4660
4695
  }
4661
4696
  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
- );
4697
+ const res = await api.post("/settings/github/connect", { website_id: site.id, installation_id: install.id }, orgOpt);
4667
4698
  const data = await res.json().catch(() => ({}));
4668
- if (!res.ok || !data.repo) {
4669
- if (data.needsReauth) {
4670
- console.error(`GitHub authorization expired. Ask the user to reconnect (browser step):
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):
4671
4705
 
4672
4706
  https://app.clawnify.com/github/reauth?state=website
4673
4707
 
4674
4708
  then re-run \`clawnify workspace connect\`.`);
4675
- } else {
4676
- console.error(`Connect failed: ${data.error ?? `HTTP ${res.status}`}`);
4677
- }
4678
- process.exit(1);
4709
+ } else {
4710
+ console.error(`Connect failed: ${error}`);
4679
4711
  }
4680
- console.log(`
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.`);
4712
+ process.exit(1);
4688
4713
  }
4689
4714
 
4690
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-O3AMIUP3.js");
5
+ const { startMcpServer } = await import("./mcp-NA5DIXTM.js");
6
6
  await startMcpServer();
7
7
  } else {
8
- const { runCli } = await import("./cli-JWJJJEOD.js");
8
+ const { runCli } = await import("./cli-5XEHE3DX.js");
9
9
  await runCli();
10
10
  }
@@ -7,7 +7,7 @@ import {
7
7
  pollUntilReady,
8
8
  readManifest,
9
9
  saveProject
10
- } from "./chunk-ZK77YX65.js";
10
+ } from "./chunk-CMR2WSTR.js";
11
11
 
12
12
  // src/mcp.ts
13
13
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawnify",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "description": "Deploy your apps and website to Clawnify from the terminal with Claude Code, Codex, and Cursor",
5
5
  "type": "module",
6
6
  "bin": {