@gitgov/core 2.6.0 → 2.7.0
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 +2 -1
- package/dist/src/agent_runner-CHDkBfPZ.d.ts +610 -0
- package/dist/src/fs.d.ts +9 -25
- package/dist/src/fs.js +3 -0
- package/dist/src/fs.js.map +1 -1
- package/dist/src/github.d.ts +117 -3
- package/dist/src/github.js +651 -10
- package/dist/src/github.js.map +1 -1
- package/dist/src/{index-Bhc341pf.d.ts → index-LULVRsCZ.d.ts} +180 -1
- package/dist/src/index.d.ts +9 -8
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/memory.d.ts +5 -6
- package/dist/src/{memory_file_lister-BIIcVXLw.d.ts → memory_file_lister-BCY4ZYGW.d.ts} +1 -2
- package/dist/src/prisma.d.ts +108 -26
- package/dist/src/prisma.js +268 -32
- package/dist/src/prisma.js.map +1 -1
- package/dist/src/{record_projection.types-B8AM7u8U.d.ts → record_projection.types-Dz9YU3r9.d.ts} +64 -4
- package/dist/src/session_store-I4Z6PW2c.d.ts +50 -0
- package/dist/src/{agent_runner-pr7h-9cV.d.ts → sync_state-Bn_LogJ2.d.ts} +5 -592
- package/package.json +7 -1
- package/dist/src/key_provider-jjWek3w1.d.ts +0 -227
- package/dist/src/record_store-BXKWqon5.d.ts +0 -64
package/dist/src/{record_projection.types-B8AM7u8U.d.ts → record_projection.types-Dz9YU3r9.d.ts}
RENAMED
|
@@ -1,4 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IdEncoder for transforming IDs to storage-safe filenames.
|
|
3
|
+
* Useful for characters not allowed in filesystem (e.g., `:` on Windows)
|
|
4
|
+
* or URL-unsafe characters in remote backends.
|
|
5
|
+
*/
|
|
6
|
+
interface IdEncoder {
|
|
7
|
+
/** Transform ID to storage-safe string */
|
|
8
|
+
encode: (id: string) => string;
|
|
9
|
+
/** Recover original ID from encoded string */
|
|
10
|
+
decode: (encoded: string) => string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Default encoder: `:` → `_` (for IDs like "human:camilo")
|
|
14
|
+
* Reversible because IDs cannot contain `_` (see id_generator.ts)
|
|
15
|
+
*/
|
|
16
|
+
declare const DEFAULT_ID_ENCODER: IdEncoder;
|
|
17
|
+
/**
|
|
18
|
+
* RecordStore<V, R, O> - Generic interface for record persistence
|
|
19
|
+
*
|
|
20
|
+
* Abstracts CRUD operations without assuming storage backend.
|
|
21
|
+
* Each implementation decides how to persist (fs, memory, db, remote).
|
|
22
|
+
*
|
|
23
|
+
* @typeParam V - Value type (the record being stored)
|
|
24
|
+
* @typeParam R - Return type for write operations (default: void for local, GitHubWriteResult for GitHub)
|
|
25
|
+
* @typeParam O - Options type for write operations (default: void for local, GitHubWriteOpts for GitHub)
|
|
26
|
+
*/
|
|
27
|
+
interface RecordStore<V, R = void, O = void> {
|
|
28
|
+
/**
|
|
29
|
+
* Gets a record by ID
|
|
30
|
+
* @returns The record or null if it doesn't exist
|
|
31
|
+
*/
|
|
32
|
+
get(id: string): Promise<V | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Persists a record
|
|
35
|
+
* @param id - Unique identifier
|
|
36
|
+
* @param value - The record to persist
|
|
37
|
+
*/
|
|
38
|
+
put(id: string, value: V, ...opts: O extends void ? [] : [opts?: O]): Promise<R>;
|
|
39
|
+
/**
|
|
40
|
+
* Persists multiple records in a single operation.
|
|
41
|
+
* Local backends iterate sequentially; GitHub backend uses atomic commits.
|
|
42
|
+
*/
|
|
43
|
+
putMany(entries: Array<{
|
|
44
|
+
id: string;
|
|
45
|
+
value: V;
|
|
46
|
+
}>, ...opts: O extends void ? [] : [opts?: O]): Promise<R>;
|
|
47
|
+
/**
|
|
48
|
+
* Deletes a record
|
|
49
|
+
* @param id - Identifier of the record to delete
|
|
50
|
+
*/
|
|
51
|
+
delete(id: string, ...opts: O extends void ? [] : [opts?: O]): Promise<R>;
|
|
52
|
+
/**
|
|
53
|
+
* Lists all record IDs
|
|
54
|
+
* @returns Array of IDs
|
|
55
|
+
*/
|
|
56
|
+
list(): Promise<string[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Checks if a record exists
|
|
59
|
+
* @param id - Identifier to check
|
|
60
|
+
*/
|
|
61
|
+
exists(id: string): Promise<boolean>;
|
|
62
|
+
}
|
|
2
63
|
|
|
3
64
|
/**
|
|
4
65
|
* This file was automatically generated from actor_record_schema.json.
|
|
@@ -1163,8 +1224,7 @@ type ProjectionContext = {
|
|
|
1163
1224
|
*
|
|
1164
1225
|
* Abstracts where IndexData is persisted. Implementations:
|
|
1165
1226
|
* - FsRecordProjection: writes to .gitgov/index.json (CLI)
|
|
1166
|
-
* -
|
|
1167
|
-
* - PrismaRecordProjection: stores as JSON blob via Prisma-compatible client (SaaS)
|
|
1227
|
+
* - PrismaRecordProjection: decomposes into 6 queryable Prisma tables (SaaS)
|
|
1168
1228
|
*/
|
|
1169
1229
|
interface IRecordProjection {
|
|
1170
1230
|
persist(data: IndexData, context: ProjectionContext): Promise<void>;
|
|
@@ -1204,4 +1264,4 @@ interface IRecordProjector {
|
|
|
1204
1264
|
invalidateCache(): Promise<void>;
|
|
1205
1265
|
}
|
|
1206
1266
|
|
|
1207
|
-
export { type
|
|
1267
|
+
export { type EventMetadata as $, type ActorPayload as A, type CollaborationMetrics as B, type ChangelogPayload as C, DEFAULT_ID_ENCODER as D, type EmbeddedMetadataHeader as E, type FeedbackPayload as F, type GitGovRecord as G, type IRecordMetrics as H, type IdEncoder as I, type ProductivityMetrics as J, RecordMetrics as K, type RecordMetricsDependencies as L, type SystemStatus as M, type TaskHealthReport as N, type ActivityEvent as O, type ProjectionContext as P, type ActorCreatedEvent as Q, type RecordStore as R, type Signature as S, type TaskPayload as T, type ActorRevokedEvent as U, type AgentRegisteredEvent as V, type BaseEvent as W, type ChangelogCreatedEvent as X, type CycleCreatedEvent as Y, type CycleStatusChangedEvent as Z, type EventHandler as _, type IRecordProjector as a, type EventSubscription as a0, type ExecutionCreatedEvent as a1, type FeedbackCreatedEvent as a2, type GitGovEvent as a3, type SystemDailyTickEvent as a4, type TaskCreatedEvent as a5, type TaskStatusChangedEvent as a6, type RecordProjectorDependencies as a7, type IndexGenerationReport as a8, type IntegrityReport as a9, type AllRecords as aa, type DerivedStates as ab, type EnrichedTaskRecord as ac, type DerivedStateSets as ad, type IntegrityError as ae, type IntegrityWarning as af, type IRecordProjection as b, type IndexData as c, type ActorRecord as d, type AgentPayload as e, type AgentRecord as f, type ChangelogRecord as g, type CustomRecord as h, type CyclePayload as i, type CycleRecord as j, type EmbeddedMetadataRecord as k, type ExecutionPayload as l, type ExecutionRecord as m, type FeedbackRecord as n, type GitGovActorRecord as o, type GitGovAgentRecord as p, type GitGovChangelogRecord as q, type GitGovCycleRecord as r, GitGovError as s, type GitGovExecutionRecord as t, type GitGovFeedbackRecord as u, type GitGovRecordPayload as v, type GitGovRecordType as w, type GitGovTaskRecord as x, type TaskRecord as y, type RecordStores as z };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { a as GitGovSession } from './index-LULVRsCZ.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SessionStore - Session persistence abstraction
|
|
5
|
+
*
|
|
6
|
+
* Interface for storing and retrieving local session state (.session.json).
|
|
7
|
+
* Session state is ephemeral, machine-local, and NOT versioned in Git.
|
|
8
|
+
*
|
|
9
|
+
* Implementations:
|
|
10
|
+
* - FsSessionStore: Filesystem-based (production)
|
|
11
|
+
* - MemorySessionStore: In-memory (tests, serverless)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Interface for session state persistence.
|
|
16
|
+
*
|
|
17
|
+
* Session state includes:
|
|
18
|
+
* - Actor state (activeTaskId, activeCycleId, syncStatus)
|
|
19
|
+
* - Sync preferences (pullScheduler, fileWatcher settings)
|
|
20
|
+
* - Cloud session tokens
|
|
21
|
+
* - Last session information
|
|
22
|
+
*
|
|
23
|
+
* Unlike ConfigStore, SessionStore handles ephemeral, machine-local state
|
|
24
|
+
* that is NOT shared between collaborators.
|
|
25
|
+
*/
|
|
26
|
+
interface SessionStore {
|
|
27
|
+
/**
|
|
28
|
+
* Load session state from storage.
|
|
29
|
+
*
|
|
30
|
+
* @returns GitGovSession object or null if not found
|
|
31
|
+
*/
|
|
32
|
+
loadSession(): Promise<GitGovSession | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Save session state to storage.
|
|
35
|
+
*
|
|
36
|
+
* @param session - The session state to persist
|
|
37
|
+
*/
|
|
38
|
+
saveSession(session: GitGovSession): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Detect actor from private key files.
|
|
41
|
+
*
|
|
42
|
+
* Optional method for implementations that support actor auto-detection
|
|
43
|
+
* from .key files in the actors directory.
|
|
44
|
+
*
|
|
45
|
+
* @returns Actor ID (e.g., "human:camilo-v2") or null if not detectable
|
|
46
|
+
*/
|
|
47
|
+
detectActorFromKeyFiles?(): Promise<string | null>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type { SessionStore as S };
|