@crewx/sdk 0.9.0-rc.173 → 0.9.0-rc.175
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/desktop/index.js +3 -3
- package/dist/esm/desktop/index.js +3 -3
- package/dist/esm/index.js +388 -259
- package/dist/esm/plugins/index.js +95 -91
- package/dist/esm/process/index.js +1 -1
- package/dist/esm/publish/index.js +2 -2
- package/dist/esm/repository/index.js +334 -201
- package/dist/esm/skills/index.js +2 -2
- package/dist/index.browser.js +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +377 -248
- package/dist/lifecycle/task-stop.d.ts +27 -1
- package/dist/lifecycle/update-admission.d.ts +1 -1
- package/dist/mcp-app/types.d.ts +3 -1
- package/dist/mcp-app/workspace-snapshot.d.ts +1 -0
- package/dist/migrations/0042_breezy_blue_shield.sql +31 -0
- package/dist/migrations/0043_nervous_darkstar.sql +1 -0
- package/dist/migrations/0044_military_galactus.sql +8 -0
- package/dist/migrations/0045_task_pid_started_at.sql +1 -0
- package/dist/migrations/meta/0042_snapshot.json +4383 -0
- package/dist/migrations/meta/0043_snapshot.json +4390 -0
- package/dist/migrations/meta/0044_snapshot.json +4435 -0
- package/dist/migrations/meta/0045_snapshot.json +4442 -0
- package/dist/migrations/meta/_journal.json +28 -0
- package/dist/plugins/index.js +99 -95
- package/dist/process/index.d.ts +2 -2
- package/dist/process/index.js +1 -1
- package/dist/process/process-control.d.ts +14 -0
- package/dist/publish/index.js +2 -2
- package/dist/repository/db.d.ts +1 -0
- package/dist/repository/index.d.ts +7 -0
- package/dist/repository/index.js +292 -159
- package/dist/repository/run-columns.d.ts +10 -0
- package/dist/repository/run-history.repository.d.ts +112 -0
- package/dist/repository/schedule-run.repository.d.ts +103 -0
- package/dist/repository/task.repository.d.ts +13 -2
- package/dist/repository/workflow-anchor-kinds.d.ts +4 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/run-column-backfill.d.ts +81 -0
- package/dist/schema/schedule-runs.d.ts +451 -0
- package/dist/schema/tasks.d.ts +114 -0
- package/dist/skills/index.js +2 -2
- package/dist/ui-instance/types.d.ts +1 -0
- package/dist/ui-plugin/app-manifest.d.ts +1 -1
- package/dist/ui-plugin/html-viewer-document-policy.d.ts +23 -0
- package/dist/ui-plugin/index.d.ts +2 -0
- package/dist/ui-plugin/types.d.ts +2 -0
- package/dist/utils/id.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
import type { FinalizeTaskForHostShutdownOptions, FinalizeTaskForHostShutdownOutcome, FinalizeTaskStopOptions, TaskRepository, TaskRow, TaskStopOrigin, TaskStopRequestResult } from '../repository/task.repository.js';
|
|
2
|
-
import { checkProcessOwnershipAsync as defaultCheckProcessOwnershipAsync, terminateProcessTree as defaultTerminateProcessTree, type ProcessControlOptions } from '../process/process-control.js';
|
|
2
|
+
import { checkProcessOwnershipAsync as defaultCheckProcessOwnershipAsync, readProcessIdentityAsync as defaultReadProcessIdentityAsync, terminateProcessTree as defaultTerminateProcessTree, type ProcessControlOptions, type ProcessOwnership } from '../process/process-control.js';
|
|
3
3
|
export declare const TASK_STOP_DEFAULT_GRACE_MS = 5000;
|
|
4
4
|
export declare const TASK_STOP_DEFAULT_POLL_MS = 250;
|
|
5
5
|
export declare function resolveTaskStopMethod(requestedAt: string | null | undefined, completedAt?: string | number, graceMs?: number): 'cooperative' | 'forced';
|
|
6
6
|
export declare const TASK_STOP_OWNED_PROCESS_MARKERS: readonly ["crewx", "claude", "codex", "opencode", "grok", "node"];
|
|
7
|
+
export interface RecordedTaskProcess {
|
|
8
|
+
pid: number;
|
|
9
|
+
startedAt: string | null | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface RecordedProcessOwnershipOptions {
|
|
12
|
+
ownershipMarkers?: readonly string[];
|
|
13
|
+
processControl?: StopTaskProcessControl;
|
|
14
|
+
processControlOptions?: ProcessControlOptions;
|
|
15
|
+
}
|
|
16
|
+
export declare function recordedTaskProcesses(row: Pick<TaskRow, 'pid' | 'pid_started_at' | 'metadata'>): RecordedTaskProcess[];
|
|
17
|
+
export type RecordedProcessJudgement = {
|
|
18
|
+
verdict: 'owned';
|
|
19
|
+
} | {
|
|
20
|
+
verdict: 'reused';
|
|
21
|
+
reason: string;
|
|
22
|
+
} | {
|
|
23
|
+
verdict: 'unproven';
|
|
24
|
+
ownership: ProcessOwnership;
|
|
25
|
+
reason: string;
|
|
26
|
+
};
|
|
27
|
+
export interface RecordedProcessJudgementOptions extends RecordedProcessOwnershipOptions {
|
|
28
|
+
legacyStartBoundaryMs?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function judgeRecordedProcess(target: RecordedTaskProcess, options?: RecordedProcessJudgementOptions): Promise<RecordedProcessJudgement>;
|
|
31
|
+
export declare function checkRecordedProcessOwnership(target: RecordedTaskProcess, options?: RecordedProcessOwnershipOptions): Promise<ProcessOwnership>;
|
|
7
32
|
export type StopTaskStatus = 'stopped' | 'not_running' | 'already_requested' | 'ownership_unverified' | 'failed';
|
|
8
33
|
export interface StopTaskResult {
|
|
9
34
|
status: StopTaskStatus;
|
|
@@ -14,6 +39,7 @@ export interface StopTaskResult {
|
|
|
14
39
|
}
|
|
15
40
|
export interface StopTaskProcessControl {
|
|
16
41
|
checkProcessOwnershipAsync?: typeof defaultCheckProcessOwnershipAsync;
|
|
42
|
+
readProcessIdentityAsync?: typeof defaultReadProcessIdentityAsync;
|
|
17
43
|
terminateProcessTree?: typeof defaultTerminateProcessTree;
|
|
18
44
|
}
|
|
19
45
|
export interface StopTaskOptions {
|
|
@@ -29,7 +29,7 @@ export interface UpdateAdmissionReservationEntry {
|
|
|
29
29
|
scheduleId: string;
|
|
30
30
|
corrupt: boolean;
|
|
31
31
|
}
|
|
32
|
-
export declare function reserveUpdateAdmission(taskId: string, scheduleId: string, timeoutMs: number): boolean;
|
|
32
|
+
export declare function reserveUpdateAdmission(taskId: string, scheduleId: string, timeoutMs: number, runId?: string): boolean;
|
|
33
33
|
export declare function releaseUpdateAdmissionReservation(taskId: string): void;
|
|
34
34
|
export declare function readUpdateAdmissionReservations(): UpdateAdmissionReservationEntry[];
|
|
35
35
|
export type DurableTaskAdmission = {
|
package/dist/mcp-app/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const MCP_APP_RESOURCE_MIME_TYPE: "text/html;profile=mcp-app";
|
|
|
7
7
|
export declare const MCP_APP_RESOURCE_URI_PREFIX = "ui://crewx/";
|
|
8
8
|
export type McpAppToolVisibility = 'model' | 'app';
|
|
9
9
|
export type McpAppTone = 'blue' | 'violet' | 'emerald' | 'amber' | 'rose' | 'sky' | 'slate' | 'indigo';
|
|
10
|
-
export declare const MCP_APP_HOST_TOOL_ALLOWLIST: readonly ["crewx_app_terminal_connect", "crewx_app_html_viewer_open"];
|
|
10
|
+
export declare const MCP_APP_HOST_TOOL_ALLOWLIST: readonly ["crewx_app_terminal_connect", "crewx_app_html_viewer_open", "crewx_app_browser"];
|
|
11
11
|
export type McpAppHostToolName = typeof MCP_APP_HOST_TOOL_ALLOWLIST[number];
|
|
12
12
|
export declare const MCP_CORE_TOOL_NAMES: readonly ["crewx_listWorkspaces", "crewx_queryAgent", "crewx_executeAgent", "crewx_getTaskResult", "crewx_listTasks", "crewx_listAgents", "callBrowser", "openTab", "listTabs", "closeTab"];
|
|
13
13
|
export type McpCoreToolName = typeof MCP_CORE_TOOL_NAMES[number];
|
|
@@ -115,6 +115,7 @@ export interface McpAppLocalRegistrationInput {
|
|
|
115
115
|
readonly csp?: McpUiResourceCsp;
|
|
116
116
|
readonly runtime?: NonNullable<UiPluginManifestV2['runtime']>;
|
|
117
117
|
readonly deviceFeatures?: readonly string[];
|
|
118
|
+
readonly downloads?: true;
|
|
118
119
|
readonly definition: UiDefinition;
|
|
119
120
|
readonly html: string;
|
|
120
121
|
readonly entryHash: string;
|
|
@@ -181,6 +182,7 @@ export interface McpAppLocalRegistration {
|
|
|
181
182
|
readonly definition: UiDefinition;
|
|
182
183
|
readonly runtime?: NonNullable<UiPluginManifestV2['runtime']>;
|
|
183
184
|
readonly deviceFeatures?: readonly string[];
|
|
185
|
+
readonly downloads?: true;
|
|
184
186
|
readonly provenance?: ProductAppBundleProvenance;
|
|
185
187
|
readonly resourceBinding: McpAppInstanceResourceBinding;
|
|
186
188
|
readonly resource: McpAppLocalResource;
|
|
@@ -14,6 +14,7 @@ export interface WorkspaceAppSnapshotResource extends McpAppLocalResource {
|
|
|
14
14
|
readonly runtime?: NonNullable<UiPluginManifestV2['runtime']>;
|
|
15
15
|
readonly csp?: NonNullable<UiPluginManifestV2['csp']>;
|
|
16
16
|
readonly deviceFeatures?: readonly string[];
|
|
17
|
+
readonly downloads?: true;
|
|
17
18
|
readonly source?: WorkspaceAppSource;
|
|
18
19
|
readonly provenance?: ProductAppBundleProvenance;
|
|
19
20
|
readonly assetCatalogId?: string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `schedule_runs` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`schedule_id` text NOT NULL,
|
|
4
|
+
`workspace_id` text NOT NULL,
|
|
5
|
+
`mode` text NOT NULL,
|
|
6
|
+
`trigger` text NOT NULL,
|
|
7
|
+
`occurrence_key` text,
|
|
8
|
+
`task_id` text,
|
|
9
|
+
`app_id` text,
|
|
10
|
+
`schedule_name` text,
|
|
11
|
+
`builtin_id` text,
|
|
12
|
+
`command` text,
|
|
13
|
+
`high_frequency` integer DEFAULT 0 NOT NULL,
|
|
14
|
+
`status` text NOT NULL,
|
|
15
|
+
`error_code` text,
|
|
16
|
+
`exit_code` integer,
|
|
17
|
+
`signal` text,
|
|
18
|
+
`started_at` text NOT NULL,
|
|
19
|
+
`finished_at` text,
|
|
20
|
+
`duration_ms` integer,
|
|
21
|
+
`pid` integer,
|
|
22
|
+
`host_pid` integer,
|
|
23
|
+
`output_tail` text,
|
|
24
|
+
`output_bytes` integer,
|
|
25
|
+
`output_truncated` integer DEFAULT 0 NOT NULL
|
|
26
|
+
);
|
|
27
|
+
--> statement-breakpoint
|
|
28
|
+
CREATE INDEX IF NOT EXISTS `idx_schedule_runs_workspace_started` ON `schedule_runs` (`workspace_id`,"started_at" DESC);--> statement-breakpoint
|
|
29
|
+
CREATE INDEX IF NOT EXISTS `idx_schedule_runs_schedule_started` ON `schedule_runs` (`schedule_id`,"started_at" DESC);--> statement-breakpoint
|
|
30
|
+
CREATE INDEX IF NOT EXISTS `idx_schedule_runs_task_id` ON `schedule_runs` (`task_id`);--> statement-breakpoint
|
|
31
|
+
CREATE INDEX IF NOT EXISTS `idx_schedule_runs_running` ON `schedule_runs` (`workspace_id`,`started_at`) WHERE "schedule_runs"."status" = 'running';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `tasks` ADD `workflow_run_id` text;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `tasks` ADD `pid_started_at` text;
|