@crewx/sdk 0.9.0-rc.9 → 0.9.0-rc.91
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/account/auth-client.d.ts +61 -0
- package/dist/account/auth-json-v2.d.ts +1 -0
- package/dist/account/auth-json.d.ts +30 -0
- package/dist/account/config.d.ts +8 -0
- package/dist/account/errors.d.ts +24 -0
- package/dist/account/index.d.ts +10 -0
- package/dist/account/index.js +1 -0
- package/dist/account/session-manager.d.ts +47 -0
- 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 +33 -0
- package/dist/config/migrate-grok-mode.d.ts +6 -0
- package/dist/config/model-compat.d.ts +31 -0
- package/dist/config/models.generated.d.ts +37 -0
- package/dist/config/models.remote.d.ts +1 -0
- package/dist/config/overdrive.d.ts +7 -0
- package/dist/config/pricing.d.ts +8 -5
- package/dist/config/pricing.generated.d.ts +4 -0
- package/dist/config/pricing.types.d.ts +4 -10
- package/dist/config/timeout.config.d.ts +3 -0
- package/dist/config/wi-boards.d.ts +19 -0
- package/dist/context-budget/continuity.d.ts +61 -0
- package/dist/context-budget/index.d.ts +140 -0
- package/dist/conversation/index.d.ts +1 -1
- package/dist/conversation/sqlite-provider.d.ts +5 -1
- package/dist/conversation/to-template-messages.d.ts +7 -0
- package/dist/conversation/types.d.ts +43 -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/account/index.js +1 -0
- package/dist/esm/desktop/index.js +3 -0
- package/dist/esm/index.js +354 -99
- package/dist/esm/plugins/index.js +213 -103
- package/dist/esm/publish/index.js +1 -0
- package/dist/esm/repository/index.js +200 -94
- package/dist/esm/testing/index.js +1 -1
- package/dist/events/types.d.ts +4 -0
- package/dist/facade/Crewx.d.ts +40 -2
- package/dist/highlight/thread-highlight-prompt.d.ts +2 -0
- package/dist/highlight/thread-highlighter.d.ts +326 -0
- package/dist/index.browser.d.ts +11 -1
- package/dist/index.browser.js +6 -2
- package/dist/index.d.ts +73 -11
- package/dist/index.js +354 -99
- package/dist/internal/console-decoder.d.ts +38 -0
- package/dist/internal/windows-spawn.d.ts +10 -0
- package/dist/layout/types.d.ts +17 -1
- package/dist/local-server/base-url.d.ts +18 -0
- package/dist/local-server/index.d.ts +8 -0
- package/dist/local-server/opencode.d.ts +8 -0
- package/dist/local-server/probe.d.ts +3 -0
- package/dist/local-server/runtime.d.ts +26 -0
- package/dist/local-server/types.d.ts +43 -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/0015_panoramic_gorilla_man.sql +71 -0
- package/dist/migrations/0016_fuzzy_hemingway.sql +14 -0
- package/dist/migrations/0017_project_stage_sdk_migration.sql +29 -0
- package/dist/migrations/0018_bored_jackal.sql +33 -0
- package/dist/migrations/0019_backfill_task_thread_ids.sql +74 -0
- package/dist/migrations/0020_useful_iron_lad.sql +55 -0
- package/dist/migrations/0021_dashing_peter_quill.sql +51 -0
- package/dist/migrations/0022_wandering_bucky.sql +1 -0
- package/dist/migrations/0023_red_payback.sql +1 -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/0015_snapshot.json +2315 -0
- package/dist/migrations/meta/0016_snapshot.json +2419 -0
- package/dist/migrations/meta/0017_snapshot.json +2419 -0
- package/dist/migrations/meta/0018_snapshot.json +2570 -0
- package/dist/migrations/meta/0020_snapshot.json +2895 -0
- package/dist/migrations/meta/0021_snapshot.json +3031 -0
- package/dist/migrations/meta/0022_snapshot.json +3039 -0
- package/dist/migrations/meta/0023_snapshot.json +3047 -0
- package/dist/migrations/meta/_journal.json +112 -0
- package/dist/paths.d.ts +1 -0
- package/dist/plugin/types.d.ts +1 -0
- package/dist/plugins/index.js +213 -103
- package/dist/plugins/sqlite-tracing.d.ts +23 -0
- package/dist/provider/acp/connection.d.ts +6 -0
- package/dist/provider/acp/meta.d.ts +11 -0
- package/dist/provider/bridge.d.ts +6 -0
- package/dist/provider/classify-task-error.d.ts +2 -0
- package/dist/provider/cli/adapter.types.d.ts +8 -1
- package/dist/provider/cli/adapters/agent-call.util.d.ts +1 -1
- package/dist/provider/cli/adapters/cli-knob.util.d.ts +7 -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 +5 -0
- package/dist/provider/cli/protocol-envelope.d.ts +2 -0
- package/dist/provider/errors.d.ts +1 -0
- package/dist/provider/idle-watchdog.d.ts +19 -0
- package/dist/provider/models.d.ts +17 -12
- 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/constants.d.ts +6 -0
- package/dist/publish/index.d.ts +26 -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/remote/execution-profile.d.ts +9 -0
- package/dist/remote/index.d.ts +1 -0
- package/dist/remote/types.d.ts +28 -0
- package/dist/repository/agent-suggestion.repository.d.ts +34 -0
- package/dist/repository/common-code.repository.d.ts +45 -0
- package/dist/repository/db.d.ts +8 -0
- package/dist/repository/index.d.ts +28 -4
- package/dist/repository/index.js +200 -94
- package/dist/repository/notification.repository.d.ts +58 -0
- package/dist/repository/project.repository.d.ts +90 -0
- package/dist/repository/request-log.repository.d.ts +1 -0
- package/dist/repository/task-log-migration.d.ts +74 -0
- package/dist/repository/task-log.repository.d.ts +44 -0
- package/dist/repository/task.repository.d.ts +120 -0
- package/dist/repository/thread-history.repository.d.ts +193 -0
- package/dist/repository/thread-title-common-code-migration.d.ts +13 -0
- package/dist/repository/thread-title.types.d.ts +29 -0
- package/dist/repository/thread.repository.d.ts +21 -2
- package/dist/repository/usage-report.repository.d.ts +27 -0
- package/dist/repository/workspace.repository.d.ts +3 -0
- package/dist/schema/agent-suggestions.d.ts +199 -0
- package/dist/schema/common-codes.d.ts +216 -0
- package/dist/schema/index.d.ts +9 -0
- package/dist/schema/notifications.d.ts +303 -0
- package/dist/schema/projects.d.ts +610 -0
- package/dist/schema/task-log-events.d.ts +119 -0
- package/dist/schema/tasks.d.ts +53 -0
- package/dist/schema/thread-history.d.ts +734 -0
- package/dist/schema/threads.d.ts +2 -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/schema/workspaces.d.ts +17 -0
- package/dist/task-log/anchor-child-tasks.d.ts +7 -0
- package/dist/task-log/delegation-trailer.d.ts +34 -0
- package/dist/testing/index.js +1 -1
- package/dist/types/index.d.ts +1536 -3
- package/dist/types/task-log.types.d.ts +2 -0
- 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/ui-plugin/index.d.ts +3 -0
- package/dist/ui-plugin/manifest.d.ts +3 -0
- package/dist/ui-plugin/types.d.ts +76 -0
- package/dist/ui-plugin/validator.d.ts +9 -0
- package/dist/utils/crewx-executable.d.ts +54 -0
- package/dist/utils/crewx-home.d.ts +1 -0
- package/dist/utils/env-defaults.d.ts +2 -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 +25 -2
- package/templates/agents/default.yaml +244 -120
- 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
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { CrewxPlugin } from '../plugin';
|
|
2
2
|
import type { Crewx } from '../facade/Crewx';
|
|
3
|
+
export interface SqliteTracingMetrics {
|
|
4
|
+
flushCount: number;
|
|
5
|
+
flushedEntries: number;
|
|
6
|
+
maxQueueEntries: number;
|
|
7
|
+
maxQueueBytes: number;
|
|
8
|
+
appendFailureCount: number;
|
|
9
|
+
appendFailureEntries: number;
|
|
10
|
+
appendFailureBytes: number;
|
|
11
|
+
appendFailureByCode: Record<string, number>;
|
|
12
|
+
appendFailureByCause: Record<string, number>;
|
|
13
|
+
pendingQueueEntries: number;
|
|
14
|
+
pendingQueueBytes: number;
|
|
15
|
+
}
|
|
3
16
|
export interface SqliteTracingPluginOptions {
|
|
4
17
|
dbRoot?: string;
|
|
5
18
|
version?: string;
|
|
@@ -9,7 +22,17 @@ export declare class SqliteTracingPlugin extends CrewxPlugin {
|
|
|
9
22
|
private unsubs;
|
|
10
23
|
private readonly dbPath;
|
|
11
24
|
private readonly version;
|
|
25
|
+
private taskRepo?;
|
|
26
|
+
private readonly queues;
|
|
27
|
+
private metrics;
|
|
12
28
|
constructor(opts?: SqliteTracingPluginOptions);
|
|
13
29
|
attach(crewx: Crewx): void;
|
|
14
30
|
detach(_crewx: Crewx): void;
|
|
31
|
+
getMetrics(): SqliteTracingMetrics;
|
|
32
|
+
private enqueueLog;
|
|
33
|
+
private recoverPartialResult;
|
|
34
|
+
private flushTaskLogs;
|
|
35
|
+
private flushAllTaskLogs;
|
|
36
|
+
private clearAllTimers;
|
|
37
|
+
private recordAppendFailure;
|
|
15
38
|
}
|
|
@@ -6,6 +6,7 @@ export interface AcpConnectionOptions {
|
|
|
6
6
|
env?: Record<string, string>;
|
|
7
7
|
cwd?: string;
|
|
8
8
|
timeoutMs?: number;
|
|
9
|
+
idleMs?: number;
|
|
9
10
|
onStderr?: (line: string) => void;
|
|
10
11
|
onPid?: (pid: number) => void;
|
|
11
12
|
configOptions?: Record<string, string>;
|
|
@@ -17,7 +18,12 @@ export declare class AcpConnection {
|
|
|
17
18
|
private disposed;
|
|
18
19
|
private stderrBuffer;
|
|
19
20
|
private collectedStderr;
|
|
21
|
+
private stderrDecoder;
|
|
22
|
+
private stderrDecodeChain;
|
|
20
23
|
private pendingUpdateCallback;
|
|
24
|
+
private idleWatchdog;
|
|
25
|
+
private idleReject;
|
|
26
|
+
private idlePromise;
|
|
21
27
|
private authMethods;
|
|
22
28
|
private _initResponse;
|
|
23
29
|
get initResponse(): InitializeResponse | null;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { ProviderDefaultProfile } from '../models.js';
|
|
2
|
+
import type { ProviderOptionSpec } from '../models.js';
|
|
3
|
+
import type { ModelTier } from '../../config/models.generated.js';
|
|
4
|
+
import type { ModelApiPricing } from '../../config/pricing.types.js';
|
|
1
5
|
import type { InitializeResponse, NewSessionResponse } from './types.js';
|
|
2
6
|
export interface AcpProviderMetaResult {
|
|
3
7
|
id: string;
|
|
@@ -11,11 +15,18 @@ export interface AcpProviderMetaResult {
|
|
|
11
15
|
models: Array<{
|
|
12
16
|
id: string;
|
|
13
17
|
name?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
contextWindowTokens?: number;
|
|
20
|
+
tier?: ModelTier;
|
|
21
|
+
recommended?: boolean;
|
|
22
|
+
apiPricing?: ModelApiPricing;
|
|
14
23
|
}>;
|
|
15
24
|
modelOverrides?: Record<string, {
|
|
16
25
|
effort?: string[];
|
|
17
26
|
defaultEffort?: string;
|
|
18
27
|
}>;
|
|
28
|
+
providerOptions?: ProviderOptionSpec[];
|
|
29
|
+
defaults?: ProviderDefaultProfile;
|
|
19
30
|
capabilities: Record<string, boolean>;
|
|
20
31
|
}
|
|
21
32
|
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;
|
|
@@ -53,10 +55,13 @@ export interface ProviderQueryOptions {
|
|
|
53
55
|
model?: string;
|
|
54
56
|
effort?: string;
|
|
55
57
|
mode?: string;
|
|
58
|
+
providerOptions?: Record<string, unknown>;
|
|
56
59
|
context?: string;
|
|
57
60
|
systemPrompt?: string;
|
|
58
61
|
additionalArgs?: string[];
|
|
59
62
|
resumeSessionId?: string;
|
|
63
|
+
providerSessionId?: string;
|
|
64
|
+
onProviderSessionId?: (id: string) => void;
|
|
60
65
|
onOutput?: (line: string, level: 'stdout' | 'stderr') => void;
|
|
61
66
|
onPid?: (pid: number) => void;
|
|
62
67
|
onCommand?: (command: string) => void;
|
|
@@ -67,6 +72,7 @@ export interface ProviderQueryOptions {
|
|
|
67
72
|
env?: Record<string, string>;
|
|
68
73
|
cwd?: string;
|
|
69
74
|
timeoutMs?: number;
|
|
75
|
+
idleMs?: number;
|
|
70
76
|
configOptions?: Record<string, string>;
|
|
71
77
|
tools?: import('../facade/Crewx').ToolDefinition[];
|
|
72
78
|
maxSteps?: number;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import type { ProviderQueryOptions, ProviderUsage } from '../bridge.js';
|
|
2
2
|
import type { TaskLogEntry } from '../../types/task-log.types.js';
|
|
3
|
+
import type { ModelTier } from '../../config/models.generated.js';
|
|
3
4
|
import { ProviderError } from '../errors.js';
|
|
4
5
|
export interface CliProviderAdapter {
|
|
5
6
|
readonly command: string;
|
|
7
|
+
createSessionId?(): string;
|
|
6
8
|
readonly meta?: {
|
|
7
9
|
displayName?: string;
|
|
8
10
|
models?: Array<{
|
|
9
11
|
id: string;
|
|
10
12
|
name?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
contextWindowTokens?: number;
|
|
15
|
+
tier?: ModelTier;
|
|
11
16
|
}>;
|
|
12
17
|
defaultTimeoutMs?: {
|
|
13
18
|
query?: number;
|
|
14
19
|
execute?: number;
|
|
15
20
|
};
|
|
21
|
+
defaultIdleMs?: number;
|
|
16
22
|
capabilities?: {
|
|
17
23
|
resume?: boolean;
|
|
18
24
|
image?: boolean;
|
|
@@ -27,8 +33,9 @@ export interface CliProviderAdapter {
|
|
|
27
33
|
env?: Record<string, string>;
|
|
28
34
|
};
|
|
29
35
|
extractText(stdout: string): string;
|
|
36
|
+
extractPartialText?(stdout: string): string | undefined;
|
|
30
37
|
extractFailure?(line: string): Error | null;
|
|
31
|
-
interpretExit?(code: number, stderr: string): Error | null;
|
|
38
|
+
interpretExit?(code: number, stderr: string, stdout?: string): Error | null;
|
|
32
39
|
parseResultMeta?(stdout: string): {
|
|
33
40
|
usage?: ProviderUsage | null;
|
|
34
41
|
model?: string | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TaskLogEntry } from '../../../types/task-log.types';
|
|
2
2
|
export declare function isAgentCallCommand(command: string): boolean;
|
|
3
|
-
export declare function parseAgentCall(timestamp: string, command: string): TaskLogEntry;
|
|
3
|
+
export declare function parseAgentCall(timestamp: string, command: string, toolUseId?: string): TaskLogEntry;
|
|
@@ -6,3 +6,10 @@ export declare function codexModeArgs(mode?: string): string[];
|
|
|
6
6
|
export declare function codexResumeModeArgs(mode?: string): string[];
|
|
7
7
|
export declare function codexEffortArgs(effort?: string): string[];
|
|
8
8
|
export declare function claudeModeArgs(mode?: string): string[];
|
|
9
|
+
export declare function claudeEffortArgs(effort?: string): string[];
|
|
10
|
+
export declare function grokModeArgs(mode?: string): string[];
|
|
11
|
+
export declare function grokAlwaysApproveArgs(alwaysApprove?: unknown): string[];
|
|
12
|
+
export declare function grokSandboxArgs(sandbox?: unknown, onWarning?: (message: string) => void): string[];
|
|
13
|
+
export declare function grokEffortArgs(effort?: string): string[];
|
|
14
|
+
export declare function antigravityModeArgs(mode?: string): string[];
|
|
15
|
+
export declare function antigravityEffortArgs(effort?: string): string[];
|
|
@@ -5,6 +5,7 @@ export { copilotAdapter } from './copilot.js';
|
|
|
5
5
|
export { codexAdapter } from './codex.js';
|
|
6
6
|
export { opencodeAdapter } from './opencode.js';
|
|
7
7
|
export { antigravityAdapter } from './antigravity.js';
|
|
8
|
+
export { grokAdapter } from './grok.js';
|
|
8
9
|
export { isAgentCallCommand, parseAgentCall } from './agent-call.util.js';
|
|
9
10
|
export declare const BUILTIN_ADAPTERS: Record<string, CliProviderAdapter>;
|
|
10
11
|
export declare function parseStdoutEvent(timestamp: string, message: string, providerId?: string): TaskLogEntry[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { BUILTIN_ADAPTERS, parseStdoutEvent, claudeAdapter, copilotAdapter, codexAdapter, opencodeAdapter, antigravityAdapter, isAgentCallCommand, parseAgentCall, } from './adapters/index.js';
|
|
1
|
+
export { BUILTIN_ADAPTERS, parseStdoutEvent, claudeAdapter, copilotAdapter, codexAdapter, opencodeAdapter, antigravityAdapter, grokAdapter, isAgentCallCommand, parseAgentCall, } from './adapters/index.js';
|
|
2
2
|
export type { CliProviderAdapter } from './adapter.types.js';
|
|
3
3
|
export { RateLimitError } from './adapter.types.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AcpProviderMetaResult } from '../acp/meta.js';
|
|
2
|
+
import type { ModelTier } from '../../config/models.generated.js';
|
|
2
3
|
import type { CliProviderAdapter } from './adapter.types.js';
|
|
3
4
|
export declare function queryOpencodeModels(): Promise<Array<{
|
|
4
5
|
id: string;
|
|
@@ -6,6 +7,10 @@ export declare function queryOpencodeModels(): Promise<Array<{
|
|
|
6
7
|
export declare function cliAdapterMetaToProviderMeta(key: string, adapter: CliProviderAdapter, overrideModels?: Array<{
|
|
7
8
|
id: string;
|
|
8
9
|
name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
contextWindowTokens?: number;
|
|
12
|
+
tier?: ModelTier;
|
|
13
|
+
recommended?: boolean;
|
|
9
14
|
}>): AcpProviderMetaResult | null;
|
|
10
15
|
export declare function queryAllCliProviderMetas(options?: {
|
|
11
16
|
includeOpencodeRuntimeModels?: boolean;
|
|
@@ -10,6 +10,7 @@ export declare class ProviderError extends Error {
|
|
|
10
10
|
readonly code: ProviderErrorCode;
|
|
11
11
|
readonly kind?: ProviderErrorKind;
|
|
12
12
|
readonly retryAfterMs?: number;
|
|
13
|
+
stdout?: string;
|
|
13
14
|
constructor(message: string, providerStr: string, options?: ProviderErrorOptions);
|
|
14
15
|
}
|
|
15
16
|
export declare class IdleTimeoutError extends ProviderError {
|
|
@@ -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
|
+
}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import { type ModelCatalogEntry, type ProviderCatalogEntry, type ProviderModeEntry, type ProviderModelOverride } from '../config/models.generated.js';
|
|
2
|
-
|
|
1
|
+
import { type ModelCatalogEntry, type ModelTier, type ProviderCatalogEntry, type ProviderDefaultProfile, type ProviderModeEntry, type ProviderModelOverride } from '../config/models.generated.js';
|
|
2
|
+
import type { ModelApiPricing } from '../config/pricing.types.js';
|
|
3
|
+
export type { ModelTier, ModelCatalogEntry, ProviderCatalogEntry, ProviderDefaultProfile, ProviderDefaults, ProviderModeEntry, ProviderOptionSpec, ProviderModelOverride, } from '../config/models.generated.js';
|
|
4
|
+
export type ModelMergeEntry = {
|
|
5
|
+
id: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
contextWindowTokens?: number;
|
|
9
|
+
tier?: ModelTier;
|
|
10
|
+
recommended?: boolean;
|
|
11
|
+
apiPricing?: ModelApiPricing;
|
|
12
|
+
};
|
|
3
13
|
export declare function setModelsOverride(providers: Record<string, ProviderCatalogEntry | ModelCatalogEntry[]>): void;
|
|
4
14
|
export declare function clearModelsOverride(): void;
|
|
15
|
+
export declare function setModelsDefaultsOverride(providers: Record<string, ProviderDefaultProfile>): void;
|
|
16
|
+
export declare function clearModelsDefaultsOverride(): void;
|
|
5
17
|
export declare function getProviderModels(provider: string): ModelCatalogEntry[];
|
|
6
18
|
export declare function getProviderCatalog(provider: string): ProviderCatalogEntry;
|
|
19
|
+
export declare function getProviderDefaultProfile(provider: string): ProviderDefaultProfile | undefined;
|
|
7
20
|
export declare function getProviderModes(provider: string): ProviderModeEntry[];
|
|
8
21
|
export declare function getProviderEffort(provider: string, model?: string): string[];
|
|
9
22
|
export declare function getProviderModelOverrides(provider: string): Record<string, ProviderModelOverride>;
|
|
@@ -11,13 +24,5 @@ export declare function getClaudeModels(): ModelCatalogEntry[];
|
|
|
11
24
|
export declare function getCodexModels(): ModelCatalogEntry[];
|
|
12
25
|
export declare function getCopilotModels(): ModelCatalogEntry[];
|
|
13
26
|
export declare function getAntigravityModels(): ModelCatalogEntry[];
|
|
14
|
-
export declare function mergeModels(a:
|
|
15
|
-
|
|
16
|
-
name?: string;
|
|
17
|
-
}>, b: Array<{
|
|
18
|
-
id: string;
|
|
19
|
-
name?: string;
|
|
20
|
-
}>): Array<{
|
|
21
|
-
id: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
}>;
|
|
27
|
+
export declare function mergeModels(a: ModelMergeEntry[], b: ModelMergeEntry[]): ModelMergeEntry[];
|
|
28
|
+
export declare function withApiPricing(models: ModelMergeEntry[]): ModelMergeEntry[];
|
package/dist/provider/order.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const PROVIDER_ORDER: readonly ["codex", "claude", "opencode", "antigravity", "copilot"];
|
|
1
|
+
export declare const PROVIDER_ORDER: readonly ["codex", "claude", "grok", "opencode", "antigravity", "copilot"];
|
|
2
2
|
export declare function providerRank(id: string): number;
|
|
3
3
|
export declare function compareProviders(a: string, b: string): number;
|
|
4
4
|
export declare function normalizeProviderId(provider?: string): string;
|
|
@@ -3,4 +3,10 @@ export interface ParsedUsage {
|
|
|
3
3
|
outputTokens: number;
|
|
4
4
|
cachedInputTokens: number;
|
|
5
5
|
}
|
|
6
|
+
export interface ClaudePartialUsage {
|
|
7
|
+
inputTokens: number;
|
|
8
|
+
cachedInputTokens: number;
|
|
9
|
+
model?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseClaudePartialUsage(stdout: string): ClaudePartialUsage | undefined;
|
|
6
12
|
export declare function parseUsage(stdout: string): ParsedUsage | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CliProviderAdapter } from './cli/adapter.types.js';
|
|
2
|
+
export declare function lookupCliAdapter(providerStr: string): CliProviderAdapter | undefined;
|
|
3
|
+
export type ProviderAvailabilityDeps = {
|
|
4
|
+
lookupAdapter?: (providerStr: string) => CliProviderAdapter | undefined;
|
|
5
|
+
env?: NodeJS.ProcessEnv;
|
|
6
|
+
};
|
|
7
|
+
export declare function isProviderAvailable(providerStr: string, deps?: ProviderAvailabilityDeps): boolean;
|
|
8
|
+
export declare function selectAvailableProvider(providers: string | string[], deps?: ProviderAvailabilityDeps): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function redactTechnicalMessage(value: unknown): string | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TaskErrorCode = 'USAGE_LIMITED' | 'CONTEXT_WINDOW_EXCEEDED' | 'INPUT_TOO_LARGE' | 'MODEL_NOT_SUPPORTED' | 'MODEL_AT_CAPACITY' | 'AUTH_REQUIRED' | 'CLI_NOT_AVAILABLE' | 'CLI_UPDATE_REQUIRED' | 'AGENT_NOT_FOUND' | 'PERMISSION_OR_TRUST' | 'TIMEOUT_OR_STUCK' | 'NETWORK_OR_PROVIDER_TRANSIENT' | 'PROVIDER_CONFIGURATION' | 'PROCESS_FAILED';
|
|
2
|
+
export interface TaskErrorMeta {
|
|
3
|
+
resetAt?: string | number;
|
|
4
|
+
model?: string;
|
|
5
|
+
cliName?: string;
|
|
6
|
+
envKey?: string;
|
|
7
|
+
upstreamType?: string;
|
|
8
|
+
upstreamCode?: string | number;
|
|
9
|
+
referenceId?: string;
|
|
10
|
+
technicalMessage?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TaskErrorProjection {
|
|
13
|
+
errorCode: TaskErrorCode | null;
|
|
14
|
+
errorProvider: string | null;
|
|
15
|
+
errorMeta?: TaskErrorMeta;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ExcludeRuleDef {
|
|
2
|
+
label: string;
|
|
3
|
+
test(basename: string, relPath: string, isDir: boolean): boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const EXCLUDE_RULES: ExcludeRuleDef[];
|
|
6
|
+
export declare function matchExclude(basename: string, relPath: string, isDir: boolean): string | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ExcludedEntry } from './scan';
|
|
2
|
+
import type { SecretFinding } from './secrets';
|
|
3
|
+
import type { PublishManifest } from './manifest';
|
|
4
|
+
import { uploadToMarketplace } from './upload';
|
|
5
|
+
import type { PublishUploadOptions, PublishUploadResult } from './upload';
|
|
6
|
+
export interface PublishOptions {
|
|
7
|
+
version?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PublishPlan {
|
|
10
|
+
manifest: PublishManifest;
|
|
11
|
+
included: string[];
|
|
12
|
+
excluded: ExcludedEntry[];
|
|
13
|
+
secretFindings: SecretFinding[];
|
|
14
|
+
}
|
|
15
|
+
export declare function planPublish(dir: string, opts?: PublishOptions): Promise<PublishPlan>;
|
|
16
|
+
export declare function packTemplate(dir: string, opts?: PublishOptions): Promise<{
|
|
17
|
+
manifest: PublishManifest;
|
|
18
|
+
tgzPath: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type { PublishManifest, ManifestFile, BuildManifestOptions } from './manifest';
|
|
21
|
+
export type { ExcludedEntry, ScanResult } from './scan';
|
|
22
|
+
export type { SecretFinding } from './secrets';
|
|
23
|
+
export { EXCLUDE_RULES } from './constants';
|
|
24
|
+
export { uploadToMarketplace };
|
|
25
|
+
export type { PublishUploadOptions, PublishUploadResult };
|
|
26
|
+
export { MARKETPLACE_API_PREFIX } from './marketplace-api.constants';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var h=require('path'),m=require('fs'),I=require('crypto'),H=require('js-yaml'),N=require('os'),q=require('tar'),zlib=require('zlib');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var h__namespace=/*#__PURE__*/_interopNamespace(h);var m__namespace=/*#__PURE__*/_interopNamespace(m);var I__namespace=/*#__PURE__*/_interopNamespace(I);var H__namespace=/*#__PURE__*/_interopNamespace(H);var N__namespace=/*#__PURE__*/_interopNamespace(N);var q__namespace=/*#__PURE__*/_interopNamespace(q);function W(e){let r=s=>s.replace(/[.+^${}()|[\]\\]/g,"\\$&"),n=e.split("/").map(s=>s==="**"?".*":s.split("*").map(r).join("[^/]*"));return new RegExp(`^${n.join("\\/")}$`)}function b(e,r){try{return W(r).test(e)}catch{return false}}function T(e,...r){let t=e.split("/");if(t.length<r.length)return false;let n=t.length-r.length;return r.every((s,i)=>b(t[n+i],s))}function X(e,r){return e.split("/").some(t=>b(t,r))}var $=[{label:".env*",test:e=>b(e,".env*")},{label:".git/",test:(e,r,t)=>t&&e===".git"},{label:"memory/",test:(e,r,t)=>t&&e==="memory"},{label:"*.key",test:e=>b(e,"*.key")},{label:"*.pem",test:e=>b(e,"*.pem")},{label:"auth.json",test:e=>e==="auth.json"},{label:"node_modules/",test:(e,r,t)=>t&&e==="node_modules"},{label:"conversations/",test:(e,r,t)=>t&&e==="conversations"},{label:".crewx/threads/",test:(e,r,t)=>t&&T(r,".crewx","threads")},{label:".crewx/crewx.db",test:(e,r,t)=>!t&&T(r,".crewx","crewx.db")},{label:".crewx/*.log",test:(e,r,t)=>!t&&T(r,".crewx","*.log")},{label:".crewx/publish/",test:(e,r,t)=>t&&T(r,".crewx","publish")},{label:".crewx/",test:(e,r)=>X(r,".crewx")}];function v(e,r,t){for(let n of $)if(n.test(e,r,t))return n.label;return null}function F(e){let r=[],t=[];function n(s,i,a){let p;try{p=m__namespace.readdirSync(s,{withFileTypes:!0});}catch{return}p.sort((o,c)=>o.name.localeCompare(c.name));for(let o of p){let c=i?`${i}/${o.name}`:o.name,l=h__namespace.join(s,o.name);if(o.isSymbolicLink()){let u;try{u=m__namespace.statSync(l);}catch{continue}if(u.isDirectory()){t.push({path:c,rule:a??"symlink-dir"});continue}let x=a??v(o.name,c,false);x?t.push({path:c,rule:x}):r.push(c);continue}if(o.isDirectory()){let u=a??v(o.name,c,true);n(l,c,u);continue}if(o.isFile()){let u=a??v(o.name,c,false);u?t.push({path:c,rule:u}):r.push(c);}}}return n(e,"",null),r.sort(),t.sort((s,i)=>s.path<i.path?-1:s.path>i.path?1:0),{included:r,excluded:t}}var Z=[{rule:"token-prefix",regex:/\b(?:sk-|ghp_|xoxb-)[A-Za-z0-9_-]{10,}/},{rule:"private-key",regex:/-----BEGIN [A-Z ]*PRIVATE KEY-----/},{rule:"aws-access-key",regex:/\bAKIA[0-9A-Z]{16}\b/}];function J(e){return e.includes(0)}function B(e,r){let t=[];for(let n of r){let s=h__namespace.join(e,n),i;try{i=m__namespace.readFileSync(s);}catch{continue}if(J(i))continue;i.toString("utf8").split(/\r\n|\r|\n/).forEach((p,o)=>{for(let{rule:c,regex:l}of Z)l.test(p)&&t.push({path:n,line:o+1,rule:c});});}return t}var z=/^[a-z0-9-]+$/,G=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,Y=/^[A-Za-z_][A-Za-z0-9_]*$/;function Q(e){let r=h__namespace.join(e,"crewx.yaml");if(!m__namespace.existsSync(r))return {};let t;try{t=H__namespace.load(m__namespace.readFileSync(r,"utf8"));}catch{return {}}if(!t||typeof t!="object")return {};let n=t.metadata;if(!n||typeof n!="object")return {};let s=n;return {name:typeof s.name=="string"?s.name:void 0,version:typeof s.version=="string"?s.version:void 0,description:typeof s.description=="string"?s.description:void 0,requiredEnv:s.requiredEnv,crewxMinVersion:typeof s.crewxMinVersion=="string"?s.crewxMinVersion:void 0}}function ee(e){return I__namespace.createHash("sha256").update(new Uint8Array(m__namespace.readFileSync(e))).digest("hex")}function j(e,r,t={}){let n=Q(e),s=n.name??h__namespace.basename(e);if(!z.test(s))throw new Error(`publish: invalid name "${s}" \u2014 must match ${z} (lowercase letters, numbers, hyphen only)`);let i=t.version??n.version;if(!i)throw new Error("publish: version is required \u2014 set crewx.yaml metadata.version or pass opts.version");if(!G.test(i))throw new Error(`publish: invalid version "${i}" \u2014 must be semver (e.g. 1.0.0)`);let a=Array.isArray(n.requiredEnv)?n.requiredEnv:[],p=[];for(let l of a){if(typeof l!="string"||!Y.test(l))throw new Error(`publish: requiredEnv must contain names only (no values), got "${String(l)}"`);p.push(l);}let o=r.map(l=>({path:l,sha256:ee(h__namespace.join(e,l))})).sort((l,u)=>l.path<u.path?-1:l.path>u.path?1:0),c={name:s,version:i,type:"template",description:n.description??"",files:o,requiredEnv:p};return n.crewxMinVersion&&(c.crewxMinVersion=n.crewxMinVersion),c}async function C(e,r){let t=h__namespace.join(e,".crewx","publish");m__namespace.mkdirSync(t,{recursive:true});let n=h__namespace.join(t,`${r.name}-${r.version}.tgz`),s=m__namespace.mkdtempSync(h__namespace.join(N__namespace.tmpdir(),"crewx-publish-"));try{m__namespace.writeFileSync(h__namespace.join(s,"manifest.json"),JSON.stringify(r,null,2));for(let i of r.files){let a=h__namespace.join(s,i.path);m__namespace.mkdirSync(h__namespace.dirname(a),{recursive:!0}),m__namespace.copyFileSync(h__namespace.join(e,i.path),a);}await q__namespace.create({gzip:!0,file:n,cwd:s,portable:!0,noMtime:!0},["manifest.json",...r.files.map(i=>i.path)]);}finally{m__namespace.rmSync(s,{recursive:true,force:true});}return n}var E="/api/v1";var ne=201,se=409,_=401;function ie(){return process.env.WI013_FAKE_UPLOAD==="1"}function ae(e){let r=zlib.gunzipSync(new Uint8Array(e)),t=zlib.gzipSync(new Uint8Array(r),{level:1});if(Buffer.compare(new Uint8Array(t),new Uint8Array(e))===0)throw new Error("publish: [E_MALFORMED] Re-gzipped upload bytes are identical to the original \u2014 tamper is a no-op");return t}function oe(e){return e.replace(/\/+$/,"")}async function P(e){try{return await e.json()}catch{return null}}function V(e,r,t){let n=e;if(!n||n.success!==true||n.data===void 0)throw new Error(`publish: [E_MALFORMED] ${r} response envelope is malformed (expected { success: true, data }) \u2014 HTTP ${t}`);return n.data}async function ce(e){if(!e.baseUrl.trim())throw new Error("publish: [E_ENV_MISSING] Marketplace base URL is required");if(!e.accessToken.trim())throw new Error("publish: [E_AUTH_EXPIRED] A valid bearer token is required");let r=oe(e.baseUrl),t=e.accessPolicy??"private",n=e.manifest.name,s;try{s=await fetch(`${r}${E}/publisher/items`,{method:"POST",headers:{Authorization:`Bearer ${e.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify({slug:n,displayName:n,description:e.manifest.description,type:"template",version:e.manifest.version,accessPolicy:t})});}catch{throw new Error("publish: [E_NETWORK] Submit request failed (network)")}let i;if(s.status===ne)i="created";else if(s.status===se)i="existing";else throw s.status===_?new Error("publish: [E_AUTH_EXPIRED] Authentication is expired or missing \u2014 please log in again (HTTP 401)"):(await P(s),new Error(`publish: [E_HTTP] Submit request failed \u2014 HTTP ${s.status}`));let a="not-needed",p=null;if(i==="existing"){let g;try{g=await fetch(`${r}${E}/publisher/items`,{method:"GET",headers:{Authorization:`Bearer ${e.accessToken}`}});}catch{throw new Error("publish: [E_NETWORK] Publisher items request failed (network)")}let K=await P(g);if(g.status!==200)throw new Error(`publish: [E_HTTP] Publisher items request failed \u2014 HTTP ${g.status}`);let M=V(K,"publisher items",g.status)?.items;if(!Array.isArray(M))throw new Error(`publish: [E_MALFORMED] Publisher items response is malformed (expected data.items[]) \u2014 HTTP ${g.status}`);let A=M.find(f=>!f||typeof f!="object"?false:f.slug===n);if(!A||typeof A.version!="string")throw new Error(`publish: [E_MALFORMED] Publisher items response does not contain slug "${n}" \u2014 HTTP ${g.status}`);if(p=A.version,p!==e.manifest.version){let f;try{f=await fetch(`${r}${E}/publisher/items/${encodeURIComponent(n)}`,{method:"PUT",headers:{Authorization:`Bearer ${e.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify({version:e.manifest.version})});}catch{throw new Error("publish: [E_NETWORK] Version update request failed (network)")}if(!f.ok)throw await P(f),f.status===_?new Error(`publish: [E_AUTH_EXPIRED] Authentication is expired or missing \u2014 please log in again (HTTP ${f.status})`):f.status===403?new Error(`publish: [E_FORBIDDEN] Version update is forbidden; only the item owner can update an existing item (HTTP ${f.status})`):new Error(`publish: [E_HTTP] Version update failed \u2014 HTTP ${f.status}`);a="applied";}}let o=m__namespace.readFileSync(e.tgzPath),c=ie()?ae(o):o,l=new FormData;l.set("archive",new Blob([new Uint8Array(c)],{type:"application/gzip"}),`${n}-${e.manifest.version}.tgz`);let u;try{u=await fetch(`${r}${E}/publisher/items/${encodeURIComponent(n)}/upload`,{method:"POST",headers:{Authorization:`Bearer ${e.accessToken}`},body:l});}catch{throw new Error("publish: [E_NETWORK] Upload request failed (network)")}if(u.status===_)throw new Error("publish: [E_AUTH_EXPIRED] Authentication is expired or missing \u2014 please log in again (HTTP 401)");if(!u.ok)throw await P(u),new Error(`publish: [E_HTTP] Upload request failed \u2014 HTTP ${u.status}`);let x=await P(u),k=V(x,"upload",u.status);return {slug:n,version:e.manifest.version,artifactChecksum:k.artifactChecksum,artifactSizeBytes:k.artifactSizeBytes,submitOutcome:i,versionUpdate:a,serverVersionBefore:p}}async function le(e,r={}){let t=h__namespace.resolve(e),{included:n,excluded:s}=F(t),i=j(t,n,{version:r.version}),a=B(t,n);return {manifest:i,included:n,excluded:s,secretFindings:a}}async function Be(e,r={}){let t=await le(e,r);if(t.secretFindings.length>0){let i=t.secretFindings.map(a=>`${a.path}:${a.line} (${a.rule})`).join(", ");throw new Error(`publish: aborted \u2014 secret findings must be resolved before packing: ${i}`)}let n=h__namespace.resolve(e),s=await C(n,t.manifest);return {manifest:t.manifest,tgzPath:s}}exports.EXCLUDE_RULES=$;exports.MARKETPLACE_API_PREFIX=E;exports.packTemplate=Be;exports.planPublish=le;exports.uploadToMarketplace=ce;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ManifestFile {
|
|
2
|
+
path: string;
|
|
3
|
+
sha256: string;
|
|
4
|
+
}
|
|
5
|
+
export interface PublishManifest {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
type: 'template';
|
|
9
|
+
description: string;
|
|
10
|
+
files: ManifestFile[];
|
|
11
|
+
requiredEnv: string[];
|
|
12
|
+
crewxMinVersion?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BuildManifestOptions {
|
|
15
|
+
version?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function buildManifest(rootDir: string, includedFiles: string[], opts?: BuildManifestOptions): PublishManifest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MARKETPLACE_API_PREFIX = "/api/v1";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PublishManifest } from './manifest';
|
|
2
|
+
export interface PublishUploadOptions {
|
|
3
|
+
tgzPath: string;
|
|
4
|
+
manifest: PublishManifest;
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
accessToken: string;
|
|
7
|
+
accessPolicy?: 'private';
|
|
8
|
+
}
|
|
9
|
+
export interface PublishUploadResult {
|
|
10
|
+
slug: string;
|
|
11
|
+
version: string;
|
|
12
|
+
artifactChecksum: string;
|
|
13
|
+
artifactSizeBytes: number;
|
|
14
|
+
submitOutcome: 'created' | 'existing';
|
|
15
|
+
versionUpdate: 'not-needed' | 'applied';
|
|
16
|
+
serverVersionBefore: string | null;
|
|
17
|
+
}
|
|
18
|
+
export declare function uploadToMarketplace(opts: PublishUploadOptions): Promise<PublishUploadResult>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AgentExecutionProfile } from './types.js';
|
|
2
|
+
export declare function resolveAgentExecutionProfiles(input: {
|
|
3
|
+
location: string;
|
|
4
|
+
targetAgentIds: string[];
|
|
5
|
+
}): Map<string, AgentExecutionProfile>;
|
|
6
|
+
export declare function resolveAgentExecutionProfile(input: {
|
|
7
|
+
location: string;
|
|
8
|
+
targetAgentId: string;
|
|
9
|
+
}): AgentExecutionProfile;
|
package/dist/remote/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export { RemoteAgentManager } from './remote-agent-manager.js';
|
|
|
5
5
|
export type { RemoteAgentManagerOptions } from './remote-agent-manager.js';
|
|
6
6
|
export { RemoteProviderRuntime, createRemoteProviderFactory, resolveFileRemoteAgent } from './remote-provider.js';
|
|
7
7
|
export type { ProviderFactoryFn, FileRemoteResolution, FileRemoteResolver } from './remote-provider.js';
|
|
8
|
+
export { resolveAgentExecutionProfile, resolveAgentExecutionProfiles, } from './execution-profile.js';
|
package/dist/remote/types.d.ts
CHANGED
|
@@ -44,6 +44,34 @@ export interface RemoteProviderConfig {
|
|
|
44
44
|
apiKey?: string;
|
|
45
45
|
headers?: Record<string, string>;
|
|
46
46
|
}
|
|
47
|
+
export type AgentExecutionProfileStatus = 'resolved' | 'pending' | 'unavailable';
|
|
48
|
+
export type AgentExecutionProfileErrorCode = 'TARGET_NOT_FOUND' | 'TARGET_AGENT_NOT_FOUND' | 'TARGET_NO_PROVIDER' | 'CHAINED_REMOTE' | 'TARGET_PARSE_FAILED' | 'TRANSPORT_ERROR';
|
|
49
|
+
export interface AgentExecutionProfileSlot {
|
|
50
|
+
provider?: string;
|
|
51
|
+
model?: string;
|
|
52
|
+
effort?: string;
|
|
53
|
+
overdrive?: {
|
|
54
|
+
provider: string;
|
|
55
|
+
model: string;
|
|
56
|
+
mode?: string;
|
|
57
|
+
effort?: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface AgentExecutionProfile {
|
|
61
|
+
status: AgentExecutionProfileStatus;
|
|
62
|
+
location?: string;
|
|
63
|
+
agentId?: string;
|
|
64
|
+
provider?: string;
|
|
65
|
+
model?: string;
|
|
66
|
+
options?: {
|
|
67
|
+
query?: AgentExecutionProfileSlot;
|
|
68
|
+
execute?: AgentExecutionProfileSlot;
|
|
69
|
+
};
|
|
70
|
+
error?: {
|
|
71
|
+
code: AgentExecutionProfileErrorCode;
|
|
72
|
+
message: string;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
47
75
|
export interface RemoteAgentQueryRequest {
|
|
48
76
|
agentId: string;
|
|
49
77
|
query: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
import { agent_suggestions } from '../schema/index.js';
|
|
3
|
+
export type AgentSuggestionRow = typeof agent_suggestions.$inferSelect;
|
|
4
|
+
export type NewAgentSuggestion = typeof agent_suggestions.$inferInsert;
|
|
5
|
+
export type SuggestionType = 'H1' | 'H3';
|
|
6
|
+
export type SuggestionStatus = 'pending' | 'applied' | 'dismissed';
|
|
7
|
+
export interface CreateAgentSuggestionInput {
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
agentId: string;
|
|
10
|
+
taskId?: string | null;
|
|
11
|
+
type: SuggestionType;
|
|
12
|
+
status?: SuggestionStatus;
|
|
13
|
+
payload: string;
|
|
14
|
+
appliedCommitSha?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULT_LIST_LIMIT = 50;
|
|
17
|
+
export declare class AgentSuggestionRepository extends BaseSqliteRepository {
|
|
18
|
+
private readonly dbPath?;
|
|
19
|
+
constructor(opts?: {
|
|
20
|
+
dbPath?: string;
|
|
21
|
+
dbRoot?: string;
|
|
22
|
+
});
|
|
23
|
+
resolveDbPath(): string;
|
|
24
|
+
private openHandle;
|
|
25
|
+
create(rows: CreateAgentSuggestionInput[]): {
|
|
26
|
+
ids: string[];
|
|
27
|
+
};
|
|
28
|
+
findLatestSet(workspaceId: string, agentId: string): AgentSuggestionRow[];
|
|
29
|
+
findSetByTaskId(workspaceId: string, agentId: string, taskId: string): AgentSuggestionRow[];
|
|
30
|
+
findById(workspaceId: string, agentId: string, suggestionId: string): AgentSuggestionRow | null;
|
|
31
|
+
updateStatus(id: string, status: SuggestionStatus, appliedCommitSha?: string | null): boolean;
|
|
32
|
+
listByAgent(workspaceId: string, agentId: string, limit?: number): AgentSuggestionRow[];
|
|
33
|
+
findDismissed(workspaceId: string, agentId: string, limit?: number): AgentSuggestionRow[];
|
|
34
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseSqliteRepository } from './base-sqlite-repository.js';
|
|
2
|
+
import { RepositoryError } from './errors.js';
|
|
3
|
+
import type { CommonCode, CommonCodeColor, CommonCodeGroup } from '../schema/index.js';
|
|
4
|
+
export { COMMON_CODE_COLORS, COMMON_CODE_GROUPS } from '../schema/common-codes.js';
|
|
5
|
+
export type { CommonCodeColor, CommonCodeGroup } from '../schema/common-codes.js';
|
|
6
|
+
export type CommonCodeErrorReason = 'COMMON_CODE_GROUP_INVALID' | 'COMMON_CODE_COLOR_INVALID' | 'COMMON_CODE_NAME_INVALID' | 'COMMON_CODE_CODE_INVALID' | 'COMMON_CODE_WORKSPACE_INVALID' | 'COMMON_CODE_NAME_CONFLICT' | 'COMMON_CODE_NOT_FOUND' | 'COMMON_CODE_SCOPE_FORBIDDEN' | 'COMMON_CODE_BUILTIN_ARCHIVE_FORBIDDEN' | 'COMMON_CODE_ARCHIVE_INVALID' | 'COMMON_CODE_UPDATE_EMPTY' | 'COMMON_CODE_REORDER_INVALID';
|
|
7
|
+
export declare class CommonCodeRepositoryError extends RepositoryError {
|
|
8
|
+
readonly reason: CommonCodeErrorReason;
|
|
9
|
+
constructor(reason: CommonCodeErrorReason, code?: 'VALIDATION' | 'NOT_FOUND' | 'CONFLICT', message?: string, cause?: unknown);
|
|
10
|
+
}
|
|
11
|
+
export interface CreateThreadStateInput {
|
|
12
|
+
workspaceId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
color: CommonCodeColor;
|
|
15
|
+
}
|
|
16
|
+
export interface UpdateCommonCodeDisplayInput {
|
|
17
|
+
group: CommonCodeGroup;
|
|
18
|
+
code: string;
|
|
19
|
+
workspaceId: string;
|
|
20
|
+
name?: string | null;
|
|
21
|
+
color?: CommonCodeColor;
|
|
22
|
+
}
|
|
23
|
+
export interface ReorderCommonCodesInput {
|
|
24
|
+
group: string;
|
|
25
|
+
workspaceId: string;
|
|
26
|
+
codes: string[];
|
|
27
|
+
}
|
|
28
|
+
export declare function generateCommonCodeId(): string;
|
|
29
|
+
export declare class CommonCodeRepository extends BaseSqliteRepository {
|
|
30
|
+
private readonly dbPath?;
|
|
31
|
+
constructor(opts?: {
|
|
32
|
+
dbPath?: string;
|
|
33
|
+
dbRoot?: string;
|
|
34
|
+
});
|
|
35
|
+
resolveDbPath(): string;
|
|
36
|
+
private openHandle;
|
|
37
|
+
listSelectable(group: string, workspaceId: string): CommonCode[];
|
|
38
|
+
listForHistory(group: string, workspaceId: string): CommonCode[];
|
|
39
|
+
reorder(input: ReorderCommonCodesInput): CommonCode[];
|
|
40
|
+
resolve(group: string, code: string): CommonCode | null;
|
|
41
|
+
createThreadState(input: CreateThreadStateInput): CommonCode;
|
|
42
|
+
updateDisplay(input: UpdateCommonCodeDisplayInput): CommonCode;
|
|
43
|
+
archive(group: string, code: string, workspaceId: string, archived?: boolean): CommonCode;
|
|
44
|
+
private assertOwnership;
|
|
45
|
+
}
|
package/dist/repository/db.d.ts
CHANGED
|
@@ -6,4 +6,12 @@ export interface DrizzleHandle {
|
|
|
6
6
|
runRaw(sqlStr: string, params?: unknown[]): void;
|
|
7
7
|
close(): void;
|
|
8
8
|
}
|
|
9
|
+
export declare const CREWX_JOURNAL_SIZE_LIMIT_BYTES: number;
|
|
10
|
+
export type ReclaimJournalMode = 'PASSIVE' | 'TRUNCATE';
|
|
11
|
+
export interface ReclaimJournalResult {
|
|
12
|
+
busy: boolean;
|
|
13
|
+
walBytesBefore: number;
|
|
14
|
+
walBytesAfter: number;
|
|
15
|
+
}
|
|
9
16
|
export declare function openDrizzleDb(dbPath: string): DrizzleHandle;
|
|
17
|
+
export declare function reclaimTemporaryJournal(dbPath: string, mode?: ReclaimJournalMode): ReclaimJournalResult;
|