@varveai/adit-core 0.2.1
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/LICENSE +21 -0
- package/dist/config/index.d.ts +29 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +107 -0
- package/dist/config/index.js.map +1 -0
- package/dist/db/connection.d.ts +9 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +48 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/diffs.d.ts +22 -0
- package/dist/db/diffs.d.ts.map +1 -0
- package/dist/db/diffs.js +37 -0
- package/dist/db/diffs.js.map +1 -0
- package/dist/db/env-snapshots.d.ts +29 -0
- package/dist/db/env-snapshots.d.ts.map +1 -0
- package/dist/db/env-snapshots.js +57 -0
- package/dist/db/env-snapshots.js.map +1 -0
- package/dist/db/events.d.ts +91 -0
- package/dist/db/events.d.ts.map +1 -0
- package/dist/db/events.js +260 -0
- package/dist/db/events.js.map +1 -0
- package/dist/db/index.d.ts +10 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +10 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +13 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +237 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/plans.d.ts +21 -0
- package/dist/db/plans.d.ts.map +1 -0
- package/dist/db/plans.js +52 -0
- package/dist/db/plans.js.map +1 -0
- package/dist/db/sessions.d.ts +23 -0
- package/dist/db/sessions.d.ts.map +1 -0
- package/dist/db/sessions.js +57 -0
- package/dist/db/sessions.js.map +1 -0
- package/dist/db/sync-state.d.ts +21 -0
- package/dist/db/sync-state.d.ts.map +1 -0
- package/dist/db/sync-state.js +36 -0
- package/dist/db/sync-state.js.map +1 -0
- package/dist/db/transcript-uploads.d.ts +57 -0
- package/dist/db/transcript-uploads.d.ts.map +1 -0
- package/dist/db/transcript-uploads.js +132 -0
- package/dist/db/transcript-uploads.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/perf/perf-log.d.ts +105 -0
- package/dist/perf/perf-log.d.ts.map +1 -0
- package/dist/perf/perf-log.js +280 -0
- package/dist/perf/perf-log.js.map +1 -0
- package/dist/security/content-redaction.d.ts +105 -0
- package/dist/security/content-redaction.d.ts.map +1 -0
- package/dist/security/content-redaction.js +365 -0
- package/dist/security/content-redaction.js.map +1 -0
- package/dist/sync/index.d.ts +3 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +3 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/ulid.d.ts +15 -0
- package/dist/sync/ulid.d.ts.map +1 -0
- package/dist/sync/ulid.js +34 -0
- package/dist/sync/ulid.js.map +1 -0
- package/dist/sync/vclock.d.ts +33 -0
- package/dist/sync/vclock.d.ts.map +1 -0
- package/dist/sync/vclock.js +69 -0
- package/dist/sync/vclock.js.map +1 -0
- package/dist/types/environment.d.ts +53 -0
- package/dist/types/environment.d.ts.map +1 -0
- package/dist/types/environment.js +8 -0
- package/dist/types/environment.js.map +1 -0
- package/dist/types/events.d.ts +88 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +40 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/plan.d.ts +30 -0
- package/dist/types/plan.d.ts.map +1 -0
- package/dist/types/plan.js +8 -0
- package/dist/types/plan.js.map +1 -0
- package/dist/types/session.d.ts +44 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +8 -0
- package/dist/types/session.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event types for the ADIT unified timeline.
|
|
3
|
+
*
|
|
4
|
+
* Every code change, prompt, tool call, and system action is an event.
|
|
5
|
+
* Events form a tree via parentEventId for nested execution tracking.
|
|
6
|
+
*/
|
|
7
|
+
/** All possible event types in the timeline */
|
|
8
|
+
export type EventType = "prompt_submit" | "assistant_response" | "user_edit" | "tool_call" | "subagent_call" | "skill_call" | "mcp_call" | "checkpoint" | "revert" | "env_snapshot" | "env_drift" | "plan_update" | "task_completed" | "notification" | "subagent_start" | "subagent_stop";
|
|
9
|
+
/** Who performed the action */
|
|
10
|
+
export type Actor = "assistant" | "user" | "tool" | "system";
|
|
11
|
+
/** Lifecycle status of an event */
|
|
12
|
+
export type EventStatus = "running" | "success" | "error" | "timeout" | "cancelled";
|
|
13
|
+
/** Classification of errors for filtering and analysis */
|
|
14
|
+
export type ErrorCategory = "tool_failure" | "timeout" | "permission_denied" | "not_found" | "validation" | "unknown";
|
|
15
|
+
/** File change statistics within a checkpoint */
|
|
16
|
+
export interface FileStat {
|
|
17
|
+
path: string;
|
|
18
|
+
status: "M" | "A" | "D" | "R" | "??";
|
|
19
|
+
additions?: number;
|
|
20
|
+
deletions?: number;
|
|
21
|
+
}
|
|
22
|
+
/** Error details attached to failed events */
|
|
23
|
+
export interface EventError {
|
|
24
|
+
category: ErrorCategory;
|
|
25
|
+
message: string;
|
|
26
|
+
stack?: string;
|
|
27
|
+
}
|
|
28
|
+
/** The core event record — every timeline entry is one of these */
|
|
29
|
+
export interface AditEvent {
|
|
30
|
+
/** ULID — globally unique, time-sortable */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Session this event belongs to */
|
|
33
|
+
sessionId: string;
|
|
34
|
+
/** Parent event for tree structure (null = root) */
|
|
35
|
+
parentEventId: string | null;
|
|
36
|
+
/** Monotonic sequence within session */
|
|
37
|
+
sequence: number;
|
|
38
|
+
/** What kind of event */
|
|
39
|
+
eventType: EventType;
|
|
40
|
+
/** Who performed it */
|
|
41
|
+
actor: Actor;
|
|
42
|
+
/** User's prompt text (when eventType=prompt_submit) */
|
|
43
|
+
promptText: string | null;
|
|
44
|
+
/** Chain of thought from the model (when eventType=assistant_response) */
|
|
45
|
+
cotText: string | null;
|
|
46
|
+
/** Summary of assistant's response */
|
|
47
|
+
responseText: string | null;
|
|
48
|
+
/** Tool/command name */
|
|
49
|
+
toolName: string | null;
|
|
50
|
+
/** Serialized tool input */
|
|
51
|
+
toolInputJson: string | null;
|
|
52
|
+
/** Serialized tool output */
|
|
53
|
+
toolOutputJson: string | null;
|
|
54
|
+
/** Git commit SHA for this checkpoint */
|
|
55
|
+
checkpointSha: string | null;
|
|
56
|
+
/** Ref path: refs/adit/checkpoints/<id> */
|
|
57
|
+
checkpointRef: string | null;
|
|
58
|
+
/** Per-file change stats */
|
|
59
|
+
diffStatJson: string | null;
|
|
60
|
+
/** Active git branch at time of event */
|
|
61
|
+
gitBranch: string | null;
|
|
62
|
+
/** HEAD SHA at time of event */
|
|
63
|
+
gitHeadSha: string | null;
|
|
64
|
+
/** FK to env_snapshots table */
|
|
65
|
+
envSnapshotId: string | null;
|
|
66
|
+
startedAt: string;
|
|
67
|
+
endedAt: string | null;
|
|
68
|
+
status: EventStatus;
|
|
69
|
+
/** Serialized EventError */
|
|
70
|
+
errorJson: string | null;
|
|
71
|
+
/** User-assigned labels */
|
|
72
|
+
labelsJson: string | null;
|
|
73
|
+
/** FK to plans table for SpecFlow task linking */
|
|
74
|
+
planTaskId: string | null;
|
|
75
|
+
/** Client that created this event (for multi-client provenance) */
|
|
76
|
+
clientId: string | null;
|
|
77
|
+
/** Vector clock for conflict resolution */
|
|
78
|
+
vclockJson: string;
|
|
79
|
+
/** Soft delete timestamp */
|
|
80
|
+
deletedAt: string | null;
|
|
81
|
+
}
|
|
82
|
+
/** Parsed labels from labelsJson */
|
|
83
|
+
export declare function parseLabels(labelsJson: string | null): string[];
|
|
84
|
+
/** Parsed diff stats from diffStatJson */
|
|
85
|
+
export declare function parseDiffStats(diffStatJson: string | null): FileStat[];
|
|
86
|
+
/** Parsed error from errorJson */
|
|
87
|
+
export declare function parseError(errorJson: string | null): EventError | null;
|
|
88
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+CAA+C;AAC/C,MAAM,MAAM,SAAS,GACjB,eAAe,GACf,oBAAoB,GACpB,WAAW,GACX,WAAW,GACX,eAAe,GACf,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,WAAW,GACX,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,eAAe,CAAC;AAEpB,+BAA+B;AAC/B,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE7D,mCAAmC;AACnC,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,GACT,WAAW,CAAC;AAEhB,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,SAAS,GACT,mBAAmB,GACnB,WAAW,GACX,YAAY,GACZ,SAAS,CAAC;AAEd,iDAAiD;AACjD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8CAA8C;AAC9C,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACxB,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;I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A2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,oCAAoC;AACpC,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,EAAE,CAO/D;AAED,0CAA0C;AAC1C,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,EAAE,CAOtE;AAED,kCAAkC;AAClC,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,UAAU,GAAG,IAAI,CAOtE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event types for the ADIT unified timeline.
|
|
3
|
+
*
|
|
4
|
+
* Every code change, prompt, tool call, and system action is an event.
|
|
5
|
+
* Events form a tree via parentEventId for nested execution tracking.
|
|
6
|
+
*/
|
|
7
|
+
/** Parsed labels from labelsJson */
|
|
8
|
+
export function parseLabels(labelsJson) {
|
|
9
|
+
if (!labelsJson)
|
|
10
|
+
return [];
|
|
11
|
+
try {
|
|
12
|
+
return JSON.parse(labelsJson);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Parsed diff stats from diffStatJson */
|
|
19
|
+
export function parseDiffStats(diffStatJson) {
|
|
20
|
+
if (!diffStatJson)
|
|
21
|
+
return [];
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(diffStatJson);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Parsed error from errorJson */
|
|
30
|
+
export function parseError(errorJson) {
|
|
31
|
+
if (!errorJson)
|
|
32
|
+
return null;
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(errorJson);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2HH,oCAAoC;AACpC,MAAM,UAAU,WAAW,CAAC,UAAyB;IACnD,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAC3B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,cAAc,CAAC,YAA2B;IACxD,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAC7B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,UAAU,CAAC,SAAwB;IACjD,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { EventType, Actor, EventStatus, ErrorCategory, FileStat, EventError, AditEvent, } from "./events.js";
|
|
2
|
+
export { parseLabels, parseDiffStats, parseError } from "./events.js";
|
|
3
|
+
export type { SessionStatus, Platform, SessionType, SessionMetadata, AditSession, } from "./session.js";
|
|
4
|
+
export type { PlanType, PlanStatus, AditPlan, } from "./plan.js";
|
|
5
|
+
export type { EnvSnapshot, EnvDiff, EnvChange } from "./environment.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtE,YAAY,EACV,aAAa,EACb,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SpecFlow-inspired plan types.
|
|
3
|
+
*
|
|
4
|
+
* Plans follow a hierarchy: Intent → Roadmap → Tasks
|
|
5
|
+
* Sessions and events can be linked to specific tasks.
|
|
6
|
+
*/
|
|
7
|
+
export type PlanType = "intent" | "roadmap" | "task";
|
|
8
|
+
export type PlanStatus = "draft" | "active" | "completed" | "abandoned";
|
|
9
|
+
/** A plan artifact (intent doc, roadmap, or task) */
|
|
10
|
+
export interface AditPlan {
|
|
11
|
+
/** ULID */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Project this plan belongs to */
|
|
14
|
+
projectId: string;
|
|
15
|
+
/** 'intent' | 'roadmap' | 'task' */
|
|
16
|
+
planType: PlanType;
|
|
17
|
+
/** Parent plan (roadmap→intent, task→roadmap) */
|
|
18
|
+
parentPlanId: string | null;
|
|
19
|
+
title: string;
|
|
20
|
+
/** Markdown content */
|
|
21
|
+
contentMd: string;
|
|
22
|
+
status: PlanStatus;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string | null;
|
|
25
|
+
/** Vector clock for sync */
|
|
26
|
+
vclockJson: string;
|
|
27
|
+
/** Soft delete */
|
|
28
|
+
deletedAt: string | null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/types/plan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,QAAQ,GACR,WAAW,GACX,WAAW,CAAC;AAEhB,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACvB,WAAW;IACX,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,QAAQ,EAAE,QAAQ,CAAC;IACnB,iDAAiD;IACjD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/types/plan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session types for ADIT.
|
|
3
|
+
*
|
|
4
|
+
* A session represents a continuous AI-assisted development interaction.
|
|
5
|
+
* Multiple sessions can exist for the same project (multi-client support).
|
|
6
|
+
*/
|
|
7
|
+
/** Session lifecycle status */
|
|
8
|
+
export type SessionStatus = "active" | "completed" | "error" | "cancelled";
|
|
9
|
+
/** Which AI platform is driving this session */
|
|
10
|
+
export type Platform = "claude-code" | "cursor" | "copilot" | "opencode" | "codex" | "other";
|
|
11
|
+
/** Session type */
|
|
12
|
+
export type SessionType = "interactive" | "headless";
|
|
13
|
+
/** Session metadata captured at start */
|
|
14
|
+
export interface SessionMetadata {
|
|
15
|
+
gitBranch: string;
|
|
16
|
+
gitRemoteUrl?: string;
|
|
17
|
+
workingDirectory: string;
|
|
18
|
+
nodeVersion?: string;
|
|
19
|
+
pythonVersion?: string;
|
|
20
|
+
osInfo?: string;
|
|
21
|
+
}
|
|
22
|
+
/** The session record */
|
|
23
|
+
export interface AditSession {
|
|
24
|
+
/** ULID — globally unique, time-sortable */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Project identifier: hash(remote_url + repo_root) */
|
|
27
|
+
projectId: string;
|
|
28
|
+
/** Unique per machine/installation */
|
|
29
|
+
clientId: string;
|
|
30
|
+
sessionType: SessionType;
|
|
31
|
+
platform: Platform;
|
|
32
|
+
startedAt: string;
|
|
33
|
+
endedAt: string | null;
|
|
34
|
+
status: SessionStatus;
|
|
35
|
+
/** Serialized SessionMetadata */
|
|
36
|
+
metadataJson: string | null;
|
|
37
|
+
/** Vector clock for sync */
|
|
38
|
+
vclockJson: string;
|
|
39
|
+
/** Platform-provided session ID (e.g., Claude Code session_id) */
|
|
40
|
+
platformSessionId?: string | null;
|
|
41
|
+
/** Soft delete timestamp */
|
|
42
|
+
deletedAt: string | null;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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version":3,"file":"session.js","sourceRoot":"","sources":["../../src/types/session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@varveai/adit-core",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Core types, database, and sync primitives for ADIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"better-sqlite3": "^12.6.2",
|
|
19
|
+
"ulid": "^2.3.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
23
|
+
"typescript": "^5.7.2"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
28
|
+
}
|
|
29
|
+
}
|