@ai-devkit/agent-manager 0.38.0 → 0.40.0
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/dist/__tests__/capacity/devin.test.js +239 -0
- package/dist/__tests__/capacity/devin.test.js.map +1 -0
- package/dist/__tests__/harnesses/devin/DevinAdapter.test.js +597 -0
- package/dist/__tests__/harnesses/devin/DevinAdapter.test.js.map +1 -0
- package/dist/__tests__/harnesses/devin/DevinAgentMapper.test.js +91 -0
- package/dist/__tests__/harnesses/devin/DevinAgentMapper.test.js.map +1 -0
- package/dist/__tests__/harnesses/devin/DevinSessionLocator.test.js +192 -0
- package/dist/__tests__/harnesses/devin/DevinSessionLocator.test.js.map +1 -0
- package/dist/__tests__/harnesses/devin/DevinSessionParser.test.js +407 -0
- package/dist/__tests__/harnesses/devin/DevinSessionParser.test.js.map +1 -0
- package/dist/__tests__/harnesses/devin/fixtures.js +95 -0
- package/dist/__tests__/harnesses/devin/fixtures.js.map +1 -0
- package/dist/__tests__/harnesses/readiness/AgentReadiness.test.js +64 -1
- package/dist/__tests__/harnesses/readiness/AgentReadiness.test.js.map +1 -1
- package/dist/__tests__/terminal/GhosttyBackend.test.js +334 -0
- package/dist/__tests__/terminal/GhosttyBackend.test.js.map +1 -0
- package/dist/adapters/AgentAdapter.d.ts +1 -1
- package/dist/adapters/AgentAdapter.d.ts.map +1 -1
- package/dist/adapters/AgentAdapter.js +2 -1
- package/dist/adapters/AgentAdapter.js.map +1 -1
- package/dist/capacity/index.d.ts +3 -0
- package/dist/capacity/index.d.ts.map +1 -1
- package/dist/capacity/index.js +8 -0
- package/dist/capacity/index.js.map +1 -1
- package/dist/capacity/providers/devin.d.ts +13 -0
- package/dist/capacity/providers/devin.d.ts.map +1 -0
- package/dist/capacity/providers/devin.js +92 -0
- package/dist/capacity/providers/devin.js.map +1 -0
- package/dist/capacity/sources/devin.d.ts +12 -0
- package/dist/capacity/sources/devin.d.ts.map +1 -0
- package/dist/capacity/sources/devin.js +29 -0
- package/dist/capacity/sources/devin.js.map +1 -0
- package/dist/harnesses/devin/DevinAdapter.d.ts +39 -0
- package/dist/harnesses/devin/DevinAdapter.d.ts.map +1 -0
- package/dist/harnesses/devin/DevinAdapter.js +177 -0
- package/dist/harnesses/devin/DevinAdapter.js.map +1 -0
- package/dist/harnesses/devin/DevinAgentMapper.d.ts +11 -0
- package/dist/harnesses/devin/DevinAgentMapper.d.ts.map +1 -0
- package/dist/harnesses/devin/DevinAgentMapper.js +35 -0
- package/dist/harnesses/devin/DevinAgentMapper.js.map +1 -0
- package/dist/harnesses/devin/DevinSessionLocator.d.ts +46 -0
- package/dist/harnesses/devin/DevinSessionLocator.d.ts.map +1 -0
- package/dist/harnesses/devin/DevinSessionLocator.js +176 -0
- package/dist/harnesses/devin/DevinSessionLocator.js.map +1 -0
- package/dist/harnesses/devin/DevinSessionParser.d.ts +29 -0
- package/dist/harnesses/devin/DevinSessionParser.d.ts.map +1 -0
- package/dist/harnesses/devin/DevinSessionParser.js +166 -0
- package/dist/harnesses/devin/DevinSessionParser.js.map +1 -0
- package/dist/harnesses/devin/credentials.d.ts +10 -0
- package/dist/harnesses/devin/credentials.d.ts.map +1 -0
- package/dist/harnesses/devin/credentials.js +66 -0
- package/dist/harnesses/devin/credentials.js.map +1 -0
- package/dist/harnesses/devin/readiness.d.ts +3 -0
- package/dist/harnesses/devin/readiness.d.ts.map +1 -0
- package/dist/harnesses/devin/readiness.js +39 -0
- package/dist/harnesses/devin/readiness.js.map +1 -0
- package/dist/harnesses/index.d.ts.map +1 -1
- package/dist/harnesses/index.js +3 -1
- package/dist/harnesses/index.js.map +1 -1
- package/dist/harnesses/readiness/AgentReadiness.d.ts.map +1 -1
- package/dist/harnesses/readiness/AgentReadiness.js +3 -1
- package/dist/harnesses/readiness/AgentReadiness.js.map +1 -1
- package/dist/harnesses/readiness/types.d.ts +1 -1
- package/dist/harnesses/readiness/types.d.ts.map +1 -1
- package/dist/harnesses/runtimeProfiles.d.ts.map +1 -1
- package/dist/harnesses/runtimeProfiles.js +2 -1
- package/dist/harnesses/runtimeProfiles.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/terminal/TtyWriter.d.ts.map +1 -1
- package/dist/terminal/TtyWriter.js +4 -3
- package/dist/terminal/TtyWriter.js.map +1 -1
- package/dist/terminal/backends/ghostty.d.ts +3 -0
- package/dist/terminal/backends/ghostty.d.ts.map +1 -0
- package/dist/terminal/backends/ghostty.js +161 -0
- package/dist/terminal/backends/ghostty.js.map +1 -0
- package/dist/terminal/backends/index.d.ts.map +1 -1
- package/dist/terminal/backends/index.js +2 -0
- package/dist/terminal/backends/index.js.map +1 -1
- package/dist/terminal/backends/shared.d.ts +2 -0
- package/dist/terminal/backends/shared.d.ts.map +1 -1
- package/dist/terminal/backends/shared.js +4 -1
- package/dist/terminal/backends/shared.js.map +1 -1
- package/dist/terminal/types.d.ts +1 -0
- package/dist/terminal/types.d.ts.map +1 -1
- package/dist/terminal/types.js +1 -0
- package/dist/terminal/types.js.map +1 -1
- package/dist/utils/process.d.ts +2 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +3 -0
- package/dist/utils/process.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/capacity/devin.test.ts +210 -0
- package/src/__tests__/capacity/fixtures/devin-config.json +6 -0
- package/src/__tests__/capacity/fixtures/devin-credentials.toml +4 -0
- package/src/__tests__/capacity/fixtures/devin-quota-nonplan.json +5 -0
- package/src/__tests__/capacity/fixtures/devin-quota.json +10 -0
- package/src/__tests__/harnesses/devin/DevinAdapter.test.ts +292 -0
- package/src/__tests__/harnesses/devin/DevinAgentMapper.test.ts +88 -0
- package/src/__tests__/harnesses/devin/DevinSessionLocator.test.ts +139 -0
- package/src/__tests__/harnesses/devin/DevinSessionParser.test.ts +218 -0
- package/src/__tests__/harnesses/devin/fixtures.ts +144 -0
- package/src/__tests__/harnesses/readiness/AgentReadiness.test.ts +41 -0
- package/src/__tests__/terminal/GhosttyBackend.test.ts +271 -0
- package/src/adapters/AgentAdapter.ts +1 -0
- package/src/capacity/index.ts +12 -0
- package/src/capacity/providers/devin.ts +121 -0
- package/src/capacity/sources/devin.ts +49 -0
- package/src/harnesses/devin/DevinAdapter.ts +224 -0
- package/src/harnesses/devin/DevinAgentMapper.ts +43 -0
- package/src/harnesses/devin/DevinSessionLocator.ts +230 -0
- package/src/harnesses/devin/DevinSessionParser.ts +236 -0
- package/src/harnesses/devin/credentials.ts +88 -0
- package/src/harnesses/devin/readiness.ts +36 -0
- package/src/harnesses/index.ts +2 -0
- package/src/harnesses/readiness/AgentReadiness.ts +2 -0
- package/src/harnesses/runtimeProfiles.ts +1 -0
- package/src/index.ts +1 -0
- package/src/terminal/TtyWriter.ts +5 -5
- package/src/terminal/backends/ghostty.ts +180 -0
- package/src/terminal/backends/index.ts +2 -0
- package/src/terminal/backends/shared.ts +6 -1
- package/src/terminal/types.ts +1 -0
- package/src/utils/process.ts +5 -0
|
@@ -3,6 +3,7 @@ import { codexReadiness } from "../codex/readiness.js";
|
|
|
3
3
|
import { copilotReadiness } from "../copilot/readiness.js";
|
|
4
4
|
import { openCodeReadiness } from "../opencode/readiness.js";
|
|
5
5
|
import { piReadiness } from "../pi/readiness.js";
|
|
6
|
+
import { devinReadiness } from "../devin/readiness.js";
|
|
6
7
|
import { builtInSkillsCheck, createReadinessRuntime, directoryCheck, executableCheck, worstReadinessStatus } from "./checks.js";
|
|
7
8
|
import { READINESS_AGENT_TYPES } from "./types.js";
|
|
8
9
|
const READINESS_PROFILES = {
|
|
@@ -22,7 +23,8 @@ const READINESS_PROFILES = {
|
|
|
22
23
|
},
|
|
23
24
|
opencode: openCodeReadiness,
|
|
24
25
|
copilot: copilotReadiness,
|
|
25
|
-
pi: piReadiness
|
|
26
|
+
pi: piReadiness,
|
|
27
|
+
devin: devinReadiness
|
|
26
28
|
};
|
|
27
29
|
export async function getAgentReadinessReport(agent, options = {}) {
|
|
28
30
|
return agentReadiness(agent, createReadinessRuntime(options));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/harnesses/readiness/AgentReadiness.ts"],"sourcesContent":["import { claudeReadiness } from \"../claude/readiness.js\";\nimport { codexReadiness } from \"../codex/readiness.js\";\nimport { copilotReadiness } from \"../copilot/readiness.js\";\nimport { openCodeReadiness } from \"../opencode/readiness.js\";\nimport { piReadiness } from \"../pi/readiness.js\";\nimport {\n builtInSkillsCheck,\n createReadinessRuntime,\n directoryCheck,\n executableCheck,\n worstReadinessStatus,\n} from \"./checks.js\";\nimport {\n READINESS_AGENT_TYPES,\n type AgentReadinessOptions,\n type AgentReadinessReport,\n type HarnessReadinessProfile,\n type ReadinessAgentType,\n type ReadinessRuntime,\n} from \"./types.js\";\n\nconst READINESS_PROFILES: Record<ReadinessAgentType, HarnessReadinessProfile> = {\n claude: claudeReadiness,\n codex: codexReadiness,\n gemini_cli: { configDir: \".gemini\" },\n grok_cli: { configDir: \".grok\" },\n kiro: { configDir: \".kiro\" },\n antigravity_cli: { configDir: \".gemini/antigravity-cli\" },\n opencode: openCodeReadiness,\n copilot: copilotReadiness,\n pi: piReadiness,\n};\n\nexport async function getAgentReadinessReport(\n agent: ReadinessAgentType,\n options: AgentReadinessOptions = {},\n): Promise<AgentReadinessReport> {\n return agentReadiness(agent, createReadinessRuntime(options));\n}\n\nasync function agentReadiness(\n agent: ReadinessAgentType,\n runtime: ReadinessRuntime,\n): Promise<AgentReadinessReport> {\n const profile = READINESS_PROFILES[agent];\n const [executable, globalConfig, builtInSkills, auth, integration] = await Promise.all([\n executableCheck(agent, runtime),\n directoryCheck(profile.configDir, runtime),\n builtInSkillsCheck(agent, runtime),\n profile.auth?.(runtime),\n profile.integration?.(runtime),\n ]);\n return {\n type: agent,\n executable,\n globalConfig,\n builtInSkills,\n auth,\n integration,\n status: worstReadinessStatus([\n executable.status,\n globalConfig.status,\n ...(auth ? [auth.status] : []),\n ...(integration ? [integration.status] : []),\n ]),\n };\n}\n\nexport async function getAgentReadinessReports(\n options: AgentReadinessOptions = {},\n): Promise<Record<ReadinessAgentType, AgentReadinessReport>> {\n const runtime = createReadinessRuntime(options);\n const entries = await Promise.all(\n READINESS_AGENT_TYPES.map(\n async (agent) => [agent, await agentReadiness(agent, runtime)] as const,\n ),\n );\n return Object.fromEntries(entries) as Record<ReadinessAgentType, AgentReadinessReport>;\n}\n\nexport { worstReadinessStatus } from \"./checks.js\";\nexport type {\n AgentReadinessOptions,\n AgentReadinessReport,\n ReadinessAgentType,\n ReadinessStatus,\n} from \"./types.js\";\n"],"names":["claudeReadiness","codexReadiness","copilotReadiness","openCodeReadiness","piReadiness","builtInSkillsCheck","createReadinessRuntime","directoryCheck","executableCheck","worstReadinessStatus","READINESS_AGENT_TYPES","READINESS_PROFILES","claude","codex","gemini_cli","configDir","grok_cli","kiro","antigravity_cli","opencode","copilot","pi","getAgentReadinessReport","agent","options","agentReadiness","runtime","profile","executable","globalConfig","builtInSkills","auth","integration","Promise","all","type","status","getAgentReadinessReports","entries","map","Object","fromEntries"],"mappings":"AAAA,SAASA,eAAe,QAAQ,yBAAyB;AACzD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SACEC,kBAAkB,EAClBC,sBAAsB,EACtBC,cAAc,EACdC,eAAe,EACfC,oBAAoB,QACf,cAAc;AACrB,SACEC,qBAAqB,QAMhB,aAAa;AAEpB,MAAMC,qBAA0E;IAC9EC,
|
|
1
|
+
{"version":3,"sources":["../../../src/harnesses/readiness/AgentReadiness.ts"],"sourcesContent":["import { claudeReadiness } from \"../claude/readiness.js\";\nimport { codexReadiness } from \"../codex/readiness.js\";\nimport { copilotReadiness } from \"../copilot/readiness.js\";\nimport { openCodeReadiness } from \"../opencode/readiness.js\";\nimport { piReadiness } from \"../pi/readiness.js\";\nimport { devinReadiness } from \"../devin/readiness.js\";\nimport {\n builtInSkillsCheck,\n createReadinessRuntime,\n directoryCheck,\n executableCheck,\n worstReadinessStatus,\n} from \"./checks.js\";\nimport {\n READINESS_AGENT_TYPES,\n type AgentReadinessOptions,\n type AgentReadinessReport,\n type HarnessReadinessProfile,\n type ReadinessAgentType,\n type ReadinessRuntime,\n} from \"./types.js\";\n\nconst READINESS_PROFILES: Record<ReadinessAgentType, HarnessReadinessProfile> = {\n claude: claudeReadiness,\n codex: codexReadiness,\n gemini_cli: { configDir: \".gemini\" },\n grok_cli: { configDir: \".grok\" },\n kiro: { configDir: \".kiro\" },\n antigravity_cli: { configDir: \".gemini/antigravity-cli\" },\n opencode: openCodeReadiness,\n copilot: copilotReadiness,\n pi: piReadiness,\n devin: devinReadiness,\n};\n\nexport async function getAgentReadinessReport(\n agent: ReadinessAgentType,\n options: AgentReadinessOptions = {},\n): Promise<AgentReadinessReport> {\n return agentReadiness(agent, createReadinessRuntime(options));\n}\n\nasync function agentReadiness(\n agent: ReadinessAgentType,\n runtime: ReadinessRuntime,\n): Promise<AgentReadinessReport> {\n const profile = READINESS_PROFILES[agent];\n const [executable, globalConfig, builtInSkills, auth, integration] = await Promise.all([\n executableCheck(agent, runtime),\n directoryCheck(profile.configDir, runtime),\n builtInSkillsCheck(agent, runtime),\n profile.auth?.(runtime),\n profile.integration?.(runtime),\n ]);\n return {\n type: agent,\n executable,\n globalConfig,\n builtInSkills,\n auth,\n integration,\n status: worstReadinessStatus([\n executable.status,\n globalConfig.status,\n ...(auth ? [auth.status] : []),\n ...(integration ? [integration.status] : []),\n ]),\n };\n}\n\nexport async function getAgentReadinessReports(\n options: AgentReadinessOptions = {},\n): Promise<Record<ReadinessAgentType, AgentReadinessReport>> {\n const runtime = createReadinessRuntime(options);\n const entries = await Promise.all(\n READINESS_AGENT_TYPES.map(\n async (agent) => [agent, await agentReadiness(agent, runtime)] as const,\n ),\n );\n return Object.fromEntries(entries) as Record<ReadinessAgentType, AgentReadinessReport>;\n}\n\nexport { worstReadinessStatus } from \"./checks.js\";\nexport type {\n AgentReadinessOptions,\n AgentReadinessReport,\n ReadinessAgentType,\n ReadinessStatus,\n} from \"./types.js\";\n"],"names":["claudeReadiness","codexReadiness","copilotReadiness","openCodeReadiness","piReadiness","devinReadiness","builtInSkillsCheck","createReadinessRuntime","directoryCheck","executableCheck","worstReadinessStatus","READINESS_AGENT_TYPES","READINESS_PROFILES","claude","codex","gemini_cli","configDir","grok_cli","kiro","antigravity_cli","opencode","copilot","pi","devin","getAgentReadinessReport","agent","options","agentReadiness","runtime","profile","executable","globalConfig","builtInSkills","auth","integration","Promise","all","type","status","getAgentReadinessReports","entries","map","Object","fromEntries"],"mappings":"AAAA,SAASA,eAAe,QAAQ,yBAAyB;AACzD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SACEC,kBAAkB,EAClBC,sBAAsB,EACtBC,cAAc,EACdC,eAAe,EACfC,oBAAoB,QACf,cAAc;AACrB,SACEC,qBAAqB,QAMhB,aAAa;AAEpB,MAAMC,qBAA0E;IAC9EC,QAAQb;IACRc,OAAOb;IACPc,YAAY;QAAEC,WAAW;IAAU;IACnCC,UAAU;QAAED,WAAW;IAAQ;IAC/BE,MAAM;QAAEF,WAAW;IAAQ;IAC3BG,iBAAiB;QAAEH,WAAW;IAA0B;IACxDI,UAAUjB;IACVkB,SAASnB;IACToB,IAAIlB;IACJmB,OAAOlB;AACT;AAEA,OAAO,eAAemB,wBACpBC,KAAyB,EACzBC,UAAiC,CAAC,CAAC;IAEnC,OAAOC,eAAeF,OAAOlB,uBAAuBmB;AACtD;AAEA,eAAeC,eACbF,KAAyB,EACzBG,OAAyB;IAEzB,MAAMC,UAAUjB,kBAAkB,CAACa,MAAM;IACzC,MAAM,CAACK,YAAYC,cAAcC,eAAeC,MAAMC,YAAY,GAAG,MAAMC,QAAQC,GAAG,CAAC;QACrF3B,gBAAgBgB,OAAOG;QACvBpB,eAAeqB,QAAQb,SAAS,EAAEY;QAClCtB,mBAAmBmB,OAAOG;QAC1BC,QAAQI,IAAI,GAAGL;QACfC,QAAQK,WAAW,GAAGN;KACvB;IACD,OAAO;QACLS,MAAMZ;QACNK;QACAC;QACAC;QACAC;QACAC;QACAI,QAAQ5B,qBAAqB;YAC3BoB,WAAWQ,MAAM;YACjBP,aAAaO,MAAM;eACfL,OAAO;gBAACA,KAAKK,MAAM;aAAC,GAAG,EAAE;eACzBJ,cAAc;gBAACA,YAAYI,MAAM;aAAC,GAAG,EAAE;SAC5C;IACH;AACF;AAEA,OAAO,eAAeC,yBACpBb,UAAiC,CAAC,CAAC;IAEnC,MAAME,UAAUrB,uBAAuBmB;IACvC,MAAMc,UAAU,MAAML,QAAQC,GAAG,CAC/BzB,sBAAsB8B,GAAG,CACvB,OAAOhB,QAAU;YAACA;YAAO,MAAME,eAAeF,OAAOG;SAAS;IAGlE,OAAOc,OAAOC,WAAW,CAACH;AAC5B;AAEA,SAAS9B,oBAAoB,QAAQ,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const READINESS_AGENT_TYPES: readonly ["claude", "codex", "gemini_cli", "grok_cli", "kiro", "antigravity_cli", "opencode", "copilot", "pi"];
|
|
1
|
+
export declare const READINESS_AGENT_TYPES: readonly ["claude", "codex", "gemini_cli", "grok_cli", "kiro", "antigravity_cli", "opencode", "copilot", "pi", "devin"];
|
|
2
2
|
export type ReadinessStatus = "pass" | "warn" | "fail";
|
|
3
3
|
export type ReadinessAuthState = "authenticated" | "unauthenticated" | "unknown";
|
|
4
4
|
export type ReadinessAgentType = (typeof READINESS_AGENT_TYPES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/harnesses/readiness/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/harnesses/readiness/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,yHAAc,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,iBAAiB,GAAG,SAAS,CAAC;AACjF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AACxE,KAAK,mBAAmB,GAAG,eAAe,GAAG,MAAM,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/D,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3D,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;AAErF,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,mBAAmB,GAAG,eAAe;IAC7E,MAAM,EAAE,CAAC,CAAC;IACV,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,IAAI,EAAE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O,CAAC;CACzC;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"runtimeProfiles.d.ts","sourceRoot":"","sources":["../../src/harnesses/runtimeProfiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAG1E,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CACzC;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAWtF,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAGzF"}
|
|
@@ -26,7 +26,8 @@ export const HARNESS_RUNTIME_PROFILES = {
|
|
|
26
26
|
]), [
|
|
27
27
|
"kiro_cli",
|
|
28
28
|
"kiro-cli"
|
|
29
|
-
])
|
|
29
|
+
]),
|
|
30
|
+
devin: profile("devin", matchArgv0("devin"))
|
|
30
31
|
};
|
|
31
32
|
export function runtimeAgentMatchesHarness(runtimeAgent, type) {
|
|
32
33
|
if (type === "other") return runtimeAgent.toLowerCase() === "other";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/harnesses/runtimeProfiles.ts"],"sourcesContent":["import path from \"node:path\";\nimport { AGENT_TYPES, type AgentType } from \"../adapters/AgentAdapter.js\";\nimport { executablePath } from \"../utils/process.js\";\n\nexport type StartableAgentType = (typeof AGENT_TYPES)[number];\n\nexport interface HarnessRuntimeProfile {\n command: string;\n runtimeKind: string;\n discoveryAliases: readonly string[];\n matches: (psCommand: string) => boolean;\n}\n\nexport const HARNESS_RUNTIME_PROFILES: Record<StartableAgentType, HarnessRuntimeProfile> = {\n claude: profile(\"claude\", matchArgv0(\"claude\")),\n codex: profile(\"codex\", matchArgv0(\"codex\")),\n copilot: profile(\"copilot\", matchArgv0Name(\"copilot-cli\")),\n gemini_cli: profile(\"gemini\", matchAnyBasename([\"gemini\"]), [\"gemini_cli\"]),\n grok_cli: profile(\"grok\", matchArgv0(\"grok\"), [\"grok_cli\"]),\n antigravity_cli: profile(\"agy\", matchArgv0(\"agy\"), [\"antigravity\", \"antigravity_cli\"]),\n opencode: profile(\"opencode\", matchArgv0(\"opencode\")),\n pi: profile(\"pi\", matchAnyBasename([\"pi\"])),\n kiro: profile(\"kiro\", matchAnyBasename([\"kiro-cli\", \"kiro\"]), [\"kiro_cli\", \"kiro-cli\"]),\n};\n\nexport function runtimeAgentMatchesHarness(runtimeAgent: string, type: AgentType): boolean {\n if (type === \"other\") return runtimeAgent.toLowerCase() === \"other\";\n return HARNESS_RUNTIME_PROFILES[type].discoveryAliases.includes(runtimeAgent.toLowerCase());\n}\n\nfunction profile(\n runtimeKind: string,\n matches: (psCommand: string) => boolean,\n extraAliases: readonly string[] = [],\n): HarnessRuntimeProfile {\n return {\n command: runtimeKind === \"kiro\" ? \"kiro-cli\" : runtimeKind,\n runtimeKind,\n discoveryAliases: [runtimeKind, ...extraAliases],\n matches,\n };\n}\n\nconst ABSOLUTE_PATH = /^(?:\\/|[a-zA-Z]:[\\\\/])/;\nconst PATH_SEPARATOR = /[\\\\/]/;\n\nfunction basenameOf(token: string): string {\n return path.basename(token).toLowerCase();\n}\n\nfunction tokensOf(psCommand: string): string[] {\n return psCommand.trim().split(/\\s+/).filter(Boolean);\n}\n\nfunction splitArgv0(psCommand: string): { argv0: string; args: string[] } {\n const command = psCommand.trim();\n const argv0 = executablePath(command);\n return { argv0, args: tokensOf(command.slice(argv0.length)) };\n}\n\nfunction mayContinueArgv0(tokens: string[], test: (token: string) => boolean): boolean {\n return (\n ABSOLUTE_PATH.test(tokens[0]) &&\n tokens.slice(1).some((token) => PATH_SEPARATOR.test(token) && test(token))\n );\n}\n\nfunction matchArgv0(name: string): (psCommand: string) => boolean {\n const lower = name.toLowerCase();\n const test = (token: string) => basenameOf(token) === lower;\n return (psCommand) => {\n const tokens = tokensOf(psCommand);\n if (tokens.length === 0) return false;\n if (test(tokens[0])) return true;\n return mayContinueArgv0(tokens, test) && test(executablePath(psCommand));\n };\n}\n\nfunction matchArgv0Name(name: string): (psCommand: string) => boolean {\n const lower = name.toLowerCase();\n const test = (token: string) => token.toLowerCase().includes(lower);\n return (psCommand) => {\n const tokens = tokensOf(psCommand);\n if (tokens.length === 0) return false;\n if (test(tokens[0])) return true;\n return mayContinueArgv0(tokens, test) && test(executablePath(psCommand));\n };\n}\n\nfunction matchAnyBasename(names: string[]): (psCommand: string) => boolean {\n const lowers = new Set(names.map((name) => name.toLowerCase()));\n const test = (token: string) => lowers.has(basenameOf(token));\n return (psCommand) => {\n const tokens = tokensOf(psCommand);\n if (tokens.length === 0) return false;\n if (test(tokens[0])) return true;\n if (!tokens.slice(1).some(test)) return false;\n if (!ABSOLUTE_PATH.test(tokens[0])) return true;\n\n const { argv0, args } = splitArgv0(psCommand);\n return test(argv0) || args.some(test);\n };\n}\n"],"names":["path","executablePath","HARNESS_RUNTIME_PROFILES","claude","profile","matchArgv0","codex","copilot","matchArgv0Name","gemini_cli","matchAnyBasename","grok_cli","antigravity_cli","opencode","pi","kiro","runtimeAgentMatchesHarness","runtimeAgent","type","toLowerCase","discoveryAliases","includes","runtimeKind","matches","extraAliases","command","ABSOLUTE_PATH","PATH_SEPARATOR","basenameOf","token","basename","tokensOf","psCommand","trim","split","filter","Boolean","splitArgv0","argv0","args","slice","length","mayContinueArgv0","tokens","test","some","name","lower","names","lowers","Set","map","has"],"mappings":"AAAA,OAAOA,UAAU,YAAY;AAE7B,SAASC,cAAc,QAAQ,sBAAsB;AAWrD,OAAO,MAAMC,2BAA8E;IACzFC,QAAQC,QAAQ,UAAUC,WAAW;IACrCC,OAAOF,QAAQ,SAASC,WAAW;IACnCE,SAASH,QAAQ,WAAWI,eAAe;IAC3CC,YAAYL,QAAQ,UAAUM,iBAAiB;QAAC;KAAS,GAAG;QAAC;KAAa;IAC1EC,UAAUP,QAAQ,QAAQC,WAAW,SAAS;QAAC;KAAW;IAC1DO,iBAAiBR,QAAQ,OAAOC,WAAW,QAAQ;QAAC;QAAe;KAAkB;IACrFQ,UAAUT,QAAQ,YAAYC,WAAW;IACzCS,IAAIV,QAAQ,MAAMM,iBAAiB;QAAC;KAAK;IACzCK,MAAMX,QAAQ,QAAQM,iBAAiB;QAAC;QAAY;KAAO,GAAG;QAAC;QAAY;KAAW;
|
|
1
|
+
{"version":3,"sources":["../../src/harnesses/runtimeProfiles.ts"],"sourcesContent":["import path from \"node:path\";\nimport { AGENT_TYPES, type AgentType } from \"../adapters/AgentAdapter.js\";\nimport { executablePath } from \"../utils/process.js\";\n\nexport type StartableAgentType = (typeof AGENT_TYPES)[number];\n\nexport interface HarnessRuntimeProfile {\n command: string;\n runtimeKind: string;\n discoveryAliases: readonly string[];\n matches: (psCommand: string) => boolean;\n}\n\nexport const HARNESS_RUNTIME_PROFILES: Record<StartableAgentType, HarnessRuntimeProfile> = {\n claude: profile(\"claude\", matchArgv0(\"claude\")),\n codex: profile(\"codex\", matchArgv0(\"codex\")),\n copilot: profile(\"copilot\", matchArgv0Name(\"copilot-cli\")),\n gemini_cli: profile(\"gemini\", matchAnyBasename([\"gemini\"]), [\"gemini_cli\"]),\n grok_cli: profile(\"grok\", matchArgv0(\"grok\"), [\"grok_cli\"]),\n antigravity_cli: profile(\"agy\", matchArgv0(\"agy\"), [\"antigravity\", \"antigravity_cli\"]),\n opencode: profile(\"opencode\", matchArgv0(\"opencode\")),\n pi: profile(\"pi\", matchAnyBasename([\"pi\"])),\n kiro: profile(\"kiro\", matchAnyBasename([\"kiro-cli\", \"kiro\"]), [\"kiro_cli\", \"kiro-cli\"]),\n devin: profile(\"devin\", matchArgv0(\"devin\")),\n};\n\nexport function runtimeAgentMatchesHarness(runtimeAgent: string, type: AgentType): boolean {\n if (type === \"other\") return runtimeAgent.toLowerCase() === \"other\";\n return HARNESS_RUNTIME_PROFILES[type].discoveryAliases.includes(runtimeAgent.toLowerCase());\n}\n\nfunction profile(\n runtimeKind: string,\n matches: (psCommand: string) => boolean,\n extraAliases: readonly string[] = [],\n): HarnessRuntimeProfile {\n return {\n command: runtimeKind === \"kiro\" ? \"kiro-cli\" : runtimeKind,\n runtimeKind,\n discoveryAliases: [runtimeKind, ...extraAliases],\n matches,\n };\n}\n\nconst ABSOLUTE_PATH = /^(?:\\/|[a-zA-Z]:[\\\\/])/;\nconst PATH_SEPARATOR = /[\\\\/]/;\n\nfunction basenameOf(token: string): string {\n return path.basename(token).toLowerCase();\n}\n\nfunction tokensOf(psCommand: string): string[] {\n return psCommand.trim().split(/\\s+/).filter(Boolean);\n}\n\nfunction splitArgv0(psCommand: string): { argv0: string; args: string[] } {\n const command = psCommand.trim();\n const argv0 = executablePath(command);\n return { argv0, args: tokensOf(command.slice(argv0.length)) };\n}\n\nfunction mayContinueArgv0(tokens: string[], test: (token: string) => boolean): boolean {\n return (\n ABSOLUTE_PATH.test(tokens[0]) &&\n tokens.slice(1).some((token) => PATH_SEPARATOR.test(token) && test(token))\n );\n}\n\nfunction matchArgv0(name: string): (psCommand: string) => boolean {\n const lower = name.toLowerCase();\n const test = (token: string) => basenameOf(token) === lower;\n return (psCommand) => {\n const tokens = tokensOf(psCommand);\n if (tokens.length === 0) return false;\n if (test(tokens[0])) return true;\n return mayContinueArgv0(tokens, test) && test(executablePath(psCommand));\n };\n}\n\nfunction matchArgv0Name(name: string): (psCommand: string) => boolean {\n const lower = name.toLowerCase();\n const test = (token: string) => token.toLowerCase().includes(lower);\n return (psCommand) => {\n const tokens = tokensOf(psCommand);\n if (tokens.length === 0) return false;\n if (test(tokens[0])) return true;\n return mayContinueArgv0(tokens, test) && test(executablePath(psCommand));\n };\n}\n\nfunction matchAnyBasename(names: string[]): (psCommand: string) => boolean {\n const lowers = new Set(names.map((name) => name.toLowerCase()));\n const test = (token: string) => lowers.has(basenameOf(token));\n return (psCommand) => {\n const tokens = tokensOf(psCommand);\n if (tokens.length === 0) return false;\n if (test(tokens[0])) return true;\n if (!tokens.slice(1).some(test)) return false;\n if (!ABSOLUTE_PATH.test(tokens[0])) return true;\n\n const { argv0, args } = splitArgv0(psCommand);\n return test(argv0) || args.some(test);\n };\n}\n"],"names":["path","executablePath","HARNESS_RUNTIME_PROFILES","claude","profile","matchArgv0","codex","copilot","matchArgv0Name","gemini_cli","matchAnyBasename","grok_cli","antigravity_cli","opencode","pi","kiro","devin","runtimeAgentMatchesHarness","runtimeAgent","type","toLowerCase","discoveryAliases","includes","runtimeKind","matches","extraAliases","command","ABSOLUTE_PATH","PATH_SEPARATOR","basenameOf","token","basename","tokensOf","psCommand","trim","split","filter","Boolean","splitArgv0","argv0","args","slice","length","mayContinueArgv0","tokens","test","some","name","lower","names","lowers","Set","map","has"],"mappings":"AAAA,OAAOA,UAAU,YAAY;AAE7B,SAASC,cAAc,QAAQ,sBAAsB;AAWrD,OAAO,MAAMC,2BAA8E;IACzFC,QAAQC,QAAQ,UAAUC,WAAW;IACrCC,OAAOF,QAAQ,SAASC,WAAW;IACnCE,SAASH,QAAQ,WAAWI,eAAe;IAC3CC,YAAYL,QAAQ,UAAUM,iBAAiB;QAAC;KAAS,GAAG;QAAC;KAAa;IAC1EC,UAAUP,QAAQ,QAAQC,WAAW,SAAS;QAAC;KAAW;IAC1DO,iBAAiBR,QAAQ,OAAOC,WAAW,QAAQ;QAAC;QAAe;KAAkB;IACrFQ,UAAUT,QAAQ,YAAYC,WAAW;IACzCS,IAAIV,QAAQ,MAAMM,iBAAiB;QAAC;KAAK;IACzCK,MAAMX,QAAQ,QAAQM,iBAAiB;QAAC;QAAY;KAAO,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AAO;QAChC,IAAIG,KAAKD,MAAM,CAAC,EAAE,GAAG,OAAO;QAC5B,OAAOD,iBAAiBC,QAAQC,SAASA,KAAK5C,eAAegC;IAC/D;AACF;AAEA,SAASzB,eAAeuC,IAAY;IAClC,MAAMC,QAAQD,KAAK3B,WAAW;IAC9B,MAAMyB,OAAO,CAACf,QAAkBA,MAAMV,WAAW,GAAGE,QAAQ,CAAC0B;IAC7D,OAAO,CAACf;QACN,MAAMW,SAASZ,SAASC;QACxB,IAAIW,OAAOF,MAAM,KAAK,GAAG,OAAO;QAChC,IAAIG,KAAKD,MAAM,CAAC,EAAE,GAAG,OAAO;QAC5B,OAAOD,iBAAiBC,QAAQC,SAASA,KAAK5C,eAAegC;IAC/D;AACF;AAEA,SAASvB,iBAAiBuC,KAAe;IACvC,MAAMC,SAAS,IAAIC,IAAIF,MAAMG,GAAG,CAAC,CAACL,OAASA,KAAK3B,WAAW;IAC3D,MAAMyB,OAAO,CAACf,QAAkBoB,OAAOG,GAAG,CAACxB,WAAWC;IACtD,OAAO,CAACG;QACN,MAAMW,SAASZ,SAASC;QACxB,IAAIW,OAAOF,MAAM,KAAK,GAAG,OAAO;QAChC,IAAIG,KAAKD,MAAM,CAAC,EAAE,GAAG,OAAO;QAC5B,IAAI,CAACA,OAAOH,KAAK,CAAC,GAAGK,IAAI,CAACD,OAAO,OAAO;QACxC,IAAI,CAAClB,cAAckB,IAAI,CAACD,MAAM,CAAC,EAAE,GAAG,OAAO;QAE3C,MAAM,EAAEL,KAAK,EAAEC,IAAI,EAAE,GAAGF,WAAWL;QACnC,OAAOY,KAAKN,UAAUC,KAAKM,IAAI,CAACD;IAClC;AACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AgentManager } from "./AgentManager.js";
|
|
2
|
-
export { getAnthropicCapacityReport, getClaudeCapacityReport, getCodexCapacityReport, getOpenAiCapacityReport, getZaiCapacityReport, } from "./capacity/index.js";
|
|
2
|
+
export { getAnthropicCapacityReport, getClaudeCapacityReport, getCodexCapacityReport, getDevinCapacityReport, getOpenAiCapacityReport, getZaiCapacityReport, } from "./capacity/index.js";
|
|
3
3
|
export type { CapacityReport, CapacityWindow } from "./capacity/index.js";
|
|
4
4
|
export { getAgentReadinessReports, worstReadinessStatus, } from "./harnesses/readiness/AgentReadiness.js";
|
|
5
5
|
export type { AgentReadinessOptions, AgentReadinessReport, ReadinessAgentType, ReadinessStatus, } from "./harnesses/readiness/AgentReadiness.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY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AAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AgentManager } from "./AgentManager.js";
|
|
2
|
-
export { getAnthropicCapacityReport, getClaudeCapacityReport, getCodexCapacityReport, getOpenAiCapacityReport, getZaiCapacityReport } from "./capacity/index.js";
|
|
2
|
+
export { getAnthropicCapacityReport, getClaudeCapacityReport, getCodexCapacityReport, getDevinCapacityReport, getOpenAiCapacityReport, getZaiCapacityReport } from "./capacity/index.js";
|
|
3
3
|
export { getAgentReadinessReports, worstReadinessStatus } from "./harnesses/readiness/AgentReadiness.js";
|
|
4
4
|
export { createBuiltinAdapters } from "./harnesses/index.js";
|
|
5
5
|
export { HARNESS_RUNTIME_PROFILES } from "./harnesses/runtimeProfiles.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { AgentManager } from \"./AgentManager.js\";\nexport {\n getAnthropicCapacityReport,\n getClaudeCapacityReport,\n getCodexCapacityReport,\n getOpenAiCapacityReport,\n getZaiCapacityReport,\n} from \"./capacity/index.js\";\nexport type { CapacityReport, CapacityWindow } from \"./capacity/index.js\";\n\nexport {\n getAgentReadinessReports,\n worstReadinessStatus,\n} from \"./harnesses/readiness/AgentReadiness.js\";\nexport type {\n AgentReadinessOptions,\n AgentReadinessReport,\n ReadinessAgentType,\n ReadinessStatus,\n} from \"./harnesses/readiness/AgentReadiness.js\";\n\nexport { createBuiltinAdapters } from \"./harnesses/index.js\";\nexport { HARNESS_RUNTIME_PROFILES, type StartableAgentType } from \"./harnesses/runtimeProfiles.js\";\nexport { AGENT_TYPES, AgentStatus } from \"./adapters/AgentAdapter.js\";\nexport type {\n AgentAdapter,\n AgentType,\n AgentInfo,\n ConversationMessage,\n SessionSummary,\n ListSessionsOptions,\n} from \"./adapters/AgentAdapter.js\";\n\nexport { TerminalFocusManager } from \"./terminal/TerminalFocusManager.js\";\nexport { TerminalType } from \"./terminal/types.js\";\nexport type { TerminalLocation } from \"./terminal/types.js\";\nexport { TtyWriter } from \"./terminal/TtyWriter.js\";\n\nexport {\n AgentRegistry,\n RenameNotFoundError,\n RenameConflictError,\n AGENT_RUNTIME_PROVIDERS,\n parseTmuxRuntimeRef,\n} from \"./utils/AgentRegistry.js\";\nexport type { AgentRuntimeProvider } from \"./utils/AgentRegistry.js\";\nexport type { InteractiveAgentRuntime } from \"./runtime/types.js\";\nexport {\n startAgent,\n stopAgent,\n focusAgent,\n sendAgentPrompt,\n TmuxUnavailableError,\n AgentNameInUseError,\n AgentPidPollTimeoutError,\n AgentRuntimeUnavailableError,\n AgentTerminalNotFoundError,\n DEFAULT_PID_POLL_TIMEOUT_MS,\n} from \"./runtime/ManagedAgentRuntime.js\";\n\nexport type { AgentRequest } from \"./utils/agent-requests.js\";\nexport { readLatestAgentRequest, writeAgentRequest } from \"./utils/agent-requests.js\";\n\nexport { AGENT_MODES } from \"./durable/DurableAgent.js\";\nexport type { DurableProvider } from \"./durable/DurableAgent.js\";\nexport { DurableAgentRepository } from \"./durable/DurableAgentRepository.js\";\nexport { ClaudePrintAgentService } from \"./harnesses/claude/durable/ClaudePrintAgentService.js\";\nexport { CodexPrintAgentService } from \"./harnesses/codex/durable/CodexPrintAgentService.js\";\nexport { PiPrintAgentService } from \"./harnesses/pi/durable/PiPrintAgentService.js\";\n"],"names":["AgentManager","getAnthropicCapacityReport","getClaudeCapacityReport","getCodexCapacityReport","getOpenAiCapacityReport","getZaiCapacityReport","getAgentReadinessReports","worstReadinessStatus","createBuiltinAdapters","HARNESS_RUNTIME_PROFILES","AGENT_TYPES","AgentStatus","TerminalFocusManager","TerminalType","TtyWriter","AgentRegistry","RenameNotFoundError","RenameConflictError","AGENT_RUNTIME_PROVIDERS","parseTmuxRuntimeRef","startAgent","stopAgent","focusAgent","sendAgentPrompt","TmuxUnavailableError","AgentNameInUseError","AgentPidPollTimeoutError","AgentRuntimeUnavailableError","AgentTerminalNotFoundError","DEFAULT_PID_POLL_TIMEOUT_MS","readLatestAgentRequest","writeAgentRequest","AGENT_MODES","DurableAgentRepository","ClaudePrintAgentService","CodexPrintAgentService","PiPrintAgentService"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SACEC,0BAA0B,EAC1BC,uBAAuB,EACvBC,sBAAsB,EACtBC,uBAAuB,EACvBC,oBAAoB,QACf,sBAAsB;AAG7B,SACEC,wBAAwB,EACxBC,oBAAoB,QACf,0CAA0C;AAQjD,SAASC,qBAAqB,QAAQ,uBAAuB;AAC7D,SAASC,wBAAwB,QAAiC,iCAAiC;AACnG,SAASC,WAAW,EAAEC,WAAW,QAAQ,6BAA6B;AAUtE,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,SAASC,YAAY,QAAQ,sBAAsB;AAEnD,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,SACEC,aAAa,EACbC,mBAAmB,EACnBC,mBAAmB,EACnBC,uBAAuB,EACvBC,mBAAmB,QACd,2BAA2B;AAGlC,SACEC,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,eAAe,EACfC,oBAAoB,EACpBC,mBAAmB,EACnBC,wBAAwB,EACxBC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,2BAA2B,QACtB,mCAAmC;AAG1C,SAASC,sBAAsB,EAAEC,iBAAiB,QAAQ,4BAA4B;AAEtF,SAASC,WAAW,QAAQ,4BAA4B;AAExD,SAASC,sBAAsB,QAAQ,sCAAsC;AAC7E,SAASC,uBAAuB,QAAQ,wDAAwD;AAChG,SAASC,sBAAsB,QAAQ,sDAAsD;AAC7F,SAASC,mBAAmB,QAAQ,gDAAgD"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { AgentManager } from \"./AgentManager.js\";\nexport {\n getAnthropicCapacityReport,\n getClaudeCapacityReport,\n getCodexCapacityReport,\n getDevinCapacityReport,\n getOpenAiCapacityReport,\n getZaiCapacityReport,\n} from \"./capacity/index.js\";\nexport type { CapacityReport, CapacityWindow } from \"./capacity/index.js\";\n\nexport {\n getAgentReadinessReports,\n worstReadinessStatus,\n} from \"./harnesses/readiness/AgentReadiness.js\";\nexport type {\n AgentReadinessOptions,\n AgentReadinessReport,\n ReadinessAgentType,\n ReadinessStatus,\n} from \"./harnesses/readiness/AgentReadiness.js\";\n\nexport { createBuiltinAdapters } from \"./harnesses/index.js\";\nexport { HARNESS_RUNTIME_PROFILES, type StartableAgentType } from \"./harnesses/runtimeProfiles.js\";\nexport { AGENT_TYPES, AgentStatus } from \"./adapters/AgentAdapter.js\";\nexport type {\n AgentAdapter,\n AgentType,\n AgentInfo,\n ConversationMessage,\n SessionSummary,\n ListSessionsOptions,\n} from \"./adapters/AgentAdapter.js\";\n\nexport { TerminalFocusManager } from \"./terminal/TerminalFocusManager.js\";\nexport { TerminalType } from \"./terminal/types.js\";\nexport type { TerminalLocation } from \"./terminal/types.js\";\nexport { TtyWriter } from \"./terminal/TtyWriter.js\";\n\nexport {\n AgentRegistry,\n RenameNotFoundError,\n RenameConflictError,\n AGENT_RUNTIME_PROVIDERS,\n parseTmuxRuntimeRef,\n} from \"./utils/AgentRegistry.js\";\nexport type { AgentRuntimeProvider } from \"./utils/AgentRegistry.js\";\nexport type { InteractiveAgentRuntime } from \"./runtime/types.js\";\nexport {\n startAgent,\n stopAgent,\n focusAgent,\n sendAgentPrompt,\n TmuxUnavailableError,\n AgentNameInUseError,\n AgentPidPollTimeoutError,\n AgentRuntimeUnavailableError,\n AgentTerminalNotFoundError,\n DEFAULT_PID_POLL_TIMEOUT_MS,\n} from \"./runtime/ManagedAgentRuntime.js\";\n\nexport type { AgentRequest } from \"./utils/agent-requests.js\";\nexport { readLatestAgentRequest, writeAgentRequest } from \"./utils/agent-requests.js\";\n\nexport { AGENT_MODES } from \"./durable/DurableAgent.js\";\nexport type { DurableProvider } from \"./durable/DurableAgent.js\";\nexport { DurableAgentRepository } from \"./durable/DurableAgentRepository.js\";\nexport { ClaudePrintAgentService } from \"./harnesses/claude/durable/ClaudePrintAgentService.js\";\nexport { CodexPrintAgentService } from \"./harnesses/codex/durable/CodexPrintAgentService.js\";\nexport { PiPrintAgentService } from \"./harnesses/pi/durable/PiPrintAgentService.js\";\n"],"names":["AgentManager","getAnthropicCapacityReport","getClaudeCapacityReport","getCodexCapacityReport","getDevinCapacityReport","getOpenAiCapacityReport","getZaiCapacityReport","getAgentReadinessReports","worstReadinessStatus","createBuiltinAdapters","HARNESS_RUNTIME_PROFILES","AGENT_TYPES","AgentStatus","TerminalFocusManager","TerminalType","TtyWriter","AgentRegistry","RenameNotFoundError","RenameConflictError","AGENT_RUNTIME_PROVIDERS","parseTmuxRuntimeRef","startAgent","stopAgent","focusAgent","sendAgentPrompt","TmuxUnavailableError","AgentNameInUseError","AgentPidPollTimeoutError","AgentRuntimeUnavailableError","AgentTerminalNotFoundError","DEFAULT_PID_POLL_TIMEOUT_MS","readLatestAgentRequest","writeAgentRequest","AGENT_MODES","DurableAgentRepository","ClaudePrintAgentService","CodexPrintAgentService","PiPrintAgentService"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SACEC,0BAA0B,EAC1BC,uBAAuB,EACvBC,sBAAsB,EACtBC,sBAAsB,EACtBC,uBAAuB,EACvBC,oBAAoB,QACf,sBAAsB;AAG7B,SACEC,wBAAwB,EACxBC,oBAAoB,QACf,0CAA0C;AAQjD,SAASC,qBAAqB,QAAQ,uBAAuB;AAC7D,SAASC,wBAAwB,QAAiC,iCAAiC;AACnG,SAASC,WAAW,EAAEC,WAAW,QAAQ,6BAA6B;AAUtE,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,SAASC,YAAY,QAAQ,sBAAsB;AAEnD,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,SACEC,aAAa,EACbC,mBAAmB,EACnBC,mBAAmB,EACnBC,uBAAuB,EACvBC,mBAAmB,QACd,2BAA2B;AAGlC,SACEC,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,eAAe,EACfC,oBAAoB,EACpBC,mBAAmB,EACnBC,wBAAwB,EACxBC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,2BAA2B,QACtB,mCAAmC;AAG1C,SAASC,sBAAsB,EAAEC,iBAAiB,QAAQ,4BAA4B;AAEtF,SAASC,WAAW,QAAQ,4BAA4B;AAExD,SAASC,sBAAsB,QAAQ,sCAAsC;AAC7E,SAASC,uBAAuB,QAAQ,wDAAwD;AAChG,SAASC,sBAAsB,QAAQ,sDAAsD;AAC7F,SAASC,mBAAmB,QAAQ,gDAAgD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtyWriter.d.ts","sourceRoot":"","sources":["../../src/terminal/TtyWriter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"TtyWriter.d.ts","sourceRoot":"","sources":["../../src/terminal/TtyWriter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,qBAAa,SAAS;WACP,IAAI,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;WAUhE,OAAO,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAS7E"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { terminalBackendFor } from "./backends/index.js";
|
|
1
|
+
import { TERMINAL_BACKENDS, terminalBackendFor } from "./backends/index.js";
|
|
2
|
+
const SUPPORTED = `Supported: ${TERMINAL_BACKENDS.map((backend)=>backend.label).join(", ")}.`;
|
|
2
3
|
export class TtyWriter {
|
|
3
4
|
static async send(location, message) {
|
|
4
5
|
const backend = terminalBackendFor(location.type);
|
|
5
6
|
if (!backend) {
|
|
6
|
-
throw new Error(`Cannot send input: unsupported terminal type "${location.type}". `
|
|
7
|
+
throw new Error(`Cannot send input: unsupported terminal type "${location.type}". ${SUPPORTED}`);
|
|
7
8
|
}
|
|
8
9
|
await backend.send(location, message);
|
|
9
10
|
}
|
|
10
11
|
static async sendKey(location, key) {
|
|
11
12
|
const backend = terminalBackendFor(location.type);
|
|
12
13
|
if (!backend) {
|
|
13
|
-
throw new Error(`Cannot send key: unsupported terminal type "${location.type}". `
|
|
14
|
+
throw new Error(`Cannot send key: unsupported terminal type "${location.type}". ${SUPPORTED}`);
|
|
14
15
|
}
|
|
15
16
|
await backend.sendKey(location, key);
|
|
16
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/terminal/TtyWriter.ts"],"sourcesContent":["import { terminalBackendFor } from \"./backends/index.js\";\nimport type { TerminalLocation } from \"./types.js\";\n\nexport class TtyWriter {\n static async send(location: TerminalLocation, message: string): Promise<void> {\n const backend = terminalBackendFor(location.type);\n if (!backend) {\n throw new Error(\n `Cannot send input: unsupported terminal type \"${location.type}\".
|
|
1
|
+
{"version":3,"sources":["../../src/terminal/TtyWriter.ts"],"sourcesContent":["import { TERMINAL_BACKENDS, terminalBackendFor } from \"./backends/index.js\";\nimport type { TerminalLocation } from \"./types.js\";\n\nconst SUPPORTED = `Supported: ${TERMINAL_BACKENDS.map((backend) => backend.label).join(\", \")}.`;\n\nexport class TtyWriter {\n static async send(location: TerminalLocation, message: string): Promise<void> {\n const backend = terminalBackendFor(location.type);\n if (!backend) {\n throw new Error(\n `Cannot send input: unsupported terminal type \"${location.type}\". ${SUPPORTED}`,\n );\n }\n await backend.send(location, message);\n }\n\n static async sendKey(location: TerminalLocation, key: string): Promise<void> {\n const backend = terminalBackendFor(location.type);\n if (!backend) {\n throw new Error(\n `Cannot send key: unsupported terminal type \"${location.type}\". ${SUPPORTED}`,\n );\n }\n await backend.sendKey(location, key);\n }\n}\n"],"names":["TERMINAL_BACKENDS","terminalBackendFor","SUPPORTED","map","backend","label","join","TtyWriter","send","location","message","type","Error","sendKey","key"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,kBAAkB,QAAQ,sBAAsB;AAG5E,MAAMC,YAAY,CAAC,WAAW,EAAEF,kBAAkBG,GAAG,CAAC,CAACC,UAAYA,QAAQC,KAAK,EAAEC,IAAI,CAAC,MAAM,CAAC,CAAC;AAE/F,OAAO,MAAMC;IACX,aAAaC,KAAKC,QAA0B,EAAEC,OAAe,EAAiB;QAC5E,MAAMN,UAAUH,mBAAmBQ,SAASE,IAAI;QAChD,IAAI,CAACP,SAAS;YACZ,MAAM,IAAIQ,MACR,CAAC,8CAA8C,EAAEH,SAASE,IAAI,CAAC,GAAG,EAAET,WAAW;QAEnF;QACA,MAAME,QAAQI,IAAI,CAACC,UAAUC;IAC/B;IAEA,aAAaG,QAAQJ,QAA0B,EAAEK,GAAW,EAAiB;QAC3E,MAAMV,UAAUH,mBAAmBQ,SAASE,IAAI;QAChD,IAAI,CAACP,SAAS;YACZ,MAAM,IAAIQ,MACR,CAAC,4CAA4C,EAAEH,SAASE,IAAI,CAAC,GAAG,EAAET,WAAW;QAEjF;QACA,MAAME,QAAQS,OAAO,CAACJ,UAAUK;IAClC;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ghostty.d.ts","sourceRoot":"","sources":["../../../src/terminal/backends/ghostty.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,eAAe,EAAyB,MAAM,aAAa,CAAC;AA2IxF,eAAO,MAAM,cAAc,EAAE,eAmC5B,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { execFile } from "child_process";
|
|
2
|
+
import { writeFile } from "fs/promises";
|
|
3
|
+
import { promisify } from "util";
|
|
4
|
+
import { escapeAppleScript } from "../../utils/applescript.js";
|
|
5
|
+
import { getProcessCwdsAsync } from "../../utils/process.js";
|
|
6
|
+
import { TerminalType } from "../types.js";
|
|
7
|
+
import { CARRIAGE_RETURN, isProcessName, sleep } from "./shared.js";
|
|
8
|
+
const execFileAsync = promisify(execFile);
|
|
9
|
+
/** Separates fields in AppleScript output; never part of an id, title or path. */ const FIELD_SEPARATOR = "\x1f";
|
|
10
|
+
const MARKER_POLL_ATTEMPTS = 10;
|
|
11
|
+
const MARKER_POLL_INTERVAL_MS = 50;
|
|
12
|
+
async function listProcesses() {
|
|
13
|
+
const { stdout } = await execFileAsync("ps", [
|
|
14
|
+
"-Axo",
|
|
15
|
+
"pid=,ppid=,tty=,comm="
|
|
16
|
+
]);
|
|
17
|
+
const rows = [];
|
|
18
|
+
for (const line of stdout.split("\n")){
|
|
19
|
+
const match = line.trim().match(/^(\d+)\s+(\d+)\s+(\S+)\s+(.+)$/);
|
|
20
|
+
if (match) {
|
|
21
|
+
rows.push({
|
|
22
|
+
pid: Number(match[1]),
|
|
23
|
+
ppid: Number(match[2]),
|
|
24
|
+
tty: match[3],
|
|
25
|
+
comm: match[4]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return rows;
|
|
30
|
+
}
|
|
31
|
+
async function listTerminals() {
|
|
32
|
+
const script = `
|
|
33
|
+
tell application "Ghostty"
|
|
34
|
+
set out to ""
|
|
35
|
+
repeat with t in terminals
|
|
36
|
+
set out to out & (id of t) & (character id 31) & (name of t) & (character id 31) & (working directory of t) & linefeed
|
|
37
|
+
end repeat
|
|
38
|
+
return out
|
|
39
|
+
end tell`;
|
|
40
|
+
const { stdout } = await execFileAsync("osascript", [
|
|
41
|
+
"-e",
|
|
42
|
+
script
|
|
43
|
+
]);
|
|
44
|
+
return stdout.split("\n").map((line)=>line.split(FIELD_SEPARATOR)).filter((fields)=>fields.length === 3 && fields[0]).map(([id, name, workingDirectory])=>({
|
|
45
|
+
id,
|
|
46
|
+
name,
|
|
47
|
+
workingDirectory
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
/** Run an AppleScript `command` with `t` bound to the located terminal; false if it is gone. */ async function onTerminal(location, command) {
|
|
51
|
+
const script = `
|
|
52
|
+
tell application "Ghostty"
|
|
53
|
+
set matches to (every terminal whose id is "${escapeAppleScript(location.identifier)}")
|
|
54
|
+
if (count of matches) is 0 then return "not_found"
|
|
55
|
+
set t to item 1 of matches
|
|
56
|
+
${command}
|
|
57
|
+
end tell
|
|
58
|
+
return "ok"`;
|
|
59
|
+
const { stdout } = await execFileAsync("osascript", [
|
|
60
|
+
"-e",
|
|
61
|
+
script
|
|
62
|
+
]);
|
|
63
|
+
return stdout.trim() === "ok";
|
|
64
|
+
}
|
|
65
|
+
/** Set the window title of whatever terminal owns `tty` (OSC 2). */ async function writeTitle(tty, title) {
|
|
66
|
+
// eslint-disable-next-line no-control-regex
|
|
67
|
+
const safe = title.replace(/[\x00-\x1f\x7f]/g, "");
|
|
68
|
+
await writeFile(tty, `\x1b]2;${safe}\x07`, {
|
|
69
|
+
flag: "a"
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Ghostty's AppleScript terminals expose an id, title and working directory,
|
|
74
|
+
* but not their TTY. Find the one owning `tty` without guessing:
|
|
75
|
+
* 1. only TTYs whose session was started by a ghostty process qualify;
|
|
76
|
+
* 2. if exactly one terminal's working directory matches a process on this
|
|
77
|
+
* TTY, and no other Ghostty TTY has a process there, that is it;
|
|
78
|
+
* 3. otherwise briefly set a unique title on the TTY, find the terminal now
|
|
79
|
+
* showing it, and restore its previous title.
|
|
80
|
+
*/ async function findTerminalId(tty) {
|
|
81
|
+
const processes = await listProcesses();
|
|
82
|
+
const ghosttyPids = new Set(processes.filter((p)=>isProcessName(p.comm, "ghostty")).map((p)=>p.pid));
|
|
83
|
+
if (ghosttyPids.size === 0) return null;
|
|
84
|
+
const ttyName = tty.replace(/^\/dev\//, "");
|
|
85
|
+
const ghosttyTtys = new Set(processes.filter((p)=>ghosttyPids.has(p.ppid) && p.tty !== "??").map((p)=>p.tty));
|
|
86
|
+
if (!ghosttyTtys.has(ttyName)) return null;
|
|
87
|
+
const terminals = await listTerminals();
|
|
88
|
+
const sessionProcesses = processes.filter((p)=>ghosttyTtys.has(p.tty));
|
|
89
|
+
const cwdByPid = await getProcessCwdsAsync(sessionProcesses.map((p)=>p.pid));
|
|
90
|
+
const ownDirs = new Set();
|
|
91
|
+
const otherDirs = new Set();
|
|
92
|
+
for (const p of sessionProcesses){
|
|
93
|
+
const cwd = cwdByPid.get(p.pid);
|
|
94
|
+
if (cwd) (p.tty === ttyName ? ownDirs : otherDirs).add(cwd);
|
|
95
|
+
}
|
|
96
|
+
// Trust the directory only when exactly one terminal is in a folder no other Ghostty TTY uses.
|
|
97
|
+
const byDirectory = terminals.filter((t)=>ownDirs.has(t.workingDirectory));
|
|
98
|
+
if (byDirectory.length === 1 && !otherDirs.has(byDirectory[0].workingDirectory)) {
|
|
99
|
+
return byDirectory[0].id;
|
|
100
|
+
}
|
|
101
|
+
const marker = `ai-devkit-${process.pid}-${Date.now()}`;
|
|
102
|
+
await writeTitle(tty, marker);
|
|
103
|
+
for(let attempt = 0; attempt < MARKER_POLL_ATTEMPTS; attempt++){
|
|
104
|
+
const marked = (await listTerminals()).find((t)=>t.name === marker);
|
|
105
|
+
if (marked) {
|
|
106
|
+
const previous = terminals.find((t)=>t.id === marked.id)?.name ?? "";
|
|
107
|
+
await writeTitle(tty, previous);
|
|
108
|
+
return marked.id;
|
|
109
|
+
}
|
|
110
|
+
await sleep(MARKER_POLL_INTERVAL_MS);
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A Ghostty `text:` action that writes `bytes` to the terminal as typed.
|
|
116
|
+
* Unlike `send key`, it does not go through the keyboard layout or input
|
|
117
|
+
* method, which can turn a digit key into another character.
|
|
118
|
+
*/ function textAction(bytes) {
|
|
119
|
+
const escaped = Array.from(bytes, (char)=>{
|
|
120
|
+
if (char === "\\") return "\\\\";
|
|
121
|
+
const code = char.charCodeAt(0);
|
|
122
|
+
return code >= 0x20 && code < 0x7f ? char : `\\x${code.toString(16).padStart(2, "0")}`;
|
|
123
|
+
}).join("");
|
|
124
|
+
return `perform action "${escapeAppleScript(`text:${escaped}`)}" on t`;
|
|
125
|
+
}
|
|
126
|
+
export const ghosttyBackend = {
|
|
127
|
+
type: TerminalType.GHOSTTY,
|
|
128
|
+
label: "Ghostty",
|
|
129
|
+
async find (tty) {
|
|
130
|
+
try {
|
|
131
|
+
const id = await findTerminalId(tty);
|
|
132
|
+
return id ? {
|
|
133
|
+
type: TerminalType.GHOSTTY,
|
|
134
|
+
identifier: id,
|
|
135
|
+
tty
|
|
136
|
+
} : null;
|
|
137
|
+
} catch {
|
|
138
|
+
// Ghostty not installed, not scriptable, or the TTY is not writable
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
async focus (location) {
|
|
143
|
+
return onTerminal(location, "focus t\n activate");
|
|
144
|
+
},
|
|
145
|
+
async send (location, message) {
|
|
146
|
+
if (!await onTerminal(location, `input text "${escapeAppleScript(message)}" to t`)) {
|
|
147
|
+
throw new Error(`Ghostty terminal not found for TTY ${location.tty}`);
|
|
148
|
+
}
|
|
149
|
+
await sleep(150);
|
|
150
|
+
if (!await onTerminal(location, textAction(CARRIAGE_RETURN))) {
|
|
151
|
+
throw new Error(`Ghostty terminal disappeared before Enter could be sent for TTY ${location.tty}`);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
async sendKey (location, key) {
|
|
155
|
+
if (!await onTerminal(location, textAction(key))) {
|
|
156
|
+
throw new Error(`Ghostty terminal not found for TTY ${location.tty}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=ghostty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/terminal/backends/ghostty.ts"],"sourcesContent":["import { execFile } from \"child_process\";\nimport { writeFile } from \"fs/promises\";\nimport { promisify } from \"util\";\nimport { escapeAppleScript } from \"../../utils/applescript.js\";\nimport { getProcessCwdsAsync } from \"../../utils/process.js\";\nimport { TerminalType, type TerminalBackend, type TerminalLocation } from \"../types.js\";\nimport { CARRIAGE_RETURN, isProcessName, sleep } from \"./shared.js\";\n\nconst execFileAsync = promisify(execFile);\n\n/** Separates fields in AppleScript output; never part of an id, title or path. */\nconst FIELD_SEPARATOR = \"\\x1f\";\nconst MARKER_POLL_ATTEMPTS = 10;\nconst MARKER_POLL_INTERVAL_MS = 50;\n\ninterface GhosttyTerminal {\n id: string;\n name: string;\n workingDirectory: string;\n}\n\ninterface ProcessRow {\n pid: number;\n ppid: number;\n tty: string;\n comm: string;\n}\n\nasync function listProcesses(): Promise<ProcessRow[]> {\n const { stdout } = await execFileAsync(\"ps\", [\"-Axo\", \"pid=,ppid=,tty=,comm=\"]);\n const rows: ProcessRow[] = [];\n for (const line of stdout.split(\"\\n\")) {\n const match = line.trim().match(/^(\\d+)\\s+(\\d+)\\s+(\\S+)\\s+(.+)$/);\n if (match) {\n rows.push({ pid: Number(match[1]), ppid: Number(match[2]), tty: match[3], comm: match[4] });\n }\n }\n return rows;\n}\n\nasync function listTerminals(): Promise<GhosttyTerminal[]> {\n const script = `\ntell application \"Ghostty\"\n set out to \"\"\n repeat with t in terminals\n set out to out & (id of t) & (character id 31) & (name of t) & (character id 31) & (working directory of t) & linefeed\n end repeat\n return out\nend tell`;\n const { stdout } = await execFileAsync(\"osascript\", [\"-e\", script]);\n return stdout\n .split(\"\\n\")\n .map((line) => line.split(FIELD_SEPARATOR))\n .filter((fields) => fields.length === 3 && fields[0])\n .map(([id, name, workingDirectory]) => ({ id, name, workingDirectory }));\n}\n\n/** Run an AppleScript `command` with `t` bound to the located terminal; false if it is gone. */\nasync function onTerminal(location: TerminalLocation, command: string): Promise<boolean> {\n const script = `\ntell application \"Ghostty\"\n set matches to (every terminal whose id is \"${escapeAppleScript(location.identifier)}\")\n if (count of matches) is 0 then return \"not_found\"\n set t to item 1 of matches\n ${command}\nend tell\nreturn \"ok\"`;\n const { stdout } = await execFileAsync(\"osascript\", [\"-e\", script]);\n return stdout.trim() === \"ok\";\n}\n\n/** Set the window title of whatever terminal owns `tty` (OSC 2). */\nasync function writeTitle(tty: string, title: string): Promise<void> {\n // eslint-disable-next-line no-control-regex\n const safe = title.replace(/[\\x00-\\x1f\\x7f]/g, \"\");\n await writeFile(tty, `\\x1b]2;${safe}\\x07`, { flag: \"a\" });\n}\n\n/**\n * Ghostty's AppleScript terminals expose an id, title and working directory,\n * but not their TTY. Find the one owning `tty` without guessing:\n * 1. only TTYs whose session was started by a ghostty process qualify;\n * 2. if exactly one terminal's working directory matches a process on this\n * TTY, and no other Ghostty TTY has a process there, that is it;\n * 3. otherwise briefly set a unique title on the TTY, find the terminal now\n * showing it, and restore its previous title.\n */\nasync function findTerminalId(tty: string): Promise<string | null> {\n const processes = await listProcesses();\n const ghosttyPids = new Set(\n processes.filter((p) => isProcessName(p.comm, \"ghostty\")).map((p) => p.pid),\n );\n if (ghosttyPids.size === 0) return null;\n\n const ttyName = tty.replace(/^\\/dev\\//, \"\");\n const ghosttyTtys = new Set(\n processes.filter((p) => ghosttyPids.has(p.ppid) && p.tty !== \"??\").map((p) => p.tty),\n );\n if (!ghosttyTtys.has(ttyName)) return null;\n\n const terminals = await listTerminals();\n const sessionProcesses = processes.filter((p) => ghosttyTtys.has(p.tty));\n const cwdByPid = await getProcessCwdsAsync(sessionProcesses.map((p) => p.pid));\n const ownDirs = new Set<string>();\n const otherDirs = new Set<string>();\n for (const p of sessionProcesses) {\n const cwd = cwdByPid.get(p.pid);\n if (cwd) (p.tty === ttyName ? ownDirs : otherDirs).add(cwd);\n }\n\n // Trust the directory only when exactly one terminal is in a folder no other Ghostty TTY uses.\n const byDirectory = terminals.filter((t) => ownDirs.has(t.workingDirectory));\n if (byDirectory.length === 1 && !otherDirs.has(byDirectory[0].workingDirectory)) {\n return byDirectory[0].id;\n }\n\n const marker = `ai-devkit-${process.pid}-${Date.now()}`;\n await writeTitle(tty, marker);\n for (let attempt = 0; attempt < MARKER_POLL_ATTEMPTS; attempt++) {\n const marked = (await listTerminals()).find((t) => t.name === marker);\n if (marked) {\n const previous = terminals.find((t) => t.id === marked.id)?.name ?? \"\";\n await writeTitle(tty, previous);\n return marked.id;\n }\n await sleep(MARKER_POLL_INTERVAL_MS);\n }\n return null;\n}\n\n/**\n * A Ghostty `text:` action that writes `bytes` to the terminal as typed.\n * Unlike `send key`, it does not go through the keyboard layout or input\n * method, which can turn a digit key into another character.\n */\nfunction textAction(bytes: string): string {\n const escaped = Array.from(bytes, (char) => {\n if (char === \"\\\\\") return \"\\\\\\\\\";\n const code = char.charCodeAt(0);\n return code >= 0x20 && code < 0x7f ? char : `\\\\x${code.toString(16).padStart(2, \"0\")}`;\n }).join(\"\");\n return `perform action \"${escapeAppleScript(`text:${escaped}`)}\" on t`;\n}\n\nexport const ghosttyBackend: TerminalBackend = {\n type: TerminalType.GHOSTTY,\n label: \"Ghostty\",\n\n async find(tty) {\n try {\n const id = await findTerminalId(tty);\n return id ? { type: TerminalType.GHOSTTY, identifier: id, tty } : null;\n } catch {\n // Ghostty not installed, not scriptable, or the TTY is not writable\n return null;\n }\n },\n\n async focus(location) {\n return onTerminal(location, \"focus t\\n activate\");\n },\n\n async send(location, message) {\n if (!(await onTerminal(location, `input text \"${escapeAppleScript(message)}\" to t`))) {\n throw new Error(`Ghostty terminal not found for TTY ${location.tty}`);\n }\n await sleep(150);\n if (!(await onTerminal(location, textAction(CARRIAGE_RETURN)))) {\n throw new Error(\n `Ghostty terminal disappeared before Enter could be sent for TTY ${location.tty}`,\n );\n }\n },\n\n async sendKey(location, key) {\n if (!(await onTerminal(location, textAction(key)))) {\n throw new Error(`Ghostty terminal not found for TTY ${location.tty}`);\n }\n },\n};\n"],"names":["execFile","writeFile","promisify","escapeAppleScript","getProcessCwdsAsync","TerminalType","CARRIAGE_RETURN","isProcessName","sleep","execFileAsync","FIELD_SEPARATOR","MARKER_POLL_ATTEMPTS","MARKER_POLL_INTERVAL_MS","listProcesses","stdout","rows","line","split","match","trim","push","pid","Number","ppid","tty","comm","listTerminals","script","map","filter","fields","length","id","name","workingDirectory","onTerminal","location","command","identifier","writeTitle","title","safe","replace","flag","findTerminalId","processes","ghosttyPids","Set","p","size","ttyName","ghosttyTtys","has","terminals","sessionProcesses","cwdByPid","ownDirs","otherDirs","cwd","get","add","byDirectory","t","marker","process","Date","now","attempt","marked","find","previous","textAction","bytes","escaped","Array","from","char","code","charCodeAt","toString","padStart","join","ghosttyBackend","type","GHOSTTY","label","focus","send","message","Error","sendKey","key"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,YAAY,QAAqD,cAAc;AACxF,SAASC,eAAe,EAAEC,aAAa,EAAEC,KAAK,QAAQ,cAAc;AAEpE,MAAMC,gBAAgBP,UAAUF;AAEhC,gFAAgF,GAChF,MAAMU,kBAAkB;AACxB,MAAMC,uBAAuB;AAC7B,MAAMC,0BAA0B;AAehC,eAAeC;IACb,MAAM,EAAEC,MAAM,EAAE,GAAG,MAAML,cAAc,MAAM;QAAC;QAAQ;KAAwB;IAC9E,MAAMM,OAAqB,EAAE;IAC7B,KAAK,MAAMC,QAAQF,OAAOG,KAAK,CAAC,MAAO;QACrC,MAAMC,QAAQF,KAAKG,IAAI,GAAGD,KAAK,CAAC;QAChC,IAAIA,OAAO;YACTH,KAAKK,IAAI,CAAC;gBAAEC,KAAKC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rD,WAAWC,UAAU,CAAC,YAAY,EAAEjC,kBAAkBqF,SAAS,MAAM,CAAC,GAAI;YACpF,MAAM,IAAIC,MAAM,CAAC,mCAAmC,EAAErD,SAASZ,GAAG,EAAE;QACtE;QACA,MAAMhB,MAAM;QACZ,IAAI,CAAE,MAAM2B,WAAWC,UAAUmC,WAAWjE,mBAAoB;YAC9D,MAAM,IAAImF,MACR,CAAC,gEAAgE,EAAErD,SAASZ,GAAG,EAAE;QAErF;IACF;IAEA,MAAMkE,SAAQtD,QAAQ,EAAEuD,GAAG;QACzB,IAAI,CAAE,MAAMxD,WAAWC,UAAUmC,WAAWoB,OAAQ;YAClD,MAAM,IAAIF,MAAM,CAAC,mCAAmC,EAAErD,SAASZ,GAAG,EAAE;QACtE;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/terminal/backends/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/terminal/backends/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAMvD,CAAC;AAMF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,GAAG,SAAS,CAElF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ghosttyBackend } from "./ghostty.js";
|
|
1
2
|
import { iterm2Backend } from "./iterm2.js";
|
|
2
3
|
import { terminalAppBackend } from "./terminal-app.js";
|
|
3
4
|
import { tmuxBackend } from "./tmux.js";
|
|
@@ -5,6 +6,7 @@ import { weztermBackend } from "./wezterm.js";
|
|
|
5
6
|
export const TERMINAL_BACKENDS = [
|
|
6
7
|
tmuxBackend,
|
|
7
8
|
weztermBackend,
|
|
9
|
+
ghosttyBackend,
|
|
8
10
|
iterm2Backend,
|
|
9
11
|
terminalAppBackend
|
|
10
12
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/terminal/backends/index.ts"],"sourcesContent":["import type { TerminalBackend } from \"../types.js\";\nimport { TerminalType } from \"../types.js\";\nimport { iterm2Backend } from \"./iterm2.js\";\nimport { terminalAppBackend } from \"./terminal-app.js\";\nimport { tmuxBackend } from \"./tmux.js\";\nimport { weztermBackend } from \"./wezterm.js\";\n\nexport const TERMINAL_BACKENDS: readonly TerminalBackend[] = [\n tmuxBackend,\n weztermBackend,\n iterm2Backend,\n terminalAppBackend,\n];\n\nconst BACKENDS_BY_TYPE = new Map<TerminalType, TerminalBackend>(\n TERMINAL_BACKENDS.map((backend) => [backend.type, backend]),\n);\n\nexport function terminalBackendFor(type: TerminalType): TerminalBackend | undefined {\n return BACKENDS_BY_TYPE.get(type);\n}\n"],"names":["iterm2Backend","terminalAppBackend","tmuxBackend","weztermBackend","TERMINAL_BACKENDS","BACKENDS_BY_TYPE","Map","map","backend","type","terminalBackendFor","get"],"mappings":"AAEA,SAASA,aAAa,QAAQ,cAAc;AAC5C,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,cAAc,QAAQ,eAAe;AAE9C,OAAO,MAAMC,oBAAgD;IAC3DF;IACAC;
|
|
1
|
+
{"version":3,"sources":["../../../src/terminal/backends/index.ts"],"sourcesContent":["import type { TerminalBackend } from \"../types.js\";\nimport { TerminalType } from \"../types.js\";\nimport { ghosttyBackend } from \"./ghostty.js\";\nimport { iterm2Backend } from \"./iterm2.js\";\nimport { terminalAppBackend } from \"./terminal-app.js\";\nimport { tmuxBackend } from \"./tmux.js\";\nimport { weztermBackend } from \"./wezterm.js\";\n\nexport const TERMINAL_BACKENDS: readonly TerminalBackend[] = [\n tmuxBackend,\n weztermBackend,\n ghosttyBackend,\n iterm2Backend,\n terminalAppBackend,\n];\n\nconst BACKENDS_BY_TYPE = new Map<TerminalType, TerminalBackend>(\n TERMINAL_BACKENDS.map((backend) => [backend.type, backend]),\n);\n\nexport function terminalBackendFor(type: TerminalType): TerminalBackend | undefined {\n return BACKENDS_BY_TYPE.get(type);\n}\n"],"names":["ghosttyBackend","iterm2Backend","terminalAppBackend","tmuxBackend","weztermBackend","TERMINAL_BACKENDS","BACKENDS_BY_TYPE","Map","map","backend","type","terminalBackendFor","get"],"mappings":"AAEA,SAASA,cAAc,QAAQ,eAAe;AAC9C,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,cAAc,QAAQ,eAAe;AAE9C,OAAO,MAAMC,oBAAgD;IAC3DF;IACAC;IACAJ;IACAC;IACAC;CACD,CAAC;AAEF,MAAMI,mBAAmB,IAAIC,IAC3BF,kBAAkBG,GAAG,CAAC,CAACC,UAAY;QAACA,QAAQC,IAAI;QAAED;KAAQ;AAG5D,OAAO,SAASE,mBAAmBD,IAAkB;IACnD,OAAOJ,iBAAiBM,GAAG,CAACF;AAC9B"}
|
|
@@ -3,5 +3,7 @@ export declare const ESCAPE_BYTE = "\u001B";
|
|
|
3
3
|
export declare function sleep(ms: number): Promise<void>;
|
|
4
4
|
export declare function execFileWithInput(command: string, args: string[], input: string): Promise<void>;
|
|
5
5
|
export declare function appleScriptKeyAction(key: string): string;
|
|
6
|
+
/** Whether a `ps` comm value (bare name or full executable path) is `name`. */
|
|
7
|
+
export declare function isProcessName(comm: string, name: string): boolean;
|
|
6
8
|
export declare function isProcessRunning(name: string): Promise<boolean>;
|
|
7
9
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/terminal/backends/shared.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,OAAS,CAAC;AACtC,eAAO,MAAM,WAAW,WAAS,CAAC;AAGlC,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMrE"}
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/terminal/backends/shared.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,OAAS,CAAC;AACtC,eAAO,MAAM,WAAW,WAAS,CAAC;AAGlC,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMrE"}
|
|
@@ -24,12 +24,15 @@ export function appleScriptKeyAction(key) {
|
|
|
24
24
|
if (key === ESCAPE_BYTE) return "key code 53";
|
|
25
25
|
return `keystroke "${escapeAppleScript(key)}"`;
|
|
26
26
|
}
|
|
27
|
+
/** Whether a `ps` comm value (bare name or full executable path) is `name`. */ export function isProcessName(comm, name) {
|
|
28
|
+
return comm === name || comm.endsWith(`/${name}`);
|
|
29
|
+
}
|
|
27
30
|
export async function isProcessRunning(name) {
|
|
28
31
|
const { stdout } = await execFileAsync("ps", [
|
|
29
32
|
"-Axo",
|
|
30
33
|
"comm"
|
|
31
34
|
]);
|
|
32
|
-
return stdout.split("\n").map((line)=>line.trim()).some((command)=>command
|
|
35
|
+
return stdout.split("\n").map((line)=>line.trim()).some((command)=>isProcessName(command, name));
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/terminal/backends/shared.ts"],"sourcesContent":["import { execFile } from \"child_process\";\nimport { promisify } from \"util\";\nimport { escapeAppleScript } from \"../../utils/applescript.js\";\n\nexport const CARRIAGE_RETURN = \"\\x0d\";\nexport const ESCAPE_BYTE = \"\\x1b\";\nconst execFileAsync = promisify(execFile);\n\nexport function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport async function execFileWithInput(\n command: string,\n args: string[],\n input: string,\n): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n const child = execFile(command, args, (error) => {\n if (error) reject(error);\n else resolve();\n });\n if (!child.stdin) {\n reject(new Error(`Cannot write stdin to ${command}`));\n return;\n }\n child.stdin.end(input);\n });\n}\n\nexport function appleScriptKeyAction(key: string): string {\n if (key === ESCAPE_BYTE) return \"key code 53\";\n return `keystroke \"${escapeAppleScript(key)}\"`;\n}\n\nexport async function isProcessRunning(name: string): Promise<boolean> {\n const { stdout } = await execFileAsync(\"ps\", [\"-Axo\", \"comm\"]);\n return stdout\n .split(\"\\n\")\n .map((line) => line.trim())\n .some((command) => command
|
|
1
|
+
{"version":3,"sources":["../../../src/terminal/backends/shared.ts"],"sourcesContent":["import { execFile } from \"child_process\";\nimport { promisify } from \"util\";\nimport { escapeAppleScript } from \"../../utils/applescript.js\";\n\nexport const CARRIAGE_RETURN = \"\\x0d\";\nexport const ESCAPE_BYTE = \"\\x1b\";\nconst execFileAsync = promisify(execFile);\n\nexport function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport async function execFileWithInput(\n command: string,\n args: string[],\n input: string,\n): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n const child = execFile(command, args, (error) => {\n if (error) reject(error);\n else resolve();\n });\n if (!child.stdin) {\n reject(new Error(`Cannot write stdin to ${command}`));\n return;\n }\n child.stdin.end(input);\n });\n}\n\nexport function appleScriptKeyAction(key: string): string {\n if (key === ESCAPE_BYTE) return \"key code 53\";\n return `keystroke \"${escapeAppleScript(key)}\"`;\n}\n\n/** Whether a `ps` comm value (bare name or full executable path) is `name`. */\nexport function isProcessName(comm: string, name: string): boolean {\n return comm === name || comm.endsWith(`/${name}`);\n}\n\nexport async function isProcessRunning(name: string): Promise<boolean> {\n const { stdout } = await execFileAsync(\"ps\", [\"-Axo\", \"comm\"]);\n return stdout\n .split(\"\\n\")\n .map((line) => line.trim())\n .some((command) => isProcessName(command, name));\n}\n"],"names":["execFile","promisify","escapeAppleScript","CARRIAGE_RETURN","ESCAPE_BYTE","execFileAsync","sleep","ms","Promise","resolve","setTimeout","execFileWithInput","command","args","input","reject","child","error","stdin","Error","end","appleScriptKeyAction","key","isProcessName","comm","name","endsWith","isProcessRunning","stdout","split","map","line","trim","some"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,iBAAiB,QAAQ,6BAA6B;AAE/D,OAAO,MAAMC,kBAAkB,OAAO;AACtC,OAAO,MAAMC,cAAc,OAAO;AAClC,MAAMC,gBAAgBJ,UAAUD;AAEhC,OAAO,SAASM,MAAMC,EAAU;IAC9B,OAAO,IAAIC,QAAQ,CAACC,UAAYC,WAAWD,SAASF;AACtD;AAEA,OAAO,eAAeI,kBACpBC,OAAe,EACfC,IAAc,EACdC,KAAa;IAEb,MAAM,IAAIN,QAAc,CAACC,SAASM;QAChC,MAAMC,QAAQhB,SAASY,SAASC,MAAM,CAACI;YACrC,IAAIA,OAAOF,OAAOE;iBACbR;QACP;QACA,IAAI,CAACO,MAAME,KAAK,EAAE;YAChBH,OAAO,IAAII,MAAM,CAAC,sBAAsB,EAAEP,SAAS;YACnD;QACF;QACAI,MAAME,KAAK,CAACE,GAAG,CAACN;IAClB;AACF;AAEA,OAAO,SAASO,qBAAqBC,GAAW;IAC9C,IAAIA,QAAQlB,aAAa,OAAO;IAChC,OAAO,CAAC,WAAW,EAAEF,kBAAkBoB,KAAK,CAAC,CAAC;AAChD;AAEA,6EAA6E,GAC7E,OAAO,SAASC,cAAcC,IAAY,EAAEC,IAAY;IACtD,OAAOD,SAASC,QAAQD,KAAKE,QAAQ,CAAC,CAAC,CAAC,EAAED,MAAM;AAClD;AAEA,OAAO,eAAeE,iBAAiBF,IAAY;IACjD,MAAM,EAAEG,MAAM,EAAE,GAAG,MAAMvB,cAAc,MAAM;QAAC;QAAQ;KAAO;IAC7D,OAAOuB,OACJC,KAAK,CAAC,MACNC,GAAG,CAAC,CAACC,OAASA,KAAKC,IAAI,IACvBC,IAAI,CAAC,CAACrB,UAAYW,cAAcX,SAASa;AAC9C"}
|
package/dist/terminal/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/terminal/types.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,YAAY,iBAAiB;IAC7B,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AA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MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,OAAO,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE"}
|
package/dist/terminal/types.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var TerminalType = /*#__PURE__*/ function(TerminalType) {
|
|
2
2
|
TerminalType["TMUX"] = "tmux";
|
|
3
3
|
TerminalType["WEZTERM"] = "wezterm";
|
|
4
|
+
TerminalType["GHOSTTY"] = "ghostty";
|
|
4
5
|
TerminalType["ITERM2"] = "iterm2";
|
|
5
6
|
TerminalType["TERMINAL_APP"] = "terminal-app";
|
|
6
7
|
TerminalType["UNKNOWN"] = "unknown";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/terminal/types.ts"],"sourcesContent":["export enum TerminalType {\n TMUX = \"tmux\",\n WEZTERM = \"wezterm\",\n ITERM2 = \"iterm2\",\n TERMINAL_APP = \"terminal-app\",\n UNKNOWN = \"unknown\",\n}\n\nexport interface TerminalLocation {\n type: TerminalType;\n identifier: string;\n tty: string;\n}\n\nexport interface TerminalBackend {\n readonly type: Exclude<TerminalType, TerminalType.UNKNOWN>;\n readonly label: string;\n find(tty: string): Promise<TerminalLocation | null>;\n focus(location: TerminalLocation): Promise<boolean>;\n send(location: TerminalLocation, message: string): Promise<void>;\n sendKey(location: TerminalLocation, key: string): Promise<void>;\n}\n"],"names":["TerminalType"],"mappings":"AAAA,OAAO,IAAA,AAAKA,sCAAAA
|
|
1
|
+
{"version":3,"sources":["../../src/terminal/types.ts"],"sourcesContent":["export enum TerminalType {\n TMUX = \"tmux\",\n WEZTERM = \"wezterm\",\n GHOSTTY = \"ghostty\",\n ITERM2 = \"iterm2\",\n TERMINAL_APP = \"terminal-app\",\n UNKNOWN = \"unknown\",\n}\n\nexport interface TerminalLocation {\n type: TerminalType;\n identifier: string;\n tty: string;\n}\n\nexport interface TerminalBackend {\n readonly type: Exclude<TerminalType, TerminalType.UNKNOWN>;\n readonly label: string;\n find(tty: string): Promise<TerminalLocation | null>;\n focus(location: TerminalLocation): Promise<boolean>;\n send(location: TerminalLocation, message: string): Promise<void>;\n sendKey(location: TerminalLocation, key: string): Promise<void>;\n}\n"],"names":["TerminalType"],"mappings":"AAAA,OAAO,IAAA,AAAKA,sCAAAA;;;;;;;WAAAA;MAOX"}
|
package/dist/utils/process.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export interface ProcessSnapshotOptions {
|
|
|
41
41
|
isCandidate?: (process: ProcessInfo) => boolean;
|
|
42
42
|
}
|
|
43
43
|
export type ProcessSnapshotCapture = (namePatterns: readonly string[], options?: ProcessSnapshotOptions) => Promise<ProcessInfo[]>;
|
|
44
|
+
/** Working directories of `pids` (async `lsof`); PIDs it cannot read are omitted. */
|
|
45
|
+
export declare function getProcessCwdsAsync(pids: number[]): Promise<Map<number, string>>;
|
|
44
46
|
/**
|
|
45
47
|
* Create a snapshot capture function with its own start-time cache.
|
|
46
48
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/utils/process.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAmB/D;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWtD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAkCD,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,WAAW,EAAE,EACjC,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,WAAW,EAAE,CAIf;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,EAAE,CA0CrE;AAED,6EAA6E;AAC7E,MAAM,MAAM,W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AAsB,KAC7B,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AAwD5B,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAEhF;AAwED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,WAAW,CAAA;CAAO,GAChC,sBAAsB,CAwDxB;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,sBAAuD,CAAC;AAE7F;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAuCvE;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAiC3E;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CAavE;AAaD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EAAE,EACxB,KAAK,EAAE,WAAW,GACjB,WAAW,GAAG,SAAS,CAKzB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,WAAW,EAAE,EACxB,gBAAgB,GAAE,WAAW,EAAO,GACnC,GAAG,CAAC,MAAM,CAAC,CAqBb;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASjD"}
|
package/dist/utils/process.js
CHANGED
|
@@ -161,6 +161,9 @@ function parseProcessList(output, namePatterns) {
|
|
|
161
161
|
matched
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
+
/** Working directories of `pids` (async `lsof`); PIDs it cannot read are omitted. */ export function getProcessCwdsAsync(pids) {
|
|
165
|
+
return batchGetProcessCwdsAsync(execFileText, pids);
|
|
166
|
+
}
|
|
164
167
|
async function batchGetProcessCwdsAsync(exec, pids) {
|
|
165
168
|
const result = new Map();
|
|
166
169
|
if (pids.length === 0) return result;
|