@getjack/jack 0.1.2 → 0.1.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.
Files changed (91) hide show
  1. package/package.json +54 -47
  2. package/src/commands/agents.ts +145 -10
  3. package/src/commands/down.ts +110 -102
  4. package/src/commands/feedback.ts +189 -0
  5. package/src/commands/init.ts +8 -12
  6. package/src/commands/login.ts +88 -0
  7. package/src/commands/logout.ts +14 -0
  8. package/src/commands/logs.ts +21 -0
  9. package/src/commands/mcp.ts +134 -7
  10. package/src/commands/new.ts +43 -17
  11. package/src/commands/open.ts +13 -6
  12. package/src/commands/projects.ts +269 -143
  13. package/src/commands/secrets.ts +413 -0
  14. package/src/commands/services.ts +96 -123
  15. package/src/commands/ship.ts +5 -1
  16. package/src/commands/whoami.ts +31 -0
  17. package/src/index.ts +218 -144
  18. package/src/lib/agent-files.ts +34 -0
  19. package/src/lib/agents.ts +390 -22
  20. package/src/lib/asset-hash.ts +50 -0
  21. package/src/lib/auth/client.ts +115 -0
  22. package/src/lib/auth/constants.ts +5 -0
  23. package/src/lib/auth/guard.ts +57 -0
  24. package/src/lib/auth/index.ts +18 -0
  25. package/src/lib/auth/store.ts +54 -0
  26. package/src/lib/binding-validator.ts +136 -0
  27. package/src/lib/build-helper.ts +211 -0
  28. package/src/lib/cloudflare-api.ts +24 -0
  29. package/src/lib/config.ts +5 -6
  30. package/src/lib/control-plane.ts +295 -0
  31. package/src/lib/debug.ts +3 -1
  32. package/src/lib/deploy-mode.ts +93 -0
  33. package/src/lib/deploy-upload.ts +92 -0
  34. package/src/lib/errors.ts +2 -0
  35. package/src/lib/github.ts +31 -1
  36. package/src/lib/hooks.ts +4 -12
  37. package/src/lib/intent.ts +88 -0
  38. package/src/lib/jsonc.ts +125 -0
  39. package/src/lib/local-paths.test.ts +902 -0
  40. package/src/lib/local-paths.ts +258 -0
  41. package/src/lib/managed-deploy.ts +175 -0
  42. package/src/lib/managed-down.ts +159 -0
  43. package/src/lib/mcp-config.ts +55 -34
  44. package/src/lib/names.ts +9 -29
  45. package/src/lib/project-operations.ts +676 -249
  46. package/src/lib/project-resolver.ts +476 -0
  47. package/src/lib/registry.ts +76 -37
  48. package/src/lib/resources.ts +196 -0
  49. package/src/lib/schema.ts +30 -1
  50. package/src/lib/storage/file-filter.ts +1 -0
  51. package/src/lib/storage/index.ts +5 -1
  52. package/src/lib/telemetry.ts +14 -0
  53. package/src/lib/tty.ts +15 -0
  54. package/src/lib/zip-packager.ts +255 -0
  55. package/src/mcp/resources/index.ts +8 -2
  56. package/src/mcp/server.ts +32 -4
  57. package/src/mcp/tools/index.ts +35 -13
  58. package/src/mcp/types.ts +6 -0
  59. package/src/mcp/utils.ts +1 -1
  60. package/src/templates/index.ts +42 -4
  61. package/src/templates/types.ts +13 -0
  62. package/templates/CLAUDE.md +166 -0
  63. package/templates/api/.jack.json +4 -0
  64. package/templates/api/bun.lock +1 -0
  65. package/templates/api/wrangler.jsonc +5 -0
  66. package/templates/hello/.jack.json +28 -0
  67. package/templates/hello/package.json +10 -0
  68. package/templates/hello/src/index.ts +11 -0
  69. package/templates/hello/tsconfig.json +11 -0
  70. package/templates/hello/wrangler.jsonc +5 -0
  71. package/templates/miniapp/.jack.json +15 -4
  72. package/templates/miniapp/bun.lock +135 -40
  73. package/templates/miniapp/index.html +1 -0
  74. package/templates/miniapp/package.json +3 -1
  75. package/templates/miniapp/public/.well-known/farcaster.json +7 -5
  76. package/templates/miniapp/public/icon.png +0 -0
  77. package/templates/miniapp/public/og.png +0 -0
  78. package/templates/miniapp/schema.sql +8 -0
  79. package/templates/miniapp/src/App.tsx +254 -3
  80. package/templates/miniapp/src/components/ShareSheet.tsx +147 -0
  81. package/templates/miniapp/src/hooks/useAI.ts +35 -0
  82. package/templates/miniapp/src/hooks/useGuestbook.ts +11 -1
  83. package/templates/miniapp/src/hooks/useShare.ts +76 -0
  84. package/templates/miniapp/src/index.css +15 -0
  85. package/templates/miniapp/src/lib/api.ts +2 -1
  86. package/templates/miniapp/src/worker.ts +515 -1
  87. package/templates/miniapp/wrangler.jsonc +15 -3
  88. package/LICENSE +0 -190
  89. package/README.md +0 -55
  90. package/src/commands/cloud.ts +0 -230
  91. package/templates/api/wrangler.toml +0 -3
