@spotpatch/dev-server 0.2.0 → 0.4.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.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, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, SpotPatchRuntimeConfig } from '@spotpatch/shared';
2
+ import { AgentJobEvent, AgentJobSnapshot, AgentJobCreateRequest, AgentCapabilityRequest, AgentCapabilitySnapshot, AgentJobResultResponse, AgentWorkspaceHealthSnapshot, ResolvedAiOptions, SpotPatchEditorPreference, ContextBudget, SpotPatchLocalePreference, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, ResolvedAgentCheckDefinition, SpotPatchRuntimeConfig } from '@spotpatch/shared';
3
3
  import { SourceFilterEntry } from '@spotpatch/compiler';
4
4
  import { IncomingMessage, ServerResponse } from 'node:http';
5
5
 
@@ -55,6 +55,8 @@ interface SpotPatchOptions {
55
55
  readonly redact?: boolean;
56
56
  readonly budget?: Partial<ContextBudget>;
57
57
  readonly shortcut?: string;
58
+ /** Exposes the review/trusted-fast selector after a project check is resolved. */
59
+ readonly trustedFastMode?: boolean;
58
60
  readonly allowLan?: boolean;
59
61
  readonly debug?: boolean;
60
62
  readonly locale?: SpotPatchLocalePreference;
@@ -106,6 +108,34 @@ interface EnvironmentAiConfiguration {
106
108
  declare function resolveCredentialEnvironment(options: ResolvedSpotPatchOptions, environment: Readonly<Record<string, string | undefined>>): Readonly<Record<string, string>>;
107
109
  declare function resolveEnvironmentAiConfiguration(environment: Readonly<Record<string, string | undefined>>): EnvironmentAiConfiguration;
108
110
 
111
+ interface IntegrationFileChange {
112
+ readonly absolutePath: string;
113
+ readonly nextContent: string;
114
+ readonly previousContent?: string;
115
+ readonly relativePath: string;
116
+ }
117
+ interface IntegrationPlan {
118
+ readonly appRoot: string;
119
+ readonly changes: readonly IntegrationFileChange[];
120
+ }
121
+ declare function integrationPathExists(absolutePath: string): Promise<boolean>;
122
+ declare function readIntegrationFile(absolutePath: string): Promise<string>;
123
+ declare function createIntegrationFileChange(appRoot: string, absolutePath: string, nextContent: string, previousContent: string | undefined): IntegrationFileChange | undefined;
124
+ declare function applyIntegrationPlan(plan: IntegrationPlan): Promise<void>;
125
+
126
+ interface ResolveProjectOptionsInput {
127
+ readonly appRoot: string;
128
+ readonly environmentAi?: false | SimpleAiOptions;
129
+ readonly options?: SpotPatchOptions;
130
+ }
131
+ declare function resolveProjectOptions(input: ResolveProjectOptionsInput): Promise<ResolvedSpotPatchOptions>;
132
+
133
+ interface DiscoverProjectValidationCheckOptions {
134
+ readonly appRoot: string;
135
+ readonly timeoutMs: number;
136
+ }
137
+ declare function discoverProjectValidationCheck(options: DiscoverProjectValidationCheckOptions): Promise<ResolvedAgentCheckDefinition | undefined>;
138
+
109
139
  type SourceIdFactory = () => string;
110
140
 
111
141
  interface SourceRegistry {
@@ -199,4 +229,4 @@ interface SerializedSpotPatchOptions {
199
229
  declare function serializeResolvedSpotPatchOptions(options: ResolvedSpotPatchOptions): SerializedSpotPatchOptions;
200
230
  declare function parseSerializedSpotPatchOptions(value: unknown): ResolvedSpotPatchOptions;
201
231
 
202
- export { type AgentJobEventListener, type AgentJobManager, type CreateAgentJobManagerOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type EnvironmentAiConfiguration, type FilterEntry, type ResolvedRuntimeBootstrapOptions, type ResolvedSpotPatchOptions, type RuntimeBootstrapOptions, type SerializedFilterEntry, type SerializedSpotPatchOptions, type SimpleAiOptions, type SourceRegistrationHandler, type SourceRegistrationService, type SourceRegistrationServiceOptions, type SourceRegistry, type SpotPatchAiOptions, type SpotPatchMiddleware, type SpotPatchNext, type SpotPatchOptions, type SpotPatchServerLogger, type SpotPatchSession, createAgentJobManager, createRuntimeAiConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, isLoopbackHostname, parseSerializedSpotPatchOptions, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveOptions, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
232
+ 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 ResolvedSpotPatchOptions, type RuntimeBootstrapOptions, type SerializedFilterEntry, type SerializedSpotPatchOptions, type SimpleAiOptions, type SourceRegistrationHandler, type SourceRegistrationService, type SourceRegistrationServiceOptions, type SourceRegistry, type SpotPatchAiOptions, type SpotPatchMiddleware, type SpotPatchNext, type SpotPatchOptions, type SpotPatchServerLogger, type SpotPatchSession, applyIntegrationPlan, createAgentJobManager, createIntegrationFileChange, createRuntimeAiConfig, 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, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, SpotPatchRuntimeConfig } from '@spotpatch/shared';
2
+ import { AgentJobEvent, AgentJobSnapshot, AgentJobCreateRequest, AgentCapabilityRequest, AgentCapabilitySnapshot, AgentJobResultResponse, AgentWorkspaceHealthSnapshot, ResolvedAiOptions, SpotPatchEditorPreference, ContextBudget, SpotPatchLocalePreference, AiProviderProtocol, AiProviderAuthentication, AiExecutionOptions, AiOptions, RuntimeAiConfig, ResolvedAgentCheckDefinition, SpotPatchRuntimeConfig } from '@spotpatch/shared';
3
3
  import { SourceFilterEntry } from '@spotpatch/compiler';
4
4
  import { IncomingMessage, ServerResponse } from 'node:http';
5
5
 
@@ -55,6 +55,8 @@ interface SpotPatchOptions {
55
55
  readonly redact?: boolean;
56
56
  readonly budget?: Partial<ContextBudget>;
57
57
  readonly shortcut?: string;
58
+ /** Exposes the review/trusted-fast selector after a project check is resolved. */
59
+ readonly trustedFastMode?: boolean;
58
60
  readonly allowLan?: boolean;
59
61
  readonly debug?: boolean;
60
62
  readonly locale?: SpotPatchLocalePreference;
@@ -106,6 +108,34 @@ interface EnvironmentAiConfiguration {
106
108
  declare function resolveCredentialEnvironment(options: ResolvedSpotPatchOptions, environment: Readonly<Record<string, string | undefined>>): Readonly<Record<string, string>>;
107
109
  declare function resolveEnvironmentAiConfiguration(environment: Readonly<Record<string, string | undefined>>): EnvironmentAiConfiguration;
108
110
 
111
+ interface IntegrationFileChange {
112
+ readonly absolutePath: string;
113
+ readonly nextContent: string;
114
+ readonly previousContent?: string;
115
+ readonly relativePath: string;
116
+ }
117
+ interface IntegrationPlan {
118
+ readonly appRoot: string;
119
+ readonly changes: readonly IntegrationFileChange[];
120
+ }
121
+ declare function integrationPathExists(absolutePath: string): Promise<boolean>;
122
+ declare function readIntegrationFile(absolutePath: string): Promise<string>;
123
+ declare function createIntegrationFileChange(appRoot: string, absolutePath: string, nextContent: string, previousContent: string | undefined): IntegrationFileChange | undefined;
124
+ declare function applyIntegrationPlan(plan: IntegrationPlan): Promise<void>;
125
+
126
+ interface ResolveProjectOptionsInput {
127
+ readonly appRoot: string;
128
+ readonly environmentAi?: false | SimpleAiOptions;
129
+ readonly options?: SpotPatchOptions;
130
+ }
131
+ declare function resolveProjectOptions(input: ResolveProjectOptionsInput): Promise<ResolvedSpotPatchOptions>;
132
+
133
+ interface DiscoverProjectValidationCheckOptions {
134
+ readonly appRoot: string;
135
+ readonly timeoutMs: number;
136
+ }
137
+ declare function discoverProjectValidationCheck(options: DiscoverProjectValidationCheckOptions): Promise<ResolvedAgentCheckDefinition | undefined>;
138
+
109
139
  type SourceIdFactory = () => string;
110
140
 
111
141
  interface SourceRegistry {
@@ -199,4 +229,4 @@ interface SerializedSpotPatchOptions {
199
229
  declare function serializeResolvedSpotPatchOptions(options: ResolvedSpotPatchOptions): SerializedSpotPatchOptions;
200
230
  declare function parseSerializedSpotPatchOptions(value: unknown): ResolvedSpotPatchOptions;
201
231
 
202
- export { type AgentJobEventListener, type AgentJobManager, type CreateAgentJobManagerOptions, type CreateMiddlewareOptions, DEFAULT_EXCLUDE, DEFAULT_OPTIONS, type EnvironmentAiConfiguration, type FilterEntry, type ResolvedRuntimeBootstrapOptions, type ResolvedSpotPatchOptions, type RuntimeBootstrapOptions, type SerializedFilterEntry, type SerializedSpotPatchOptions, type SimpleAiOptions, type SourceRegistrationHandler, type SourceRegistrationService, type SourceRegistrationServiceOptions, type SourceRegistry, type SpotPatchAiOptions, type SpotPatchMiddleware, type SpotPatchNext, type SpotPatchOptions, type SpotPatchServerLogger, type SpotPatchSession, createAgentJobManager, createRuntimeAiConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, isLoopbackHostname, parseSerializedSpotPatchOptions, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveOptions, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };
232
+ 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 ResolvedSpotPatchOptions, type RuntimeBootstrapOptions, type SerializedFilterEntry, type SerializedSpotPatchOptions, type SimpleAiOptions, type SourceRegistrationHandler, type SourceRegistrationService, type SourceRegistrationServiceOptions, type SourceRegistry, type SpotPatchAiOptions, type SpotPatchMiddleware, type SpotPatchNext, type SpotPatchOptions, type SpotPatchServerLogger, type SpotPatchSession, applyIntegrationPlan, createAgentJobManager, createIntegrationFileChange, createRuntimeAiConfig, createSession, createSourceRegistrationService, createSourceRegistry, createSpotPatchMiddleware, discoverProjectValidationCheck, integrationPathExists, isLoopbackHostname, parseSerializedSpotPatchOptions, readIntegrationFile, readJsonRequestBody, readRuntimeBootstrap, resolveCredentialEnvironment, resolveEnvironmentAiConfiguration, resolveOptions, resolveProjectOptions, resolveRuntimeBootstrapOptions, serializeResolvedSpotPatchOptions };