@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,51 @@
1
+ import type { IComputedValue } from "mobx";
2
+ import type { AiToolKind } from "./ai-tool";
3
+ /**
4
+ * The menu a tool's own configuration is offered in, opened from the tool's row in
5
+ * the AI tool button's menu. One kind for every tool: the row says which tool it
6
+ * opened the menu for, and the item renders that tool's `Settings`.
7
+ */
8
+ export declare const aiToolConfigurationMenuKind: import("@k8slens/injectable").TypedSpecifier<"ai-tool-configuration-menu", {
9
+ dropDownMenuData: {
10
+ readonly kind: AiToolKind;
11
+ };
12
+ }>;
13
+ /** Resolves whether the tool has the configuration it needs to run. */
14
+ export type AiToolIsConfigured = () => Promise<IComputedValue<boolean>>;
15
+ /**
16
+ * Whether a tool has the configuration it needs to run — the Custom kind's
17
+ * free-text command, for instance, is nothing until the user writes one.
18
+ *
19
+ * Registered only by the tools that need configuring; a tool with no registration
20
+ * needs none and is always ready. Registering one is also what makes a surface
21
+ * offer the tool's own `Settings`, so a tool can be configured where it is picked
22
+ * rather than in one place alone.
23
+ */
24
+ export declare const aiToolIsConfiguredForKindInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolIsConfigured, () => Promise<IComputedValue<boolean>> | undefined, "zero-or-one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IComputedValue<boolean>>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IComputedValue<boolean>>> | undefined> & {
25
+ readonly __abstract: true;
26
+ for: (kind: AiToolKind) => import("@k8slens/injectable").InjectionToken2Base<AiToolIsConfigured, () => Promise<IComputedValue<boolean>> | undefined, "zero-or-one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IComputedValue<boolean>>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<Promise<IComputedValue<boolean>>> | undefined> & {
27
+ readonly __abstract?: never;
28
+ } & {
29
+ speciality: any;
30
+ };
31
+ };
32
+ /** What one tool says about configuration of its own, as the surfaces that gate on it need it. */
33
+ export interface AiToolConfigurationState {
34
+ /** Whether the tool has configuration to fill in at all. */
35
+ readonly isConfigurable: IComputedValue<boolean>;
36
+ /** Whether that configuration is there yet. */
37
+ readonly isConfigured: IComputedValue<boolean>;
38
+ /** Whether the tool may be picked: it either needs no configuration, or has it. */
39
+ readonly isReadyToSelect: IComputedValue<boolean>;
40
+ }
41
+ /** Resolves one tool's configuration state. */
42
+ export type AiToolConfigurationStateFor = () => (kind: AiToolKind) => AiToolConfigurationState;
43
+ /**
44
+ * Reads {@link aiToolIsConfiguredForKindInjectionToken} on behalf of every surface
45
+ * that gates on it — the AI tool button's menu and the preferences selector — so
46
+ * one rule is not enforced in one place and missed in another.
47
+ */
48
+ export declare const aiToolConfigurationStateInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolConfigurationStateFor, () => ((kind: AiToolKind) => AiToolConfigurationState)[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<(kind: AiToolKind) => AiToolConfigurationState>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<(kind: AiToolKind) => AiToolConfigurationState>[]> & {
49
+ readonly __abstract?: never;
50
+ };
51
+ //# sourceMappingURL=ai-tool-configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-configuration.d.ts","sourceRoot":"","sources":["../../src/ai-tool-configuration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;uBAAwC,UAAU;;EAEzF,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;AAExE;;;;;;;;GAQG;AACH,eAAO,MAAM,uCAAuC;;gBAG1C,UAAU;;;;;CAMnB,CAAC;AAEF,kGAAkG;AAClG,MAAM,WAAW,wBAAwB;IACvC,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACjD,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC/C,mFAAmF;IACnF,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACnD;AAED,+CAA+C;AAC/C,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,IAAI,EAAE,UAAU,KAAK,wBAAwB,CAAC;AAE/F;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,+FAPI,UAAU,KAAK,wBAAwB;;CAY1F,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type React from "react";
2
+ import type { AiToolKind } from "./ai-tool";
3
+ /** Props a tool's description component receives, so it can adapt to detection state. */
4
+ export interface AiToolDescriptionProps {
5
+ /** Whether the tool was detected as installed; lets a description swap in a "Not found in PATH" message. */
6
+ readonly isInstalled: boolean;
7
+ }
8
+ /** Resolves a kind's description component. */
9
+ export type AiToolDescription = () => React.ComponentType<AiToolDescriptionProps>;
10
+ /**
11
+ * Per-kind description for an AI tool — a short blurb introducing the tool (e.g.
12
+ * "The coding assistant by Anthropic"), shown as the selector's secondary line.
13
+ * A React component (not a string) receiving the tool's detection state, so it
14
+ * may include markup/links and opt to show a "Not found in PATH" message (or any
15
+ * other guidance) when the tool is not installed. Contribute one per tool kind.
16
+ */
17
+ export declare const aiToolDescriptionInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolDescription, () => React.ComponentType<AiToolDescriptionProps>[], "zero-or-many", () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<AiToolDescriptionProps>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<AiToolDescriptionProps>>[]> & {
18
+ readonly __abstract: true;
19
+ for: (kind: AiToolKind) => import("@k8slens/injectable").InjectionToken2Base<AiToolDescription, () => React.ComponentType<AiToolDescriptionProps>[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<AiToolDescriptionProps>>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<React.ComponentType<AiToolDescriptionProps>>[]> & {
20
+ readonly __abstract?: never;
21
+ } & {
22
+ speciality: any;
23
+ };
24
+ };
25
+ //# sourceMappingURL=ai-tool-description.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-description.d.ts","sourceRoot":"","sources":["../../src/ai-tool-description.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,yFAAyF;AACzF,MAAM,WAAW,sBAAsB;IACrC,4GAA4G;IAC5G,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,+CAA+C;AAC/C,MAAM,MAAM,iBAAiB,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;AAElF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;gBAGlC,UAAU;;;;;CAMnB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Re-scans AI tool installation state and updates {@link aiToolsInjectionToken}.
3
+ * Awaitable, so callers can act once detection settles.
4
+ */
5
+ export type RefreshAiToolDetection = () => Promise<void>;
6
+ /**
7
+ * Resolves the explicit "re-scan installed AI tools" action. Detection is never
8
+ * a side effect of injection: the preferences UI calls this on mount and from a
9
+ * "Refresh" control, and the launch path awaits it before resolving the
10
+ * effective tool — so tools installed/removed while Lens is running are picked
11
+ * up without a restart.
12
+ *
13
+ * Shaped as a factory returning the action (like `aiToolNameInjectionToken`) so
14
+ * it is consumable via `useInject` / `di.inject` — which return the action — and
15
+ * never needs `inject2` (absent from the React-context DI container).
16
+ */
17
+ export declare const refreshAiToolDetectionInjectionToken: import("@k8slens/injectable").InjectionToken2Base<() => RefreshAiToolDetection, () => RefreshAiToolDetection[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<RefreshAiToolDetection>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<RefreshAiToolDetection>[]> & {
18
+ readonly __abstract?: never;
19
+ };
20
+ //# sourceMappingURL=ai-tool-detection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-detection.d.ts","sourceRoot":"","sources":["../../src/ai-tool-detection.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oCAAoC,0DAA6C,sBAAsB;;CAKjH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { AiToolKind } from "./ai-tool";
2
+ /** Resolves the plain-text display name for a given AI tool kind. */
3
+ export type AiToolDisplayName = () => string;
4
+ /**
5
+ * Per-kind plain-text display name (e.g. "Claude Code"). Used by string-only
6
+ * slots that cannot render the React `aiToolNameInjectionToken` component — for
7
+ * example the command-palette entry title. The React name component derives
8
+ * from this same value, so the two stay in sync.
9
+ */
10
+ export declare const aiToolDisplayNameInjectionToken: import("@k8slens/injectable").InjectionToken2Base<AiToolDisplayName, () => string[], "zero-or-many", () => import("@k8slens/injectable").InjectionInstanceWithMeta<string>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<string>[]> & {
11
+ readonly __abstract: true;
12
+ for: (kind: AiToolKind) => import("@k8slens/injectable").InjectionToken2Base<AiToolDisplayName, () => string[], "one", () => import("@k8slens/injectable").InjectionInstanceWithMeta<string>, () => import("@k8slens/injectable").InjectionInstanceWithMeta<string>[]> & {
13
+ readonly __abstract?: never;
14
+ } & {
15
+ speciality: any;
16
+ };
17
+ };
18
+ //# sourceMappingURL=ai-tool-display-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tool-display-name.d.ts","sourceRoot":"","sources":["../../src/ai-tool-display-name.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,qEAAqE;AACrE,MAAM,MAAM,iBAAiB,GAAG,MAAM,MAAM,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B;;gBAGlC,UAAU;;;;;CAMnB,CAAC"}