or3-provider-sqlite 0.0.24 → 0.0.25
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 +9 -3
- package/dist/module.json +1 -1
- package/dist/runtime/server/background-jobs/sqlite-provider.d.ts +34 -1
- package/dist/runtime/server/background-jobs/sqlite-provider.js +830 -29
- package/dist/runtime/server/db/migrate.js +4 -1
- package/dist/runtime/server/db/migrations/029_delegation_wait.d.ts +4 -0
- package/dist/runtime/server/db/migrations/029_delegation_wait.js +89 -0
- package/dist/runtime/server/db/schema.d.ts +8 -0
- package/dist/runtime/server/sync/background-history-fingerprint.d.ts +6 -0
- package/dist/runtime/server/sync/background-history-fingerprint.js +14 -0
- package/dist/runtime/server/sync/canonical-project-ownership.d.ts +6 -0
- package/dist/runtime/server/sync/canonical-project-ownership.js +20 -0
- package/dist/runtime/server/sync/sqlite-sync-gateway-adapter.d.ts +17 -0
- package/dist/runtime/server/sync/sqlite-sync-gateway-adapter.js +145 -34
- package/package.json +13 -7
package/README.md
CHANGED
|
@@ -283,12 +283,18 @@ bun run type-check # TypeScript validation
|
|
|
283
283
|
bun run build # build for distribution
|
|
284
284
|
```
|
|
285
285
|
|
|
286
|
-
The normal test suite
|
|
287
|
-
|
|
286
|
+
The normal test suite uses a hash-verified snapshot of a reviewed, committed
|
|
287
|
+
host revision; see [its provenance](test/fixtures/host-next.README.md).
|
|
288
|
+
`bun run test:host-integration` reruns the
|
|
288
289
|
same background-job, canonical-history and registration cases against a prepared
|
|
289
290
|
sibling `../or3-chat` at the exact reviewed source tree. It fails on missing or
|
|
290
291
|
mismatched source rather than falling back to fixtures. See the
|
|
291
|
-
[fixture provenance and prerequisites](test/fixtures/host
|
|
292
|
+
[fixture provenance and prerequisites](test/fixtures/host-next.README.md).
|
|
293
|
+
|
|
294
|
+
`OR3_PROJECT_HOST_ROOT=/path/to/or3-chat bun run type-check:host-contract`
|
|
295
|
+
checks provider server code against that prepared host's actual contracts and
|
|
296
|
+
generated Nuxt server declarations. This is stronger than the standalone release
|
|
297
|
+
shim check; it does not establish that either checkout is a released artifact.
|
|
292
298
|
|
|
293
299
|
## Compatibility
|
|
294
300
|
|
package/dist/module.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import type { BackgroundJob, BackgroundJobExecution, BackgroundJobProvider, CreateJobParams, JobUpdate, AdmissionCancellationResult, GenerationHistoryPhase, TerminalGenerationSnapshot } from '~~/server/utils/background-jobs/types';
|
|
1
|
+
import type { BackgroundJob, BackgroundJobExecution, BackgroundJobProvider, CreateJobParams, DelegationChildAdmission, DelegationChildAdmissionResult, DelegationWaitCommit, DelegationResume, DelegationResumeResult, JobUpdate, AdmissionCancellationResult, GenerationHistoryPhase, TerminalGenerationSnapshot } from '~~/server/utils/background-jobs/types';
|
|
2
|
+
import { type DelegationDispatch } from '~~/shared/chat/delegation-checkpoint';
|
|
2
3
|
export declare class SqliteBackgroundJobProvider implements BackgroundJobProvider {
|
|
3
4
|
readonly name = "sqlite";
|
|
5
|
+
get delegationCoordinatorVersion(): 1 | undefined;
|
|
6
|
+
private lastDelegationDiagnosticCheckAt?;
|
|
4
7
|
createJob(params: CreateJobParams): Promise<string>;
|
|
5
8
|
getJob(jobId: string, userId: string): Promise<BackgroundJob | null>;
|
|
6
9
|
findJobByIdempotencyKey(idempotencyKey: string, userId: string): Promise<BackgroundJob | null>;
|
|
@@ -14,6 +17,30 @@ export declare class SqliteBackgroundJobProvider implements BackgroundJobProvide
|
|
|
14
17
|
checkJobAborted(jobId: string): Promise<boolean>;
|
|
15
18
|
claimJob(jobId: string, leaseOwner: string, now: number, leaseExpiresAt: number): Promise<BackgroundJob | null>;
|
|
16
19
|
claimNextJob(leaseOwner: string, now: number, leaseExpiresAt: number): Promise<BackgroundJob | null>;
|
|
20
|
+
beginDelegationDispatch(jobId: string, leaseOwner: string): Promise<DelegationDispatch | null>;
|
|
21
|
+
commitDelegationDispatch(jobId: string, leaseOwner: string, sequence: number, execution: BackgroundJobExecution, toolCalls: BackgroundJob['tool_calls']): Promise<boolean>;
|
|
22
|
+
parkDelegationWait(jobId: string, leaseOwner: string, execution: BackgroundJobExecution, toolCalls: BackgroundJob['tool_calls']): Promise<boolean>;
|
|
23
|
+
claimNextDelegationWait(leaseOwner: string, now: number, leaseExpiresAt: number): Promise<BackgroundJob | null>;
|
|
24
|
+
admitDelegationChild(input: DelegationChildAdmission): Promise<DelegationChildAdmissionResult>;
|
|
25
|
+
commitDelegationWait(input: DelegationWaitCommit): Promise<boolean>;
|
|
26
|
+
stopInvalidDelegationWait(input: {
|
|
27
|
+
parentJobId: string;
|
|
28
|
+
leaseOwner: string;
|
|
29
|
+
expectedRevision: number;
|
|
30
|
+
authorizationDenied?: boolean;
|
|
31
|
+
}): Promise<'valid' | 'stopped' | 'not-owned' | 'unavailable'>;
|
|
32
|
+
cleanupDelegationWait(input: {
|
|
33
|
+
parentJobId: string;
|
|
34
|
+
leaseOwner: string;
|
|
35
|
+
expectedRevision: number;
|
|
36
|
+
}): Promise<'not-owned' | 'pending' | 'settled'>;
|
|
37
|
+
expireDelegationWait(input: {
|
|
38
|
+
parentJobId: string;
|
|
39
|
+
leaseOwner: string;
|
|
40
|
+
expectedRevision: number;
|
|
41
|
+
}): Promise<'not-owned' | 'pending'>;
|
|
42
|
+
private stopDelegationChildren;
|
|
43
|
+
resumeDelegationWait(input: DelegationResume): Promise<DelegationResumeResult>;
|
|
17
44
|
renewJobLease(jobId: string, leaseOwner: string, _now: number, leaseExpiresAt: number): Promise<boolean>;
|
|
18
45
|
updateJobExecution(jobId: string, execution: BackgroundJobExecution, leaseOwner: string): Promise<boolean>;
|
|
19
46
|
claimClientToolCall(jobId: string, userId: string, callId: string, claimToken: string, claimExpiresAt: number): Promise<BackgroundJob | null>;
|
|
@@ -22,6 +49,12 @@ export declare class SqliteBackgroundJobProvider implements BackgroundJobProvide
|
|
|
22
49
|
setHistoryPhase(jobId: string, phase: GenerationHistoryPhase, options?: {
|
|
23
50
|
from?: GenerationHistoryPhase[];
|
|
24
51
|
}): Promise<boolean>;
|
|
52
|
+
deferDelegationHistory(input: {
|
|
53
|
+
jobId: string;
|
|
54
|
+
userId: string;
|
|
55
|
+
generationId: string;
|
|
56
|
+
phase: 'admission_pending' | 'finalization_pending';
|
|
57
|
+
}): Promise<boolean>;
|
|
25
58
|
getPendingHistoryJobs(limit: number): Promise<BackgroundJob[]>;
|
|
26
59
|
cleanupExpired(): Promise<number>;
|
|
27
60
|
getActiveJobCount(): Promise<number>;
|