@gitgov/core 2.5.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.
@@ -1,7 +1,5 @@
1
- import { I as ISessionManager, S as SessionStore, G as GitGovSession, A as ActorState, a as SyncPreferencesUpdate, K as KeyProvider } from './key_provider-jjWek3w1.js';
2
- import { k as IConfigManager, C as ConfigStore, G as GitGovConfig, S as SyncConfig, l as SyncDefaults, A as AuditState, j as AuditStateUpdate, g as FileLister, F as FsFileListerOptions, h as FileListOptions, i as FileStats, I as IGitModule } from './index-Bhc341pf.js';
3
- import { R as RecordStore } from './record_store-BXKWqon5.js';
4
- import { Q as BaseEvent, X as EventHandler, Z as EventSubscription, a0 as GitGovEvent, G as GitGovRecord, v as GitGovRecordType, I as IRecordProjector, A as ActorPayload, c as ActorRecord, R as RecordStores$1, l as ExecutionRecord, e as AgentRecord } from './record_projection.types-B8AM7u8U.js';
1
+ import { o as IConfigManager, C as ConfigStore, G as GitGovConfig, p as SyncConfig, q as SyncDefaults, m as AuditState, n as AuditStateUpdate, K as KeyProvider, k as ISessionManager, I as IGitModule } from './index-LULVRsCZ.js';
2
+ import { W as BaseEvent, _ as EventHandler, a0 as EventSubscription, a3 as GitGovEvent, G as GitGovRecord, w as GitGovRecordType, R as RecordStore, a as IRecordProjector, A as ActorPayload, d as ActorRecord, z as RecordStores$1 } from './record_projection.types-Dz9YU3r9.js';
5
3
 
