@codemem/server 0.47.4 → 0.48.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/dist/index.d.ts +22 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +956 -141
- package/dist/index.js.map +1 -1
- package/dist/relay-reachability-test-fixtures.d.ts +19 -0
- package/dist/relay-reachability-test-fixtures.d.ts.map +1 -0
- package/dist/relay-reachability.d.ts +37 -0
- package/dist/relay-reachability.d.ts.map +1 -0
- package/dist/relay-sync-test-fixtures.d.ts +109 -0
- package/dist/relay-sync-test-fixtures.d.ts.map +1 -0
- package/dist/routes/memory-tool-call.d.ts +47 -0
- package/dist/routes/memory-tool-call.d.ts.map +1 -0
- package/dist/routes/pack.d.ts +3 -1
- package/dist/routes/pack.d.ts.map +1 -1
- package/dist/routes/sync.d.ts +1 -0
- package/dist/routes/sync.d.ts.map +1 -1
- package/dist/shared-store.d.ts +8 -0
- package/dist/shared-store.d.ts.map +1 -0
- package/dist/sync-app.d.ts +17 -0
- package/dist/sync-app.d.ts.map +1 -0
- package/dist/sync-channel-dispatch-test-fixtures.d.ts +43 -0
- package/dist/sync-channel-dispatch-test-fixtures.d.ts.map +1 -0
- package/dist/sync-channel-dispatch.d.ts +19 -0
- package/dist/sync-channel-dispatch.d.ts.map +1 -0
- package/dist/sync-channel-pass-test-fixtures.d.ts +81 -0
- package/dist/sync-channel-pass-test-fixtures.d.ts.map +1 -0
- package/dist/viewer-authority.d.ts +17 -0
- package/dist/viewer-authority.d.ts.map +1 -0
- package/package.json +2 -2
- package/static/app.js +31 -31
- package/static/app.js.br +0 -0
- package/static/app.js.gz +0 -0
- package/static/index.html +75 -13
package/dist/index.d.ts
CHANGED
|
@@ -8,17 +8,19 @@
|
|
|
8
8
|
* Entry: `codemem serve`
|
|
9
9
|
*/
|
|
10
10
|
import type { DeviceIdentityCoordinatorEvidence, GetUpdateStatusOptions, ObserverClient, UpdateStatus } from "@codemem/core";
|
|
11
|
-
import {
|
|
11
|
+
import { type RawEventSweeper, VERSION } from "@codemem/core";
|
|
12
12
|
import { Hono } from "hono";
|
|
13
13
|
import { type AccountLinkOptions } from "./account/guard.js";
|
|
14
14
|
import type { createAccountOwnerRecoveryService } from "./account/owner-recovery-service.js";
|
|
15
15
|
import type { AccountStatusOptions } from "./account/status.js";
|
|
16
16
|
import type { RawEventInbox } from "./raw-event-inbox.js";
|
|
17
|
-
import { type InMemoryRequestRateLimiter } from "./request-rate-limit.js";
|
|
18
17
|
import { type ConfigRouteOptions } from "./routes/config.js";
|
|
18
|
+
import { type MemoryToolCallFn } from "./routes/memory-tool-call.js";
|
|
19
19
|
import { type SyncRoutesOptions } from "./routes/sync.js";
|
|
20
20
|
import { type ViewerTargetStore } from "./routes/target-validation.js";
|
|
21
21
|
import { type LegacyTeamCompletionDependencies, type LegacyTeamConfiguredGroupSnapshotLoader } from "./routes/team-setup.js";
|
|
22
|
+
import { type SyncAppOptions } from "./sync-app.js";
|
|
23
|
+
import { type ViewerAuthorityOptions } from "./viewer-authority.js";
|
|
22
24
|
export type { AccountContext, AccountContextReader, AccountContextReaderOptions, AccountContextResult, AccountProfile, AccountSetup, } from "./account/context.js";
|
|
23
25
|
export { createAccountContextReader } from "./account/context.js";
|
|
24
26
|
export type { AccountLinkOptions } from "./account/guard.js";
|
|
@@ -32,25 +34,34 @@ export type { AdvancePendingProjectSharesResult, AdvanceProjectShareOperationRes
|
|
|
32
34
|
export { advancePendingProjectSharesOperation, reconcileRecipientPolicyProjectsOperation, } from "./application/coordinator-maintenance.js";
|
|
33
35
|
export type { RawEventInbox, RawEventInboxEntry, RawEventInboxStatus } from "./raw-event-inbox.js";
|
|
34
36
|
export { createViewerRawEventInbox, FileRawEventInbox, resolveRawEventInboxDirectory, } from "./raw-event-inbox.js";
|
|
37
|
+
export { createViewerRelayReachability, type RelayLogLevel, type ViewerRelayReachability, type ViewerRelayReachabilityOptions, } from "./relay-reachability.js";
|
|
38
|
+
export { MEMORY_TOOL_CALL_CAPABILITY, type MemoryToolCaller, type MemoryToolCallFn, memoryToolCallRoutes, } from "./routes/memory-tool-call.js";
|
|
35
39
|
export type { RecipientPolicyReconciliationReadModel, RecipientPolicyReconciliationReadState, ReconcileConfiguredCoordinatorEnrollmentResult, } from "./routes/sync.js";
|
|
36
40
|
export { advancePendingProjectShares, advanceProjectShareOperation, createRecipientPolicyReconcilerEffects, listRecipientPolicyReconciliationStatus, recipientPolicyCapabilityFromStatus, reconcileConfiguredCoordinatorEnrollment, reconcileRecipientPolicyProjects, } from "./routes/sync.js";
|
|
37
41
|
export type { LegacyTeamSetupActionBlockedReasonV1, LegacyTeamSetupActionGateV1, LegacyTeamSetupCandidateSummaryV1, LegacyTeamSetupDetailResponseV1, LegacyTeamSetupDeviceV1, LegacyTeamSetupErrorResponseV1, LegacyTeamSetupFinishResponseV1, LegacyTeamSetupIdentityChoiceV1, LegacyTeamSetupMutationResponseV1, LegacyTeamSetupPendingCandidateSummaryV1, LegacyTeamSetupProjectV1, LegacyTeamSetupSummaryResponseV1, LegacyTeamSetupViewerAccessDeltaV1, LegacyTeamSetupViewV1, } from "./routes/team-setup.js";
|
|
42
|
+
export { closeStore, closeStoreAsync, getStore } from "./shared-store.js";
|
|
43
|
+
export type { ViewerAuthorityOptions } from "./viewer-authority.js";
|
|
38
44
|
export { VERSION };
|
|
39
|
-
/** Get (or create) the shared store instance. Exported so the sweeper can share it. */
|
|
40
|
-
export declare function getStore(): MemoryStore;
|
|
41
|
-
/** Close a synchronous-only shared store. Async pack owners use closeStoreAsync(). */
|
|
42
|
-
export declare function closeStore(): void;
|
|
43
|
-
/** Drain semantic work before closing SQLite and releasing the shared store. */
|
|
44
|
-
export declare function closeStoreAsync(): Promise<void>;
|
|
45
45
|
/**
|
|
46
46
|
* Create the Hono app with all viewer routes.
|
|
47
47
|
* Exported for testing — pass a custom store factory to inject test DBs.
|
|
48
48
|
*/
|
|
49
|
-
export interface AppOptions {
|
|
49
|
+
export interface AppOptions extends SyncAppOptions {
|
|
50
|
+
/**
|
|
51
|
+
* Trusted listener context for loopback Host validation. Defaults to accountLink's
|
|
52
|
+
* callback, which the CLI always supplies with the actual bound port. Without
|
|
53
|
+
* either callback, embedding callers own authority validation. External binds
|
|
54
|
+
* retain their existing requirement for authentication outside this app.
|
|
55
|
+
*/
|
|
56
|
+
viewerAuthority?: ViewerAuthorityOptions;
|
|
50
57
|
accountLink?: AccountLinkOptions & AccountStatusOptions & {
|
|
51
58
|
ownerRecovery?: ReturnType<typeof createAccountOwnerRecoveryService>;
|
|
52
59
|
};
|
|
53
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Runs memory tools for thin hosts. `codemem serve` supplies it; when absent
|
|
62
|
+
* the route is not mounted and the profile does not advertise the capability.
|
|
63
|
+
*/
|
|
64
|
+
memoryToolCall?: MemoryToolCallFn;
|
|
54
65
|
rawEventInbox?: RawEventInbox | null;
|
|
55
66
|
rawEventTarget?: ViewerTargetStore;
|
|
56
67
|
sweeper?: RawEventSweeper | null;
|
|
@@ -64,28 +75,12 @@ export interface AppOptions {
|
|
|
64
75
|
teamSetupCompletionDependencies?: LegacyTeamCompletionDependencies | null;
|
|
65
76
|
readCoordinatorConfig?: SyncRoutesOptions["readCoordinatorConfig"];
|
|
66
77
|
renameCoordinatorGroup?: SyncRoutesOptions["renameCoordinatorGroup"];
|
|
67
|
-
syncRequestRateLimit?: {
|
|
68
|
-
limiter?: InMemoryRequestRateLimiter;
|
|
69
|
-
readLimit?: number;
|
|
70
|
-
mutationLimit?: number;
|
|
71
|
-
unauthenticatedReadLimit?: number;
|
|
72
|
-
unauthenticatedMutationLimit?: number;
|
|
73
|
-
};
|
|
74
78
|
getSyncRuntimeStatus?: () => {
|
|
75
79
|
phase: "starting" | "running" | "stopping" | "error" | "disabled" | "rebootstrapping" | "needs_attention" | null;
|
|
76
80
|
detail?: string | null;
|
|
77
81
|
} | null;
|
|
78
82
|
}
|
|
79
83
|
export declare function createApp(opts?: AppOptions): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
80
|
-
/**
|
|
81
|
-
* Create the Hono app for peer-to-peer sync protocol routes only.
|
|
82
|
-
*
|
|
83
|
-
* This app is bound to a separate network-accessible listener
|
|
84
|
-
* (default 0.0.0.0:7337) so remote peers can reach the sync
|
|
85
|
-
* endpoints without exposing the viewer UI or local API routes.
|
|
86
|
-
*
|
|
87
|
-
* No CORS/origin guard is applied — sync requests are authenticated
|
|
88
|
-
* via cryptographic signature verification instead.
|
|
89
|
-
*/
|
|
84
|
+
/** Preserve the public server options while transport adapters use the narrower factory. */
|
|
90
85
|
export declare function createSyncApp(opts?: AppOptions): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
91
86
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACX,iCAAiC,EACjC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EACX,iCAAiC,EACjC,sBAAsB,EAEtB,cAAc,EACd,YAAY,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,eAAe,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,oBAAoB,CAAC;AACjF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,OAAO,EA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