@crewx/sdk 0.9.0-rc.73 → 0.9.0-rc.74

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.
@@ -0,0 +1,39 @@
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';
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 declare function generateCommonCodeId(): string;
24
+ export declare class CommonCodeRepository extends BaseSqliteRepository {
25
+ private readonly dbPath?;
26
+ constructor(opts?: {
27
+ dbPath?: string;
28
+ dbRoot?: string;
29
+ });
30
+ resolveDbPath(): string;
31
+ private openHandle;
32
+ listSelectable(group: string, workspaceId: string): CommonCode[];
33
+ listForHistory(group: string, workspaceId: string): CommonCode[];
34
+ resolve(group: string, code: string): CommonCode | null;
35
+ createThreadState(input: CreateThreadStateInput): CommonCode;
36
+ updateDisplay(input: UpdateCommonCodeDisplayInput): CommonCode;
37
+ archive(group: string, code: string, workspaceId: string, archived?: boolean): CommonCode;
38
+ private assertOwnership;
39
+ }
@@ -1,6 +1,9 @@
1
1
  export { BaseSqliteRepository } from './base-sqlite-repository.js';
2
2
  export { RepositoryError } from './errors.js';
3
3
  export type { RepositoryErrorCode } from './errors.js';
4
+ export { COMMON_CODE_COLORS, COMMON_CODE_GROUPS, CommonCodeRepository, CommonCodeRepositoryError, generateCommonCodeId, } from './common-code.repository.js';
5
+ export type { CommonCodeColor, CommonCodeErrorReason, CommonCodeGroup, CreateThreadStateInput, UpdateCommonCodeDisplayInput, } from './common-code.repository.js';
6
+ export type { CommonCode, NewCommonCode } from '../schema/common-codes.js';
4
7
  export { WorkspaceRepository } from './workspace.repository.js';
5
8
  export type { ProjectRow, ThreadRow as WorkspaceThreadRow, ThreadWithAgentRow } from './workspace.repository.js';
6
9
  export { DEFAULT_PROJECT_STAGE_KEYS, DEFAULT_PROJECT_STAGES, ProjectRepository, } from './project.repository.js';
@@ -13,14 +16,17 @@ export type { PushResult } from './push.js';
13
16
  export type { Workspace, NewWorkspace } from '../schema/index.js';
14
17
  export { tasks } from '../schema/index.js';
15
18
  export { TaskRepository } from './task.repository.js';
16
- export type { TaskRow, TaskListRow, NewTask, AgentUsageRow, TrendRow, ProviderUsageRow, ModelUsageRow, ReportTaskRow, DelegationEdge, DelegationMatrixResult, WorkflowCardRow, WorkflowParentTaskRow, } from './task.repository.js';
19
+ export type { TaskRow, TaskActivityLogRow, FindTasksByThreadOptions, TaskListRow, NewTask, AgentUsageRow, TrendRow, ProviderUsageRow, ModelUsageRow, ReportTaskRow, DelegationEdge, DelegationMatrixResult, WorkflowCardRow, WorkflowParentTaskRow, } from './task.repository.js';
17
20
  export { TaskLogRepository } from './task-log.repository.js';
18
21
  export type { TaskLogEntry, RawTaskLogEntry, TaskLogRawEntry, TaskLogStorage, TaskLogState, TaskLogReadResult, TaskLogRepositoryContract, } from './task-log.repository.js';
19
22
  export { runTaskLogMigration, resolveTaskLogMigrationDbPath, taskLogBackupName, tryCheckpointTaskLogWal, hasSufficientTaskLogMigrationFreeSpace, } from './task-log-migration.js';
20
23
  export { TASK_LOG_MIGRATION_EVENT_ROW_BYTES, TASK_LOG_MIGRATION_MIN_FREE_SPACE_BYTES, TASK_LOG_MIGRATION_TERMINAL_STATUSES, } from './task-log-migration.js';
21
24
  export type { TaskLogMigrationFailure, TaskLogMigrationFailureKind, TaskLogMigrationMode, TaskLogMigrationOptions, TaskLogMigrationReport, TaskLogWalCheckpointConnection, TaskLogVerificationIssue, TaskLogVerificationIssueKind, TaskLogVerificationReport, } from './task-log-migration.js';
22
25
  export { ThreadRepository } from './thread.repository.js';
23
- export type { ThreadRow, NewThread } from './thread.repository.js';
26
+ export { ThreadTitleMetadataPatchError, } from './thread.repository.js';
27
+ export type { ThreadRow, NewThread, ThreadTitleMetadataPatch, ThreadTitleMetadataPatchResult, ThreadTitleMetadataPatchErrorReason, } from './thread.repository.js';
28
+ export { migrateLegacyThreadTitleCommonCodes, migrateThreadTitleCommonCodes, } from './thread-title-common-code-migration.js';
29
+ export type { ThreadTitleCommonCodeMigrationOptions, ThreadTitleCommonCodeMigrationResult, } from './thread-title-common-code-migration.js';
24
30
  export { SpanRepository } from './span.repository.js';
25
31
  export type { SpanRow, NewSpan } from './span.repository.js';
26
32
  export { ToolCallRepository } from './tool-call.repository.js';