6
4
  /**
7
5
  * ConfigManager - Project Configuration Manager
@@ -78,200 +76,6 @@ declare class ConfigManager implements IConfigManager {
78
76
  getStateBranch(): Promise<string>;
79
77
  }
80
78
 
81
- /**
82
- * SessionManager - Local Session State Manager
83
- *
84
- * Provides typed access to GitGovernance session state (.session.json).
85
- * Session state is ephemeral, machine-local, and NOT versioned in Git.
86
- *
87
- * Uses SessionStore abstraction for backend-agnostic persistence.
88
- */
89
-
90
- /**
91
- * Session Manager Class
92
- *
93
- * Provides typed access to GitGovernance session state.
94
- * Uses SessionStore abstraction for backend-agnostic persistence.
95
- *
96
- * @example
97
- * ```typescript
98
- * // Production usage
99
- * import { FsSessionStore } from '@gitgov/core/fs';
100
- * const sessionStore = new FsSessionStore('/path/to/project');
101
- * const sessionManager = new SessionManager(sessionStore);
102
- *
103
- * // Test usage
104
- * import { MemorySessionStore } from '@gitgov/core/memory';
105
- * const sessionStore = new MemorySessionStore();
106
- * sessionStore.setSession({ ... });
107
- * const sessionManager = new SessionManager(sessionStore);
108
- * ```
109
- */
110
- declare class SessionManager implements ISessionManager {
111
- private readonly sessionStore;
112
- constructor(sessionStore: SessionStore);
113
- /**
114
- * Load GitGovernance session state
115
- * [EARS-E1] Auto-detects actor from .key files if no session or no actorId exists
116
- */
117
- loadSession(): Promise<GitGovSession | null>;
118
- /**
119
- * [EARS-E1] Detect actor from .key files in .gitgov/actors/
120
- */
121
- detectActorFromKeyFiles(): Promise<string | null>;
122
- /**
123
- * Get actor state for a specific actor
124
- */
125
- getActorState(actorId: string): Promise<ActorState | null>;
126
- /**
127
- * Update actor state for a specific actor
128
- */
129
- updateActorState(actorId: string, state: Partial<ActorState>): Promise<void>;
130
- /**
131
- * Get cloud session token
132
- */
133
- getCloudSessionToken(): Promise<string | null>;
134
- /**
135
- * Get sync preferences from session
136
- */
137
- getSyncPreferences(): Promise<GitGovSession['syncPreferences'] | null>;
138
- /**
139
- * Update sync preferences in .session.json
140
- * These are local machine preferences that override project defaults
141
- */
142
- updateSyncPreferences(preferences: SyncPreferencesUpdate): Promise<void>;
143
- /**
144
- * Get last session info (last human who interacted)
145
- */
146
- getLastSession(): Promise<{
147
- actorId: string;
148
- timestamp: string;
149
- } | null>;
150
- }
151
-
152
- /**
153
- * FsKeyProvider - Filesystem-based KeyProvider implementation
154
- *
155
- * Stores private keys in .gitgov/keys/{actorId}.key
156
- * Used in development and CLI environments.
157
- *
158
- * @module key_provider/fs/fs_key_provider
159
- */
160
-
161
- /**
162
- * Options for FsKeyProvider.
163
- */
164
- interface FsKeyProviderOptions {
165
- /** Directory where key files are stored (e.g., .gitgov/keys) */
166
- keysDir: string;
167
- /** File extension for key files (default: '.key') */
168
- extension?: string;
169
- /** File permissions for key files (default: 0o600 - owner read/write only) */
170
- fileMode?: number;
171
- }
172
- /**
173
- * Filesystem-based KeyProvider implementation.
174
- * Keys are stored in a dedicated directory with .key extension.
175
- *
176
- * @example
177
- * ```typescript
178
- * const provider = new FsKeyProvider({ keysDir: '.gitgov/keys' });
179
- * await provider.setPrivateKey('actor:human:alice', 'base64PrivateKey...');
180
- * const key = await provider.getPrivateKey('actor:human:alice');
181
- * ```
182
- */
183
- declare class FsKeyProvider implements KeyProvider {
184
- private readonly keysDir;
185
- private readonly extension;
186
- private readonly fileMode;
187
- constructor(options: FsKeyProviderOptions);
188
- /**
189
- * [EARS-KP01] Retrieves the private key for an actor.
190
- * [EARS-FKP07] Trims whitespace from content.
191
- * [EARS-FKP08] Returns null for empty key file.
192
- */
193
- getPrivateKey(actorId: string): Promise<string | null>;
194
- /**
195
- * [EARS-KP03] Stores a private key for an actor.
196
- * [EARS-FKP01] Creates keysDir if not exists.
197
- * [EARS-FKP02] Writes key to {keysDir}/{actorId}.key.
198
- * [EARS-FKP03] Sets secure file permissions (0600).
199
- */
200
- setPrivateKey(actorId: string, privateKey: string): Promise<void>;
201
- /**
202
- * [EARS-FKP06] Checks if a private key exists for an actor.
203
- */
204
- hasPrivateKey(actorId: string): Promise<boolean>;
205
- /**
206
- * [EARS-KP04] Deletes the private key for an actor.
207
- */
208
- deletePrivateKey(actorId: string): Promise<boolean>;
209
- /**
210
- * [EARS-FKP04] Builds the key file path, sanitizing actorId to prevent path traversal.
211
- * [EARS-FKP05] Replaces slashes with underscores.
212
- */
213
- private getKeyPath;
214
- /**
215
- * [EARS-FKP04] Sanitizes actorId to prevent directory traversal.
216
- * [EARS-FKP05] Replaces path separators with underscores.
217
- * [EARS-FKP09] Throws INVALID_ACTOR_ID for empty actorId.
218
- */
219
- private sanitizeActorId;
220
- /**
221
- * Sanitizes actorId for logging (removes potential secrets).
222
- */
223
- private sanitizeForLog;
224
- }
225
-
226
- /**
227
- * FsFileLister - Filesystem-based FileLister implementation
228
- *
229
- * Uses fast-glob for pattern matching and fs/promises for file operations.
230
- * Used in CLI and development environments.
231
- *
232
- * @module file_lister/fs/fs_file_lister
233
- */
234
-
235
- /**
236
- * Filesystem-based FileLister implementation.
237
- * Uses fast-glob for pattern matching and fs/promises for file operations.
238
- *
239
- * @example
240
- * ```typescript
241
- * const lister = new FsFileLister({ cwd: '/path/to/project' });
242
- * const files = await lister.list(['**\/*.ts'], { ignore: ['node_modules/**'] });
243
- * const content = await lister.read('src/index.ts');
244
- * ```
245
- */
246
- declare class FsFileLister implements FileLister {
247
- private readonly cwd;
248
- constructor(options: FsFileListerOptions);
249
- /**
250
- * [EARS-FL01] Lists files matching glob patterns.
251
- * [EARS-FFL01] Excludes files matching ignore patterns.
252
- */
253
- list(patterns: string[], options?: FileListOptions): Promise<string[]>;
254
- /**
255
- * [EARS-FL02] Checks if a file exists.
256
- */
257
- exists(filePath: string): Promise<boolean>;
258
- /**
259
- * [EARS-FL03] Reads file content as string.
260
- * [EARS-FFL03] Throws FILE_NOT_FOUND for missing files.
261
- */
262
- read(filePath: string): Promise<string>;
263
- /**
264
- * [EARS-FL04] Gets file statistics.
265
- * [EARS-FFL03] Throws FILE_NOT_FOUND for missing files.
266
- */
267
- stat(filePath: string): Promise<FileStats>;
268
- /**
269
- * [EARS-FFL04] Validates that the path doesn't contain traversal characters.
270
- * [EARS-FFL05] Validates that the path is not absolute.
271
- */
272
- private validatePath;
273
- }
274
-
275
79
  /**
276
80
  * Event Stream interface - Contract for both Local and Global bus implementations
277
81
  */
