@pushto/cli 0.4.9 → 0.5.0

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.
Files changed (114) hide show
  1. package/dist/commands/__tests__/auth-add.test.d.ts +2 -0
  2. package/dist/commands/__tests__/auth-add.test.d.ts.map +1 -0
  3. package/dist/commands/__tests__/auth-add.test.js +27 -0
  4. package/dist/commands/__tests__/auth-add.test.js.map +1 -0
  5. package/dist/commands/__tests__/deploy-target.test.d.ts +2 -0
  6. package/dist/commands/__tests__/deploy-target.test.d.ts.map +1 -0
  7. package/dist/commands/__tests__/deploy-target.test.js +43 -0
  8. package/dist/commands/__tests__/deploy-target.test.js.map +1 -0
  9. package/dist/commands/__tests__/headless-smoke.test.js +35 -1
  10. package/dist/commands/__tests__/headless-smoke.test.js.map +1 -1
  11. package/dist/commands/__tests__/mcp-add.test.d.ts +2 -0
  12. package/dist/commands/__tests__/mcp-add.test.d.ts.map +1 -0
  13. package/dist/commands/__tests__/mcp-add.test.js +112 -0
  14. package/dist/commands/__tests__/mcp-add.test.js.map +1 -0
  15. package/dist/commands/__tests__/mcp-serve.test.d.ts +2 -0
  16. package/dist/commands/__tests__/mcp-serve.test.d.ts.map +1 -0
  17. package/dist/commands/__tests__/mcp-serve.test.js +169 -0
  18. package/dist/commands/__tests__/mcp-serve.test.js.map +1 -0
  19. package/dist/commands/__tests__/upgrade-trust.test.d.ts +2 -0
  20. package/dist/commands/__tests__/upgrade-trust.test.d.ts.map +1 -0
  21. package/dist/commands/__tests__/upgrade-trust.test.js +26 -0
  22. package/dist/commands/__tests__/upgrade-trust.test.js.map +1 -0
  23. package/dist/commands/auth.d.ts +13 -1
  24. package/dist/commands/auth.d.ts.map +1 -1
  25. package/dist/commands/auth.js +100 -1
  26. package/dist/commands/auth.js.map +1 -1
  27. package/dist/commands/deploy.d.ts +27 -0
  28. package/dist/commands/deploy.d.ts.map +1 -1
  29. package/dist/commands/deploy.js +129 -109
  30. package/dist/commands/deploy.js.map +1 -1
  31. package/dist/commands/init.d.ts.map +1 -1
  32. package/dist/commands/init.js +20 -45
  33. package/dist/commands/init.js.map +1 -1
  34. package/dist/commands/link.d.ts +10 -0
  35. package/dist/commands/link.d.ts.map +1 -0
  36. package/dist/commands/link.js +78 -0
  37. package/dist/commands/link.js.map +1 -0
  38. package/dist/commands/mcp.d.ts +7 -0
  39. package/dist/commands/mcp.d.ts.map +1 -0
  40. package/dist/commands/mcp.js +137 -0
  41. package/dist/commands/mcp.js.map +1 -0
  42. package/dist/commands/preview.d.ts.map +1 -1
  43. package/dist/commands/preview.js +7 -4
  44. package/dist/commands/preview.js.map +1 -1
  45. package/dist/commands/upgrade.d.ts +2 -0
  46. package/dist/commands/upgrade.d.ts.map +1 -1
  47. package/dist/commands/upgrade.js +52 -1
  48. package/dist/commands/upgrade.js.map +1 -1
  49. package/dist/commands/use.d.ts.map +1 -1
  50. package/dist/commands/use.js +2 -1
  51. package/dist/commands/use.js.map +1 -1
  52. package/dist/index.js +24 -4
  53. package/dist/index.js.map +1 -1
  54. package/dist/lib/__tests__/deploy-local.test.d.ts +2 -0
  55. package/dist/lib/__tests__/deploy-local.test.d.ts.map +1 -0
  56. package/dist/lib/__tests__/deploy-local.test.js +103 -0
  57. package/dist/lib/__tests__/deploy-local.test.js.map +1 -0
  58. package/dist/lib/__tests__/mcp-serve-client.test.d.ts +2 -0
  59. package/dist/lib/__tests__/mcp-serve-client.test.d.ts.map +1 -0
  60. package/dist/lib/__tests__/mcp-serve-client.test.js +74 -0
  61. package/dist/lib/__tests__/mcp-serve-client.test.js.map +1 -0
  62. package/dist/lib/__tests__/npm-packaging.test.js +1 -1
  63. package/dist/lib/__tests__/npm-packaging.test.js.map +1 -1
  64. package/dist/lib/__tests__/resolve-slug.test.d.ts +2 -0
  65. package/dist/lib/__tests__/resolve-slug.test.d.ts.map +1 -0
  66. package/dist/lib/__tests__/resolve-slug.test.js +54 -0
  67. package/dist/lib/__tests__/resolve-slug.test.js.map +1 -0
  68. package/dist/lib/__tests__/snippet-insert.test.d.ts +2 -0
  69. package/dist/lib/__tests__/snippet-insert.test.d.ts.map +1 -0
  70. package/dist/lib/__tests__/snippet-insert.test.js +69 -0
  71. package/dist/lib/__tests__/snippet-insert.test.js.map +1 -0
  72. package/dist/lib/create-project.d.ts +19 -0
  73. package/dist/lib/create-project.d.ts.map +1 -0
  74. package/dist/lib/create-project.js +51 -0
  75. package/dist/lib/create-project.js.map +1 -0
  76. package/dist/lib/mcp-serve/agent-config.d.ts +26 -0
  77. package/dist/lib/mcp-serve/agent-config.d.ts.map +1 -0
  78. package/dist/lib/mcp-serve/agent-config.js +38 -0
  79. package/dist/lib/mcp-serve/agent-config.js.map +1 -0
  80. package/dist/lib/mcp-serve/client.d.ts +22 -0
  81. package/dist/lib/mcp-serve/client.d.ts.map +1 -0
  82. package/dist/lib/mcp-serve/client.js +68 -0
  83. package/dist/lib/mcp-serve/client.js.map +1 -0
  84. package/dist/lib/mcp-serve/deploy-local.d.ts +13 -0
  85. package/dist/lib/mcp-serve/deploy-local.d.ts.map +1 -0
  86. package/dist/lib/mcp-serve/deploy-local.js +99 -0
  87. package/dist/lib/mcp-serve/deploy-local.js.map +1 -0
  88. package/dist/lib/mcp-serve/serve.d.ts +19 -0
  89. package/dist/lib/mcp-serve/serve.d.ts.map +1 -0
  90. package/dist/lib/mcp-serve/serve.js +60 -0
  91. package/dist/lib/mcp-serve/serve.js.map +1 -0
  92. package/dist/lib/mcp-serve/token.d.ts +20 -0
  93. package/dist/lib/mcp-serve/token.d.ts.map +1 -0
  94. package/dist/lib/mcp-serve/token.js +43 -0
  95. package/dist/lib/mcp-serve/token.js.map +1 -0
  96. package/dist/lib/perform-deploy.d.ts +74 -0
  97. package/dist/lib/perform-deploy.d.ts.map +1 -0
  98. package/dist/lib/perform-deploy.js +112 -0
  99. package/dist/lib/perform-deploy.js.map +1 -0
  100. package/dist/lib/project-name.d.ts +6 -0
  101. package/dist/lib/project-name.d.ts.map +1 -0
  102. package/dist/lib/project-name.js +10 -0
  103. package/dist/lib/project-name.js.map +1 -0
  104. package/dist/lib/resolve-slug.d.ts +13 -3
  105. package/dist/lib/resolve-slug.d.ts.map +1 -1
  106. package/dist/lib/resolve-slug.js +21 -9
  107. package/dist/lib/resolve-slug.js.map +1 -1
  108. package/dist/lib/snippet-insert.d.ts +36 -0
  109. package/dist/lib/snippet-insert.d.ts.map +1 -0
  110. package/dist/lib/snippet-insert.js +74 -0
  111. package/dist/lib/snippet-insert.js.map +1 -0
  112. package/dist/version.d.ts +1 -1
  113. package/dist/version.js +3 -3
  114. package/package.json +2 -1
