@crewx/sdk 0.9.0-rc.100 → 0.9.0-rc.102
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/agent/agent-list-view.d.ts +19 -0
- package/dist/esm/index.js +121 -118
- package/dist/esm/plugins/index.js +46 -46
- package/dist/esm/repository/index.js +51 -51
- package/dist/facade/Crewx.d.ts +10 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +123 -120
- package/dist/lifecycle/task-stop.d.ts +20 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +44 -44
- package/dist/plugins/sqlite-tracing.d.ts +11 -0
- package/dist/repository/index.js +51 -51
- package/dist/repository/task.repository.d.ts +9 -0
- package/dist/template/helpers/exec.browser.d.ts +1 -1
- package/dist/template/helpers/exec.d.ts +1 -1
- package/dist/template/types.d.ts +7 -0
- package/package.json +1 -1
|
@@ -32,6 +32,13 @@ export interface FinalizeTaskStopOptions {
|
|
|
32
32
|
terminalReason?: TaskTerminalReason;
|
|
33
33
|
durationMs?: number | null;
|
|
34
34
|
}
|
|
35
|
+
export interface FinalizeTaskForHostShutdownOptions {
|
|
36
|
+
id: string;
|
|
37
|
+
expectedRunEpoch: number;
|
|
38
|
+
workspaceId?: string | null;
|
|
39
|
+
completedAt?: string;
|
|
40
|
+
}
|
|
41
|
+
export type FinalizeTaskForHostShutdownOutcome = 'settled' | 'not_running' | 'epoch_mismatch' | 'workspace_mismatch';
|
|
35
42
|
export type TaskListRow = Pick<TaskRow, 'id' | 'thread_id' | 'agent_id' | 'status' | 'parent_task_id' | 'started_at' | 'completed_at' | 'duration_ms' | 'input_tokens' | 'output_tokens' | 'cost_usd' | 'error'>;
|
|
36
43
|
export type TaskActivityLogRow = Pick<TaskRow, 'id' | 'thread_id' | 'agent_id' | 'parent_task_id' | 'started_at' | 'completed_at'>;
|
|
37
44
|
export type FindTasksByThreadOptions = {
|
|
@@ -140,6 +147,7 @@ export interface ThreadChain {
|
|
|
140
147
|
targetAgentTurnCount: number;
|
|
141
148
|
turns: ThreadChainTurn[];
|
|
142
149
|
}
|
|
150
|
+
export declare const HOST_SHUTDOWN_TERMINAL_ERROR = "Stopped by app shutdown";
|
|
143
151
|
type TaskUsageColumns = Pick<TaskRow, 'input_tokens' | 'output_tokens' | 'cached_input_tokens' | 'cost_usd'>;
|
|
144
152
|
export declare function mergeTerminalReason(metadataJson: string | null | undefined, reason: TaskTerminalReason): string;
|
|
145
153
|
export declare function hasRecordedUsage(task: TaskUsageColumns): boolean;
|
|
@@ -172,6 +180,7 @@ export declare class TaskRepository extends BaseSqliteRepository {
|
|
|
172
180
|
}): TaskStopRequestResult;
|
|
173
181
|
private requestTaskStopForInstruction;
|
|
174
182
|
finalizeTaskStop(opts: FinalizeTaskStopOptions): boolean;
|
|
183
|
+
finalizeTaskForHostShutdown(opts: FinalizeTaskForHostShutdownOptions): FinalizeTaskForHostShutdownOutcome;
|
|
175
184
|
stopTask(id: string, options?: StopTaskOptions): Promise<StopTaskResult>;
|
|
176
185
|
stopTaskGenerationForInstruction(options: StopTaskGenerationForInstructionOptions): Promise<StopTaskResult>;
|
|
177
186
|
startTask(opts: {
|
|
@@ -8,7 +8,7 @@ export declare function isAllowed(_command: string, _policy: ExecPolicy): boolea
|
|
|
8
8
|
export declare function setAuditVerbose(_enabled: boolean): void;
|
|
9
9
|
export declare function logExecAudit(_entry: {
|
|
10
10
|
command: string;
|
|
11
|
-
status: 'allowed' | 'denied' | 'error' | 'reused';
|
|
11
|
+
status: 'allowed' | 'denied' | 'error' | 'reused' | 'in-process';
|
|
12
12
|
allowed_by?: string;
|
|
13
13
|
reason?: string;
|
|
14
14
|
duration_ms?: number;
|
|
@@ -8,7 +8,7 @@ export declare function isAllowed(command: string, policy: ExecPolicy): boolean;
|
|
|
8
8
|
export declare function setAuditVerbose(enabled: boolean): void;
|
|
9
9
|
export declare function logExecAudit(entry: {
|
|
10
10
|
command: string;
|
|
11
|
-
status: 'allowed' | 'denied' | 'error' | 'reused';
|
|
11
|
+
status: 'allowed' | 'denied' | 'error' | 'reused' | 'in-process';
|
|
12
12
|
allowed_by?: string;
|
|
13
13
|
reason?: string;
|
|
14
14
|
duration_ms?: number;
|
package/dist/template/types.d.ts
CHANGED
|
@@ -24,10 +24,17 @@ export interface ExecReuseMetrics {
|
|
|
24
24
|
reusedCalls: number;
|
|
25
25
|
actualMs: number;
|
|
26
26
|
reusedMs: number;
|
|
27
|
+
inProcessCalls: number;
|
|
28
|
+
inProcessMs: number;
|
|
27
29
|
}
|
|
30
|
+
export type PromptListResolver = (argv: readonly string[], ctx: {
|
|
31
|
+
cwd: string;
|
|
32
|
+
env: Record<string, string>;
|
|
33
|
+
}) => string | undefined;
|
|
28
34
|
export interface ExecReuseScope {
|
|
29
35
|
readonly cache: Map<string, string>;
|
|
30
36
|
readonly metrics: ExecReuseMetrics;
|
|
37
|
+
readonly listResolver?: PromptListResolver;
|
|
31
38
|
}
|
|
32
39
|
export interface TemplateRenderOptions {
|
|
33
40
|
execReuseScope?: ExecReuseScope;
|