@robota-sdk/agent-product 3.6.1 → 3.8.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 (35) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/coding/index.cjs +1 -1
  3. package/dist/coding/index.js +1 -1
  4. package/dist/command/index.cjs +1 -1
  5. package/dist/command/index.d.cts +19 -12
  6. package/dist/command/index.d.cts.map +1 -1
  7. package/dist/command/index.d.ts +19 -12
  8. package/dist/command/index.d.ts.map +1 -1
  9. package/dist/command/index.js +1 -1
  10. package/dist/command/node.d.cts +1 -1
  11. package/dist/command/node.d.ts +1 -1
  12. package/dist/command-BwqSJ1sX.js +123 -0
  13. package/dist/command-BwqSJ1sX.js.map +1 -0
  14. package/dist/{command--ag0fdHz.cjs → command-CZqe1Y9x.cjs} +77 -77
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.d.cts +16 -9
  17. package/dist/index.d.cts.map +1 -1
  18. package/dist/index.d.ts +16 -9
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/{keybindings-command-module-CcA9-Xqi.d.cts → keybindings-command-module-DuL6bSYI.d.cts} +3 -3
  23. package/dist/{keybindings-command-module-CcA9-Xqi.d.cts.map → keybindings-command-module-DuL6bSYI.d.cts.map} +1 -1
  24. package/dist/{keybindings-command-module-CcA9-Xqi.d.ts → keybindings-command-module-DuL6bSYI.d.ts} +3 -3
  25. package/dist/{keybindings-command-module-CcA9-Xqi.d.ts.map → keybindings-command-module-DuL6bSYI.d.ts.map} +1 -1
  26. package/dist/personal/index.cjs +24 -24
  27. package/dist/personal/index.d.cts +418 -36
  28. package/dist/personal/index.d.cts.map +1 -1
  29. package/dist/personal/index.d.ts +418 -36
  30. package/dist/personal/index.d.ts.map +1 -1
  31. package/dist/personal/index.js +24 -24
  32. package/dist/personal/index.js.map +1 -1
  33. package/package.json +7 -7
  34. package/dist/command-BXOf0yNQ.js +0 -123
  35. package/dist/command-BXOf0yNQ.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./capability-pack-Dc6eJ76H.cjs"),t=require("./load-external-presets-DyoUUA3V.cjs");require("./preset-tH5pgRIC.cjs");let n=require("@robota-sdk/agent-core"),r=require("@robota-sdk/agent-framework");function i(e,t){let n=e.provider??t.provider,r=e.providerErrorGuidance??t.providerErrorGuidance,i=e.promptFileReferenceTag??t.promptFileReferenceTag,a=e.modelCommandToolPrefix??t.modelCommandToolPrefix,o=e.subagentHookEnvironmentNames??t.subagentHookEnvironmentNames,s=e.observerFailureWarningCode??t.observerFailureWarningCode,c=e.permissionMode===void 0&&t.defaultPermissionMode!==void 0?{permissionMode:t.defaultPermissionMode}:{},l=e.commandModules??t.commandModules,u={...e.commandHostAdapters,presetRegistry:t.presetRegistry};if(`session`in e)return{...e,provider:n,...r===void 0?{}:{providerErrorGuidance:r},...i===void 0?{}:{promptFileReferenceTag:i},...a===void 0?{}:{modelCommandToolPrefix:a},...o===void 0?{}:{subagentHookEnvironmentNames:o},...s===void 0?{}:{observerFailureWarningCode:s},commandModules:l,commandHostAdapters:u,...c};if(n===void 0)throw Error("assembleProduct: no provider available — the profile carried neither `providerSettings` nor an injected `provider`, and the session options supplied none.");return{...e,provider:n,...r===void 0?{}:{providerErrorGuidance:r},...i===void 0?{}:{promptFileReferenceTag:i},...a===void 0?{}:{modelCommandToolPrefix:a},...o===void 0?{}:{subagentHookEnvironmentNames:o},...s===void 0?{}:{observerFailureWarningCode:s},commandModules:l,commandHostAdapters:u,additionalTools:[...e.additionalTools??[],...t.tools],...t.subagents.length>0?{agentDefinitions:t.subagents}:{},...c}}function a(a){let o=a.presetRegistry??t.r(a.presets??[]),s=a.defaultPresetId===void 0?void 0:o.resolvePreset(a.defaultPresetId,a.presetContext),{merged:c,acceptedPacks:l,rejected:u,rejectedPacks:d}=e.t(a.baseCommandModules??[],a.packs??[]),f=a.provider??(a.providerSettings===void 0?void 0:(0,n.createProviderFromConfig)(a.providerSettings,a.providerDefinitions)),p=e=>i(e.session,{provider:f,providerErrorGuidance:a.providerErrorGuidance,promptFileReferenceTag:a.promptFileReferenceTag,modelCommandToolPrefix:a.modelCommandToolPrefix,subagentHookEnvironmentNames:a.subagentHookEnvironmentNames,observerFailureWarningCode:a.observerFailureWarningCode,commandModules:c.commandModules,tools:c.tools,subagents:c.subagents,defaultPermissionMode:s?.permissionMode,presetRegistry:o});return{id:a.id,...a.agentName===void 0?{}:{agentName:a.agentName},...a.version===void 0?{}:{version:a.version},...f===void 0?{}:{provider:f},providerDefinitions:a.providerDefinitions,commandModules:c.commandModules,tools:c.tools,subagents:c.subagents,acceptedPacks:l,rejectedCapabilities:u,rejectedPacks:d,presets:o,resolvePreset:(e,t)=>o.resolvePreset(e,t),...a.defaultPresetId===void 0?{}:{defaultPresetId:a.defaultPresetId},...s===void 0?{}:{defaultPreset:s},backgroundTaskRunners:a.backgroundTaskRunners??[],...a.subagentRunnerFactory===void 0?{}:{subagentRunnerFactory:a.subagentRunnerFactory},...a.transports===void 0?{}:{transports:typeof a.transports==`function`?a.transports():a.transports},buildRuntimeOptions:p,buildRuntime:e=>(0,r.buildRuntimeSession)(p(e))}}exports.assembleProduct=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./capability-pack-Dc6eJ76H.cjs"),t=require("./load-external-presets-DyoUUA3V.cjs");require("./preset-tH5pgRIC.cjs");let n=require("@robota-sdk/agent-core"),r=require("@robota-sdk/agent-framework");function i(e,t){if(t.provider&&(0,n.isManagedRunProvider)(t.provider))throw new n.ManagedRunUnavailableError(t.provider.name);let r=e.provider??t.provider;if(r&&(0,n.isManagedRunProvider)(r))throw new n.ManagedRunUnavailableError(r.name);let i=e.providerErrorGuidance??t.providerErrorGuidance,a=e.promptFileReferenceTag??t.promptFileReferenceTag,o=e.modelCommandToolPrefix??t.modelCommandToolPrefix,s=e.subagentHookEnvironmentNames??t.subagentHookEnvironmentNames,c=e.observerFailureWarningCode??t.observerFailureWarningCode,l=e.permissionMode===void 0&&t.defaultPermissionMode!==void 0?{permissionMode:t.defaultPermissionMode}:{},u=e.commandModules??t.commandModules,d={...e.commandHostAdapters,presetRegistry:t.presetRegistry};if(`session`in e)return{...e,provider:r,...i===void 0?{}:{providerErrorGuidance:i},...a===void 0?{}:{promptFileReferenceTag:a},...o===void 0?{}:{modelCommandToolPrefix:o},...s===void 0?{}:{subagentHookEnvironmentNames:s},...c===void 0?{}:{observerFailureWarningCode:c},commandModules:u,commandHostAdapters:d,...l};if(r===void 0)throw Error("assembleProduct: no provider available — the profile carried neither `providerSettings` nor an injected `provider`, and the session options supplied none.");return{...e,provider:r,...i===void 0?{}:{providerErrorGuidance:i},...a===void 0?{}:{promptFileReferenceTag:a},...o===void 0?{}:{modelCommandToolPrefix:o},...s===void 0?{}:{subagentHookEnvironmentNames:s},...c===void 0?{}:{observerFailureWarningCode:c},commandModules:u,commandHostAdapters:d,additionalTools:[...e.additionalTools??[],...t.tools],...t.subagents.length>0?{agentDefinitions:t.subagents}:{},...l}}function a(a){let o=a.presetRegistry??t.r(a.presets??[]),s=a.defaultPresetId===void 0?void 0:o.resolvePreset(a.defaultPresetId,a.presetContext),{merged:c,acceptedPacks:l,rejected:u,rejectedPacks:d}=e.t(a.baseCommandModules??[],a.packs??[]),f=a.provider??(a.providerSettings===void 0?void 0:(0,n.createProviderFromConfig)(a.providerSettings,a.providerDefinitions)),p=e=>i(e.session,{provider:f,providerErrorGuidance:a.providerErrorGuidance,promptFileReferenceTag:a.promptFileReferenceTag,modelCommandToolPrefix:a.modelCommandToolPrefix,subagentHookEnvironmentNames:a.subagentHookEnvironmentNames,observerFailureWarningCode:a.observerFailureWarningCode,commandModules:c.commandModules,tools:c.tools,subagents:c.subagents,defaultPermissionMode:s?.permissionMode,presetRegistry:o});return{id:a.id,...a.agentName===void 0?{}:{agentName:a.agentName},...a.version===void 0?{}:{version:a.version},...f===void 0?{}:{provider:f},providerDefinitions:a.providerDefinitions,commandModules:c.commandModules,tools:c.tools,subagents:c.subagents,acceptedPacks:l,rejectedCapabilities:u,rejectedPacks:d,presets:o,resolvePreset:(e,t)=>o.resolvePreset(e,t),...a.defaultPresetId===void 0?{}:{defaultPresetId:a.defaultPresetId},...s===void 0?{}:{defaultPreset:s},backgroundTaskRunners:a.backgroundTaskRunners??[],...a.subagentRunnerFactory===void 0?{}:{subagentRunnerFactory:a.subagentRunnerFactory},...a.transports===void 0?{}:{transports:typeof a.transports==`function`?a.transports():a.transports},buildRuntimeOptions:p,buildRuntime:e=>(0,r.buildRuntimeSession)(p(e))}}exports.assembleProduct=a;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as IRejectedCapability, n as ICapabilityPack, o as IRejectedCapabilityPack, r as ICapabilityPackMetadata } from "./index-tMvD5zn-.cjs";