@@ -0,0 +1,6 @@
1
+ /** The naming rules `pushto init` has always applied, shared with deploy's
2
+ * create-on-first-push path so a directory name and an explicit name can
3
+ * never slugify differently. */
4
+ export declare const slugifyProjectName: (name: string) => string;
5
+ export declare const MIN_SLUG_LENGTH = 3;
6
+ //# sourceMappingURL=project-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-name.d.ts","sourceRoot":"","sources":["../../src/lib/project-name.ts"],"names":[],"mappings":"AAAA;;iCAEiC;AACjC,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MAKxB,CAAC;AAE3B,eAAO,MAAM,eAAe,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** The naming rules `pushto init` has always applied, shared with deploy's
2
+ * create-on-first-push path so a directory name and an explicit name can
3
+ * never slugify differently. */
4
+ export const slugifyProjectName = (name) => name
5
+ .toLowerCase()
6
+ .replace(/[^a-z0-9-]/g, '-')
7
+ .replace(/-+/g, '-')
8
+ .replace(/^-|-$/g, '');
9
+ export const MIN_SLUG_LENGTH = 3;
10
+ //# sourceMappingURL=project-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-name.js","sourceRoot":"","sources":["../../src/lib/project-name.ts"],"names":[],"mappings":"AAAA;;iCAEiC;AACjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAU,EAAE,CACzD,IAAI;KACD,WAAW,EAAE;KACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;KAC3B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;KACnB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC"}
@@ -1,7 +1,17 @@
1
1
  /**
2
- * Resolve the project slug from:
2
+ * The slug linked to this directory by its .pushto file, or undefined.
3
+ *
4
+ * Commands that UPLOAD the directory (deploy, preview) must use this and
5
+ * never resolveSlug: the global slug points wherever init/use last ran —
6
+ * any directory on the machine — and following it shipped a brand-new
7
+ * project's files into an unrelated old project (soiaa → offload-test,
8
+ * 2026-07-30).
9
+ */
10
+ export declare const readLocalSlug: (cwd?: string) => string | undefined;
11
+ /**
12
+ * Resolve the project slug for CONTROL commands (logs, status, open, env…):
3
13
  * 1. .pushto file in the current directory
4
- * 2. Global config (last `pushto init`)
14
+ * 2. Global config (last `pushto init` / `pushto use`)
5
15
  */