@@ -683,115 +487,6 @@ interface FixResult {
683
487
  backupPath?: string;
684
488
  }
685
489
 
686
- /**
687
- * Environment validation result.
688
- * Used by filesystem implementations to check prerequisites.
689
- */
690
- type EnvironmentValidation = {
691
- /** Whether environment is valid for initialization */
692
- isValid: boolean;
693
- /** Whether directory contains Git repository (fs-only) */
694
- isGitRepo: boolean;
695
- /** Whether process has write permissions */
696
- hasWritePermissions: boolean;
697
- /** Whether GitGovernance is already initialized */
698
- isAlreadyInitialized: boolean;
699
- /** Path to .gitgov directory (if already initialized) */
700
- gitgovPath?: string;
701
- /** List of validation warnings */
702
- warnings: string[];
703
- /** Actionable suggestions for user */
704
- suggestions: string[];
705
- /** Whether a remote 'origin' is configured */
706
- hasRemote?: boolean;
707
- /** Whether the current branch has commits */
708
- hasCommits?: boolean;
709
- /** Name of the current branch */
710
- currentBranch?: string;
711
- };
712
-
713
- /**
714
- * Public interface for project initialization operations (pure - no I/O assumptions).
715
- *
716
- * This interface defines the contract for initializing GitGovernance projects
717
- * across different backends (filesystem, database, API).
718
- *
719
- * The project context (path, tenant ID, etc.) is injected at construction time,
720
- * so methods operate on the pre-configured project without needing explicit paths.
721
- *
722
- * Implementations:
723
- * - FsProjectInitializer: Local filesystem (.gitgov/ directory)
724
- * - DbProjectInitializer: Database (SaaS multi-tenant)
725
- * - ApiProjectInitializer: Remote API (agents, serverless)
726
- *
727
- * @example
728
- * ```typescript
729
- * // CLI uses FsProjectInitializer with projectRoot injected
730
- * const initializer: IProjectInitializer = new FsProjectInitializer('/path/to/project');
731
- * await initializer.createProjectStructure();
732
- *
733
- * // SaaS uses DbProjectInitializer with tenant injected
734
- * const initializer: IProjectInitializer = new DbProjectInitializer(pool, 'tenant-123');
735
- * await initializer.createProjectStructure();
736
- * ```
737
- */
738
- interface IProjectInitializer {
739
- /**
740
- * Creates the project structure (directories for fs, tables for db, etc).
741
- */
742
- createProjectStructure(): Promise<void>;
743
- /**
744
- * Checks if a project is already initialized.
745
- *
746
- * @returns true if already initialized
747
- */
748
- isInitialized(): Promise<boolean>;
749
- /**
750
- * Writes the project configuration.
751
- *
752
- * @param config - GitGovConfig to persist
753
- */
754
- writeConfig(config: GitGovConfig): Promise<void>;
755
- /**
756
- * Initializes a session for the bootstrap actor.
757
- *
758
- * @param actorId - ID of the bootstrap actor
759
- */
760
- initializeSession(actorId: string): Promise<void>;
761
- /**
762
- * Cleans up partial setup if initialization fails.
763
- */
764
- rollback(): Promise<void>;
765
- /**
766
- * Validates environment for project initialization.
767
- *
768
- * @returns Validation result with warnings and suggestions
769
- */
770
- validateEnvironment(): Promise<EnvironmentValidation>;
771
- /**
772
- * Reads a file from the project context.
773
- *
774
- * @param filePath - Path to the file (relative or absolute depending on backend)
775
- * @returns File contents as string
776
- */
777
- readFile(filePath: string): Promise<string>;
778
- /**
779
- * Copies the agent prompt to the project root for IDE access.
780
- */
781
- copyAgentPrompt(): Promise<void>;
782
- /**
783
- * Sets up version control integration (e.g., .gitignore for fs).
784
- */
785
- setupGitIntegration(): Promise<void>;
786
- /**
787
- * Gets the path/identifier for an actor record.
788
- *
789
- * @param actorId - Actor ID
790
- * @returns Path or identifier for the actor
791
- */
792
- getActorPath(actorId: string): string;
793
- }
794
-
795
490
  /**
796
491
  * IdentityAdapter Interface - The Identity Management Contract
797
492
  *
@@ -824,51 +519,6 @@ interface IdentityAdapterDependencies {
824
519
  eventBus?: IEventStream;
825
520
  }
826
521
 
827
- declare class IdentityAdapter implements IIdentityAdapter {
828
- private stores;
829
- private keyProvider;
830
- private sessionManager;
831
- private eventBus;
832
- constructor(dependencies: IdentityAdapterDependencies);
833
- /**
834
- * Get actor public key for validation - used by other adapters
835
- */
836
- getActorPublicKey(keyId: string): Promise<string | null>;
837
- createActor(payload: ActorPayload, _signerId: string): Promise<ActorRecord>;
838
- getActor(actorId: string): Promise<ActorRecord | null>;
839
- listActors(): Promise<ActorRecord[]>;
840
- signRecord<T extends GitGovRecord>(record: T, actorId: string, role: string, notes: string): Promise<T>;
841
- /**
842
- * Resolves the current active ActorRecord ID by following the succession chain.
843
- * This is critical for AgentRecord operations after key rotation.
844
- *
845
- * @param originalActorId - The original actor ID (may be revoked)
846
- * @returns Promise<string> - The current active actor ID
847
- */
848
- resolveCurrentActorId(originalActorId: string): Promise<string>;
849
- /**
850
- * Gets the current ActorRecord of the system based on active session or fallback.
851
- * This is critical for CLI commands that need to know "who is the current user".
852
- *
853
- * @returns Promise<ActorRecord> - The current active ActorRecord
854
- */
855
- getCurrentActor(): Promise<ActorRecord>;
856
- /**
857
- * Gets the effective (current active) ActorRecord for an AgentRecord.
858
- * This resolves the succession chain to get the current cryptographic identity.
859
- *
860
- * @param agentId - The AgentRecord ID (may reference revoked ActorRecord)
861
- * @returns Promise<ActorRecord | null> - The current active ActorRecord or null
862
- */
863
- getEffectiveActorForAgent(agentId: string): Promise<ActorRecord | null>;
864
- rotateActorKey(actorId: string): Promise<{
865
- oldActor: ActorRecord;
866
- newActor: ActorRecord;
867
- }>;
868
- revokeActor(actorId: string, revokedBy?: string, reason?: "compromised" | "rotation" | "manual", supersededBy?: string): Promise<ActorRecord>;
869
- authenticate(_sessionToken: string): Promise<void>;
870
- }
871
-
872
522
  /**
873
523
  * SyncStateModule Dependencies
874
524
  */
