@spotpatch/agent 1.3.0 → 1.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.cjs +601 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -2
- package/dist/index.d.ts +53 -2
- package/dist/index.js +604 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AgentJobResult, AgentCheckResult, SpotAnnotation, ResolvedAiExecutionOptions, ResolvedAiModelProfile, ResolvedOpenAICompatibleProviderOptions, AgentLimits, AgentCapabilitySnapshot, AgentWorkspaceHealthSnapshot } from '@spotpatch/shared';
|
|
1
|
+
import { AgentJobResult, AgentCheckResult, SpotAnnotation, ResolvedAiExecutionOptions, ResolvedAiModelProfile, ResolvedOpenAICompatibleProviderOptions, AgentLimits, AgentCapabilitySnapshot, externalHandoffSnapshotSchema, ResolvedAgentCheckDefinition, AgentWorkspaceHealthSnapshot } from '@spotpatch/shared';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
|
|
3
4
|
interface ProviderCredential {
|
|
4
5
|
readonly kind: "provider-credential";
|
|
@@ -91,6 +92,56 @@ interface ProviderSessionOptions {
|
|
|
91
92
|
|
|
92
93
|
declare function createOpenAICompatibleProviderSession(options: ProviderSessionOptions): ProviderSession;
|
|
93
94
|
|
|
95
|
+
interface AuthorizedManagedTask {
|
|
96
|
+
readonly annotation: z.infer<typeof externalHandoffSnapshotSchema>["annotation"];
|
|
97
|
+
readonly revision: number;
|
|
98
|
+
}
|
|
99
|
+
interface PreparedManagedTask {
|
|
100
|
+
readonly kind: "prepared-managed-task";
|
|
101
|
+
readonly revision: number;
|
|
102
|
+
readonly workspaceRoot: string;
|
|
103
|
+
readonly prompt: string;
|
|
104
|
+
}
|
|
105
|
+
interface ManagedExecutionResult {
|
|
106
|
+
readonly revision: number;
|
|
107
|
+
readonly diff: string;
|
|
108
|
+
readonly files: readonly Readonly<{
|
|
109
|
+
path: string;
|
|
110
|
+
additions: number;
|
|
111
|
+
deletions: number;
|
|
112
|
+
}>[];
|
|
113
|
+
readonly checks: readonly Readonly<{
|
|
114
|
+
id: string;
|
|
115
|
+
outcome: "passed" | "failed" | "unavailable";
|
|
116
|
+
durationMs: number;
|
|
117
|
+
exitCode?: number;
|
|
118
|
+
}>[];
|
|
119
|
+
readonly validationOutcome: "passed" | "failed" | "not-configured" | "unavailable";
|
|
120
|
+
readonly applied: boolean;
|
|
121
|
+
readonly expiresAt: string;
|
|
122
|
+
readonly timings: Readonly<{
|
|
123
|
+
preparing: number;
|
|
124
|
+
agent: number;
|
|
125
|
+
auditing: number;
|
|
126
|
+
validating: number;
|
|
127
|
+
applying?: number;
|
|
128
|
+
total: number;
|
|
129
|
+
}>;
|
|
130
|
+
}
|
|
131
|
+
type ManagedExecutionPhaseObserver = (phase: "validating" | "applying") => void;
|
|
132
|
+
interface ManagedExecutionPort {
|
|
133
|
+
prepare(input: AuthorizedManagedTask, signal: AbortSignal): Promise<PreparedManagedTask>;
|
|
134
|
+
auditAndApply(task: PreparedManagedTask, signal: AbortSignal, onPhase?: ManagedExecutionPhaseObserver): Promise<ManagedExecutionResult>;
|
|
135
|
+
dispose(): Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
interface CreateManagedExecutionRunnerOptions {
|
|
138
|
+
readonly checks?: Readonly<Record<string, ResolvedAgentCheckDefinition>>;
|
|
139
|
+
readonly limits?: Readonly<AgentLimits>;
|
|
140
|
+
readonly root: string;
|
|
141
|
+
readonly temporaryBase?: string;
|
|
142
|
+
}
|
|
143
|
+
declare function createManagedExecutionRunner(options: CreateManagedExecutionRunnerOptions): ManagedExecutionPort;
|
|
144
|
+
|
|
94
145
|
declare function inspectAgentWorkspace(root: string, signal?: AbortSignal): Promise<AgentWorkspaceHealthSnapshot>;
|
|
95
146
|
|
|
96
|
-
export { type AgentExecutionCallbacks, type ExecuteAgentChangeOptions, type PreparedAgentChange, type ProviderCredential, type ProviderSession, type ProviderSessionOptions, type ProviderToolCall, type ProviderToolDefinition, type ProviderToolResult, type ProviderTurn, applyPreparedAgentChange, createOpenAICompatibleProviderSession, createProviderCredential, executeAgentChange, inspectAgentWorkspace, probeProviderCapability, resolveProviderCredential, revertPreparedAgentChange };
|
|
147
|
+
export { type AgentExecutionCallbacks, type AuthorizedManagedTask, type CreateManagedExecutionRunnerOptions, type ExecuteAgentChangeOptions, type ManagedExecutionPhaseObserver, type ManagedExecutionPort, type ManagedExecutionResult, type PreparedAgentChange, type PreparedManagedTask, type ProviderCredential, type ProviderSession, type ProviderSessionOptions, type ProviderToolCall, type ProviderToolDefinition, type ProviderToolResult, type ProviderTurn, applyPreparedAgentChange, createManagedExecutionRunner, createOpenAICompatibleProviderSession, createProviderCredential, executeAgentChange, inspectAgentWorkspace, probeProviderCapability, resolveProviderCredential, revertPreparedAgentChange };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AgentJobResult, AgentCheckResult, SpotAnnotation, ResolvedAiExecutionOptions, ResolvedAiModelProfile, ResolvedOpenAICompatibleProviderOptions, AgentLimits, AgentCapabilitySnapshot, AgentWorkspaceHealthSnapshot } from '@spotpatch/shared';
|
|
1
|
+
import { AgentJobResult, AgentCheckResult, SpotAnnotation, ResolvedAiExecutionOptions, ResolvedAiModelProfile, ResolvedOpenAICompatibleProviderOptions, AgentLimits, AgentCapabilitySnapshot, externalHandoffSnapshotSchema, ResolvedAgentCheckDefinition, AgentWorkspaceHealthSnapshot } from '@spotpatch/shared';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
|
|
3
4
|
interface ProviderCredential {
|
|
4
5
|
readonly kind: "provider-credential";
|
|
@@ -91,6 +92,56 @@ interface ProviderSessionOptions {
|
|
|
91
92
|
|
|
92
93
|
declare function createOpenAICompatibleProviderSession(options: ProviderSessionOptions): ProviderSession;
|
|
93
94
|
|
|
95
|
+
interface AuthorizedManagedTask {
|
|
96
|
+
readonly annotation: z.infer<typeof externalHandoffSnapshotSchema>["annotation"];
|
|
97
|
+
readonly revision: number;
|
|
98
|
+
}
|
|
99
|
+
interface PreparedManagedTask {
|
|
100
|
+
readonly kind: "prepared-managed-task";
|
|
101
|
+
readonly revision: number;
|
|
102
|
+
readonly workspaceRoot: string;
|
|
103
|
+
readonly prompt: string;
|
|
104
|
+
}
|
|
105
|
+
interface ManagedExecutionResult {
|
|
106
|
+
readonly revision: number;
|
|
107
|
+
readonly diff: string;
|
|
108
|
+
readonly files: readonly Readonly<{
|
|
109
|
+
path: string;
|
|
110
|
+
additions: number;
|
|
111
|
+
deletions: number;
|
|
112
|
+
}>[];
|
|
113
|
+
readonly checks: readonly Readonly<{
|
|
114
|
+
id: string;
|
|
115
|
+
outcome: "passed" | "failed" | "unavailable";
|
|
116
|
+
durationMs: number;
|
|
117
|
+
exitCode?: number;
|
|
118
|
+
}>[];
|
|
119
|
+
readonly validationOutcome: "passed" | "failed" | "not-configured" | "unavailable";
|
|
120
|
+
readonly applied: boolean;
|
|
121
|
+
readonly expiresAt: string;
|
|
122
|
+
readonly timings: Readonly<{
|
|
123
|
+
preparing: number;
|
|
124
|
+
agent: number;
|
|
125
|
+
auditing: number;
|
|
126
|
+
validating: number;
|
|
127
|
+
applying?: number;
|
|
128
|
+
total: number;
|
|
129
|
+
}>;
|
|
130
|
+
}
|
|
131
|
+
type ManagedExecutionPhaseObserver = (phase: "validating" | "applying") => void;
|
|
132
|
+
interface ManagedExecutionPort {
|
|
133
|
+
prepare(input: AuthorizedManagedTask, signal: AbortSignal): Promise<PreparedManagedTask>;
|
|
134
|
+
auditAndApply(task: PreparedManagedTask, signal: AbortSignal, onPhase?: ManagedExecutionPhaseObserver): Promise<ManagedExecutionResult>;
|
|
135
|
+
dispose(): Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
interface CreateManagedExecutionRunnerOptions {
|
|
138
|
+
readonly checks?: Readonly<Record<string, ResolvedAgentCheckDefinition>>;
|
|
139
|
+
readonly limits?: Readonly<AgentLimits>;
|
|
140
|
+
readonly root: string;
|
|
141
|
+
readonly temporaryBase?: string;
|
|
142
|
+
}
|
|
143
|
+
declare function createManagedExecutionRunner(options: CreateManagedExecutionRunnerOptions): ManagedExecutionPort;
|
|
144
|
+
|
|
94
145
|
declare function inspectAgentWorkspace(root: string, signal?: AbortSignal): Promise<AgentWorkspaceHealthSnapshot>;
|
|
95
146
|
|
|
96
|
-
export { type AgentExecutionCallbacks, type ExecuteAgentChangeOptions, type PreparedAgentChange, type ProviderCredential, type ProviderSession, type ProviderSessionOptions, type ProviderToolCall, type ProviderToolDefinition, type ProviderToolResult, type ProviderTurn, applyPreparedAgentChange, createOpenAICompatibleProviderSession, createProviderCredential, executeAgentChange, inspectAgentWorkspace, probeProviderCapability, resolveProviderCredential, revertPreparedAgentChange };
|
|
147
|
+
export { type AgentExecutionCallbacks, type AuthorizedManagedTask, type CreateManagedExecutionRunnerOptions, type ExecuteAgentChangeOptions, type ManagedExecutionPhaseObserver, type ManagedExecutionPort, type ManagedExecutionResult, type PreparedAgentChange, type PreparedManagedTask, type ProviderCredential, type ProviderSession, type ProviderSessionOptions, type ProviderToolCall, type ProviderToolDefinition, type ProviderToolResult, type ProviderTurn, applyPreparedAgentChange, createManagedExecutionRunner, createOpenAICompatibleProviderSession, createProviderCredential, executeAgentChange, inspectAgentWorkspace, probeProviderCapability, resolveProviderCredential, revertPreparedAgentChange };
|