infra-kit 0.1.127 → 0.1.128
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/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +10 -0
- package/.turbo/turbo-check.log +1 -1
- package/.turbo/turbo-infra-kit-check.log +14 -0
- package/.turbo/turbo-test.log +243 -243
- package/dist/{chunk-SGR2XAVR.js → chunk-QBHCWAAG.js} +27 -27
- package/dist/chunk-QBHCWAAG.js.map +7 -0
- package/dist/chunk-YSBF5C7C.js +2 -0
- package/dist/chunk-YSBF5C7C.js.map +7 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp.js +1 -1
- package/package.json +2 -2
- package/src/commands/audit/.omc/state/agent-replay-f9c17a0e-2dd8-4f7d-badf-631f266c5d4c.jsonl +4 -0
- package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/mission-state.json +79 -0
- package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +22 -0
- package/src/commands/audit/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/subagent-tracking-state.json +26 -0
- package/src/commands/audit/audit.ts +1 -1
- package/src/commands/init/__tests__/shell-body.test.ts +31 -0
- package/src/commands/init/init.ts +18 -3
- package/src/lib/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +18 -0
- package/src/lib/package-config/package-config.ts +2 -2
- package/src/lib/package-validator/.omc/state/sessions/f9c17a0e-2dd8-4f7d-badf-631f266c5d4c/pre-tool-advisory-throttle.json +10 -0
- package/src/lib/package-validator/__tests__/package-validator.test.ts +9 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-SGR2XAVR.js.map +0 -7
- package/dist/chunk-WA4BQRDC.js +0 -2
- package/dist/chunk-WA4BQRDC.js.map +0 -7
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var a=e=>e,n={requiredScripts:["build","ts-check","eslint-check","prettier-check","test"],requiredFiles:["tsconfig.json","eslint.config.js","readme.md"],turboTasks:[]},c={requiredScripts:["build","dev","test","qa","infra-kit-check","fix"],requiredFiles:["turbo.json","pnpm-workspace.yaml"],turboTasks:["build","test","ts-check","eslint-check","prettier-check","infra-kit-check"]},d=(e,t=n)=>({requiredScripts:e.requiredScripts??[...t.requiredScripts],requiredFiles:e.requiredFiles??[...t.requiredFiles],turboTasks:e.turbo?.requiredTasks??[...t.turboTasks]});import{z as r}from"zod";var p="vendor.config.ts",o=r.string().refine(e=>{let t=/^(?:[/\\]|[a-z]:)/i.test(e),i=e.split(/[\\/]/).includes("..");return!t&&!i&&e.trim().length>0},{message:'must be a non-empty repo-relative path without ".." segments'}),s=r.object({name:r.string(),source:o,target:o,type:r.enum(["file","directory"]),vendored:r.boolean().optional()}),f=r.object({copy:r.array(s)}).strict(),l=e=>e;export{a,n as b,c,d,p as e,f,l as g};
|
|
2
|
+
//# sourceMappingURL=chunk-YSBF5C7C.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/package-config/package-config.ts", "../src/lib/vendor/config-schema.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Validation rules for a single workspace package, declared in its\n * `infra-kit.config.js`. Every field is optional: a key left unset falls back to\n * the active baseline ({@link DEFAULT_RULES} for packages, {@link ROOT_DEFAULT_RULES}\n * for the monorepo root), and a key set replaces that default wholesale (per-key,\n * no array concatenation) so a package can opt out with an explicit empty array.\n *\n * Most packages need none of these \u2014 the standard rules live in the baseline, so\n * a typical config is just `defineConfig(() => ({}))`.\n *\n * @example\n * // infra-kit.config.js\n * import { defineConfig } from 'infra-kit'\n *\n * export default defineConfig(() => ({}))\n */\nexport interface InfraKitPackageConfig {\n /** Scripts that must be present in the package's package.json `scripts` map. */\n requiredScripts?: string[]\n /** Files (relative to the package root) that must exist on disk. */\n requiredFiles?: string[]\n /** Turborepo expectations \u2014 only meaningful where a turbo.json lives (the root). */\n turbo?: {\n /** Tasks that must be defined in turbo.json `tasks`. */\n requiredTasks?: string[]\n }\n}\n\n/**\n * Accepted shapes for a package config's default export \u2014 mirrors Vite's\n * `defineConfig` input: a plain object, a sync factory, or an async factory.\n */\nexport type InfraKitPackageConfigInput =\n InfraKitPackageConfig | (() => InfraKitPackageConfig) | (() => Promise<InfraKitPackageConfig>)\n\n/**\n * Identity helper that gives `infra-kit.config.js` authors full type inference\n * and editor autocomplete without changing the value \u2014 exactly like Vite's\n * `defineConfig`. Resolution of the factory form happens in the loader, not here.\n *\n * @example\n * export default defineConfig(() => ({}))\n *\n * @example\n * export default defineConfig(() => ({ requiredScripts: [] }))\n */\nexport const defineConfig = (config: InfraKitPackageConfigInput): InfraKitPackageConfigInput => {\n return config\n}\n\n/** Fully-resolved rules with every defaultable field present. */\nexport interface ResolvedPackageRules {\n requiredScripts: string[]\n requiredFiles: string[]\n turboTasks: string[]\n}\n\n/**\n * Baseline rules for a standard TypeScript workspace package, applied to any key\n * a package leaves unset. These are the \"under the hood\" defaults so a conforming\n * package's config can stay empty; non-standard packages override the relevant key.\n */\nexport const DEFAULT_RULES: Readonly<ResolvedPackageRules> = {\n requiredScripts: ['build', 'ts-check', 'eslint-check', 'prettier-check', 'test'],\n requiredFiles: ['tsconfig.json', 'eslint.config.js', 'readme.md'],\n turboTasks: [],\n}\n\n/**\n * Baseline rules for the monorepo root (`infra-kit audit --root`). Checks the\n * root commands, the workspace/turbo files, and that the turbo pipeline defines\n * the expected tasks \u2014 so the root's own config can also stay empty.\n */\nexport const ROOT_DEFAULT_RULES: Readonly<ResolvedPackageRules> = {\n requiredScripts: ['build', 'dev', 'test', 'qa', 'infra-kit-check', 'fix'],\n requiredFiles: ['turbo.json', 'pnpm-workspace.yaml'],\n turboTasks: ['build', 'test', 'ts-check', 'eslint-check', 'prettier-check', 'infra-kit-check'],\n}\n\n/**\n * Merge a parsed package config over a baseline. Each key is replaced wholesale\n * when the package provides it, otherwise the baseline value is used.\n *\n * @example\n * resolvePackageConfig({ requiredScripts: [] })\n * // => { requiredScripts: [], requiredFiles: [...DEFAULT_RULES.requiredFiles], turboTasks: [] }\n */\nexport const resolvePackageConfig = (\n config: InfraKitPackageConfig,\n baseline: Readonly<ResolvedPackageRules> = DEFAULT_RULES,\n): ResolvedPackageRules => {\n return {\n requiredScripts: config.requiredScripts ?? [...baseline.requiredScripts],\n requiredFiles: config.requiredFiles ?? [...baseline.requiredFiles],\n turboTasks: config.turbo?.requiredTasks ?? [...baseline.turboTasks],\n }\n}\n", "import { z } from 'zod'\n\n/**\n * Pure (node-free) vendor config schema + authoring helper. Kept separate from\n * `config.ts` (which imports node builtins for the runtime loader) so the public\n * lib entry can re-export `defineVendorConfig` without dragging node types into\n * the emitted `.d.ts`.\n */\n\n/**\n * Filename a source repo provides at its root to declare WHAT `vendor sync`\n * copies (`copy[]`). Lives ONLY on the write path \u2014 `vendor check` never loads it.\n * WHERE/WHICH to stamp (`workspaceDir` + `targets`) is machine-local and lives in\n * the user-global factory config (`~/.infra-kit/vendor.json`).\n */\nexport const VENDOR_CONFIG_FILE = 'vendor.config.ts'\n\n/**\n * A non-empty, repo-relative path with no `..` segments and no absolute prefix\n * (POSIX `/`, UNC/`\\`, or a Windows drive like `C:`). Containment guard for\n * vendor copy items so a malicious/typo config can't read or write outside the\n * source/target repo roots. Kept as a string/regex check (no `node:path`) to\n * respect this file's node-free constraint \u2014 `sync-ops.ts` does the resolved\n * runtime containment assert as defense in depth.\n */\nconst safeRelPath = z.string().refine(\n (p) => {\n const isAbsolute = /^(?:[/\\\\]|[a-z]:)/i.test(p)\n const hasDotDotSegment = p.split(/[\\\\/]/).includes('..')\n\n return !isAbsolute && !hasDotDotSegment && p.trim().length > 0\n },\n { message: 'must be a non-empty repo-relative path without \"..\" segments' },\n)\n\n/**\n * One item to sync from the source repo into each target. `vendored: true` marks\n * workspace packages that must land under `vendor/` (the single-source-of-truth\n * code); everything else is root-level tooling that stays at the repo root.\n */\nexport const vendorCopyItemSchema = z.object({\n name: z.string(),\n source: safeRelPath,\n target: safeRelPath,\n type: z.enum(['file', 'directory']),\n vendored: z.boolean().optional(),\n})\n\nexport const vendorConfigSchema = z\n .object({\n /** Files/dirs to copy. Items with `vendored: true` land under `vendor/`. */\n copy: z.array(vendorCopyItemSchema),\n })\n // Reject stray keys so a leftover `targets` (now machine-local, in\n // ~/.infra-kit/vendor.json) yields a clear \"unrecognized key\" error rather\n // than being silently ignored.\n .strict()\n\nexport type VendorCopyItem = z.infer<typeof vendorCopyItemSchema>\nexport type VendorConfig = z.infer<typeof vendorConfigSchema>\n\n/**\n * Identity helper for authoring a type-safe `vendor.config.ts` in a source repo.\n * Re-exported from the public lib entry so a source repo can\n * `import { defineVendorConfig } from 'infra-kit'`.\n *\n * NOTE: a `vendor.config.ts` must be type-strippable \u2014 Node's native type\n * stripping (Node >= 24) loads it without a build step, which forbids `enum`,\n * `namespace`, and parameter properties.\n *\n * @example\n * export default defineVendorConfig({\n * copy: [{ name: 'Configs', source: 'vendor/configs', target: 'vendor/configs', type: 'directory', vendored: true }],\n * })\n */\nexport const defineVendorConfig = (config: VendorConfig): VendorConfig => {\n return config\n}\n"],
|
|
5
|
+
"mappings": "AA8CO,IAAMA,EAAgBC,GACpBA,EAeIC,EAAgD,CAC3D,gBAAiB,CAAC,QAAS,WAAY,eAAgB,iBAAkB,MAAM,EAC/E,cAAe,CAAC,gBAAiB,mBAAoB,WAAW,EAChE,WAAY,CAAC,CACf,EAOaC,EAAqD,CAChE,gBAAiB,CAAC,QAAS,MAAO,OAAQ,KAAM,kBAAmB,KAAK,EACxE,cAAe,CAAC,aAAc,qBAAqB,EACnD,WAAY,CAAC,QAAS,OAAQ,WAAY,eAAgB,iBAAkB,iBAAiB,CAC/F,EAUaC,EAAuB,CAClCH,EACAI,EAA2CH,KAEpC,CACL,gBAAiBD,EAAO,iBAAmB,CAAC,GAAGI,EAAS,eAAe,EACvE,cAAeJ,EAAO,eAAiB,CAAC,GAAGI,EAAS,aAAa,EACjE,WAAYJ,EAAO,OAAO,eAAiB,CAAC,GAAGI,EAAS,UAAU,CACpE,GC/FF,OAAS,KAAAC,MAAS,MAeX,IAAMC,EAAqB,mBAU5BC,EAAcF,EAAE,OAAO,EAAE,OAC5BG,GAAM,CACL,IAAMC,EAAa,qBAAqB,KAAKD,CAAC,EACxCE,EAAmBF,EAAE,MAAM,OAAO,EAAE,SAAS,IAAI,EAEvD,MAAO,CAACC,GAAc,CAACC,GAAoBF,EAAE,KAAK,EAAE,OAAS,CAC/D,EACA,CAAE,QAAS,8DAA+D,CAC5E,EAOaG,EAAuBN,EAAE,OAAO,CAC3C,KAAMA,EAAE,OAAO,EACf,OAAQE,EACR,OAAQA,EACR,KAAMF,EAAE,KAAK,CAAC,OAAQ,WAAW,CAAC,EAClC,SAAUA,EAAE,QAAQ,EAAE,SAAS,CACjC,CAAC,EAEYO,EAAqBP,EAC/B,OAAO,CAEN,KAAMA,EAAE,MAAMM,CAAoB,CACpC,CAAC,EAIA,OAAO,EAmBGE,EAAsBC,GAC1BA",
|
|
6
|
+
"names": ["defineConfig", "config", "DEFAULT_RULES", "ROOT_DEFAULT_RULES", "resolvePackageConfig", "baseline", "z", "VENDOR_CONFIG_FILE", "safeRelPath", "p", "isAbsolute", "hasDotDotSegment", "vendorCopyItemSchema", "vendorConfigSchema", "defineVendorConfig", "config"]
|
|
7
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as ue,B as ge,C as ve,D as ye,E as he,F as we,G as ke,H as Ce,I as Ae,J as Ee,K as Se,L as M,M as O,N as xe,O as Re,P as Le,Q as be,R as je,T as P,c as a,d as q,e as w,f as u,g as I,h as Z,i as ee,j as _,k as j,l as oe,m as te,n as re,o as ne,p as $,q as ie,r as k,s as ae,t as se,u as ce,v as de,w as me,x as le,y as pe,z as fe}from"./chunk-
|
|
1
|
+
import{A as ue,B as ge,C as ve,D as ye,E as he,F as we,G as ke,H as Ce,I as Ae,J as Ee,K as Se,L as M,M as O,N as xe,O as Re,P as Le,Q as be,R as je,T as P,c as a,d as q,e as w,f as u,g as I,h as Z,i as ee,j as _,k as j,l as oe,m as te,n as re,o as ne,p as $,q as ie,r as k,s as ae,t as se,u as ce,v as de,w as me,x as le,y as pe,z as fe}from"./chunk-QBHCWAAG.js";import{A as X,m as Y,y as T,z as Q}from"./chunk-DB6CTNBS.js";import{e as N}from"./chunk-YSBF5C7C.js";import ko,{Separator as E}from"@inquirer/select";import{Command as Co}from"commander";import h from"node:process";import F from"node:fs/promises";import eo from"node:path";import Pe from"node:process";import{$ as oo}from"zx";var V=async()=>{let e=await T(),o=await Promise.all([{label:"project (committed)",path:e.main},{label:"user global",path:e.userGlobal},{label:"user project",path:e.userProject}].map(async r=>({...r,exists:await w(r.path)})));a.info(`Project name: ${e.projectName}
|
|
2
2
|
`),a.info(`Config merge chain (later overrides earlier):
|
|
3
3
|
`);for(let r of o){let s=r.exists?" [\u2713]":" [ ]";a.info(`${s} ${r.label.padEnd(22)} ${u(r.path)}`)}let t={projectName:e.projectName,layers:o.map(r=>({label:r.label,path:r.path,exists:r.exists}))};return{content:[{type:"text",text:JSON.stringify(t,null,2)}],structuredContent:t}},G=async()=>{let e=await T(),o=Pe.env.EDITOR||Pe.env.VISUAL||"vi";if(await F.mkdir(eo.dirname(e.userProject),{recursive:!0}),!await w(e.userProject)){let r=to(e.userProject);await F.writeFile(e.userProject,`{}
|
|
4
4
|
`,"utf-8"),await F.writeFile(r,ro(e.projectName),"utf-8"),a.info(`Created ${u(e.userProject)} \u2014 see ${u(r)} for the annotated reference.`)}a.info(`Opening ${u(e.userProject)} in ${o}`),await oo({stdio:"inherit"})`${o} ${e.userProject}`,X();let t={path:e.userProject,editor:o};return{content:[{type:"text",text:JSON.stringify(t,null,2)}],structuredContent:t}},to=e=>e.replace(/\.json$/,".example.jsonc"),ro=e=>`// infra-kit user override for ${e} \u2014 ~/.infra-kit/projects/${e}/infra-kit.json
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,g as e}from"./chunk-
|
|
1
|
+
import{a as o,g as e}from"./chunk-YSBF5C7C.js";export{o as defineConfig,e as defineVendorConfig};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/mcp.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as m,a as s,b as p,c}from"./chunk-
|
|
1
|
+
import{S as m,a as s,b as p,c}from"./chunk-QBHCWAAG.js";import"./chunk-DB6CTNBS.js";import"./chunk-YSBF5C7C.js";import{StdioServerTransport as g}from"@modelcontextprotocol/sdk/server/stdio.js";import h from"node:process";import o from"node:process";var l=r=>{o.on("SIGINT",()=>{r.info({msg:"Received SIGINT. Shutting down..."}),o.exit(0)}),o.on("SIGTERM",()=>{r.info({msg:"Received SIGTERM. Shutting down..."}),o.exit(0)}),o.on("uncaughtException",e=>{r.fatal({err:e,msg:"Uncaught Exception"}),r.error(`Uncaught Exception! Check ${s}. Shutting down...`),r.flush(),o.exit(1)}),o.on("unhandledRejection",(e,n)=>{r.fatal({reason:e,promise:n,msg:"Unhandled Rejection"}),r.error(`Unhandled Rejection! Check ${s}. Shutting down...`),r.flush(),o.exit(1)})};import{McpServer as x}from"@modelcontextprotocol/sdk/server/mcp.js";var d=async r=>{};var u=async r=>{};var a=r=>async e=>{let{toolName:n,handler:S}=r;c.info({msg:`Tool execution started: ${n}`,params:e});try{let i=await S({...e,confirmedCommand:!0});return c.info({msg:`Tool execution successful: ${n}`}),i}catch(i){throw c.error({err:i,params:e,msg:`Tool execution failed: ${n}`}),i}};var f=async r=>{for(let e of m())r.registerTool(e.name,{description:e.description,inputSchema:e.inputSchema,outputSchema:e.outputSchema},a({toolName:e.name,handler:e.handler}))};async function v(){let r=new x({name:"infra-kit",version:"1.0.0"},{capabilities:{resources:{},tools:{},prompts:{}}});return await d(r),await u(r),await f(r),r}var t=p(),T=async()=>{let r;try{r=await v(),t.info("MCP Server instance created")}catch(e){t.error({err:e,msg:"Failed to create MCP server"}),t.error("Fatal error during server creation."),h.exit(1)}try{let e=new g;await r.connect(e),t.info({msg:"Server connected to transport. Ready."})}catch(e){t.error({err:e,msg:"Failed to initialize server"}),t.error("Fatal error during server transport init."),h.exit(1)}};l(t);T();
|
|
2
2
|
//# sourceMappingURL=mcp.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "infra-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.128",
|
|
5
5
|
"description": "infra-kit",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"inspector": "npx @modelcontextprotocol/inspector node ./dist/mcp.js --debug",
|
|
23
23
|
"build": "pnpm run clean-artifacts && node ./scripts/build.js",
|
|
24
|
-
"check": "
|
|
24
|
+
"infra-kit-check": "infra-kit audit",
|
|
25
25
|
"clean-artifacts": "rm -rf dist",
|
|
26
26
|
"clean-cache": "rm -rf node_modules/.cache .eslintcache tsconfig.tsbuildinfo .turbo .swc",
|
|
27
27
|
"prettier-fix": "pnpm exec prettier **/* --write --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
{"t":0,"agent":"a4cd717","agent_type":"planner","event":"agent_start","parent_mode":"none"}
|
|
2
|
+
{"t":0,"agent":"a4cd717","agent_type":"planner","event":"agent_stop","success":true,"duration_ms":133214}
|
|
3
|
+
{"t":0,"agent":"aefdd9e","agent_type":"architect","event":"agent_start","parent_mode":"none"}
|
|
4
|
+
{"t":0,"agent":"aefdd9e","agent_type":"architect","event":"agent_stop","success":true,"duration_ms":335907}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"updatedAt": "2026-07-06T11:39:20.788Z",
|
|
3
|
+
"missions": [
|
|
4
|
+
{
|
|
5
|
+
"id": "session:f9c17a0e-2dd8-4f7d-badf-631f266c5d4c:none",
|
|
6
|
+
"source": "session",
|
|
7
|
+
"name": "none",
|
|
8
|
+
"objective": "Session mission",
|
|
9
|
+
"createdAt": "2026-07-06T11:31:08.958Z",
|
|
10
|
+
"updatedAt": "2026-07-06T11:39:20.788Z",
|
|
11
|
+
"status": "done",
|
|
12
|
+
"workerCount": 2,
|
|
13
|
+
"taskCounts": {
|
|
14
|
+
"total": 2,
|
|
15
|
+
"pending": 0,
|
|
16
|
+
"blocked": 0,
|
|
17
|
+
"inProgress": 0,
|
|
18
|
+
"completed": 2,
|
|
19
|
+
"failed": 0
|
|
20
|
+
},
|
|
21
|
+
"agents": [
|
|
22
|
+
{
|
|
23
|
+
"name": "planner:a4cd717",
|
|
24
|
+
"role": "planner",
|
|
25
|
+
"ownership": "a4cd717005186b809",
|
|
26
|
+
"status": "done",
|
|
27
|
+
"currentStep": null,
|
|
28
|
+
"latestUpdate": "completed",
|
|
29
|
+
"completedSummary": null,
|
|
30
|
+
"updatedAt": "2026-07-06T11:33:22.172Z"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "architect:aefdd9e",
|
|
34
|
+
"role": "architect",
|
|
35
|
+
"ownership": "aefdd9e0d2ff8feff",
|
|
36
|
+
"status": "done",
|
|
37
|
+
"currentStep": null,
|
|
38
|
+
"latestUpdate": "completed",
|
|
39
|
+
"completedSummary": null,
|
|
40
|
+
"updatedAt": "2026-07-06T11:39:20.788Z"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"timeline": [
|
|
44
|
+
{
|
|
45
|
+
"id": "session-start:a4cd717005186b809:2026-07-06T11:31:08.958Z",
|
|
46
|
+
"at": "2026-07-06T11:31:08.958Z",
|
|
47
|
+
"kind": "update",
|
|
48
|
+
"agent": "planner:a4cd717",
|
|
49
|
+
"detail": "started planner:a4cd717",
|
|
50
|
+
"sourceKey": "session-start:a4cd717005186b809"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "session-stop:a4cd717005186b809:2026-07-06T11:33:22.172Z",
|
|
54
|
+
"at": "2026-07-06T11:33:22.172Z",
|
|
55
|
+
"kind": "completion",
|
|
56
|
+
"agent": "planner:a4cd717",
|
|
57
|
+
"detail": "completed",
|
|
58
|
+
"sourceKey": "session-stop:a4cd717005186b809"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "session-start:aefdd9e0d2ff8feff:2026-07-06T11:33:44.881Z",
|
|
62
|
+
"at": "2026-07-06T11:33:44.881Z",
|
|
63
|
+
"kind": "update",
|
|
64
|
+
"agent": "architect:aefdd9e",
|
|
65
|
+
"detail": "started architect:aefdd9e",
|
|
66
|
+
"sourceKey": "session-start:aefdd9e0d2ff8feff"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "session-stop:aefdd9e0d2ff8feff:2026-07-06T11:39:20.788Z",
|
|
70
|
+
"at": "2026-07-06T11:39:20.788Z",
|
|
71
|
+
"kind": "completion",
|
|
72
|
+
"agent": "architect:aefdd9e",
|
|
73
|
+
"detail": "completed",
|
|
74
|
+
"sourceKey": "session-stop:aefdd9e0d2ff8feff"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"entries": {
|
|
4
|
+
"79a93d4a2f8f50b95f852280616242fee1855dc99a3c75211917f55e72e95fae": {
|
|
5
|
+
"last_emitted_at_ms": 1783337777537,
|
|
6
|
+
"message": "Use parallel execution for independent tasks. Use run_in_background for long operations (npm install, builds, tests)."
|
|
7
|
+
},
|
|
8
|
+
"e8765485f1860750e2194137d680dc43d5deccb4e52afc5e830cb43e8ed02a43": {
|
|
9
|
+
"last_emitted_at_ms": 1783337624665,
|
|
10
|
+
"message": "Spawning agent: oh-my-claudecode:architect (inherit) | Task: Architect review of plan"
|
|
11
|
+
},
|
|
12
|
+
"466399dafa2d20f60587180bad0a07358eb7f2bce724df0ff682f038ad33f5ad": {
|
|
13
|
+
"last_emitted_at_ms": 1783337483143,
|
|
14
|
+
"message": "Read multiple files in parallel when possible for faster analysis."
|
|
15
|
+
},
|
|
16
|
+
"03acfdb8b7399f27a90be1552ee8d7cf9bddbaa30df4e9673a9360fd3028ed17": {
|
|
17
|
+
"last_emitted_at_ms": 1783337468761,
|
|
18
|
+
"message": "Spawning agent: oh-my-claudecode:planner (inherit) | Task: Planner: audit coverage gap"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"updated_at": "2026-07-06T11:36:17.537Z"
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"agents": [
|
|
3
|
+
{
|
|
4
|
+
"agent_id": "a4cd717005186b809",
|
|
5
|
+
"agent_type": "oh-my-claudecode:planner",
|
|
6
|
+
"started_at": "2026-07-06T11:31:08.958Z",
|
|
7
|
+
"parent_mode": "none",
|
|
8
|
+
"status": "completed",
|
|
9
|
+
"completed_at": "2026-07-06T11:33:22.172Z",
|
|
10
|
+
"duration_ms": 133214
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"agent_id": "aefdd9e0d2ff8feff",
|
|
14
|
+
"agent_type": "oh-my-claudecode:architect",
|
|
15
|
+
"started_at": "2026-07-06T11:33:44.881Z",
|
|
16
|
+
"parent_mode": "none",
|
|
17
|
+
"status": "completed",
|
|
18
|
+
"completed_at": "2026-07-06T11:39:20.788Z",
|
|
19
|
+
"duration_ms": 335907
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"total_spawned": 2,
|
|
23
|
+
"total_completed": 2,
|
|
24
|
+
"total_failed": 0,
|
|
25
|
+
"last_updated": "2026-07-06T11:39:20.988Z"
|
|
26
|
+
}
|
|
@@ -93,7 +93,7 @@ const logResult = (result: PackageValidationResult): void => {
|
|
|
93
93
|
/**
|
|
94
94
|
* Audit the monorepo root (`root`), every non-vendor workspace package (`all`),
|
|
95
95
|
* or the package resolved by walking up from the working directory (default —
|
|
96
|
-
* the shape used by a package's `"check": "infra-kit audit"` script). The
|
|
96
|
+
* the shape used by a package's `"infra-kit-check": "infra-kit audit"` script). The
|
|
97
97
|
* returned `structuredContent.allPassed` lets the CLI set a non-zero exit code so
|
|
98
98
|
* the audit fails CI; this function never calls `process.exit` so the MCP tool
|
|
99
99
|
* can reuse it.
|
|
@@ -98,3 +98,34 @@ describe('buildShellBody — warm cache', () => {
|
|
|
98
98
|
expect(body).toContain('env-clear "$@"')
|
|
99
99
|
})
|
|
100
100
|
})
|
|
101
|
+
|
|
102
|
+
describe('buildShellBody — async notice (prompt-safe printing)', () => {
|
|
103
|
+
const body = buildShellBody()
|
|
104
|
+
|
|
105
|
+
it('defines a _infra_kit_notify helper guarded on ZLE that redraws the prompt', () => {
|
|
106
|
+
expect(body).toContain('_infra_kit_notify() {')
|
|
107
|
+
// Guards on ZLE being active: erases the current prompt line, then redraws.
|
|
108
|
+
expect(body).toContain(" zle && print -u2 -n $'\\r\\e[K'")
|
|
109
|
+
expect(body).toContain(' zle && zle reset-prompt')
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it('routes the async notices through _infra_kit_notify (never a bare print at the idle prompt)', () => {
|
|
113
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
114
|
+
expect(body).toContain('_infra_kit_notify "infra-kit: auto-loaded vars for ${INFRA_KIT_ENV_CONFIG:-?}"')
|
|
115
|
+
expect(body).toContain('_infra_kit_notify "infra-kit: auto-cleared env"')
|
|
116
|
+
expect(body).toContain(
|
|
117
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
118
|
+
'_infra_kit_notify "infra-kit: loaded cached vars for ${INFRA_KIT_ENV_CONFIG:-?} (refreshing…)"',
|
|
119
|
+
)
|
|
120
|
+
// No async notice should still use a bare `print -u2 "infra-kit:` form.
|
|
121
|
+
expect(body).not.toContain('print -u2 "infra-kit:')
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('defines _infra_kit_notify before the startup autoload that (transitively) calls it', () => {
|
|
125
|
+
const notifyIdx = body.indexOf('_infra_kit_notify() {')
|
|
126
|
+
const startupInvokeIdx = body.lastIndexOf('_infra_kit_startup_autoload\n')
|
|
127
|
+
|
|
128
|
+
expect(notifyIdx).toBeGreaterThanOrEqual(0)
|
|
129
|
+
expect(startupInvokeIdx).toBeGreaterThan(notifyIdx)
|
|
130
|
+
})
|
|
131
|
+
})
|
|
@@ -297,6 +297,21 @@ export const buildShellBody = (): string => {
|
|
|
297
297
|
`env-clear() { local f m; f=$(${runCmd} env-clear "$@") || return; m=$(zstat +mtime -- "$f" 2>/dev/null || echo 0); _INFRA_KIT_LAST_CLEAR_MTIME=$m; source "$f"; ${runCmd} env-status; }`,
|
|
298
298
|
`env-status() { ${runCmd} env-status; }`,
|
|
299
299
|
`alias ik='${runCmd}'`,
|
|
300
|
+
// Print an async notice without corrupting an already-drawn prompt. The
|
|
301
|
+
// startup poll fires via `sched` at an IDLE prompt (ZLE active) which does
|
|
302
|
+
// NOT redraw the prompt, so a bare `print` lands appended to the visible
|
|
303
|
+
// prompt line and looks like un-removable typed input. When ZLE is active we
|
|
304
|
+
// erase the current line (CR + clear-to-EOL), print the message on its own
|
|
305
|
+
// line, then `zle reset-prompt` to redraw the prompt below it. In precmd /
|
|
306
|
+
// shell-startup (ZLE inactive) `zle` is false and this is a plain stderr
|
|
307
|
+
// print above the about-to-be-drawn prompt — unchanged behavior.
|
|
308
|
+
'_infra_kit_notify() {',
|
|
309
|
+
// When ZLE is active, erase the current prompt line first and redraw after;
|
|
310
|
+
// both are no-ops when ZLE is inactive so this stays a plain stderr print.
|
|
311
|
+
" zle && print -u2 -n $'\\r\\e[K'",
|
|
312
|
+
' print -u2 -- "$1"',
|
|
313
|
+
' zle && zle reset-prompt',
|
|
314
|
+
'}',
|
|
300
315
|
'_infra_kit_autoload() {',
|
|
301
316
|
' [[ -z "$INFRA_KIT_SESSION" ]] && return',
|
|
302
317
|
// eslint-disable-next-line no-template-curly-in-string
|
|
@@ -311,12 +326,12 @@ export const buildShellBody = (): string => {
|
|
|
311
326
|
' source "$load_file"',
|
|
312
327
|
' _INFRA_KIT_LAST_LOAD_MTIME=$load_mtime',
|
|
313
328
|
// eslint-disable-next-line no-template-curly-in-string
|
|
314
|
-
'
|
|
329
|
+
' _infra_kit_notify "infra-kit: auto-loaded vars for ${INFRA_KIT_ENV_CONFIG:-?}"',
|
|
315
330
|
' fi',
|
|
316
331
|
' if (( clear_mtime > _INFRA_KIT_LAST_CLEAR_MTIME && clear_mtime >= _INFRA_KIT_SHELL_STARTED && clear_mtime > load_mtime )); then',
|
|
317
332
|
' source "$clear_file"',
|
|
318
333
|
' _INFRA_KIT_LAST_CLEAR_MTIME=$clear_mtime',
|
|
319
|
-
'
|
|
334
|
+
' _infra_kit_notify "infra-kit: auto-cleared env"',
|
|
320
335
|
' fi',
|
|
321
336
|
'}',
|
|
322
337
|
'autoload -Uz add-zsh-hook',
|
|
@@ -376,7 +391,7 @@ export const buildShellBody = (): string => {
|
|
|
376
391
|
' (( ${EPOCHSECONDS:-0} - wm >= _INFRA_KIT_WARM_TTL )) && return',
|
|
377
392
|
' source "$warm"',
|
|
378
393
|
// eslint-disable-next-line no-template-curly-in-string
|
|
379
|
-
'
|
|
394
|
+
' _infra_kit_notify "infra-kit: loaded cached vars for ${INFRA_KIT_ENV_CONFIG:-?} (refreshing…)"',
|
|
380
395
|
'}',
|
|
381
396
|
// One-shot env auto-load when a NEW shell opens inside an infra-kit project
|
|
382
397
|
// or worktree (config: envAutoLoad.trigger "shell-startup"). Cheap pure-zsh
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"entries": {
|
|
4
|
+
"79a93d4a2f8f50b95f852280616242fee1855dc99a3c75211917f55e72e95fae": {
|
|
5
|
+
"last_emitted_at_ms": 1783339798994,
|
|
6
|
+
"message": "Use parallel execution for independent tasks. Use run_in_background for long operations (npm install, builds, tests)."
|
|
7
|
+
},
|
|
8
|
+
"445ed27a3872b681d98190bae61ccb84954e1bc4e140df5370be958dee776b3a": {
|
|
9
|
+
"last_emitted_at_ms": 1783339766672,
|
|
10
|
+
"message": "Verify changes work after editing. Test functionality before marking complete."
|
|
11
|
+
},
|
|
12
|
+
"466399dafa2d20f60587180bad0a07358eb7f2bce724df0ff682f038ad33f5ad": {
|
|
13
|
+
"last_emitted_at_ms": 1783339749887,
|
|
14
|
+
"message": "Read multiple files in parallel when possible for faster analysis."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"updated_at": "2026-07-06T12:09:58.994Z"
|
|
18
|
+
}
|
|
@@ -72,9 +72,9 @@ export const DEFAULT_RULES: Readonly<ResolvedPackageRules> = {
|
|
|
72
72
|
* the expected tasks — so the root's own config can also stay empty.
|
|
73
73
|
*/
|
|
74
74
|
export const ROOT_DEFAULT_RULES: Readonly<ResolvedPackageRules> = {
|
|
75
|
-
requiredScripts: ['build', 'dev', 'test', 'qa', 'check', 'fix'],
|
|
75
|
+
requiredScripts: ['build', 'dev', 'test', 'qa', 'infra-kit-check', 'fix'],
|
|
76
76
|
requiredFiles: ['turbo.json', 'pnpm-workspace.yaml'],
|
|
77
|
-
turboTasks: ['build', 'test', 'ts-check', 'eslint-check', 'prettier-check', 'check'],
|
|
77
|
+
turboTasks: ['build', 'test', 'ts-check', 'eslint-check', 'prettier-check', 'infra-kit-check'],
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"entries": {
|
|
4
|
+
"79a93d4a2f8f50b95f852280616242fee1855dc99a3c75211917f55e72e95fae": {
|
|
5
|
+
"last_emitted_at_ms": 1783337418617,
|
|
6
|
+
"message": "Use parallel execution for independent tasks. Use run_in_background for long operations (npm install, builds, tests)."
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"updated_at": "2026-07-06T11:30:18.617Z"
|
|
10
|
+
}
|
|
@@ -177,13 +177,20 @@ describe('validatePackage — root / turbo', () => {
|
|
|
177
177
|
packageJson: {
|
|
178
178
|
name: 'monorepo',
|
|
179
179
|
type: 'module',
|
|
180
|
-
scripts: { build: 'x', dev: 'x', test: 'x', qa: 'x', check: 'x', fix: 'x' },
|
|
180
|
+
scripts: { build: 'x', dev: 'x', test: 'x', qa: 'x', 'infra-kit-check': 'x', fix: 'x' },
|
|
181
181
|
},
|
|
182
182
|
config: 'export default {}',
|
|
183
183
|
files: {
|
|
184
184
|
'pnpm-workspace.yaml': 'packages: []\n',
|
|
185
185
|
'turbo.json': JSON.stringify({
|
|
186
|
-
tasks: {
|
|
186
|
+
tasks: {
|
|
187
|
+
build: {},
|
|
188
|
+
test: {},
|
|
189
|
+
'ts-check': {},
|
|
190
|
+
'eslint-check': {},
|
|
191
|
+
'prettier-check': {},
|
|
192
|
+
'infra-kit-check': {},
|
|
193
|
+
},
|
|
187
194
|
}),
|
|
188
195
|
},
|
|
189
196
|
})
|