6
- export declare const resolveSlug: () => string | undefined;
16
+ export declare const resolveSlug: (cwd?: string) => string | undefined;
7
17
  //# sourceMappingURL=resolve-slug.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-slug.d.ts","sourceRoot":"","sources":["../../src/lib/resolve-slug.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAO,MAAM,GAAG,SAiBvC,CAAC"}
1
+ {"version":3,"file":"resolve-slug.d.ts","sourceRoot":"","sources":["../../src/lib/resolve-slug.ts"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,MAAK,MAAsB,KAAG,MAAM,GAAG,SAWpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,MAAK,MAAsB,KAAG,MAAM,GAAG,SAOlE,CAAC"}
@@ -5,24 +5,36 @@ import { getProjectSlug } from './config.js';
5
5
  const SAFE_SLUG_RE = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
6
6
  const isValidSlug = (slug) => slug.length >= 2 && slug.length <= 63 && SAFE_SLUG_RE.test(slug);
7
7
  /**
8
- * Resolve the project slug from:
9
- * 1. .pushto file in the current directory
10
- * 2. Global config (last `pushto init`)
8
+ * The slug linked to this directory by its .pushto file, or undefined.
9
+ *
10
+ * Commands that UPLOAD the directory (deploy, preview) must use this and
11
+ * never resolveSlug: the global slug points wherever init/use last ran —
12
+ * any directory on the machine — and following it shipped a brand-new
13
+ * project's files into an unrelated old project (soiaa → offload-test,
14
+ * 2026-07-30).
11
15
  */
12
- export const resolveSlug = () => {
13
- // Check for .pushto file in cwd
14
- const pushtoFile = path.join(process.cwd(), '.pushto');
16
+ export const readLocalSlug = (cwd = process.cwd()) => {
15
17
  try {
16
- const content = fs.readFileSync(pushtoFile, 'utf-8');
18
+ const content = fs.readFileSync(path.join(cwd, '.pushto'), 'utf-8');
17
19
  const parsed = JSON.parse(content);
18
20
  if (typeof parsed.slug === 'string' && isValidSlug(parsed.slug)) {
19
21
  return parsed.slug;
20
22
  }
21
23
  }
22
24
  catch {
23
- // No .pushto file or invalid JSON — fall through
25
+ // No .pushto file or invalid JSON — this directory simply isn't linked
24
26
  }
25
- // Fall back to global config
27
+ return undefined;
28
+ };
29
+ /**
30
+ * Resolve the project slug for CONTROL commands (logs, status, open, env…):
31
+ * 1. .pushto file in the current directory
32
+ * 2. Global config (last `pushto init` / `pushto use`)
33
+ */
34
+ export const resolveSlug = (cwd = process.cwd()) => {
35
+ const local = readLocalSlug(cwd);
36
+ if (local)
37
+ return local;
26
38
  const globalSlug = getProjectSlug();
27
39
  if (globalSlug && isValidSlug(globalSlug))
28
40
  return globalSlug;
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-slug.js","sourceRoot":"","sources":["../../src/lib/resolve-slug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,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AG,8BAA8B,CAAC;AACpD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAW,EAAE,CAC5C,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE,EAAsB,EAAE;IAC/E,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;QACpE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAChE,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;IACzE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE,EAAsB,EAAE;IAC7E,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IAExB,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC;IACpC,IAAI,UAAU,IAAI,WAAW,CAAC,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC;IAC7D,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Everything `pushto auth add` needs to put the widget in a project,
3
+ * as pure functions the tests can hold still.
4
+ *
5
+ * The snippet always points at the canonical host — it runs on the
6
+ * user's site, not against whatever apiUrl this CLI happens to target.
7
+ */
8
+ export declare const WIDGET_SRC = "https://pushto.host/api/auth/widget.js";
9
+ export declare const authSnippet: (projectId: string, apiKey: string) => string;
10
+ export declare const isAlreadyWired: (source: string) => boolean;
11
+ /** Insert before the LAST </body> (case-insensitive). Null = no anchor: print, don't guess. */
12
+ export declare const insertBeforeBody: (html: string, snippet: string) => string | null;
13
+ export type SnippetTarget = {
14
+ kind: 'html';
15
+ path: string;
16
+ } | {
17
+ kind: 'react';
18
+ } | {
19
+ kind: 'none';
20
+ };
21
+ /**
22
+ * html first, deliberately: a vite+react app has BOTH a root index.html
23
+ * and a react dependency, and the root index.html is its real entry —
24
+ * inserting there puts the widget on the served page without touching
25
+ * any component.
26
+ */
27
+ export declare const detectTarget: (dir: string) => SnippetTarget;
28
+ /**
29
+ * Kept in sync BY HAND with the dashboard's react snippet
30
+ * (apps/web/.../auth/page.tsx reactSnippet). Not imported from
31
+ * packages/shared: the CLI's NodeNext resolution and the shared barrel
32
+ * have a standing standoff (2026-07-25), and 20 lines is cheaper than
33
+ * reopening it.
34
+ */
35
+ export declare const reactWrapperSource: (projectId: string, apiKey: string) => string;
36
+ //# sourceMappingURL=snippet-insert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippet-insert.d.ts","sourceRoot":"","sources":["../../src/lib/snippet-insert.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,eAAO,MAAM,UAAU,2CAA2C,CAAC;AAEnE,eAAO,MAAM,WAAW,GAAI,WAAW,MAAM,EAAE,QAAQ,MAAM,KAAG,MACwD,CAAC;AAEzH,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,OAAsC,CAAC;AAEvF,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,SAAS,MAAM,KAAG,MAAM,GAAG,IAIzE,CAAC;AAEF,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,aAgB1C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,WAAW,MAAM,EAAE,QAAQ,MAAM,KAAG,MAuBtE,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ /**
4
+ * Everything `pushto auth add` needs to put the widget in a project,
5
+ * as pure functions the tests can hold still.
6
+ *
7
+ * The snippet always points at the canonical host — it runs on the
8
+ * user's site, not against whatever apiUrl this CLI happens to target.
9
+ */
10
+ export const WIDGET_SRC = 'https://pushto.host/api/auth/widget.js';
11
+ export const authSnippet = (projectId, apiKey) => `<div id="pushto-auth"></div>\n<script src="${WIDGET_SRC}" data-project="${projectId}" data-key="${apiKey}"></script>`;
12
+ export const isAlreadyWired = (source) => source.includes(WIDGET_SRC);
13
+ /** Insert before the LAST </body> (case-insensitive). Null = no anchor: print, don't guess. */
14
+ export const insertBeforeBody = (html, snippet) => {
15
+ const idx = html.toLowerCase().lastIndexOf('</body>');
16
+ if (idx === -1)
17
+ return null;
18
+ return `${html.slice(0, idx)} ${snippet}\n${html.slice(idx)}`;
19
+ };
20
+ /**
21
+ * html first, deliberately: a vite+react app has BOTH a root index.html
22
+ * and a react dependency, and the root index.html is its real entry —
23
+ * inserting there puts the widget on the served page without touching
24
+ * any component.
25
+ */
26
+ export const detectTarget = (dir) => {
27
+ for (const candidate of [join(dir, 'index.html'), join(dir, 'public', 'index.html')]) {
28
+ if (existsSync(candidate))
29
+ return { kind: 'html', path: candidate };
30
+ }
31
+ const pkgPath = join(dir, 'package.json');
32
+ if (existsSync(pkgPath)) {
33
+ try {
34
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
35
+ if (pkg.dependencies?.react)
36
+ return { kind: 'react' };
37
+ }
38
+ catch {
39
+ // broken package.json — fall through to none; add prints instead
40
+ }
41
+ }
42
+ return { kind: 'none' };
43
+ };
44
+ /**
45
+ * Kept in sync BY HAND with the dashboard's react snippet
46
+ * (apps/web/.../auth/page.tsx reactSnippet). Not imported from
47
+ * packages/shared: the CLI's NodeNext resolution and the shared barrel
48
+ * have a standing standoff (2026-07-25), and 20 lines is cheaper than
49
+ * reopening it.
50
+ */
51
+ export const reactWrapperSource = (projectId, apiKey) => `// pushto auth — drop-in component backed by the hosted widget
52
+ import { useEffect } from 'react';
53
+
54
+ const SRC = '${WIDGET_SRC}';
55
+ const PROJECT = '${projectId}';
56
+ const KEY = '${apiKey}';
57
+
58
+ export function PushtoAuth() {
59
+ useEffect(() => {
60
+ if (document.getElementById('pushto-auth-loader')) return;
61
+ const s = document.createElement('script');
62
+ s.id = 'pushto-auth-loader';
63
+ s.src = SRC;
64
+ s.setAttribute('data-project', PROJECT);
65
+ s.setAttribute('data-key', KEY);
66
+ document.body.appendChild(s);
67
+ }, []);
68
+ return <div id="pushto-auth" />;
69
+ }
70
+
71
+ // once loaded, session helpers live on window.pushtoAuth:
72
+ // .getUser() .login(email, pw) .signup(email, pw) .logout() .onChange(cb)
73
+ `;
74
+ //# sourceMappingURL=snippet-insert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippet-insert.js","sourceRoot":"","sources":["../../src/lib/snippet-insert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,wCAAwC,CAAC;AAEnE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAiB,EAAE,MAAc,EAAU,EAAE,CACvE,8CAA8C,UAAU,mBAAmB,SAAS,e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E,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAiB,EAAE,MAAc,EAAU,EAAE,CAC9E;;;eAGa,UAAU;mBACN,SAAS;eACb,MAAM;;;;;;;;;;;;;;;;;CAiBpB,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.4.9";
1
+ export declare const VERSION = "0.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // AUTO-GENERATED FILE — DO NOT EDIT BY HAND.
2
2
  //
3
- // The literal "0.4.9" below is a placeholder. In CI release
3
+ // The literal "0.5.0" below is a placeholder. In CI release
4
4
  // builds (scripts/build-binaries.sh), `sed` replaces it with the real version
5
5
  // string before each `bun build --compile` invocation, and the build asserts
6
6
  // the version was actually embedded by greping the binary. This is the
@@ -10,7 +10,7 @@
10
10
  // silent).
11
11
  //
12
12
  // In local dev (`tsx src/index.ts`) the placeholder stays put and `pushto
13
- // --version` reports the literal "0.4.9" — a giveaway
13
+ // --version` reports the literal "0.5.0" — a giveaway
14
14
  // that you're on the source tree, not a release build.
15
- export const VERSION = "0.4.9";
15
+ export const VERSION = "0.5.0";
16
16
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushto/cli",
3
- "version": "0.4.9",
3
+ "version": "0.5.0",
4
4
  "description": "Deploy to pushto.host from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,6 +18,7 @@
18
18
  "prepublishOnly": "npm run build"
19
19
  },
20
20
  "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.29.0",
21
22
  "archiver": "^7.0.1",
22
23
  "chalk": "^5.4.0",
23
24
  "commander": "^13.0.0",