package/LICENSE DELETED
@@ -1,190 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to the Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- Copyright 2025 jack contributors
179
-
180
- Licensed under the Apache License, Version 2.0 (the "License");
181
- you may not use this file except in compliance with the License.
182
- You may obtain a copy of the License at
183
-
184
- http://www.apache.org/licenses/LICENSE-2.0
185
-
186
- Unless required by applicable law or agreed to in writing, software
187
- distributed under the License is distributed on an "AS IS" BASIS,
188
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
- See the License for the specific language governing permissions and
190
- limitations under the License.
package/README.md DELETED
@@ -1,55 +0,0 @@
1
- # jack
2
-
3
- CLI for vibecoders to rapidly deploy to Cloudflare Workers.
4
-
5
- ## Install
6
-
7
- ```bash
8
- # Install Bun (if needed)
9
- curl -fsSL https://bun.sh/install | bash
10
-
11
- # Run directly
12
- bunx @getjack/jack new my-app
13
-
14
- # Or install globally
15
- bun add -g @getjack/jack
16
- jack new my-app
17
- ```
18
-
19
- ## Usage
20
-
21
- ```bash
22
- # Create a new project
23
- jack new my-app
24
-
25
- # Deploy to Cloudflare Workers
26
- jack ship
27
-
28
- # List your projects
29
- jack list
30
- ```
31
-
32
- ## Requirements
33
-
34
- - [Bun](https://bun.sh) >= 1.0.0
35
- - Cloudflare account (for deployments)
36
-
37
- ## Releasing
38
-
39
- This project uses [Semantic Versioning](https://semver.org/).
40
-
41
- ```bash
42
- # Bump version, commit, and tag
43
- npm version patch # 0.1.1 → 0.1.2 (bug fixes)
44
- npm version minor # 0.1.1 → 0.2.0 (new features)
45
- npm version major # 0.1.1 → 1.0.0 (breaking changes)
46
-
47
- # Push to trigger publish
48
- git push && git push --tags
49
- ```
50
-
51
- GitHub Actions automatically publishes to npm when a version tag is pushed.
52
-
53
- ## License
54
-
55
- Apache-2.0
@@ -1,230 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { select } from "@inquirer/prompts";
4
- import { formatRelativeTime, formatSize } from "../lib/format.ts";
5
- import { error, info, item, output as outputSpinner, success } from "../lib/output.ts";
6
- import { scanProjectFiles } from "../lib/storage/file-filter.ts";
7
- import {
8
- type CloudProject,
9
- type ManifestFile,
10
- computeChecksum,
11
- computeDiff,
12
- deleteCloudProject,
13
- getProjectNameFromDir,
14
- getRemoteManifest,
15
- listCloudProjects,
16
- } from "../lib/storage/index.ts";
17
- import { getBucketName } from "../lib/storage/r2-client.ts";
18
-
19
- /**
20
- * Main cloud command - handles all cloud storage operations
21
- */
22
- export default async function cloud(subcommand?: string, args: string[] = []): Promise<void> {
23
- if (!subcommand) {
24
- return await listCommand();
25
- }
26
-
27
- switch (subcommand) {
28
- case "list":
29
- return await listCommand();
30
- case "status":
31
- return await statusCommand();
32
- case "delete":
33
- return await deleteCommand(args);
34
- default:
35
- error(`Unknown subcommand: ${subcommand}`);
36
- info("Available: list, status, delete");
37
- process.exit(1);
38
- }
39
- }
40
-
41
- /**
42
- * List all cloud projects
43
- */
44
- async function listCommand(): Promise<void> {
45
- outputSpinner.start("Fetching projects...");
46
- const projects = await listCloudProjects();
47
- outputSpinner.stop();
48
-
49
- if (projects.length === 0) {
50
- info("No projects in cloud storage");
51
- return;
52
- }
53
-
54
- console.error("");
55
- // Header
56
- console.error(`${"PROJECT".padEnd(20)} ${"FILES".padEnd(8)} ${"SIZE".padEnd(12)} ${"LAST SYNC"}`);
57
- console.error("-".repeat(60));
58
-
59
- // Projects
60
- let totalFiles = 0;
61
- let totalSize = 0;
62
-
63
- for (const project of projects) {
64
- const name = project.name.padEnd(20);
65
- const files = String(project.files).padEnd(8);
66
- const size = formatSize(project.size).padEnd(12);
67
- const lastSync = formatRelativeTime(project.lastSync);
68
-
69
- console.error(`${name} ${files} ${size} ${lastSync}`);
70
-
71
- totalFiles += project.files;
72
- totalSize += project.size;
73
- }
74
-
75
- // Total
76
- console.error("-".repeat(60));
77
- console.error(
78
- `${"TOTAL".padEnd(20)} ${String(totalFiles).padEnd(8)} ${formatSize(totalSize).padEnd(12)}`,
79
- );
80
- console.error("");
81
- }
82
-
83
- /**
84
- * Show cloud storage status
85
- */
86
- async function statusCommand(): Promise<void> {
87
- try {
88
- const bucketName = await getBucketName();
89
-
90
- console.error("");
91
- success("Cloud Storage");
92
- item(`Bucket: ${bucketName}`);
93
- console.error("");
94
-
95
- // Check if we're in a project directory
96
- const cwd = process.cwd();
97
- const hasWranglerToml = existsSync(join(cwd, "wrangler.toml"));
98
- const hasWranglerJsonc = existsSync(join(cwd, "wrangler.jsonc"));
99
-
100
- if (!hasWranglerToml && !hasWranglerJsonc) {
101
- info("Not in a project directory (no wrangler.toml or wrangler.jsonc found)");
102
- console.error("");
103
- return;
104
- }
105
-
106
- // Get project name
107
- const projectName = await getProjectNameFromDir(cwd);
108
- info(`Current project: ${projectName}`);
109
- console.error("");
110
-
111
- // Get remote manifest
112
- const remoteManifest = await getRemoteManifest(projectName);
113
-
114
- if (!remoteManifest) {
115
- info("Project not synced to cloud yet");
116
- console.error("");
117
- return;
118
- }
119
-
120
- // Get local files and compute checksums
121
- const filteredFiles = await scanProjectFiles(cwd);
122
- const localFiles: ManifestFile[] = [];
123
-
124
- for (const file of filteredFiles) {
125
- const checksum = await computeChecksum(file.absolutePath);
126
- localFiles.push({
127
- path: file.path,
128
- size: file.size,
129
- checksum,
130
- modified: new Date().toISOString(),
131
- });
132
- }
133
-
134
- // Compute diff
135
- const diff = computeDiff(localFiles, remoteManifest);
136
- const totalChanges = diff.added.length + diff.changed.length + diff.deleted.length;
137
-
138
- // Show sync status
139
- success("Sync Status");
140
- item(`Remote files: ${remoteManifest.files.length}`);
141
- item(`Local files: ${localFiles.length}`);
142
- item(`Last sync: ${formatRelativeTime(remoteManifest.lastSync)}`);
143
-
144
- // Show pending changes
145
- if (totalChanges > 0) {
146
- console.error("");
147
- info(`${totalChanges} file(s) have changed`);
148
- if (diff.added.length > 0) {
149
- item(` ${diff.added.length} added`);
150
- }
151
- if (diff.changed.length > 0) {
152
- item(` ${diff.changed.length} modified`);
153
- }
154
- if (diff.deleted.length > 0) {
155
- item(` ${diff.deleted.length} deleted`);
156
- }
157
- console.error("");
158
- item("Run 'jack ship' to sync changes");
159
- } else {
160
- console.error("");
161
- info("All files in sync");
162
- }
163
-
164
- console.error("");
165
- } catch (err) {
166
- console.error("");
167
- error(err instanceof Error ? err.message : String(err));
168
- process.exit(1);
169
- }
170
- }
171
-
172
- /**
173
- * Delete a cloud project
174
- */
175
- async function deleteCommand(args: string[]): Promise<void> {
176
- const [projectName] = args;
177
-
178
- if (!projectName) {
179
- error("Project name required");
180
- info("Usage: jack cloud delete <project-name>");
181
- process.exit(1);
182
- }
183
-
184
- // Check if project exists
185
- outputSpinner.start("Checking project...");
186
- const manifest = await getRemoteManifest(projectName);
187
- outputSpinner.stop();
188
-
189
- if (!manifest) {
190
- error(`Project '${projectName}' not found in cloud storage`);
191
- process.exit(1);
192
- }
193
-
194
- // Show what will be deleted
195
- console.error("");
196
- info(`Project: ${projectName}`);
197
- item(`Files: ${manifest.files.length}`);
198
- item(`Size: ${formatSize(manifest.files.reduce((sum, f) => sum + f.size, 0))}`);
199
- item(`Last sync: ${formatRelativeTime(manifest.lastSync)}`);
200
- console.error("");
201
-
202
- // Confirm deletion
203
- console.error(" Esc to skip\n");
204
- const action = await select({
205
- message: `Delete project '${projectName}' from cloud storage?`,
206
- choices: [
207
- { name: "1. Yes", value: "yes" },
208
- { name: "2. No", value: "no" },
209
- ],
210
- });
211
-
212
- if (action === "no") {
213
- info("Cancelled");
214
- return;
215
- }
216
-
217
- // Delete project
218
- outputSpinner.start("Deleting project...");
219
- const deleted = await deleteCloudProject(projectName);
220
- outputSpinner.stop();
221
-
222
- if (deleted) {
223
- console.error("");
224
- success(`Deleted project '${projectName}' from cloud storage`);
225
- } else {
226
- console.error("");
227
- error("Failed to delete project");
228
- process.exit(1);
229
- }
230
- }
@@ -1,3 +0,0 @@
1
- name = "jack-template"
2
- main = "src/index.ts"
3
- compatibility_date = "2024-12-01"