@crewx/sdk 0.9.0-rc.6 → 0.9.0-rc.60
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/README.md +1 -1
- package/dist/activity-log/builder.d.ts +55 -6
- package/dist/config/canonicalize-agent-options.d.ts +17 -0
- package/dist/config/global-settings.d.ts +19 -0
- package/dist/config/migrate-grok-mode.d.ts +6 -0
- package/dist/config/model-compat.d.ts +16 -0
- package/dist/config/models.generated.d.ts +55 -0
- package/dist/config/models.remote.d.ts +4 -0
- package/dist/config/overdrive.d.ts +31 -0
- package/dist/config/pricing.d.ts +9 -5
- package/dist/config/pricing.generated.d.ts +4 -0
- package/dist/config/pricing.types.d.ts +4 -0
- package/dist/config/timeout.config.d.ts +3 -0
- package/dist/config/wi-boards.d.ts +19 -0
- package/dist/context-budget/index.d.ts +105 -0
- package/dist/conversation/index.d.ts +1 -1
- package/dist/conversation/to-template-messages.d.ts +7 -0
- package/dist/conversation/types.d.ts +1 -0
- package/dist/desktop/command-runner.d.ts +4 -0
- package/dist/desktop/default-adapters.d.ts +4 -0
- package/dist/desktop/global-install.d.ts +19 -0
- package/dist/desktop/index.d.ts +2 -0
- package/dist/desktop/index.js +3 -0
- package/dist/desktop/install.d.ts +5 -0
- package/dist/desktop/lnk.d.ts +22 -0
- package/dist/desktop/manifest.d.ts +21 -0
- package/dist/desktop/types.d.ts +67 -0
- package/dist/desktop/version.d.ts +1 -0
- package/dist/desktop/windows-paths.d.ts +21 -0
- package/dist/desktop/wrapper.d.ts +18 -0
- package/dist/esm/desktop/index.js +3 -0
- package/dist/esm/index.js +240 -102
- package/dist/esm/plugins/index.js +150 -90
- package/dist/esm/publish/index.js +1 -0
- package/dist/esm/repository/index.js +126 -66
- package/dist/esm/testing/index.js +1 -1
- package/dist/events/types.d.ts +3 -0
- package/dist/facade/Crewx.d.ts +28 -0
- package/dist/index.browser.d.ts +6 -1
- package/dist/index.browser.js +6 -2
- package/dist/index.d.ts +37 -9
- package/dist/index.js +240 -102
- package/dist/internal/windows-spawn.d.ts +10 -0
- package/dist/migrations/0008_careful_black_bird.sql +17 -0
- package/dist/migrations/0009_hot_dark_phoenix.sql +1 -0
- package/dist/migrations/0010_analyze_stats.sql +6 -0
- package/dist/migrations/0011_far_black_tarantula.sql +1 -0
- package/dist/migrations/0012_blue_turbo.sql +23 -0
- package/dist/migrations/0013_hesitant_adam_destine.sql +15 -0
- package/dist/migrations/0014_organic_mongu.sql +73 -0
- package/dist/migrations/meta/0008_snapshot.json +1327 -0
- package/dist/migrations/meta/0009_snapshot.json +1335 -0
- package/dist/migrations/meta/0010_snapshot.json +1335 -0
- package/dist/migrations/meta/0011_snapshot.json +1342 -0
- package/dist/migrations/meta/0012_snapshot.json +1494 -0
- package/dist/migrations/meta/0013_snapshot.json +1592 -0
- package/dist/migrations/meta/0014_snapshot.json +1975 -0
- package/dist/migrations/meta/_journal.json +49 -0
- package/dist/paths.d.ts +1 -0
- package/dist/plugin/types.d.ts +1 -0
- package/dist/plugins/index.js +150 -90
- package/dist/provider/acp/adapters/claude.d.ts +0 -1
- package/dist/provider/acp/connection.d.ts +4 -0
- package/dist/provider/acp/meta.d.ts +15 -0
- package/dist/provider/bridge.d.ts +16 -1
- package/dist/provider/classify-task-error.d.ts +2 -0
- package/dist/provider/cli/adapter.types.d.ts +6 -0
- package/dist/provider/cli/adapters/cli-knob.util.d.ts +6 -0
- package/dist/provider/cli/adapters/grok.d.ts +2 -0
- package/dist/provider/cli/adapters/index.d.ts +1 -0
- package/dist/provider/cli/index.d.ts +1 -1
- package/dist/provider/cli/meta.d.ts +8 -1
- package/dist/provider/errors.d.ts +1 -0
- package/dist/provider/idle-watchdog.d.ts +19 -0
- package/dist/provider/models.d.ts +26 -24
- package/dist/provider/order.d.ts +1 -1
- package/dist/provider/parse-usage.d.ts +6 -0
- package/dist/provider/provider-selection.d.ts +8 -0
- package/dist/provider/redact-technical-message.d.ts +1 -0
- package/dist/provider/task-error.types.d.ts +16 -0
- package/dist/publish/auth-boundary.d.ts +22 -0
- package/dist/publish/auth-json.d.ts +11 -0
- package/dist/publish/constants.d.ts +6 -0
- package/dist/publish/index.d.ts +30 -0
- package/dist/publish/index.js +1 -0
- package/dist/publish/manifest.d.ts +17 -0
- package/dist/publish/marketplace-api.constants.d.ts +1 -0
- package/dist/publish/pack.d.ts +2 -0
- package/dist/publish/scan.d.ts +9 -0
- package/dist/publish/secrets.d.ts +6 -0
- package/dist/publish/upload.d.ts +18 -0
- package/dist/repository/agent-suggestion.repository.d.ts +34 -0
- package/dist/repository/index.d.ts +7 -1
- package/dist/repository/index.js +126 -66
- package/dist/repository/notification.repository.d.ts +58 -0
- package/dist/repository/task.repository.d.ts +94 -0
- package/dist/repository/thread.repository.d.ts +16 -2
- package/dist/repository/usage-report.repository.d.ts +27 -0
- package/dist/schema/agent-suggestions.d.ts +199 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/notifications.d.ts +303 -0
- package/dist/schema/ui-action-receipts.d.ts +303 -0
- package/dist/schema/ui-instances.d.ts +267 -0
- package/dist/schema/usage-reports.d.ts +252 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +1 -1
- package/dist/types/index.d.ts +448 -3
- package/dist/ui-card/index.d.ts +2 -0
- package/dist/ui-card/legacy-card-parser.d.ts +11 -0
- package/dist/ui-instance/definition.d.ts +6 -0
- package/dist/ui-instance/errors.d.ts +17 -0
- package/dist/ui-instance/index.d.ts +6 -0
- package/dist/ui-instance/json.d.ts +5 -0
- package/dist/ui-instance/runtime.d.ts +13 -0
- package/dist/ui-instance/store.d.ts +65 -0
- package/dist/ui-instance/types.d.ts +200 -0
- package/dist/utils/crewx-home.d.ts +1 -0
- package/dist/utils/id.d.ts +1 -1
- package/dist/utils/timestamp.d.ts +1 -0
- package/dist/wi/create.d.ts +48 -0
- package/dist/wi/select.d.ts +20 -0
- package/package.json +19 -3
- package/templates/agents/default.yaml +175 -117
- package/templates/documents/crewx-manual.md +138 -138
- package/templates/workflows/wi-default-flow.yaml +65 -0
- package/templates/workflows/wi-plan-flow.yaml +140 -0
|
@@ -20,15 +20,25 @@ export type WindowsSpawnInvocation = {
|
|
|
20
20
|
shell?: boolean;
|
|
21
21
|
windowsHide?: boolean;
|
|
22
22
|
};
|
|
23
|
+
export type BinResolutionMode = 'global_first' | 'local_first';
|
|
24
|
+
export type ResolveExecutablePathOptions = {
|
|
25
|
+
cwd?: string;
|
|
26
|
+
env?: NodeJS.ProcessEnv;
|
|
27
|
+
platform?: NodeJS.Platform;
|
|
28
|
+
resolution?: BinResolutionMode;
|
|
29
|
+
};
|
|
23
30
|
export type ResolveWindowsSpawnProgramParams = {
|
|
24
31
|
command: string;
|
|
25
32
|
platform?: NodeJS.Platform;
|
|
26
33
|
env?: NodeJS.ProcessEnv;
|
|
27
34
|
execPath?: string;
|
|
28
35
|
packageName?: string;
|
|
36
|
+
cwd?: string;
|
|
37
|
+
resolution?: BinResolutionMode;
|
|
29
38
|
allowShellFallback?: boolean;
|
|
30
39
|
};
|
|
31
40
|
export type ResolveWindowsSpawnProgramCandidateParams = Omit<ResolveWindowsSpawnProgramParams, 'allowShellFallback'>;
|
|
41
|
+
export declare function resolveExecutablePath(command: string, options?: ResolveExecutablePathOptions): string;
|
|
32
42
|
export declare function resolveWindowsExecutablePath(command: string, env: NodeJS.ProcessEnv): string;
|
|
33
43
|
export declare function resolveWindowsSpawnProgramCandidate(params: ResolveWindowsSpawnProgramCandidateParams): WindowsSpawnProgramCandidate;
|
|
34
44
|
export declare function applyWindowsSpawnProgramPolicy(params: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `usage_reports` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`workspace_id` text NOT NULL,
|
|
4
|
+
`month` text NOT NULL,
|
|
5
|
+
`generated_at` text NOT NULL,
|
|
6
|
+
`source_range` text NOT NULL,
|
|
7
|
+
`tier` text NOT NULL,
|
|
8
|
+
`total_tokens` integer NOT NULL,
|
|
9
|
+
`total_cost_usd` real NOT NULL,
|
|
10
|
+
`payload` text NOT NULL,
|
|
11
|
+
`payload_hash` text,
|
|
12
|
+
`signature` text,
|
|
13
|
+
`signed_at` text,
|
|
14
|
+
`issuer` text
|
|
15
|
+
);
|
|
16
|
+
--> statement-breakpoint
|
|
17
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `uniq_usage_reports_ws_month` ON `usage_reports` (`workspace_id`,`month`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE INDEX IF NOT EXISTS `idx_threads_ws_updated` ON `threads` (`workspace_id`,`updated_at`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE INDEX IF NOT EXISTS `idx_threads_title` ON `threads` (`title`);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `notification_reads` (
|
|
2
|
+
`notification_id` text NOT NULL,
|
|
3
|
+
`user_id` text NOT NULL,
|
|
4
|
+
`read_at` text NOT NULL,
|
|
5
|
+
PRIMARY KEY(`notification_id`, `user_id`)
|
|
6
|
+
);
|
|
7
|
+
--> statement-breakpoint
|
|
8
|
+
CREATE TABLE IF NOT EXISTS `notifications` (
|
|
9
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
10
|
+
`workspace_id` text NOT NULL,
|
|
11
|
+
`agent_id` text,
|
|
12
|
+
`task_id` text,
|
|
13
|
+
`thread_id` text,
|
|
14
|
+
`source` text DEFAULT 'agent' NOT NULL,
|
|
15
|
+
`level` text DEFAULT 'info' NOT NULL,
|
|
16
|
+
`title` text NOT NULL,
|
|
17
|
+
`body` text,
|
|
18
|
+
`target_user_id` text,
|
|
19
|
+
`created_at` text NOT NULL,
|
|
20
|
+
`metadata` text
|
|
21
|
+
);
|
|
22
|
+
--> statement-breakpoint
|
|
23
|
+
CREATE INDEX IF NOT EXISTS `idx_notifications_ws_created` ON `notifications` (`workspace_id`,"created_at" DESC);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `agent_suggestions` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`workspace_id` text NOT NULL,
|
|
4
|
+
`agent_id` text NOT NULL,
|
|
5
|
+
`task_id` text,
|
|
6
|
+
`type` text NOT NULL,
|
|
7
|
+
`status` text DEFAULT 'pending' NOT NULL,
|
|
8
|
+
`payload` text NOT NULL,
|
|
9
|
+
`applied_commit_sha` text,
|
|
10
|
+
`created_at` text NOT NULL,
|
|
11
|
+
`updated_at` text NOT NULL
|
|
12
|
+
);
|
|
13
|
+
--> statement-breakpoint
|
|
14
|
+
CREATE INDEX IF NOT EXISTS `idx_agent_suggestions_ws_agent` ON `agent_suggestions` (`workspace_id`,`agent_id`);--> statement-breakpoint
|
|
15
|
+
CREATE INDEX IF NOT EXISTS `idx_agent_suggestions_ws_created` ON `agent_suggestions` (`workspace_id`,`created_at`);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS `ui_instances` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`definition_id` text NOT NULL,
|
|
4
|
+
`definition_version` integer NOT NULL,
|
|
5
|
+
`definition_hash` text NOT NULL,
|
|
6
|
+
`workspace_id` text NOT NULL,
|
|
7
|
+
`thread_id` text NOT NULL,
|
|
8
|
+
`anchor_task_id` text,
|
|
9
|
+
`domain_ref_json` text NOT NULL,
|
|
10
|
+
`state_json` text NOT NULL,
|
|
11
|
+
`revision` integer DEFAULT 0 NOT NULL,
|
|
12
|
+
`status` text DEFAULT 'active' NOT NULL,
|
|
13
|
+
`granted_capabilities_json` text DEFAULT '[]' NOT NULL,
|
|
14
|
+
`created_at` integer NOT NULL,
|
|
15
|
+
`updated_at` integer NOT NULL,
|
|
16
|
+
CONSTRAINT "ui_instances_id_ck" CHECK(length("ui_instances"."id") BETWEEN 5 AND 128 AND "ui_instances"."id" GLOB 'uic_*'),
|
|
17
|
+
CONSTRAINT "ui_instances_definition_id_ck" CHECK(length("ui_instances"."definition_id") BETWEEN 1 AND 128),
|
|
18
|
+
CONSTRAINT "ui_instances_definition_version_ck" CHECK("ui_instances"."definition_version" >= 1),
|
|
19
|
+
CONSTRAINT "ui_instances_definition_hash_ck" CHECK(length("ui_instances"."definition_hash") = 64 AND "ui_instances"."definition_hash" NOT GLOB '*[^0-9a-f]*'),
|
|
20
|
+
CONSTRAINT "ui_instances_workspace_id_ck" CHECK(length("ui_instances"."workspace_id") BETWEEN 1 AND 256),
|
|
21
|
+
CONSTRAINT "ui_instances_thread_id_ck" CHECK(length("ui_instances"."thread_id") BETWEEN 1 AND 256),
|
|
22
|
+
CONSTRAINT "ui_instances_domain_ref_json_ck" CHECK(json_valid("ui_instances"."domain_ref_json") AND json_type("ui_instances"."domain_ref_json") = 'object'),
|
|
23
|
+
CONSTRAINT "ui_instances_state_json_ck" CHECK(json_valid("ui_instances"."state_json") AND json_type("ui_instances"."state_json") = 'object'),
|
|
24
|
+
CONSTRAINT "ui_instances_revision_ck" CHECK("ui_instances"."revision" >= 0),
|
|
25
|
+
CONSTRAINT "ui_instances_status_ck" CHECK("ui_instances"."status" IN ('active', 'completed', 'expired', 'revoked', 'unsupported')),
|
|
26
|
+
CONSTRAINT "ui_instances_granted_capabilities_json_ck" CHECK(json_valid("ui_instances"."granted_capabilities_json") AND json_type("ui_instances"."granted_capabilities_json") = 'array'),
|
|
27
|
+
CONSTRAINT "ui_instances_created_at_ck" CHECK("ui_instances"."created_at" >= 0),
|
|
28
|
+
CONSTRAINT "ui_instances_updated_at_ck" CHECK("ui_instances"."updated_at" >= "ui_instances"."created_at")
|
|
29
|
+
);
|
|
30
|
+
--> statement-breakpoint
|
|
31
|
+
CREATE INDEX IF NOT EXISTS `ui_instances_workspace_thread_idx` ON `ui_instances` (`workspace_id`,`thread_id`);--> statement-breakpoint
|
|
32
|
+
CREATE TABLE IF NOT EXISTS `ui_action_receipts` (
|
|
33
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
34
|
+
`instance_id` text NOT NULL,
|
|
35
|
+
`request_id` text NOT NULL,
|
|
36
|
+
`action_id` text NOT NULL,
|
|
37
|
+
`actor_json` text NOT NULL,
|
|
38
|
+
`source` text NOT NULL,
|
|
39
|
+
`expected_revision` integer NOT NULL,
|
|
40
|
+
`before_revision` integer NOT NULL,
|
|
41
|
+
`after_revision` integer,
|
|
42
|
+
`status` text NOT NULL,
|
|
43
|
+
`outcome` text,
|
|
44
|
+
`input_json` text NOT NULL,
|
|
45
|
+
`result_json` text,
|
|
46
|
+
`error_code` text,
|
|
47
|
+
`requested_at` integer NOT NULL,
|
|
48
|
+
`settled_at` integer,
|
|
49
|
+
CONSTRAINT "ui_action_receipts_id_ck" CHECK(length("ui_action_receipts"."id") BETWEEN 5 AND 128),
|
|
50
|
+
CONSTRAINT "ui_action_receipts_instance_id_ck" CHECK(length("ui_action_receipts"."instance_id") BETWEEN 1 AND 128),
|
|
51
|
+
CONSTRAINT "ui_action_receipts_request_id_ck" CHECK(length("ui_action_receipts"."request_id") BETWEEN 1 AND 128),
|
|
52
|
+
CONSTRAINT "ui_action_receipts_action_id_ck" CHECK(length("ui_action_receipts"."action_id") BETWEEN 1 AND 128),
|
|
53
|
+
CONSTRAINT "ui_action_receipts_actor_json_ck" CHECK(json_valid("ui_action_receipts"."actor_json") AND json_type("ui_action_receipts"."actor_json") = 'object'),
|
|
54
|
+
CONSTRAINT "ui_action_receipts_source_ck" CHECK("ui_action_receipts"."source" IN ('ui_host', 'cli', 'system')),
|
|
55
|
+
CONSTRAINT "ui_action_receipts_expected_revision_ck" CHECK("ui_action_receipts"."expected_revision" >= 0),
|
|
56
|
+
CONSTRAINT "ui_action_receipts_before_revision_ck" CHECK("ui_action_receipts"."before_revision" >= 0),
|
|
57
|
+
CONSTRAINT "ui_action_receipts_after_revision_ck" CHECK("ui_action_receipts"."after_revision" IS NULL OR "ui_action_receipts"."after_revision" >= 0),
|
|
58
|
+
CONSTRAINT "ui_action_receipts_status_ck" CHECK("ui_action_receipts"."status" IN ('requested', 'settled')),
|
|
59
|
+
CONSTRAINT "ui_action_receipts_outcome_ck" CHECK("ui_action_receipts"."outcome" IS NULL OR "ui_action_receipts"."outcome" IN ('succeeded', 'rejected', 'failed', 'conflicted', 'expired')),
|
|
60
|
+
CONSTRAINT "ui_action_receipts_input_json_ck" CHECK(json_valid("ui_action_receipts"."input_json") AND json_type("ui_action_receipts"."input_json") = 'object'),
|
|
61
|
+
CONSTRAINT "ui_action_receipts_result_json_ck" CHECK("ui_action_receipts"."result_json" IS NULL OR (json_valid("ui_action_receipts"."result_json") AND json_type("ui_action_receipts"."result_json") = 'object')),
|
|
62
|
+
CONSTRAINT "ui_action_receipts_requested_at_ck" CHECK("ui_action_receipts"."requested_at" >= 0),
|
|
63
|
+
CONSTRAINT "ui_action_receipts_settled_at_ck" CHECK("ui_action_receipts"."settled_at" IS NULL OR "ui_action_receipts"."settled_at" >= "ui_action_receipts"."requested_at"),
|
|
64
|
+
CONSTRAINT "ui_action_receipts_status_transition_ck" CHECK((
|
|
65
|
+
("ui_action_receipts"."status" = 'requested' AND "ui_action_receipts"."after_revision" IS NULL AND "ui_action_receipts"."outcome" IS NULL AND "ui_action_receipts"."settled_at" IS NULL)
|
|
66
|
+
OR
|
|
67
|
+
("ui_action_receipts"."status" = 'settled' AND "ui_action_receipts"."after_revision" IS NOT NULL AND "ui_action_receipts"."outcome" IS NOT NULL AND "ui_action_receipts"."settled_at" IS NOT NULL)
|
|
68
|
+
))
|
|
69
|
+
);
|
|
70
|
+
--> statement-breakpoint
|
|
71
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `ui_action_receipts_instance_request_uq` ON `ui_action_receipts` (`instance_id`,`request_id`);--> statement-breakpoint
|
|
72
|
+
CREATE INDEX IF NOT EXISTS `ui_action_receipts_instance_id_idx` ON `ui_action_receipts` (`instance_id`);--> statement-breakpoint
|
|
73
|
+
CREATE INDEX IF NOT EXISTS `ui_action_receipts_requested_at_idx` ON `ui_action_receipts` (`requested_at`);
|