@k8slens/ai-tools-contracts 1.0.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.
Files changed (69) hide show
  1. package/dist/index.d.ts +34 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +642 -0
  4. package/dist/src/ai-tool-configuration.d.ts +51 -0
  5. package/dist/src/ai-tool-configuration.d.ts.map +1 -0
  6. package/dist/src/ai-tool-description.d.ts +25 -0
  7. package/dist/src/ai-tool-description.d.ts.map +1 -0
  8. package/dist/src/ai-tool-detection.d.ts +20 -0
  9. package/dist/src/ai-tool-detection.d.ts.map +1 -0
  10. package/dist/src/ai-tool-display-name.d.ts +18 -0
  11. package/dist/src/ai-tool-display-name.d.ts.map +1 -0
  12. package/dist/src/ai-tool-icon.d.ts +577 -0
  13. package/dist/src/ai-tool-icon.d.ts.map +1 -0
  14. package/dist/src/ai-tool-injection-token.d.ts +10 -0
  15. package/dist/src/ai-tool-injection-token.d.ts.map +1 -0
  16. package/dist/src/ai-tool-installation-instructions.d.ts +20 -0
  17. package/dist/src/ai-tool-installation-instructions.d.ts.map +1 -0
  18. package/dist/src/ai-tool-installed-via-cli-command.d.ts +17 -0
  19. package/dist/src/ai-tool-installed-via-cli-command.d.ts.map +1 -0
  20. package/dist/src/ai-tool-instructions-filename.d.ts +20 -0
  21. package/dist/src/ai-tool-instructions-filename.d.ts.map +1 -0
  22. package/dist/src/ai-tool-instructions-filenames.d.ts +13 -0
  23. package/dist/src/ai-tool-instructions-filenames.d.ts.map +1 -0
  24. package/dist/src/ai-tool-is-configured.d.ts +17 -0
  25. package/dist/src/ai-tool-is-configured.d.ts.map +1 -0
  26. package/dist/src/ai-tool-name.d.ts +17 -0
  27. package/dist/src/ai-tool-name.d.ts.map +1 -0
  28. package/dist/src/ai-tool-order-number.d.ts +16 -0
  29. package/dist/src/ai-tool-order-number.d.ts.map +1 -0
  30. package/dist/src/ai-tool-selection-row.d.ts +18 -0
  31. package/dist/src/ai-tool-selection-row.d.ts.map +1 -0
  32. package/dist/src/ai-tool-settings.d.ts +18 -0
  33. package/dist/src/ai-tool-settings.d.ts.map +1 -0
  34. package/dist/src/ai-tool-top-bar-menu.d.ts +46 -0
  35. package/dist/src/ai-tool-top-bar-menu.d.ts.map +1 -0
  36. package/dist/src/ai-tool.d.ts +64 -0
  37. package/dist/src/ai-tool.d.ts.map +1 -0
  38. package/dist/src/ai-tools-injection-token.d.ts +12 -0
  39. package/dist/src/ai-tools-injection-token.d.ts.map +1 -0
  40. package/dist/src/ai-tools-open-externally.d.ts +17 -0
  41. package/dist/src/ai-tools-open-externally.d.ts.map +1 -0
  42. package/dist/src/build-external-terminal-command.d.ts +33 -0
  43. package/dist/src/build-external-terminal-command.d.ts.map +1 -0
  44. package/dist/src/current-shell-family.d.ts +13 -0
  45. package/dist/src/current-shell-family.d.ts.map +1 -0
  46. package/dist/src/default-ai-tool-icon.d.ts +8 -0
  47. package/dist/src/default-ai-tool-icon.d.ts.map +1 -0
  48. package/dist/src/detected-ai-tools.d.ts +15 -0
  49. package/dist/src/detected-ai-tools.d.ts.map +1 -0
  50. package/dist/src/get-ai-command-for-terminal.d.ts +17 -0
  51. package/dist/src/get-ai-command-for-terminal.d.ts.map +1 -0
  52. package/dist/src/get-ai-tool-injectable-bunch.d.ts +534 -0
  53. package/dist/src/get-ai-tool-injectable-bunch.d.ts.map +1 -0
  54. package/dist/src/get-ai-tool-is-installed-cli-command.d.ts +20 -0
  55. package/dist/src/get-ai-tool-is-installed-cli-command.d.ts.map +1 -0
  56. package/dist/src/get-open-tool-in-external-terminal-for-tool.d.ts +17 -0
  57. package/dist/src/get-open-tool-in-external-terminal-for-tool.d.ts.map +1 -0
  58. package/dist/src/get-resume-ai-command-for-terminal.d.ts +23 -0
  59. package/dist/src/get-resume-ai-command-for-terminal.d.ts.map +1 -0
  60. package/dist/src/operating-system-specific.d.ts +16 -0
  61. package/dist/src/operating-system-specific.d.ts.map +1 -0
  62. package/dist/src/os-and-shell-specific.d.ts +133 -0
  63. package/dist/src/os-and-shell-specific.d.ts.map +1 -0
  64. package/dist/src/resolve-llm-command.d.ts +16 -0
  65. package/dist/src/resolve-llm-command.d.ts.map +1 -0
  66. package/dist/src/selected-ai-tool-injection-tokens.d.ts +363 -0
  67. package/dist/src/selected-ai-tool-injection-tokens.d.ts.map +1 -0
  68. package/dist/tsconfig.tsbuildinfo +1 -0
  69. package/package.json +63 -0
