@crewx/sdk 0.9.0-rc.3 → 0.9.0-rc.31
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/config/canonicalize-agent-options.d.ts +16 -0
- package/dist/config/models.generated.d.ts +22 -0
- package/dist/config/models.remote.d.ts +4 -0
- package/dist/config/overdrive.d.ts +24 -0
- package/dist/config/pricing.d.ts +8 -8
- package/dist/config/pricing.generated.d.ts +2 -0
- package/dist/config/pricing.remote.d.ts +4 -0
- package/dist/config/pricing.types.d.ts +5 -0
- package/dist/config/timeout.config.d.ts +3 -0
- package/dist/esm/index.js +123 -81
- package/dist/esm/plugins/index.js +119 -72
- package/dist/esm/repository/index.js +107 -60
- package/dist/esm/testing/index.js +1 -1
- package/dist/facade/Crewx.d.ts +5 -0
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.js +2 -2
- package/dist/index.d.ts +11 -4
- package/dist/index.js +124 -82
- 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/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/_journal.json +35 -0
- package/dist/plugins/index.js +119 -72
- package/dist/provider/acp/adapters/claude.d.ts +0 -4
- package/dist/provider/acp/connection.d.ts +4 -0
- package/dist/provider/acp/meta.d.ts +4 -0
- package/dist/provider/bridge.d.ts +13 -1
- package/dist/provider/cli/adapter.types.d.ts +1 -0
- package/dist/provider/cli/adapters/claude.d.ts +0 -1
- package/dist/provider/cli/adapters/cli-knob.util.d.ts +2 -0
- package/dist/provider/cli/meta.d.ts +10 -2
- package/dist/provider/idle-watchdog.d.ts +19 -0
- package/dist/provider/models.d.ts +23 -0
- package/dist/provider/order.d.ts +1 -0
- package/dist/repository/index.d.ts +5 -1
- package/dist/repository/index.js +107 -60
- package/dist/repository/notification.repository.d.ts +58 -0
- package/dist/repository/task.repository.d.ts +34 -0
- package/dist/repository/thread.repository.d.ts +16 -2
- package/dist/repository/usage-report.repository.d.ts +27 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/notifications.d.ts +303 -0
- package/dist/schema/usage-reports.d.ts +252 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/utils/id.d.ts +1 -1
- package/package.json +3 -2
- package/templates/agents/default.yaml +34 -0
|
@@ -12,6 +12,10 @@ export interface AcpProviderMetaResult {
|
|
|
12
12
|
id: string;
|
|
13
13
|
name?: string;
|
|
14
14
|
}>;
|
|
15
|
+
modelOverrides?: Record<string, {
|
|
16
|
+
effort?: string[];
|
|
17
|
+
defaultEffort?: string;
|
|
18
|
+
}>;
|
|
15
19
|
capabilities: Record<string, boolean>;
|
|
16
20
|
}
|
|
17
21
|
declare function extractProviderMeta(adapterId: string, displayName: string | undefined, initResponse: InitializeResponse, sessionResponse: NewSessionResponse): AcpProviderMetaResult;
|
|
@@ -3,8 +3,10 @@ export declare function parseStreamJsonOutput(raw: string): string;
|
|
|
3
3
|
export declare function parseResultEventUsage(raw: string): ProviderUsage | null;
|
|
4
4
|
export { ProviderError, IdleTimeoutError, TotalTimeoutError, type ProviderErrorCode, type ProviderErrorKind, type ProviderErrorOptions, } from './errors.js';
|
|
5
5
|
export declare function shouldFallbackToGhCopilot(providerId: string, err: unknown, platform?: NodeJS.Platform): boolean;
|
|
6
|
+
export declare const KILL_GRACE_MS = 2000;
|
|
6
7
|
export interface RunCliProcessOptions {
|
|
7
8
|
timeoutMs?: number;
|
|
9
|
+
idleMs?: number;
|
|
8
10
|
env?: Record<string, string>;
|
|
9
11
|
cwd?: string;
|
|
10
12
|
onOutput?: (line: string, level: 'stdout' | 'stderr') => void;
|
|
@@ -37,6 +39,11 @@ export declare class ClientToolCallRequiredError extends Error {
|
|
|
37
39
|
constructor(toolCall: ClientToolCall, continuationState: ContinuationState);
|
|
38
40
|
}
|
|
39
41
|
export type ProviderFactory = (id: string, providerStr: string) => ProviderRuntime;
|
|
42
|
+
export type AdditionalArgsProvider = (ctx: {
|
|
43
|
+
providerStr: string;
|
|
44
|
+
providerId: string;
|
|
45
|
+
mode?: string;
|
|
46
|
+
}) => string[];
|
|
40
47
|
export declare function registerProviderFactory(namespace: string, factory: ProviderFactory): void;
|
|
41
48
|
export interface ProviderUsage {
|
|
42
49
|
inputTokens: number;
|
|
@@ -62,6 +69,7 @@ export interface ProviderQueryOptions {
|
|
|
62
69
|
env?: Record<string, string>;
|
|
63
70
|
cwd?: string;
|
|
64
71
|
timeoutMs?: number;
|
|
72
|
+
idleMs?: number;
|
|
65
73
|
configOptions?: Record<string, string>;
|
|
66
74
|
tools?: import('../facade/Crewx').ToolDefinition[];
|
|
67
75
|
maxSteps?: number;
|
|
@@ -76,4 +84,8 @@ export interface ProviderRuntime {
|
|
|
76
84
|
}>, options?: ProviderQueryOptions): Promise<string>;
|
|
77
85
|
dispose?(): Promise<void>;
|
|
78
86
|
}
|
|
79
|
-
export declare function createProvider(providerStr: string): ProviderRuntime;
|
|
87
|
+
export declare function createProvider(providerStr: string, additionalArgsProvider?: AdditionalArgsProvider): ProviderRuntime;
|
|
88
|
+
export declare function mergeAdditionalArgs(options: ProviderQueryOptions | undefined, provider: AdditionalArgsProvider | undefined, ctx: {
|
|
89
|
+
providerStr: string;
|
|
90
|
+
providerId: string;
|
|
91
|
+
}): ProviderQueryOptions;
|
|
@@ -3,5 +3,7 @@ export declare function decodeModelEffort(model?: string): {
|
|
|
3
3
|
effort?: string;
|
|
4
4
|
};
|
|
5
5
|
export declare function codexModeArgs(mode?: string): string[];
|
|
6
|
+
export declare function codexResumeModeArgs(mode?: string): string[];
|
|
6
7
|
export declare function codexEffortArgs(effort?: string): string[];
|
|
7
8
|
export declare function claudeModeArgs(mode?: string): string[];
|
|
9
|
+
export declare function claudeEffortArgs(effort?: string): string[];
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { AcpProviderMetaResult } from '../acp/meta.js';
|
|
2
2
|
import type { CliProviderAdapter } from './adapter.types.js';
|
|
3
|
-
export declare function
|
|
4
|
-
|
|
3
|
+
export declare function queryOpencodeModels(): Promise<Array<{
|
|
4
|
+
id: string;
|
|
5
|
+
}>>;
|
|
6
|
+
export declare function cliAdapterMetaToProviderMeta(key: string, adapter: CliProviderAdapter, overrideModels?: Array<{
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
}>): AcpProviderMetaResult | null;
|
|
10
|
+
export declare function queryAllCliProviderMetas(options?: {
|
|
11
|
+
includeOpencodeRuntimeModels?: boolean;
|
|
12
|
+
}): Promise<AcpProviderMetaResult[]>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface IdleWatchdogOptions {
|
|
2
|
+
timeoutMs: number;
|
|
3
|
+
onIdle: () => void;
|
|
4
|
+
now?: () => number;
|
|
5
|
+
}
|
|
6
|
+
export declare class IdleWatchdog {
|
|
7
|
+
private readonly timeoutMs;
|
|
8
|
+
private readonly onIdleCb;
|
|
9
|
+
private readonly now;
|
|
10
|
+
private timer;
|
|
11
|
+
private lastActivity;
|
|
12
|
+
private settled;
|
|
13
|
+
constructor(options: IdleWatchdogOptions);
|
|
14
|
+
start(): void;
|
|
15
|
+
refresh(): void;
|
|
16
|
+
stop(): void;
|
|
17
|
+
private scheduleCheck;
|
|
18
|
+
private fireIdle;
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ModelCatalogEntry, type ProviderCatalogEntry, type ProviderModeEntry, type ProviderModelOverride } from '../config/models.generated.js';
|
|
2
|
+
export type { ModelCatalogEntry, ProviderCatalogEntry, ProviderModeEntry, ProviderModelOverride, } from '../config/models.generated.js';
|
|
3
|
+
export declare function setModelsOverride(providers: Record<string, ProviderCatalogEntry | ModelCatalogEntry[]>): void;
|
|
4
|
+
export declare function clearModelsOverride(): void;
|
|
5
|
+
export declare function getProviderModels(provider: string): ModelCatalogEntry[];
|
|
6
|
+
export declare function getProviderCatalog(provider: string): ProviderCatalogEntry;
|
|
7
|
+
export declare function getProviderModes(provider: string): ProviderModeEntry[];
|
|
8
|
+
export declare function getProviderEffort(provider: string, model?: string): string[];
|
|
9
|
+
export declare function getProviderModelOverrides(provider: string): Record<string, ProviderModelOverride>;
|
|
10
|
+
export declare function getClaudeModels(): ModelCatalogEntry[];
|
|
11
|
+
export declare function getCodexModels(): ModelCatalogEntry[];
|
|
12
|
+
export declare function getCopilotModels(): ModelCatalogEntry[];
|
|
13
|
+
export declare function getAntigravityModels(): ModelCatalogEntry[];
|
|
14
|
+
export declare function mergeModels(a: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
}>, b: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
}>): Array<{
|
|
21
|
+
id: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
}>;
|
package/dist/provider/order.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const PROVIDER_ORDER: readonly ["codex", "claude", "opencode", "antigravity", "copilot"];
|
|
2
2
|
export declare function providerRank(id: string): number;
|
|
3
3
|
export declare function compareProviders(a: string, b: string): number;
|
|
4
|
+
export declare function normalizeProviderId(provider?: string): string;
|
|
@@ -11,7 +11,7 @@ export type { PushResult } from './push.js';
|
|
|
11
11
|
export type { Workspace, NewWorkspace } from '../schema/index.js';
|
|
12
12
|
export { tasks } from '../schema/index.js';
|
|
13
13
|
export { TaskRepository } from './task.repository.js';
|
|
14
|
-
export type { TaskRow, NewTask, AgentUsageRow, TrendRow, ProviderUsageRow } from './task.repository.js';
|
|
14
|
+
export type { TaskRow, TaskListRow, NewTask, AgentUsageRow, TrendRow, ProviderUsageRow, ModelUsageRow, ReportTaskRow, WorkflowCardRow, } from './task.repository.js';
|
|
15
15
|
export { ThreadRepository } from './thread.repository.js';
|
|
16
16
|
export type { ThreadRow, NewThread } from './thread.repository.js';
|
|
17
17
|
export { SpanRepository } from './span.repository.js';
|
|
@@ -24,3 +24,7 @@ export { RequestLogRepository } from './request-log.repository.js';
|
|
|
24
24
|
export type { RequestLogRow, NewRequestLog, RequestLogEntry } from './request-log.repository.js';
|
|
25
25
|
export { UsageLimitSnapshotRepository, calcBucketStart } from './usage-limit-snapshot.repository.js';
|
|
26
26
|
export type { UsageLimitSnapshotRow, NewUsageLimitSnapshot, UpsertSnapshotInput, LimitTrendPoint, LimitTrendProvider, } from './usage-limit-snapshot.repository.js';
|
|
27
|
+
export { UsageReportRepository } from './usage-report.repository.js';
|
|
28
|
+
export type { UsageReportRow, NewUsageReport, PublishReportInput } from './usage-report.repository.js';
|
|
29
|
+
export { NotificationRepository, DEFAULT_NOTIFICATION_CAP, DEFAULT_LIST_LIMIT as DEFAULT_NOTIFICATION_LIST_LIMIT, } from './notification.repository.js';
|
|
30
|
+
export type { NotificationRow, NewNotification, NotificationReadRow, NotificationLevel, NotificationSource, CreateNotificationInput, NotificationListItem, ListNotificationsParams, UserScope as NotificationUserScope, MarkReadParams as NotificationMarkReadParams, } from './notification.repository.js';
|