@intra-mart/accel 0.5.0-dev.202608030656 → 0.5.0-dev.202608180918
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/README.md +103 -32
- package/dist/asset/deployer.d.ts +2 -0
- package/dist/asset/deployer.js +11 -9
- package/dist/asset/git-provider.d.ts +1 -0
- package/dist/asset/git-provider.js +20 -9
- package/dist/asset/updater.d.ts +9 -2
- package/dist/asset/updater.js +12 -6
- package/dist/asset/walker.d.ts +2 -1
- package/dist/asset/walker.js +36 -0
- package/dist/commands/asset-provider.d.ts +1 -1
- package/dist/commands/asset-provider.js +2 -2
- package/dist/commands/attach.d.ts +116 -82
- package/dist/commands/attach.js +176 -145
- package/dist/commands/cache.js +11 -19
- package/dist/commands/deploy.d.ts +53 -32
- package/dist/commands/deploy.js +112 -75
- package/dist/commands/detach.d.ts +18 -0
- package/dist/commands/detach.js +69 -54
- package/dist/commands/init.d.ts +117 -83
- package/dist/commands/init.js +119 -98
- package/dist/commands/login.d.ts +12 -10
- package/dist/commands/login.js +14 -10
- package/dist/commands/preset.d.ts +31 -0
- package/dist/commands/preset.js +389 -0
- package/dist/commands/run-wrapper.d.ts +15 -0
- package/dist/commands/run-wrapper.js +62 -0
- package/dist/commands/switch.d.ts +49 -17
- package/dist/commands/switch.js +206 -122
- package/dist/commands/update.d.ts +142 -83
- package/dist/commands/update.js +359 -261
- package/dist/core/color-env.d.ts +1 -0
- package/dist/core/color-env.js +6 -0
- package/dist/core/constants.d.ts +0 -1
- package/dist/core/constants.js +0 -3
- package/dist/core/errors.d.ts +6 -0
- package/dist/core/errors.js +16 -0
- package/dist/core/logger.d.ts +15 -0
- package/dist/core/logger.js +1 -0
- package/dist/core/paths.d.ts +6 -0
- package/dist/core/paths.js +22 -0
- package/dist/core/types.d.ts +14 -1
- package/dist/core/validation.d.ts +34 -0
- package/dist/core/validation.js +87 -0
- package/dist/core/validators.d.ts +2 -0
- package/dist/core/validators.js +7 -0
- package/dist/deploy/api-client.d.ts +1 -0
- package/dist/deploy/api-client.js +7 -1
- package/dist/git/config-file.d.ts +3 -0
- package/dist/git/config-file.js +178 -0
- package/dist/git/errors.d.ts +5 -0
- package/dist/git/errors.js +21 -2
- package/dist/git/git-objects.d.ts +11 -0
- package/dist/git/git-objects.js +49 -0
- package/dist/git/http.d.ts +2 -2
- package/dist/git/http.js +22 -10
- package/dist/git/index-file.d.ts +17 -0
- package/dist/git/index-file.js +111 -0
- package/dist/git/object-cache.d.ts +1 -0
- package/dist/git/object-cache.js +11 -15
- package/dist/git/object-store.d.ts +4 -0
- package/dist/git/object-store.js +82 -107
- package/dist/git/pack-parse.d.ts +19 -0
- package/dist/git/pack-parse.js +261 -0
- package/dist/git/pack-store.d.ts +20 -0
- package/dist/git/pack-store.js +144 -0
- package/dist/git/read-capped.d.ts +1 -0
- package/dist/git/read-capped.js +26 -0
- package/dist/git/redact-url.d.ts +1 -0
- package/dist/git/redact-url.js +14 -0
- package/dist/git/repo-layout.d.ts +5 -0
- package/dist/git/repo-layout.js +44 -0
- package/dist/git/smart-http.d.ts +3 -2
- package/dist/git/smart-http.js +5 -5
- package/dist/git/untracked.d.ts +11 -0
- package/dist/git/untracked.js +93 -0
- package/dist/git/worktree-status.d.ts +4 -0
- package/dist/git/worktree-status.js +140 -0
- package/dist/git/zlib-inflate.d.ts +7 -0
- package/dist/git/zlib-inflate.js +78 -0
- package/dist/i18n/en.js +47 -0
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/ja.js +47 -0
- package/dist/i18n/zh_CN.js +47 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -2
- package/dist/interactive/asset-messages.d.ts +2 -1
- package/dist/interactive/asset-messages.js +4 -4
- package/dist/interactive/clack-logger.d.ts +2 -0
- package/dist/interactive/clack-logger.js +11 -0
- package/dist/interactive/credential-auth.d.ts +2 -0
- package/dist/interactive/credential-auth.js +7 -6
- package/dist/interactive/credentials-prompts.js +10 -6
- package/dist/interactive/next-steps.d.ts +2 -1
- package/dist/interactive/next-steps.js +3 -3
- package/dist/interactive/progress.d.ts +8 -1
- package/dist/interactive/progress.js +0 -0
- package/dist/interactive/prompts.d.ts +3 -33
- package/dist/interactive/prompts.js +23 -111
- package/dist/interactive/summary.d.ts +2 -1
- package/dist/interactive/summary.js +3 -3
- package/dist/juggling/resolve.d.ts +7 -0
- package/dist/juggling/resolve.js +18 -0
- package/dist/lib.d.ts +34 -0
- package/dist/lib.js +29 -0
- package/dist/utils/args.d.ts +4 -1
- package/dist/utils/args.js +26 -3
- package/dist/utils/githooks-sync.d.ts +3 -1
- package/dist/utils/githooks-sync.js +37 -37
- package/dist/utils/mcp-generate.d.ts +26 -0
- package/dist/utils/mcp-generate.js +313 -0
- package/dist/utils/preset-io.d.ts +24 -0
- package/dist/utils/preset-io.js +167 -0
- package/dist/utils/settings-io.d.ts +2 -0
- package/dist/utils/settings-io.js +2 -2
- package/package.json +20 -13
- package/dist/utils/mcp-sync.d.ts +0 -4
- package/dist/utils/mcp-sync.js +0 -103
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intra-mart/accel",
|
|
3
|
-
"version": "0.5.0-dev.
|
|
3
|
+
"version": "0.5.0-dev.202608180918",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tool for intra-mart Accel Platform development",
|
|
6
6
|
"author": "NTT DATA INTRAMART",
|
|
@@ -18,6 +18,13 @@
|
|
|
18
18
|
"bin": {
|
|
19
19
|
"accel": "dist/index.js"
|
|
20
20
|
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/lib.d.ts",
|
|
24
|
+
"default": "./dist/lib.js"
|
|
25
|
+
},
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
21
28
|
"files": [
|
|
22
29
|
"dist",
|
|
23
30
|
"assets"
|
|
@@ -38,23 +45,23 @@
|
|
|
38
45
|
"typecheck": "tsc --noEmit"
|
|
39
46
|
},
|
|
40
47
|
"dependencies": {
|
|
41
|
-
"@clack/prompts": "^1.
|
|
48
|
+
"@clack/prompts": "^1.7.0",
|
|
42
49
|
"@intra-mart/catalog": "0.1.0-dev.202606250213",
|
|
43
|
-
"citty": "^0.
|
|
44
|
-
"fast-xml-parser": "^5.
|
|
45
|
-
"
|
|
50
|
+
"citty": "^0.2.2",
|
|
51
|
+
"fast-xml-parser": "^5.10.1",
|
|
52
|
+
"ignore": "^7.0.6",
|
|
46
53
|
"node-diff3": "^3.2.1",
|
|
47
54
|
"remark-parse": "^11.0.0",
|
|
48
|
-
"semver": "^7.
|
|
49
|
-
"smol-toml": "^1.
|
|
50
|
-
"undici": "^8.
|
|
55
|
+
"semver": "^7.8.5",
|
|
56
|
+
"smol-toml": "^1.7.1",
|
|
57
|
+
"undici": "^8.10.0",
|
|
51
58
|
"unified": "^11.0.5"
|
|
52
59
|
},
|
|
53
60
|
"devDependencies": {
|
|
54
|
-
"@types/node": "^24",
|
|
55
|
-
"@types/semver": "^7.
|
|
56
|
-
"execa": "^
|
|
57
|
-
"typescript": "^
|
|
58
|
-
"vitest": "^
|
|
61
|
+
"@types/node": "^24.13.3",
|
|
62
|
+
"@types/semver": "^7.8.0",
|
|
63
|
+
"execa": "^10.0.1",
|
|
64
|
+
"typescript": "^7.0.2",
|
|
65
|
+
"vitest": "^4.1.10"
|
|
59
66
|
}
|
|
60
67
|
}
|
package/dist/utils/mcp-sync.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { AccelCredentials } from "../core/types.js";
|
|
2
|
-
export declare const matchesEndpoint: (url: string, endpoint: string) => boolean;
|
|
3
|
-
export declare const syncMcpAuthorization: (projectDir: string, creds: AccelCredentials) => Promise<void>;
|
|
4
|
-
export declare const persistCredentialsAndSyncMcp: (projectDir: string, creds: AccelCredentials) => Promise<void>;
|
package/dist/utils/mcp-sync.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
|
|
4
|
-
import { persistCredentials } from "./credentials.js";
|
|
5
|
-
import { syncGitHooks } from "./githooks-sync.js";
|
|
6
|
-
import { readSettingsSafe } from "./settings-io.js";
|
|
7
|
-
const AUTHORIZATION_HEADER = "Authorization";
|
|
8
|
-
export const matchesEndpoint = (url, endpoint) => {
|
|
9
|
-
if (typeof url !== "string" || url.length === 0)
|
|
10
|
-
return false;
|
|
11
|
-
if (typeof endpoint !== "string" || endpoint.length === 0)
|
|
12
|
-
return false;
|
|
13
|
-
if (url === endpoint)
|
|
14
|
-
return true;
|
|
15
|
-
return url.startsWith(endpoint + "/");
|
|
16
|
-
};
|
|
17
|
-
const updateServers = (servers, endpoint, bearer, rules) => {
|
|
18
|
-
if (!servers || typeof servers !== "object")
|
|
19
|
-
return 0;
|
|
20
|
-
let updated = 0;
|
|
21
|
-
for (const value of Object.values(servers)) {
|
|
22
|
-
if (!value || typeof value !== "object")
|
|
23
|
-
continue;
|
|
24
|
-
const entry = value;
|
|
25
|
-
if (rules.requireHttpType && entry.type !== "http")
|
|
26
|
-
continue;
|
|
27
|
-
if (typeof entry.url !== "string")
|
|
28
|
-
continue;
|
|
29
|
-
if (!matchesEndpoint(entry.url, endpoint))
|
|
30
|
-
continue;
|
|
31
|
-
if (rules.shouldSkip?.(entry))
|
|
32
|
-
continue;
|
|
33
|
-
const existing = entry[rules.headersKey];
|
|
34
|
-
const headers = existing && typeof existing === "object"
|
|
35
|
-
? existing
|
|
36
|
-
: {};
|
|
37
|
-
headers[AUTHORIZATION_HEADER] = bearer;
|
|
38
|
-
entry[rules.headersKey] = headers;
|
|
39
|
-
updated++;
|
|
40
|
-
}
|
|
41
|
-
return updated;
|
|
42
|
-
};
|
|
43
|
-
const syncJsonFile = async (filePath, serversKey, endpoint, bearer) => {
|
|
44
|
-
try {
|
|
45
|
-
const content = await readFile(filePath, "utf-8");
|
|
46
|
-
const doc = JSON.parse(content);
|
|
47
|
-
const updated = updateServers(doc[serversKey], endpoint, bearer, {
|
|
48
|
-
headersKey: "headers",
|
|
49
|
-
requireHttpType: true,
|
|
50
|
-
});
|
|
51
|
-
if (updated > 0) {
|
|
52
|
-
await writeFile(filePath, JSON.stringify(doc, null, 2) + "\n", "utf-8");
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const syncCodexToml = async (filePath, endpoint, bearer) => {
|
|
59
|
-
try {
|
|
60
|
-
const content = await readFile(filePath, "utf-8");
|
|
61
|
-
const doc = parseToml(content);
|
|
62
|
-
const updated = updateServers(doc.mcp_servers, endpoint, bearer, {
|
|
63
|
-
headersKey: "http_headers",
|
|
64
|
-
requireHttpType: false,
|
|
65
|
-
shouldSkip: (entry) => "env_http_headers" in entry,
|
|
66
|
-
});
|
|
67
|
-
if (updated > 0) {
|
|
68
|
-
const out = stringifyToml(doc);
|
|
69
|
-
await writeFile(filePath, out.endsWith("\n") ? out : out + "\n", "utf-8");
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
export const syncMcpAuthorization = async (projectDir, creds) => {
|
|
76
|
-
const settings = await readSettingsSafe(projectDir);
|
|
77
|
-
if (!settings)
|
|
78
|
-
return;
|
|
79
|
-
const agents = settings.agents ?? [];
|
|
80
|
-
const bearer = `Bearer ${creds.apiKey}`;
|
|
81
|
-
if (agents.includes("claude-code")) {
|
|
82
|
-
await syncJsonFile(join(projectDir, ".mcp.json"), "mcpServers", creds.endpoint, bearer);
|
|
83
|
-
}
|
|
84
|
-
if (agents.includes("codex")) {
|
|
85
|
-
await syncCodexToml(join(projectDir, ".codex", "config.toml"), creds.endpoint, bearer);
|
|
86
|
-
}
|
|
87
|
-
if (agents.includes("github-copilot")) {
|
|
88
|
-
await syncJsonFile(join(projectDir, ".vscode", "mcp.json"), "servers", creds.endpoint, bearer);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
export const persistCredentialsAndSyncMcp = async (projectDir, creds) => {
|
|
92
|
-
await persistCredentials(projectDir, creds);
|
|
93
|
-
try {
|
|
94
|
-
await syncMcpAuthorization(projectDir, creds);
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
await syncGitHooks(projectDir);
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
}
|
|
103
|
-
};
|