@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.
- package/package.json +54 -47
- package/src/commands/agents.ts +145 -10
- package/src/commands/down.ts +110 -102
- package/src/commands/feedback.ts +189 -0
- package/src/commands/init.ts +8 -12
- package/src/commands/login.ts +88 -0
- package/src/commands/logout.ts +14 -0
- package/src/commands/logs.ts +21 -0
- package/src/commands/mcp.ts +134 -7
- package/src/commands/new.ts +43 -17
- package/src/commands/open.ts +13 -6
- package/src/commands/projects.ts +269 -143
- package/src/commands/secrets.ts +413 -0
- package/src/commands/services.ts +96 -123
- package/src/commands/ship.ts +5 -1
- package/src/commands/whoami.ts +31 -0
- package/src/index.ts +218 -144
- package/src/lib/agent-files.ts +34 -0
- package/src/lib/agents.ts +390 -22
- package/src/lib/asset-hash.ts +50 -0
- package/src/lib/auth/client.ts +115 -0
- package/src/lib/auth/constants.ts +5 -0
- package/src/lib/auth/guard.ts +57 -0
- package/src/lib/auth/index.ts +18 -0
- package/src/lib/auth/store.ts +54 -0
- package/src/lib/binding-validator.ts +136 -0
- package/src/lib/build-helper.ts +211 -0
- package/src/lib/cloudflare-api.ts +24 -0
- package/src/lib/config.ts +5 -6
- package/src/lib/control-plane.ts +295 -0
- package/src/lib/debug.ts +3 -1
- package/src/lib/deploy-mode.ts +93 -0
- package/src/lib/deploy-upload.ts +92 -0
- package/src/lib/errors.ts +2 -0
- package/src/lib/github.ts +31 -1
- package/src/lib/hooks.ts +4 -12
- package/src/lib/intent.ts +88 -0
- package/src/lib/jsonc.ts +125 -0
- package/src/lib/local-paths.test.ts +902 -0
- package/src/lib/local-paths.ts +258 -0
- package/src/lib/managed-deploy.ts +175 -0
- package/src/lib/managed-down.ts +159 -0
- package/src/lib/mcp-config.ts +55 -34
- package/src/lib/names.ts +9 -29
- package/src/lib/project-operations.ts +676 -249
- package/src/lib/project-resolver.ts +476 -0
- package/src/lib/registry.ts +76 -37
- package/src/lib/resources.ts +196 -0
- package/src/lib/schema.ts +30 -1
- package/src/lib/storage/file-filter.ts +1 -0
- package/src/lib/storage/index.ts +5 -1
- package/src/lib/telemetry.ts +14 -0
- package/src/lib/tty.ts +15 -0
- package/src/lib/zip-packager.ts +255 -0
- package/src/mcp/resources/index.ts +8 -2
- package/src/mcp/server.ts +32 -4
- package/src/mcp/tools/index.ts +35 -13
- package/src/mcp/types.ts +6 -0
- package/src/mcp/utils.ts +1 -1
- package/src/templates/index.ts +42 -4
- package/src/templates/types.ts +13 -0
- package/templates/CLAUDE.md +166 -0
- package/templates/api/.jack.json +4 -0
- package/templates/api/bun.lock +1 -0
- package/templates/api/wrangler.jsonc +5 -0
- package/templates/hello/.jack.json +28 -0
- package/templates/hello/package.json +10 -0
- package/templates/hello/src/index.ts +11 -0
- package/templates/hello/tsconfig.json +11 -0
- package/templates/hello/wrangler.jsonc +5 -0
- package/templates/miniapp/.jack.json +15 -4
- package/templates/miniapp/bun.lock +135 -40
- package/templates/miniapp/index.html +1 -0
- package/templates/miniapp/package.json +3 -1
- package/templates/miniapp/public/.well-known/farcaster.json +7 -5
- package/templates/miniapp/public/icon.png +0 -0
- package/templates/miniapp/public/og.png +0 -0
- package/templates/miniapp/schema.sql +8 -0
- package/templates/miniapp/src/App.tsx +254 -3
- package/templates/miniapp/src/components/ShareSheet.tsx +147 -0
- package/templates/miniapp/src/hooks/useAI.ts +35 -0
- package/templates/miniapp/src/hooks/useGuestbook.ts +11 -1
- package/templates/miniapp/src/hooks/useShare.ts +76 -0
- package/templates/miniapp/src/index.css +15 -0
- package/templates/miniapp/src/lib/api.ts +2 -1
- package/templates/miniapp/src/worker.ts +515 -1
- package/templates/miniapp/wrangler.jsonc +15 -3
- package/LICENSE +0 -190
- package/README.md +0 -55
- package/src/commands/cloud.ts +0 -230
- package/templates/api/wrangler.toml +0 -3
package/src/lib/mcp-config.ts
CHANGED
|
@@ -14,18 +14,18 @@ export interface McpServerConfig {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* App-specific MCP configuration paths and settings
|
|
18
18
|
*/
|
|
19
|
-
interface
|
|
19
|
+
interface AppMcpConfig {
|
|
20
20
|
path: string;
|
|
21
21
|
key: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* Maps
|
|
25
|
+
* App MCP configuration paths
|
|
26
|
+
* Maps app ID to its config file path and MCP servers key
|
|
27
27
|
*/
|
|
28
|
-
export const
|
|
28
|
+
export const APP_MCP_CONFIGS: Record<string, AppMcpConfig> = {
|
|
29
29
|
"claude-code": {
|
|
30
30
|
path: join(homedir(), ".claude.json"),
|
|
31
31
|
key: "mcpServers",
|
|
@@ -49,64 +49,85 @@ const JACK_MCP_CONFIG_PATH = join(JACK_MCP_CONFIG_DIR, "config.json");
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Returns the jack MCP server configuration
|
|
52
|
+
* Includes PATH with common install locations so Claude Desktop can find jack
|
|
52
53
|
*/
|
|
53
54
|
export function getJackMcpConfig(): McpServerConfig {
|
|
55
|
+
// Build PATH with common locations where jack might be installed
|
|
56
|
+
// ~/.bun/bin is where `bun link` installs global commands
|
|
57
|
+
const bunBin = join(homedir(), ".bun", "bin");
|
|
58
|
+
const npmBin = join(homedir(), ".npm-global", "bin");
|
|
59
|
+
const defaultPaths = [bunBin, npmBin, "/opt/homebrew/bin", "/usr/local/bin", "/usr/bin", "/bin"];
|
|
60
|
+
|
|
54
61
|
return {
|
|
55
62
|
command: "jack",
|
|
56
63
|
args: ["mcp", "serve"],
|
|
64
|
+
env: {
|
|
65
|
+
PATH: defaultPaths.join(":"),
|
|
66
|
+
},
|
|
57
67
|
};
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
/**
|
|
61
|
-
* Get display name for
|
|
71
|
+
* Get display name for app
|
|
62
72
|
*/
|
|
63
|
-
export function
|
|
73
|
+
export function getAppDisplayName(appId: string): string {
|
|
64
74
|
const displayNames: Record<string, string> = {
|
|
65
75
|
"claude-code": "Claude Code",
|
|
66
76
|
"claude-desktop": "Claude Desktop",
|
|
67
77
|
};
|
|
68
|
-
return displayNames[
|
|
78
|
+
return displayNames[appId] || appId;
|
|
69
79
|
}
|
|
70
80
|
|
|
71
81
|
/**
|
|
72
|
-
* Check if an
|
|
82
|
+
* Check if an app is installed
|
|
83
|
+
*
|
|
84
|
+
* Detection strategies per app:
|
|
85
|
+
* - claude-code: Check for ~/.claude/ directory (created when Claude Code is installed/run)
|
|
86
|
+
* - claude-desktop: Check if config directory exists (created when app is first run)
|
|
73
87
|
*/
|
|
74
|
-
export function
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
88
|
+
export function isAppInstalled(appId: string): boolean {
|
|
89
|
+
const appConfig = APP_MCP_CONFIGS[appId];
|
|
90
|
+
if (!appConfig) return false;
|
|
91
|
+
|
|
92
|
+
if (appId === "claude-code") {
|
|
93
|
+
// Claude Code creates ~/.claude/ directory when installed
|
|
94
|
+
// Don't use parent of ~/.claude.json (that's ~, which always exists)
|
|
95
|
+
const claudeCodeDataDir = join(homedir(), ".claude");
|
|
96
|
+
return existsSync(claudeCodeDataDir);
|
|
97
|
+
}
|
|
77
98
|
|
|
78
|
-
//
|
|
79
|
-
const configDir = dirname(
|
|
99
|
+
// For other apps (claude-desktop), check if config directory exists
|
|
100
|
+
const configDir = dirname(appConfig.path);
|
|
80
101
|
return existsSync(configDir);
|
|
81
102
|
}
|
|
82
103
|
|
|
83
104
|
/**
|
|
84
|
-
* Install MCP config to a single
|
|
105
|
+
* Install MCP config to a single app
|
|
85
106
|
* Reads existing config, merges jack server, writes back
|
|
86
107
|
* Returns true on success
|
|
87
108
|
*/
|
|
88
|
-
export async function
|
|
89
|
-
const
|
|
90
|
-
if (!
|
|
91
|
-
throw new Error(`Unknown
|
|
109
|
+
export async function installMcpConfigToApp(appId: string): Promise<boolean> {
|
|
110
|
+
const appConfig = APP_MCP_CONFIGS[appId];
|
|
111
|
+
if (!appConfig) {
|
|
112
|
+
throw new Error(`Unknown app: ${appId}`);
|
|
92
113
|
}
|
|
93
114
|
|
|
94
115
|
// Ensure parent directory exists
|
|
95
|
-
const configDir = dirname(
|
|
116
|
+
const configDir = dirname(appConfig.path);
|
|
96
117
|
if (!existsSync(configDir)) {
|
|
97
118
|
try {
|
|
98
119
|
await mkdir(configDir, { recursive: true });
|
|
99
120
|
} catch (error) {
|
|
100
|
-
// Directory doesn't exist and can't be created -
|
|
121
|
+
// Directory doesn't exist and can't be created - app not installed
|
|
101
122
|
return false;
|
|
102
123
|
}
|
|
103
124
|
}
|
|
104
125
|
|
|
105
126
|
// Read existing config or start with empty object
|
|
106
127
|
let existingConfig: Record<string, unknown> = {};
|
|
107
|
-
if (existsSync(
|
|
128
|
+
if (existsSync(appConfig.path)) {
|
|
108
129
|
try {
|
|
109
|
-
existingConfig = await Bun.file(
|
|
130
|
+
existingConfig = await Bun.file(appConfig.path).json();
|
|
110
131
|
} catch {
|
|
111
132
|
// Invalid JSON - treat as empty config
|
|
112
133
|
existingConfig = {};
|
|
@@ -114,17 +135,17 @@ export async function installMcpConfigToIde(ideId: string): Promise<boolean> {
|
|
|
114
135
|
}
|
|
115
136
|
|
|
116
137
|
// Get or create mcpServers object
|
|
117
|
-
const mcpServers = (existingConfig[
|
|
138
|
+
const mcpServers = (existingConfig[appConfig.key] as Record<string, unknown>) || {};
|
|
118
139
|
|
|
119
140
|
// Add/update jack MCP server
|
|
120
141
|
mcpServers.jack = getJackMcpConfig();
|
|
121
142
|
|
|
122
143
|
// Merge back into config
|
|
123
|
-
existingConfig[
|
|
144
|
+
existingConfig[appConfig.key] = mcpServers;
|
|
124
145
|
|
|
125
146
|
// Write updated config
|
|
126
147
|
try {
|
|
127
|
-
await Bun.write(
|
|
148
|
+
await Bun.write(appConfig.path, JSON.stringify(existingConfig, null, 2));
|
|
128
149
|
return true;
|
|
129
150
|
} catch {
|
|
130
151
|
// Write failed (permissions, etc.)
|
|
@@ -133,22 +154,22 @@ export async function installMcpConfigToIde(ideId: string): Promise<boolean> {
|
|
|
133
154
|
}
|
|
134
155
|
|
|
135
156
|
/**
|
|
136
|
-
* Install to ALL detected/installed
|
|
137
|
-
* Returns array of
|
|
157
|
+
* Install to ALL detected/installed apps
|
|
158
|
+
* Returns array of app IDs that were configured
|
|
138
159
|
*/
|
|
139
|
-
export async function
|
|
160
|
+
export async function installMcpConfigsToAllApps(): Promise<string[]> {
|
|
140
161
|
const configured: string[] = [];
|
|
141
162
|
|
|
142
|
-
for (const
|
|
143
|
-
// Check if
|
|
144
|
-
if (!
|
|
163
|
+
for (const appId of Object.keys(APP_MCP_CONFIGS)) {
|
|
164
|
+
// Check if app is installed
|
|
165
|
+
if (!isAppInstalled(appId)) {
|
|
145
166
|
continue;
|
|
146
167
|
}
|
|
147
168
|
|
|
148
169
|
// Try to install config
|
|
149
|
-
const success = await
|
|
170
|
+
const success = await installMcpConfigToApp(appId);
|
|
150
171
|
if (success) {
|
|
151
|
-
configured.push(
|
|
172
|
+
configured.push(appId);
|
|
152
173
|
}
|
|
153
174
|
}
|
|
154
175
|
|
package/src/lib/names.ts
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
"swift",
|
|
3
|
-
"bright",
|
|
4
|
-
"calm",
|
|
5
|
-
"bold",
|
|
6
|
-
"cool",
|
|
7
|
-
"fast",
|
|
8
|
-
"keen",
|
|
9
|
-
"neat",
|
|
10
|
-
"warm",
|
|
11
|
-
"wise",
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
const nouns = [
|
|
15
|
-
"wave",
|
|
16
|
-
"spark",
|
|
17
|
-
"cloud",
|
|
18
|
-
"star",
|
|
19
|
-
"leaf",
|
|
20
|
-
"stone",
|
|
21
|
-
"wind",
|
|
22
|
-
"flame",
|
|
23
|
-
"brook",
|
|
24
|
-
"ridge",
|
|
25
|
-
];
|
|
1
|
+
import { humanId } from "human-id";
|
|
26
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Generate a Heroku-style project name
|
|
5
|
+
* Examples: "brave-moon-7xz", "calm-star-2ab"
|
|
6
|
+
*/
|
|
27
7
|
export function generateProjectName(): string {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
return humanId({
|
|
9
|
+
separator: "-",
|
|
10
|
+
capitalize: false,
|
|
11
|
+
});
|
|
32
12
|
}
|