@@ -1113,8 +763,8 @@ type StateDeltaFile = {
1113
763
  *
1114
764
  * Defines the contract for state synchronization between local working tree
1115
765
  * and a shared state branch. Implementations handle the I/O specifics:
1116
- * - FsSyncStateModule: Uses local filesystem + git CLI (packages/core/src/sync_state/fs_sync/)
1117
- * - Future: GithubSyncStateModule via GitHub API
766
+ * - FsSyncStateModule: Uses local filesystem + git CLI (packages/core/src/sync_state/fs/)
767
+ * - GithubSyncStateModule: Uses GitHub API via Octokit (packages/core/src/sync_state/github_sync_state/)
1118
768
  *
1119
769
  * @module sync_state
1120
770
  */
@@ -1152,241 +802,4 @@ interface ISyncStateModule {
1152
802
  resolveConflict(options: SyncStateResolveOptions): Promise<SyncStateResolveResult>;
1153
803
  }
1154
804
 
1155
- /**
1156
- * ExecutionAdapter Dependencies - Facade + Dependency Injection Pattern
1157
- */
1158
- type ExecutionAdapterDependencies = {
1159
- stores: Required<Pick<RecordStores$1, 'tasks' | 'executions'>>;
1160
- identity: IdentityAdapter;
1161
- eventBus: IEventStream;
1162
- };
1163
- /**
1164
- * ExecutionAdapter Interface - The Chronicler of the System
1165
- */
1166
- interface IExecutionAdapter {
1167
- /**
1168
- * Records a new execution event.
1169
- */
1170
- create(payload: Partial<ExecutionRecord>, actorId: string): Promise<ExecutionRecord>;
1171
- /**
1172
- * Gets a specific ExecutionRecord by its ID.
1173
- */
1174
- getExecution(executionId: string): Promise<ExecutionRecord | null>;
1175
- /**
1176
- * Gets all ExecutionRecords for a specific Task.
1177
- */
1178
- getExecutionsByTask(taskId: string): Promise<ExecutionRecord[]>;
1179
- /**
1180
- * Gets all ExecutionRecords in the system.
1181
- */
1182
- getAllExecutions(): Promise<ExecutionRecord[]>;
1183
- }
1184
-
1185
- /**
1186
- * Union type of all supported engines.
1187
- */
1188
- type Engine = AgentRecord["engine"];
1189
- /**
1190
- * Supported engine types by the runner.
1191
- */
1192
- type EngineType = Engine["type"];
1193
- /**
1194
- * Local engine configuration.
1195
- * Agent executes in the same process.
1196
- */
1197
- type LocalEngine = Extract<Engine, {
1198
- type: "local";
1199
- }>;
1200
- /**
1201
- * API engine configuration.
1202
- * Agent executes on a remote server via HTTP.
1203
- */
1204
- type ApiEngine = Extract<Engine, {
1205
- type: "api";
1206
- }>;
1207
- /**
1208
- * MCP engine configuration.
1209
- * Agent executes as MCP server (Model Context Protocol).
1210
- */
1211
- type McpEngine = Extract<Engine, {
1212
- type: "mcp";
1213
- }>;
1214
- /**
1215
- * Custom engine configuration.
1216
- * Allows extensibility via registered protocol handlers.
1217
- */
1218
- type CustomEngine = Extract<Engine, {
1219
- type: "custom";
1220
- }>;
1221
- /**
1222
- * Authentication configuration for remote backends (API/MCP).
1223
- * Extracted from the API engine's auth field.
1224
- */
1225
- type AuthConfig = NonNullable<ApiEngine["auth"]>;
1226
- /**
1227
- * Authentication types for remote backends.
1228
- */
1229
- type AuthType = NonNullable<AuthConfig["type"]>;
1230
- /**
1231
- * Execution context passed to each agent.
1232
- * Includes all information needed for traceability.
1233
- */
1234
- type AgentExecutionContext = {
1235
- /** Agent ID being executed (e.g., "agent:source-audit") */
1236
- agentId: string;
1237
- /** ActorRecord executing (type "agent") */
1238
- actorId: string;
1239
- /** TaskRecord that triggered this execution (required) */
1240
- taskId: string;
1241
- /** Unique UUID for this execution */
1242
- runId: string;
1243
- /** Optional input passed to the agent (from RunOptions.input) */
1244
- input?: unknown;
1245
- };
1246
- /**
1247
- * Options for executing an agent.
1248
- */
1249
- type RunOptions = {
1250
- /** Agent ID to execute (e.g., "agent:source-audit") */
1251
- agentId: string;
1252
- /** TaskRecord that triggers this execution (required) */
1253
- taskId: string;
1254
- /** Actor executing. If not provided, uses agentId */
1255
- actorId?: string;
1256
- /** Specific tool to invoke (MCP engines only) */
1257
- tool?: string;
1258
- /** Input to pass to the agent */
1259
- input?: unknown;
1260
- };
1261
- /**
1262
- * Structured output from the agent.
1263
- * Captured by the runner from each backend.
1264
- */
1265
- type AgentOutput = {
1266
- /** Response data from agent (free structure) */
1267
- data?: unknown;
1268
- /** Text message (summary or description) */
1269
- message?: string;
1270
- /** Generated artifacts (file paths, record IDs, etc.) */
1271
- artifacts?: string[];
1272
- /** Additional agent metadata */
1273
- metadata?: Record<string, unknown>;
1274
- };
1275
- /**
1276
- * Complete response from an agent execution.
1277
- * Returned by runner.runOnce().
1278
- */
1279
- type AgentResponse = {
1280
- /** Unique UUID for this execution */
1281
- runId: string;
1282
- /** Executed agent ID */
1283
- agentId: string;
1284
- /** Execution status */
1285
- status: "success" | "error";
1286
- /** Agent output (only if status: "success") */
1287
- output?: AgentOutput;
1288
- /** Error message (only if status: "error") */
1289
- error?: string;
1290
- /** Created ExecutionRecord ID */
1291
- executionRecordId: string;
1292
- /** Start timestamp */
1293
- startedAt: string;
1294
- /** Completion timestamp */
1295
- completedAt: string;
1296
- /** Duration in milliseconds */
1297
- durationMs: number;
1298
- };
1299
- /**
1300
- * AgentRunner module dependencies (filesystem implementation).
1301
- */
1302
- type AgentRunnerDependencies = {
1303
- /** Path to project root (REQUIRED, injected from CLI/bootstrap) */
1304
- projectRoot: string;
1305
- /** Path to .gitgov directory (optional, defaults to projectRoot/.gitgov) */
1306
- gitgovPath?: string;
1307
- /** IdentityAdapter for actor-signature auth (required if that auth type is used) */
1308
- identityAdapter?: IIdentityAdapter;
1309
- /** ExecutionAdapter for persisting executions (REQUIRED) */
1310
- executionAdapter: IExecutionAdapter;
1311
- /** EventBus for emitting events (optional, no events if not provided) */
1312
- eventBus?: IEventStream;
1313
- /** Protocol handler registry (for engine.type: "custom") */
1314
- protocolHandlers?: ProtocolHandlerRegistry;
1315
- /** Runtime handler registry (for engine.runtime in local engines) */
1316
- runtimeHandlers?: RuntimeHandlerRegistry;
1317
- };
1318
- /**
1319
- * Events emitted by the runner via EventBus.
1320
- */
1321
- type AgentRunnerEvent = {
1322
- type: "agent:started";
1323
- payload: {
1324
- runId: string;
1325
- agentId: string;
1326
- taskId: string;
1327
- startedAt: string;
1328
- };
1329
- } | {
1330
- type: "agent:completed";
1331
- payload: {
1332
- runId: string;
1333
- agentId: string;
1334
- taskId: string;
1335
- status: "success";
1336
- durationMs: number;
1337
- executionRecordId: string;
1338
- };
1339
- } | {
1340
- type: "agent:error";
1341
- payload: {
1342
- runId: string;
1343
- agentId: string;
1344
- taskId: string;
1345
- status: "error";
1346
- error: string;
1347
- durationMs: number;
1348
- executionRecordId: string;
1349
- };
1350
- };
1351
-
1352
- /**
1353
- * Interface for agent loader (allows mocking in tests).
1354
- */
1355
- interface IAgentLoader {
1356
- loadAgent(agentId: string): Promise<AgentRecord>;
1357
- }
1358
- /**
1359
- * Interface for AgentRunner implementations.
1360
- * Allows different backends (filesystem, memory, serverless).
1361
- */
1362
- interface IAgentRunner {
1363
- /**
1364
- * Executes an agent once and returns the response.
1365
- * TaskRecord must exist before calling this method.
1366
- */
1367
- runOnce(opts: RunOptions): Promise<AgentResponse>;
1368
- }
1369
- /**
1370
- * Registry for protocol handlers (engine.type: "custom").
1371
- */
1372
- interface ProtocolHandlerRegistry {
1373
- register(protocol: string, handler: ProtocolHandler): void;
1374
- get(protocol: string): ProtocolHandler | undefined;
1375
- }
1376
- /**
1377
- * Handler for engine.type: "custom".
1378
- */
1379
- type ProtocolHandler = (engine: CustomEngine, ctx: AgentExecutionContext) => Promise<AgentOutput>;
1380
- /**
1381
- * Registry for runtime handlers (engine.runtime in local engines).
1382
- */
1383
- interface RuntimeHandlerRegistry {
1384
- register(runtime: string, handler: RuntimeHandler): void;
1385
- get(runtime: string): RuntimeHandler | undefined;
1386
- }
1387
- /**
1388
- * Handler for engine.runtime in local engines.
1389
- */
1390
- type RuntimeHandler = (engine: LocalEngine, ctx: AgentExecutionContext) => Promise<AgentOutput>;
1391
-
1392
- export { type ExpectedFilesScope as $, type AuditStateOptions as A, eventBus as B, ConfigManager as C, publishEvent as D, type EnvironmentValidation as E, type FixRecordOptions as F, subscribeToEvent as G, type IIdentityAdapter as H, type ILintModule as I, IdentityAdapter as J, type IdentityAdapterDependencies as K, type LintOptions as L, type LintModuleDependencies as M, type FixResult as N, type LintSummary as O, type ProtocolHandlerRegistry as P, type RecordEntry as Q, type RecordStores as R, SessionManager as S, type ValidatorType as T, type IExecutionAdapter as U, type ValidationContext as V, type ExecutionAdapterDependencies as W, type AuditScope as X, type ConflictFileDiff as Y, type ConflictInfo as Z, type ConflictType as _, type LintReport as a, type AgentExecutionContext as a0, type AgentOutput as a1, type AgentRunnerEvent as a2, type ApiEngine as a3, type AuthConfig as a4, type AuthType as a5, type CustomEngine as a6, type Engine as a7, type EngineType as a8, type IAgentLoader as a9, type LocalEngine as aa, type McpEngine as ab, type ProtocolHandler as ac, type RuntimeHandler as ad, type RuntimeHandlerRegistry as ae, type FixReport as b, type LintRecordContext as c, type LintResult as d, type IProjectInitializer as e, type ISyncStateModule as f, type SyncStateModuleDependencies as g, type StateDeltaFile as h, type ConflictDiff as i, type IntegrityViolation as j, type AuditStateReport as k, type SyncStatePushOptions as l, type SyncStatePushResult as m, type SyncStatePullOptions as n, type SyncStatePullResult as o, type SyncStateResolveOptions as p, type SyncStateResolveResult as q, type IEventStream as r, type IAgentRunner as s, type AgentRunnerDependencies as t, type RunOptions as u, type AgentResponse as v, FsKeyProvider as w, type FsKeyProviderOptions as x, FsFileLister as y, EventBus as z };
805
+ export { type AuditStateOptions as A, type AuditScope as B, ConfigManager as C, type ConflictFileDiff as D, EventBus as E, type FixRecordOptions as F, type ConflictInfo as G, type ConflictType as H, type ILintModule as I, type ExpectedFilesScope as J, type LintOptions as L, type RecordStores as R, type SyncStateModuleDependencies as S, type ValidationContext as V, type LintReport as a, type FixReport as b, type LintRecordContext as c, type LintResult as d, type ISyncStateModule as e, type StateDeltaFile as f, type ConflictDiff as g, type IntegrityViolation as h, type AuditStateReport as i, type SyncStatePushOptions as j, type SyncStatePushResult as k, type SyncStatePullOptions as l, type SyncStatePullResult as m, type SyncStateResolveOptions as n, type SyncStateResolveResult as o, type IEventStream as p, type IIdentityAdapter as q, eventBus as r, publishEvent as s, subscribeToEvent as t, type IdentityAdapterDependencies as u, type LintModuleDependencies as v, type FixResult as w, type LintSummary as x, type RecordEntry as y, type ValidatorType as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitgov/core",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "SDK for the GitGovernance ecosystem, providing a type-safe, local-first API to manage identities, agents, and workflows.",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -44,6 +44,7 @@
44
44
  "prebuild": "pnpm compile:types && pnpm generate:indexes",
45
45
  "build": "pnpm clean && tsup",
46
46
  "test": "jest",
47
+ "test:e2e": "jest --config jest.e2e.config.cjs",
47
48
  "test:coverage": "jest --coverage",
48
49
  "prepublishOnly": "pnpm build"
49
50
  },
@@ -80,16 +81,21 @@
80
81
  "picomatch": "^4.0.3"
81
82
  },
82
83
  "devDependencies": {
84
+ "@prisma/adapter-pg": "^6.0.0",
85
+ "@prisma/client": "^6.0.0",
83
86
  "@semantic-release/changelog": "^6.0.3",
84
87
  "@semantic-release/git": "^10.0.1",
85
88
  "@semantic-release/github": "^9.2.6",
86
89
  "@types/jest": "^29.5.14",
87
90
  "@types/js-yaml": "^4.0.9",
88
91
  "@types/node": "^22.18.0",
92
+ "@types/pg": "^8.16.0",
89
93
  "@types/picomatch": "^4.0.2",
90
94
  "conventional-changelog-conventionalcommits": "^7.0.2",
91
95
  "jest": "^29.7.0",
92
96
  "json-schema-to-typescript": "^15.0.4",
97
+ "pg": "^8.13.0",
98
+ "prisma": "^6.0.0",
93
99
  "semantic-release": "^22.0.12",
94
100
  "ts-jest": "^29.1.1",
95
101
  "tsup": "^8.0.0",