@@ -0,0 +1,20 @@
1
+ import type { AiToolKind } from "./ai-tool";
2
+ /** Resolves the instructions filename a given AI tool kind reads from its working directory. */
3
+ export type AiToolInstructionsFilename = () => string | undefined;
4
+ /**
5
+ * Per-kind instructions filename — the file the tool auto-discovers in its
6
+ * working directory (e.g. `"CLAUDE.md"` for Claude Code, `"GEMINI.md"` for
7
+ * Gemini CLI). The launcher always writes the canonical
8
+ * {@link agentsInstructionsFilename}; when a kind declares a different filename
9
+ * the launcher additionally writes that file as an indirection importing the
10
+ * canonical one. `undefined` for kinds that read no such file.
11
+ */
12
+ export declare const aiToolInstructionsFilenameInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolInstructionsFilename, () => (string | undefined)[], "zero-or-many", () => import("@k8slens/injectable").InjectionInstanceWithMeta<string | undefined>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<string | undefined>[]> & {
13
+ readonly __abstract: true;
14
+ for: (kind: AiToolKind) => import("@k8slens/injectable").InjectionToken2Base<AiToolInstructionsFilename, () => (string | undefined)[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<string | undefined>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<string | undefined>[]> & {
15
+ readonly __abstract?: never;
16
+ } & {
17
+ speciality: any;
18
+ };
19
+ };
20
+ //# sourceMappingURL=ai-tool-instructions-filename.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-instructions-filename.d.ts","sourceRoot":"","sources":["../../src/ai-tool-instructions-filename.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,gGAAgG;AAChG,MAAM,MAAM,0BAA0B,GAAG,MAAM,MAAM,GAAG,SAAS,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,wCAAwC;;gBAK3C,UAAU;;;;;CAMnB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** Resolves the indirection instructions filenames to write across all registered AI tools. */
2
+ export type AiToolInstructionsIndirectionFilenames = () => readonly string[];
3
+ /**
4
+ * The distinct tool-specific instructions filenames across **all** registered AI
5
+ * tool kinds — regardless of installation state — excluding the canonical
6
+ * {@link agentsInstructionsFilename}. A launcher writes the canonical
7
+ * `AGENTS.md` plus each of these as an indirection importing it, so whichever
8
+ * tool the user later picks finds its instructions in the working directory.
9
+ */
10
+ export declare const aiToolInstructionsIndirectionFilenamesInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolInstructionsIndirectionFilenames, () => (readonly string[])[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<readonly string[]>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<readonly string[]>[]> & {
11
+ readonly __abstract?: never;
12
+ };
13
+ //# sourceMappingURL=ai-tool-instructions-filenames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-instructions-filenames.d.ts","sourceRoot":"","sources":["../../src/ai-tool-instructions-filenames.ts"],"names":[],"mappings":"AAEA,+FAA+F;AAC/F,MAAM,MAAM,sCAAsC,GAAG,MAAM,SAAS,MAAM,EAAE,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,oDAAoD;;CAK7D,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { IComputedValue } from "mobx";
2
+ /**
3
+ * Whether a real AI tool is configured — i.e. the effective AI tool kind is a real
4
+ * tool (or Custom), not {@link noAiToolKind}. Derived purely from the user's
5
+ * selection, NOT from install detection: observing the configured state must not
6
+ * depend on the async PATH scan having run first.
7
+ *
8
+ * A promise that resolves once the persisted selection has loaded (then a reactive
9
+ * boolean), so consumers reflect a genuine *pending* state while it loads instead
10
+ * of guessing `false`. React surfaces read it via `useInject(...)` under
11
+ * `<Suspense>` (or bridge it with `asReactive`); the launch handlers `await` it.
12
+ * The Ask-AI launch surfaces gate their visibility on it.
13
+ */
14
+ export declare const aiToolIsConfiguredInjectionToken: import("@k8slens/injectable").InjectionToken2Base<() => Promise<IComputedValue<boolean>>, () => Promise<IComputedValue<boolean>>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IComputedValue<boolean>>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IComputedValue<boolean>>>[]> & {
15
+ readonly __abstract?: never;
16
+ };
17
+ //# sourceMappingURL=ai-tool-is-configured.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-is-configured.d.ts","sourceRoot":"","sources":["../../src/ai-tool-is-configured.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gCAAgC,0DACtB,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;;CAInD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type React from "react";
2
+ import type { AiToolKind } from "./ai-tool";
3
+ /** Resolves the display-name component for a given AI tool kind. */
4
+ export type AiToolName = () => React.ComponentType;
5
+ /**
6
+ * Per-kind display name for an AI tool — a React component (not a string), so
7
+ * a tool can render branding/markup. Contribute one per tool kind.
8
+ */
9
+ export declare const aiToolNameInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolName, () => React.ComponentType<{}>[], "zero-or-many", () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<{}>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<{}>>[]> & {
10
+ readonly __abstract: true;
11
+ for: (kind: AiToolKind) => import("@k8slens/injectable").InjectionToken2Base<AiToolName, () => React.ComponentType<{}>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<{}>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<{}>>[]> & {
12
+ readonly __abstract?: never;
13
+ } & {
14
+ speciality: any;
15
+ };
16
+ };
17
+ //# sourceMappingURL=ai-tool-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-name.d.ts","sourceRoot":"","sources":["../../src/ai-tool-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;gBAG3B,UAAU;;;;;CAMnB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { AiToolKind } from "./ai-tool";
2
+ /** Resolves the order/priority number for a given AI tool kind. */
3
+ export type AiToolOrderNumber = () => number;
4
+ /**
5
+ * Per-kind ordering/priority for an AI tool. Lower comes first in the selector;
6
+ * the lowest-numbered *installed* tool is the default selection.
7
+ */
8
+ export declare const aiToolOrderNumberInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolOrderNumber, () => number[], "zero-or-many", () => import("@k8slens/injectable").InjectionInstanceWithMeta<number>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<number>[]> & {
9
+ readonly __abstract: true;
10
+ for: (kind: AiToolKind) => import("@k8slens/injectable").InjectionToken2Base<AiToolOrderNumber, () => number[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<number>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<number>[]> & {
11
+ readonly __abstract?: never;
12
+ } & {
13
+ speciality: any;
14
+ };
15
+ };
16
+ //# sourceMappingURL=ai-tool-order-number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-order-number.d.ts","sourceRoot":"","sources":["../../src/ai-tool-order-number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,mEAAmE;AACnE,MAAM,MAAM,iBAAiB,GAAG,MAAM,MAAM,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,+BAA+B;;gBAGlC,UAAU;;;;;CAMnB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type React from "react";
2
+ import type { AiToolKind } from "./ai-tool";
3
+ export interface AiToolSelectionRowProps {
4
+ /** The tool the row represents. */
5
+ readonly kind: AiToolKind;
6
+ }
7
+ /**
8
+ * One AI tool's row in the top bar menu's selection section: how the row looks and what
9
+ * clicking it does (selecting an installed tool, guiding the installation of a missing
10
+ * one). Registered against the menu automatically, per tool, by
11
+ * {@link getAiToolInjectableBunch}; the feature owning the AI tool button provides the
12
+ * implementation, so this generic package stays free of its telemetry and entitlement
13
+ * concerns.
14
+ */
15
+ export declare const AiToolSelectionRow: React.FunctionComponent<AiToolSelectionRowProps> & import("@k8slens/injectable").InjectionToken2Base<() => React.FunctionComponent<AiToolSelectionRowProps>, () => React.FunctionComponent<AiToolSelectionRowProps>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.FunctionComponent<AiToolSelectionRowProps>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.FunctionComponent<AiToolSelectionRowProps>>[]> & {
16
+ readonly __abstract?: never;
17
+ };
18
+ //# sourceMappingURL=ai-tool-selection-row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-selection-row.d.ts","sourceRoot":"","sources":["../../src/ai-tool-selection-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,WAAW,uBAAuB;IACtC,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;CAE3B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type React from "react";
2
+ import type { AiToolKind } from "./ai-tool";
3
+ /** Resolves a kind's settings component, shown below the selector when that kind is selected. */
4
+ export type AiToolSettings = () => React.ComponentType;
5
+ /**
6
+ * Per-kind settings UI, rendered beneath the AI-tool selector when that kind is
7
+ * the active selection. Optional — most tools need none; e.g. the "custom" kind
8
+ * contributes a command input + a run-externally toggle. A React component.
9
+ */
10
+ export declare const aiToolSettingsInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolSettings, () => React.ComponentType<{}>[], "zero-or-many", () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<{}>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<{}>>[]> & {
11
+ readonly __abstract: true;
12
+ for: (kind: AiToolKind) => import("@k8slens/injectable").InjectionToken2Base<AiToolSettings, () => React.ComponentType<{}>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<{}>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<{}>>[]> & {
13
+ readonly __abstract?: never;
14
+ } & {
15
+ speciality: any;
16
+ };
17
+ };
18
+ //# sourceMappingURL=ai-tool-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-settings.d.ts","sourceRoot":"","sources":["../../src/ai-tool-settings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,iGAAiG;AACjG,MAAM,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;gBAG/B,UAAU;;;;;CAMnB,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The drop-down menu of the top bar's AI tool button. The AI tool selection rows are
3
+ * contributed automatically, one per registered tool, by `getAiToolInjectableBunch` of
4
+ * `@k8slens/ai-tools-contracts`; anyone else contributes their own items with
5
+ * `getDropDownMenuItemInjectableBunch` of `@k8slens/drop-down-menu-contracts` against
6
+ * this kind, placed with {@link aiToolTopBarMenuOrderNumbers}.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * export default getDropDownMenuItemInjectableBunch({
11
+ * id: "my-ai-menu-item",
12
+ * kind: aiToolTopBarMenuKind,
13
+ * orderNumber: aiToolTopBarMenuOrderNumbers.sectionEnd + 100,
14
+ * Component: MyMenuItem,
15
+ * });
16
+ * ```
17
+ */
18
+ export declare const aiToolTopBarMenuKind: import("@k8slens/injectable").TypedSpecifier<"ai-tool-top-bar-menu", {
19
+ dropDownMenuData: void;
20
+ }>;
21
+ /**
22
+ * Where the AI tool selection section's own items sit in the button's menu, as the
23
+ * boundaries they are laid out against. The selection rows occupy two bands, each
24
+ * `bandWidth` wide, so that every installed tool comes before every not-yet-installed
25
+ * one while each band stays sorted by the tools' own order numbers.
26
+ *
27
+ * A contributor places itself relative to these rather than against a guessed number.
28
+ * The section ends at {@link sectionEnd}: items contributed after it pick their order
29
+ * numbers from there up, framing their own sections with separators they contribute
30
+ * themselves.
31
+ */
32
+ export declare const aiToolTopBarMenuOrderNumbers: {
33
+ /** The heading above the selection rows. */
34
+ readonly aiToolsHeader: 100;
35
+ /** The scanning indicator shown while the first detection has not settled. */
36
+ readonly detectionPending: 200;
37
+ /** The first order number of the band holding the rows of installed tools. */
38
+ readonly installedAiToolBand: 300;
39
+ /** The first order number of the band holding the rows of not-installed tools. */
40
+ readonly notInstalledAiToolBand: 400;
41
+ /** How wide each selection band is, and so how far a tool's own number may reach. */
42
+ readonly bandWidth: 100;
43
+ /** The first order number past the whole selection section. */
44
+ readonly sectionEnd: 500;
45
+ };
46
+ //# sourceMappingURL=ai-tool-top-bar-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-top-bar-menu.d.ts","sourceRoot":"","sources":["../../src/ai-tool-top-bar-menu.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB;;EAAgD,CAAC;AAElF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B;IACvC,4CAA4C;aAC5C,aAAa,EAAE,GAAG;IAClB,8EAA8E;aAC9E,gBAAgB,EAAE,GAAG;IACrB,8EAA8E;aAC9E,mBAAmB,EAAE,GAAG;IACxB,kFAAkF;aAClF,sBAAsB,EAAE,GAAG;IAC3B,qFAAqF;aACrF,SAAS,EAAE,GAAG;IACd,+DAA+D;aAC/D,UAAU,EAAE,GAAG;CACP,CAAC"}
@@ -0,0 +1,64 @@
1
+ import type { ConsumptionDi, DiContainerForInjection } from "@k8slens/injectable";
2
+ /** Identifier for a kind of AI CLI tool, e.g. `"claude"`. */
3
+ export type AiToolKind = string;
4
+ /** The pseudo-kind for the user's free-text "Custom" command. */
5
+ export declare const customAiToolKind: AiToolKind;
6
+ /**
7
+ * The pseudo-kind for "No AI tool" — the explicit opt-out, and the default/fallback
8
+ * effective kind. It is not a registered tool: when it is the effective selection,
9
+ * Lens launches nothing and the AI surfaces hide (the top-bar button becomes
10
+ * "Configure AI"). The effective kind resolves to this whenever the selection is
11
+ * unset, set to this sentinel, or set to a tool that is not installed.
12
+ */
13
+ export declare const noAiToolKind: AiToolKind;
14
+ /**
15
+ * The canonical agent-instructions filename, written into every AI tool tab's
16
+ * working directory. Tools that read a differently-named file (see
17
+ * {@link AiToolInstructionsFilename}) get that file too, as an indirection
18
+ * importing this one.
19
+ */
20
+ export declare const agentsInstructionsFilename = "AGENTS.md";
21
+ /**
22
+ * The contents of a tool-specific instructions file (e.g. `CLAUDE.md`): a single
23
+ * line importing the canonical {@link agentsInstructionsFilename}, so a tool that
24
+ * reads its own filename still picks up the instructions written there.
25
+ */
26
+ export declare const agentsInstructionsIndirectionContents = "@AGENTS.md\n";
27
+ /**
28
+ * Builds the shell command that launches an AI CLI tool in a terminal. An async
29
+ * callback receiving the DI container, so a tool can inject (and await) whatever
30
+ * it needs while assembling its command. `dir` is the working directory the
31
+ * command runs in; the launcher has already written the cluster context there as
32
+ * `AGENTS.md` (plus per-tool indirection files), so tools discover it from cwd.
33
+ */
34
+ export type GetCliCommand = (di: DiContainerForInjection, args: {
35
+ prompt?: string;
36
+ dir: string;
37
+ }) => Promise<string>;
38
+ /**
39
+ * Builds the host command that checks whether an AI tool is installed (e.g.
40
+ * `command -v claude` / `where claude`). The command is run on the host and an
41
+ * exit code of `0` means installed. Given the DI container, returns the command
42
+ * string. Omit (on `AiToolBunchParams`) for an always-available tool.
43
+ */
44
+ export type GetAiToolIsInstalledCliCommand = (di: ConsumptionDi) => string;
45
+ /**
46
+ * Builds the full host command that opens an AI tool in a fresh external terminal
47
+ * window — typically by wrapping the tool's own invocation with one of the
48
+ * `build{Mac,Windows,Linux}ExternalTerminalCommand` helpers. Mirrors
49
+ * {@link GetCliCommand}'s args (so it can reuse the tool's launch command),
50
+ * plus `env` (e.g. `{ KUBECONFIG }`) which is baked into the command because the
51
+ * freshly-opened terminal does not inherit the launcher's environment. Returns
52
+ * `""` when the tool has no command to run (e.g. an empty Custom template).
53
+ */
54
+ export type GetOpenToolInExternalTerminalCliCommand = (di: DiContainerForInjection, args: {
55
+ prompt?: string;
56
+ dir: string;
57
+ env?: Record<string, string>;
58
+ }) => Promise<string>;
59
+ /** An AI tool kind together with its detected installation state. */
60
+ export interface AiToolListEntry {
61
+ readonly kind: AiToolKind;
62
+ readonly isInstalled: boolean;
63
+ }
64
+ //# sourceMappingURL=ai-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool.d.ts","sourceRoot":"","sources":["../../src/ai-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAElF,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,EAAE,UAAqB,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,UAAmB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,iBAAqC,CAAC;AAExF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAErH;;;;;GAKG;AAIH,MAAM,MAAM,8BAA8B,GAAG,CAAC,EAAE,EAAE,aAAa,KAAK,MAAM,CAAC;AAE3E;;;;;;;;GAQG;AACH,MAAM,MAAM,uCAAuC,GAAG,CACpD,EAAE,EAAE,uBAAuB,EAC3B,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,KACjE,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B"}
@@ -0,0 +1,12 @@
1
+ import type { IComputedValue } from "mobx";
2
+ import type { AiToolListEntry } from "./ai-tool";
3
+ /** Resolves the reactive list of all contributed AI tools with install state. */
4
+ export type AiTools = () => Promise<IComputedValue<AiToolListEntry[]>>;
5
+ /**
6
+ * All contributed AI tool kinds together with their detected installation
7
+ * state, sorted by order number. Consumed by the preferences selector.
8
+ */
9
+ export declare const aiToolsInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiTools, () => Promise<IComputedValue<AiToolListEntry[]>>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IComputedValue<AiToolListEntry[]>>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IComputedValue<AiToolListEntry[]>>>[]> & {
10
+ readonly __abstract?: never;
11
+ };
12
+ //# sourceMappingURL=ai-tools-injection-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tools-injection-token.d.ts","sourceRoot":"","sources":["../../src/ai-tools-injection-token.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,iFAAiF;AACjF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;CAG9B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { IObservableValue } from "mobx";
2
+ /**
3
+ * The global "open AI tools in an external terminal" toggle. When `true`, the
4
+ * selected AI tool launches in a fresh external terminal window — built by the
5
+ * host operating system's external-terminal command builder (resolved via
6
+ * `selectedAiToolExternalTerminalCommandInjectionToken`) and spawned detached on
7
+ * the host — instead of a Lens terminal tab. Applies to every tool (Custom
8
+ * included), replacing the former per-tool runs-externally callbacks.
9
+ *
10
+ * Persisted; the box loads asynchronously, so the token resolves to a promise
11
+ * of the observable. Supported on macOS (Terminal), Windows (Windows Terminal), and
12
+ * Linux (the first available terminal emulator).
13
+ */
14
+ export declare const aiToolsOpenExternallyInjectionToken: import("@k8slens/injectable").InjectionToken2Base<() => Promise<IObservableValue<boolean>>, () => Promise<IObservableValue<boolean>>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IObservableValue<boolean>>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IObservableValue<boolean>>>[]> & {
15
+ readonly __abstract?: never;
16
+ };
17
+ //# sourceMappingURL=ai-tools-open-externally.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tools-open-externally.d.ts","sourceRoot":"","sources":["../../src/ai-tools-open-externally.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mCAAmC,0DACzB,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;;CAIrD,CAAC"}
@@ -0,0 +1,33 @@
1
+ export interface ExternalTerminalCommandOptions {
2
+ /**
3
+ * The resolved inner command to run, inserted **raw** (it is a full command
4
+ * line, not an argument).
5
+ */
6
+ readonly command: string;
7
+ /** The working directory the command runs in. Builders quote it, so a path with spaces is safe. */
8
+ readonly dir: string;
9
+ /**
10
+ * Per-launch environment to apply. A freshly-opened external terminal runs its
11
+ * own shell that does not inherit the launcher's env, so a builder has to carry
12
+ * these into the launched command itself rather than relying on the ambient
13
+ * environment. Realistically small (e.g. just `KUBECONFIG`).
14
+ */
15
+ readonly env?: Record<string, string>;
16
+ /**
17
+ * The user-configured shell (the same "Shell Path" the in-app terminal uses), so
18
+ * the external terminal runs the command in — and drops the user into — that
19
+ * shell rather than the OS/terminal default.
20
+ */
21
+ readonly shell: string;
22
+ }
23
+ /** Builds the full host command that opens `command` in a fresh external terminal window for one OS. */
24
+ export type ExternalTerminalCommandBuilder = (options: ExternalTerminalCommandOptions) => string;
25
+ /**
26
+ * The host OS's {@link ExternalTerminalCommandBuilder}. Registered per-OS via
27
+ * `getInjectableForOperatingSystems` (host-only `*-only` tags), so injecting the
28
+ * token yields the builder for the current OS — no runtime platform switch.
29
+ */
30
+ export declare const externalTerminalCommandBuilderInjectionToken: import("@k8slens/injectable").InjectionToken2Base<() => ExternalTerminalCommandBuilder, () => ExternalTerminalCommandBuilder[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<ExternalTerminalCommandBuilder>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<ExternalTerminalCommandBuilder>[]> & {
31
+ readonly __abstract?: never;
32
+ };
33
+ //# sourceMappingURL=build-external-terminal-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-external-terminal-command.d.ts","sourceRoot":"","sources":["../../src/build-external-terminal-command.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mGAAmG;IACnG,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,wGAAwG;AACxG,MAAM,MAAM,8BAA8B,GAAG,CAAC,OAAO,EAAE,8BAA8B,KAAK,MAAM,CAAC;AAEjG;;;;GAIG;AACH,eAAO,MAAM,4CAA4C,0DAClC,8BAA8B;;CAIjD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { IComputedValue } from "mobx";
2
+ import type { ShellFamily } from "@k8slens/public-utilities";
3
+ /**
4
+ * Reactive lookup of the active shell *family* (`posix`/`fish`/`cmd`/`powershell`),
5
+ * derived from the user-configured shell. Consumers of the per-kind AI command
6
+ * tokens (which register one {@link import("@k8slens/public-utilities").ShellScoped} cell
7
+ * per family) use this to pick the active shell's command at runtime via
8
+ * `resolveForShell(injectMany(token.for(kind))(), currentShellFamily.get())`.
9
+ */
10
+ export declare const currentShellFamilyInjectionToken: import("@k8slens/injectable").InjectionToken2Base<() => IComputedValue<ShellFamily>, () => IComputedValue<ShellFamily>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<IComputedValue<ShellFamily>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<IComputedValue<ShellFamily>>[]> & {
11
+ readonly __abstract?: never;
12
+ };
13
+ //# sourceMappingURL=current-shell-family.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"current-shell-family.d.ts","sourceRoot":"","sources":["../../src/current-shell-family.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,0DACtB,cAAc,CAAC,WAAW,CAAC;;CAI9C,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type SvgProps } from "@k8slens/element-components";
2
+ /**
3
+ * Generic fallback icon for an AI tool that contributes no `Icon` of its own (a
4
+ * terminal glyph). The bunch factory falls back to this so the effective-icon
5
+ * token never resolves to `undefined`.
6
+ */
7
+ export declare const DefaultAiToolIcon: (props: SvgProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=default-ai-tool-icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-ai-tool-icon.d.ts","sourceRoot":"","sources":["../../src/default-ai-tool-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAO,MAAM,6BAA6B,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,QAAQ,4CAIhD,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { IComputedValue } from "mobx";
2
+ import type { AiToolListEntry } from "./ai-tool";
3
+ /** Resolves the synchronously readable detected-tools list. */
4
+ export type DetectedAiTools = () => IComputedValue<AiToolListEntry[]>;
5
+ /**
6
+ * The AI tools with their detected install state, as a synchronously readable reactive
7
+ * list — the same state `aiToolsInjectionToken` exposes behind a promise, for consumers
8
+ * that need sync reactivity (e.g. the `isVisible` computeds of menu items). Empty until
9
+ * the first explicit scan (`refreshAiToolDetectionInjectionToken`) has run; a kind
10
+ * missing from the list has not been scanned yet.
11
+ */
12
+ export declare const detectedAiToolsInjectionToken: import("@k8slens/injectable").InjectionToken2Base<DetectedAiTools, () => IComputedValue<AiToolListEntry[]>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<IComputedValue<AiToolListEntry[]>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<IComputedValue<AiToolListEntry[]>>[]> & {
13
+ readonly __abstract?: never;
14
+ };
15
+ //# sourceMappingURL=detected-ai-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detected-ai-tools.d.ts","sourceRoot":"","sources":["../../src/detected-ai-tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GAAG,MAAM,cAAc,CAAC,eAAe,EAAE,CAAC,CAAC;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B;;CAGtC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ShellScoped } from "@k8slens/platform-specific-injectables";
2
+ import type { AiToolKind, GetCliCommand } from "./ai-tool";
3
+ /**
4
+ * Per-kind builder for the command that launches an AI tool in a terminal.
5
+ * Contribute one per tool kind via `.for(kind)`. Registered (by the bunch factory)
6
+ * as one {@link ShellScoped} cell per shell family; consumers pick the active
7
+ * shell's at runtime with `resolveForShell(injectMany(token.for(kind))(), family)`.
8
+ */
9
+ export declare const getAiCommandForTerminalInjectionToken: import("@k8slens/injectable").InjectionToken2Base<() => ShellScoped<GetCliCommand>, () => ShellScoped<GetCliCommand>[], "zero-or-many", () => import("@k8slens/injectable").InjectionInstanceWithMeta<ShellScoped<GetCliCommand>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<ShellScoped<GetCliCommand>>[]> & {
10
+ readonly __abstract: true;
11
+ for: (kind: AiToolKind) => import("@k8slens/injectable").InjectionToken2Base<() => ShellScoped<GetCliCommand>, () => ShellScoped<GetCliCommand>[], "zero-or-many", () => import("@k8slens/injectable").InjectionInstanceWithMeta<ShellScoped<GetCliCommand>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<ShellScoped<GetCliCommand>>[]> & {
12
+ readonly __abstract?: never;
13
+ } & {
14
+ speciality: any;
15
+ };
16
+ };
17
+ //# sourceMappingURL=get-ai-command-for-terminal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-ai-command-for-terminal.d.ts","sourceRoot":"","sources":["../../src/get-ai-command-for-terminal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,0DAC3B,WAAW,CAAC,aAAa,CAAC;;gBAIvC,UAAU,6DAEK,WAAW,CAAC,aAAa,CAAC;;;;;CAOlD,CAAC"}