@spotpatch/dev-server 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -322,12 +322,20 @@ interface CreateConfiguredKeyAskExecutorsOptions {
|
|
|
322
322
|
/** Builds one isolated read-only Ask executor per configured Provider/model pair. */
|
|
323
323
|
declare function createConfiguredKeyAskExecutors(options: CreateConfiguredKeyAskExecutorsOptions): readonly ContextualAskExecutor[];
|
|
324
324
|
|
|
325
|
+
/** Executors that drive a locally installed Agent CLI instead of an API key. */
|
|
326
|
+
interface ManagedAskExecutors {
|
|
327
|
+
readonly codex: ContextualAskExecutor;
|
|
328
|
+
readonly claudeCode: ContextualAskExecutor;
|
|
329
|
+
}
|
|
325
330
|
interface ComposeContextualAskExecutorsOptions {
|
|
326
331
|
readonly configuredKey: readonly ContextualAskExecutor[];
|
|
327
|
-
readonly
|
|
332
|
+
readonly managed: ManagedAskExecutors;
|
|
328
333
|
readonly defaultExecutor?: ContextualAskExecutorPreference;
|
|
329
334
|
}
|
|
330
|
-
/**
|
|
335
|
+
/**
|
|
336
|
+
* Orders independent executor implementations without coupling dev-server to
|
|
337
|
+
* any Agent. The preferred kind comes first; otherwise configured keys lead.
|
|
338
|
+
*/
|
|
331
339
|
declare function composeContextualAskExecutors(options: ComposeContextualAskExecutorsOptions): readonly ContextualAskExecutor[];
|
|
332
340
|
|
|
333
341
|
interface SpotPatchSession {
|
|
@@ -438,7 +446,7 @@ interface DevelopmentSessionInput extends Omit<CreateMiddlewareOptions, "agentMa
|
|
|
438
446
|
readonly resolveSourceImports?: CreateContextualAskManagerOptions["resolveSourceImports"];
|
|
439
447
|
readonly environment: Readonly<Record<string, string | undefined>>;
|
|
440
448
|
readonly executionRoot?: string;
|
|
441
|
-
readonly
|
|
449
|
+
readonly createManagedAskExecutors: () => ManagedAskExecutors;
|
|
442
450
|
readonly createExternalAgentControl: (validation: ResolvedManagedExecutionValidation) => Promise<ExternalAgentControlPort>;
|
|
443
451
|
readonly resolveValidation?: () => Promise<ResolvedManagedExecutionValidation>;
|
|
444
452
|
}
|
|
@@ -449,4 +457,4 @@ interface DevelopmentSession {
|
|
|
449
457
|
/** Owns feature services, not HTTP listeners or framework-specific transports. */
|
|
450
458
|
declare function createDevelopmentSession(input: DevelopmentSessionInput): Promise<DevelopmentSession>;
|
|
451
459
|
|
|
452
|
-
export { type AgentJobEventListener, type AgentJobManager, type CaptureAskReadSnapshotOptions, type CapturedAskReadSnapshot, type ComposeContextualAskExecutorsOptions, ContextualAskError, type ContextualAskJobEventListener, type ContextualAskManager, type ContextualAskRoute, type CreateAgentJobManagerOptions, type CreateConfiguredKeyAskExecutorsOptions, type CreateContextualAskManagerOptions, type CreateExternalHandoffServiceOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DevelopmentSession, type DevelopmentSessionInput, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, type ExternalAgentControlPort, type ExternalHandoffService, type FilterEntry, type IntegrationFileChange, type IntegrationPlan, type ResolveManagedExecutionValidationOptions, type ResolveProjectOptionsInput, type ResolveProjectValidationChecksOptions, type ResolvedContextualAskOptions, type ResolvedManagedExecutionValidation, type ResolvedRuntimeBootstrapOptions, type ResolvedSpotPatchDataFlowOptions, type ResolvedSpotPatchOptions, type RuntimeBootstrapOptions, type SerializedFilterEntry, type SerializedSpotPatchOptions, type SimpleAiOptions, type SourceRegistrationHandler, type SourceRegistrationService, type SourceRegistrationServiceOptions, type SourceRegistry, type SpotPatchAiOptions, type SpotPatchDataFlowOptions, type SpotPatchMiddleware, type SpotPatchNext, type SpotPatchOptions, type SpotPatchServerLogger, type SpotPatchSession, type WorkspaceActivityCoordinator, type WorkspaceActivityKind, type WorkspaceActivityLease, applyIntegrationPlan, captureAskReadSnapshot, composeContextualAskExecutors, createAgentJobManager, createConfiguredKeyAskExecutors, createContextualAskManager, createDevelopmentSession, createExternalHandoffService, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, createWorkspaceActivityCoordinator, discoverProjectValidationCheck, handleContextualAskRequest, integrationPathExists, isLoopbackHostname, matchContextualAskPath, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveManagedExecutionValidation, resolveOptions, resolveProjectOptions, resolveProjectValidationChecks, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
|
460
|
+
export { type AgentJobEventListener, type AgentJobManager, type CaptureAskReadSnapshotOptions, type CapturedAskReadSnapshot, type ComposeContextualAskExecutorsOptions, ContextualAskError, type ContextualAskJobEventListener, type ContextualAskManager, type ContextualAskRoute, type CreateAgentJobManagerOptions, type CreateConfiguredKeyAskExecutorsOptions, type CreateContextualAskManagerOptions, type CreateExternalHandoffServiceOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DevelopmentSession, type DevelopmentSessionInput, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, type ExternalAgentControlPort, type ExternalHandoffService, type FilterEntry, type IntegrationFileChange, type IntegrationPlan, type ManagedAskExecutors, type ResolveManagedExecutionValidationOptions, type ResolveProjectOptionsInput, type ResolveProjectValidationChecksOptions, type ResolvedContextualAskOptions, type ResolvedManagedExecutionValidation, type ResolvedRuntimeBootstrapOptions, type ResolvedSpotPatchDataFlowOptions, type ResolvedSpotPatchOptions, type RuntimeBootstrapOptions, type SerializedFilterEntry, type SerializedSpotPatchOptions, type SimpleAiOptions, type SourceRegistrationHandler, type SourceRegistrationService, type SourceRegistrationServiceOptions, type SourceRegistry, type SpotPatchAiOptions, type SpotPatchDataFlowOptions, type SpotPatchMiddleware, type SpotPatchNext, type SpotPatchOptions, type SpotPatchServerLogger, type SpotPatchSession, type WorkspaceActivityCoordinator, type WorkspaceActivityKind, type WorkspaceActivityLease, applyIntegrationPlan, captureAskReadSnapshot, composeContextualAskExecutors, createAgentJobManager, createConfiguredKeyAskExecutors, createContextualAskManager, createDevelopmentSession, createExternalHandoffService, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, createWorkspaceActivityCoordinator, discoverProjectValidationCheck, handleContextualAskRequest, integrationPathExists, isLoopbackHostname, matchContextualAskPath, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveManagedExecutionValidation, resolveOptions, resolveProjectOptions, resolveProjectValidationChecks, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -322,12 +322,20 @@ interface CreateConfiguredKeyAskExecutorsOptions {
|
|
|
322
322
|
/** Builds one isolated read-only Ask executor per configured Provider/model pair. */
|
|
323
323
|
declare function createConfiguredKeyAskExecutors(options: CreateConfiguredKeyAskExecutorsOptions): readonly ContextualAskExecutor[];
|
|
324
324
|
|
|
325
|
+
/** Executors that drive a locally installed Agent CLI instead of an API key. */
|
|
326
|
+
interface ManagedAskExecutors {
|
|
327
|
+
readonly codex: ContextualAskExecutor;
|
|
328
|
+
readonly claudeCode: ContextualAskExecutor;
|
|
329
|
+
}
|
|
325
330
|
interface ComposeContextualAskExecutorsOptions {
|
|
326
331
|
readonly configuredKey: readonly ContextualAskExecutor[];
|
|
327
|
-
readonly
|
|
332
|
+
readonly managed: ManagedAskExecutors;
|
|
328
333
|
readonly defaultExecutor?: ContextualAskExecutorPreference;
|
|
329
334
|
}
|
|
330
|
-
/**
|
|
335
|
+
/**
|
|
336
|
+
* Orders independent executor implementations without coupling dev-server to
|
|
337
|
+
* any Agent. The preferred kind comes first; otherwise configured keys lead.
|
|
338
|
+
*/
|
|
331
339
|
declare function composeContextualAskExecutors(options: ComposeContextualAskExecutorsOptions): readonly ContextualAskExecutor[];
|
|
332
340
|
|
|
333
341
|
interface SpotPatchSession {
|
|
@@ -438,7 +446,7 @@ interface DevelopmentSessionInput extends Omit<CreateMiddlewareOptions, "agentMa
|
|
|
438
446
|
readonly resolveSourceImports?: CreateContextualAskManagerOptions["resolveSourceImports"];
|
|
439
447
|
readonly environment: Readonly<Record<string, string | undefined>>;
|
|
440
448
|
readonly executionRoot?: string;
|
|
441
|
-
readonly
|
|
449
|
+
readonly createManagedAskExecutors: () => ManagedAskExecutors;
|
|
442
450
|
readonly createExternalAgentControl: (validation: ResolvedManagedExecutionValidation) => Promise<ExternalAgentControlPort>;
|
|
443
451
|
readonly resolveValidation?: () => Promise<ResolvedManagedExecutionValidation>;
|
|
444
452
|
}
|
|
@@ -449,4 +457,4 @@ interface DevelopmentSession {
|
|
|
449
457
|
/** Owns feature services, not HTTP listeners or framework-specific transports. */
|
|
450
458
|
declare function createDevelopmentSession(input: DevelopmentSessionInput): Promise<DevelopmentSession>;
|
|
451
459
|
|
|
452
|
-
export { type AgentJobEventListener, type AgentJobManager, type CaptureAskReadSnapshotOptions, type CapturedAskReadSnapshot, type ComposeContextualAskExecutorsOptions, ContextualAskError, type ContextualAskJobEventListener, type ContextualAskManager, type ContextualAskRoute, type CreateAgentJobManagerOptions, type CreateConfiguredKeyAskExecutorsOptions, type CreateContextualAskManagerOptions, type CreateExternalHandoffServiceOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DevelopmentSession, type DevelopmentSessionInput, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, type ExternalAgentControlPort, type ExternalHandoffService, type FilterEntry, type IntegrationFileChange, type IntegrationPlan, type ResolveManagedExecutionValidationOptions, type ResolveProjectOptionsInput, type ResolveProjectValidationChecksOptions, type ResolvedContextualAskOptions, type ResolvedManagedExecutionValidation, type ResolvedRuntimeBootstrapOptions, type ResolvedSpotPatchDataFlowOptions, type ResolvedSpotPatchOptions, type RuntimeBootstrapOptions, type SerializedFilterEntry, type SerializedSpotPatchOptions, type SimpleAiOptions, type SourceRegistrationHandler, type SourceRegistrationService, type SourceRegistrationServiceOptions, type SourceRegistry, type SpotPatchAiOptions, type SpotPatchDataFlowOptions, type SpotPatchMiddleware, type SpotPatchNext, type SpotPatchOptions, type SpotPatchServerLogger, type SpotPatchSession, type WorkspaceActivityCoordinator, type WorkspaceActivityKind, type WorkspaceActivityLease, applyIntegrationPlan, captureAskReadSnapshot, composeContextualAskExecutors, createAgentJobManager, createConfiguredKeyAskExecutors, createContextualAskManager, createDevelopmentSession, createExternalHandoffService, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, createWorkspaceActivityCoordinator, discoverProjectValidationCheck, handleContextualAskRequest, integrationPathExists, isLoopbackHostname, matchContextualAskPath, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveManagedExecutionValidation, resolveOptions, resolveProjectOptions, resolveProjectValidationChecks, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
|
460
|
+
export { type AgentJobEventListener, type AgentJobManager, type CaptureAskReadSnapshotOptions, type CapturedAskReadSnapshot, type ComposeContextualAskExecutorsOptions, ContextualAskError, type ContextualAskJobEventListener, type ContextualAskManager, type ContextualAskRoute, type CreateAgentJobManagerOptions, type CreateConfiguredKeyAskExecutorsOptions, type CreateContextualAskManagerOptions, type CreateExternalHandoffServiceOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DevelopmentSession, type DevelopmentSessionInput, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, type ExternalAgentControlPort, type ExternalHandoffService, type FilterEntry, type IntegrationFileChange, type IntegrationPlan, type ManagedAskExecutors, type ResolveManagedExecutionValidationOptions, type ResolveProjectOptionsInput, type ResolveProjectValidationChecksOptions, type ResolvedContextualAskOptions, type ResolvedManagedExecutionValidation, type ResolvedRuntimeBootstrapOptions, type ResolvedSpotPatchDataFlowOptions, type ResolvedSpotPatchOptions, type RuntimeBootstrapOptions, type SerializedFilterEntry, type SerializedSpotPatchOptions, type SimpleAiOptions, type SourceRegistrationHandler, type SourceRegistrationService, type SourceRegistrationServiceOptions, type SourceRegistry, type SpotPatchAiOptions, type SpotPatchDataFlowOptions, type SpotPatchMiddleware, type SpotPatchNext, type SpotPatchOptions, type SpotPatchServerLogger, type SpotPatchSession, type WorkspaceActivityCoordinator, type WorkspaceActivityKind, type WorkspaceActivityLease, applyIntegrationPlan, captureAskReadSnapshot, composeContextualAskExecutors, createAgentJobManager, createConfiguredKeyAskExecutors, createContextualAskManager, createDevelopmentSession, createExternalHandoffService, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, createWorkspaceActivityCoordinator, discoverProjectValidationCheck, handleContextualAskRequest, integrationPathExists, isLoopbackHostname, matchContextualAskPath, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveManagedExecutionValidation, resolveOptions, resolveProjectOptions, resolveProjectValidationChecks, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
package/dist/index.js
CHANGED
|
@@ -2699,7 +2699,9 @@ function confidence(value) {
|
|
|
2699
2699
|
async function authorizeSeeds(selection, registry, root, realRoot) {
|
|
2700
2700
|
const byPath = /* @__PURE__ */ new Map();
|
|
2701
2701
|
for (const target of selection.targets) {
|
|
2702
|
-
|
|
2702
|
+
const location = target.react.source?.fileId === void 0 ? target.source : target.react.source;
|
|
2703
|
+
let fileId = location.fileId;
|
|
2704
|
+
let claimedRelative = location.relativePath;
|
|
2703
2705
|
let sourceVersion;
|
|
2704
2706
|
if (target.react.componentSourceId !== void 0) {
|
|
2705
2707
|
const anchor = registry.resolveDataFlowComponent(target.react.componentSourceId);
|
|
@@ -2707,6 +2709,7 @@ async function authorizeSeeds(selection, registry, root, realRoot) {
|
|
|
2707
2709
|
deny("ASK_SELECTION_STALE");
|
|
2708
2710
|
}
|
|
2709
2711
|
fileId = anchor.fileId;
|
|
2712
|
+
claimedRelative = void 0;
|
|
2710
2713
|
sourceVersion = anchor.sourceVersion;
|
|
2711
2714
|
}
|
|
2712
2715
|
if (fileId === void 0) continue;
|
|
@@ -2716,7 +2719,6 @@ async function authorizeSeeds(selection, registry, root, realRoot) {
|
|
|
2716
2719
|
if (canonical === void 0) deny("ASK_SELECTION_STALE");
|
|
2717
2720
|
const absolutePath = path5.normalize(canonical);
|
|
2718
2721
|
const registeredRelative = toPosixRelative(realRoot, absolutePath);
|
|
2719
|
-
const claimedRelative = target.react.source?.relativePath ?? target.source.relativePath;
|
|
2720
2722
|
if (claimedRelative !== void 0 && claimedRelative.split("\\").join("/") !== registeredRelative) {
|
|
2721
2723
|
deny("ASK_SELECTION_STALE");
|
|
2722
2724
|
}
|
|
@@ -3637,8 +3639,10 @@ function createConfiguredKeyAskExecutors(options) {
|
|
|
3637
3639
|
|
|
3638
3640
|
// src/contextual-ask/executors.ts
|
|
3639
3641
|
function composeContextualAskExecutors(options) {
|
|
3642
|
+
const { codex, claudeCode } = options.managed;
|
|
3643
|
+
const preference = options.defaultExecutor?.kind;
|
|
3640
3644
|
return Object.freeze(
|
|
3641
|
-
|
|
3645
|
+
preference === "managed-codex" ? [codex, claudeCode, ...options.configuredKey] : preference === "claude-code" ? [claudeCode, codex, ...options.configuredKey] : [...options.configuredKey, codex, claudeCode]
|
|
3642
3646
|
);
|
|
3643
3647
|
}
|
|
3644
3648
|
|
|
@@ -5905,9 +5909,9 @@ function parseContextualAsk(value) {
|
|
|
5905
5909
|
throw new TypeError("The SpotPatch contextual Ask transport is invalid.");
|
|
5906
5910
|
}
|
|
5907
5911
|
const preference = value.defaultExecutor;
|
|
5908
|
-
if (preference.kind === "managed-codex" && hasExactKeys(preference, ["kind"])) {
|
|
5912
|
+
if ((preference.kind === "managed-codex" || preference.kind === "claude-code") && hasExactKeys(preference, ["kind"])) {
|
|
5909
5913
|
return Object.freeze({
|
|
5910
|
-
defaultExecutor: Object.freeze({ kind:
|
|
5914
|
+
defaultExecutor: Object.freeze({ kind: preference.kind })
|
|
5911
5915
|
});
|
|
5912
5916
|
}
|
|
5913
5917
|
if (preference.kind === "configured-key" && hasExactKeys(preference, ["kind", "modelProfileId", "providerProfileId"]) && typeof preference.providerProfileId === "string" && typeof preference.modelProfileId === "string") {
|
|
@@ -5999,7 +6003,7 @@ async function createDevelopmentSession(input) {
|
|
|
5999
6003
|
environment: input.environment,
|
|
6000
6004
|
...preference
|
|
6001
6005
|
}),
|
|
6002
|
-
|
|
6006
|
+
managed: input.createManagedAskExecutors(),
|
|
6003
6007
|
...preference
|
|
6004
6008
|
})
|
|
6005
6009
|
});
|