@spotpatch/dev-server 0.6.0 → 0.7.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 +429 -244
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -3
- package/dist/index.d.ts +30 -3
- package/dist/index.js +388 -189
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { applyPreparedAgentChange, executeAgentChange, inspectAgentWorkspace, probeProviderCapability, resolveProviderCredential, revertPreparedAgentChange } from '@spotpatch/agent';
|
|
2
|
-
import { AgentJobEvent, AgentJobSnapshot, AgentJobCreateRequest, AgentCapabilityRequest, AgentCapabilitySnapshot, AgentJobResultResponse, AgentWorkspaceHealthSnapshot, ResolvedAiOptions, ExternalHandoffFramework, ExternalHandoffCapability, ExternalHandoffPublishRequest, SpotAnnotation, ExternalHandoffPublishResult, ExternalHandoffStatusResult, SpotPatchEditorPreference, ContextBudget, SpotPatchLocalePreference, DataFlowLimits, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, RuntimeDataFlowConfig, ResolvedAgentCheckDefinition, SpotPatchRuntimeConfig } from '@spotpatch/shared';
|
|
2
|
+
import { AgentJobEvent, AgentJobSnapshot, AgentJobCreateRequest, AgentCapabilityRequest, AgentCapabilitySnapshot, AgentJobResultResponse, AgentWorkspaceHealthSnapshot, ResolvedAiOptions, ExternalHandoffFramework, ExternalHandoffCapability, ExternalHandoffPublishRequest, SpotAnnotation, ExternalHandoffPublishResult, ExternalHandoffStatusResult, ExternalAgentControlStatus, ExternalAgentControlConnectRequest, ExternalAgentControlDisconnectRequest, ExternalAgentControlCancelRequest, ExternalAgentManagedResult, SpotPatchEditorPreference, ContextBudget, SpotPatchLocalePreference, DataFlowLimits, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, RuntimeDataFlowConfig, ResolvedAgentCheckDefinition, AgentLimits, SpotPatchRuntimeConfig } from '@spotpatch/shared';
|
|
3
3
|
import { SourceFilterEntry } from '@spotpatch/compiler';
|
|
4
4
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
5
|
|
|
@@ -51,6 +51,16 @@ interface CreateExternalHandoffServiceOptions {
|
|
|
51
51
|
}
|
|
52
52
|
declare function createExternalHandoffService(options: CreateExternalHandoffServiceOptions): ExternalHandoffService;
|
|
53
53
|
|
|
54
|
+
interface ExternalAgentControlPort {
|
|
55
|
+
getStatus(): ExternalAgentControlStatus;
|
|
56
|
+
connect(request: ExternalAgentControlConnectRequest, signal: AbortSignal): Promise<ExternalAgentControlStatus>;
|
|
57
|
+
disconnect(request: ExternalAgentControlDisconnectRequest): Promise<ExternalAgentControlStatus>;
|
|
58
|
+
cancel(request: ExternalAgentControlCancelRequest): Promise<ExternalAgentControlStatus>;
|
|
59
|
+
getResult(revision: number): ExternalAgentManagedResult | undefined;
|
|
60
|
+
subscribe(listener: (status: ExternalAgentControlStatus) => void): () => void;
|
|
61
|
+
dispose(): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
54
64
|
type FilterEntry = SourceFilterEntry;
|
|
55
65
|
interface SimpleAiOptions {
|
|
56
66
|
readonly baseURL: string;
|
|
@@ -187,7 +197,20 @@ interface DiscoverProjectValidationCheckOptions {
|
|
|
187
197
|
readonly appRoot: string;
|
|
188
198
|
readonly timeoutMs: number;
|
|
189
199
|
}
|
|
200
|
+
interface ResolveProjectValidationChecksOptions extends DiscoverProjectValidationCheckOptions {
|
|
201
|
+
readonly checks: Readonly<Record<string, ResolvedAgentCheckDefinition>>;
|
|
202
|
+
}
|
|
203
|
+
interface ResolveManagedExecutionValidationOptions {
|
|
204
|
+
readonly ai: false | ResolvedAiOptions;
|
|
205
|
+
readonly appRoot: string;
|
|
206
|
+
}
|
|
207
|
+
interface ResolvedManagedExecutionValidation {
|
|
208
|
+
readonly checks: Readonly<Record<string, ResolvedAgentCheckDefinition>>;
|
|
209
|
+
readonly limits: Readonly<AgentLimits>;
|
|
210
|
+
}
|
|
190
211
|
declare function discoverProjectValidationCheck(options: DiscoverProjectValidationCheckOptions): Promise<ResolvedAgentCheckDefinition | undefined>;
|
|
212
|
+
declare function resolveProjectValidationChecks(options: ResolveProjectValidationChecksOptions): Promise<Readonly<Record<string, ResolvedAgentCheckDefinition>>>;
|
|
213
|
+
declare function resolveManagedExecutionValidation(options: ResolveManagedExecutionValidationOptions): Promise<ResolvedManagedExecutionValidation>;
|
|
191
214
|
|
|
192
215
|
type SourceIdFactory = () => string;
|
|
193
216
|
|
|
@@ -232,7 +255,10 @@ declare function resolveRuntimeBootstrapOptions(options: RuntimeBootstrapOptions
|
|
|
232
255
|
declare function readRuntimeBootstrap(request: IncomingMessage, options: ResolvedRuntimeBootstrapOptions): Promise<SpotPatchRuntimeConfig>;
|
|
233
256
|
|
|
234
257
|
type SpotPatchNext = (error?: unknown) => void;
|
|
235
|
-
|
|
258
|
+
interface SpotPatchMiddleware {
|
|
259
|
+
(request: IncomingMessage, response: ServerResponse, next: SpotPatchNext): void;
|
|
260
|
+
dispose(): void;
|
|
261
|
+
}
|
|
236
262
|
interface SpotPatchServerLogger {
|
|
237
263
|
warn(message: string): void;
|
|
238
264
|
}
|
|
@@ -240,6 +266,7 @@ interface CreateMiddlewareOptions {
|
|
|
240
266
|
readonly agentManager?: AgentJobManager;
|
|
241
267
|
readonly bootstrap?: RuntimeBootstrapOptions;
|
|
242
268
|
readonly editorLauncher?: EditorLauncher;
|
|
269
|
+
readonly externalAgentControl?: ExternalAgentControlPort;
|
|
243
270
|
readonly externalHandoffService?: ExternalHandoffService;
|
|
244
271
|
readonly logger?: SpotPatchServerLogger;
|
|
245
272
|
readonly options: ResolvedSpotPatchOptions;
|
|
@@ -296,4 +323,4 @@ interface SerializedSpotPatchOptions {
|
|
|
296
323
|
declare function serializeResolvedSpotPatchOptions(options: ResolvedSpotPatchOptions): SerializedSpotPatchOptions;
|
|
297
324
|
declare function parseSerializedSpotPatchOptions(value: unknown): ResolvedSpotPatchOptions;
|
|
298
325
|
|
|
299
|
-
export { type AgentJobEventListener, type AgentJobManager, type CreateAgentJobManagerOptions, type CreateExternalHandoffServiceOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, type ExternalHandoffService, type FilterEntry, type IntegrationFileChange, type IntegrationPlan, type ResolveProjectOptionsInput, 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, applyIntegrationPlan, createAgentJobManager, createExternalHandoffService, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, discoverProjectValidationCheck, integrationPathExists, isLoopbackHostname, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveOptions, resolveProjectOptions, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
|
326
|
+
export { type AgentJobEventListener, type AgentJobManager, type CreateAgentJobManagerOptions, type CreateExternalHandoffServiceOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, type ExternalAgentControlPort, type ExternalHandoffService, type FilterEntry, type IntegrationFileChange, type IntegrationPlan, type ResolveManagedExecutionValidationOptions, type ResolveProjectOptionsInput, type ResolveProjectValidationChecksOptions, 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, applyIntegrationPlan, createAgentJobManager, createExternalHandoffService, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, discoverProjectValidationCheck, integrationPathExists, isLoopbackHostname, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveManagedExecutionValidation, resolveOptions, resolveProjectOptions, resolveProjectValidationChecks, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { applyPreparedAgentChange, executeAgentChange, inspectAgentWorkspace, probeProviderCapability, resolveProviderCredential, revertPreparedAgentChange } from '@spotpatch/agent';
|
|
2
|
-
import { AgentJobEvent, AgentJobSnapshot, AgentJobCreateRequest, AgentCapabilityRequest, AgentCapabilitySnapshot, AgentJobResultResponse, AgentWorkspaceHealthSnapshot, ResolvedAiOptions, ExternalHandoffFramework, ExternalHandoffCapability, ExternalHandoffPublishRequest, SpotAnnotation, ExternalHandoffPublishResult, ExternalHandoffStatusResult, SpotPatchEditorPreference, ContextBudget, SpotPatchLocalePreference, DataFlowLimits, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, RuntimeDataFlowConfig, ResolvedAgentCheckDefinition, SpotPatchRuntimeConfig } from '@spotpatch/shared';
|
|
2
|
+
import { AgentJobEvent, AgentJobSnapshot, AgentJobCreateRequest, AgentCapabilityRequest, AgentCapabilitySnapshot, AgentJobResultResponse, AgentWorkspaceHealthSnapshot, ResolvedAiOptions, ExternalHandoffFramework, ExternalHandoffCapability, ExternalHandoffPublishRequest, SpotAnnotation, ExternalHandoffPublishResult, ExternalHandoffStatusResult, ExternalAgentControlStatus, ExternalAgentControlConnectRequest, ExternalAgentControlDisconnectRequest, ExternalAgentControlCancelRequest, ExternalAgentManagedResult, SpotPatchEditorPreference, ContextBudget, SpotPatchLocalePreference, DataFlowLimits, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, RuntimeDataFlowConfig, ResolvedAgentCheckDefinition, AgentLimits, SpotPatchRuntimeConfig } from '@spotpatch/shared';
|
|
3
3
|
import { SourceFilterEntry } from '@spotpatch/compiler';
|
|
4
4
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
5
|
|
|
@@ -51,6 +51,16 @@ interface CreateExternalHandoffServiceOptions {
|
|
|
51
51
|
}
|
|
52
52
|
declare function createExternalHandoffService(options: CreateExternalHandoffServiceOptions): ExternalHandoffService;
|
|
53
53
|
|
|
54
|
+
interface ExternalAgentControlPort {
|
|
55
|
+
getStatus(): ExternalAgentControlStatus;
|
|
56
|
+
connect(request: ExternalAgentControlConnectRequest, signal: AbortSignal): Promise<ExternalAgentControlStatus>;
|
|
57
|
+
disconnect(request: ExternalAgentControlDisconnectRequest): Promise<ExternalAgentControlStatus>;
|
|
58
|
+
cancel(request: ExternalAgentControlCancelRequest): Promise<ExternalAgentControlStatus>;
|
|
59
|
+
getResult(revision: number): ExternalAgentManagedResult | undefined;
|
|
60
|
+
subscribe(listener: (status: ExternalAgentControlStatus) => void): () => void;
|
|
61
|
+
dispose(): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
|
|
54
64
|
type FilterEntry = SourceFilterEntry;
|
|
55
65
|
interface SimpleAiOptions {
|
|
56
66
|
readonly baseURL: string;
|
|
@@ -187,7 +197,20 @@ interface DiscoverProjectValidationCheckOptions {
|
|
|
187
197
|
readonly appRoot: string;
|
|
188
198
|
readonly timeoutMs: number;
|
|
189
199
|
}
|
|
200
|
+
interface ResolveProjectValidationChecksOptions extends DiscoverProjectValidationCheckOptions {
|
|
201
|
+
readonly checks: Readonly<Record<string, ResolvedAgentCheckDefinition>>;
|
|
202
|
+
}
|
|
203
|
+
interface ResolveManagedExecutionValidationOptions {
|
|
204
|
+
readonly ai: false | ResolvedAiOptions;
|
|
205
|
+
readonly appRoot: string;
|
|
206
|
+
}
|
|
207
|
+
interface ResolvedManagedExecutionValidation {
|
|
208
|
+
readonly checks: Readonly<Record<string, ResolvedAgentCheckDefinition>>;
|
|
209
|
+
readonly limits: Readonly<AgentLimits>;
|
|
210
|
+
}
|
|
190
211
|
declare function discoverProjectValidationCheck(options: DiscoverProjectValidationCheckOptions): Promise<ResolvedAgentCheckDefinition | undefined>;
|
|
212
|
+
declare function resolveProjectValidationChecks(options: ResolveProjectValidationChecksOptions): Promise<Readonly<Record<string, ResolvedAgentCheckDefinition>>>;
|
|
213
|
+
declare function resolveManagedExecutionValidation(options: ResolveManagedExecutionValidationOptions): Promise<ResolvedManagedExecutionValidation>;
|
|
191
214
|
|
|
192
215
|
type SourceIdFactory = () => string;
|
|
193
216
|
|
|
@@ -232,7 +255,10 @@ declare function resolveRuntimeBootstrapOptions(options: RuntimeBootstrapOptions
|
|
|
232
255
|
declare function readRuntimeBootstrap(request: IncomingMessage, options: ResolvedRuntimeBootstrapOptions): Promise<SpotPatchRuntimeConfig>;
|
|
233
256
|
|
|
234
257
|
type SpotPatchNext = (error?: unknown) => void;
|
|
235
|
-
|
|
258
|
+
interface SpotPatchMiddleware {
|
|
259
|
+
(request: IncomingMessage, response: ServerResponse, next: SpotPatchNext): void;
|
|
260
|
+
dispose(): void;
|
|
261
|
+
}
|
|
236
262
|
interface SpotPatchServerLogger {
|
|
237
263
|
warn(message: string): void;
|
|
238
264
|
}
|
|
@@ -240,6 +266,7 @@ interface CreateMiddlewareOptions {
|
|
|
240
266
|
readonly agentManager?: AgentJobManager;
|
|
241
267
|
readonly bootstrap?: RuntimeBootstrapOptions;
|
|
242
268
|
readonly editorLauncher?: EditorLauncher;
|
|
269
|
+
readonly externalAgentControl?: ExternalAgentControlPort;
|
|
243
270
|
readonly externalHandoffService?: ExternalHandoffService;
|
|
244
271
|
readonly logger?: SpotPatchServerLogger;
|
|
245
272
|
readonly options: ResolvedSpotPatchOptions;
|
|
@@ -296,4 +323,4 @@ interface SerializedSpotPatchOptions {
|
|
|
296
323
|
declare function serializeResolvedSpotPatchOptions(options: ResolvedSpotPatchOptions): SerializedSpotPatchOptions;
|
|
297
324
|
declare function parseSerializedSpotPatchOptions(value: unknown): ResolvedSpotPatchOptions;
|
|
298
325
|
|
|
299
|
-
export { type AgentJobEventListener, type AgentJobManager, type CreateAgentJobManagerOptions, type CreateExternalHandoffServiceOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, type ExternalHandoffService, type FilterEntry, type IntegrationFileChange, type IntegrationPlan, type ResolveProjectOptionsInput, 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, applyIntegrationPlan, createAgentJobManager, createExternalHandoffService, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, discoverProjectValidationCheck, integrationPathExists, isLoopbackHostname, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveOptions, resolveProjectOptions, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
|
326
|
+
export { type AgentJobEventListener, type AgentJobManager, type CreateAgentJobManagerOptions, type CreateExternalHandoffServiceOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, type ExternalAgentControlPort, type ExternalHandoffService, type FilterEntry, type IntegrationFileChange, type IntegrationPlan, type ResolveManagedExecutionValidationOptions, type ResolveProjectOptionsInput, type ResolveProjectValidationChecksOptions, 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, applyIntegrationPlan, createAgentJobManager, createExternalHandoffService, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, discoverProjectValidationCheck, integrationPathExists, isLoopbackHostname, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveManagedExecutionValidation, resolveOptions, resolveProjectOptions, resolveProjectValidationChecks, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|