@codemem/core 0.22.3 → 0.23.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/better-sqlite-coordinator-store.d.ts +5 -1
- package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
- package/dist/coordinator-actions.d.ts +13 -1
- package/dist/coordinator-actions.d.ts.map +1 -1
- package/dist/{coordinator-api-CEbQ6LHE.js → coordinator-api-tVUvKt0u.js} +70 -9
- package/dist/coordinator-api-tVUvKt0u.js.map +1 -0
- package/dist/coordinator-api.d.ts.map +1 -1
- package/dist/coordinator-store-contract.d.ts +32 -0
- package/dist/coordinator-store-contract.d.ts.map +1 -1
- package/dist/coordinator-store-test-harness.d.ts.map +1 -1
- package/dist/coordinator-store.d.ts +1 -1
- package/dist/coordinator-store.d.ts.map +1 -1
- package/dist/d1-coordinator-store.d.ts +5 -1
- package/dist/d1-coordinator-store.d.ts.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7667 -6567
- package/dist/index.js.map +1 -1
- package/dist/ingest-pipeline.d.ts.map +1 -1
- package/dist/ingest-prompts.d.ts +1 -0
- package/dist/ingest-prompts.d.ts.map +1 -1
- package/dist/ingest-types.d.ts +1 -0
- package/dist/ingest-types.d.ts.map +1 -1
- package/dist/internal/cloudflare-coordinator.js +107 -46
- package/dist/internal/cloudflare-coordinator.js.map +1 -1
- package/dist/maintenance.d.ts +194 -0
- package/dist/maintenance.d.ts.map +1 -1
- package/dist/observer-config.d.ts +35 -1
- package/dist/observer-config.d.ts.map +1 -1
- package/dist/pack-eval-fixtures.d.ts +19 -0
- package/dist/pack-eval-fixtures.d.ts.map +1 -0
- package/dist/pack.d.ts.map +1 -1
- package/dist/raw-event-sweeper.d.ts.map +1 -1
- package/dist/search.d.ts +1 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/store.d.ts +10 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/summary-memory.d.ts +12 -0
- package/dist/summary-memory.d.ts.map +1 -0
- package/dist/sync-auth.d.ts +1 -0
- package/dist/sync-auth.d.ts.map +1 -1
- package/dist/sync-bootstrap.d.ts +1 -0
- package/dist/sync-bootstrap.d.ts.map +1 -1
- package/dist/sync-pass.d.ts.map +1 -1
- package/dist/sync-replication.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -7
- package/dist/coordinator-api-CEbQ6LHE.js.map +0 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Ported from codemem/coordinator_store.py.
|
|
11
11
|
*/
|
|
12
12
|
import type { Database as DatabaseType } from "better-sqlite3";
|
|
13
|
-
import type { CoordinatorCreateInviteInput, CoordinatorCreateJoinRequestInput, CoordinatorCreateReciprocalApprovalInput, CoordinatorEnrollDeviceInput, CoordinatorEnrollment, CoordinatorGroup, CoordinatorInvite, CoordinatorJoinRequest, CoordinatorJoinRequestReviewResult, CoordinatorListReciprocalApprovalsInput, CoordinatorPeerRecord, CoordinatorPresenceRecord, CoordinatorReciprocalApproval, CoordinatorReviewJoinRequestInput, CoordinatorStore, CoordinatorUpsertPresenceInput } from "./coordinator-store-contract.js";
|
|
13
|
+
import type { CoordinatorBootstrapGrant, CoordinatorCreateBootstrapGrantInput, CoordinatorCreateInviteInput, CoordinatorCreateJoinRequestInput, CoordinatorCreateReciprocalApprovalInput, CoordinatorEnrollDeviceInput, CoordinatorEnrollment, CoordinatorGroup, CoordinatorInvite, CoordinatorJoinRequest, CoordinatorJoinRequestReviewResult, CoordinatorListReciprocalApprovalsInput, CoordinatorPeerRecord, CoordinatorPresenceRecord, CoordinatorReciprocalApproval, CoordinatorReviewJoinRequestInput, CoordinatorStore, CoordinatorUpsertPresenceInput } from "./coordinator-store-contract.js";
|
|
14
14
|
export declare const DEFAULT_COORDINATOR_DB_PATH: string;
|
|
15
15
|
export declare function connectCoordinator(path?: string): DatabaseType;
|
|
16
16
|
export declare class BetterSqliteCoordinatorStore implements CoordinatorStore {
|
|
@@ -37,6 +37,10 @@ export declare class BetterSqliteCoordinatorStore implements CoordinatorStore {
|
|
|
37
37
|
listJoinRequests(groupId: string, status?: string): Promise<CoordinatorJoinRequest[]>;
|
|
38
38
|
reviewJoinRequest(opts: CoordinatorReviewJoinRequestInput): Promise<CoordinatorJoinRequestReviewResult | null>;
|
|
39
39
|
createReciprocalApproval(opts: CoordinatorCreateReciprocalApprovalInput): Promise<CoordinatorReciprocalApproval>;
|
|
40
|
+
createBootstrapGrant(opts: CoordinatorCreateBootstrapGrantInput): Promise<CoordinatorBootstrapGrant>;
|
|
41
|
+
getBootstrapGrant(grantId: string): Promise<CoordinatorBootstrapGrant | null>;
|
|
42
|
+
listBootstrapGrants(groupId: string): Promise<CoordinatorBootstrapGrant[]>;
|
|
43
|
+
revokeBootstrapGrant(grantId: string, revokedAt?: string): Promise<boolean>;
|
|
40
44
|
listReciprocalApprovals(opts: CoordinatorListReciprocalApprovalsInput): Promise<CoordinatorReciprocalApproval[]>;
|
|
41
45
|
upsertPresence(opts: CoordinatorUpsertPresenceInput): Promise<CoordinatorPresenceRecord>;
|
|
42
46
|
listGroupPeers(groupId: string, requestingDeviceId: string): Promise<CoordinatorPeerRecord[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-sqlite-coordinator-store.d.ts","sourceRoot":"","sources":["../src/better-sqlite-coordinator-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,KAAK,EACX,4BAA4B,EAC5B,iCAAiC,EACjC,wCAAwC,EACxC,4BAA4B,EAC5B,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,kCAAkC,EAClC,uCAAuC,EACvC,qBAAqB,EACrB,yBAAyB,EACzB,6BAA6B,
|
|
1
|
+
{"version":3,"file":"better-s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,EAAE,oCAAoC,GACxC,OAAO,CAAC,yBAAyB,CAAC;IAI/B,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC;IAQ7E,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAS1E,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,SAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAS7E,uBAAuB,CAC5B,IAAI,EAAE,uCAAuC,GAC3C,OAAO,CAAC,6BAA6B,EAAE,CAAC;IAarC,cAAc,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA4BxF,cAAc,CACnB,OAAO,EAAE,MAAM,EACf,kBAAkB,EAAE,MAAM,GACxB,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAyCnC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoordinatorEnrollment, CoordinatorGroup, CoordinatorJoinRequest, CoordinatorJoinRequestReviewResult } from "./coordinator-store-contract.js";
|
|
1
|
+
import type { CoordinatorBootstrapGrant, CoordinatorEnrollment, CoordinatorGroup, CoordinatorJoinRequest, CoordinatorJoinRequestReviewResult } from "./coordinator-store-contract.js";
|
|
2
2
|
export declare function coordinatorCreateGroupAction(opts: {
|
|
3
3
|
groupId: string;
|
|
4
4
|
displayName?: string | null;
|
|
@@ -66,4 +66,16 @@ export declare function coordinatorReviewJoinRequestAction(opts: {
|
|
|
66
66
|
remoteUrl?: string | null;
|
|
67
67
|
adminSecret?: string | null;
|
|
68
68
|
}): Promise<CoordinatorJoinRequestReviewResult | null>;
|
|
69
|
+
export declare function coordinatorListBootstrapGrantsAction(opts: {
|
|
70
|
+
groupId: string;
|
|
71
|
+
dbPath?: string | null;
|
|
72
|
+
remoteUrl?: string | null;
|
|
73
|
+
adminSecret?: string | null;
|
|
74
|
+
}): Promise<CoordinatorBootstrapGrant[]>;
|
|
75
|
+
export declare function coordinatorRevokeBootstrapGrantAction(opts: {
|
|
76
|
+
grantId: string;
|
|
77
|
+
dbPath?: string | null;
|
|
78
|
+
remoteUrl?: string | null;
|
|
79
|
+
adminSecret?: string | null;
|
|
80
|
+
}): Promise<boolean>;
|
|
69
81
|
//# sourceMappingURL=coordinator-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-actions.d.ts","sourceRoot":"","sources":["../src/coordinator-actions.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACX,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,kCAAkC,EAClC,MAAM,iCAAiC,CAAC;AA4IzC,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAY5B;AAED,wBAAsB,2BAA2B,CAAC,IAAI,CAAC,EAAE;IACxD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAO9B;AAED,wBAAsB,6BAA6B,CAAC,IAAI,EAAE;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuBjC;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,MA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C3B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,kCAAkC,GAAG,IAAI,CAAC,CAgCrD;AAED,wBAAsB,oCAAoC,CAAC,IAAI,EAAE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAsBvC;AAED,wBAAsB,qCAAqC,CAAC,IAAI,EAAE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,OAAO,CAAC,CA8BnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash as e } from "node:crypto";
|
|
2
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
2
|
+
//#region ../../node_modules/.pnpm/hono@4.12.11/node_modules/hono/dist/compose.js
|
|
3
3
|
var t = (e, t, n) => (r, i) => {
|
|
4
4
|
let a = -1;
|
|
5
5
|
return o(0);
|
|
@@ -192,7 +192,7 @@ var o = (e, t, n) => {
|
|
|
192
192
|
}), t;
|
|
193
193
|
}
|
|
194
194
|
async parseBody(e) {
|
|
195
|
-
return
|
|
195
|
+
return r(this, e);
|
|
196
196
|
}
|
|
197
197
|
#a = (e) => {
|
|
198
198
|
let { bodyCache: t, raw: n } = this, r = t[e];
|
|
@@ -510,7 +510,7 @@ function P(e, t) {
|
|
|
510
510
|
return this.match = r, r(e, t);
|
|
511
511
|
}
|
|
512
512
|
//#endregion
|
|
513
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
513
|
+
//#region ../../node_modules/.pnpm/hono@4.12.11/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
514
514
|
var F = "[^/]+", I = ".*", L = "(?:|/.*)", R = /* @__PURE__ */ Symbol(), ce = /* @__PURE__ */ new Set(".\\+*[^]$()");
|
|
515
515
|
function le(e, t) {
|
|
516
516
|
return e.length === 1 ? t.length === 1 ? e < t ? -1 : 1 : -1 : t.length === 1 || e === I || e === L ? 1 : t === I || t === L ? -1 : e === F ? 1 : t === F ? -1 : e.length === t.length ? e < t ? -1 : 1 : t.length - e.length;
|
|
@@ -1435,6 +1435,60 @@ function Ie(e) {
|
|
|
1435
1435
|
} finally {
|
|
1436
1436
|
await o.close();
|
|
1437
1437
|
}
|
|
1438
|
+
}), u.get("/v1/admin/bootstrap-grants/:grantId", async (e) => {
|
|
1439
|
+
let r = Z(e.req.header(X), t);
|
|
1440
|
+
if (!r.ok) return f(e, e.req.path, !1) ?? e.json({ error: r.error }, 401);
|
|
1441
|
+
let i = f(e, "admin", !0);
|
|
1442
|
+
if (i) return i;
|
|
1443
|
+
let a = String(e.req.param("grantId") ?? "").trim();
|
|
1444
|
+
if (!a) return e.json({ error: "grant_id_required" }, 400);
|
|
1445
|
+
let o = n();
|
|
1446
|
+
try {
|
|
1447
|
+
let t = await o.getBootstrapGrant(a);
|
|
1448
|
+
if (!t) return e.json({ error: "grant_not_found" }, 404);
|
|
1449
|
+
let n = await o.getEnrollment(t.group_id, t.worker_device_id);
|
|
1450
|
+
if (!n) return e.json({ error: "worker_enrollment_not_found" }, 404);
|
|
1451
|
+
let r = {
|
|
1452
|
+
grant: t,
|
|
1453
|
+
worker_enrollment: n
|
|
1454
|
+
};
|
|
1455
|
+
return e.json(r);
|
|
1456
|
+
} finally {
|
|
1457
|
+
await o.close();
|
|
1458
|
+
}
|
|
1459
|
+
}), u.get("/v1/admin/bootstrap-grants", async (e) => {
|
|
1460
|
+
let r = Z(e.req.header(X), t);
|
|
1461
|
+
if (!r.ok) return f(e, e.req.path, !1) ?? e.json({ error: r.error }, 401);
|
|
1462
|
+
let i = f(e, "admin", !0);
|
|
1463
|
+
if (i) return i;
|
|
1464
|
+
let a = (e.req.query("group_id") ?? "").trim();
|
|
1465
|
+
if (!a) return e.json({ error: "group_id_required" }, 400);
|
|
1466
|
+
let o = n();
|
|
1467
|
+
try {
|
|
1468
|
+
return e.json({ items: await o.listBootstrapGrants(a) });
|
|
1469
|
+
} finally {
|
|
1470
|
+
await o.close();
|
|
1471
|
+
}
|
|
1472
|
+
}), u.post("/v1/admin/bootstrap-grants/revoke", async (e) => {
|
|
1473
|
+
let r = Z(e.req.header(X), t);
|
|
1474
|
+
if (!r.ok) return f(e, e.req.path, !1) ?? e.json({ error: r.error }, 401);
|
|
1475
|
+
let i = f(e, "admin", !0);
|
|
1476
|
+
if (i) return i;
|
|
1477
|
+
let a = await p(e);
|
|
1478
|
+
if (a == null) return e.json({ error: "body_too_large" }, 413);
|
|
1479
|
+
let o = m(a);
|
|
1480
|
+
if (!o) return e.json({ error: "invalid_json" }, 400);
|
|
1481
|
+
let s = String(o.grant_id ?? "").trim();
|
|
1482
|
+
if (!s) return e.json({ error: "grant_id_required" }, 400);
|
|
1483
|
+
let c = n();
|
|
1484
|
+
try {
|
|
1485
|
+
return await c.revokeBootstrapGrant(s, t.now()) ? e.json({
|
|
1486
|
+
ok: !0,
|
|
1487
|
+
grant_id: s
|
|
1488
|
+
}) : e.json({ error: "grant_not_found" }, 404);
|
|
1489
|
+
} finally {
|
|
1490
|
+
await c.close();
|
|
1491
|
+
}
|
|
1438
1492
|
}), u.post("/v1/admin/join-requests/approve", async (e) => $(e, !0, {
|
|
1439
1493
|
createStore: n,
|
|
1440
1494
|
runtime: t,
|
|
@@ -1549,14 +1603,21 @@ async function $(e, t, n) {
|
|
|
1549
1603
|
o = null;
|
|
1550
1604
|
}
|
|
1551
1605
|
if (!o) return e.json({ error: "invalid_json" }, 400);
|
|
1552
|
-
let s = String(o.request_id ?? "").trim(), c = String(o.reviewed_by ?? "").trim() || null;
|
|
1606
|
+
let s = String(o.request_id ?? "").trim(), c = String(o.reviewed_by ?? "").trim() || null, l = String(o.bootstrap_grant_seed_device_id ?? "").trim(), u = String(o.bootstrap_grant_expires_at ?? "").trim();
|
|
1553
1607
|
if (!s) return e.json({ error: "request_id_required" }, 400);
|
|
1554
|
-
let
|
|
1608
|
+
let d = [l, u].filter(Boolean).length;
|
|
1609
|
+
if (d > 0 && d < 2) return e.json({ error: "bootstrap_grant_seed_device_id_and_expires_at_required_together" }, 400);
|
|
1610
|
+
let f = n.createStore();
|
|
1555
1611
|
try {
|
|
1556
|
-
let n = await
|
|
1612
|
+
let n = await f.reviewJoinRequest({
|
|
1557
1613
|
requestId: s,
|
|
1558
1614
|
approved: t,
|
|
1559
|
-
reviewedBy: c
|
|
1615
|
+
reviewedBy: c,
|
|
1616
|
+
bootstrapGrant: t && l && u ? {
|
|
1617
|
+
seedDeviceId: l,
|
|
1618
|
+
expiresAt: u,
|
|
1619
|
+
createdBy: c
|
|
1620
|
+
} : null
|
|
1560
1621
|
});
|
|
1561
1622
|
return n ? n._no_transition ? e.json({
|
|
1562
1623
|
error: "request_not_pending",
|
|
@@ -1566,10 +1627,10 @@ async function $(e, t, n) {
|
|
|
1566
1627
|
request: n
|
|
1567
1628
|
}) : e.json({ error: "request_not_found" }, 404);
|
|
1568
1629
|
} finally {
|
|
1569
|
-
await
|
|
1630
|
+
await f.close();
|
|
1570
1631
|
}
|
|
1571
1632
|
}
|
|
1572
1633
|
//#endregion
|
|
1573
1634
|
export { W as a, we as i, J as n, Te as o, Ae as r, G as s, Ie as t };
|
|
1574
1635
|
|
|
1575
|
-
//# sourceMappingURL=coordinator-api-
|
|
1636
|
+
//# sourceMappingURL=coordinator-api-tVUvKt0u.js.map
|