@spotpatch/dev-server 0.5.0 → 0.6.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 +1524 -350
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.js +1529 -306
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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, 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, SpotPatchEditorPreference, ContextBudget, SpotPatchLocalePreference, DataFlowLimits, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, RuntimeDataFlowConfig, ResolvedAgentCheckDefinition, SpotPatchRuntimeConfig } from '@spotpatch/shared';
|
|
3
3
|
import { SourceFilterEntry } from '@spotpatch/compiler';
|
|
4
4
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
5
|
|
|
@@ -35,6 +35,22 @@ interface CreateAgentJobManagerOptions {
|
|
|
35
35
|
}
|
|
36
36
|
declare function createAgentJobManager(options: CreateAgentJobManagerOptions): AgentJobManager;
|
|
37
37
|
|
|
38
|
+
type AuthorizeExternalHandoff = (annotation: ExternalHandoffPublishRequest["annotation"]) => Promise<SpotAnnotation>;
|
|
39
|
+
interface ExternalHandoffService {
|
|
40
|
+
readonly capability: () => ExternalHandoffCapability;
|
|
41
|
+
readonly close: () => Promise<void>;
|
|
42
|
+
readonly publish: (request: ExternalHandoffPublishRequest, authorize: AuthorizeExternalHandoff) => Promise<ExternalHandoffPublishResult>;
|
|
43
|
+
readonly resolveDelivery: (cursor: string) => ExternalHandoffStatusResult;
|
|
44
|
+
readonly start: () => Promise<void>;
|
|
45
|
+
readonly status: (cursor?: string) => ExternalHandoffStatusResult;
|
|
46
|
+
}
|
|
47
|
+
interface CreateExternalHandoffServiceOptions {
|
|
48
|
+
readonly framework: ExternalHandoffFramework;
|
|
49
|
+
readonly root: string;
|
|
50
|
+
readonly sessionId: string;
|
|
51
|
+
}
|
|
52
|
+
declare function createExternalHandoffService(options: CreateExternalHandoffServiceOptions): ExternalHandoffService;
|
|
53
|
+
|
|
38
54
|
type FilterEntry = SourceFilterEntry;
|
|
39
55
|
interface SimpleAiOptions {
|
|
40
56
|
readonly baseURL: string;
|
|
@@ -66,6 +82,7 @@ interface SpotPatchOptions {
|
|
|
66
82
|
readonly maxTargets?: number;
|
|
67
83
|
readonly ai?: SpotPatchAiOptions;
|
|
68
84
|
readonly dataFlow?: false | SpotPatchDataFlowOptions;
|
|
85
|
+
readonly externalAgent?: boolean;
|
|
69
86
|
}
|
|
70
87
|
interface ResolvedSpotPatchOptions {
|
|
71
88
|
readonly enabled: boolean;
|
|
@@ -81,6 +98,9 @@ interface ResolvedSpotPatchOptions {
|
|
|
81
98
|
readonly maxTargets: number;
|
|
82
99
|
readonly ai: false | ResolvedAiOptions;
|
|
83
100
|
readonly dataFlow: ResolvedSpotPatchDataFlowOptions;
|
|
101
|
+
readonly externalAgent: Readonly<{
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
}>;
|
|
84
104
|
}
|
|
85
105
|
interface ResolvedSpotPatchDataFlowOptions {
|
|
86
106
|
readonly enabled: boolean;
|
|
@@ -127,6 +147,9 @@ declare const DEFAULT_OPTIONS: Readonly<{
|
|
|
127
147
|
readonly reportMaxFields: 100;
|
|
128
148
|
}>;
|
|
129
149
|
}>;
|
|
150
|
+
externalAgent: Readonly<{
|
|
151
|
+
enabled: false;
|
|
152
|
+
}>;
|
|
130
153
|
}>;
|
|
131
154
|
declare function createRuntimeAiConfig(options: false | ResolvedAiOptions): RuntimeAiConfig;
|
|
132
155
|
declare function createRuntimeDataFlowConfig(options: ResolvedSpotPatchDataFlowOptions): RuntimeDataFlowConfig;
|
|
@@ -217,6 +240,7 @@ interface CreateMiddlewareOptions {
|
|
|
217
240
|
readonly agentManager?: AgentJobManager;
|
|
218
241
|
readonly bootstrap?: RuntimeBootstrapOptions;
|
|
219
242
|
readonly editorLauncher?: EditorLauncher;
|
|
243
|
+
readonly externalHandoffService?: ExternalHandoffService;
|
|
220
244
|
readonly logger?: SpotPatchServerLogger;
|
|
221
245
|
readonly options: ResolvedSpotPatchOptions;
|
|
222
246
|
readonly registry: SourceRegistry;
|
|
@@ -261,6 +285,7 @@ interface SerializedSpotPatchOptions {
|
|
|
261
285
|
readonly dataFlow: false | SpotPatchDataFlowOptions;
|
|
262
286
|
readonly editor: SpotPatchEditorPreference;
|
|
263
287
|
readonly enabled: boolean;
|
|
288
|
+
readonly externalAgent: boolean;
|
|
264
289
|
readonly exclude: readonly SerializedFilterEntry[];
|
|
265
290
|
readonly include: readonly SerializedFilterEntry[];
|
|
266
291
|
readonly locale: SpotPatchLocalePreference;
|
|
@@ -271,4 +296,4 @@ interface SerializedSpotPatchOptions {
|
|
|
271
296
|
declare function serializeResolvedSpotPatchOptions(options: ResolvedSpotPatchOptions): SerializedSpotPatchOptions;
|
|
272
297
|
declare function parseSerializedSpotPatchOptions(value: unknown): ResolvedSpotPatchOptions;
|
|
273
298
|
|
|
274
|
-
export { type AgentJobEventListener, type AgentJobManager, type CreateAgentJobManagerOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, 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, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, discoverProjectValidationCheck, integrationPathExists, isLoopbackHostname, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveOptions, resolveProjectOptions, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
|
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 };
|
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, 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, SpotPatchEditorPreference, ContextBudget, SpotPatchLocalePreference, DataFlowLimits, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, RuntimeDataFlowConfig, ResolvedAgentCheckDefinition, SpotPatchRuntimeConfig } from '@spotpatch/shared';
|
|
3
3
|
import { SourceFilterEntry } from '@spotpatch/compiler';
|
|
4
4
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
5
5
|
|
|
@@ -35,6 +35,22 @@ interface CreateAgentJobManagerOptions {
|
|
|
35
35
|
}
|
|
36
36
|
declare function createAgentJobManager(options: CreateAgentJobManagerOptions): AgentJobManager;
|
|
37
37
|
|
|
38
|
+
type AuthorizeExternalHandoff = (annotation: ExternalHandoffPublishRequest["annotation"]) => Promise<SpotAnnotation>;
|
|
39
|
+
interface ExternalHandoffService {
|
|
40
|
+
readonly capability: () => ExternalHandoffCapability;
|
|
41
|
+
readonly close: () => Promise<void>;
|
|
42
|
+
readonly publish: (request: ExternalHandoffPublishRequest, authorize: AuthorizeExternalHandoff) => Promise<ExternalHandoffPublishResult>;
|
|
43
|
+
readonly resolveDelivery: (cursor: string) => ExternalHandoffStatusResult;
|
|
44
|
+
readonly start: () => Promise<void>;
|
|
45
|
+
readonly status: (cursor?: string) => ExternalHandoffStatusResult;
|
|
46
|
+
}
|
|
47
|
+
interface CreateExternalHandoffServiceOptions {
|
|
48
|
+
readonly framework: ExternalHandoffFramework;
|
|
49
|
+
readonly root: string;
|
|
50
|
+
readonly sessionId: string;
|
|
51
|
+
}
|
|
52
|
+
declare function createExternalHandoffService(options: CreateExternalHandoffServiceOptions): ExternalHandoffService;
|
|
53
|
+
|
|
38
54
|
type FilterEntry = SourceFilterEntry;
|
|
39
55
|
interface SimpleAiOptions {
|
|
40
56
|
readonly baseURL: string;
|
|
@@ -66,6 +82,7 @@ interface SpotPatchOptions {
|
|
|
66
82
|
readonly maxTargets?: number;
|
|
67
83
|
readonly ai?: SpotPatchAiOptions;
|
|
68
84
|
readonly dataFlow?: false | SpotPatchDataFlowOptions;
|
|
85
|
+
readonly externalAgent?: boolean;
|
|
69
86
|
}
|
|
70
87
|
interface ResolvedSpotPatchOptions {
|
|
71
88
|
readonly enabled: boolean;
|
|
@@ -81,6 +98,9 @@ interface ResolvedSpotPatchOptions {
|
|
|
81
98
|
readonly maxTargets: number;
|
|
82
99
|
readonly ai: false | ResolvedAiOptions;
|
|
83
100
|
readonly dataFlow: ResolvedSpotPatchDataFlowOptions;
|
|
101
|
+
readonly externalAgent: Readonly<{
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
}>;
|
|
84
104
|
}
|
|
85
105
|
interface ResolvedSpotPatchDataFlowOptions {
|
|
86
106
|
readonly enabled: boolean;
|
|
@@ -127,6 +147,9 @@ declare const DEFAULT_OPTIONS: Readonly<{
|
|
|
127
147
|
readonly reportMaxFields: 100;
|
|
128
148
|
}>;
|
|
129
149
|
}>;
|
|
150
|
+
externalAgent: Readonly<{
|
|
151
|
+
enabled: false;
|
|
152
|
+
}>;
|
|
130
153
|
}>;
|
|
131
154
|
declare function createRuntimeAiConfig(options: false | ResolvedAiOptions): RuntimeAiConfig;
|
|
132
155
|
declare function createRuntimeDataFlowConfig(options: ResolvedSpotPatchDataFlowOptions): RuntimeDataFlowConfig;
|
|
@@ -217,6 +240,7 @@ interface CreateMiddlewareOptions {
|
|
|
217
240
|
readonly agentManager?: AgentJobManager;
|
|
218
241
|
readonly bootstrap?: RuntimeBootstrapOptions;
|
|
219
242
|
readonly editorLauncher?: EditorLauncher;
|
|
243
|
+
readonly externalHandoffService?: ExternalHandoffService;
|
|
220
244
|
readonly logger?: SpotPatchServerLogger;
|
|
221
245
|
readonly options: ResolvedSpotPatchOptions;
|
|
222
246
|
readonly registry: SourceRegistry;
|
|
@@ -261,6 +285,7 @@ interface SerializedSpotPatchOptions {
|
|
|
261
285
|
readonly dataFlow: false | SpotPatchDataFlowOptions;
|
|
262
286
|
readonly editor: SpotPatchEditorPreference;
|
|
263
287
|
readonly enabled: boolean;
|
|
288
|
+
readonly externalAgent: boolean;
|
|
264
289
|
readonly exclude: readonly SerializedFilterEntry[];
|
|
265
290
|
readonly include: readonly SerializedFilterEntry[];
|
|
266
291
|
readonly locale: SpotPatchLocalePreference;
|
|
@@ -271,4 +296,4 @@ interface SerializedSpotPatchOptions {
|
|
|
271
296
|
declare function serializeResolvedSpotPatchOptions(options: ResolvedSpotPatchOptions): SerializedSpotPatchOptions;
|
|
272
297
|
declare function parseSerializedSpotPatchOptions(value: unknown): ResolvedSpotPatchOptions;
|
|
273
298
|
|
|
274
|
-
export { type AgentJobEventListener, type AgentJobManager, type CreateAgentJobManagerOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type DiscoverProjectValidationCheckOptions, type EnvironmentAiConfiguration, 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, createIntegrationFileChange, createRuntimeAiConfig, createRuntimeDataFlowConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, discoverProjectValidationCheck, integrationPathExists, isLoopbackHostname, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveOptions, resolveProjectOptions, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
|
|
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 };
|