2
2
  import { a as IResolvedPresetOptions, i as IPreset } from "./load-external-presets-DCY3HJ8d.cjs";
3
3
  import { c as IPresetRegistry, u as IResolvePresetContext } from "./index-Cz8aDRO3.cjs";
4
- import { FunctionTool, IAIProvider, IProviderDefinition, IProviderDefinitionConfig } from "@robota-sdk/agent-core";
4
+ import { FunctionTool, IAIProvider, IProviderDefinition, IProviderDefinitionConfig, TExecutionProvider, TProviderDefinition } from "@robota-sdk/agent-core";
5
5
  import { IAgentDefinition, IBackgroundTaskRunner, ICommandModule, ICreateSessionOptions, IProviderErrorGuidance, InteractiveSession, TInteractiveSessionOptions, TSubagentRunnerFactory } from "@robota-sdk/agent-framework";
6
6
  import { ITransportRegistryView } from "@robota-sdk/agent-interface/transport";
7
7
  //#region src/product-profile.d.ts
@@ -15,7 +15,7 @@ import { ITransportRegistryView } from "@robota-sdk/agent-interface/transport";
15
15
  * product assembly** — the profile carries neither behavior nor capability *definitions*, it only
16
16
  * *references* them and supplies identity + injected adapters.
17
17
  */
