@codemem/core 0.32.0 → 0.32.2
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/coordinator-actions.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +59 -47
- package/dist/index.js.map +1 -1
- package/dist/observer-client.d.ts +2 -0
- package/dist/observer-client.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-actions.d.ts","sourceRoot":"","sources":["../src/coordinator-actions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coordinator-actions.d.ts","sourceRoot":"","sources":["../src/coordinator-actions.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACX,yBAAyB,EACzB,qBAAqB,EACrB,oCAAoC,EACpC,gBAAgB,EAChB,sBAAsB,EACtB,kCAAkC,EAClC,qCAAqC,EACrC,gBAAgB,EAChB,0BAA0B,EAC1B,MAAM,iCAAiC,CAAC;AA+KzC,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;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2B5B;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,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,gBAAgB,G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B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAsBpC;AAED,wBAAsB,kCAAkC,CAAC,IAAI,EAAE;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This package owns the SQLite store, embedding worker interface,
|
|
5
5
|
* and type definitions shared across the codemem TS backend.
|
|
6
6
|
*/
|
|
7
|
-
export declare const VERSION = "0.32.
|
|
7
|
+
export declare const VERSION = "0.32.2";
|
|
8
8
|
export * as Api from "./api-types.js";
|
|
9
9
|
export { extractApplyPatchPaths, MUTATING_TOOL_NAMES } from "./apply-patch.js";
|
|
10
10
|
export type { CreateBetterSqliteCoordinatorAppOptions } from "./better-sqlite-coordinator-runtime.js";
|
package/dist/index.js
CHANGED
|
@@ -10682,10 +10682,10 @@ function um(e) {
|
|
|
10682
10682
|
return n.length > 0 ? n.join("") : null;
|
|
10683
10683
|
}
|
|
10684
10684
|
function dm(e) {
|
|
10685
|
-
return {
|
|
10685
|
+
return e ? {
|
|
10686
10686
|
authorization: `Bearer ${e}`,
|
|
10687
10687
|
"content-type": "application/json"
|
|
10688
|
-
};
|
|
10688
|
+
} : { "content-type": "application/json" };
|
|
10689
10689
|
}
|
|
10690
10690
|
function fm(e, t) {
|
|
10691
10691
|
let n = { ...e };
|
|
@@ -10756,7 +10756,15 @@ function _m(e) {
|
|
|
10756
10756
|
let r = n.message;
|
|
10757
10757
|
if (!r) return null;
|
|
10758
10758
|
let i = r.content;
|
|
10759
|
-
|
|
10759
|
+
if (typeof i == "string") return i;
|
|
10760
|
+
if (!Array.isArray(i)) return null;
|
|
10761
|
+
let a = [];
|
|
10762
|
+
for (let e of i) {
|
|
10763
|
+
if (typeof e != "object" || !e) continue;
|
|
10764
|
+
let t = e;
|
|
10765
|
+
(t.type === "text" || t.type === "output_text") && typeof t.text == "string" && a.push(t.text);
|
|
10766
|
+
}
|
|
10767
|
+
return a.length > 0 ? a.join("") : null;
|
|
10760
10768
|
}
|
|
10761
10769
|
function vm(e) {
|
|
10762
10770
|
let t = e.output_text;
|
|
@@ -10855,6 +10863,7 @@ var Tm = class {
|
|
|
10855
10863
|
authAdapter;
|
|
10856
10864
|
_observerHeaders;
|
|
10857
10865
|
_customBaseUrl;
|
|
10866
|
+
_customBaseUrlAllowsNoAuth;
|
|
10858
10867
|
_apiKey;
|
|
10859
10868
|
_claudeCommand;
|
|
10860
10869
|
_sidecarModel;
|
|
@@ -10889,7 +10898,7 @@ var Tm = class {
|
|
|
10889
10898
|
let d = typeof n.observerBaseUrl == "string" && n.observerBaseUrl.trim().length > 0;
|
|
10890
10899
|
this.tierRoutingEnabled = r.has("observerTierRoutingEnabled") ? n.observerTierRoutingEnabled === !0 : qp(this.provider, this.runtime, d), this.simpleProvider = typeof n.observerSimpleProvider == "string" && n.observerSimpleProvider.trim() ? n.observerSimpleProvider.trim() : null, this.simpleModel = typeof n.observerSimpleModel == "string" && n.observerSimpleModel.trim() ? n.observerSimpleModel.trim() : null, this.simpleTemperature = typeof n.observerSimpleTemperature == "number" && Number.isFinite(n.observerSimpleTemperature) ? n.observerSimpleTemperature : null, this.richProvider = typeof n.observerRichProvider == "string" && n.observerRichProvider.trim() ? n.observerRichProvider.trim() : null, this.richModel = typeof n.observerRichModel == "string" && n.observerRichModel.trim() ? n.observerRichModel.trim() : null, this.richTemperature = typeof n.observerRichTemperature == "number" && Number.isFinite(n.observerRichTemperature) ? n.observerRichTemperature : null, this.richReasoningEffort = typeof n.observerRichReasoningEffort == "string" && n.observerRichReasoningEffort.trim() ? n.observerRichReasoningEffort.trim() : null, this.richReasoningSummary = typeof n.observerRichReasoningSummary == "string" && n.observerRichReasoningSummary.trim() ? n.observerRichReasoningSummary.trim() : null, this.richMaxOutputTokens = typeof n.observerRichMaxOutputTokens == "number" && Number.isFinite(n.observerRichMaxOutputTokens) ? n.observerRichMaxOutputTokens : null, this.openaiUseResponses = r.has("observerOpenAIUseResponses") ? n.observerOpenAIUseResponses === !0 : this.provider === "openai" && this.runtime === "api_http", this.reasoningEffort = typeof n.observerReasoningEffort == "string" && n.observerReasoningEffort.trim() ? n.observerReasoningEffort.trim() : null, this.reasoningSummary = typeof n.observerReasoningSummary == "string" && n.observerReasoningSummary.trim() ? n.observerReasoningSummary.trim() : null, this.maxChars = n.observerMaxChars, this.maxTokens = n.observerMaxTokens, this.maxOutputTokens = typeof n.observerMaxOutputTokens == "number" && Number.isFinite(n.observerMaxOutputTokens) ? n.observerMaxOutputTokens : this.maxTokens, this.authSource = n.observerAuthSource, this.authFile = n.observerAuthFile, this.authCommand = [...n.observerAuthCommand], this.authTimeoutMs = n.observerAuthTimeoutMs, this.authCacheTtlS = n.observerAuthCacheTtlS, this._observerHeaders = { ...n.observerHeaders }, this._apiKey = n.observerApiKey ?? null;
|
|
10891
10900
|
let f = n.observerBaseUrl;
|
|
10892
|
-
this._customBaseUrl = typeof f == "string" && f.trim() ? f.trim() : null, this.authAdapter = new Op({
|
|
10901
|
+
this._customBaseUrl = typeof f == "string" && f.trim() ? f.trim() : null, this._customBaseUrlAllowsNoAuth = this._customBaseUrl != null, this.authAdapter = new Op({
|
|
10893
10902
|
source: n.observerAuthSource,
|
|
10894
10903
|
filePath: n.observerAuthFile,
|
|
10895
10904
|
command: n.observerAuthCommand,
|
|
@@ -10956,6 +10965,9 @@ var Tm = class {
|
|
|
10956
10965
|
refreshAuth(e = !0) {
|
|
10957
10966
|
this.authAdapter.invalidateCache(), this._initProvider(e);
|
|
10958
10967
|
}
|
|
10968
|
+
canCallOpenAIDirectWithoutAuth() {
|
|
10969
|
+
return this._customBaseUrlAllowsNoAuth && !this._codexAccess && this.provider !== "anthropic";
|
|
10970
|
+
}
|
|
10959
10971
|
async observe(e, t) {
|
|
10960
10972
|
let n = this.maxChars, r = Math.floor(n * .25), i = Math.max(0, n - r), a = e.length > i ? e.slice(0, i) : e, o = Math.max(r, n - a.length), s = t.length > o ? t.slice(0, o) : t;
|
|
10961
10973
|
try {
|
|
@@ -10987,7 +10999,7 @@ var Tm = class {
|
|
|
10987
10999
|
}
|
|
10988
11000
|
async observeStructuredJson(e, t, n, r) {
|
|
10989
11001
|
if (this.provider === "openai" && this.openaiUseResponses && !this._codexAccess) {
|
|
10990
|
-
if (!this.auth.token && (this._initProvider(!0), !this.auth.token)) return {
|
|
11002
|
+
if (!this.auth.token && !this.canCallOpenAIDirectWithoutAuth() && (this._initProvider(!0), !this.auth.token && !this.canCallOpenAIDirectWithoutAuth())) return {
|
|
10991
11003
|
raw: null,
|
|
10992
11004
|
parsed: null,
|
|
10993
11005
|
provider: this.provider,
|
|
@@ -10996,7 +11008,7 @@ var Tm = class {
|
|
|
10996
11008
|
};
|
|
10997
11009
|
let i;
|
|
10998
11010
|
i = this._customBaseUrl ? `${Bp(this._customBaseUrl)}/responses` : "https://api.openai.com/v1/responses";
|
|
10999
|
-
let a = fm(dm(this.auth.token
|
|
11011
|
+
let a = fm(dm(this.auth.token), Mp(this._observerHeaders, this.auth)), o = gm(this.model, e, t, this.maxOutputTokens, this.reasoningEffort, this.reasoningSummary, this.temperature, n, r), s = await this._fetchJSON(i, a, o, {
|
|
11000
11012
|
parseResponse: vm,
|
|
11001
11013
|
providerLabel: "OpenAI"
|
|
11002
11014
|
});
|
|
@@ -11039,14 +11051,14 @@ var Tm = class {
|
|
|
11039
11051
|
n && e != null && e <= wm() && (n = null);
|
|
11040
11052
|
}
|
|
11041
11053
|
if (this.provider !== "openai" && this.provider !== "anthropic") {
|
|
11042
|
-
let n = Wt(this.provider),
|
|
11043
|
-
if (
|
|
11054
|
+
let n = Wt(this.provider), r = Object.keys(n).length > 0, [i, a, o] = r ? ln(this.provider, this.model) : Qt(this.provider, this.model);
|
|
11055
|
+
if (i && !this._customBaseUrl && (this._customBaseUrl = i, this._customBaseUrlAllowsNoAuth = r), a && (this.model = a), o && Object.keys(o).length > 0 && (this._observerHeaders = {
|
|
11044
11056
|
...this._observerHeaders,
|
|
11045
|
-
...
|
|
11057
|
+
...o
|
|
11046
11058
|
}), !this._customBaseUrl) return;
|
|
11047
|
-
let
|
|
11059
|
+
let s = this.provider === "opencode" ? vp(t, this.provider) : null, c = sn(n) || this._apiKey || s;
|
|
11048
11060
|
this.auth = this.authAdapter.resolve({
|
|
11049
|
-
explicitToken:
|
|
11061
|
+
explicitToken: c,
|
|
11050
11062
|
envTokens: [process.env.CODEMEM_OBSERVER_API_KEY ?? ""],
|
|
11051
11063
|
forceRefresh: e
|
|
11052
11064
|
});
|
|
@@ -11070,10 +11082,10 @@ var Tm = class {
|
|
|
11070
11082
|
if (this.runtime === "claude_sidecar") return this._callSidecar(e, t);
|
|
11071
11083
|
if (this._codexAccess) return this._callCodexConsumer(e, t);
|
|
11072
11084
|
if (this._anthropicOAuthAccess) return this._callAnthropicConsumer(e, t);
|
|
11073
|
-
if (!this.auth.token) {
|
|
11085
|
+
if (!this.auth.token && !this.canCallOpenAIDirectWithoutAuth()) {
|
|
11074
11086
|
if (this._initProvider(!0), this._codexAccess) return this._callCodexConsumer(e, t);
|
|
11075
11087
|
if (this._anthropicOAuthAccess) return this._callAnthropicConsumer(e, t);
|
|
11076
|
-
if (!this.auth.token) return this._setLastError(`${Em(this.provider)} credentials are missing.`, "auth_missing"), null;
|
|
11088
|
+
if (!this.auth.token && !this.canCallOpenAIDirectWithoutAuth()) return this._setLastError(`${Em(this.provider)} credentials are missing.`, "auth_missing"), null;
|
|
11077
11089
|
}
|
|
11078
11090
|
return this.provider === "anthropic" ? this._callAnthropicDirect(e, t) : this._callOpenAIDirect(e, t);
|
|
11079
11091
|
}
|
|
@@ -11087,7 +11099,7 @@ var Tm = class {
|
|
|
11087
11099
|
async _callOpenAIDirect(e, t) {
|
|
11088
11100
|
let n;
|
|
11089
11101
|
n = this._customBaseUrl ? `${Bp(this._customBaseUrl)}/${this.openaiUseResponses ? "responses" : "chat/completions"}` : this.openaiUseResponses ? "https://api.openai.com/v1/responses" : "https://api.openai.com/v1/chat/completions";
|
|
11090
|
-
let r = fm(dm(this.auth.token
|
|
11102
|
+
let r = fm(dm(this.auth.token), Mp(this._observerHeaders, this.auth)), i = this.openaiUseResponses ? hm(this.model, e, t, this.maxOutputTokens, this.reasoningEffort, this.reasoningSummary, this.temperature) : mm(this.model, e, t, this.maxTokens, this.temperature);
|
|
11091
11103
|
return this._fetchJSON(n, r, i, {
|
|
11092
11104
|
parseResponse: this.openaiUseResponses ? vm : _m,
|
|
11093
11105
|
providerLabel: Em(this.provider)
|
|
@@ -12250,56 +12262,56 @@ async function xh(e) {
|
|
|
12250
12262
|
}
|
|
12251
12263
|
}
|
|
12252
12264
|
async function Sh(e) {
|
|
12253
|
-
let t = s(r(e.inviteValue)), n = e.dbPath ??
|
|
12265
|
+
let t = s(r(e.inviteValue)), n = Dn(e.dbPath ?? void 0), i = e.keysDir ?? (process.env.CODEMEM_KEYS_DIR?.trim() || void 0);
|
|
12254
12266
|
ii(n);
|
|
12255
|
-
let
|
|
12267
|
+
let a = Mn(n), o = "", c = "";
|
|
12256
12268
|
try {
|
|
12257
|
-
[
|
|
12269
|
+
[o, c] = dr(a, { keysDir: i });
|
|
12258
12270
|
} finally {
|
|
12259
|
-
|
|
12260
|
-
}
|
|
12261
|
-
let
|
|
12262
|
-
if (!
|
|
12263
|
-
let
|
|
12264
|
-
if (!
|
|
12265
|
-
let
|
|
12266
|
-
if (
|
|
12267
|
-
let
|
|
12271
|
+
a.close();
|
|
12272
|
+
}
|
|
12273
|
+
let l = nr(i);
|
|
12274
|
+
if (!l) throw Error("public key missing");
|
|
12275
|
+
let u = String(t.coordinator_url ?? "").trim();
|
|
12276
|
+
if (!u) throw Error("Invite is missing a coordinator URL.");
|
|
12277
|
+
let d = e.configPath ? zt(e.configPath) : Rt(), f = String(d.actor_display_name ?? o).trim() || o, p = (e) => Zm(e.trim()), m = p(String(d.sync_coordinator_url ?? "")), h = p(u);
|
|
12278
|
+
if (m && m !== h) throw Error(`This device is already enrolled with coordinator ${m}. Multi-team joining is only supported across groups on the same coordinator.`);
|
|
12279
|
+
let g = 0, _ = null;
|
|
12268
12280
|
try {
|
|
12269
|
-
[
|
|
12281
|
+
[g, _] = await kl("POST", `${Zm(u)}/v1/join`, {
|
|
12270
12282
|
body: {
|
|
12271
12283
|
token: String(t.token),
|
|
12272
|
-
device_id:
|
|
12273
|
-
public_key:
|
|
12274
|
-
fingerprint:
|
|
12275
|
-
display_name:
|
|
12284
|
+
device_id: o,
|
|
12285
|
+
public_key: l,
|
|
12286
|
+
fingerprint: c,
|
|
12287
|
+
display_name: f
|
|
12276
12288
|
},
|
|
12277
12289
|
timeoutS: Xm
|
|
12278
12290
|
});
|
|
12279
12291
|
} catch (e) {
|
|
12280
|
-
throw rh(e,
|
|
12292
|
+
throw rh(e, u);
|
|
12281
12293
|
}
|
|
12282
|
-
if (
|
|
12283
|
-
let e = typeof
|
|
12284
|
-
throw Error(`Invite import failed (${
|
|
12294
|
+
if (g < 200 || g >= 300) {
|
|
12295
|
+
let e = typeof _?.error == "string" ? _.error : "unknown";
|
|
12296
|
+
throw Error(`Invite import failed (${g}): ${e}`);
|
|
12285
12297
|
}
|
|
12286
|
-
let
|
|
12287
|
-
|
|
12288
|
-
let
|
|
12289
|
-
let e =
|
|
12298
|
+
let v = e.configPath ? zt(e.configPath) : Rt();
|
|
12299
|
+
v.sync_coordinator_url = u;
|
|
12300
|
+
let y = String(t.group_id), b = (() => {
|
|
12301
|
+
let e = v.sync_coordinator_groups;
|
|
12290
12302
|
if (Array.isArray(e)) return e.map((e) => String(e).trim()).filter(Boolean);
|
|
12291
12303
|
if (typeof e == "string") return e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
12292
|
-
let t =
|
|
12304
|
+
let t = v.sync_coordinator_group;
|
|
12293
12305
|
return typeof t == "string" && t.trim() ? [t.trim()] : [];
|
|
12294
|
-
})(),
|
|
12295
|
-
|
|
12296
|
-
let
|
|
12306
|
+
})(), x = Array.from(new Set([...b, y]));
|
|
12307
|
+
v.sync_coordinator_groups = x, v.sync_coordinator_group = x[0] ?? y;
|
|
12308
|
+
let S = Bt(v, e.configPath ?? void 0);
|
|
12297
12309
|
return {
|
|
12298
12310
|
group_id: t.group_id,
|
|
12299
12311
|
coordinator_url: t.coordinator_url,
|
|
12300
|
-
status:
|
|
12301
|
-
config_path:
|
|
12302
|
-
groups:
|
|
12312
|
+
status: _?.status ?? null,
|
|
12313
|
+
config_path: S,
|
|
12314
|
+
groups: x
|
|
12303
12315
|
};
|
|
12304
12316
|
}
|
|
12305
12317
|
async function Ch(e) {
|
|
@@ -17913,7 +17925,7 @@ function hS(e, t = "local") {
|
|
|
17913
17925
|
}
|
|
17914
17926
|
//#endregion
|
|
17915
17927
|
//#region src/index.ts
|
|
17916
|
-
var gS = "0.32.
|
|
17928
|
+
var gS = "0.32.2";
|
|
17917
17929
|
//#endregion
|
|
17918
17930
|
export { ke as Api, V as BetterSqliteCoordinatorStore, Ft as CODEMEM_CONFIG_ENV_OVERRIDES, Fh as DEDUP_KEY_BACKFILL_JOB, R as DEFAULT_COORDINATOR_DB_PATH, En as DEFAULT_DB_PATH, Ql as DEFAULT_SCOPE_MEMBERSHIP_CACHE_MAX_AGE_MS, nx as DEFAULT_SERVICE_TYPE, Au as DEFAULT_SYNC_SCOPE_ID, o as DEFAULT_TIME_WINDOW_S, zh as DedupKeyBackfillRunner, si as INJECTION_EVAL_SCENARIO_PACKS, Iv as LEGACY_SHARED_REVIEW_SCOPE_ID, Ei as LOCAL_DEFAULT_SCOPE_ID, bb as LOCAL_SYNC_CAPABILITY, Qg as LOW_SIGNAL_TOOLS, Sr as MAPPABLE_CLAUDE_HOOK_EVENTS, Cn as MIN_COMPATIBLE_SCHEMA, Ae as MUTATING_TOOL_NAMES, Of as MemoryStore, Op as ObserverAuthAdapter, em as ObserverAuthError, Tm as ObserverClient, Uy as REF_BACKFILL_JOB, Og as RICH_TIER_DEFAULTS, Hy as RawEventSweeper, Yy as RefBackfillRunner, Sn as SCHEMA_VERSION, Lv as SCOPE_BACKFILL_JOB, n as SCOPE_MEMBERSHIP_REVOCATION_LIMITATION, Xy as SESSION_CONTEXT_BACKFILL_JOB, fr as SIGNATURE_VERSION, Dg as SIMPLE_TIER_DEFAULTS, ub as SUMMARY_DEDUP_BACKFILL_JOB, vb as SYNC_CAPABILITIES, yb as SYNC_CAPABILITY_HEADER, lS as SYNC_SCOPE_QUERY_PARAM, $v as ScopeBackfillRunner, lb as SessionContextBackfillRunner, _b as SummaryDedupBackfillRunner, cS as SyncRetentionRunner, E_ as TRIVIAL_REQUESTS, wb as VECTOR_MODEL_MIGRATION_JOB, gS as VERSION, Kb as VectorModelMigrationRunner, es as _resetEmbeddingClient, dS as addSyncScopeToBoundary, wl as addressDedupeKey, _x as advertiseMdns, Bm as aiBackfillStructuredContent, Ny as analyzeProjectScopeMappingChangeGuardrails, ex as applyBootstrapSnapshot, of as applyReplicationOps, zn as assertSchemaReady, cp as backfillMemoryDedupKeys, rp as backfillNarrativeFromBody, nf as backfillReplicationOps, Yv as backfillScopeIds, qf as backfillTagsText, js as backfillVectors, hn as bootstrapSchema, u_ as budgetToolEvents, _r as buildAuthHeaders, Ol as buildBaseUrl, pr as buildCanonicalRequest, Sp as buildCodexHeaders, Yi as buildFilterClauses, Xi as buildFilterClausesWithContext, Xh as buildImportKey, zr as buildIngestPayloadFromHook, $c as buildMemoryPack, tl as buildMemoryPackAsync, el as buildMemoryPackTrace, nl as buildMemoryPackTraceAsync, w_ as buildObserverPrompt, Rr as buildRawEventEnvelopeFromHook, vv as buildSessionContext, F_ as buildTranscript, gd as bulkPruneReplicationOpsByAgeCutoff, mi as canonicalMemoryKind, Mi as canonicalWorkspaceIdentity, Zu as chunkOpsBySize, Qo as chunkText, Bv as classifyLegacyMemoryScope, dv as cleanOrphanSessions, yr as cleanupNonces, ga as clearMemoryRefs, ad as clockTuple, Rf as compareMemoryRoleReports, Yr as completeMaintenanceJob, Mn as connect, Xe as connectCoordinator, Gx as consecutiveConnectivityFailures, oh as coordinatorArchiveGroupAction, ih as coordinatorCreateGroupAction, xh as coordinatorCreateInviteAction, uh as coordinatorCreateScopeAction, vh as coordinatorDisableDeviceAction, yh as coordinatorEnableDeviceAction, zl as coordinatorEnabled, hh as coordinatorEnrollDeviceAction, ph as coordinatorGrantScopeMembershipAction, Sh as coordinatorImportInviteAction, Th as coordinatorListBootstrapGrantsAction, gh as coordinatorListDevicesAction, ch as coordinatorListGroupsAction, Ch as coordinatorListJoinRequestsAction, fh as coordinatorListScopeMembershipsAction, lh as coordinatorListScopesAction, bh as coordinatorRemoveDeviceAction, _h as coordinatorRenameDeviceAction, ah as coordinatorRenameGroupAction, wh as coordinatorReviewJoinRequestAction, Eh as coordinatorRevokeBootstrapGrantAction, mh as coordinatorRevokeScopeMembershipAction, Xl as coordinatorStatusSnapshot, sh as coordinatorUnarchiveGroupAction, dh as coordinatorUpdateScopeAction, br as createBetterSqliteCoordinatorApp, c as createCoordinatorApp, Jl as createCoordinatorReciprocalApproval, Tx as cursorAdvances, ep as deactivateLowSignalMemories, $f as deactivateLowSignalObservations, zg as decideExtractionReplayTier, s as decodeInvitePayload, tp as dedupNearDuplicateMemories, Ko as dedupeOrderedIds, Dh as defaultSpaceScopeIdForGroup, Ph as deleteCoordinatorGroupPreference, Ry as deleteProjectScopeSettingsMapping, P_ as deriveRequest, ku as deriveTags, vx as discoverPeersViaMdns, rs as embedTexts, t as encodeInvitePayload, dr as ensureDeviceIdentity, Zr as ensureMaintenanceJobsSchema, yn as ensureSchemaBootstrapped, Hv as ensureScopeBackfillScopes, iu as ensureScopeMembershipCacheStateTable, Hs as estimateTokens, Tg as evaluateSessionExtractionItems, r_ as eventToToolEvent, qa as expandQuery, Xo as explain, e as explainScopeMembershipRevocation, ag as exportMemories, a_ as extractAdapterEvent, je as extractApplyPatchPaths, I_ as extractAssistantMessages, L_ as extractAssistantUsage, r as extractInvitePayload, np as extractNarrativeFromBody, _p as extractOAuthAccess, bp as extractOAuthAccountId, xp as extractOAuthExpires, R_ as extractPrompts, vp as extractProviderApiKey, id as extractReplicationOps, i_ as extractToolEvents, Xr as failMaintenanceJob, qb as fetchAllSnapshotPages, Kl as fetchCoordinatorStalePeers, Ou as fileTags, zd as filterReplicationOpsForSync, Rd as filterReplicationOpsForSyncWithStatus, ba as findByConcept, ya as findByFile, i as fingerprintPublicKey, N_ as firstSentence, bv as flushRawEvents, Un as fromJson, Wn as fromJsonStrict, sr as generateKeypair, Tu as getCachedScopeAuthorization, Lt as getCodememConfigPath, Ht as getCodememEnvOverrides, jh as getCoordinatorGroupPreference, ns as getEmbeddingClient, _g as getExtractionBenchmarkProfile, oi as getInjectionEvalScenarioByPrompt, ci as getInjectionEvalScenarioPack, li as getInjectionEvalScenarioPrompts, Q as getMaintenanceJob, Lf as getMemoryRoleReport, Wt as getOpenCodeProviderConfig, sn as getProviderApiKey, an as getProviderBaseUrl, on as getProviderHeaders, rn as getProviderOptions, ri as getRawEventRelinkPlan, ni as getRawEventRelinkReport, zf as getRawEventStatus, Vf as getReliabilityMetrics, td as getReplicationCursor, Rn as getSchemaVersion, Ts as getSemanticIndexDiagnostics, Eg as getSessionExtractionEval, wg as getSessionExtractionEvalScenario, di as getSummaryMetadata, Xx as getSyncDaemonPhase, Ku as getSyncResetState, At as getWorkspaceCodememConfigPath, jt as getWorkspaceScopedCodememConfigPath, Z_ as hasMeaningfulObservation, Ih as hasPendingDedupKeyBackfill, Gy as hasPendingRefBackfill, Kv as hasPendingScopeBackfill, ob as hasPendingSessionContextBackfill, fb as hasPendingSummaryDedupBackfill, pd as hasUnsyncedSharedMemoryChanges, Zo as hashText, hg as importMemories, lv as ingest, fv as ingestMain, ii as initDatabase, pS as initTestSchema, mS as insertTestSession, l as inviteLink, Wx as isConnectivityError, Ln as isEmbeddingDisabled, $g as isInternalMemoryTool, Xf as isLowSignalObservation, od as isNewerClock, Gg as isSensitiveFieldName, fi as isSummaryLikeMemory, M_ as isTrivialRequest, Ya as kindBonus, wu as listCachedScopesForDevice, Jt as listConfiguredOpenCodeProviders, Mh as listCoordinatorGroupPreferences, Zl as listCoordinatorJoinRequests, ql as listCoordinatorReciprocalApprovals, Gt as listCustomProviders, vg as listExtractionBenchmarkProfiles, Qd as listInboundScopeRejections, Kr as listMaintenanceJobs, Yt as listObserverProviderOptions, Py as listProjectScopeCandidates, Fy as listProjectScopeInventory, Oy as listProjectScopeSettingsMappings, Dy as listSharingDomainSettingsScopes, fd as loadMemorySnapshotPageForPeer, $p as loadObserverConfig, Dt as loadOpenCodeConfig, mp as loadOpenCodeOAuthCache, ix as loadPeerAddresses, rr as loadPrivateKey, er as loadPrivateKeyKeychain, nr as loadPublicKey, dd as loadReplicationOpsForPeer, ud as loadReplicationOpsSince, In as loadSqliteVec, Hl as lookupCoordinatorPeers, Ir as mapClaudeHookPayload, yx as mdnsAddressesForPeer, dx as mdnsEnabled, Tl as mergeAddresses, Zh as mergeSummaryMetadata, jn as migrateLegacyDbPath, tf as migrateLegacyImportKeys, Cb as negotiateSyncCapability, B_ as normalizeAdapterEvents, Cl as normalizeAddress, ha as normalizeConcept, z_ as normalizeEventsForSessionContext, Yf as normalizeObservation, Dr as normalizeProjectLabel, j_ as normalizeRequestText, Sb as normalizeSyncCapability, Du as normalizeTag, e_ as normalizeToolName, X_ as parseObserverResponse, wa as parsePositiveMemoryId, Ca as parseStrictInteger, uS as parseSyncScopeRequest, Kx as peerBackoffSeconds, Ad as peerCanSyncPrivateOpByPersonalScopeGrant, Dd as personalScopeGrantStatusForPeer, _d as planReplicationOpsAgePrune, _a as populateMemoryRefs, yp as probeAvailableCredentials, o_ as projectAdapterToolEvent, yi as projectBasename, Si as projectClause, xi as projectColumnClause, Ci as projectMatchesFilter, md as pruneReplicationOps, hd as pruneReplicationOpsUntilCaughtUp, Hf as rawEventsGate, Tp as readAuthFile, Rt as readCodememConfigFile, zt as readCodememConfigFileAtPath, Rl as readCoordinatorSyncConfig, og as readImportPayload, Pt as readWorkspaceCodememConfigFile, Iy as reassignProjectScopeInventoryProject, Ja as recencyScore, vr as recordNonce, sx as recordPeerSuccess, sd as recordReplicationOp, ox as recordSyncAttempt, dp as redactText, Cu as refreshConfiguredScopeMembershipCache, Su as refreshScopeMembershipCache, Gl as refreshStoredCoordinatorPeerAddresses, Vl as registerCoordinatorPresence, Xd as rejectInboundScopeFailures, Mp as renderObserverHeaders, Pv as replayBatchExtraction, Fv as replayBatchExtractionWithTierRouting, kd as replicationOpRequiresPersonalScopeAuthorization, kl as requestJson, zo as rerankResults, Zt as resolveBuiltInProviderDefaultModel, Xt as resolveBuiltInProviderFromModel, Qt as resolveBuiltInProviderModel, It as resolveCodememConfigPath, cn as resolveCustomProviderDefaultModel, $t as resolveCustomProviderFromModel, ln as resolveCustomProviderModel, Dn as resolveDbPath, Ar as resolveHookProject, tr as resolveKeyPaths, hp as resolveOAuthProvider, en as resolvePlaceholder, Ti as resolveProject, Vi as resolveProjectScope, Bf as retryRawEventFailures, Cp as runAuthCommand, Rh as runDedupKeyBackfillPass, Jy as runRefBackfillPass, Qv as runScopeBackfillPass, sb as runSessionContextBackfillPass, gb as runSummaryDedupBackfillPass, eS as runSyncDaemon, Bx as runSyncPass, Gb as runVectorMigrationPass, Jg as sanitizePayload, Zg as sanitizeToolOutput, Jm as scanSecretsRetroactive, H as schema, a as scopeMembershipEpochStatus, Bo as search, hS as seedMixedScopeFixture, rx as selectDialAddresses, Ms as semanticSearch, as as serializeFloat32, lx as setPeerLocalActorClaim, cx as setPeerProjectFilter, nd as setReplicationCursor, Yx as setSyncDaemonError, Jx as setSyncDaemonOk, Zx as setSyncDaemonPhase, qu as setSyncResetState, qx as shouldSkipOfflinePeer, mr as signRequest, qr as startMaintenanceJob, $n as storePrivateKeyKeychain, As as storeVectors, Tt as stripJsonComments, Hg as stripPrivate, Kg as stripPrivateObj, Et as stripTrailingCommas, Zd as summarizeInboundScopeRejections, $x as syncDaemonTick, zx as syncOnce, Rx as syncPassPreflight, Td as syncProjectAllowedByFilters, fS as syncScopeResetRequiredPayload, Ed as syncVisibilityAllowed, X as tableExists, Wo as timeline, Z as toJson, Gn as toJsonNullable, Jr as updateMaintenanceJob, ax as updatePeerAddresses, fu as upsertCachedScopeMemberships, Nh as upsertCoordinatorGroupPreference, Ly as upsertProjectScopeSettingsMapping, ai as vacuumDatabase, ur as validateExistingKeypair, hr as verifySignature, Bt as writeCodememConfigFile, Vt as writeWorkspaceCodememConfigFile };
|
|
17919
17931
|
|