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

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.
Files changed (37) hide show
  1. package/dist/context-budget/continuity.d.ts +53 -0
  2. package/dist/context-budget/index.d.ts +35 -1
  3. package/dist/conversation/sqlite-provider.d.ts +4 -1
  4. package/dist/conversation/types.d.ts +28 -0
  5. package/dist/esm/index.js +219 -155
  6. package/dist/esm/plugins/index.js +129 -126
  7. package/dist/esm/repository/index.js +123 -120
  8. package/dist/facade/Crewx.d.ts +6 -2
  9. package/dist/highlight/thread-highlighter.d.ts +155 -0
  10. package/dist/index.browser.d.ts +2 -0
  11. package/dist/index.browser.js +4 -4
  12. package/dist/index.d.ts +20 -2
  13. package/dist/index.js +220 -156
  14. package/dist/layout/types.d.ts +15 -1
  15. package/dist/migrations/0018_bored_jackal.sql +33 -0
  16. package/dist/migrations/0019_backfill_task_thread_ids.sql +74 -0
  17. package/dist/migrations/0020_useful_iron_lad.sql +55 -0
  18. package/dist/migrations/meta/0018_snapshot.json +2570 -0
  19. package/dist/migrations/meta/0020_snapshot.json +2895 -0
  20. package/dist/migrations/meta/_journal.json +22 -1
  21. package/dist/plugins/index.js +129 -126
  22. package/dist/repository/common-code.repository.d.ts +39 -0
  23. package/dist/repository/index.d.ts +12 -2
  24. package/dist/repository/index.js +123 -120
  25. package/dist/repository/task.repository.d.ts +5 -0
  26. package/dist/repository/thread-history.repository.d.ts +117 -0
  27. package/dist/repository/thread-title-common-code-migration.d.ts +13 -0
  28. package/dist/repository/thread-title.types.d.ts +29 -0
  29. package/dist/repository/thread.repository.d.ts +16 -0
  30. package/dist/schema/common-codes.d.ts +216 -0
  31. package/dist/schema/index.d.ts +2 -0
  32. package/dist/schema/thread-history.d.ts +518 -0
  33. package/dist/schema/threads.d.ts +2 -0
  34. package/dist/types/index.d.ts +1092 -0
  35. package/dist/utils/id.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/templates/agents/default.yaml +33 -0
@@ -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,21 @@ 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';
30
+ export { ThreadHistoryConflictError, ThreadHighlightConflictError, ThreadHistoryRepository, } from './thread-history.repository.js';
31
+ export type { CreateThreadHighlightInput, DismissThreadHighlightInput, ListActiveHighlightsOptions, ThreadActorInput, ThreadSnapshot, ThreadSnapshotMutationInput, ThreadTimeline, ThreadTimelineOptions, ThreadTimelineQuery, UpdateThreadHighlightInput, } from './thread-history.repository.js';
32
+ export { BUILTIN_THREAD_STATES, THREAD_PRIORITIES, customStateLabel, hasThreadTitleKey, isThreadPriority, isThreadState, matchesThreadTitleFilter, mergeThreadTitleMeta, parseThreadPriorityFilter, parseThreadStateFilter, readThreadTitleMeta, threadTitleSearchHaystack, } from './thread-title.types.js';
33
+ export type { BuiltinThreadState, LegacyThreadState, StableThreadState, ThreadPriority, ThreadState, ThreadTitleFilter, ThreadTitleMeta, ThreadTitlePatch, } from './thread-title.types.js';
24
34
  export { SpanRepository } from './span.repository.js';
25
35
  export type { SpanRow, NewSpan } from './span.repository.js';
26
36
  export { ToolCallRepository } from './tool-call.repository.js';