infra-kit 0.1.94 → 0.1.97
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/.eslintcache +1 -1
- package/.turbo/turbo-eslint-check.log +1 -1
- package/.turbo/turbo-prettier-check.log +1 -1
- package/.turbo/turbo-test.log +7 -7
- package/.turbo/turbo-ts-check.log +1 -1
- package/dist/cli.js +37 -34
- package/dist/cli.js.map +4 -4
- package/dist/mcp.js +28 -25
- package/dist/mcp.js.map +4 -4
- package/package.json +3 -3
- package/src/commands/doctor/doctor.ts +119 -1
- package/src/commands/env-clear/env-clear.ts +1 -1
- package/src/commands/env-list/env-list.ts +1 -1
- package/src/commands/env-load/env-load.ts +1 -1
- package/src/commands/env-status/env-status.ts +1 -1
- package/src/commands/gh-merge-dev/gh-merge-dev.ts +1 -1
- package/src/commands/gh-release-deliver/gh-release-deliver.ts +1 -1
- package/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts +1 -1
- package/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts +1 -1
- package/src/commands/gh-release-list/gh-release-list.ts +1 -1
- package/src/commands/init/init.ts +3 -3
- package/src/commands/release-create/release-create.ts +1 -1
- package/src/commands/release-create-batch/release-create-batch.ts +1 -1
- package/src/commands/version/version.ts +1 -1
- package/src/commands/worktrees-add/index.ts +2 -1
- package/src/commands/worktrees-add/worktrees-add.ts +52 -11
- package/src/commands/worktrees-list/worktrees-list.ts +1 -1
- package/src/commands/worktrees-open/index.ts +1 -0
- package/src/commands/worktrees-open/worktrees-open.ts +197 -0
- package/src/commands/worktrees-remove/worktrees-remove.ts +50 -3
- package/src/commands/worktrees-sync/worktrees-sync.ts +69 -5
- package/src/entry/cli.ts +34 -5
- package/src/integrations/clickup/.gitkeep +0 -0
- package/src/integrations/cmux/index.ts +1 -0
- package/src/integrations/cmux/list-workspace-titles.ts +42 -0
- package/src/integrations/cursor/add-folders-to-workspace.ts +84 -0
- package/src/integrations/cursor/index.ts +4 -0
- package/src/integrations/cursor/reconcile-workspace-folders.ts +90 -0
- package/src/integrations/cursor/remove-folders-from-workspace.ts +93 -0
- package/src/integrations/cursor/resolve-workspace-path.ts +13 -0
- package/src/integrations/doppler/doppler-project.ts +2 -2
- package/src/lib/__tests__/infra-kit-config.test.ts +64 -14
- package/src/lib/git-utils/git-utils.ts +27 -8
- package/src/lib/infra-kit-config/index.ts +2 -0
- package/src/lib/infra-kit-config/infra-kit-config.ts +143 -0
- package/src/mcp/tools/index.ts +2 -0
- package/tsconfig.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/lib/infra-kit-config.ts +0 -69
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import yaml from 'yaml'
|
|
4
|
-
import { z } from 'zod'
|
|
5
|
-
|
|
6
|
-
import { getProjectRoot } from 'src/lib/git-utils'
|
|
7
|
-
|
|
8
|
-
const INFRA_KIT_CONFIG_FILE = 'infra-kit.yml'
|
|
9
|
-
|
|
10
|
-
const jiraTaskManagerProviderSchema = z.object({
|
|
11
|
-
type: z.literal('jira'),
|
|
12
|
-
baseUrl: z.string().url(),
|
|
13
|
-
projectId: z.number().int().positive(),
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
const infraKitConfigSchema = z.object({
|
|
17
|
-
dopplerProjectName: z.string().min(1),
|
|
18
|
-
environments: z.array(z.string().min(1)).min(1),
|
|
19
|
-
taskManagerProvider: z.union([z.string(), z.literal(false), jiraTaskManagerProviderSchema]),
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
export type InfraKitConfig = z.infer<typeof infraKitConfigSchema>
|
|
23
|
-
|
|
24
|
-
interface CacheEntry {
|
|
25
|
-
mtimeMs: number
|
|
26
|
-
value: InfraKitConfig
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
let cached: CacheEntry | null = null
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Read and validate infra-kit.yml. Results are cached per file mtime so the
|
|
33
|
-
* long-running MCP server picks up edits without a restart — if the user edits
|
|
34
|
-
* infra-kit.yml mid-session, the next call re-reads it.
|
|
35
|
-
*/
|
|
36
|
-
export const getInfraKitConfig = async (): Promise<InfraKitConfig> => {
|
|
37
|
-
const projectRoot = await getProjectRoot()
|
|
38
|
-
const configPath = path.join(projectRoot, INFRA_KIT_CONFIG_FILE)
|
|
39
|
-
|
|
40
|
-
let stat: Awaited<ReturnType<typeof fs.stat>>
|
|
41
|
-
|
|
42
|
-
try {
|
|
43
|
-
stat = await fs.stat(configPath)
|
|
44
|
-
} catch {
|
|
45
|
-
cached = null
|
|
46
|
-
throw new Error(`infra-kit.yml not found at ${configPath}`)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (cached && cached.mtimeMs === stat.mtimeMs) {
|
|
50
|
-
return cached.value
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const raw = await fs.readFile(configPath, 'utf-8')
|
|
54
|
-
const parsed = yaml.parse(raw)
|
|
55
|
-
const result = infraKitConfigSchema.safeParse(parsed)
|
|
56
|
-
|
|
57
|
-
if (!result.success) {
|
|
58
|
-
throw new Error(`Invalid infra-kit.yml at ${configPath}: ${result.error.message}`)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
cached = { mtimeMs: stat.mtimeMs, value: result.data }
|
|
62
|
-
|
|
63
|
-
return result.data
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** For tests — drops the in-memory cache. */
|
|
67
|
-
export const resetInfraKitConfigCache = (): void => {
|
|
68
|
-
cached = null
|
|
69
|
-
}
|