@agimon-ai/doompi-loop 0.0.1-alpha.13 → 0.0.1-alpha.14
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/adapters/pi/extension.cjs +1 -1
- package/dist/adapters/pi/extension.cjs.map +1 -1
- package/dist/adapters/pi/extension.d.cts.map +1 -1
- package/dist/adapters/pi/extension.d.mts.map +1 -1
- package/dist/adapters/pi/extension.mjs +1 -1
- package/dist/adapters/pi/extension.mjs.map +1 -1
- package/dist/tui/loopListOverlay.cjs +1 -1
- package/dist/tui/loopListOverlay.cjs.map +1 -1
- package/dist/tui/loopListOverlay.mjs +1 -1
- package/dist/tui/loopListOverlay.mjs.map +1 -1
- package/dist/tui/startLoopOverlay.cjs +1 -1
- package/dist/tui/startLoopOverlay.cjs.map +1 -1
- package/dist/tui/startLoopOverlay.mjs +1 -1
- package/dist/tui/startLoopOverlay.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../types/constants.cjs"),t=require("../../commands/loopCommand.cjs"),n=require("../../services/loop/launcher.cjs"),r=require("../../services/loop/defaultLauncher.cjs"),i=require("../../tui/loopListOverlay.cjs"),a=require("../../tui/startLoopOverlay.cjs"),o=require("./leader.cjs");let s=require("@agimon-ai/doompi-
|
|
1
|
+
const e=require("../../types/constants.cjs"),t=require("../../commands/loopCommand.cjs"),n=require("../../services/loop/launcher.cjs"),r=require("../../services/loop/defaultLauncher.cjs"),i=require("../../tui/loopListOverlay.cjs"),a=require("../../tui/startLoopOverlay.cjs"),o=require("./leader.cjs");let s=require("@agimon-ai/doompi-extension-contracts/mode");const c=Symbol.for(`@agimon-ai/doompi-loop/installed-hosts`),l=`start`,u=`stop`;function d(t,n){let r=n.length>0;return{activation:r?`active`:`inactive`,condition:n.some(({state:e})=>e===`starting`||e===`stopping`)?`queued`:`ready`,...r?{detail:`${n.length} active`,color:e.ACTIVE_MODE_COLOR}:{},actions:[...t.length>0?[{id:l,enabled:!0}]:[{id:l,enabled:!1,disabledReason:`No loop launchers are registered.`}],...r?[{id:u,enabled:!0}]:[{id:u,enabled:!1,disabledReason:`No loops are active.`}]]}}function f(e){let t=globalThis,n=t[c]??new WeakSet;return t[c]=n,!n.has(e)&&(n.add(e),!0)}function p(c){if(!f(c))return;let p,m,h,g,_=n.createLoopLauncherClient(()=>p),v=r.createDefaultLoopLauncher(c),y=(0,s.registerMinorModeOwner)(c,{descriptor:{source:e.PACKAGE_SOURCE,id:e.MODE_STATUS_ID,label:`Loop`,description:`Session-scoped recurring prompt loops.`,order:60,actions:[{id:l,label:`Start`,description:`Start a loop with a registered launcher.`,contexts:[`tui`,`headless`],parameters:[{name:`launcherId`,label:`Launcher`,kind:`string`,required:!0,minLength:1},{name:`instanceId`,label:`Instance ID`,kind:`string`,required:!1,minLength:1}]},{id:u,label:`Stop`,description:`Stop one active loop instance.`,contexts:[`tui`,`headless`],parameters:[{name:`instanceId`,label:`Instance ID`,kind:`string`,required:!0,minLength:1},{name:`reason`,label:`Reason`,kind:`string`,required:!1,minLength:1}]}]},initialState:d([],[]),async handleAction(e,t){if(e===l){let e=await _.launch(t.launcherId,t.instanceId?{instanceId:t.instanceId}:{});return{message:e?`Loop '${e.instanceId}' started.`:`Loop launch was cancelled.`}}if(e===u)return{message:await _.stop(t.instanceId,t.reason??`Stopped through minor_mode.`)?`Loop stopped.`:`Loop instance was not active.`};throw Error(`Unknown loop mode action: ${e}`)}});o.registerLeaderContribution(c);let b=()=>{let t=_.listLaunchers(),n=_.listInstances(),r=n.length;m?.ui?.setStatus(e.STATUS_KEY,r?`loops: ${r}`:void 0),y.publish(d(t,n))};t.registerCommands(c,{async start(t){let n=_.listLaunchers();if(!n.length){t.ui.notify(`No loop launchers are registered for this session.`,e.NOTIFY_INFO_LEVEL);return}let r=await a.openStartLoopOverlay(t,n);if(r)try{let n=await _.launch(r);n&&t.ui.notify(`${n.label??n.launcherLabel} started.`,e.NOTIFY_INFO_LEVEL)}catch(e){t.ui.notify(`Loop could not start: ${e instanceof Error?e.message:String(e)}`,`error`)}},async list(e){await i.openLoopListOverlay(e,_)}}),c.on(`session_start`,async(t,n)=>{h?.(),h=void 0,await _.stopAll(`Pi session replaced.`),await g?.dispose(`Pi session replaced.`),g=void 0,m?.ui?.setStatus(e.STATUS_KEY,void 0),m=n,p=n.sessionManager.getSessionId(),g=v.register(n),h=_.subscribe(b),b()}),c.on(`session_shutdown`,async()=>{await _.stopAll(`Pi session shut down.`),await g?.dispose(`Pi session shut down.`),g=void 0,h?.(),h=void 0,m?.ui?.setStatus(e.STATUS_KEY,void 0),m=void 0,p=void 0,y.publish(d([],[]))})}exports.registerLoopExtension=p;
|
|
2
2
|
//# sourceMappingURL=extension.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.cjs","names":["createLoopLauncherClient","createDefaultLoopLauncher","registerDoomModeContribution","PACKAGE_SOURCE","MODE_STATUS_ID","STATUS_KEY","ACTIVE_MODE_COLOR","NOTIFY_INFO_LEVEL","openStartLoopOverlay","openLoopListOverlay"],"sources":["../../../src/adapters/pi/extension.ts"],"sourcesContent":["import { registerDoomModeContribution } from '@agimon-ai/doompi-ui/mode';\nimport type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\nimport { registerCommands } from '../../commands/loopCommand.ts';\nimport { createDefaultLoopLauncher } from '../../services/loop/defaultLauncher.ts';\nimport { createLoopLauncherClient, type LoopLauncherRegistration } from '../../services/loop/launcher.ts';\nimport { openLoopListOverlay } from '../../tui/loopListOverlay.ts';\nimport { openStartLoopOverlay } from '../../tui/startLoopOverlay.ts';\nimport {\n ACTIVE_MODE_COLOR,\n LOOPS_GROUP_ORDER,\n MODE_STATUS_ID,\n NOTIFY_INFO_LEVEL,\n PACKAGE_SOURCE,\n STATUS_KEY,\n} from '../../types/constants.ts';\nimport { registerLeaderContribution } from './leader.ts';\n\nconst INSTALLATIONS_KEY = Symbol.for('@agimon-ai/doompi-loop/installed-hosts');\n\ntype InstallationRegistry = typeof globalThis & {\n [INSTALLATIONS_KEY]?: WeakSet<object>;\n};\n\nfunction claimHostInstallation(pi: ExtensionAPI): boolean {\n const registry = globalThis as InstallationRegistry;\n const installedHosts = registry[INSTALLATIONS_KEY] ?? new WeakSet<object>();\n registry[INSTALLATIONS_KEY] = installedHosts;\n if (installedHosts.has(pi)) return false;\n installedHosts.add(pi);\n return true;\n}\n\nexport function registerLoopExtension(pi: ExtensionAPI): void {\n if (!claimHostInstallation(pi)) return;\n let sessionId: string | undefined;\n let context: ExtensionContext | undefined;\n let unsubscribe: (() => void) | undefined;\n let defaultRegistration: LoopLauncherRegistration | undefined;\n const client = createLoopLauncherClient(() => sessionId);\n const defaultLauncher = createDefaultLoopLauncher(pi);\n const mode = registerDoomModeContribution(pi, {\n source: PACKAGE_SOURCE,\n id: MODE_STATUS_ID,\n order: LOOPS_GROUP_ORDER,\n });\n registerLeaderContribution(pi);\n\n const updateStatus = (): void => {\n const count = client.listInstances().length;\n context?.ui?.setStatus(STATUS_KEY, count ? `loops: ${count}` : undefined);\n mode.update(count ? { label: 'LOOP', detail: `${count} active`, color: ACTIVE_MODE_COLOR } : undefined);\n };\n\n registerCommands(pi, {\n async start(ctx) {\n const launchers = client.listLaunchers();\n if (!launchers.length) {\n ctx.ui.notify('No loop launchers are registered for this session.', NOTIFY_INFO_LEVEL);\n return;\n }\n const launcherId = await openStartLoopOverlay(ctx, launchers);\n if (!launcherId) return;\n try {\n const instance = await client.launch(launcherId);\n if (instance) ctx.ui.notify(`${instance.label ?? instance.launcherLabel} started.`, NOTIFY_INFO_LEVEL);\n } catch (error) {\n ctx.ui.notify(`Loop could not start: ${error instanceof Error ? error.message : String(error)}`, 'error');\n }\n },\n async list(ctx) {\n await openLoopListOverlay(ctx, client);\n },\n });\n\n pi.on('session_start', async (_event, ctx) => {\n unsubscribe?.();\n unsubscribe = undefined;\n await client.stopAll('Pi session replaced.');\n await defaultRegistration?.dispose('Pi session replaced.');\n defaultRegistration = undefined;\n context?.ui?.setStatus(STATUS_KEY, undefined);\n\n context = ctx;\n sessionId = ctx.sessionManager.getSessionId();\n defaultRegistration = defaultLauncher.register(ctx);\n unsubscribe = client.subscribe(updateStatus);\n updateStatus();\n });\n\n pi.on('session_shutdown', async () => {\n await client.stopAll('Pi session shut down.');\n await defaultRegistration?.dispose('Pi session shut down.');\n defaultRegistration = undefined;\n unsubscribe?.();\n unsubscribe = undefined;\n context?.ui?.setStatus(STATUS_KEY, undefined);\n context = undefined;\n sessionId = undefined;\n mode.update(undefined);\n });\n}\n"],"mappings":"wVAiBA,MAAM,EAAoB,OAAO,IAAI,wCAAwC,EAM7E,SAAS,EAAsB,EAA2B,CACxD,IAAM,EAAW,WACX,EAAiB,EAAS,IAAsB,IAAI,QAI1D,MAHA,GAAS,GAAqB,EAC9B,CAAI,EAAe,IAAI,CAAE,IACzB,EAAe,IAAI,CAAE,EACd,GACT,CAEA,SAAgB,EAAsB,EAAwB,CAC5D,GAAI,CAAC,EAAsB,CAAE,EAAG,OAChC,IAAI,EACA,EACA,EACA,EACE,EAASA,EAAAA,6BAA+B,CAAS,EACjD,EAAkBC,EAAAA,0BAA0B,CAAE,EAC9C,GAAA,EAAOC,EAAAA,6BAAAA,CAA6B,EAAI,CAC5C,OAAQC,EAAAA,eACR,GAAIC,EAAAA,eACJ,MAAA,EACF,CAAC,EACD,EAAA,2BAA2B,CAAE,EAE7B,IAAM,MAA2B,CAC/B,IAAM,EAAQ,EAAO,cAAc,CAAC,CAAC,OACrC,GAAS,IAAI,UAAUC,EAAAA,WAAY,EAAQ,UAAU,IAAU,IAAA,EAAS,EACxE,EAAK,OAAO,EAAQ,CAAE,MAAO,OAAQ,OAAQ,GAAG,EAAM,SAAU,MAAOC,EAAAA,iBAAkB,EAAI,IAAA,EAAS,CACxG,EAEA,EAAA,iBAAiB,EAAI,CACnB,MAAM,MAAM,EAAK,CACf,IAAM,EAAY,EAAO,cAAc,EACvC,GAAI,CAAC,EAAU,OAAQ,CACrB,EAAI,GAAG,OAAO,qDAAsDC,EAAAA,iBAAiB,EACrF,MACF,CACA,IAAM,EAAa,MAAMC,EAAAA,qBAAqB,EAAK,CAAS,EACvD,KACL,GAAI,CACF,IAAM,EAAW,MAAM,EAAO,OAAO,CAAU,EAC3C,GAAU,EAAI,GAAG,OAAO,GAAG,EAAS,OAAS,EAAS,cAAc,WAAYD,EAAAA,iBAAiB,CACvG,OAAS,EAAO,CACd,EAAI,GAAG,OAAO,yBAAyB,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,IAAK,OAAO,CAC1G,CACF,EACA,MAAM,KAAK,EAAK,CACd,MAAME,EAAAA,oBAAoB,EAAK,CAAM,CACvC,CACF,CAAC,EAED,EAAG,GAAG,gBAAiB,MAAO,EAAQ,IAAQ,CAC5C,IAAc,EACd,EAAc,IAAA,GACd,MAAM,EAAO,QAAQ,sBAAsB,EAC3C,MAAM,GAAqB,QAAQ,sBAAsB,EACzD,EAAsB,IAAA,GACtB,GAAS,IAAI,UAAUJ,EAAAA,WAAY,IAAA,EAAS,EAE5C,EAAU,EACV,EAAY,EAAI,eAAe,aAAa,EAC5C,EAAsB,EAAgB,SAAS,CAAG,EAClD,EAAc,EAAO,UAAU,CAAY,EAC3C,EAAa,CACf,CAAC,EAED,EAAG,GAAG,mBAAoB,SAAY,CACpC,MAAM,EAAO,QAAQ,uBAAuB,EAC5C,MAAM,GAAqB,QAAQ,uBAAuB,EAC1D,EAAsB,IAAA,GACtB,IAAc,EACd,EAAc,IAAA,GACd,GAAS,IAAI,UAAUA,EAAAA,WAAY,IAAA,EAAS,EAC5C,EAAU,IAAA,GACV,EAAY,IAAA,GACZ,EAAK,OAAO,IAAA,EAAS,CACvB,CAAC,CACH"}
|
|
1
|
+
{"version":3,"file":"extension.cjs","names":["ACTIVE_MODE_COLOR","createLoopLauncherClient","createDefaultLoopLauncher","registerMinorModeOwner","PACKAGE_SOURCE","MODE_STATUS_ID","STATUS_KEY","NOTIFY_INFO_LEVEL","openStartLoopOverlay","openLoopListOverlay"],"sources":["../../../src/adapters/pi/extension.ts"],"sourcesContent":["import { type MinorModeState, registerMinorModeOwner } from '@agimon-ai/doompi-extension-contracts/mode';\nimport type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\nimport { registerCommands } from '../../commands/loopCommand.ts';\nimport { createDefaultLoopLauncher } from '../../services/loop/defaultLauncher.ts';\nimport {\n createLoopLauncherClient,\n type LoopInstanceSnapshot,\n type LoopLauncherRegistration,\n type LoopLauncherSummary,\n} from '../../services/loop/launcher.ts';\nimport { openLoopListOverlay } from '../../tui/loopListOverlay.ts';\nimport { openStartLoopOverlay } from '../../tui/startLoopOverlay.ts';\nimport {\n ACTIVE_MODE_COLOR,\n LOOPS_GROUP_ORDER,\n MODE_STATUS_ID,\n NOTIFY_INFO_LEVEL,\n PACKAGE_SOURCE,\n STATUS_KEY,\n} from '../../types/constants.ts';\nimport { registerLeaderContribution } from './leader.ts';\n\nconst INSTALLATIONS_KEY = Symbol.for('@agimon-ai/doompi-loop/installed-hosts');\nconst MODE_ACTION_START = 'start';\nconst MODE_ACTION_STOP = 'stop';\n\ntype InstallationRegistry = typeof globalThis & {\n [INSTALLATIONS_KEY]?: WeakSet<object>;\n};\n\nfunction loopModeState(\n launchers: readonly LoopLauncherSummary[],\n instances: readonly LoopInstanceSnapshot[],\n): MinorModeState {\n const active = instances.length > 0;\n return {\n activation: active ? 'active' : 'inactive',\n condition: instances.some(({ state }) => state === 'starting' || state === 'stopping') ? 'queued' : 'ready',\n ...(active ? { detail: `${instances.length} active`, color: ACTIVE_MODE_COLOR } : {}),\n actions: [\n ...(launchers.length > 0\n ? [{ id: MODE_ACTION_START, enabled: true } as const]\n : [{ id: MODE_ACTION_START, enabled: false, disabledReason: 'No loop launchers are registered.' } as const]),\n ...(active\n ? [{ id: MODE_ACTION_STOP, enabled: true } as const]\n : [{ id: MODE_ACTION_STOP, enabled: false, disabledReason: 'No loops are active.' } as const]),\n ],\n };\n}\n\nfunction claimHostInstallation(pi: ExtensionAPI): boolean {\n const registry = globalThis as InstallationRegistry;\n const installedHosts = registry[INSTALLATIONS_KEY] ?? new WeakSet<object>();\n registry[INSTALLATIONS_KEY] = installedHosts;\n if (installedHosts.has(pi)) return false;\n installedHosts.add(pi);\n return true;\n}\n\nexport function registerLoopExtension(pi: ExtensionAPI): void {\n if (!claimHostInstallation(pi)) return;\n let sessionId: string | undefined;\n let context: ExtensionContext | undefined;\n let unsubscribe: (() => void) | undefined;\n let defaultRegistration: LoopLauncherRegistration | undefined;\n const client = createLoopLauncherClient(() => sessionId);\n const defaultLauncher = createDefaultLoopLauncher(pi);\n const mode = registerMinorModeOwner(pi, {\n descriptor: {\n source: PACKAGE_SOURCE,\n id: MODE_STATUS_ID,\n label: 'Loop',\n description: 'Session-scoped recurring prompt loops.',\n order: LOOPS_GROUP_ORDER,\n actions: [\n {\n id: MODE_ACTION_START,\n label: 'Start',\n description: 'Start a loop with a registered launcher.',\n contexts: ['tui', 'headless'],\n parameters: [\n { name: 'launcherId', label: 'Launcher', kind: 'string', required: true, minLength: 1 },\n { name: 'instanceId', label: 'Instance ID', kind: 'string', required: false, minLength: 1 },\n ],\n },\n {\n id: MODE_ACTION_STOP,\n label: 'Stop',\n description: 'Stop one active loop instance.',\n contexts: ['tui', 'headless'],\n parameters: [\n { name: 'instanceId', label: 'Instance ID', kind: 'string', required: true, minLength: 1 },\n { name: 'reason', label: 'Reason', kind: 'string', required: false, minLength: 1 },\n ],\n },\n ],\n },\n initialState: loopModeState([], []),\n async handleAction(actionId, argumentsValue) {\n if (actionId === MODE_ACTION_START) {\n const instance = await client.launch(\n argumentsValue.launcherId as string,\n argumentsValue.instanceId ? { instanceId: argumentsValue.instanceId as string } : {},\n );\n return { message: instance ? `Loop '${instance.instanceId}' started.` : 'Loop launch was cancelled.' };\n }\n if (actionId === MODE_ACTION_STOP) {\n const stopped = await client.stop(\n argumentsValue.instanceId as string,\n (argumentsValue.reason as string | undefined) ?? 'Stopped through minor_mode.',\n );\n return { message: stopped ? 'Loop stopped.' : 'Loop instance was not active.' };\n }\n throw new Error(`Unknown loop mode action: ${actionId}`);\n },\n });\n registerLeaderContribution(pi);\n\n const updateStatus = (): void => {\n const launchers = client.listLaunchers();\n const instances = client.listInstances();\n const count = instances.length;\n context?.ui?.setStatus(STATUS_KEY, count ? `loops: ${count}` : undefined);\n mode.publish(loopModeState(launchers, instances));\n };\n\n registerCommands(pi, {\n async start(ctx) {\n const launchers = client.listLaunchers();\n if (!launchers.length) {\n ctx.ui.notify('No loop launchers are registered for this session.', NOTIFY_INFO_LEVEL);\n return;\n }\n const launcherId = await openStartLoopOverlay(ctx, launchers);\n if (!launcherId) return;\n try {\n const instance = await client.launch(launcherId);\n if (instance) ctx.ui.notify(`${instance.label ?? instance.launcherLabel} started.`, NOTIFY_INFO_LEVEL);\n } catch (error) {\n ctx.ui.notify(`Loop could not start: ${error instanceof Error ? error.message : String(error)}`, 'error');\n }\n },\n async list(ctx) {\n await openLoopListOverlay(ctx, client);\n },\n });\n\n pi.on('session_start', async (_event, ctx) => {\n unsubscribe?.();\n unsubscribe = undefined;\n await client.stopAll('Pi session replaced.');\n await defaultRegistration?.dispose('Pi session replaced.');\n defaultRegistration = undefined;\n context?.ui?.setStatus(STATUS_KEY, undefined);\n\n context = ctx;\n sessionId = ctx.sessionManager.getSessionId();\n defaultRegistration = defaultLauncher.register(ctx);\n unsubscribe = client.subscribe(updateStatus);\n updateStatus();\n });\n\n pi.on('session_shutdown', async () => {\n await client.stopAll('Pi session shut down.');\n await defaultRegistration?.dispose('Pi session shut down.');\n defaultRegistration = undefined;\n unsubscribe?.();\n unsubscribe = undefined;\n context?.ui?.setStatus(STATUS_KEY, undefined);\n context = undefined;\n sessionId = undefined;\n mode.publish(loopModeState([], []));\n });\n}\n"],"mappings":"yWAsBA,MAAM,EAAoB,OAAO,IAAI,wCAAwC,EACvE,EAAoB,QACpB,EAAmB,OAMzB,SAAS,EAC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AAG,OAAO,GAAG,EAAS,OAAS,EAAS,cAAc,WAAYD,EAAAA,iBAAiB,CACvG,OAAS,EAAO,CACd,EAAI,GAAG,OAAO,yBAAyB,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,IAAK,OAAO,CAC1G,CACF,EACA,MAAM,KAAK,EAAK,CACd,MAAME,EAAAA,oBAAoB,EAAK,CAAM,CACvC,CACF,CAAC,EAED,EAAG,GAAG,gBAAiB,MAAO,EAAQ,IAAQ,CAC5C,IAAc,EACd,EAAc,IAAA,GACd,MAAM,EAAO,QAAQ,sBAAsB,EAC3C,MAAM,GAAqB,QAAQ,sBAAsB,EACzD,EAAsB,IAAA,GACtB,GAAS,IAAI,UAAUH,EAAAA,WAAY,IAAA,EAAS,EAE5C,EAAU,EACV,EAAY,EAAI,eAAe,aAAa,EAC5C,EAAsB,EAAgB,SAAS,CAAG,EAClD,EAAc,EAAO,UAAU,CAAY,EAC3C,EAAa,CACf,CAAC,EAED,EAAG,GAAG,mBAAoB,SAAY,CACpC,MAAM,EAAO,QAAQ,uBAAuB,EAC5C,MAAM,GAAqB,QAAQ,uBAAuB,EAC1D,EAAsB,IAAA,GACtB,IAAc,EACd,EAAc,IAAA,GACd,GAAS,IAAI,UAAUA,EAAAA,WAAY,IAAA,EAAS,EAC5C,EAAU,IAAA,GACV,EAAY,IAAA,GACZ,EAAK,QAAQ,EAAc,CAAC,EAAG,CAAC,CAAC,CAAC,CACpC,CAAC,CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.cts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"extension.d.cts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;iBA2DgB,sBAAsB,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.d.mts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"extension.d.mts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;iBA2DgB,sBAAsB,IAAI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ACTIVE_MODE_COLOR as e,MODE_STATUS_ID as t,NOTIFY_INFO_LEVEL as n,PACKAGE_SOURCE as r,STATUS_KEY as i}from"../../types/constants.mjs";import{registerCommands as a}from"../../commands/loopCommand.mjs";import{createLoopLauncherClient as o}from"../../services/loop/launcher.mjs";import{createDefaultLoopLauncher as s}from"../../services/loop/defaultLauncher.mjs";import{openLoopListOverlay as c}from"../../tui/loopListOverlay.mjs";import{openStartLoopOverlay as l}from"../../tui/startLoopOverlay.mjs";import{registerLeaderContribution as u}from"./leader.mjs";import{
|
|
1
|
+
import{ACTIVE_MODE_COLOR as e,MODE_STATUS_ID as t,NOTIFY_INFO_LEVEL as n,PACKAGE_SOURCE as r,STATUS_KEY as i}from"../../types/constants.mjs";import{registerCommands as a}from"../../commands/loopCommand.mjs";import{createLoopLauncherClient as o}from"../../services/loop/launcher.mjs";import{createDefaultLoopLauncher as s}from"../../services/loop/defaultLauncher.mjs";import{openLoopListOverlay as c}from"../../tui/loopListOverlay.mjs";import{openStartLoopOverlay as l}from"../../tui/startLoopOverlay.mjs";import{registerLeaderContribution as u}from"./leader.mjs";import{registerMinorModeOwner as d}from"@agimon-ai/doompi-extension-contracts/mode";const f=Symbol.for(`@agimon-ai/doompi-loop/installed-hosts`),p=`start`,m=`stop`;function h(t,n){let r=n.length>0;return{activation:r?`active`:`inactive`,condition:n.some(({state:e})=>e===`starting`||e===`stopping`)?`queued`:`ready`,...r?{detail:`${n.length} active`,color:e}:{},actions:[...t.length>0?[{id:p,enabled:!0}]:[{id:p,enabled:!1,disabledReason:`No loop launchers are registered.`}],...r?[{id:m,enabled:!0}]:[{id:m,enabled:!1,disabledReason:`No loops are active.`}]]}}function g(e){let t=globalThis,n=t[f]??new WeakSet;return t[f]=n,!n.has(e)&&(n.add(e),!0)}function _(e){if(!g(e))return;let f,_,v,y,b=o(()=>f),x=s(e),S=d(e,{descriptor:{source:r,id:t,label:`Loop`,description:`Session-scoped recurring prompt loops.`,order:60,actions:[{id:p,label:`Start`,description:`Start a loop with a registered launcher.`,contexts:[`tui`,`headless`],parameters:[{name:`launcherId`,label:`Launcher`,kind:`string`,required:!0,minLength:1},{name:`instanceId`,label:`Instance ID`,kind:`string`,required:!1,minLength:1}]},{id:m,label:`Stop`,description:`Stop one active loop instance.`,contexts:[`tui`,`headless`],parameters:[{name:`instanceId`,label:`Instance ID`,kind:`string`,required:!0,minLength:1},{name:`reason`,label:`Reason`,kind:`string`,required:!1,minLength:1}]}]},initialState:h([],[]),async handleAction(e,t){if(e===p){let e=await b.launch(t.launcherId,t.instanceId?{instanceId:t.instanceId}:{});return{message:e?`Loop '${e.instanceId}' started.`:`Loop launch was cancelled.`}}if(e===m)return{message:await b.stop(t.instanceId,t.reason??`Stopped through minor_mode.`)?`Loop stopped.`:`Loop instance was not active.`};throw Error(`Unknown loop mode action: ${e}`)}});u(e);let C=()=>{let e=b.listLaunchers(),t=b.listInstances(),n=t.length;_?.ui?.setStatus(i,n?`loops: ${n}`:void 0),S.publish(h(e,t))};a(e,{async start(e){let t=b.listLaunchers();if(!t.length){e.ui.notify(`No loop launchers are registered for this session.`,n);return}let r=await l(e,t);if(r)try{let t=await b.launch(r);t&&e.ui.notify(`${t.label??t.launcherLabel} started.`,n)}catch(t){e.ui.notify(`Loop could not start: ${t instanceof Error?t.message:String(t)}`,`error`)}},async list(e){await c(e,b)}}),e.on(`session_start`,async(e,t)=>{v?.(),v=void 0,await b.stopAll(`Pi session replaced.`),await y?.dispose(`Pi session replaced.`),y=void 0,_?.ui?.setStatus(i,void 0),_=t,f=t.sessionManager.getSessionId(),y=x.register(t),v=b.subscribe(C),C()}),e.on(`session_shutdown`,async()=>{await b.stopAll(`Pi session shut down.`),await y?.dispose(`Pi session shut down.`),y=void 0,v?.(),v=void 0,_?.ui?.setStatus(i,void 0),_=void 0,f=void 0,S.publish(h([],[]))})}export{_ as registerLoopExtension};
|
|
2
2
|
//# sourceMappingURL=extension.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.mjs","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"extension.mjs","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"sourcesContent":["import { type MinorModeState, registerMinorModeOwner } from '@agimon-ai/doompi-extension-contracts/mode';\nimport type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\nimport { registerCommands } from '../../commands/loopCommand.ts';\nimport { createDefaultLoopLauncher } from '../../services/loop/defaultLauncher.ts';\nimport {\n createLoopLauncherClient,\n type LoopInstanceSnapshot,\n type LoopLauncherRegistration,\n type LoopLauncherSummary,\n} from '../../services/loop/launcher.ts';\nimport { openLoopListOverlay } from '../../tui/loopListOverlay.ts';\nimport { openStartLoopOverlay } from '../../tui/startLoopOverlay.ts';\nimport {\n ACTIVE_MODE_COLOR,\n LOOPS_GROUP_ORDER,\n MODE_STATUS_ID,\n NOTIFY_INFO_LEVEL,\n PACKAGE_SOURCE,\n STATUS_KEY,\n} from '../../types/constants.ts';\nimport { registerLeaderContribution } from './leader.ts';\n\nconst INSTALLATIONS_KEY = Symbol.for('@agimon-ai/doompi-loop/installed-hosts');\nconst MODE_ACTION_START = 'start';\nconst MODE_ACTION_STOP = 'stop';\n\ntype InstallationRegistry = typeof globalThis & {\n [INSTALLATIONS_KEY]?: WeakSet<object>;\n};\n\nfunction loopModeState(\n launchers: readonly LoopLauncherSummary[],\n instances: readonly LoopInstanceSnapshot[],\n): MinorModeState {\n const active = instances.length > 0;\n return {\n activation: active ? 'active' : 'inactive',\n condition: instances.some(({ state }) => state === 'starting' || state === 'stopping') ? 'queued' : 'ready',\n ...(active ? { detail: `${instances.length} active`, color: ACTIVE_MODE_COLOR } : {}),\n actions: [\n ...(launchers.length > 0\n ? [{ id: MODE_ACTION_START, enabled: true } as const]\n : [{ id: MODE_ACTION_START, enabled: false, disabledReason: 'No loop launchers are registered.' } as const]),\n ...(active\n ? [{ id: MODE_ACTION_STOP, enabled: true } as const]\n : [{ id: MODE_ACTION_STOP, enabled: false, disabledReason: 'No loops are active.' } as const]),\n ],\n };\n}\n\nfunction claimHostInstallation(pi: ExtensionAPI): boolean {\n const registry = globalThis as InstallationRegistry;\n const installedHosts = registry[INSTALLATIONS_KEY] ?? new WeakSet<object>();\n registry[INSTALLATIONS_KEY] = installedHosts;\n if (installedHosts.has(pi)) return false;\n installedHosts.add(pi);\n return true;\n}\n\nexport function registerLoopExtension(pi: ExtensionAPI): void {\n if (!claimHostInstallation(pi)) return;\n let sessionId: string | undefined;\n let context: ExtensionContext | undefined;\n let unsubscribe: (() => void) | undefined;\n let defaultRegistration: LoopLauncherRegistration | undefined;\n const client = createLoopLauncherClient(() => sessionId);\n const defaultLauncher = createDefaultLoopLauncher(pi);\n const mode = registerMinorModeOwner(pi, {\n descriptor: {\n source: PACKAGE_SOURCE,\n id: MODE_STATUS_ID,\n label: 'Loop',\n description: 'Session-scoped recurring prompt loops.',\n order: LOOPS_GROUP_ORDER,\n actions: [\n {\n id: MODE_ACTION_START,\n label: 'Start',\n description: 'Start a loop with a registered launcher.',\n contexts: ['tui', 'headless'],\n parameters: [\n { name: 'launcherId', label: 'Launcher', kind: 'string', required: true, minLength: 1 },\n { name: 'instanceId', label: 'Instance ID', kind: 'string', required: false, minLength: 1 },\n ],\n },\n {\n id: MODE_ACTION_STOP,\n label: 'Stop',\n description: 'Stop one active loop instance.',\n contexts: ['tui', 'headless'],\n parameters: [\n { name: 'instanceId', label: 'Instance ID', kind: 'string', required: true, minLength: 1 },\n { name: 'reason', label: 'Reason', kind: 'string', required: false, minLength: 1 },\n ],\n },\n ],\n },\n initialState: loopModeState([], []),\n async handleAction(actionId, argumentsValue) {\n if (actionId === MODE_ACTION_START) {\n const instance = await client.launch(\n argumentsValue.launcherId as string,\n argumentsValue.instanceId ? { instanceId: argumentsValue.instanceId as string } : {},\n );\n return { message: instance ? `Loop '${instance.instanceId}' started.` : 'Loop launch was cancelled.' };\n }\n if (actionId === MODE_ACTION_STOP) {\n const stopped = await client.stop(\n argumentsValue.instanceId as string,\n (argumentsValue.reason as string | undefined) ?? 'Stopped through minor_mode.',\n );\n return { message: stopped ? 'Loop stopped.' : 'Loop instance was not active.' };\n }\n throw new Error(`Unknown loop mode action: ${actionId}`);\n },\n });\n registerLeaderContribution(pi);\n\n const updateStatus = (): void => {\n const launchers = client.listLaunchers();\n const instances = client.listInstances();\n const count = instances.length;\n context?.ui?.setStatus(STATUS_KEY, count ? `loops: ${count}` : undefined);\n mode.publish(loopModeState(launchers, instances));\n };\n\n registerCommands(pi, {\n async start(ctx) {\n const launchers = client.listLaunchers();\n if (!launchers.length) {\n ctx.ui.notify('No loop launchers are registered for this session.', NOTIFY_INFO_LEVEL);\n return;\n }\n const launcherId = await openStartLoopOverlay(ctx, launchers);\n if (!launcherId) return;\n try {\n const instance = await client.launch(launcherId);\n if (instance) ctx.ui.notify(`${instance.label ?? instance.launcherLabel} started.`, NOTIFY_INFO_LEVEL);\n } catch (error) {\n ctx.ui.notify(`Loop could not start: ${error instanceof Error ? error.message : String(error)}`, 'error');\n }\n },\n async list(ctx) {\n await openLoopListOverlay(ctx, client);\n },\n });\n\n pi.on('session_start', async (_event, ctx) => {\n unsubscribe?.();\n unsubscribe = undefined;\n await client.stopAll('Pi session replaced.');\n await defaultRegistration?.dispose('Pi session replaced.');\n defaultRegistration = undefined;\n context?.ui?.setStatus(STATUS_KEY, undefined);\n\n context = ctx;\n sessionId = ctx.sessionManager.getSessionId();\n defaultRegistration = defaultLauncher.register(ctx);\n unsubscribe = client.subscribe(updateStatus);\n updateStatus();\n });\n\n pi.on('session_shutdown', async () => {\n await client.stopAll('Pi session shut down.');\n await defaultRegistration?.dispose('Pi session shut down.');\n defaultRegistration = undefined;\n unsubscribe?.();\n unsubscribe = undefined;\n context?.ui?.setStatus(STATUS_KEY, undefined);\n context = undefined;\n sessionId = undefined;\n mode.publish(loopModeState([], []));\n });\n}\n"],"mappings":"uoBAsBA,MAAM,EAAoB,OAAO,IAAI,wCAAwC,EACvE,EAAoB,QACpB,EAAmB,OAMzB,SAAS,EACP,EACA,EACgB,CAChB,IAAM,EAAS,EAAU,OAAS,EAClC,MAAO,CACL,WAAY,EAAS,SAAW,WAChC,UAAW,EAAU,MAAM,CAAE,WAAY,IAAU,YAAc,IAAU,UAAU,EAAI,SAAW,QACpG,GAAI,EAAS,CAAE,OAAQ,GAAG,EAAU,OAAO,SAAU,MAAO,CAAkB,EAAI,CAAC,EACnF,QAAS,CACP,GAAI,EAAU,OAAS,EACnB,CAAC,CAAE,GAAI,EAAmB,QAAS,EAAK,CAAU,EAClD,CAAC,CAAE,GAAI,EAAmB,QAAS,GAAO,eAAgB,mCAAoC,CAAU,EAC5G,GAAI,EACA,CAAC,CAAE,GAAI,EAAkB,QAAS,EAAK,CAAU,EACjD,CAAC,CAAE,GAAI,EAAkB,QAAS,GAAO,eAAgB,sBAAuB,CAAU,CAChG,CACF,CACF,CAEA,SAAS,EAAsB,EAA2B,CACxD,IAAM,EAAW,WACX,EAAiB,EAAS,IAAsB,IAAI,QAI1D,MAHA,GAAS,GAAqB,EAC9B,CAAI,EAAe,IAAI,CAAE,IACzB,EAAe,IAAI,CAAE,EACd,GACT,CAEA,SAAgB,EAAsB,EAAwB,CAC5D,GAAI,CAAC,EAAsB,CAAE,EAAG,OAChC,IAAI,EACA,EACA,EACA,EACE,EAAS,MAA+B,CAAS,EACjD,EAAkB,EAA0B,CAAE,EAC9C,EAAO,EAAuB,EAAI,CACtC,WAAY,CACV,OAAQ,EACR,GAAI,EACJ,MAAO,OACP,YAAa,yCACb,MAAA,GACA,QAAS,CACP,CACE,GAAI,EACJ,MAAO,QACP,YAAa,2CACb,SAAU,CAAC,MAAO,UAAU,EAC5B,WAAY,CACV,CAAE,KAAM,aAAc,MAAO,WAAY,K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AAI,CACF,IAAM,EAAW,MAAM,EAAO,OAAO,CAAU,EAC3C,GAAU,EAAI,GAAG,OAAO,GAAG,EAAS,OAAS,EAAS,cAAc,WAAY,CAAiB,CACvG,OAAS,EAAO,CACd,EAAI,GAAG,OAAO,yBAAyB,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,IAAK,OAAO,CAC1G,CACF,EACA,MAAM,KAAK,EAAK,CACd,MAAM,EAAoB,EAAK,CAAM,CACvC,CACF,CAAC,EAED,EAAG,GAAG,gBAAiB,MAAO,EAAQ,IAAQ,CAC5C,IAAc,EACd,EAAc,IAAA,GACd,MAAM,EAAO,QAAQ,sBAAsB,EAC3C,MAAM,GAAqB,QAAQ,sBAAsB,EACzD,EAAsB,IAAA,GACtB,GAAS,IAAI,UAAU,EAAY,IAAA,EAAS,EAE5C,EAAU,EACV,EAAY,EAAI,eAAe,aAAa,EAC5C,EAAsB,EAAgB,SAAS,CAAG,EAClD,EAAc,EAAO,UAAU,CAAY,EAC3C,EAAa,CACf,CAAC,EAED,EAAG,GAAG,mBAAoB,SAAY,CACpC,MAAM,EAAO,QAAQ,uBAAuB,EAC5C,MAAM,GAAqB,QAAQ,uBAAuB,EAC1D,EAAsB,IAAA,GACtB,IAAc,EACd,EAAc,IAAA,GACd,GAAS,IAAI,UAAU,EAAY,IAAA,EAAS,EAC5C,EAAU,IAAA,GACV,EAAY,IAAA,GACZ,EAAK,QAAQ,EAAc,CAAC,EAAG,CAAC,CAAC,CAAC,CACpC,CAAC,CACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e=require("@agimon-ai/doompi-ui/components/doomOverlay"),t=require("@earendil-works/pi-tui");const n=`Stopped from the loop list.`;var r=class extends e.DoomOverlay{client;done;unsubscribe;instances;selected=0;constructor(e,t,n,r){super(e,t),this.client=n,this.done=r,this.instances=n.listInstances(),this.unsubscribe=n.subscribe(()=>this.refresh())}dispose(){this.unsubscribe()}handleInput(e){if((0,t.matchesKey)(e,`escape`)||(0,t.matchesKey)(e,`ctrl+c`)||e===`q`)return this.done(void 0);if((0,t.matchesKey)(e,`up`)||e===`k`)return this.move(-1);if((0,t.matchesKey)(e,`down`)||e===`j`)return this.move(1);if(e===`x`){let e=this.instances[this.selected];e&&this.client.stop(e.instanceId,n)}}getChrome(){return{title:`LOOPS`,breadcrumb:`SPC › l / loops › l / list`,headerRight:`${this.instances.length} active`,footer
|
|
1
|
+
let e=require("@agimon-ai/doompi-ui/components/doomOverlay"),t=require("@earendil-works/pi-tui");const n=`Stopped from the loop list.`;var r=class extends e.DoomOverlay{client;done;unsubscribe;instances;selected=0;constructor(e,t,n,r){super(e,t),this.client=n,this.done=r,this.instances=n.listInstances(),this.unsubscribe=n.subscribe(()=>this.refresh())}dispose(){this.unsubscribe()}handleInput(e){if((0,t.matchesKey)(e,`escape`)||(0,t.matchesKey)(e,`ctrl+c`)||e===`q`)return this.done(void 0);if((0,t.matchesKey)(e,`up`)||e===`k`)return this.move(-1);if((0,t.matchesKey)(e,`down`)||e===`j`)return this.move(1);if(e===`x`){let e=this.instances[this.selected];e&&this.client.stop(e.instanceId,n)}}getChrome(){return{title:`LOOPS`,breadcrumb:`SPC › l / loops › l / list`,headerRight:`${this.instances.length} active`,footer:`${e.DOOM_NAVIGATION_KEYS.list} move · x stop · esc close · launched detached work continues`,footerHints:[[e.DOOM_NAVIGATION_KEYS.list,`move`],[`x`,`stop scheduling`],[`esc`,`close`]],accent:e.DOOM_OVERLAY_ACCENT}}renderBody(e){let n=this.theme.fg(`dim`,(0,t.truncateToWidth)(`Stopping a loop does not cancel detached work already launched.`,e));return this.instances.length?[n,``,...this.instances.flatMap((n,r)=>{let i=r===this.selected?this.theme.fg(`accent`,`▸`):` `,a=n.label??n.launcherLabel,o=this.theme.fg(n.state===`running`?`success`:`warning`,n.state),s=(0,t.truncateToWidth)(`${i} ${a} · ${o}`,e),c=n.detail??n.instanceId;return[s,` ${this.theme.fg(`dim`,(0,t.truncateToWidth)(c,Math.max(0,e-4)))}`]})]:[this.theme.fg(`dim`,`No loop instances are active in this session.`),``,n]}refresh(){this.instances=this.client.listInstances(),this.selected=Math.min(this.selected,Math.max(0,this.instances.length-1)),this.invalidate()}move(e){this.instances.length&&(this.selected=Math.max(0,Math.min(this.selected+e,this.instances.length-1)),this.invalidate())}};async function i(t,i){if(t.mode!==`tui`){let e=i.listInstances(),r=e.map(e=>`${e.label??e.launcherLabel} (${e.instanceId})`),a=await t.ui.select(`Stop loop scheduling`,r),o=e[r.indexOf(a??``)];o&&await i.stop(o.instanceId,n);return}await t.ui.custom((e,t,n,a)=>new r(e,t,i,a),e.DOOM_FULLSCREEN_UI_OPTIONS)}exports.LoopListOverlay=r,exports.openLoopListOverlay=i;
|
|
2
2
|
//# sourceMappingURL=loopListOverlay.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loopListOverlay.cjs","names":["DoomOverlay","matchesKey","DOOM_OVERLAY_ACCENT","truncateToWidth","DOOM_FULLSCREEN_UI_OPTIONS"],"sources":["../../src/tui/loopListOverlay.ts"],"sourcesContent":["import {\n DOOM_FULLSCREEN_UI_OPTIONS,\n DOOM_OVERLAY_ACCENT,\n DoomOverlay,\n type DoomOverlayChrome,\n type DoomOverlayTui,\n} from '@agimon-ai/doompi-ui/components/doomOverlay';\nimport type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';\nimport { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';\nimport type { LoopInstanceSnapshot, LoopLauncherClient } from '../services/loop/launcher.ts';\n\nconst EMPTY_MESSAGE = 'No loop instances are active in this session.';\nconst STOP_SCOPE_MESSAGE = 'Stopping a loop does not cancel detached work already launched.';\nconst STOP_REASON = 'Stopped from the loop list.';\n\nexport class LoopListOverlay extends DoomOverlay {\n private readonly unsubscribe: () => void;\n private instances: readonly LoopInstanceSnapshot[];\n private selected = 0;\n\n constructor(\n tui: DoomOverlayTui,\n theme: Theme,\n private readonly client: LoopLauncherClient,\n private readonly done: (result: undefined) => void,\n ) {\n super(tui, theme);\n this.instances = client.listInstances();\n this.unsubscribe = client.subscribe(() => this.refresh());\n }\n\n dispose(): void {\n this.unsubscribe();\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, 'escape') || matchesKey(data, 'ctrl+c') || data === 'q') return this.done(undefined);\n if (matchesKey(data, 'up') || data === 'k') return this.move(-1);\n if (matchesKey(data, 'down') || data === 'j') return this.move(1);\n if (data === 'x') {\n const instance = this.instances[this.selected];\n if (instance) void this.client.stop(instance.instanceId, STOP_REASON);\n }\n }\n\n protected getChrome(): DoomOverlayChrome {\n return {\n title: 'LOOPS',\n breadcrumb: 'SPC › l / loops › l / list',\n headerRight: `${this.instances.length} active`,\n footer:
|
|
1
|
+
{"version":3,"file":"loopListOverlay.cjs","names":["DoomOverlay","matchesKey","DOOM_NAVIGATION_KEYS","DOOM_OVERLAY_ACCENT","truncateToWidth","DOOM_FULLSCREEN_UI_OPTIONS"],"sources":["../../src/tui/loopListOverlay.ts"],"sourcesContent":["import {\n DOOM_FULLSCREEN_UI_OPTIONS,\n DOOM_NAVIGATION_KEYS,\n DOOM_OVERLAY_ACCENT,\n DoomOverlay,\n type DoomOverlayChrome,\n type DoomOverlayTui,\n} from '@agimon-ai/doompi-ui/components/doomOverlay';\nimport type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';\nimport { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';\nimport type { LoopInstanceSnapshot, LoopLauncherClient } from '../services/loop/launcher.ts';\n\nconst EMPTY_MESSAGE = 'No loop instances are active in this session.';\nconst STOP_SCOPE_MESSAGE = 'Stopping a loop does not cancel detached work already launched.';\nconst STOP_REASON = 'Stopped from the loop list.';\n\nexport class LoopListOverlay extends DoomOverlay {\n private readonly unsubscribe: () => void;\n private instances: readonly LoopInstanceSnapshot[];\n private selected = 0;\n\n constructor(\n tui: DoomOverlayTui,\n theme: Theme,\n private readonly client: LoopLauncherClient,\n private readonly done: (result: undefined) => void,\n ) {\n super(tui, theme);\n this.instances = client.listInstances();\n this.unsubscribe = client.subscribe(() => this.refresh());\n }\n\n dispose(): void {\n this.unsubscribe();\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, 'escape') || matchesKey(data, 'ctrl+c') || data === 'q') return this.done(undefined);\n if (matchesKey(data, 'up') || data === 'k') return this.move(-1);\n if (matchesKey(data, 'down') || data === 'j') return this.move(1);\n if (data === 'x') {\n const instance = this.instances[this.selected];\n if (instance) void this.client.stop(instance.instanceId, STOP_REASON);\n }\n }\n\n protected getChrome(): DoomOverlayChrome {\n return {\n title: 'LOOPS',\n breadcrumb: 'SPC › l / loops › l / list',\n headerRight: `${this.instances.length} active`,\n footer: `${DOOM_NAVIGATION_KEYS.list} move · x stop · esc close · launched detached work continues`,\n footerHints: [\n [DOOM_NAVIGATION_KEYS.list, 'move'],\n ['x', 'stop scheduling'],\n ['esc', 'close'],\n ],\n accent: DOOM_OVERLAY_ACCENT,\n };\n }\n\n protected renderBody(width: number): string[] {\n const stopScope = this.theme.fg('dim', truncateToWidth(STOP_SCOPE_MESSAGE, width));\n if (!this.instances.length) return [this.theme.fg('dim', EMPTY_MESSAGE), '', stopScope];\n return [\n stopScope,\n '',\n ...this.instances.flatMap((instance, index) => {\n const marker = index === this.selected ? this.theme.fg('accent', '▸') : ' ';\n const name = instance.label ?? instance.launcherLabel;\n const state = this.theme.fg(instance.state === 'running' ? 'success' : 'warning', instance.state);\n const line = truncateToWidth(`${marker} ${name} · ${state}`, width);\n const detail = instance.detail ?? instance.instanceId;\n return [line, ` ${this.theme.fg('dim', truncateToWidth(detail, Math.max(0, width - 4)))}`];\n }),\n ];\n }\n\n private refresh(): void {\n this.instances = this.client.listInstances();\n this.selected = Math.min(this.selected, Math.max(0, this.instances.length - 1));\n this.invalidate();\n }\n\n private move(delta: number): void {\n if (!this.instances.length) return;\n this.selected = Math.max(0, Math.min(this.selected + delta, this.instances.length - 1));\n this.invalidate();\n }\n}\n\nexport async function openLoopListOverlay(ctx: ExtensionContext, client: LoopLauncherClient): Promise<void> {\n if (ctx.mode !== 'tui') {\n const instances = client.listInstances();\n const labels = instances.map((instance) => `${instance.label ?? instance.launcherLabel} (${instance.instanceId})`);\n const selected = await ctx.ui.select('Stop loop scheduling', labels);\n const instance = instances[labels.indexOf(selected ?? '')];\n if (instance) await client.stop(instance.instanceId, STOP_REASON);\n return;\n }\n await ctx.ui.custom<undefined>(\n (tui, theme, _keybindings, done) => new LoopListOverlay(tui, theme, client, done),\n DOOM_FULLSCREEN_UI_OPTIONS,\n );\n}\n"],"mappings":"iGAYA,MAEM,EAAc,8BAEpB,IAAa,EAAb,cAAqCA,EAAAA,WAAY,CAQ5B,OACA,KARnB,YACA,UACA,SAAmB,EAEnB,YACE,EACA,EACA,EACA,EACA,CACA,MAAM,EAAK,CAAK,EAHC,KAAA,OAAA,EACA,KAAA,KAAA,EAGjB,KAAK,UAAY,EAAO,cAAc,EACtC,KAAK,YAAc,EAAO,cAAgB,KAAK,QAAQ,CAAC,CAC1D,CAEA,SAAgB,CACd,KAAK,YAAY,CACnB,CAEA,YAAY,EAAoB,CAC9B,IAAA,EAAIC,EAAAA,WAAAA,CAAW,EAAM,QAAQ,IAAA,EAAKA,EAAAA,WAAAA,CAAW,EAAM,QAAQ,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,IAAA,EAAS,EACxG,IAAA,EAAIA,EAAAA,WAAAA,CAAW,EAAM,IAAI,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,EAAE,EAC/D,IAAA,EAAIA,EAAAA,WAAAA,CAAW,EAAM,MAAM,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,CAAC,EAChE,GAAI,IAAS,IAAK,CAChB,IAAM,EAAW,KAAK,UAAU,KAAK,UACjC,GAAU,KAAU,OAAO,KAAK,EAAS,WAAY,CAAW,CACtE,CACF,CAEA,WAAyC,CACvC,MAAO,CACL,MAAO,QACP,WAAY,6BACZ,YAAa,GAAG,KAAK,UAAU,OAAO,SACtC,OAAQ,GAAGC,EAAA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A2C,CAC1G,GAAI,EAAI,OAAS,MAAO,CACtB,IAAM,EAAY,EAAO,cAAc,EACjC,EAAS,EAAU,IAAK,GAAa,GAAG,EAAS,OAAS,EAAS,cAAc,IAAI,EAAS,WAAW,EAAE,EAC3G,EAAW,MAAM,EAAI,GAAG,OAAO,uBAAwB,CAAM,EAC7D,EAAW,EAAU,EAAO,QAAQ,GAAY,EAAE,GACpD,GAAU,MAAM,EAAO,KAAK,EAAS,WAAY,CAAW,EAChE,MACF,CACA,MAAM,EAAI,GAAG,QACV,EAAK,EAAO,EAAc,IAAS,IAAI,EAAgB,EAAK,EAAO,EAAQ,CAAI,EAChFC,EAAAA,0BACF,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DOOM_FULLSCREEN_UI_OPTIONS as e,
|
|
1
|
+
import{DOOM_FULLSCREEN_UI_OPTIONS as e,DOOM_NAVIGATION_KEYS as t,DOOM_OVERLAY_ACCENT as n,DoomOverlay as r}from"@agimon-ai/doompi-ui/components/doomOverlay";import{matchesKey as i,truncateToWidth as a}from"@earendil-works/pi-tui";const o=`Stopped from the loop list.`;var s=class extends r{client;done;unsubscribe;instances;selected=0;constructor(e,t,n,r){super(e,t),this.client=n,this.done=r,this.instances=n.listInstances(),this.unsubscribe=n.subscribe(()=>this.refresh())}dispose(){this.unsubscribe()}handleInput(e){if(i(e,`escape`)||i(e,`ctrl+c`)||e===`q`)return this.done(void 0);if(i(e,`up`)||e===`k`)return this.move(-1);if(i(e,`down`)||e===`j`)return this.move(1);if(e===`x`){let e=this.instances[this.selected];e&&this.client.stop(e.instanceId,o)}}getChrome(){return{title:`LOOPS`,breadcrumb:`SPC › l / loops › l / list`,headerRight:`${this.instances.length} active`,footer:`${t.list} move · x stop · esc close · launched detached work continues`,footerHints:[[t.list,`move`],[`x`,`stop scheduling`],[`esc`,`close`]],accent:n}}renderBody(e){let t=this.theme.fg(`dim`,a(`Stopping a loop does not cancel detached work already launched.`,e));return this.instances.length?[t,``,...this.instances.flatMap((t,n)=>{let r=n===this.selected?this.theme.fg(`accent`,`▸`):` `,i=t.label??t.launcherLabel,o=this.theme.fg(t.state===`running`?`success`:`warning`,t.state),s=a(`${r} ${i} · ${o}`,e),c=t.detail??t.instanceId;return[s,` ${this.theme.fg(`dim`,a(c,Math.max(0,e-4)))}`]})]:[this.theme.fg(`dim`,`No loop instances are active in this session.`),``,t]}refresh(){this.instances=this.client.listInstances(),this.selected=Math.min(this.selected,Math.max(0,this.instances.length-1)),this.invalidate()}move(e){this.instances.length&&(this.selected=Math.max(0,Math.min(this.selected+e,this.instances.length-1)),this.invalidate())}};async function c(t,n){if(t.mode!==`tui`){let e=n.listInstances(),r=e.map(e=>`${e.label??e.launcherLabel} (${e.instanceId})`),i=await t.ui.select(`Stop loop scheduling`,r),a=e[r.indexOf(i??``)];a&&await n.stop(a.instanceId,o);return}await t.ui.custom((e,t,r,i)=>new s(e,t,n,i),e)}export{s as LoopListOverlay,c as openLoopListOverlay};
|
|
2
2
|
//# sourceMappingURL=loopListOverlay.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loopListOverlay.mjs","names":[],"sources":["../../src/tui/loopListOverlay.ts"],"sourcesContent":["import {\n DOOM_FULLSCREEN_UI_OPTIONS,\n DOOM_OVERLAY_ACCENT,\n DoomOverlay,\n type DoomOverlayChrome,\n type DoomOverlayTui,\n} from '@agimon-ai/doompi-ui/components/doomOverlay';\nimport type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';\nimport { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';\nimport type { LoopInstanceSnapshot, LoopLauncherClient } from '../services/loop/launcher.ts';\n\nconst EMPTY_MESSAGE = 'No loop instances are active in this session.';\nconst STOP_SCOPE_MESSAGE = 'Stopping a loop does not cancel detached work already launched.';\nconst STOP_REASON = 'Stopped from the loop list.';\n\nexport class LoopListOverlay extends DoomOverlay {\n private readonly unsubscribe: () => void;\n private instances: readonly LoopInstanceSnapshot[];\n private selected = 0;\n\n constructor(\n tui: DoomOverlayTui,\n theme: Theme,\n private readonly client: LoopLauncherClient,\n private readonly done: (result: undefined) => void,\n ) {\n super(tui, theme);\n this.instances = client.listInstances();\n this.unsubscribe = client.subscribe(() => this.refresh());\n }\n\n dispose(): void {\n this.unsubscribe();\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, 'escape') || matchesKey(data, 'ctrl+c') || data === 'q') return this.done(undefined);\n if (matchesKey(data, 'up') || data === 'k') return this.move(-1);\n if (matchesKey(data, 'down') || data === 'j') return this.move(1);\n if (data === 'x') {\n const instance = this.instances[this.selected];\n if (instance) void this.client.stop(instance.instanceId, STOP_REASON);\n }\n }\n\n protected getChrome(): DoomOverlayChrome {\n return {\n title: 'LOOPS',\n breadcrumb: 'SPC › l / loops › l / list',\n headerRight: `${this.instances.length} active`,\n footer:
|
|
1
|
+
{"version":3,"file":"loopListOverlay.mjs","names":[],"sources":["../../src/tui/loopListOverlay.ts"],"sourcesContent":["import {\n DOOM_FULLSCREEN_UI_OPTIONS,\n DOOM_NAVIGATION_KEYS,\n DOOM_OVERLAY_ACCENT,\n DoomOverlay,\n type DoomOverlayChrome,\n type DoomOverlayTui,\n} from '@agimon-ai/doompi-ui/components/doomOverlay';\nimport type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';\nimport { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';\nimport type { LoopInstanceSnapshot, LoopLauncherClient } from '../services/loop/launcher.ts';\n\nconst EMPTY_MESSAGE = 'No loop instances are active in this session.';\nconst STOP_SCOPE_MESSAGE = 'Stopping a loop does not cancel detached work already launched.';\nconst STOP_REASON = 'Stopped from the loop list.';\n\nexport class LoopListOverlay extends DoomOverlay {\n private readonly unsubscribe: () => void;\n private instances: readonly LoopInstanceSnapshot[];\n private selected = 0;\n\n constructor(\n tui: DoomOverlayTui,\n theme: Theme,\n private readonly client: LoopLauncherClient,\n private readonly done: (result: undefined) => void,\n ) {\n super(tui, theme);\n this.instances = client.listInstances();\n this.unsubscribe = client.subscribe(() => this.refresh());\n }\n\n dispose(): void {\n this.unsubscribe();\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, 'escape') || matchesKey(data, 'ctrl+c') || data === 'q') return this.done(undefined);\n if (matchesKey(data, 'up') || data === 'k') return this.move(-1);\n if (matchesKey(data, 'down') || data === 'j') return this.move(1);\n if (data === 'x') {\n const instance = this.instances[this.selected];\n if (instance) void this.client.stop(instance.instanceId, STOP_REASON);\n }\n }\n\n protected getChrome(): DoomOverlayChrome {\n return {\n title: 'LOOPS',\n breadcrumb: 'SPC › l / loops › l / list',\n headerRight: `${this.instances.length} active`,\n footer: `${DOOM_NAVIGATION_KEYS.list} move · x stop · esc close · launched detached work continues`,\n footerHints: [\n [DOOM_NAVIGATION_KEYS.list, 'move'],\n ['x', 'stop scheduling'],\n ['esc', 'close'],\n ],\n accent: DOOM_OVERLAY_ACCENT,\n };\n }\n\n protected renderBody(width: number): string[] {\n const stopScope = this.theme.fg('dim', truncateToWidth(STOP_SCOPE_MESSAGE, width));\n if (!this.instances.length) return [this.theme.fg('dim', EMPTY_MESSAGE), '', stopScope];\n return [\n stopScope,\n '',\n ...this.instances.flatMap((instance, index) => {\n const marker = index === this.selected ? this.theme.fg('accent', '▸') : ' ';\n const name = instance.label ?? instance.launcherLabel;\n const state = this.theme.fg(instance.state === 'running' ? 'success' : 'warning', instance.state);\n const line = truncateToWidth(`${marker} ${name} · ${state}`, width);\n const detail = instance.detail ?? instance.instanceId;\n return [line, ` ${this.theme.fg('dim', truncateToWidth(detail, Math.max(0, width - 4)))}`];\n }),\n ];\n }\n\n private refresh(): void {\n this.instances = this.client.listInstances();\n this.selected = Math.min(this.selected, Math.max(0, this.instances.length - 1));\n this.invalidate();\n }\n\n private move(delta: number): void {\n if (!this.instances.length) return;\n this.selected = Math.max(0, Math.min(this.selected + delta, this.instances.length - 1));\n this.invalidate();\n }\n}\n\nexport async function openLoopListOverlay(ctx: ExtensionContext, client: LoopLauncherClient): Promise<void> {\n if (ctx.mode !== 'tui') {\n const instances = client.listInstances();\n const labels = instances.map((instance) => `${instance.label ?? instance.launcherLabel} (${instance.instanceId})`);\n const selected = await ctx.ui.select('Stop loop scheduling', labels);\n const instance = instances[labels.indexOf(selected ?? '')];\n if (instance) await client.stop(instance.instanceId, STOP_REASON);\n return;\n }\n await ctx.ui.custom<undefined>(\n (tui, theme, _keybindings, done) => new LoopListOverlay(tui, theme, client, done),\n DOOM_FULLSCREEN_UI_OPTIONS,\n );\n}\n"],"mappings":"sOAYA,MAEM,EAAc,8BAEpB,IAAa,EAAb,cAAqC,CAAY,CAQ5B,OACA,KARnB,YACA,UACA,SAAmB,EAEnB,YACE,EACA,EACA,EACA,EACA,CACA,MAAM,EAAK,CAAK,EAHC,KAAA,OAAA,EACA,KAAA,KAAA,EAGjB,KAAK,UAAY,EAAO,cAAc,EACtC,KAAK,YAAc,EAAO,cAAgB,KAAK,QAAQ,CAAC,CAC1D,CAEA,SAAgB,CACd,KAAK,YAAY,CACnB,CAEA,YAAY,EAAoB,CAC9B,GAAI,EAAW,EAAM,QAAQ,GAAK,EAAW,EAAM,QAAQ,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,IAAA,EAAS,EACxG,GAAI,EAAW,EAAM,IAAI,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,EAAE,EAC/D,GAAI,EAAW,EAAM,MAAM,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,CAAC,EAChE,GAAI,IAAS,IAAK,CAChB,IAAM,EAAW,KAAK,UAAU,KAAK,UACjC,GAAU,KAAU,OAAO,KAAK,EAAS,WAAY,CAAW,CACtE,CACF,CAEA,WAAyC,CACvC,MAAO,CACL,MAAO,QACP,WAAY,6BACZ,YAAa,GAAG,KAAK,UAAU,OAAO,SACtC,OAAQ,GAAG,EAAqB,KAAK,+DACrC,YAAa,CACX,CAAC,EAAqB,KAAM,MAAM,EAClC,CAAC,IAAK,iBAAiB,EACvB,CAAC,MAAO,OAAO,CACjB,E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AC7D,EAAW,EAAU,EAAO,QAAQ,GAAY,EAAE,GACpD,GAAU,MAAM,EAAO,KAAK,EAAS,WAAY,CAAW,EAChE,MACF,CACA,MAAM,EAAI,GAAG,QACV,EAAK,EAAO,EAAc,IAAS,IAAI,EAAgB,EAAK,EAAO,EAAQ,CAAI,EAChF,CACF,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e=require("@agimon-ai/doompi-ui/components/doomOverlay"),t=require("@earendil-works/pi-tui");var n=class extends e.DoomOverlay{launchers;done;selected=0;constructor(e,t,n,r){super(e,t),this.launchers=n,this.done=r}handleInput(e){if((0,t.matchesKey)(e,`escape`)||(0,t.matchesKey)(e,`ctrl+c`)||e===`q`)return this.done(void 0);if((0,t.matchesKey)(e,`up`)||e===`k`)return this.move(-1);if((0,t.matchesKey)(e,`down`)||e===`j`)return this.move(1);(0,t.matchesKey)(e,`enter`)&&this.done(this.launchers[this.selected]?.id)}getChrome(){return{title:`START LOOP`,breadcrumb:`SPC › l / loops › s / start`,footer
|
|
1
|
+
let e=require("@agimon-ai/doompi-ui/components/doomOverlay"),t=require("@earendil-works/pi-tui");var n=class extends e.DoomOverlay{launchers;done;selected=0;constructor(e,t,n,r){super(e,t),this.launchers=n,this.done=r}handleInput(e){if((0,t.matchesKey)(e,`escape`)||(0,t.matchesKey)(e,`ctrl+c`)||e===`q`)return this.done(void 0);if((0,t.matchesKey)(e,`up`)||e===`k`)return this.move(-1);if((0,t.matchesKey)(e,`down`)||e===`j`)return this.move(1);(0,t.matchesKey)(e,`enter`)&&this.done(this.launchers[this.selected]?.id)}getChrome(){return{title:`START LOOP`,breadcrumb:`SPC › l / loops › s / start`,footer:`${e.DOOM_NAVIGATION_KEYS.list} move · enter launch · esc close`,footerHints:[[e.DOOM_NAVIGATION_KEYS.list,`move`],[`enter`,`launch`],[`esc`,`close`]],accent:e.DOOM_OVERLAY_ACCENT}}renderBody(e){return this.launchers.length?this.launchers.flatMap((n,r)=>{let i=r===this.selected,a=i?this.theme.fg(`accent`,`▸`):` `,o=i?this.theme.bold(n.label):n.label,s=[`${a} ${(0,t.truncateToWidth)(o,Math.max(0,e-2))}`];return n.description&&s.push(` ${this.theme.fg(`dim`,(0,t.truncateToWidth)(n.description,Math.max(0,e-4)))}`),s}):[this.theme.fg(`dim`,`No loop launchers are registered for this session.`)]}move(e){this.launchers.length&&(this.selected=Math.max(0,Math.min(this.selected+e,this.launchers.length-1)),this.invalidate())}};async function r(t,r){if(t.mode!==`tui`){let e=r.map(e=>e.label),n=await t.ui.select(`Start loop`,e);return r[e.indexOf(n??``)]?.id}return t.ui.custom((e,t,i,a)=>new n(e,t,r,a),e.DOOM_FULLSCREEN_UI_OPTIONS)}exports.StartLoopOverlay=n,exports.openStartLoopOverlay=r;
|
|
2
2
|
//# sourceMappingURL=startLoopOverlay.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startLoopOverlay.cjs","names":["DoomOverlay","matchesKey","DOOM_OVERLAY_ACCENT","truncateToWidth","DOOM_FULLSCREEN_UI_OPTIONS"],"sources":["../../src/tui/startLoopOverlay.ts"],"sourcesContent":["import {\n DOOM_FULLSCREEN_UI_OPTIONS,\n DOOM_OVERLAY_ACCENT,\n DoomOverlay,\n type DoomOverlayChrome,\n type DoomOverlayTui,\n} from '@agimon-ai/doompi-ui/components/doomOverlay';\nimport type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';\nimport { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';\nimport type { LoopLauncherSummary } from '../services/loop/launcher.ts';\n\nconst EMPTY_MESSAGE = 'No loop launchers are registered for this session.';\n\nexport class StartLoopOverlay extends DoomOverlay {\n private selected = 0;\n\n constructor(\n tui: DoomOverlayTui,\n theme: Theme,\n private readonly launchers: readonly LoopLauncherSummary[],\n private readonly done: (result: string | undefined) => void,\n ) {\n super(tui, theme);\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, 'escape') || matchesKey(data, 'ctrl+c') || data === 'q') return this.done(undefined);\n if (matchesKey(data, 'up') || data === 'k') return this.move(-1);\n if (matchesKey(data, 'down') || data === 'j') return this.move(1);\n if (matchesKey(data, 'enter')) this.done(this.launchers[this.selected]?.id);\n }\n\n protected getChrome(): DoomOverlayChrome {\n return {\n title: 'START LOOP',\n breadcrumb: 'SPC › l / loops › s / start',\n footer:
|
|
1
|
+
{"version":3,"file":"startLoopOverlay.cjs","names":["DoomOverlay","matchesKey","DOOM_NAVIGATION_KEYS","DOOM_OVERLAY_ACCENT","truncateToWidth","DOOM_FULLSCREEN_UI_OPTIONS"],"sources":["../../src/tui/startLoopOverlay.ts"],"sourcesContent":["import {\n DOOM_FULLSCREEN_UI_OPTIONS,\n DOOM_NAVIGATION_KEYS,\n DOOM_OVERLAY_ACCENT,\n DoomOverlay,\n type DoomOverlayChrome,\n type DoomOverlayTui,\n} from '@agimon-ai/doompi-ui/components/doomOverlay';\nimport type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';\nimport { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';\nimport type { LoopLauncherSummary } from '../services/loop/launcher.ts';\n\nconst EMPTY_MESSAGE = 'No loop launchers are registered for this session.';\n\nexport class StartLoopOverlay extends DoomOverlay {\n private selected = 0;\n\n constructor(\n tui: DoomOverlayTui,\n theme: Theme,\n private readonly launchers: readonly LoopLauncherSummary[],\n private readonly done: (result: string | undefined) => void,\n ) {\n super(tui, theme);\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, 'escape') || matchesKey(data, 'ctrl+c') || data === 'q') return this.done(undefined);\n if (matchesKey(data, 'up') || data === 'k') return this.move(-1);\n if (matchesKey(data, 'down') || data === 'j') return this.move(1);\n if (matchesKey(data, 'enter')) this.done(this.launchers[this.selected]?.id);\n }\n\n protected getChrome(): DoomOverlayChrome {\n return {\n title: 'START LOOP',\n breadcrumb: 'SPC › l / loops › s / start',\n footer: `${DOOM_NAVIGATION_KEYS.list} move · enter launch · esc close`,\n footerHints: [\n [DOOM_NAVIGATION_KEYS.list, 'move'],\n ['enter', 'launch'],\n ['esc', 'close'],\n ],\n accent: DOOM_OVERLAY_ACCENT,\n };\n }\n\n protected renderBody(width: number): string[] {\n if (!this.launchers.length) return [this.theme.fg('dim', EMPTY_MESSAGE)];\n return this.launchers.flatMap((launcher, index) => {\n const selected = index === this.selected;\n const marker = selected ? this.theme.fg('accent', '▸') : ' ';\n const label = selected ? this.theme.bold(launcher.label) : launcher.label;\n const lines = [`${marker} ${truncateToWidth(label, Math.max(0, width - 2))}`];\n if (launcher.description)\n lines.push(` ${this.theme.fg('dim', truncateToWidth(launcher.description, Math.max(0, width - 4)))}`);\n return lines;\n });\n }\n\n private move(delta: number): void {\n if (!this.launchers.length) return;\n this.selected = Math.max(0, Math.min(this.selected + delta, this.launchers.length - 1));\n this.invalidate();\n }\n}\n\nexport async function openStartLoopOverlay(\n ctx: ExtensionContext,\n launchers: readonly LoopLauncherSummary[],\n): Promise<string | undefined> {\n if (ctx.mode !== 'tui') {\n const labels = launchers.map((launcher) => launcher.label);\n const selected = await ctx.ui.select('Start loop', labels);\n return launchers[labels.indexOf(selected ?? '')]?.id;\n }\n return ctx.ui.custom<string | undefined>(\n (tui, theme, _keybindings, done) => new StartLoopOverlay(tui, theme, launchers, done),\n DOOM_FULLSCREEN_UI_OPTIONS,\n );\n}\n"],"mappings":"iGAcA,IAAa,EAAb,cAAsCA,EAAAA,WAAY,CAM7B,UACA,KANnB,SAAmB,EAEnB,YACE,EACA,EACA,EACA,EACA,CACA,MAAM,EAAK,CAAK,EAHC,KAAA,UAAA,EACA,KAAA,KAAA,CAGnB,CAEA,YAAY,EAAoB,CAC9B,IAAA,EAAIC,EAAAA,WAAAA,CAAW,EAAM,QAAQ,IAAA,EAAKA,EAAAA,WAAAA,CAAW,EAAM,QAAQ,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,IAAA,EAAS,EACxG,IAAA,EAAIA,EAAAA,WAAAA,CAAW,EAAM,IAAI,GAAK,IAAS,IAAK,OAAO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EAAI,OAAS,MAAO,CACtB,IAAM,EAAS,EAAU,IAAK,GAAa,EAAS,KAAK,EACnD,EAAW,MAAM,EAAI,GAAG,OAAO,aAAc,CAAM,EACzD,OAAO,EAAU,EAAO,QAAQ,GAAY,EAAE,EAAE,EAAE,EACpD,CACA,OAAO,EAAI,GAAG,QACX,EAAK,EAAO,EAAc,IAAS,IAAI,EAAiB,EAAK,EAAO,EAAW,CAAI,EACpFC,EAAAA,0BACF,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DOOM_FULLSCREEN_UI_OPTIONS as e,
|
|
1
|
+
import{DOOM_FULLSCREEN_UI_OPTIONS as e,DOOM_NAVIGATION_KEYS as t,DOOM_OVERLAY_ACCENT as n,DoomOverlay as r}from"@agimon-ai/doompi-ui/components/doomOverlay";import{matchesKey as i,truncateToWidth as a}from"@earendil-works/pi-tui";var o=class extends r{launchers;done;selected=0;constructor(e,t,n,r){super(e,t),this.launchers=n,this.done=r}handleInput(e){if(i(e,`escape`)||i(e,`ctrl+c`)||e===`q`)return this.done(void 0);if(i(e,`up`)||e===`k`)return this.move(-1);if(i(e,`down`)||e===`j`)return this.move(1);i(e,`enter`)&&this.done(this.launchers[this.selected]?.id)}getChrome(){return{title:`START LOOP`,breadcrumb:`SPC › l / loops › s / start`,footer:`${t.list} move · enter launch · esc close`,footerHints:[[t.list,`move`],[`enter`,`launch`],[`esc`,`close`]],accent:n}}renderBody(e){return this.launchers.length?this.launchers.flatMap((t,n)=>{let r=n===this.selected,i=r?this.theme.fg(`accent`,`▸`):` `,o=r?this.theme.bold(t.label):t.label,s=[`${i} ${a(o,Math.max(0,e-2))}`];return t.description&&s.push(` ${this.theme.fg(`dim`,a(t.description,Math.max(0,e-4)))}`),s}):[this.theme.fg(`dim`,`No loop launchers are registered for this session.`)]}move(e){this.launchers.length&&(this.selected=Math.max(0,Math.min(this.selected+e,this.launchers.length-1)),this.invalidate())}};async function s(t,n){if(t.mode!==`tui`){let e=n.map(e=>e.label),r=await t.ui.select(`Start loop`,e);return n[e.indexOf(r??``)]?.id}return t.ui.custom((e,t,r,i)=>new o(e,t,n,i),e)}export{o as StartLoopOverlay,s as openStartLoopOverlay};
|
|
2
2
|
//# sourceMappingURL=startLoopOverlay.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startLoopOverlay.mjs","names":[],"sources":["../../src/tui/startLoopOverlay.ts"],"sourcesContent":["import {\n DOOM_FULLSCREEN_UI_OPTIONS,\n DOOM_OVERLAY_ACCENT,\n DoomOverlay,\n type DoomOverlayChrome,\n type DoomOverlayTui,\n} from '@agimon-ai/doompi-ui/components/doomOverlay';\nimport type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';\nimport { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';\nimport type { LoopLauncherSummary } from '../services/loop/launcher.ts';\n\nconst EMPTY_MESSAGE = 'No loop launchers are registered for this session.';\n\nexport class StartLoopOverlay extends DoomOverlay {\n private selected = 0;\n\n constructor(\n tui: DoomOverlayTui,\n theme: Theme,\n private readonly launchers: readonly LoopLauncherSummary[],\n private readonly done: (result: string | undefined) => void,\n ) {\n super(tui, theme);\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, 'escape') || matchesKey(data, 'ctrl+c') || data === 'q') return this.done(undefined);\n if (matchesKey(data, 'up') || data === 'k') return this.move(-1);\n if (matchesKey(data, 'down') || data === 'j') return this.move(1);\n if (matchesKey(data, 'enter')) this.done(this.launchers[this.selected]?.id);\n }\n\n protected getChrome(): DoomOverlayChrome {\n return {\n title: 'START LOOP',\n breadcrumb: 'SPC › l / loops › s / start',\n footer:
|
|
1
|
+
{"version":3,"file":"startLoopOverlay.mjs","names":[],"sources":["../../src/tui/startLoopOverlay.ts"],"sourcesContent":["import {\n DOOM_FULLSCREEN_UI_OPTIONS,\n DOOM_NAVIGATION_KEYS,\n DOOM_OVERLAY_ACCENT,\n DoomOverlay,\n type DoomOverlayChrome,\n type DoomOverlayTui,\n} from '@agimon-ai/doompi-ui/components/doomOverlay';\nimport type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';\nimport { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';\nimport type { LoopLauncherSummary } from '../services/loop/launcher.ts';\n\nconst EMPTY_MESSAGE = 'No loop launchers are registered for this session.';\n\nexport class StartLoopOverlay extends DoomOverlay {\n private selected = 0;\n\n constructor(\n tui: DoomOverlayTui,\n theme: Theme,\n private readonly launchers: readonly LoopLauncherSummary[],\n private readonly done: (result: string | undefined) => void,\n ) {\n super(tui, theme);\n }\n\n handleInput(data: string): void {\n if (matchesKey(data, 'escape') || matchesKey(data, 'ctrl+c') || data === 'q') return this.done(undefined);\n if (matchesKey(data, 'up') || data === 'k') return this.move(-1);\n if (matchesKey(data, 'down') || data === 'j') return this.move(1);\n if (matchesKey(data, 'enter')) this.done(this.launchers[this.selected]?.id);\n }\n\n protected getChrome(): DoomOverlayChrome {\n return {\n title: 'START LOOP',\n breadcrumb: 'SPC › l / loops › s / start',\n footer: `${DOOM_NAVIGATION_KEYS.list} move · enter launch · esc close`,\n footerHints: [\n [DOOM_NAVIGATION_KEYS.list, 'move'],\n ['enter', 'launch'],\n ['esc', 'close'],\n ],\n accent: DOOM_OVERLAY_ACCENT,\n };\n }\n\n protected renderBody(width: number): string[] {\n if (!this.launchers.length) return [this.theme.fg('dim', EMPTY_MESSAGE)];\n return this.launchers.flatMap((launcher, index) => {\n const selected = index === this.selected;\n const marker = selected ? this.theme.fg('accent', '▸') : ' ';\n const label = selected ? this.theme.bold(launcher.label) : launcher.label;\n const lines = [`${marker} ${truncateToWidth(label, Math.max(0, width - 2))}`];\n if (launcher.description)\n lines.push(` ${this.theme.fg('dim', truncateToWidth(launcher.description, Math.max(0, width - 4)))}`);\n return lines;\n });\n }\n\n private move(delta: number): void {\n if (!this.launchers.length) return;\n this.selected = Math.max(0, Math.min(this.selected + delta, this.launchers.length - 1));\n this.invalidate();\n }\n}\n\nexport async function openStartLoopOverlay(\n ctx: ExtensionContext,\n launchers: readonly LoopLauncherSummary[],\n): Promise<string | undefined> {\n if (ctx.mode !== 'tui') {\n const labels = launchers.map((launcher) => launcher.label);\n const selected = await ctx.ui.select('Start loop', labels);\n return launchers[labels.indexOf(selected ?? '')]?.id;\n }\n return ctx.ui.custom<string | undefined>(\n (tui, theme, _keybindings, done) => new StartLoopOverlay(tui, theme, launchers, done),\n DOOM_FULLSCREEN_UI_OPTIONS,\n );\n}\n"],"mappings":"sOAcA,IAAa,EAAb,cAAsC,CAAY,CAM7B,UACA,KANnB,SAAmB,EAEnB,YACE,EACA,EACA,EACA,EACA,CACA,MAAM,EAAK,CAAK,EAHC,KAAA,UAAA,EACA,KAAA,KAAA,CAGnB,CAEA,YAAY,EAAoB,CAC9B,GAAI,EAAW,EAAM,QAAQ,GAAK,EAAW,EAAM,QAAQ,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,IAAA,EAAS,EACxG,GAAI,EAAW,EAAM,IAAI,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,EAAE,EAC/D,GAAI,EAAW,EAAM,MAAM,GAAK,IAAS,IAAK,OAAO,KAAK,KAAK,CAAC,EAC5D,EAAW,EAAM,OAAO,GAAG,KAAK,KAAK,KAAK,UAAU,KAAK,SAAS,EAAE,EAAE,CAC5E,CAEA,WAAyC,CACvC,MAAO,CACL,MAAO,aACP,WAAY,8BACZ,OAAQ,GAAG,EAAqB,KAAK,kCACrC,YAAa,CACX,CAAC,EAAqB,KAAM,MAAM,EAClC,CAAC,QAAS,QAAQ,EAClB,CAAC,MAAO,OAAO,CACjB,EACA,OAAQ,CACV,CACF,CAEA,WAAqB,EAAyB,CAE5C,OADK,KAAK,UAAU,OACb,KAAK,UAAU,SAAS,EAAU,IAAU,CACjD,IAAM,EAAW,IAAU,KAAK,SAC1B,EAAS,EAAW,KAAK,MAAM,GAAG,SAAU,GAAG,EAAI,IACnD,EAAQ,EAAW,KAAK,MAAM,KAAK,EAAS,KAAK,EAAI,EAAS,MAC9D,EAAQ,CAAC,GAAG,EAAO,GAAG,EAAgB,EAAO,KAAK,IAAI,EAAG,EAAQ,CAAC,CAAC,GAAG,EAG5E,OAFI,EAAS,aACX,EAAM,KAAK,OAAO,KAAK,MAAM,GAAG,MAAO,EAAgB,EAAS,YAAa,KAAK,IAAI,EAAG,EAAQ,CAAC,CAAC,CAAC,GAAG,EAClG,CACT,CAAC,EATkC,CAAC,KAAK,MAAM,GAAG,MAAO,oDAAa,CAAC,CAUzE,CAEA,KAAa,EAAqB,CAC3B,KAAK,UAAU,SACpB,KAAK,SAAW,KAAK,IAAI,EAAG,KAAK,IAAI,KAAK,SAAW,EAAO,KAAK,UAAU,OAAS,CAAC,CAAC,EACtF,KAAK,WAAW,EAClB,CACF,EAEA,eAAsB,EACpB,EACA,EAC6B,CAC7B,GAAI,EAAI,OAAS,MAAO,CACtB,IAAM,EAAS,EAAU,IAAK,GAAa,EAAS,KAAK,EACnD,EAAW,MAAM,EAAI,GAAG,OAAO,aAAc,CAAM,EACzD,OAAO,EAAU,EAAO,QAAQ,GAAY,EAAE,EAAE,EAAE,EACpD,CACA,OAAO,EAAI,GAAG,QACX,EAAK,EAAO,EAAc,IAAS,IAAI,EAAiB,EAAK,EAAO,EAAW,CAAI,EACpF,CACF,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-loop",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.14",
|
|
4
4
|
"description": "Generic multi-loop controller for Doompi",
|
|
5
5
|
"homepage": "https://agimon.ai",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@agimon-ai/doompi-
|
|
34
|
-
"@agimon-ai/doompi-
|
|
33
|
+
"@agimon-ai/doompi-ui": "0.0.1-alpha.14",
|
|
34
|
+
"@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.14"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@earendil-works/pi-coding-agent": "0.84.1",
|