18
- interface IProductProfile {
18
+ interface IProductProfile<P extends TExecutionProvider = IAIProvider> {
19
19
  /** Product id (diagnostics + surfaced on the assembled product). NEVER branched on by the assembler. */
20
20
  id: string;
21
21
  /** Product agent display name. */
@@ -27,13 +27,13 @@ interface IProductProfile {
27
27
  * providers it can speak to, and the kernel constructs from this registry. Pass `[]` for a product that
28
28
  * only ever runs on an injected {@link provider}.
29
29
  */
30
- providerDefinitions: readonly IProviderDefinition[];
30
+ providerDefinitions: readonly IProviderDefinition<P>[];
31
31
  /**
32
32
  * The ALREADY-RESOLVED provider configuration (name/model/apiKey/baseURL/…). The SHELL performs the
33
33
  * settings/env/file reads that produce this value and passes it IN as plain data; the kernel then
34
34
  * constructs the provider from it via `createProviderFromConfig`. That keeps the fold pure and IO-free
35
35
  * (guard b) while returning provider construction to the kernel, per the spec's In-kernel boundary
36
- * ("Provider construction FROM `IProviderDefinition[]` + already-resolved settings → In-kernel").
36
+ * ("Provider construction FROM `TProviderDefinition[]` + already-resolved settings → In-kernel").
37
37
  *
38
38
  * Absent ⇒ no provider is constructed; the consumer either injects {@link provider} or supplies one at
39
39
  * `buildRuntime` time (the Mode A shape, which carries only `providerDefinitions`).
@@ -44,7 +44,7 @@ interface IProductProfile {
44
44
  * precedence over {@link providerSettings}. the configured CLI uses it for `--session-log` replay, where the
45
45
  * provider answers from a recorded log instead of a vendor definition.
46
46
  */
47
- provider?: IAIProvider;
47
+ provider?: P;
48
48
  /** Product-specific, plain-data remediation text for recognized provider errors. */
49
49
  providerErrorGuidance?: IProviderErrorGuidance;
50
50
  /** Model-visible enclosure for workspace file references; neutral when omitted. */
@@ -108,7 +108,7 @@ interface IBuildRuntimeInput {
108
108
  * The neutral runtime materials {@link assembleProduct} produces — everything the shell needs to bind its
109
109
  * own transport/presentation. Concrete transports, the TUI, and mode dispatch stay in the shell.
110
110
  */
111
- interface IAssembledProduct {
111
+ interface IAssembledProduct<P extends TExecutionProvider = IAIProvider> {
112
112
  /** Product identity (passthrough — surfaced for the shell, never branched on by the assembler). */
113
113
  id: string;
114
114
  agentName?: string;
@@ -118,9 +118,9 @@ interface IAssembledProduct {
118
118
  * `profile.provider` when one was supplied (it wins). `undefined` when the profile carried neither
119
119
  * (Mode A): the consumer then supplies a provider in the `buildRuntime` session options.
120
120
  */
121
- provider?: IAIProvider;
121
+ provider?: P;
122
122
  /** The product's provider surface (passthrough) — the definitions hot-swap and setup flows read. */
123
- providerDefinitions: readonly IProviderDefinition[];
123
+ providerDefinitions: readonly IProviderDefinition<P>[];
124
124
  /** `baseCommandModules ⊕ merged pack modules` (see `mergeCapabilityPacks`). */
125
125
  commandModules: readonly ICommandModule[];
126
126
  /** Merged pack tools (additive). */
@@ -168,6 +168,10 @@ interface IAssembledProduct {
168
168
  }
169
169
  //#endregion
170
170
  //#region src/assemble-product.d.ts
171
+ type TAssembledForDefinitions<D extends TProviderDefinition, P extends TExecutionProvider> = Omit<IAssembledProduct<TExecutionProvider>, 'provider' | 'providerDefinitions'> & {
172
+ provider?: ReturnType<D['createProvider']> | P;
173
+ providerDefinitions: readonly D[];
174
+ };
171
175
  /**
172
176
  * The single product-composition function — a PURE, deterministic, IO-free fold over `IProductProfile`.
173
177
  *
@@ -197,7 +201,10 @@ interface IAssembledProduct {
197
201
  * Settings/args/env resolution and concrete transports/presentation stay in the shell; `assembleProduct`
198
202
  * receives already-resolved data and returns neutral materials the shell binds its own transport over.
199
203
  */
200
- declare function assembleProduct(profile: IProductProfile): IAssembledProduct;
204
+ declare function assembleProduct<D extends TProviderDefinition = IProviderDefinition, P extends TExecutionProvider = ReturnType<D['createProvider']>>(profile: Omit<IProductProfile<TExecutionProvider>, 'providerDefinitions' | 'provider'> & {
205
+ providerDefinitions: readonly D[];
206
+ provider?: P;
207
+ }): TAssembledForDefinitions<D, P>;
201
208
  //#endregion
202
209
  export { type IAssembledProduct, type IBuildRuntimeInput, type IProductProfile, assembleProduct };
203
210
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/product-profile.ts","../src/assemble-product.ts"],"mappings":";;;;;;;;;;;;;;;;;UAwCiB;;EAGf;;EAEA;;EAEA;;;;;;EAQA,8BAA8B;;;;;;;;;;;EAW9B,mBAAmB;;;;;;EAMnB,WAAW;;EAEX,wBAAwB;;EAExB;;EAEA;;EAEA,+BAA+B;;EAE/B,6BAA6B;;;;;EAM7B,mBAAmB;;;;;;;;;;;;EAYnB,iBAAiB;;EAEjB;;;;;;EAMA,gBAAgB;;EAIhB,iBAAiB;;EAEjB,8BAA8B;;EAI9B,iCAAiC;;EAEjC,wBAAwB;;EAExB,aAAa,gCAAgC;;;;;;;UAQ9B;;;;;;EAMf,SAAS;;;;;;UAOM;;EAEf;EACA;EACA;;;;;;EAOA,WAAW;;EAEX,8BAA8B;;EAG9B,yBAAyB;;EAEzB,gBAAgB;;EAEhB,oBAAoB;;EAEpB,+BAA+B;;EAE/B,wBAAwB;;EAExB,wBAAwB;;;;;EAMxB,SAAS;;EAET,gBACE,YACA,UAAU,WAAW,yCAClB;;;;;;EAML;EACA,gBAAgB;;EAGhB,gCAAgC;EAChC,wBAAwB;EACxB,aAAa;;;;;;;;EASb,sBAAsB,OAAO,uBAAuB;;;;;;EAOpD,eAAe,OAAO,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCtC/B,gBAAgB,SAAS,kBAAkB"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/product-profile.ts","../src/assemble-product.ts"],"mappings":";;;;;;;;;;;;;;;;;UAyCiB,gBAAgB,UAAU,qBAAqB;;EAG9D;;EAEA;;EAEA;;;;;;EAQA,8BAA8B,oBAAoB;;;;;;;;;;;EAWlD,mBAAmB;;;;;;EAMnB,WAAW;;EAEX,wBAAwB;;EAExB;;EAEA;;EAEA,+BAA+B;;EAE/B,6BAA6B;;;;;EAM7B,mBAAmB;;;;;;;;;;;;EAYnB,iBAAiB;;EAEjB;;;;;;EAMA,gBAAgB;;EAIhB,iBAAiB;;EAEjB,8BAA8B;;EAI9B,iCAAiC;;EAEjC,wBAAwB;;EAExB,aAAa,gCAAgC;;;;;;;UAQ9B;;;;;;EAMf,SAAS;;;;;;UAOM,kBAAkB,UAAU,qBAAqB;;EAEhE;EACA;EACA;;;;;;EAOA,WAAW;;EAEX,8BAA8B,oBAAoB;;EAGlD,yBAAyB;;EAEzB,gBAAgB;;EAEhB,oBAAoB;;EAEpB,+BAA+B;;EAE/B,wBAAwB;;EAExB,wBAAwB;;;;;EAMxB,SAAS;;EAET,gBACE,YACA,UAAU,WAAW,yCAClB;;;;;;EAML;EACA,gBAAgB;;EAGhB,gCAAgC;EAChC,wBAAwB;EACxB,aAAa;;;;;;;;EASb,sBAAsB,OAAO,uBAAuB;;;;;;EAOpD,eAAe,OAAO,uBAAuB;;;;KC/I1C,yBAAyB,UAAU,qBAAqB,UAAU,sBAAsB,KAC3F,kBAAkB;EAGlB,WAAW,WAAW,uBAAuB;EAC7C,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsHhB,gBACd,UAAU,sBAAsB,qBAChC,UAAU,qBAAqB,WAAW,sBAE1C,SAAS,KAAK,gBAAgB;EAC5B,8BAA8B;EAC9B,WAAW;IAEZ,yBAAyB,GAAG"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as IRejectedCapability, n as ICapabilityPack, o as IRejectedCapabilityPack, r as ICapabilityPackMetadata } from "./index-tMvD5zn-.js";
2
2
  import { a as IResolvedPresetOptions, i as IPreset } from "./load-external-presets-DCY3HJ8d.js";
3
3
  import { c as IPresetRegistry, u as IResolvePresetContext } from "./index-jksIH551.js";
4
- import { FunctionTool, IAIProvider, IProviderDefinition, IProviderDefinitionConfig } from "@robota-sdk/agent-core";
4
+ import { FunctionTool, IAIProvider, IProviderDefinition, IProviderDefinitionConfig, TExecutionProvider, TProviderDefinition } from "@robota-sdk/agent-core";
5
5
  import { IAgentDefinition, IBackgroundTaskRunner, ICommandModule, ICreateSessionOptions, IProviderErrorGuidance, InteractiveSession, TInteractiveSessionOptions, TSubagentRunnerFactory } from "@robota-sdk/agent-framework";
6
6
  import { ITransportRegistryView } from "@robota-sdk/agent-interface/transport";
7
7
  //#region src/product-profile.d.ts
@@ -15,7 +15,7 @@ import { ITransportRegistryView } from "@robota-sdk/agent-interface/transport";
15
15
  * product assembly** — the profile carries neither behavior nor capability *definitions*, it only
16
16
  * *references* them and supplies identity + injected adapters.
17
17
  */
18
- interface IProductProfile {
18
+ interface IProductProfile<P extends TExecutionProvider = IAIProvider> {
19
19
  /** Product id (diagnostics + surfaced on the assembled product). NEVER branched on by the assembler. */
20
20
  id: string;
21
21
  /** Product agent display name. */
@@ -27,13 +27,13 @@ interface IProductProfile {
27
27
  * providers it can speak to, and the kernel constructs from this registry. Pass `[]` for a product that
28
28
  * only ever runs on an injected {@link provider}.
29
29
  */
30
- providerDefinitions: readonly IProviderDefinition[];
30
+ providerDefinitions: readonly IProviderDefinition<P>[];
31
31
  /**
32
32
  * The ALREADY-RESOLVED provider configuration (name/model/apiKey/baseURL/…). The SHELL performs the
33
33
  * settings/env/file reads that produce this value and passes it IN as plain data; the kernel then
34
34
  * constructs the provider from it via `createProviderFromConfig`. That keeps the fold pure and IO-free
35
35
  * (guard b) while returning provider construction to the kernel, per the spec's In-kernel boundary
36
- * ("Provider construction FROM `IProviderDefinition[]` + already-resolved settings → In-kernel").
36
+ * ("Provider construction FROM `TProviderDefinition[]` + already-resolved settings → In-kernel").
37
37
  *
38
38
  * Absent ⇒ no provider is constructed; the consumer either injects {@link provider} or supplies one at
39
39
  * `buildRuntime` time (the Mode A shape, which carries only `providerDefinitions`).
@@ -44,7 +44,7 @@ interface IProductProfile {
44
44
  * precedence over {@link providerSettings}. the configured CLI uses it for `--session-log` replay, where the
45
45
  * provider answers from a recorded log instead of a vendor definition.
46
46
  */
47
- provider?: IAIProvider;
47
+ provider?: P;
48
48
  /** Product-specific, plain-data remediation text for recognized provider errors. */
49
49
  providerErrorGuidance?: IProviderErrorGuidance;
50
50
  /** Model-visible enclosure for workspace file references; neutral when omitted. */
@@ -108,7 +108,7 @@ interface IBuildRuntimeInput {
108
108
  * The neutral runtime materials {@link assembleProduct} produces — everything the shell needs to bind its
109
109
  * own transport/presentation. Concrete transports, the TUI, and mode dispatch stay in the shell.
110
110
  */
111
- interface IAssembledProduct {
111
+ interface IAssembledProduct<P extends TExecutionProvider = IAIProvider> {
112
112
  /** Product identity (passthrough — surfaced for the shell, never branched on by the assembler). */
113
113
  id: string;
114
114
  agentName?: string;
@@ -118,9 +118,9 @@ interface IAssembledProduct {
118
118
  * `profile.provider` when one was supplied (it wins). `undefined` when the profile carried neither
119
119
  * (Mode A): the consumer then supplies a provider in the `buildRuntime` session options.
120
120
  */
121
- provider?: IAIProvider;
121
+ provider?: P;
122
122
  /** The product's provider surface (passthrough) — the definitions hot-swap and setup flows read. */
123
- providerDefinitions: readonly IProviderDefinition[];
123
+ providerDefinitions: readonly IProviderDefinition<P>[];
124
124
  /** `baseCommandModules ⊕ merged pack modules` (see `mergeCapabilityPacks`). */
125
125
  commandModules: readonly ICommandModule[];
126
126
  /** Merged pack tools (additive). */
@@ -168,6 +168,10 @@ interface IAssembledProduct {
168
168
  }
169
169
  //#endregion
170
170
  //#region src/assemble-product.d.ts
171
+ type TAssembledForDefinitions<D extends TProviderDefinition, P extends TExecutionProvider> = Omit<IAssembledProduct<TExecutionProvider>, 'provider' | 'providerDefinitions'> & {
172
+ provider?: ReturnType<D['createProvider']> | P;
173
+ providerDefinitions: readonly D[];
174
+ };
171
175
  /**
172
176
  * The single product-composition function — a PURE, deterministic, IO-free fold over `IProductProfile`.
173
177
  *
@@ -197,7 +201,10 @@ interface IAssembledProduct {
197
201
  * Settings/args/env resolution and concrete transports/presentation stay in the shell; `assembleProduct`
198
202
  * receives already-resolved data and returns neutral materials the shell binds its own transport over.
199
203
  */
200
- declare function assembleProduct(profile: IProductProfile): IAssembledProduct;
204
+ declare function assembleProduct<D extends TProviderDefinition = IProviderDefinition, P extends TExecutionProvider = ReturnType<D['createProvider']>>(profile: Omit<IProductProfile<TExecutionProvider>, 'providerDefinitions' | 'provider'> & {
205
+ providerDefinitions: readonly D[];
206
+ provider?: P;
207
+ }): TAssembledForDefinitions<D, P>;
201
208
  //#endregion
202
209
  export { type IAssembledProduct, type IBuildRuntimeInput, type IProductProfile, assembleProduct };
203
210
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/product-profile.ts","../src/assemble-product.ts"],"mappings":";;;;;;;;;;;;;;;;;UAwCiB;;EAGf;;EAEA;;EAEA;;;;;;EAQA,8BAA8B;;;;;;;;;;;EAW9B,mBAAmB;;;;;;EAMnB,WAAW;;EAEX,wBAAwB;;EAExB;;EAEA;;EAEA,+BAA+B;;EAE/B,6BAA6B;;;;;EAM7B,mBAAmB;;;;;;;;;;;;EAYnB,iBAAiB;;EAEjB;;;;;;EAMA,gBAAgB;;EAIhB,iBAAiB;;EAEjB,8BAA8B;;EAI9B,iCAAiC;;EAEjC,wBAAwB;;EAExB,aAAa,gCAAgC;;;;;;;UAQ9B;;;;;;EAMf,SAAS;;;;;;UAOM;;EAEf;EACA;EACA;;;;;;EAOA,WAAW;;EAEX,8BAA8B;;EAG9B,yBAAyB;;EAEzB,gBAAgB;;EAEhB,oBAAoB;;EAEpB,+BAA+B;;EAE/B,wBAAwB;;EAExB,wBAAwB;;;;;EAMxB,SAAS;;EAET,gBACE,YACA,UAAU,WAAW,yCAClB;;;;;;EAML;EACA,gBAAgB;;EAGhB,gCAAgC;EAChC,wBAAwB;EACxB,aAAa;;;;;;;;EASb,sBAAsB,OAAO,uBAAuB;;;;;;EAOpD,eAAe,OAAO,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBCtC/B,gBAAgB,SAAS,kBAAkB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/product-profile.ts","../src/assemble-product.ts"],"mappings":";;;;;;;;;;;;;;;;;UAyCiB,gBAAgB,UAAU,qBAAqB;;EAG9D;;EAEA;;EAEA;;;;;;EAQA,8BAA8B,oBAAoB;;;;;;;;;;;EAWlD,mBAAmB;;;;;;EAMnB,WAAW;;EAEX,wBAAwB;;EAExB;;EAEA;;EAEA,+BAA+B;;EAE/B,6BAA6B;;;;;EAM7B,mBAAmB;;;;;;;;;;;;EAYnB,iBAAiB;;EAEjB;;;;;;EAMA,gBAAgB;;EAIhB,iBAAiB;;EAEjB,8BAA8B;;EAI9B,iCAAiC;;EAEjC,wBAAwB;;EAExB,aAAa,gCAAgC;;;;;;;UAQ9B;;;;;;EAMf,SAAS;;;;;;UAOM,kBAAkB,UAAU,qBAAqB;;EAEhE;EACA;EACA;;;;;;EAOA,WAAW;;EAEX,8BAA8B,oBAAoB;;EAGlD,yBAAyB;;EAEzB,gBAAgB;;EAEhB,oBAAoB;;EAEpB,+BAA+B;;EAE/B,wBAAwB;;EAExB,wBAAwB;;;;;EAMxB,SAAS;;EAET,gBACE,YACA,UAAU,WAAW,yCAClB;;;;;;EAML;EACA,gBAAgB;;EAGhB,gCAAgC;EAChC,wBAAwB;EACxB,aAAa;;;;;;;;EASb,sBAAsB,OAAO,uBAAuB;;;;;;EAOpD,eAAe,OAAO,uBAAuB;;;;KC/I1C,yBAAyB,UAAU,qBAAqB,UAAU,sBAAsB,KAC3F,kBAAkB;EAGlB,WAAW,WAAW,uBAAuB;EAC7C,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsHhB,gBACd,UAAU,sBAAsB,qBAChC,UAAU,qBAAqB,WAAW,sBAE1C,SAAS,KAAK,gBAAgB;EAC5B,8BAA8B;EAC9B,WAAW;IAEZ,yBAAyB,GAAG"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{t as e}from"./capability-pack-D389p-Cv.js";import{r as t}from"./load-external-presets-CJeFbxNF.js";import"./preset-nuw37AF-.js";import{createProviderFromConfig as n}from"@robota-sdk/agent-core";import{buildRuntimeSession as r}from"@robota-sdk/agent-framework";function i(e,t){let n=e.provider??t.provider,r=e.providerErrorGuidance??t.providerErrorGuidance,i=e.promptFileReferenceTag??t.promptFileReferenceTag,a=e.modelCommandToolPrefix??t.modelCommandToolPrefix,o=e.subagentHookEnvironmentNames??t.subagentHookEnvironmentNames,s=e.observerFailureWarningCode??t.observerFailureWarningCode,c=e.permissionMode===void 0&&t.defaultPermissionMode!==void 0?{permissionMode:t.defaultPermissionMode}:{},l=e.commandModules??t.commandModules,u={...e.commandHostAdapters,presetRegistry:t.presetRegistry};if(`session`in e)return{...e,provider:n,...r===void 0?{}:{providerErrorGuidance:r},...i===void 0?{}:{promptFileReferenceTag:i},...a===void 0?{}:{modelCommandToolPrefix:a},...o===void 0?{}:{subagentHookEnvironmentNames:o},...s===void 0?{}:{observerFailureWarningCode:s},commandModules:l,commandHostAdapters:u,...c};if(n===void 0)throw Error("assembleProduct: no provider available — the profile carried neither `providerSettings` nor an injected `provider`, and the session options supplied none.");return{...e,provider:n,...r===void 0?{}:{providerErrorGuidance:r},...i===void 0?{}:{promptFileReferenceTag:i},...a===void 0?{}:{modelCommandToolPrefix:a},...o===void 0?{}:{subagentHookEnvironmentNames:o},...s===void 0?{}:{observerFailureWarningCode:s},commandModules:l,commandHostAdapters:u,additionalTools:[...e.additionalTools??[],...t.tools],...t.subagents.length>0?{agentDefinitions:t.subagents}:{},...c}}function a(a){let o=a.presetRegistry??t(a.presets??[]),s=a.defaultPresetId===void 0?void 0:o.resolvePreset(a.defaultPresetId,a.presetContext),{merged:c,acceptedPacks:l,rejected:u,rejectedPacks:d}=e(a.baseCommandModules??[],a.packs??[]),f=a.provider??(a.providerSettings===void 0?void 0:n(a.providerSettings,a.providerDefinitions)),p=e=>i(e.session,{provider:f,providerErrorGuidance:a.providerErrorGuidance,promptFileReferenceTag:a.promptFileReferenceTag,modelCommandToolPrefix:a.modelCommandToolPrefix,subagentHookEnvironmentNames:a.subagentHookEnvironmentNames,observerFailureWarningCode:a.observerFailureWarningCode,commandModules:c.commandModules,tools:c.tools,subagents:c.subagents,defaultPermissionMode:s?.permissionMode,presetRegistry:o});return{id:a.id,...a.agentName===void 0?{}:{agentName:a.agentName},...a.version===void 0?{}:{version:a.version},...f===void 0?{}:{provider:f},providerDefinitions:a.providerDefinitions,commandModules:c.commandModules,tools:c.tools,subagents:c.subagents,acceptedPacks:l,rejectedCapabilities:u,rejectedPacks:d,presets:o,resolvePreset:(e,t)=>o.resolvePreset(e,t),...a.defaultPresetId===void 0?{}:{defaultPresetId:a.defaultPresetId},...s===void 0?{}:{defaultPreset:s},backgroundTaskRunners:a.backgroundTaskRunners??[],...a.subagentRunnerFactory===void 0?{}:{subagentRunnerFactory:a.subagentRunnerFactory},...a.transports===void 0?{}:{transports:typeof a.transports==`function`?a.transports():a.transports},buildRuntimeOptions:p,buildRuntime:e=>r(p(e))}}export{a as assembleProduct};
1
+ import{t as e}from"./capability-pack-D389p-Cv.js";import{r as t}from"./load-external-presets-CJeFbxNF.js";import"./preset-nuw37AF-.js";import{ManagedRunUnavailableError as n,createProviderFromConfig as r,isManagedRunProvider as i}from"@robota-sdk/agent-core";import{buildRuntimeSession as a}from"@robota-sdk/agent-framework";function o(e,t){if(t.provider&&i(t.provider))throw new n(t.provider.name);let r=e.provider??t.provider;if(r&&i(r))throw new n(r.name);let a=e.providerErrorGuidance??t.providerErrorGuidance,o=e.promptFileReferenceTag??t.promptFileReferenceTag,s=e.modelCommandToolPrefix??t.modelCommandToolPrefix,c=e.subagentHookEnvironmentNames??t.subagentHookEnvironmentNames,l=e.observerFailureWarningCode??t.observerFailureWarningCode,u=e.permissionMode===void 0&&t.defaultPermissionMode!==void 0?{permissionMode:t.defaultPermissionMode}:{},d=e.commandModules??t.commandModules,f={...e.commandHostAdapters,presetRegistry:t.presetRegistry};if(`session`in e)return{...e,provider:r,...a===void 0?{}:{providerErrorGuidance:a},...o===void 0?{}:{promptFileReferenceTag:o},...s===void 0?{}:{modelCommandToolPrefix:s},...c===void 0?{}:{subagentHookEnvironmentNames:c},...l===void 0?{}:{observerFailureWarningCode:l},commandModules:d,commandHostAdapters:f,...u};if(r===void 0)throw Error("assembleProduct: no provider available — the profile carried neither `providerSettings` nor an injected `provider`, and the session options supplied none.");return{...e,provider:r,...a===void 0?{}:{providerErrorGuidance:a},...o===void 0?{}:{promptFileReferenceTag:o},...s===void 0?{}:{modelCommandToolPrefix:s},...c===void 0?{}:{subagentHookEnvironmentNames:c},...l===void 0?{}:{observerFailureWarningCode:l},commandModules:d,commandHostAdapters:f,additionalTools:[...e.additionalTools??[],...t.tools],...t.subagents.length>0?{agentDefinitions:t.subagents}:{},...u}}function s(n){let i=n.presetRegistry??t(n.presets??[]),s=n.defaultPresetId===void 0?void 0:i.resolvePreset(n.defaultPresetId,n.presetContext),{merged:c,acceptedPacks:l,rejected:u,rejectedPacks:d}=e(n.baseCommandModules??[],n.packs??[]),f=n.provider??(n.providerSettings===void 0?void 0:r(n.providerSettings,n.providerDefinitions)),p=e=>o(e.session,{provider:f,providerErrorGuidance:n.providerErrorGuidance,promptFileReferenceTag:n.promptFileReferenceTag,modelCommandToolPrefix:n.modelCommandToolPrefix,subagentHookEnvironmentNames:n.subagentHookEnvironmentNames,observerFailureWarningCode:n.observerFailureWarningCode,commandModules:c.commandModules,tools:c.tools,subagents:c.subagents,defaultPermissionMode:s?.permissionMode,presetRegistry:i});return{id:n.id,...n.agentName===void 0?{}:{agentName:n.agentName},...n.version===void 0?{}:{version:n.version},...f===void 0?{}:{provider:f},providerDefinitions:n.providerDefinitions,commandModules:c.commandModules,tools:c.tools,subagents:c.subagents,acceptedPacks:l,rejectedCapabilities:u,rejectedPacks:d,presets:i,resolvePreset:(e,t)=>i.resolvePreset(e,t),...n.defaultPresetId===void 0?{}:{defaultPresetId:n.defaultPresetId},...s===void 0?{}:{defaultPreset:s},backgroundTaskRunners:n.backgroundTaskRunners??[],...n.subagentRunnerFactory===void 0?{}:{subagentRunnerFactory:n.subagentRunnerFactory},...n.transports===void 0?{}:{transports:typeof n.transports==`function`?n.transports():n.transports},buildRuntimeOptions:p,buildRuntime:e=>a(p(e))}}export{s as assembleProduct};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/assemble-product.ts"],"sourcesContent":["import { mergeCapabilityPacks } from './capability-pack/index.js';\nimport { createProviderFromConfig } from '@robota-sdk/agent-core';\nimport { buildRuntimeSession } from '@robota-sdk/agent-framework';\nimport { createPresetRegistry } from './preset/index.js';\n\nimport type { IAssembledProduct, IBuildRuntimeInput, IProductProfile } from './product-profile.js';\nimport type { TCompositionFieldPolicy } from './capability-pack/index.js';\nimport type {\n FunctionTool,\n IAIProvider,\n IToolWithEventService,\n TPermissionMode,\n} from '@robota-sdk/agent-core';\nimport type {\n IAgentDefinition,\n ICommandHostAdapters,\n ICommandModule,\n TInteractiveSessionOptions,\n} from '@robota-sdk/agent-framework';\nimport type { IPresetRegistry, IResolvedPresetOptions } from './preset/index.js';\n\nexport const PRODUCT_PROFILE_FIELD_POLICIES = {\n id: 'surfaced',\n agentName: 'surfaced',\n version: 'surfaced',\n providerDefinitions: 'consumed-and-surfaced',\n providerSettings: 'consumed',\n provider: 'consumed-and-surfaced',\n providerErrorGuidance: 'consumed',\n promptFileReferenceTag: 'consumed',\n modelCommandToolPrefix: 'consumed',\n subagentHookEnvironmentNames: 'consumed',\n observerFailureWarningCode: 'consumed',\n presets: 'consumed',\n presetRegistry: 'consumed-and-surfaced',\n defaultPresetId: 'consumed-and-surfaced',\n presetContext: 'consumed',\n packs: 'consumed',\n baseCommandModules: 'consumed',\n backgroundTaskRunners: 'surfaced',\n subagentRunnerFactory: 'surfaced',\n transports: 'consumed-and-surfaced',\n} as const satisfies Record<keyof IProductProfile, TCompositionFieldPolicy>;\n\n/** The product-owned materials the assembler overlays onto the shell-supplied session options. */\ninterface IOverlayMaterials {\n provider: IAIProvider | undefined;\n providerErrorGuidance: IProductProfile['providerErrorGuidance'];\n promptFileReferenceTag: IProductProfile['promptFileReferenceTag'];\n modelCommandToolPrefix: IProductProfile['modelCommandToolPrefix'];\n subagentHookEnvironmentNames: IProductProfile['subagentHookEnvironmentNames'];\n observerFailureWarningCode: IProductProfile['observerFailureWarningCode'];\n commandModules: readonly ICommandModule[];\n tools: readonly FunctionTool[];\n subagents: readonly IAgentDefinition[];\n defaultPermissionMode: TPermissionMode | undefined;\n /** The instance preset registry, so `/preset` discovers this product's presets. */\n presetRegistry: IPresetRegistry;\n}\n\n/**\n * Overlay the assembled command modules, pack tools, and pack subagents onto the shell's session options.\n * The injected pre-built-session path gets command modules only (its session already owns its tools); the\n * standard construction path also receives the additive pack tools and — via the framework's\n * `agentDefinitions` injection seam (owner Decision 2) — the merged pack subagents, so a\n * pack's subagents actually reach the runtime instead of being inert material. `agentDefinitions` is left\n * UNSET when no pack contributes one, so the framework's own built-ins + discovery are unchanged.\n *\n * The default preset's `permissionMode` is applied only when the shell left it unset.\n */\nfunction overlaySessionOptions(\n base: TInteractiveSessionOptions,\n materials: IOverlayMaterials,\n): TInteractiveSessionOptions {\n const provider = base.provider ?? materials.provider;\n const providerErrorGuidance = base.providerErrorGuidance ?? materials.providerErrorGuidance;\n const promptFileReferenceTag = base.promptFileReferenceTag ?? materials.promptFileReferenceTag;\n const modelCommandToolPrefix = base.modelCommandToolPrefix ?? materials.modelCommandToolPrefix;\n const subagentHookEnvironmentNames =\n base.subagentHookEnvironmentNames ?? materials.subagentHookEnvironmentNames;\n const observerFailureWarningCode =\n base.observerFailureWarningCode ?? materials.observerFailureWarningCode;\n const permissionModeOverlay =\n base.permissionMode === undefined && materials.defaultPermissionMode !== undefined\n ? { permissionMode: materials.defaultPermissionMode }\n : {};\n // The shell may hand in a selection it has ALREADY narrowed — the configured shell applies its preset's\n // enabled/disabledCommandModules delta to the merged `base ⊕ packs` superset before calling the seam\n // (the spec's composition order: the merge widens, the preset delta narrows). Overwriting it here would\n // silently undo that narrowing, so the assembled set is overlaid only when the caller left it unset —\n // the same \"only when the shell left it unset\" rule `permissionMode` already follows.\n const commandModules = base.commandModules ?? materials.commandModules;\n // MERGED into the shell's bag, never substituted for it. The shell wires its own adapters\n // there (remote control, process, settings) and the registry stands beside them; replacing the bag\n // would silently drop capabilities this assembler knows nothing about. Both arms get it — an\n // injected session is exactly the embedded-host case the item is about.\n const commandHostAdapters: ICommandHostAdapters = {\n ...base.commandHostAdapters,\n presetRegistry: materials.presetRegistry,\n };\n\n if ('session' in base) {\n return {\n ...base,\n provider,\n ...(providerErrorGuidance !== undefined ? { providerErrorGuidance } : {}),\n ...(promptFileReferenceTag !== undefined ? { promptFileReferenceTag } : {}),\n ...(modelCommandToolPrefix !== undefined ? { modelCommandToolPrefix } : {}),\n ...(subagentHookEnvironmentNames !== undefined ? { subagentHookEnvironmentNames } : {}),\n ...(observerFailureWarningCode !== undefined ? { observerFailureWarningCode } : {}),\n commandModules,\n commandHostAdapters,\n ...permissionModeOverlay,\n };\n }\n\n if (provider === undefined) {\n throw new Error(\n 'assembleProduct: no provider available — the profile carried neither `providerSettings` nor an injected `provider`, and the session options supplied none.',\n );\n }\n\n return {\n ...base,\n provider,\n ...(providerErrorGuidance !== undefined ? { providerErrorGuidance } : {}),\n ...(promptFileReferenceTag !== undefined ? { promptFileReferenceTag } : {}),\n ...(modelCommandToolPrefix !== undefined ? { modelCommandToolPrefix } : {}),\n ...(subagentHookEnvironmentNames !== undefined ? { subagentHookEnvironmentNames } : {}),\n ...(observerFailureWarningCode !== undefined ? { observerFailureWarningCode } : {}),\n commandModules,\n commandHostAdapters,\n additionalTools: [\n ...(base.additionalTools ?? []),\n ...(materials.tools as readonly IToolWithEventService[]),\n ],\n ...(materials.subagents.length > 0 ? { agentDefinitions: materials.subagents } : {}),\n ...permissionModeOverlay,\n };\n}\n\n/**\n * The single product-composition function — a PURE, deterministic, IO-free fold over `IProductProfile`.\n *\n * `assembleProduct` is a **peer** of the repo's already-blessed pure folds (`resolvePreset`,\n * `mergeSettings`, `mergeCapabilityPacks`): it reads only its argument, calls only pure sub-folds and the\n * framework's runtime-construction seam, and hard-codes **no** product's choices — there is ZERO\n * product-specific branching (no `if (profile.id === '…')` ever). Everything product-specific arrives as\n * `profile` DATA. This property is what makes the `agent-product` carve-out from the \"no shared\n * product factory\" rule safe; its three parts (dependency-graph neutrality, purity/no-IO, no\n * product-name conditionals) are stated in this package's SPEC.md, \"The pure-fold property\".\n *\n * What it does:\n * 1. Builds a PER-CALL instance-scoped preset registry over `profile.presets` — or adopts the\n * instance the caller already built and handed in as `profile.presetRegistry`. Either way it\n * never mutates the `preset` subpath's module-level `externalPresets` global, so two products in one process do\n * not share one registry and repeat calls do not accumulate. `defaultPresetId` is resolved over that\n * registry with `profile.presetContext`, so the product's `defaultPreset` is the caller's resolution.\n * 2. Merges the additive capability packs onto `profile.baseCommandModules` via `mergeCapabilityPacks`\n * (base ⊕ packs, with a rejection channel — never a silent override).\n * 3. Constructs the provider from `profile.providerDefinitions` + the shell's already-resolved\n * `profile.providerSettings` (owner Decision 1) via agent-core's pure `createProviderFromConfig`; an\n * injected `profile.provider` overrides it.\n * 4. Produces `buildRuntimeOptions`/`buildRuntime`, which DELEGATE runtime construction to\n * `agent-framework`'s `buildRuntimeSession` seam (the SSOT for runtime assembly) — never re-implementing runtime\n * assembly — overlaying the assembled modules, pack tools, and pack subagents (`agentDefinitions`).\n *\n * Settings/args/env resolution and concrete transports/presentation stay in the shell; `assembleProduct`\n * receives already-resolved data and returns neutral materials the shell binds its own transport over.\n */\nexport function assembleProduct(profile: IProductProfile): IAssembledProduct {\n // (1) Per-call instance-scoped preset registry — pure w.r.t. process state. A caller that had to\n // resolve a preset BEFORE it could build this profile (a preset can carry the `model`/`agentName` the\n // profile is constructed from) hands its own instance in as `presetRegistry`; the assembler then uses\n // THAT one rather than building a second, equivalent registry, so there is exactly one resolution path.\n // Either way the registry is instance-scoped — no module-level state is read or mutated.\n const presets = profile.presetRegistry ?? createPresetRegistry(profile.presets ?? []);\n const defaultPreset: IResolvedPresetOptions | undefined =\n profile.defaultPresetId !== undefined\n ? presets.resolvePreset(profile.defaultPresetId, profile.presetContext)\n : undefined;\n\n // (2) Additive capability merge — base ⊕ packs, deterministic, with a rejection channel.\n const { merged, acceptedPacks, rejected, rejectedPacks } = mergeCapabilityPacks(\n profile.baseCommandModules ?? [],\n profile.packs ?? [],\n );\n\n // (3) Provider construction — IN-KERNEL, from the profile's definitions + the shell's ALREADY-RESOLVED\n // settings (owner Decision 1). `createProviderFromConfig` is a pure `config → IAIProvider` factory that\n // lives in `@robota-sdk/agent-core`, an ALLOWED dependency layer,\n // so this reads no fs/env and the fold stays pure. An injected `profile.provider` wins (advanced/test\n // override, e.g. `--session-log` replay); with neither, no provider is constructed and the consumer\n // supplies one in the `buildRuntime` session options (the Mode A shape).\n const provider =\n profile.provider ??\n (profile.providerSettings !== undefined\n ? createProviderFromConfig(profile.providerSettings, profile.providerDefinitions)\n : undefined);\n\n // (4) The runtime-construction delegate — DELEGATES to the framework seam, never re-implements.\n const buildRuntimeOptions = (input: IBuildRuntimeInput): TInteractiveSessionOptions =>\n overlaySessionOptions(input.session, {\n provider,\n providerErrorGuidance: profile.providerErrorGuidance,\n promptFileReferenceTag: profile.promptFileReferenceTag,\n modelCommandToolPrefix: profile.modelCommandToolPrefix,\n subagentHookEnvironmentNames: profile.subagentHookEnvironmentNames,\n observerFailureWarningCode: profile.observerFailureWarningCode,\n commandModules: merged.commandModules,\n tools: merged.tools,\n subagents: merged.subagents,\n defaultPermissionMode: defaultPreset?.permissionMode,\n // The instance registry reaches the SESSION through the host-adapter bag, so\n // `/preset` discovers through the same presets this product resolved with. It was already\n // assembled here and surfaced on the product; what was missing was the last hop, which is why\n // `/preset` read a module global and why two products in one process shared one mutable list.\n presetRegistry: presets,\n });\n\n return {\n id: profile.id,\n ...(profile.agentName !== undefined ? { agentName: profile.agentName } : {}),\n ...(profile.version !== undefined ? { version: profile.version } : {}),\n ...(provider !== undefined ? { provider } : {}),\n providerDefinitions: profile.providerDefinitions,\n commandModules: merged.commandModules,\n tools: merged.tools,\n subagents: merged.subagents,\n acceptedPacks,\n rejectedCapabilities: rejected,\n rejectedPacks,\n presets,\n resolvePreset: (id, context) => presets.resolvePreset(id, context),\n ...(profile.defaultPresetId !== undefined ? { defaultPresetId: profile.defaultPresetId } : {}),\n ...(defaultPreset !== undefined ? { defaultPreset } : {}),\n backgroundTaskRunners: profile.backgroundTaskRunners ?? [],\n ...(profile.subagentRunnerFactory !== undefined\n ? { subagentRunnerFactory: profile.subagentRunnerFactory }\n : {}),\n ...(profile.transports !== undefined\n ? {\n transports:\n typeof profile.transports === 'function' ? profile.transports() : profile.transports,\n }\n : {}),\n buildRuntimeOptions,\n buildRuntime: (input) => buildRuntimeSession(buildRuntimeOptions(input)),\n };\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/assemble-product.ts"],"sourcesContent":["import { mergeCapabilityPacks } from './capability-pack/index.js';\nimport {\n createProviderFromConfig,\n isManagedRunProvider,\n ManagedRunUnavailableError,\n} from '@robota-sdk/agent-core';\nimport { buildRuntimeSession } from '@robota-sdk/agent-framework';\nimport { createPresetRegistry } from './preset/index.js';\n\nimport type { IAssembledProduct, IBuildRuntimeInput, IProductProfile } from './product-profile.js';\nimport type { TCompositionFieldPolicy } from './capability-pack/index.js';\nimport type {\n FunctionTool,\n IProviderDefinition,\n TProviderDefinition,\n TExecutionProvider,\n IToolWithEventService,\n TPermissionMode,\n} from '@robota-sdk/agent-core';\nimport type {\n IAgentDefinition,\n ICommandHostAdapters,\n ICommandModule,\n TInteractiveSessionOptions,\n} from '@robota-sdk/agent-framework';\nimport type { IPresetRegistry, IResolvedPresetOptions } from './preset/index.js';\n\nexport const PRODUCT_PROFILE_FIELD_POLICIES = {\n id: 'surfaced',\n agentName: 'surfaced',\n version: 'surfaced',\n providerDefinitions: 'consumed-and-surfaced',\n providerSettings: 'consumed',\n provider: 'consumed-and-surfaced',\n providerErrorGuidance: 'consumed',\n promptFileReferenceTag: 'consumed',\n modelCommandToolPrefix: 'consumed',\n subagentHookEnvironmentNames: 'consumed',\n observerFailureWarningCode: 'consumed',\n presets: 'consumed',\n presetRegistry: 'consumed-and-surfaced',\n defaultPresetId: 'consumed-and-surfaced',\n presetContext: 'consumed',\n packs: 'consumed',\n baseCommandModules: 'consumed',\n backgroundTaskRunners: 'surfaced',\n subagentRunnerFactory: 'surfaced',\n transports: 'consumed-and-surfaced',\n} as const satisfies Record<keyof IProductProfile, TCompositionFieldPolicy>;\n\n/** The product-owned materials the assembler overlays onto the shell-supplied session options. */\ninterface IOverlayMaterials {\n provider: TExecutionProvider | undefined;\n providerErrorGuidance: IProductProfile['providerErrorGuidance'];\n promptFileReferenceTag: IProductProfile['promptFileReferenceTag'];\n modelCommandToolPrefix: IProductProfile['modelCommandToolPrefix'];\n subagentHookEnvironmentNames: IProductProfile['subagentHookEnvironmentNames'];\n observerFailureWarningCode: IProductProfile['observerFailureWarningCode'];\n commandModules: readonly ICommandModule[];\n tools: readonly FunctionTool[];\n subagents: readonly IAgentDefinition[];\n defaultPermissionMode: TPermissionMode | undefined;\n /** The instance preset registry, so `/preset` discovers this product's presets. */\n presetRegistry: IPresetRegistry;\n}\n\ntype TAssembledForDefinitions<D extends TProviderDefinition, P extends TExecutionProvider> = Omit<\n IAssembledProduct<TExecutionProvider>,\n 'provider' | 'providerDefinitions'\n> & {\n provider?: ReturnType<D['createProvider']> | P;\n providerDefinitions: readonly D[];\n};\n\n/**\n * Overlay the assembled command modules, pack tools, and pack subagents onto the shell's session options.\n * The injected pre-built-session path gets command modules only (its session already owns its tools); the\n * standard construction path also receives the additive pack tools and — via the framework's\n * `agentDefinitions` injection seam (owner Decision 2) — the merged pack subagents, so a\n * pack's subagents actually reach the runtime instead of being inert material. `agentDefinitions` is left\n * UNSET when no pack contributes one, so the framework's own built-ins + discovery are unchanged.\n *\n * The default preset's `permissionMode` is applied only when the shell left it unset.\n */\nfunction overlaySessionOptions(\n base: TInteractiveSessionOptions,\n materials: IOverlayMaterials,\n): TInteractiveSessionOptions {\n if (materials.provider && isManagedRunProvider(materials.provider)) {\n throw new ManagedRunUnavailableError(materials.provider.name);\n }\n const provider = base.provider ?? materials.provider;\n if (provider && isManagedRunProvider(provider))\n throw new ManagedRunUnavailableError(provider.name);\n const providerErrorGuidance = base.providerErrorGuidance ?? materials.providerErrorGuidance;\n const promptFileReferenceTag = base.promptFileReferenceTag ?? materials.promptFileReferenceTag;\n const modelCommandToolPrefix = base.modelCommandToolPrefix ?? materials.modelCommandToolPrefix;\n const subagentHookEnvironmentNames =\n base.subagentHookEnvironmentNames ?? materials.subagentHookEnvironmentNames;\n const observerFailureWarningCode =\n base.observerFailureWarningCode ?? materials.observerFailureWarningCode;\n const permissionModeOverlay =\n base.permissionMode === undefined && materials.defaultPermissionMode !== undefined\n ? { permissionMode: materials.defaultPermissionMode }\n : {};\n // The shell may hand in a selection it has ALREADY narrowed — the configured shell applies its preset's\n // enabled/disabledCommandModules delta to the merged `base ⊕ packs` superset before calling the seam\n // (the spec's composition order: the merge widens, the preset delta narrows). Overwriting it here would\n // silently undo that narrowing, so the assembled set is overlaid only when the caller left it unset —\n // the same \"only when the shell left it unset\" rule `permissionMode` already follows.\n const commandModules = base.commandModules ?? materials.commandModules;\n // MERGED into the shell's bag, never substituted for it. The shell wires its own adapters\n // there (remote control, process, settings) and the registry stands beside them; replacing the bag\n // would silently drop capabilities this assembler knows nothing about. Both arms get it — an\n // injected session is exactly the embedded-host case the item is about.\n const commandHostAdapters: ICommandHostAdapters = {\n ...base.commandHostAdapters,\n presetRegistry: materials.presetRegistry,\n };\n\n if ('session' in base) {\n return {\n ...base,\n provider,\n ...(providerErrorGuidance !== undefined ? { providerErrorGuidance } : {}),\n ...(promptFileReferenceTag !== undefined ? { promptFileReferenceTag } : {}),\n ...(modelCommandToolPrefix !== undefined ? { modelCommandToolPrefix } : {}),\n ...(subagentHookEnvironmentNames !== undefined ? { subagentHookEnvironmentNames } : {}),\n ...(observerFailureWarningCode !== undefined ? { observerFailureWarningCode } : {}),\n commandModules,\n commandHostAdapters,\n ...permissionModeOverlay,\n };\n }\n\n if (provider === undefined) {\n throw new Error(\n 'assembleProduct: no provider available — the profile carried neither `providerSettings` nor an injected `provider`, and the session options supplied none.',\n );\n }\n\n return {\n ...base,\n provider,\n ...(providerErrorGuidance !== undefined ? { providerErrorGuidance } : {}),\n ...(promptFileReferenceTag !== undefined ? { promptFileReferenceTag } : {}),\n ...(modelCommandToolPrefix !== undefined ? { modelCommandToolPrefix } : {}),\n ...(subagentHookEnvironmentNames !== undefined ? { subagentHookEnvironmentNames } : {}),\n ...(observerFailureWarningCode !== undefined ? { observerFailureWarningCode } : {}),\n commandModules,\n commandHostAdapters,\n additionalTools: [\n ...(base.additionalTools ?? []),\n ...(materials.tools as readonly IToolWithEventService[]),\n ],\n ...(materials.subagents.length > 0 ? { agentDefinitions: materials.subagents } : {}),\n ...permissionModeOverlay,\n };\n}\n\n/**\n * The single product-composition function — a PURE, deterministic, IO-free fold over `IProductProfile`.\n *\n * `assembleProduct` is a **peer** of the repo's already-blessed pure folds (`resolvePreset`,\n * `mergeSettings`, `mergeCapabilityPacks`): it reads only its argument, calls only pure sub-folds and the\n * framework's runtime-construction seam, and hard-codes **no** product's choices — there is ZERO\n * product-specific branching (no `if (profile.id === '…')` ever). Everything product-specific arrives as\n * `profile` DATA. This property is what makes the `agent-product` carve-out from the \"no shared\n * product factory\" rule safe; its three parts (dependency-graph neutrality, purity/no-IO, no\n * product-name conditionals) are stated in this package's SPEC.md, \"The pure-fold property\".\n *\n * What it does:\n * 1. Builds a PER-CALL instance-scoped preset registry over `profile.presets` — or adopts the\n * instance the caller already built and handed in as `profile.presetRegistry`. Either way it\n * never mutates the `preset` subpath's module-level `externalPresets` global, so two products in one process do\n * not share one registry and repeat calls do not accumulate. `defaultPresetId` is resolved over that\n * registry with `profile.presetContext`, so the product's `defaultPreset` is the caller's resolution.\n * 2. Merges the additive capability packs onto `profile.baseCommandModules` via `mergeCapabilityPacks`\n * (base ⊕ packs, with a rejection channel — never a silent override).\n * 3. Constructs the provider from `profile.providerDefinitions` + the shell's already-resolved\n * `profile.providerSettings` (owner Decision 1) via agent-core's pure `createProviderFromConfig`; an\n * injected `profile.provider` overrides it.\n * 4. Produces `buildRuntimeOptions`/`buildRuntime`, which DELEGATE runtime construction to\n * `agent-framework`'s `buildRuntimeSession` seam (the SSOT for runtime assembly) — never re-implementing runtime\n * assembly — overlaying the assembled modules, pack tools, and pack subagents (`agentDefinitions`).\n *\n * Settings/args/env resolution and concrete transports/presentation stay in the shell; `assembleProduct`\n * receives already-resolved data and returns neutral materials the shell binds its own transport over.\n */\nexport function assembleProduct<\n D extends TProviderDefinition = IProviderDefinition,\n P extends TExecutionProvider = ReturnType<D['createProvider']>,\n>(\n profile: Omit<IProductProfile<TExecutionProvider>, 'providerDefinitions' | 'provider'> & {\n providerDefinitions: readonly D[];\n provider?: P;\n },\n): TAssembledForDefinitions<D, P> {\n // (1) Per-call instance-scoped preset registry — pure w.r.t. process state. A caller that had to\n // resolve a preset BEFORE it could build this profile (a preset can carry the `model`/`agentName` the\n // profile is constructed from) hands its own instance in as `presetRegistry`; the assembler then uses\n // THAT one rather than building a second, equivalent registry, so there is exactly one resolution path.\n // Either way the registry is instance-scoped — no module-level state is read or mutated.\n const presets = profile.presetRegistry ?? createPresetRegistry(profile.presets ?? []);\n const defaultPreset: IResolvedPresetOptions | undefined =\n profile.defaultPresetId !== undefined\n ? presets.resolvePreset(profile.defaultPresetId, profile.presetContext)\n : undefined;\n\n // (2) Additive capability merge — base ⊕ packs, deterministic, with a rejection channel.\n const { merged, acceptedPacks, rejected, rejectedPacks } = mergeCapabilityPacks(\n profile.baseCommandModules ?? [],\n profile.packs ?? [],\n );\n\n // (3) Provider construction — IN-KERNEL, from the profile's definitions + the shell's ALREADY-RESOLVED\n // settings (owner Decision 1). `createProviderFromConfig` is a pure `config → IAIProvider` factory that\n // lives in `@robota-sdk/agent-core`, an ALLOWED dependency layer,\n // so this reads no fs/env and the fold stays pure. An injected `profile.provider` wins (advanced/test\n // override, e.g. `--session-log` replay); with neither, no provider is constructed and the consumer\n // supplies one in the `buildRuntime` session options (the Mode A shape).\n const provider =\n profile.provider ??\n (profile.providerSettings !== undefined\n ? createProviderFromConfig(profile.providerSettings, profile.providerDefinitions)\n : undefined);\n\n // (4) The runtime-construction delegate — DELEGATES to the framework seam, never re-implements.\n const buildRuntimeOptions = (input: IBuildRuntimeInput): TInteractiveSessionOptions =>\n overlaySessionOptions(input.session, {\n provider,\n providerErrorGuidance: profile.providerErrorGuidance,\n promptFileReferenceTag: profile.promptFileReferenceTag,\n modelCommandToolPrefix: profile.modelCommandToolPrefix,\n subagentHookEnvironmentNames: profile.subagentHookEnvironmentNames,\n observerFailureWarningCode: profile.observerFailureWarningCode,\n commandModules: merged.commandModules,\n tools: merged.tools,\n subagents: merged.subagents,\n defaultPermissionMode: defaultPreset?.permissionMode,\n // The instance registry reaches the SESSION through the host-adapter bag, so\n // `/preset` discovers through the same presets this product resolved with. It was already\n // assembled here and surfaced on the product; what was missing was the last hop, which is why\n // `/preset` read a module global and why two products in one process shared one mutable list.\n presetRegistry: presets,\n });\n\n return {\n id: profile.id,\n ...(profile.agentName !== undefined ? { agentName: profile.agentName } : {}),\n ...(profile.version !== undefined ? { version: profile.version } : {}),\n ...(provider !== undefined ? { provider } : {}),\n providerDefinitions: profile.providerDefinitions,\n commandModules: merged.commandModules,\n tools: merged.tools,\n subagents: merged.subagents,\n acceptedPacks,\n rejectedCapabilities: rejected,\n rejectedPacks,\n presets,\n resolvePreset: (id, context) => presets.resolvePreset(id, context),\n ...(profile.defaultPresetId !== undefined ? { defaultPresetId: profile.defaultPresetId } : {}),\n ...(defaultPreset !== undefined ? { defaultPreset } : {}),\n backgroundTaskRunners: profile.backgroundTaskRunners ?? [],\n ...(profile.subagentRunnerFactory !== undefined\n ? { subagentRunnerFactory: profile.subagentRunnerFactory }\n : {}),\n ...(profile.transports !== undefined\n ? {\n transports:\n typeof profile.transports === 'function' ? profile.transports() : profile.transports,\n }\n : {}),\n buildRuntimeOptions,\n buildRuntime: (input) => buildRuntimeSession(buildRuntimeOptions(input)),\n };\n}\n"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- import { IFileSystem, IProviderDefinition } from "@robota-sdk/agent-core";
1
+ import { IFileSystem, TProviderDefinition } from "@robota-sdk/agent-core";
2
2
  import { ICommandHostTerminalHandoff, ICommandHostWorkspace, ICommandMCPActivationAdapter, ICommandModule, IContributionSource, ISkillRootDescriptor, TSettingsData, TSettingsSource, TWorkspaceProjectAccess } from "@robota-sdk/agent-framework";
3
3
  import { ICommand, ICommandResult, ICommandSource } from "@robota-sdk/agent-interface/command";
4
4
  //#region src/command/doctor/doctor-types.d.ts
@@ -53,7 +53,7 @@ interface IDoctorInputs {
53
53
  /** Every settings source the runtime merge chain reads, in precedence order. */
54
54
  readonly settingsSources: readonly TSettingsSource[];
55
55
  readonly projectAccess: TWorkspaceProjectAccess;
56
- readonly providerDefinitions: readonly IProviderDefinition[];
56
+ readonly providerDefinitions: readonly TProviderDefinition[];
57
57
  /** Optional host wording for remediation; omitted values use product-neutral guidance. */
58
58
  readonly diagnosticGuidance?: {
59
59
  readonly providerResolution?: string;
@@ -123,4 +123,4 @@ declare class KeybindingsCommandSource implements ICommandSource {
123
123
  declare function createKeybindingsCommandModule(file: IKeybindingsFilePort | undefined, openInEditor?: TOpenFileInEditor): ICommandModule;
124
124
  //#endregion
125
125
  export { createKeybindingsCommandModule as a, IDoctorEndpointProbeResult as c, IDoctorReport as d, TDoctorCheckStatus as f, createKeybindingsCommandEntry as i, IDoctorInputs as l, KeybindingsCommandSource as n, IDoctorCheck as o, TDoctorNotProbed as p, TOpenFileInEditor as r, IDoctorDeps as s, IKeybindingsFilePort as t, IDoctorPathFacts as u };
126
- //# sourceMappingURL=keybindings-command-module-CcA9-Xqi.d.cts.map
126
+ //# sourceMappingURL=keybindings-command-module-DuL6bSYI.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keybindings-command-module-CcA9-Xqi.d.cts","names":[],"sources":["../src/command/doctor/doctor-types.ts","../src/command/keybindings/keybindings-command-module.ts"],"mappings":";;;;KAmBY;;KAGA;UAEK;;WAEN;WACA;WACA,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAGM;WACN,iBAAiB;WACjB;WACA;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;;;UAIM;WACN;WACA;;;;;WAKA;;WAEA;aAAwB;aAAuB;;;WAE/C;;WAEA,0BAA0B;WAC1B,eAAe;WACf,8BAA8B;;WAE9B;aACE;aACA;;;WAGF,KAAK,SAAS;WACd,8BAA8B;WAC9B,qBAAqB;;WAErB;;WAEA,gBAAgB;;WAEhB,qBAAqB;;WAErB,qBAAqB;;;UAIf;WACN;WACA;WACA;;WAEA;;;;;;;UAQM;WACN,gBAAgB,cAAc,iBAAiB,QAAQ;WACvD,cAAc,iBAAiB;;WAE/B,iBAAiB;;WAEjB;;WAEA,OAAO;;;;;WAKP,2BACP,mBACA;aAAoB;;;WAGb,gBAAgB,cAAc,UAAU;;;;UCpHlC;EACf,cAAc;;;;;;;KAQJ,qBAAqB,cAAc,gBAAgB;iBAE/C,iCAAiC;cAyCpC,oCAAoC;WACtC;EAET,eAAe;;iBAKD,+BACd,MAAM,kCACN,eAAe,oBACd"}
1
+ {"version":3,"file":"keybindings-command-module-DuL6bSYI.d.cts","names":[],"sources":["../src/command/doctor/doctor-types.ts","../src/command/keybindings/keybindings-command-module.ts"],"mappings":";;;;KAmBY;;KAGA;UAEK;;WAEN;WACA;WACA,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAGM;WACN,iBAAiB;WACjB;WACA;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;;;UAIM;WACN;WACA;;;;;WAKA;;WAEA;aAAwB;aAAuB;;;WAE/C;;WAEA,0BAA0B;WAC1B,eAAe;WACf,8BAA8B;;WAE9B;aACE;aACA;;;WAGF,KAAK,SAAS;WACd,8BAA8B;WAC9B,qBAAqB;;WAErB;;WAEA,gBAAgB;;WAEhB,qBAAqB;;WAErB,qBAAqB;;;UAIf;WACN;WACA;WACA;;WAEA;;;;;;;UAQM;WACN,gBAAgB,cAAc,iBAAiB,QAAQ;WACvD,cAAc,iBAAiB;;WAE/B,iBAAiB;;WAEjB;;WAEA,OAAO;;;;;WAKP,2BACP,mBACA;aAAoB;;;WAGb,gBAAgB,cAAc,UAAU;;;;UCpHlC;EACf,cAAc;;;;;;;KAQJ,qBAAqB,cAAc,gBAAgB;iBAE/C,iCAAiC;cAyCpC,oCAAoC;WACtC;EAET,eAAe;;iBAKD,+BACd,MAAM,kCACN,eAAe,oBACd"}
@@ -1,4 +1,4 @@
1
- import { IFileSystem, IProviderDefinition } from "@robota-sdk/agent-core";
1
+ import { IFileSystem, TProviderDefinition } from "@robota-sdk/agent-core";
2
2
  import { ICommandHostTerminalHandoff, ICommandHostWorkspace, ICommandMCPActivationAdapter, ICommandModule, IContributionSource, ISkillRootDescriptor, TSettingsData, TSettingsSource, TWorkspaceProjectAccess } from "@robota-sdk/agent-framework";
3
3
  import { ICommand, ICommandResult, ICommandSource } from "@robota-sdk/agent-interface/command";
4
4
  //#region src/command/doctor/doctor-types.d.ts
@@ -53,7 +53,7 @@ interface IDoctorInputs {
53
53
  /** Every settings source the runtime merge chain reads, in precedence order. */
54
54
  readonly settingsSources: readonly TSettingsSource[];
55
55
  readonly projectAccess: TWorkspaceProjectAccess;
56
- readonly providerDefinitions: readonly IProviderDefinition[];
56
+ readonly providerDefinitions: readonly TProviderDefinition[];
57
57
  /** Optional host wording for remediation; omitted values use product-neutral guidance. */
58
58
  readonly diagnosticGuidance?: {
59
59
  readonly providerResolution?: string;
@@ -123,4 +123,4 @@ declare class KeybindingsCommandSource implements ICommandSource {
123
123
  declare function createKeybindingsCommandModule(file: IKeybindingsFilePort | undefined, openInEditor?: TOpenFileInEditor): ICommandModule;
124
124
  //#endregion
125
125
  export { createKeybindingsCommandModule as a, IDoctorEndpointProbeResult as c, IDoctorReport as d, TDoctorCheckStatus as f, createKeybindingsCommandEntry as i, IDoctorInputs as l, KeybindingsCommandSource as n, IDoctorCheck as o, TDoctorNotProbed as p, TOpenFileInEditor as r, IDoctorDeps as s, IKeybindingsFilePort as t, IDoctorPathFacts as u };
126
- //# sourceMappingURL=keybindings-command-module-CcA9-Xqi.d.ts.map
126
+ //# sourceMappingURL=keybindings-command-module-DuL6bSYI.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keybindings-command-module-CcA9-Xqi.d.ts","names":[],"sources":["../src/command/doctor/doctor-types.ts","../src/command/keybindings/keybindings-command-module.ts"],"mappings":";;;;KAmBY;;KAGA;UAEK;;WAEN;WACA;WACA,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAGM;WACN,iBAAiB;WACjB;WACA;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;;;UAIM;WACN;WACA;;;;;WAKA;;WAEA;aAAwB;aAAuB;;;WAE/C;;WAEA,0BAA0B;WAC1B,eAAe;WACf,8BAA8B;;WAE9B;aACE;aACA;;;WAGF,KAAK,SAAS;WACd,8BAA8B;WAC9B,qBAAqB;;WAErB;;WAEA,gBAAgB;;WAEhB,qBAAqB;;WAErB,qBAAqB;;;UAIf;WACN;WACA;WACA;;WAEA;;;;;;;UAQM;WACN,gBAAgB,cAAc,iBAAiB,QAAQ;WACvD,cAAc,iBAAiB;;WAE/B,iBAAiB;;WAEjB;;WAEA,OAAO;;;;;WAKP,2BACP,mBACA;aAAoB;;;WAGb,gBAAgB,cAAc,UAAU;;;;UCpHlC;EACf,cAAc;;;;;;;KAQJ,qBAAqB,cAAc,gBAAgB;iBAE/C,iCAAiC;cAyCpC,oCAAoC;WACtC;EAET,eAAe;;iBAKD,+BACd,MAAM,kCACN,eAAe,oBACd"}
1
+ {"version":3,"file":"keybindings-command-module-DuL6bSYI.d.ts","names":[],"sources":["../src/command/doctor/doctor-types.ts","../src/command/keybindings/keybindings-command-module.ts"],"mappings":";;;;KAmBY;;KAGA;UAEK;;WAEN;WACA;WACA,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;UAGM;WACN,iBAAiB;WACjB;WACA;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;;;UAIM;WACN;WACA;;;;;WAKA;;WAEA;aAAwB;aAAuB;;;WAE/C;;WAEA,0BAA0B;WAC1B,eAAe;WACf,8BAA8B;;WAE9B;aACE;aACA;;;WAGF,KAAK,SAAS;WACd,8BAA8B;WAC9B,qBAAqB;;WAErB;;WAEA,gBAAgB;;WAEhB,qBAAqB;;WAErB,qBAAqB;;;UAIf;WACN;WACA;WACA;;WAEA;;;;;;;UAQM;WACN,gBAAgB,cAAc,iBAAiB,QAAQ;WACvD,cAAc,iBAAiB;;WAE/B,iBAAiB;;WAEjB;;WAEA,OAAO;;;;;WAKP,2BACP,mBACA;aAAoB;;;WAGb,gBAAgB,cAAc,UAAU;;;;UCpHlC;EACf,cAAc;;;;;;;KAQJ,qBAAqB,cAAc,gBAAgB;iBAE/C,iCAAiC;cAyCpC,oCAAoC;WACtC;EAET,eAAe;;iBAKD,+BACd,MAAM,kCACN,eAAe,oBACd"}