codexuse-cli 3.6.0 → 3.6.1
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.js +1 -1
- package/dist/server/{NodeSqliteClient-C3G_wOtl.mjs → NodeSqliteClient-BXfshIvF.mjs} +3 -3
- package/dist/server/{SqlClient-DExl4DLk.mjs → SqlClient-DSf3-WP1.mjs} +35 -2
- package/dist/server/{SqlError-CJg2cz5q.mjs → SqlError-Djvykpuc.mjs} +2 -2
- package/dist/server/{SqliteClient-DG8tJKWU.mjs → SqliteClient-DBy8Gtib.mjs} +3 -3
- package/dist/server/index.mjs +90 -34
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10226,7 +10226,7 @@ async function ensureCliStorageReady() {
|
|
|
10226
10226
|
}
|
|
10227
10227
|
|
|
10228
10228
|
// src/app/main.ts
|
|
10229
|
-
var VERSION = true ? "3.6.
|
|
10229
|
+
var VERSION = true ? "3.6.1" : "0.0.0";
|
|
10230
10230
|
async function runCli() {
|
|
10231
10231
|
const args = process.argv.slice(2);
|
|
10232
10232
|
if (args.length === 0) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { $a as add, Ai as effectServices, Fr as map, It as die$1, Ni as provide, Nn as getCurrent, Qa as Service, Qn as as, Qr as scope, Ri as Scope, Tr as gen, a as makeCompilerSqlite, ci as tap, g as unwrap, gr as flatMap, hi as uninterruptibleMask, i as defaultTransforms, ii as succeed, lo as minutes, lr as die, n as SqlClient, no as getUnsafe, o as layer$1, pi as try_, pn as make$1, pr as fail, qn as acquireUseRelease, r as make$2, ro as make$3, si as sync, t as SafeIntegers, to as get, vi as void_, yi as withFiber, ys as identity, zi as addFinalizer } from "./SqlClient-DSf3-WP1.mjs";
|
|
4
4
|
import { n as make$4, t as get$1 } from "./index.mjs";
|
|
5
|
-
import { t as SqlError } from "./SqlError-
|
|
5
|
+
import { t as SqlError } from "./SqlError-Djvykpuc.mjs";
|
|
6
6
|
import { DatabaseSync } from "node:sqlite";
|
|
7
7
|
//#region src/persistence/NodeSqliteClient.ts
|
|
8
8
|
/**
|
|
@@ -137,4 +137,4 @@ const layerMemory = (config = {}) => effectServices(map(makeMemory(config), (cli
|
|
|
137
137
|
//#endregion
|
|
138
138
|
export { SqliteClient, TypeId, layer, layerConfig, layerMemory };
|
|
139
139
|
|
|
140
|
-
//# sourceMappingURL=NodeSqliteClient-
|
|
140
|
+
//# sourceMappingURL=NodeSqliteClient-BXfshIvF.mjs.map
|
|
@@ -13578,6 +13578,39 @@ const forkIn = forkIn$1;
|
|
|
13578
13578
|
*/
|
|
13579
13579
|
const forkScoped = forkScoped$1;
|
|
13580
13580
|
/**
|
|
13581
|
+
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
13582
|
+
* new fiber is attached to the global scope, when the fiber executing the
|
|
13583
|
+
* returned effect terminates, the forked fiber will continue running.
|
|
13584
|
+
*
|
|
13585
|
+
* @example
|
|
13586
|
+
* ```ts
|
|
13587
|
+
* import { Effect } from "effect"
|
|
13588
|
+
*
|
|
13589
|
+
* const daemonTask = Effect.gen(function*() {
|
|
13590
|
+
* while (true) {
|
|
13591
|
+
* yield* Effect.sleep("1 second")
|
|
13592
|
+
* yield* Effect.log("Daemon running...")
|
|
13593
|
+
* }
|
|
13594
|
+
* })
|
|
13595
|
+
*
|
|
13596
|
+
* const program = Effect.gen(function*() {
|
|
13597
|
+
* const fiber = yield* daemonTask.pipe(Effect.forkDetach)
|
|
13598
|
+
*
|
|
13599
|
+
* // or fork a fiber that starts immediately:
|
|
13600
|
+
* yield* daemonTask.pipe(Effect.forkDetach({ startImmediately: true }))
|
|
13601
|
+
*
|
|
13602
|
+
* yield* Effect.log("Daemon started")
|
|
13603
|
+
* yield* Effect.sleep("3 seconds")
|
|
13604
|
+
* // Daemon continues running after this effect completes
|
|
13605
|
+
* return "main completed"
|
|
13606
|
+
* })
|
|
13607
|
+
* ```
|
|
13608
|
+
*
|
|
13609
|
+
* @since 2.0.0
|
|
13610
|
+
* @category Supervision & Fibers
|
|
13611
|
+
*/
|
|
13612
|
+
const forkDetach = forkDetach$1;
|
|
13613
|
+
/**
|
|
13581
13614
|
* The foundational function for running effects, returning a "fiber" that can
|
|
13582
13615
|
* be observed or interrupted.
|
|
13583
13616
|
*
|
|
@@ -27947,6 +27980,6 @@ var TransactionConnection = class extends Service()("effect/sql/SqlClient/Transa
|
|
|
27947
27980
|
*/
|
|
27948
27981
|
const SafeIntegers = /* @__PURE__ */ Reference("effect/sql/SqlClient/SafeIntegers", { defaultValue: () => false });
|
|
27949
27982
|
//#endregion
|
|
27950
|
-
export { encodeUnknownEffect as $,
|
|
27983
|
+
export { encodeUnknownEffect as $, add$2 as $a, isFailure$1 as $i, asSome as $n, BaseProto as $o, scoped as $r, runFold as $t, NullOr as A, gen$1 as Aa, effectServices as Ai, make$15 as An, getOrThrow as Ao, log as Ar, Size as At, Union as B, succeedNone$1 as Ba, close as Bi, parseJson as Bn, map$10 as Bo, onInterrupt as Br, fromChannel as Bt, Finite as C, fiberInterrupt as Ca, catchDone as Ci, offerAll as Cn, sort as Co, forkIn as Cr, assign as Ct, NonEmptyArray as D, forkDetach$1 as Da, TaggedError as Di, unbounded as Dn, makeEquivalence$3 as Do, ignoreCause as Dr, FileDescriptor as Dt, Literals as E, forever$2 as Ea, Error$2 as Ei, take as En, filterMap$2 as Eo, ignore as Er, TypeId$4 as Et, TaggedErrorClass as F, scopeAddFinalizerExit as Fa, succeed$3 as Fi, badArgument as Fn, getOrElse$1 as Fo, map$3 as Fr, decodeText as Ft, decodeEffect as G, updateServices$1 as Ga, fail$5 as Gi, encodeBase64Url as Gn, make$29 as Go, provideService as Gr, fromReadableStream as Gt, Void as H, sync$2 as Ha, provide$3 as Hi, InvalidValue as Hn, none as Ho, orElseSucceed as Hr, fromIterable as Ht, TemplateLiteral as I, servicesWith$1 as Ia, sync$1 as Ii, systemError as In, getOrNull as Io, mapError as Ir, die as It, decodeUnknownEffect as J, CurrentLogSpans as Ja, make$25 as Ji, addFinalizer as Jn, PipeInspectableProto as Jo, runFork as Jr, merge as Jt, decodeExit as K, void_$3 as Ka, failCause$3 as Ki, acquireRelease as Kn, make$30 as Ko, provideServices as Kr, isStream as Kt, Trim as L, sleep$1 as La, unwrap$4 as Li, nominal as Ln, getOrUndefined as Lo, matchCauseEffect as Lr, empty as Lt, Record as M, loggerMake as Ma, mergeAll$1 as Mi, makeUnsafe$3 as Mn, succeed$7 as Mo, logError as Mr, make$7 as Mt, String$1 as N, onExit$3 as Na, provide$2 as Ni, getCurrent as Nn, filter$6 as No, logInfo as Nr, callback as Nt, NonEmptyString as O, formatLabel as Oa, effect as Oi, publish as On, fail$9 as Oo, interrupt$1 as Or, FileSystem as Ot, Struct as P, scope$1 as Pa, provideMerge as Pi, BadArgument as Pn, fromNullishOr$3 as Po, logWarning as Pr, concat as Pt, encodeEffect as Q, Service as Qa, hasInterrupts as Qi, as as Qn, withFiber$1 as Qo, scope as Qr, runCollect as Qt, Tuple as R, structuredMessage as Ra, Scope as Ri, transform as Rn, isNone as Ro, matchEffect as Rr, fail$1 as Rt, ErrorClass as S, defaultLogger as Sa, zipWith as Si, offer as Sn, of as So, forkDetach as Sr, withDecodingDefault as St, Literal as T, fnUntraced$1 as Ta, Class as Ti, shutdown as Tn, map$9 as To, gen as Tr, Path as Tt, brand as U, tracerLogger as Ua, _await as Ui, makeFormatterDefault as Un, some as Uo, promise as Ur, fromPubSub as Ut, Unknown as V, suspend$4 as Va, make$24 as Vi, stringifyJson as Vn, match$7 as Vo, orDie as Vr, fromEffect as Vt, declare as W, uninterruptibleMask$1 as Wa, doneUnsafe as Wi, make$21 as Wn, Number$5 as Wo, provide as Wr, fromQueue as Wt, decodeUnknownSync as X, DisablePropagation as Xa, succeed$4 as Xi, andThen as Xn, exitSucceed as Xo, runPromiseWith as Xr, onExit as Xt, decodeUnknownExit as Y, MinimumLogLevel as Ya, makeUnsafe$7 as Yi, all$1 as Yn, YieldableProto as Yo, runPromise as Yr, mkString as Yt, encode as Z, Reference as Za, fail$6 as Zi, annotateLogs as Zn, isEffect$1 as Zo, runSync as Zr, run$1 as Zt, url as _, andThen$1 as _a, useSpan as _i, set as _n, fromIterable$2 as _o, fn as _r, constVoid as _s, tag as _t, makeCompilerSqlite as a, UnknownError as aa, succeedNone as ai, unwrap$1 as an, fromInputUnsafe as ao, catchFilter as ar, symbolRedactable as as, isLessThanOrEqualTo as at, DateValid as b, causePretty as ba, withParentSpan as bi, failCauseUnsafe as bn, makeEquivalence$1 as bo, forever as br, pipe as bs, toType as bt, FalseValues as c, hasInterrupts$1 as ca, tap as ci, drain as cn, isZero$1 as co, catch_ as cr, structure as cs, isMinLength as ct, boolean as d, squash as da, timeoutOrElse as di, fromTransform$1 as dn, toMillis as do, ensuring as dr, isNotNull as ds, isSchemaError as dt, isSuccess$1 as ea, service as ei, runForEach as en, empty$5 as eo, asVoid as er, Class$1 as es, fromJsonString as et, map as f, ClockRef as fa, tryPromise as fi, mapDone as fn, toSeconds as fo, exit as fr, isNotUndefined as fs, link as ft, unwrap as g, addFinalizer$2 as ga, updateServices as gi, remove as gn, flatMapNullishOr as go, flatMap$2 as gr, constTrue as gs, suspend as gt, string as h, LogToStderr as ha, uninterruptibleMask as hi, make$12 as hn, filter$3 as ho, filterOrFail as hr, constFalse as hs, optional as ht, defaultTransforms as i, NoSuchElementError as ia, succeed$2 as ii, transduce as in, merge$2 as io, catchDefect as ir, redact as is, isGreaterThanOrEqualTo as it, Number$1 as j, ignore$1 as ja, empty$3 as ji, set$1 as jn, isFailure$3 as jo, logDebug as jr, WatchBackend as jt, Null as k, formatLogSpan as ka, effectDiscard as ki, unbounded$1 as kn, failVoid as ko, isEffect as kr, FileTypeId as kt, TrueValues as l, hasInterruptsOnly as la, tapCause as li, fromChannel$1 as ln, minutes as lo, die$2 as lr, symbol$3 as ls, isNonEmpty as lt, port as m, CurrentLoggers as ma, uninterruptible as mi, get$2 as mn, ensure as mo, failCause$2 as mr, isUndefined as ms, mutable as mt, SqlClient as n, void_$2 as na, services as ni, suspend$1 as nn, getUnsafe as no, callback$1 as nr, format$3 as ns, isBetween as nt, layer as o, done$1 as oa, suspend$3 as oi, get as on, infinity as oo, catchTag as or, symbol$2 as os, isMaxLength as ot, option as p, ConsoleRef as pa, try_ as pi, make$11 as pn, zero$1 as po, fail$4 as pr, isNullish as ps, makeFilter as pt, decodeTo as q, CurrentLogAnnotations as qa, isDone as qi, acquireUseRelease as qn, strictEqual as qo, result as qr, make$8 as qt, make as r, Done as ra, servicesWith as ri, toReadableStreamEffect as rn, make$27 as ro, catchCause as rr, formatJson as rs, isGreaterThan$1 as rt, Boolean as s, fail$7 as sa, sync as si, make$9 as sn, isFinite$1 as so, catchTags as sr, array as ss, isMaxProperties as st, SafeIntegers as t, succeed$5 as ta, serviceOption as ti, splitLines as tn, get$3 as to, cached as tr, NodeInspectSymbol as ts, is as tt, all as u, pretty as ua, timeoutOption as ui, isSink as un, seconds as uo, effectify as ur, hasProperty as us, isPattern as ut, Array$1 as v, as$1 as va, void_$1 as vi, size as vn, isArray as vo, fnUntraced as vr, dual as vs, toCodecStringTree as vt, Int as w, flatMap$4 as wa, clamp$1 as wi, offerUnsafe as wn, makeEquivalence$2 as wo, forkScoped as wr, omit as wt, Defect as x, consolePretty as xa, withSpan as xi, make$13 as xn, map$8 as xo, forkChild as xr, pipeArguments as xs, withConstructorDefault as xt, Boolean$1 as y, asSome$1 as ya, withFiber as yi, endUnsafe as yn, isReadonlyArrayNonEmpty as yo, forEach$1 as yr, identity as ys, toJsonSchemaDocument as yt, URLFromString as z, succeed$6 as za, addFinalizer$1 as zi, transformOrFail as zn, isSome as zo, never$4 as zr, flatMap as zt };
|
|
27951
27984
|
|
|
27952
|
-
//# sourceMappingURL=SqlClient-
|
|
27985
|
+
//# sourceMappingURL=SqlClient-DSf3-WP1.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import { F as TaggedErrorClass, N as String, ht as optional, j as Number, x as Defect } from "./SqlClient-
|
|
3
|
+
import { F as TaggedErrorClass, N as String, ht as optional, j as Number, x as Defect } from "./SqlClient-DSf3-WP1.mjs";
|
|
4
4
|
//#region ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/dist/unstable/sql/SqlError.js
|
|
5
5
|
/**
|
|
6
6
|
* @since 4.0.0
|
|
@@ -25,4 +25,4 @@ TaggedErrorClass("effect/sql/ResultLengthMismatch")("ResultLengthMismatch", {
|
|
|
25
25
|
//#endregion
|
|
26
26
|
export { SqlError as t };
|
|
27
27
|
|
|
28
|
-
//# sourceMappingURL=SqlError-
|
|
28
|
+
//# sourceMappingURL=SqlError-Djvykpuc.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { t as SqlError } from "./SqlError-
|
|
3
|
+
import { $a as add, Ai as effectServices, Fr as map, It as die, Jn as addFinalizer, Ni as provide, Nn as getCurrent, Qa as Service, Qn as as, Ri as Scope, Tr as gen, a as makeCompilerSqlite, ci as tap, g as unwrap, gr as flatMap, hi as uninterruptibleMask, i as defaultTransforms, ii as succeed, n as SqlClient, no as getUnsafe, o as layer$1, pi as try_, pn as make$1, pr as fail, r as make$2, ro as make$3, si as sync, t as SafeIntegers, to as get, yi as withFiber, ys as identity, zi as addFinalizer$1 } from "./SqlClient-DSf3-WP1.mjs";
|
|
4
|
+
import { t as SqlError } from "./SqlError-Djvykpuc.mjs";
|
|
5
5
|
import { Database } from "bun:sqlite";
|
|
6
6
|
//#region ../../node_modules/.bun/@effect+sql-sqlite-bun@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+sql-sqlite-bun@8881a9b+eecd35a1726d7096/node_modules/@effect/sql-sqlite-bun/dist/SqliteClient.js
|
|
7
7
|
/**
|
|
@@ -124,4 +124,4 @@ const layer = (config) => effectServices(map(make(config), (client) => make$3(Sq
|
|
|
124
124
|
//#endregion
|
|
125
125
|
export { SqliteClient, TypeId, layer, layerConfig, make };
|
|
126
126
|
|
|
127
|
-
//# sourceMappingURL=SqliteClient-
|
|
127
|
+
//# sourceMappingURL=SqliteClient-DBy8Gtib.mjs.map
|
package/dist/server/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import { $ as encodeUnknownEffect, $
|
|
3
|
+
import { $ as encodeUnknownEffect, $i as isFailure, $n as asSome$1, $o as BaseProto, $r as scoped, $t as runFold, A as NullOr, Aa as gen$1, An as make$21, Ao as getOrThrow, Ar as log$1, At as Size, B as Union, Ba as succeedNone, Bi as close, Bn as parseJson, Bo as map$5, Br as onInterrupt, Bt as fromChannel$1, C as Finite, Ca as fiberInterrupt, Ci as catchDone, Cn as offerAll, Co as sort, Cr as forkIn, Ct as assign, D as NonEmptyArray, Da as forkDetach, Di as TaggedError, Dn as unbounded, Do as makeEquivalence$2, Dr as ignoreCause, Dt as FileDescriptor, E as Literals, Ea as forever$1, Ei as Error$1, En as take, Eo as filterMap, Er as ignore, Et as TypeId$17, F as TaggedErrorClass, Fa as scopeAddFinalizerExit, Fi as succeed$2, Fn as badArgument, Fo as getOrElse, Fr as map$3, Ft as decodeText, G as decodeEffect, Ga as updateServices, Gi as fail$4, Gn as encodeBase64Url, Go as make$27, Gr as provideService, Gt as fromReadableStream, H as Void, Ha as sync$1, Hi as provide$2, Hn as InvalidValue$1, Ho as none$3, Hr as orElseSucceed, Ht as fromIterable$1, I as TemplateLiteral, Ia as servicesWith, Ii as sync$2, In as systemError, Io as getOrNull, Ir as mapError, J as decodeUnknownEffect, Ja as CurrentLogSpans, Ji as make$28, Jn as addFinalizer$1, Jo as PipeInspectableProto, Jr as runFork, Jt as merge$1, K as decodeExit, Ka as void_$2, Ki as failCause$1, Kn as acquireRelease, Ko as make$33, Kr as provideServices, Kt as isStream, L as Trim, La as sleep$1, Li as unwrap$1, Ln as nominal, Lo as getOrUndefined, Lr as matchCauseEffect, Lt as empty$4, M as Record, Ma as loggerMake, Mi as mergeAll, Mn as makeUnsafe$1, Mo as succeed$4, Mr as logError$1, Mt as make$22, N as String$1, Na as onExit, Ni as provide$1, No as filter$1, Nr as logInfo$1, Nt as callback$1, O as NonEmptyString, Oa as formatLabel, Oi as effect, On as publish, Oo as fail$3, Or as interrupt, Ot as FileSystem, P as Struct, Pa as scope, Pi as provideMerge, Pn as BadArgument, Po as fromNullishOr, Pr as logWarning$1, Pt as concat, Q as encodeEffect, Qa as Service, Qi as hasInterrupts$1, Qn as as, Qo as withFiber, Qt as runCollect, R as Tuple, Ra as structuredMessage, Ri as Scope, Rn as transform$1, Ro as isNone, Rr as matchEffect, Rt as fail$5, S as ErrorClass, Sa as defaultLogger$1, Si as zipWith, Sn as offer$1, So as of, Sr as forkDetach$1, St as withDecodingDefault, T as Literal, Ta as fnUntraced$1, Ti as Class, Tn as shutdown, To as map$7, Tr as gen, Tt as Path$1, U as brand, Ua as tracerLogger$1, Ui as _await, Un as makeFormatterDefault, Uo as some, Ur as promise, Ut as fromPubSub, V as Unknown, Va as suspend$1, Vi as make$29, Vn as stringifyJson, Vo as match, Vr as orDie, Vt as fromEffect, W as declare, Wa as uninterruptibleMask, Wi as doneUnsafe, Wn as make$32, Wo as Number$2, Wr as provide, Wt as fromQueue, X as decodeUnknownSync, Xa as DisablePropagation, Xi as succeed$5, Xn as andThen, Xo as exitSucceed, Xr as runPromiseWith, Xt as onExit$1, Y as decodeUnknownExit, Ya as MinimumLogLevel, Yi as makeUnsafe$2, Yn as all, Yo as YieldableProto, Yr as runPromise, Yt as mkString, Z as encode, Za as Reference, Zi as fail, Zn as annotateLogs, Zo as isEffect$1, Zr as runSync, Zt as run$2, _ as url, _a as andThen$1, _i as useSpan, _n as set$3, _o as fromIterable$2, _r as fn, _s as constVoid, _t as tag, aa as UnknownError, ai as succeedNone$1, an as unwrap, ao as fromInputUnsafe, ar as catchFilter, as as symbolRedactable, at as isLessThanOrEqualTo, b as DateValid, ba as causePretty, bi as withParentSpan, bn as failCauseUnsafe, bo as makeEquivalence$1, br as forever, bs as pipe, bt as toType, c as FalseValues, ca as hasInterrupts, ci as tap, cn as drain, co as isZero, cr as catch_, cs as structure, ct as isMinLength, d as boolean$3, da as squash, di as timeoutOrElse, dn as fromTransform, do as toMillis, dr as ensuring, ds as isNotNull, dt as isSchemaError, ea as isSuccess, ei as service, en as runForEach, eo as empty$5, er as asVoid, es as Class$1, et as fromJsonString, f as map$6, fa as ClockRef, fi as tryPromise, fn as mapDone, fo as toSeconds, fr as exit, fs as isNotUndefined, ft as link$1, ga as addFinalizer$2, gi as updateServices$1, gn as remove$2, go as flatMapNullishOr, gr as flatMap, gs as constTrue, gt as suspend$2, h as string$3, ha as LogToStderr$1, hi as uninterruptibleMask$1, hn as make$25, ho as filter, hr as filterOrFail, hs as constFalse, ht as optional$2, ia as NoSuchElementError, ii as succeed, in as transduce, io as merge$2, ir as catchDefect, is as redact$1, it as isGreaterThanOrEqualTo, j as Number$1, ja as ignore$1, ji as empty$6, jn as set$4, jo as isFailure$1, jr as logDebug, jt as WatchBackend, k as Null, ka as formatLogSpan, ki as effectDiscard, kn as unbounded$1, ko as failVoid, kr as isEffect, kt as FileTypeId, l as TrueValues, la as hasInterruptsOnly, li as tapCause, ln as fromChannel, lo as minutes, lr as die, ls as symbol$1, lt as isNonEmpty, m as port, ma as CurrentLoggers$1, mi as uninterruptible, mn as get$3, mo as ensure, mr as failCause, ms as isUndefined, mt as mutable, n as SqlClient, na as void_$3, ni as services, nn as suspend$3, nr as callback, ns as format$1, nt as isBetween, oa as done, oi as suspend, on as get$2, oo as infinity, or as catchTag, os as symbol, ot as isMaxLength, p as option, pa as ConsoleRef, pi as try_, pn as make$30, po as zero, pr as fail$1, ps as isNullish, pt as makeFilter, q as decodeTo, qa as CurrentLogAnnotations, qi as isDone, qn as acquireUseRelease, qo as strictEqual, qr as result, qt as make$31, ra as Done, ri as servicesWith$1, rn as toReadableStreamEffect, ro as make$26, rr as catchCause, rs as formatJson$1, rt as isGreaterThan, s as Boolean$1, sa as fail$2, si as sync, sn as make$23, so as isFinite$1, sr as catchTags, ss as array, st as isMaxProperties, ta as succeed$1, ti as serviceOption, tn as splitLines, to as get$4, tr as cached, ts as NodeInspectSymbol, tt as is, u as all$1, ua as pretty, ui as timeoutOption, un as isSink, uo as seconds, ur as effectify, us as hasProperty, ut as isPattern, v as Array$1, va as as$1, vi as void_$1, vn as size, vo as isArray, vr as fnUntraced, vs as dual, vt as toCodecStringTree, w as Int, wa as flatMap$1, wi as clamp, wn as offerUnsafe, wo as makeEquivalence, wr as forkScoped, wt as omit, x as Defect, xa as consolePretty$1, xi as withSpan, xn as make$24, xo as map$4, xr as forkChild, xs as pipeArguments, xt as withConstructorDefault, y as Boolean$2, ya as asSome, yi as withFiber$1, yn as endUnsafe, yo as isReadonlyArrayNonEmpty, yr as forEach, ys as identity, yt as toJsonSchemaDocument, z as URLFromString, za as succeed$3, zi as addFinalizer, zn as transformOrFail, zo as isSome, zr as never, zt as flatMap$2 } from "./SqlClient-DSf3-WP1.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as NodeChildProcess from "node:child_process";
|
|
6
6
|
import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
@@ -20876,8 +20876,8 @@ const runMigrations = gen(function* () {
|
|
|
20876
20876
|
//#endregion
|
|
20877
20877
|
//#region src/persistence/Layers/Sqlite.ts
|
|
20878
20878
|
const defaultSqliteClientLoaders = {
|
|
20879
|
-
bun: () => import("./SqliteClient-
|
|
20880
|
-
node: () => import("./NodeSqliteClient-
|
|
20879
|
+
bun: () => import("./SqliteClient-DBy8Gtib.mjs"),
|
|
20880
|
+
node: () => import("./NodeSqliteClient-BXfshIvF.mjs")
|
|
20881
20881
|
};
|
|
20882
20882
|
const makeRuntimeSqliteLayer = (config) => gen(function* () {
|
|
20883
20883
|
const loader = defaultSqliteClientLoaders[process.versions.bun !== void 0 ? "bun" : "node"];
|
|
@@ -28625,6 +28625,7 @@ const makeOrchestrationProjectionPipeline = gen(function* () {
|
|
|
28625
28625
|
turnId
|
|
28626
28626
|
});
|
|
28627
28627
|
const pendingTurnStart = yield* projectionTurnRepository.getPendingTurnStartByThreadId({ threadId: event.payload.threadId });
|
|
28628
|
+
if (!(isSome(existingTurn) || isSome(pendingTurnStart))) return;
|
|
28628
28629
|
if (isSome(existingTurn)) {
|
|
28629
28630
|
const nextState = existingTurn.value.state === "completed" || existingTurn.value.state === "error" ? existingTurn.value.state : "running";
|
|
28630
28631
|
yield* projectionTurnRepository.upsertByTurnId({
|
|
@@ -31804,14 +31805,21 @@ function closeExternalCodexThreadSyncWatcher() {
|
|
|
31804
31805
|
function setExternalCodexThreadSyncRefreshQueue(queue) {
|
|
31805
31806
|
externalCodexThreadSyncRefreshQueue = queue ? { offer: queue } : null;
|
|
31806
31807
|
}
|
|
31807
|
-
function
|
|
31808
|
-
if (!externalCodexThreadSyncRefreshQueue) return;
|
|
31809
|
-
|
|
31810
|
-
|
|
31808
|
+
async function requestExternalCodexThreadSyncRefresh(trigger) {
|
|
31809
|
+
if (!externalCodexThreadSyncRefreshQueue) return false;
|
|
31810
|
+
try {
|
|
31811
|
+
await externalCodexThreadSyncRefreshQueue.offer();
|
|
31812
|
+
return true;
|
|
31813
|
+
} catch (error) {
|
|
31814
|
+
console.warn("[t3 external thread sync] refresh enqueue failed", {
|
|
31811
31815
|
trigger,
|
|
31812
31816
|
error
|
|
31813
31817
|
});
|
|
31814
|
-
|
|
31818
|
+
return false;
|
|
31819
|
+
}
|
|
31820
|
+
}
|
|
31821
|
+
function queueExternalCodexThreadSyncRefresh(trigger) {
|
|
31822
|
+
requestExternalCodexThreadSyncRefresh(trigger);
|
|
31815
31823
|
}
|
|
31816
31824
|
function startExternalCodexThreadSyncWatcher(homePath) {
|
|
31817
31825
|
const resolvedHomePath = path.resolve(homePath);
|
|
@@ -32558,7 +32566,7 @@ async function listLegacyThreadPage(appServer, workspace, input) {
|
|
|
32558
32566
|
cwd: workspace.path,
|
|
32559
32567
|
cursor: input.cursor ?? null,
|
|
32560
32568
|
limit: input.limit,
|
|
32561
|
-
sortKey: "created_at"
|
|
32569
|
+
sortKey: input.sortKey ?? "created_at"
|
|
32562
32570
|
})));
|
|
32563
32571
|
return {
|
|
32564
32572
|
threads: normalized.threads.toSorted((left, right) => toEpochMs(right.updatedAt ?? right.createdAt, 0) - toEpochMs(left.updatedAt ?? left.createdAt, 0) || right.id.localeCompare(left.id)),
|
|
@@ -32809,7 +32817,8 @@ async function runExternalThreadSummaryBackfill(input) {
|
|
|
32809
32817
|
while (cursor) {
|
|
32810
32818
|
const page = await listLegacyThreadPage(appServer, plan.workspace, {
|
|
32811
32819
|
cursor,
|
|
32812
|
-
limit: EXTERNAL_THREAD_PAGE_SIZE
|
|
32820
|
+
limit: EXTERNAL_THREAD_PAGE_SIZE,
|
|
32821
|
+
sortKey: plan.sortKey
|
|
32813
32822
|
});
|
|
32814
32823
|
for (const summary of page.threads) {
|
|
32815
32824
|
const result = await runPromise(syncExternalThreadSummary({
|
|
@@ -33047,7 +33056,10 @@ const runExternalCodexThreadSync = gen(function* () {
|
|
|
33047
33056
|
const { projectId, workspace } = syncTarget;
|
|
33048
33057
|
let firstPage = null;
|
|
33049
33058
|
try {
|
|
33050
|
-
firstPage = yield* tryPromise(() => listLegacyThreadPage(appServer, workspace, {
|
|
33059
|
+
firstPage = yield* tryPromise(() => listLegacyThreadPage(appServer, workspace, {
|
|
33060
|
+
limit: EXTERNAL_SYNC_FOREGROUND_THREAD_LIMIT,
|
|
33061
|
+
sortKey: "updated_at"
|
|
33062
|
+
}));
|
|
33051
33063
|
} catch (cause) {
|
|
33052
33064
|
hadErrors = true;
|
|
33053
33065
|
yield* logWarning$1("failed to list external Codex threads for project", {
|
|
@@ -33119,7 +33131,8 @@ const runExternalCodexThreadSync = gen(function* () {
|
|
|
33119
33131
|
}
|
|
33120
33132
|
if (firstPage.nextCursor) backgroundBackfillPlans.push({
|
|
33121
33133
|
...syncTarget,
|
|
33122
|
-
nextCursor: firstPage.nextCursor
|
|
33134
|
+
nextCursor: firstPage.nextCursor,
|
|
33135
|
+
sortKey: "updated_at"
|
|
33123
33136
|
});
|
|
33124
33137
|
}
|
|
33125
33138
|
} finally {
|
|
@@ -33189,8 +33202,22 @@ const makeThreadSnapshotPreparation = gen(function* () {
|
|
|
33189
33202
|
proposedPlanRepository: yield* ProjectionThreadProposedPlanRepository,
|
|
33190
33203
|
turnRepository: yield* ProjectionTurnRepository
|
|
33191
33204
|
};
|
|
33192
|
-
const
|
|
33193
|
-
|
|
33205
|
+
const readPersistedImportedThreadState = (threadId) => all([
|
|
33206
|
+
importStateRepositories.messageRepository.listByThreadId({ threadId }),
|
|
33207
|
+
importStateRepositories.activityRepository.listByThreadId({ threadId }),
|
|
33208
|
+
importStateRepositories.proposedPlanRepository.listByThreadId({ threadId })
|
|
33209
|
+
], { concurrency: "inherit" }).pipe(map$3(([messages, activities, proposedPlans]) => {
|
|
33210
|
+
const importedIdPrefix = `${threadId}:`;
|
|
33211
|
+
return {
|
|
33212
|
+
hasArtifacts: messages.length > 0 || activities.length > 0 || proposedPlans.length > 0,
|
|
33213
|
+
hasImportedLineage: messages.some((message) => message.messageId.startsWith(importedIdPrefix)) || activities.some((activity) => activity.activityId.startsWith(importedIdPrefix)) || proposedPlans.some((plan) => plan.planId.startsWith(importedIdPrefix))
|
|
33214
|
+
};
|
|
33215
|
+
}), orElseSucceed(() => ({
|
|
33216
|
+
hasArtifacts: false,
|
|
33217
|
+
hasImportedLineage: false
|
|
33218
|
+
})));
|
|
33219
|
+
const ensureImportedThreadLiveSession = (thread, options) => gen(function* () {
|
|
33220
|
+
if (thread.origin !== "external-import" || thread.deletedAt !== null || !(options?.hasImportedLineage ?? hasImportedThreadLineage(thread))) return;
|
|
33194
33221
|
const workspaceCwd = resolveThreadWorkspaceCwd({
|
|
33195
33222
|
thread,
|
|
33196
33223
|
projects: (yield* orchestrationEngine.getReadModel()).projects
|
|
@@ -33260,20 +33287,31 @@ const makeThreadSnapshotPreparation = gen(function* () {
|
|
|
33260
33287
|
return entry.promise;
|
|
33261
33288
|
};
|
|
33262
33289
|
const prepareThreadSnapshot = (threadId) => gen(function* () {
|
|
33263
|
-
yield*
|
|
33264
|
-
|
|
33265
|
-
orchestrationEngine,
|
|
33266
|
-
stateDir: serverConfig.stateDir,
|
|
33267
|
-
importStateRepositories,
|
|
33268
|
-
providerRuntimeRepository
|
|
33269
|
-
}).pipe(catchCause((cause) => logWarning$1("failed on-demand imported thread hydration", {
|
|
33270
|
-
threadId,
|
|
33271
|
-
cause: pretty(cause)
|
|
33272
|
-
}).pipe(as(false))));
|
|
33273
|
-
const thread = (yield* orchestrationEngine.getReadModel()).threads.find((entry) => entry.id === threadId);
|
|
33290
|
+
let readModel = yield* orchestrationEngine.getReadModel();
|
|
33291
|
+
let thread = readModel.threads.find((entry) => entry.id === threadId);
|
|
33274
33292
|
if (!thread) return;
|
|
33275
|
-
yield*
|
|
33276
|
-
|
|
33293
|
+
const persistedImportedState = thread.origin === "external-import" && thread.deletedAt === null ? yield* readPersistedImportedThreadState(thread.id) : {
|
|
33294
|
+
hasArtifacts: false,
|
|
33295
|
+
hasImportedLineage: false
|
|
33296
|
+
};
|
|
33297
|
+
if (thread.origin === "external-import" && thread.deletedAt === null && !persistedImportedState.hasArtifacts) {
|
|
33298
|
+
yield* hydrateExternalThreadIfNeeded({
|
|
33299
|
+
threadId,
|
|
33300
|
+
orchestrationEngine,
|
|
33301
|
+
stateDir: serverConfig.stateDir,
|
|
33302
|
+
importStateRepositories,
|
|
33303
|
+
providerRuntimeRepository
|
|
33304
|
+
}).pipe(catchCause((cause) => logWarning$1("failed on-demand imported thread hydration", {
|
|
33305
|
+
threadId,
|
|
33306
|
+
cause: pretty(cause)
|
|
33307
|
+
}).pipe(as(false))));
|
|
33308
|
+
readModel = yield* orchestrationEngine.getReadModel();
|
|
33309
|
+
thread = readModel.threads.find((entry) => entry.id === threadId);
|
|
33310
|
+
if (!thread) return;
|
|
33311
|
+
}
|
|
33312
|
+
const hasImportedLineage = hasImportedThreadLineage(thread) || persistedImportedState.hasImportedLineage;
|
|
33313
|
+
yield* ensureImportedThreadLiveSession(thread, { hasImportedLineage });
|
|
33314
|
+
if (thread.origin === "external-import" && thread.deletedAt === null && hasImportedLineage) ensureFocusedImportedThreadSync(thread.id);
|
|
33277
33315
|
}).pipe(catchCause(() => void_$1));
|
|
33278
33316
|
return { prepareThreadSnapshot };
|
|
33279
33317
|
});
|
|
@@ -48257,7 +48295,7 @@ const handleOrchestrationRequest = fnUntraced(function* (body, context) {
|
|
|
48257
48295
|
yield* context.threadSnapshotPreparation.prepareThreadSnapshot(body.threadId);
|
|
48258
48296
|
return yield* context.projectionReadModelQuery.getThreadSnapshot(stripRequestTag(body));
|
|
48259
48297
|
case ORCHESTRATION_WS_METHODS.syncExternalThreads:
|
|
48260
|
-
yield* context.runExternalCodexThreadSync;
|
|
48298
|
+
if (!(yield* tryPromise(() => context.requestExternalCodexThreadSyncRefresh()).pipe(orElseSucceed(() => false)))) yield* forkDetach$1(context.runExternalCodexThreadSync.pipe(catch_((cause) => logWarning$1("failed to sync external Codex threads", { cause }))));
|
|
48261
48299
|
return { syncedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
48262
48300
|
case ORCHESTRATION_WS_METHODS.dispatchCommand: {
|
|
48263
48301
|
const normalizedCommand = yield* context.normalizeDispatchCommand({ command: body.command });
|
|
@@ -53302,6 +53340,7 @@ const createServer = fn(function* () {
|
|
|
53302
53340
|
resolveExternalThreadOverrideIntent,
|
|
53303
53341
|
persistExternalThreadOverrideIntent,
|
|
53304
53342
|
dispatchOrchestrationCommand,
|
|
53343
|
+
requestExternalCodexThreadSyncRefresh: () => requestExternalCodexThreadSyncRefresh("renderer-ws"),
|
|
53305
53344
|
runExternalCodexThreadSync
|
|
53306
53345
|
};
|
|
53307
53346
|
const routeRequest = fnUntraced(function* (request, ws) {
|
|
@@ -54055,12 +54094,29 @@ const runStartupMaintenance = gen(function* () {
|
|
|
54055
54094
|
});
|
|
54056
54095
|
}).pipe(tap(() => logInfo$1("Startup Projects maintenance completed", { mode: "background" })));
|
|
54057
54096
|
const makeExternalCodexThreadSyncRefreshLoop = gen(function* () {
|
|
54058
|
-
const
|
|
54059
|
-
|
|
54060
|
-
|
|
54061
|
-
|
|
54062
|
-
|
|
54063
|
-
|
|
54097
|
+
const runWithServices = runPromiseWith(yield* services());
|
|
54098
|
+
let disposed = false;
|
|
54099
|
+
let refreshQueued = false;
|
|
54100
|
+
let refreshInFlight = false;
|
|
54101
|
+
const runRefreshIfNeeded = () => {
|
|
54102
|
+
if (disposed || refreshInFlight || !refreshQueued) return;
|
|
54103
|
+
refreshInFlight = true;
|
|
54104
|
+
refreshQueued = false;
|
|
54105
|
+
runWithServices(runExternalCodexThreadSync.pipe(catch_((cause) => logWarning$1("failed to sync external Codex threads", { cause })))).finally(() => {
|
|
54106
|
+
refreshInFlight = false;
|
|
54107
|
+
if (refreshQueued && !disposed) runRefreshIfNeeded();
|
|
54108
|
+
});
|
|
54109
|
+
};
|
|
54110
|
+
setExternalCodexThreadSyncRefreshQueue(() => {
|
|
54111
|
+
refreshQueued = true;
|
|
54112
|
+
runRefreshIfNeeded();
|
|
54113
|
+
return Promise.resolve();
|
|
54114
|
+
});
|
|
54115
|
+
yield* addFinalizer$1(() => sync(() => {
|
|
54116
|
+
disposed = true;
|
|
54117
|
+
setExternalCodexThreadSyncRefreshQueue(null);
|
|
54118
|
+
}));
|
|
54119
|
+
}).pipe(asVoid);
|
|
54064
54120
|
const makeServerProgram = (input) => gen(function* () {
|
|
54065
54121
|
const startupStartedAt = Date.now();
|
|
54066
54122
|
const cliConfig = yield* CliConfig;
|