clanka 0.8.0 → 0.8.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/Acp.d.ts +4 -4
- package/dist/Acp.d.ts.map +1 -1
- package/dist/Acp.js +6 -6
- package/dist/Acp.js.map +1 -1
- package/dist/Acp.test.js +4 -4
- package/dist/Acp.test.js.map +1 -1
- package/dist/AcpImage.test.js +7 -7
- package/dist/AcpImage.test.js.map +1 -1
- package/dist/Agent.d.ts +8 -8
- package/dist/Agent.d.ts.map +1 -1
- package/dist/Agent.js +7 -7
- package/dist/Agent.js.map +1 -1
- package/dist/Agent.test.js +6 -6
- package/dist/Agent.test.js.map +1 -1
- package/dist/AgentExecutor.d.ts +9 -9
- package/dist/AgentExecutor.d.ts.map +1 -1
- package/dist/AgentExecutor.js +5 -5
- package/dist/AgentExecutor.js.map +1 -1
- package/dist/AgentExecutorImage.test.js +6 -6
- package/dist/AgentExecutorImage.test.js.map +1 -1
- package/dist/AgentImage.test.js +3 -3
- package/dist/AgentImage.test.js.map +1 -1
- package/dist/AgentOutput.d.ts +2 -2
- package/dist/AgentOutput.d.ts.map +1 -1
- package/dist/AgentOutput.js +2 -2
- package/dist/AgentOutput.js.map +1 -1
- package/dist/AgentSkills.d.ts.map +1 -1
- package/dist/AgentSkills.js +6 -1
- package/dist/AgentSkills.js.map +1 -1
- package/dist/AgentSkills.test.js +21 -4
- package/dist/AgentSkills.test.js.map +1 -1
- package/dist/AgentTools.d.ts +4 -4
- package/dist/AgentTools.d.ts.map +1 -1
- package/dist/AgentTools.js +4 -4
- package/dist/AgentTools.js.map +1 -1
- package/dist/AgentToolsImage.test.js +2 -2
- package/dist/AgentToolsImage.test.js.map +1 -1
- package/dist/ChunkRepo.d.ts +10 -10
- package/dist/ChunkRepo.d.ts.map +1 -1
- package/dist/ChunkRepo.js +7 -7
- package/dist/ChunkRepo.js.map +1 -1
- package/dist/ChunkRepo.test.js +2 -2
- package/dist/ChunkRepo.test.js.map +1 -1
- package/dist/CodeChunker.d.ts +1 -1
- package/dist/CodeChunker.d.ts.map +1 -1
- package/dist/CodeChunker.js +2 -2
- package/dist/CodeChunker.js.map +1 -1
- package/dist/Codex.d.ts +5 -5
- package/dist/Codex.d.ts.map +1 -1
- package/dist/Codex.js +1 -1
- package/dist/Codex.js.map +1 -1
- package/dist/CodexAuth.d.ts +2 -2
- package/dist/CodexAuth.d.ts.map +1 -1
- package/dist/CodexAuth.js +6 -6
- package/dist/CodexAuth.js.map +1 -1
- package/dist/CodexAuth.test.js +3 -3
- package/dist/CodexAuth.test.js.map +1 -1
- package/dist/Compaction.d.ts +3 -3
- package/dist/Compaction.d.ts.map +1 -1
- package/dist/Compaction.js +3 -3
- package/dist/Compaction.js.map +1 -1
- package/dist/Compaction.test.js +3 -3
- package/dist/Compaction.test.js.map +1 -1
- package/dist/CompactionImage.test.js +4 -4
- package/dist/CompactionImage.test.js.map +1 -1
- package/dist/CompactionTokens.test.js +3 -3
- package/dist/CompactionTokens.test.js.map +1 -1
- package/dist/CompactionTransport.test.js +5 -5
- package/dist/CompactionTransport.test.js.map +1 -1
- package/dist/Copilot.d.ts +3 -3
- package/dist/Copilot.d.ts.map +1 -1
- package/dist/Copilot.js +1 -1
- package/dist/Copilot.js.map +1 -1
- package/dist/CopilotAuth.d.ts +2 -2
- package/dist/CopilotAuth.d.ts.map +1 -1
- package/dist/CopilotAuth.js +4 -4
- package/dist/CopilotAuth.js.map +1 -1
- package/dist/CopilotAuth.test.js +2 -2
- package/dist/CopilotAuth.test.js.map +1 -1
- package/dist/GlobalWebSocket.d.ts +1 -1
- package/dist/GlobalWebSocket.d.ts.map +1 -1
- package/dist/GlobalWebSocket.js +1 -1
- package/dist/GlobalWebSocket.js.map +1 -1
- package/dist/Image.d.ts +2 -2
- package/dist/Image.d.ts.map +1 -1
- package/dist/Image.js +3 -3
- package/dist/Image.js.map +1 -1
- package/dist/Image.test.js +2 -2
- package/dist/Image.test.js.map +1 -1
- package/dist/SemanticSearch.d.ts +3 -3
- package/dist/SemanticSearch.d.ts.map +1 -1
- package/dist/SemanticSearch.js +2 -2
- package/dist/SemanticSearch.js.map +1 -1
- package/dist/Sqlite.d.ts +2 -2
- package/dist/Sqlite.d.ts.map +1 -1
- package/dist/Sqlite.js +1 -1
- package/dist/Sqlite.js.map +1 -1
- package/dist/ToolkitRenderer.d.ts +2 -2
- package/dist/ToolkitRenderer.d.ts.map +1 -1
- package/dist/WebToMarkdown.d.ts +2 -2
- package/dist/WebToMarkdown.d.ts.map +1 -1
- package/dist/WebToMarkdown.js +1 -1
- package/dist/WebToMarkdown.js.map +1 -1
- package/dist/WebToMarkdown.test.js +1 -1
- package/dist/WebToMarkdown.test.js.map +1 -1
- package/dist/Xai.d.ts +10 -3
- package/dist/Xai.d.ts.map +1 -1
- package/dist/Xai.js +26 -2
- package/dist/Xai.js.map +1 -1
- package/dist/Xai.test.js +38 -4
- package/dist/Xai.test.js.map +1 -1
- package/dist/XaiAuth.d.ts +2 -2
- package/dist/XaiAuth.d.ts.map +1 -1
- package/dist/XaiAuth.js +4 -4
- package/dist/XaiAuth.js.map +1 -1
- package/dist/XaiAuth.test.js +2 -2
- package/dist/XaiAuth.test.js.map +1 -1
- package/dist/bin/{Effect-CeAMoJlg.mjs → Effect-BCeySOy1.mjs} +281 -586
- package/dist/bin/Effect-BCeySOy1.mjs.map +1 -0
- package/dist/bin/{McpClient-zQibhsnA.mjs → McpClient-DP4jlaD1.mjs} +3 -3
- package/dist/bin/{McpClient-zQibhsnA.mjs.map → McpClient-DP4jlaD1.mjs.map} +1 -1
- package/dist/bin/{OutputFormatter-C7Awn0DS.mjs → OutputFormatter-Ch8yFytV.mjs} +3 -3
- package/dist/bin/{OutputFormatter-C7Awn0DS.mjs.map → OutputFormatter-Ch8yFytV.mjs.map} +1 -1
- package/dist/bin/{Schema-Bc06DxcV.mjs → Schema-C9JQ5hI0.mjs} +1979 -1663
- package/dist/bin/Schema-C9JQ5hI0.mjs.map +1 -0
- package/dist/bin/{SemanticSearch-BPxQoRSC.mjs → SemanticSearch-BJGnYhFt.mjs} +47 -43
- package/dist/bin/SemanticSearch-BJGnYhFt.mjs.map +1 -0
- package/dist/bin/{Stream-DlGXvw0L.mjs → Stream-CgH3SuLu.mjs} +60 -61
- package/dist/bin/Stream-CgH3SuLu.mjs.map +1 -0
- package/dist/bin/cli.mjs +659 -426
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/cli.js +7 -5
- package/dist/cli.js.map +1 -1
- package/dist/fixtures/TestImages.js +2 -2
- package/dist/fixtures/TestImages.js.map +1 -1
- package/package.json +7 -7
- package/src/Acp.test.ts +5 -5
- package/src/Acp.ts +8 -8
- package/src/AcpImage.test.ts +9 -9
- package/src/Agent.test.ts +7 -7
- package/src/Agent.ts +10 -10
- package/src/AgentExecutor.ts +8 -8
- package/src/AgentExecutorImage.test.ts +6 -6
- package/src/AgentImage.test.ts +5 -5
- package/src/AgentOutput.ts +2 -2
- package/src/AgentSkills.test.ts +81 -37
- package/src/AgentSkills.ts +5 -1
- package/src/AgentTools.ts +5 -5
- package/src/AgentToolsImage.test.ts +4 -4
- package/src/ChunkRepo.test.ts +2 -2
- package/src/ChunkRepo.ts +7 -7
- package/src/CodeChunker.ts +2 -2
- package/src/Codex.ts +4 -4
- package/src/CodexAuth.test.ts +3 -3
- package/src/CodexAuth.ts +6 -6
- package/src/Compaction.test.ts +3 -3
- package/src/Compaction.ts +3 -3
- package/src/CompactionImage.test.ts +4 -4
- package/src/CompactionTokens.test.ts +3 -3
- package/src/CompactionTransport.test.ts +6 -6
- package/src/Copilot.ts +2 -2
- package/src/CopilotAuth.test.ts +2 -6
- package/src/CopilotAuth.ts +4 -4
- package/src/GlobalWebSocket.ts +1 -1
- package/src/Image.test.ts +2 -2
- package/src/Image.ts +4 -4
- package/src/OutputFormatter.ts +1 -1
- package/src/SemanticSearch.test.ts +1 -1
- package/src/SemanticSearch.ts +4 -4
- package/src/Sqlite.ts +1 -1
- package/src/ToolkitRenderer.ts +2 -2
- package/src/WebToMarkdown.test.ts +1 -1
- package/src/WebToMarkdown.ts +2 -2
- package/src/Xai.test.ts +67 -8
- package/src/Xai.ts +52 -3
- package/src/XaiAuth.test.ts +2 -2
- package/src/XaiAuth.ts +4 -4
- package/src/cli.ts +9 -7
- package/src/fixtures/TestImages.ts +2 -2
- package/src/fixtures/patch13-broken.txt +4 -4
- package/src/fixtures/patch13-fixed.txt +4 -4
- package/dist/bin/Effect-CeAMoJlg.mjs.map +0 -1
- package/dist/bin/Schema-Bc06DxcV.mjs.map +0 -1
- package/dist/bin/SemanticSearch-BPxQoRSC.mjs.map +0 -1
- package/dist/bin/Stream-DlGXvw0L.mjs.map +0 -1
package/dist/bin/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --optimize-for-size
|
|
2
|
-
import { $ as isEffect, $a as
|
|
3
|
-
import { $ as
|
|
4
|
-
import { $ as declare, $t as
|
|
2
|
+
import { $ as isEffect, $a as map$8, $i as headUnsafe, $n as buildWithScope, $o as symbol$2, $t as uninterruptibleMask, A as ensuring, Aa as getOrUndefined$1, Ai as ParentSpan, An as StackTrace, Ao as assignProperty, Ar as isDone, At as result, B as fnUntraced, Ba as flatMapNullishOr, Bi as headNonEmpty, Bn as hasInterrupts, Br as succeed$3, Bt as sleep, C as catch_, Ca as zero, Cr as MinimumLogLevel, Cs as constUndefined, Ct as promise, Da as empty$7, Dn as Done, Dr as doneUnsafe, Ds as flow, Dt as raceFirst, E as contextWith, Ea as add, En as nextBetween, Es as dual, Et as provideService, F as filterOrFail, Fa as merge$2, Fi as findFirst, Fn as done, Fo as NodeInspectSymbol, Fr as failCause$1, G as forkIn, Ga as getOrElse, Gi as last$1, Go as equals, Gt as tap, H as forEach$2, Hi as isCanonicalArrayIndex, Hn as interruptors, Ho as redact$1, Ht as succeedNone, I as flatMap$1, Ia as all, Ii as findFirstIndex, In as fail$4, Io as toJson, Ir as interrupt$1, It as scope, Ja as getOrUndefined, Ji as match$3, Jt as timeoutOrElse, K as forkScoped, Ka as getOrNull, Kn as isTimeoutError, Ko as symbol$1, Kt as tapCause, L as flatMapEager, La as exists, Li as findLast, Ln as filterInterruptors, Lo as format, Lt as scoped, M as fail$2, Ma as getUnsafe, Mn as UnknownError$1, Mo as setStackTraceLimit, Mr as makeUnsafe$2, Mt as runFork, N as failCause, Na as make$42, Ni as appendAll, Nn as annotate$1, No as BaseProto, Nr as die$1, Nt as runForkWith, O as die, Oa as get$3, Oo as withFiber$1, Os as identity, Ot as repeat, Pa as makeUnsafe$3, Pi as empty$6, Po as Class, Pr as fail$3, Ps as pipeArguments, Pt as runSync, Q as interruptible, Qi as empty$8, Qn as squash, Qo as structure, Qt as uninterruptible, Ra as filter$1, Rr as isFailure$1, S as catchTags, Sr as CurrentLogAnnotations, Ss as constTrue, St as orElseSucceed, T as context, Ta as Service, Ti as sync$1, Tn as Random$1, Tr as _await, Tt as provideContext, U as forever, Ua as fromNullishOr, Ui as isReadonlyArrayNonEmpty, Uo as symbolRedactable, Ur as ConsoleRef, Ut as suspend, Vi as isArrayNonEmpty, Vn as hasInterruptsOnly, Vr as void_$1, Vt as succeed$2, W as forkChild, Wa as fromUndefinedOr, Wi as join$1, Wr as LogToStderr$1, Wt as sync, X as ignore, Xi as reduce, Xt as try_, Y as gen, Ya as isNone, Yi as of, Yo as hash, Yt as tryPromise, Z as interrupt, Za as isSome, Zn as pretty, Zt as undefined_, _ as catchFilter, _a as minutes, _n as min, _o as strictEqual, _r as close, _s as isTagged, _t as onExit, a as andThen, aa as isSuccess, an as whileLoop, ao as toArray, ar as merge$3, as as isIterable, at as makeSpanScoped, b as catchReason, ba as seconds, bn as catchDone, br as makeUnsafe$1, bs as or, bt as option$1, c as as, ca as succeed$1, cn as withParentSpan, cr as orDie$1, cs as isNotNullish, ct as mapEager, d as cached, da as fromInputUnsafe$1, dn as zipWith, dr as succeed$4, ds as isNullish, dt as match$4, ea as fail$1, en as updateContext, eo as match$2, er as effect, es as hasProperty, et as logDebug, f as cachedWithTTL, fa as infinity, fr as succeedContext, g as catchEager, ga as millis, gn as jittered, gr as addFinalizerExit, gs as isString, gt as onError, h as catchDefect, hn as isSchedule, hr as addFinalizer$1, ht as never, i as all$1, ia as isFailure, io as some, ir as fresh, it as logWarning, j as exit, ja as getOrUndefinedUnsafe, ji as Array$1, jn as TimeoutError, jo as getStackTraceLimit, jr as isDoneUnsafe, js as pipe, jt as retry, k as effectify, ka as getOption, ki as DisablePropagation, kr as into, ks as memoize, kt as request, l as asSome, la as try_$1, ln as withSpan$1, lr as provide$3, ls as isNotUndefined, lt as mapError, m as catchCause, ma as isFinite, mn as exponential, mr as Scope, mt as matchEffect, nn as useSpan, no as orElse$1, nt as logFatal, o as annotateCurrentSpan, oa as map$6, on as withFiber, or as mergeAll, ot as map$5, p as callback, pn as TaggedClass, pr as unwrap$1, ps as isObject, pt as matchCauseEffect, q as fromOption, qa as getOrThrow, qi as map$7, qt as timeout, r as addFinalizer, ra as getOrUndefined$2, rn as void_, ro as orElseSome, rr as empty$9, rt as logInfo, s as annotateLogs, sr as mock, ss as isNotNull, st as mapBothEager, t as acquireRelease, ta as failVoid, tn as updateService, to as none, tr as effectContext, tt as logError, u as asVoid, ua as format$1, un as yieldNow, ur as provideMerge, us as isNull, ut as mapErrorEager, v as catchIf, vn as passthrough, vo as Prototype, vs as isUndefined, w as clockWith, wa as Reference, ws as constVoid, wt as provide$1, x as catchTag, xa as toMillis, xo as PipeInspectableProto, xr as provide$2, xs as constFalse, xt as orDie, yn as spaced, yt as onInterrupt, z as fn, za as flatMap$2, zi as fromIterable$1, zr as isSuccess$1, zt as serviceOption } from "./Effect-BCeySOy1.mjs";
|
|
3
|
+
import { $ as tap$1, A as mapArrayEffect, At as getCurrent, B as provideService$1, Bt as round, Ct as unbounded, D as isStream, Dt as update, E as fromReadableStream, Et as set$2, F as mkString, Ft as join$2, G as runForEach, H as runCollect, I as onEnd, It as runIn, J as splitLines, K as runForEachArray, L as orDie$2, Lt as camelToSnake, M as mapError$1, Mt as interruptAll, N as merge$4, Nt as interruptAllAs, O as map$9, Ot as makeUnsafe$5, P as mergeAll$1, Q as takeUntil, R as pipeThroughChannel, Rt as toLowerCase, S as fromIterable$2, St as take, T as fromQueue, Tt as make$43, V as run$4, Vt as normalizeNonEmpty, W as runFold, X as suspend$1, Y as succeed$5, Z as take$1, _ as flattenIterable, _t as offer, a as catchTags$1, at as pipeTo, b as fromChannel$1, bt as offerUnsafe, c as die$2, ct as make$45, d as ensuring$1, dt as end, et as transduce, f as fail$5, ft as endUnsafe, g as flatMap$3, gt as make$44, h as filterMap, ht as failCauseUnsafe, i as catchReason$1, it as mapDone, j as mapEffect$1, jt as interrupt$2, k as mapArray, kt as await_, l as drop, lt as makeUnsafe$4, m as filter$2, mt as failCause$2, n as callback$1, nt as fromTransform$1, o as catch_$1, ot as toTransform, p as failCause$3, pt as fail$6, rt as map$10, s as decodeText, st as unwrap$2, t as broadcast, tt as unwrap$3, u as empty$10, ut as bounded, vt as offerAll, w as fromPull, x as fromEffect, xt as poll, yt as offerAllUnsafe, z as provideContext$1, zt as parse$1 } from "./Stream-CgH3SuLu.mjs";
|
|
4
|
+
import { $ as declare, $t as Union$1, An as toString, At as tag, B as TaggedUnion, Bn as isRedacted, Bt as omit, C as Never, Ct as isSchemaError, D as NullOr, Dn as empty$11, Dt as mutable, E as Null, En as Pointer, Et as makeFilterGroup, F as String$5, Fn as formatIso, Ft as toType, G as Uint8Array$2, Gn as EncodingError, Gt as encodeEffect, H as Tuple, Hn as value, Ht as _is, I as Struct, It as withConstructorDefault, J as Union, Jn as TaggedError, Jt as FilterGroup, K as Uint8ArrayFromBase64, Kn as Error$2, Kt as Arrays, L as StructWithRest, Ln as fromDateUnsafe, Lt as withDecodingDefault, M as Record, Mn as fromSetCookie, Mt as toCodecStringTree, N as Redacted$1, Nn as decode$4, Nt as toEncoded$1, O as Number$2, On as fromInput$1, Ot as optional$2, P as SchemaError, Pn as encode, Pt as toJsonSchemaDocument, Q as check, Qn as map$11, Qt as Suspend, R as TaggedClass$2, Rt as withDecodingDefaultKey, Sn as passthrough$1, St as isSchema, T as NonEmptyString$1, Tn as InvalidValue$1, Tt as makeFilter, U as URL$1, Un as stringOrRedacted, Ut as decodeEffect$1, V as TrueLiterals, Vn as make$46, Vt as getReferenceKey, W as URLFromString, Wn as Clock, Wt as decodeUnknownEffect, X as Void, Xn as assignProperty$1, Xt as Objects, Y as Unknown, Yn as taggedEnum, Yt as Literal$1, Zn as makeEquivalence, Zt as PropertySignature, _ as Int$1, _n as transform$3, _t as isMaxLength, a as BooleanLiterals, an as null_, at as decodeUnknownSync, b as Literals$2, bt as isPattern, cn as resolveAt, ct as encodeUnknownEffect, d as Defect, dn as string, dt as is, en as applyToSelfOrLastLinkEncoding, et as decodeEffect, f as Duration, fn as toEncoded, ft as isFinite$1, g as Finite, gn as passthrough$2, gt as isLessThanOrEqualTo, h as FalseLiterals, hn as Transformation, ht as isInt, in as mapOrSame, it as decodeUnknownOption, j as OptionFromOptional, jn as empty$12, jt as toCodecJson, k as Option, kn as setAll$1, kt as optionalKey, ln as resolveDescription, lt as fromJsonString, m as Exit, mn as unknown, mt as isGreaterThanOrEqualTo, n as ArraySchema, nn as isNever, nt as decodeTo$1, o as Class$1, on as optionalKey$1, ot as encodeEffect$1, p as Error$3, pn as toType$1, pt as isGreaterThan, q as UndefinedOr, qn as TaggedClass$1, qt as Filter, r as Boolean$4, rn as isOptional, rt as decodeUnknownEffect$1, s as DateTimeUtc, sn as replaceChecks, st as encodeTo, t as Any, tn as decodeTo, tt as decodeSync, u as DateTimeUtcFromString, un as resolveIdentifier, v as Json, vn as transformEffect$1, vt as isMaxProperties, w as NonEmptyArray, wn as transformEffect, wt as make$47, x as MutableJson, xt as isPropertyNames, y as Literal, yn as transformOptional, yt as isMinLength, z as TaggedError$1 } from "./Schema-C9JQ5hI0.mjs";
|
|
5
5
|
import * as Http from "node:http";
|
|
6
6
|
import * as Https from "node:https";
|
|
7
7
|
import { PassThrough, Readable, Writable } from "node:stream";
|
|
@@ -42,7 +42,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
42
42
|
enumerable: true
|
|
43
43
|
}) : target, mod));
|
|
44
44
|
//#endregion
|
|
45
|
-
//#region node_modules/.pnpm/effect@
|
|
45
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Filter.js
|
|
46
46
|
const toPredicate = (self) => (input) => !isFailure(self(input));
|
|
47
47
|
const has = (key) => (input) => input.has(key) ? succeed$1(input) : fail$1(input);
|
|
48
48
|
const compose = dual(2, (left, right) => (input) => {
|
|
@@ -51,14 +51,14 @@ const compose = dual(2, (left, right) => (input) => {
|
|
|
51
51
|
return right(leftOut.success);
|
|
52
52
|
});
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region node_modules/.pnpm/effect@
|
|
54
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/BigInt.js
|
|
55
55
|
const BigInt$1 = globalThis.BigInt;
|
|
56
56
|
const toNumber = (b) => {
|
|
57
57
|
if (b > BigInt$1(Number.MAX_SAFE_INTEGER) || b < BigInt$1(Number.MIN_SAFE_INTEGER)) return none();
|
|
58
58
|
return some(Number(b));
|
|
59
59
|
};
|
|
60
60
|
//#endregion
|
|
61
|
-
//#region node_modules/.pnpm/effect@
|
|
61
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ByteSize.js
|
|
62
62
|
const bigint0 = BigInt(0);
|
|
63
63
|
const bigint1 = BigInt(1);
|
|
64
64
|
const decimalBase = BigInt(1e3);
|
|
@@ -249,7 +249,7 @@ const fromNumber = (input) => {
|
|
|
249
249
|
if (!Number.isSafeInteger(input) || input < 0) return invalid(`expected a non-negative safe integer, received ${input}`);
|
|
250
250
|
return make$41(BigInt(input));
|
|
251
251
|
};
|
|
252
|
-
const
|
|
252
|
+
const fromStringUnsafe = (input) => {
|
|
253
253
|
const match = /^\s*(\d+)(?:\.(\d+))?\s*([A-Za-z]+)\s*$/.exec(input);
|
|
254
254
|
if (match === null) return invalid(`unsupported syntax ${JSON.stringify(input)}`);
|
|
255
255
|
const unit = unitsByName.get(match[3]);
|
|
@@ -266,13 +266,13 @@ const fromInputUnsafe = (input) => {
|
|
|
266
266
|
if (input < bigint0) return invalid(`expected a non-negative bigint, received ${input}`);
|
|
267
267
|
return make$41(input);
|
|
268
268
|
case "number": return fromNumber(input);
|
|
269
|
-
case "string": return
|
|
269
|
+
case "string": return fromStringUnsafe(input);
|
|
270
270
|
}
|
|
271
271
|
return invalid(`unsupported input ${input}`);
|
|
272
272
|
};
|
|
273
273
|
const bytes = (value) => typeof value === "bigint" ? fromInputUnsafe(value) : fromNumber(value);
|
|
274
274
|
//#endregion
|
|
275
|
-
//#region node_modules/.pnpm/effect@
|
|
275
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/PlatformError.js
|
|
276
276
|
const TypeId$34 = "~effect/PlatformError";
|
|
277
277
|
var BadArgument = class extends TaggedError("BadArgument") {
|
|
278
278
|
get message() {
|
|
@@ -300,7 +300,7 @@ var PlatformError = class extends TaggedError("PlatformError") {
|
|
|
300
300
|
const systemError = (options) => new PlatformError(new SystemError(options));
|
|
301
301
|
const badArgument = (options) => new PlatformError(new BadArgument(options));
|
|
302
302
|
//#endregion
|
|
303
|
-
//#region node_modules/.pnpm/effect@
|
|
303
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Sink.js
|
|
304
304
|
const TypeId$33 = "~effect/Sink";
|
|
305
305
|
const endVoid = succeed$2([void 0]);
|
|
306
306
|
const sinkVariance = {
|
|
@@ -338,7 +338,7 @@ const forEach$1 = (f) => forEachArray(forEach$2((_) => f(_), { discard: true }))
|
|
|
338
338
|
const forEachArray = (f) => fromTransform((upstream) => upstream.pipe(flatMap$1(f), forever({ disableYield: true }), catchDone(() => endVoid)));
|
|
339
339
|
const unwrap = (effect) => fromChannel(unwrap$2(map$5(effect, toChannel)));
|
|
340
340
|
//#endregion
|
|
341
|
-
//#region node_modules/.pnpm/effect@
|
|
341
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/MutableHashMap.js
|
|
342
342
|
const TypeId$32 = "~effect/MutableHashMap";
|
|
343
343
|
const MutableHashMapProto = {
|
|
344
344
|
[TypeId$32]: TypeId$32,
|
|
@@ -376,10 +376,10 @@ const fromIterable = (entries) => {
|
|
|
376
376
|
const get$2 = dual(2, (self, key) => {
|
|
377
377
|
if (self.backing.has(key)) return some(self.backing.get(key));
|
|
378
378
|
else if (isSimpleKey(key)) return none();
|
|
379
|
-
const refKey = referentialKeysCache.get(
|
|
380
|
-
if (refKey !== void 0
|
|
381
|
-
const hash$
|
|
382
|
-
const bucket = self.buckets.get(hash$
|
|
379
|
+
const refKey = referentialKeysCache.get(key);
|
|
380
|
+
if (refKey !== void 0 && self.backing.has(refKey)) return some(self.backing.get(refKey));
|
|
381
|
+
const hash$1 = hash(key);
|
|
382
|
+
const bucket = self.buckets.get(hash$1);
|
|
383
383
|
if (bucket === void 0) return none();
|
|
384
384
|
return getFromBucket(self, bucket, key);
|
|
385
385
|
});
|
|
@@ -398,15 +398,15 @@ const set$1 = dual(3, (self, key, value) => {
|
|
|
398
398
|
self.backing.set(key, value);
|
|
399
399
|
return self;
|
|
400
400
|
}
|
|
401
|
-
let refKey = referentialKeysCache.get(
|
|
401
|
+
let refKey = referentialKeysCache.get(key);
|
|
402
402
|
if (refKey !== void 0 && self.backing.has(refKey)) {
|
|
403
403
|
self.backing.set(refKey, value);
|
|
404
404
|
return self;
|
|
405
405
|
}
|
|
406
|
-
const hash$
|
|
407
|
-
const bucket = self.buckets.get(hash$
|
|
406
|
+
const hash$2 = hash(key);
|
|
407
|
+
const bucket = self.buckets.get(hash$2);
|
|
408
408
|
if (bucket === void 0) {
|
|
409
|
-
self.buckets.set(hash$
|
|
409
|
+
self.buckets.set(hash$2, [key]);
|
|
410
410
|
self.backing.set(key, value);
|
|
411
411
|
return self;
|
|
412
412
|
}
|
|
@@ -429,9 +429,9 @@ const remove$2 = dual(2, (self, key_) => {
|
|
|
429
429
|
self.backing.delete(key_);
|
|
430
430
|
return self;
|
|
431
431
|
}
|
|
432
|
-
const key = referentialKeysCache.get(
|
|
433
|
-
const hash$
|
|
434
|
-
const bucket = self.buckets.get(hash$
|
|
432
|
+
const key = referentialKeysCache.get(key_) ?? key_;
|
|
433
|
+
const hash$4 = hash(key);
|
|
434
|
+
const bucket = self.buckets.get(hash$4);
|
|
435
435
|
if (bucket === void 0) return self;
|
|
436
436
|
for (let i = 0, len = bucket.length; i < len; i++) {
|
|
437
437
|
const bkey = bucket[i];
|
|
@@ -441,7 +441,7 @@ const remove$2 = dual(2, (self, key_) => {
|
|
|
441
441
|
break;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
if (bucket.length === 0) self.buckets.delete(hash$
|
|
444
|
+
if (bucket.length === 0) self.buckets.delete(hash$4);
|
|
445
445
|
return self;
|
|
446
446
|
});
|
|
447
447
|
const size = (self) => self.backing.size;
|
|
@@ -450,7 +450,7 @@ const forEach = dual(2, (self, f) => {
|
|
|
450
450
|
self.backing.forEach(f);
|
|
451
451
|
});
|
|
452
452
|
//#endregion
|
|
453
|
-
//#region node_modules/.pnpm/effect@
|
|
453
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/internal/rcRef.js
|
|
454
454
|
const TypeId$31 = "~effect/RcRef";
|
|
455
455
|
const stateEmpty = { _tag: "Empty" };
|
|
456
456
|
const stateClosed = { _tag: "Closed" };
|
|
@@ -479,65 +479,63 @@ var RcRefImpl = class {
|
|
|
479
479
|
const make$39 = (options) => withFiber((fiber) => {
|
|
480
480
|
const context = fiber.context;
|
|
481
481
|
const scope = get$3(context, Scope);
|
|
482
|
-
const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
|
|
482
|
+
const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== void 0 ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
|
|
483
483
|
return as(addFinalizerExit(scope, () => {
|
|
484
484
|
const close$1 = ref.state._tag === "Acquired" ? close(ref.state.scope, void_$1) : void_;
|
|
485
485
|
ref.state = stateClosed;
|
|
486
486
|
return close$1;
|
|
487
487
|
}), ref);
|
|
488
488
|
});
|
|
489
|
-
const getState = (self) =>
|
|
489
|
+
const getState = (self, restore) => {
|
|
490
490
|
switch (self.state._tag) {
|
|
491
491
|
case "Closed": return interrupt;
|
|
492
|
-
case "Acquired":
|
|
493
|
-
self.state
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
const scope = makeUnsafe$1();
|
|
497
|
-
return self.semaphore.withPermit(suspend(() => {
|
|
498
|
-
if (self.state._tag !== "Empty") return loop(restore);
|
|
499
|
-
return restore(provideContext(self.acquire, add(self.context, Scope, scope))).pipe(flatMap$1((value) => {
|
|
500
|
-
if (self.state._tag === "Closed") return interrupt;
|
|
501
|
-
const state = {
|
|
502
|
-
_tag: "Acquired",
|
|
503
|
-
value,
|
|
504
|
-
scope,
|
|
505
|
-
fiber: void 0,
|
|
506
|
-
refCount: 1,
|
|
507
|
-
invalidated: false
|
|
508
|
-
};
|
|
509
|
-
self.state = state;
|
|
510
|
-
return succeed$2(state);
|
|
511
|
-
}), onExit((exit) => isFailure$1(exit) ? close(scope, exit) : void_));
|
|
512
|
-
}));
|
|
492
|
+
case "Acquired": {
|
|
493
|
+
const state = self.state;
|
|
494
|
+
state.refCount++;
|
|
495
|
+
return state.fiber ? as(interrupt$2(state.fiber), state) : succeed$2(state);
|
|
513
496
|
}
|
|
497
|
+
case "Empty": return self.semaphore.withPermit(suspend(() => {
|
|
498
|
+
if (self.state._tag !== "Empty") return getState(self, restore);
|
|
499
|
+
const scope = makeUnsafe$1();
|
|
500
|
+
return restore(provideContext(self.acquire, add(self.context, Scope, scope))).pipe(flatMap$1((value) => {
|
|
501
|
+
if (self.state._tag === "Closed") return interrupt;
|
|
502
|
+
const state = {
|
|
503
|
+
_tag: "Acquired",
|
|
504
|
+
value,
|
|
505
|
+
scope,
|
|
506
|
+
fiber: void 0,
|
|
507
|
+
refCount: 1,
|
|
508
|
+
invalidated: false
|
|
509
|
+
};
|
|
510
|
+
self.state = state;
|
|
511
|
+
return succeed$2(state);
|
|
512
|
+
}), onExit((exit) => isFailure$1(exit) ? close(scope, exit) : void_));
|
|
513
|
+
}));
|
|
514
514
|
}
|
|
515
|
-
}
|
|
516
|
-
const get$1 =
|
|
515
|
+
};
|
|
516
|
+
const get$1 = (self_) => {
|
|
517
517
|
const self = self_;
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
518
|
+
return uninterruptibleMask((restore) => flatMap$1(scope, (scope) => flatMap$1(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
|
|
519
|
+
};
|
|
520
|
+
const release = (self, state) => {
|
|
521
|
+
state.refCount--;
|
|
522
|
+
if (state.refCount > 0) return void_;
|
|
523
|
+
const idleTimeToLive = self.idleTimeToLive;
|
|
524
|
+
if (idleTimeToLive === void 0 || state.invalidated) {
|
|
525
|
+
if (self.state === state) self.state = stateEmpty;
|
|
526
|
+
return close(state.scope, void_$1);
|
|
527
|
+
} else if (!isFinite(idleTimeToLive)) return void_;
|
|
528
|
+
state.fiber = uninterruptibleMask((restore) => flatMap$1(restore(sleep(idleTimeToLive)), () => {
|
|
529
|
+
if (self.state === state && state.refCount === 0) {
|
|
530
|
+
self.state = stateEmpty;
|
|
526
531
|
return close(state.scope, void_$1);
|
|
527
|
-
}
|
|
528
|
-
state.fiber = sleep(self.idleTimeToLive).pipe(flatMap$1(() => {
|
|
529
|
-
if (self.state === state && state.refCount === 0) {
|
|
530
|
-
self.state = stateEmpty;
|
|
531
|
-
return close(state.scope, void_$1);
|
|
532
|
-
}
|
|
533
|
-
return void_;
|
|
534
|
-
}), ensuring(sync(() => {
|
|
535
|
-
state.fiber = void 0;
|
|
536
|
-
})), runForkWith(self.context), runIn(self.scope));
|
|
532
|
+
}
|
|
537
533
|
return void_;
|
|
538
|
-
})
|
|
539
|
-
|
|
540
|
-
});
|
|
534
|
+
})).pipe(ensuring(sync(() => {
|
|
535
|
+
state.fiber = void 0;
|
|
536
|
+
})), runForkWith(self.context), runIn(self.scope));
|
|
537
|
+
return void_;
|
|
538
|
+
};
|
|
541
539
|
const invalidate$1 = (self_) => {
|
|
542
540
|
const self = self_;
|
|
543
541
|
return uninterruptible(suspend(() => {
|
|
@@ -551,12 +549,12 @@ const invalidate$1 = (self_) => {
|
|
|
551
549
|
}));
|
|
552
550
|
};
|
|
553
551
|
//#endregion
|
|
554
|
-
//#region node_modules/.pnpm/effect@
|
|
552
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/RcRef.js
|
|
555
553
|
const make$38 = make$39;
|
|
556
554
|
const get = get$1;
|
|
557
555
|
const invalidate = invalidate$1;
|
|
558
556
|
//#endregion
|
|
559
|
-
//#region node_modules/.pnpm/effect@
|
|
557
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/FileSystem.js
|
|
560
558
|
const TypeId$30 = "~effect/FileSystem";
|
|
561
559
|
const FileSystem = Service("effect/FileSystem");
|
|
562
560
|
const make$37 = (impl) => FileSystem.of({
|
|
@@ -608,11 +606,11 @@ const make$37 = (impl) => FileSystem.of({
|
|
|
608
606
|
const FileTypeId = "~effect/FileSystem/File";
|
|
609
607
|
var WatchBackend = class extends Service()("effect/FileSystem/WatchBackend") {};
|
|
610
608
|
//#endregion
|
|
611
|
-
//#region node_modules/.pnpm/effect@
|
|
609
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Path.js
|
|
612
610
|
const TypeId$29 = "~effect/Path";
|
|
613
611
|
const Path$3 = Service("effect/Path");
|
|
614
612
|
//#endregion
|
|
615
|
-
//#region node_modules/.pnpm/effect@
|
|
613
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/Headers.js
|
|
616
614
|
const TypeId$28 = Symbol.for("~effect/http/Headers");
|
|
617
615
|
const Proto$15 = Object.defineProperties(Object.create(null), {
|
|
618
616
|
[TypeId$28]: { value: TypeId$28 },
|
|
@@ -694,7 +692,30 @@ const CurrentRedactedNames = Reference("effect/Headers/CurrentRedactedNames", {
|
|
|
694
692
|
"x-api-key"
|
|
695
693
|
] });
|
|
696
694
|
//#endregion
|
|
697
|
-
//#region node_modules/.pnpm/effect@
|
|
695
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/encoding/Base64Url.js
|
|
696
|
+
const decode$3 = (str) => {
|
|
697
|
+
const stripped = str.replace(/[\n\r]/g, "");
|
|
698
|
+
const length = stripped.length;
|
|
699
|
+
if (length % 4 === 1) return fail$1(new EncodingError({
|
|
700
|
+
module: "Base64Url",
|
|
701
|
+
kind: "Decode",
|
|
702
|
+
input: stripped,
|
|
703
|
+
message: `Length should be a multiple of 4, but is ${length}`
|
|
704
|
+
}));
|
|
705
|
+
if (!/^[-_A-Z0-9]*?={0,2}$/i.test(stripped)) return fail$1(new EncodingError({
|
|
706
|
+
module: "Base64Url",
|
|
707
|
+
kind: "Decode",
|
|
708
|
+
input: stripped,
|
|
709
|
+
message: "Invalid input"
|
|
710
|
+
}));
|
|
711
|
+
let sanitized = length % 4 === 2 ? `${stripped}==` : length % 4 === 3 ? `${stripped}=` : stripped;
|
|
712
|
+
sanitized = sanitized.replace(/-/g, "+").replace(/_/g, "/");
|
|
713
|
+
return decode$4(sanitized);
|
|
714
|
+
};
|
|
715
|
+
const decodeString = (str) => map$6(decode$3(str), (_) => decoder.decode(_));
|
|
716
|
+
const decoder = new TextDecoder();
|
|
717
|
+
//#endregion
|
|
718
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Terminal.js
|
|
698
719
|
const TypeId$27 = "~effect/Terminal";
|
|
699
720
|
const QuitErrorTypeId = "~effect/Terminal/QuitError";
|
|
700
721
|
var QuitError = class extends Error$3("QuitError")({ _tag: tag("QuitError") }) {
|
|
@@ -707,7 +728,7 @@ const make$35 = (impl) => Terminal.of({
|
|
|
707
728
|
[TypeId$27]: TypeId$27
|
|
708
729
|
});
|
|
709
730
|
//#endregion
|
|
710
|
-
//#region node_modules/.pnpm/effect@
|
|
731
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/ansi.js
|
|
711
732
|
const ESC = "\x1B[";
|
|
712
733
|
const BEL = "\x07";
|
|
713
734
|
const SEP = ";";
|
|
@@ -755,7 +776,7 @@ const eraseLines = (rows) => {
|
|
|
755
776
|
return command;
|
|
756
777
|
};
|
|
757
778
|
//#endregion
|
|
758
|
-
//#region node_modules/.pnpm/effect@
|
|
779
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/Prompt.js
|
|
759
780
|
const TypeId$26 = "~effect/cli/Prompt";
|
|
760
781
|
const isPrompt$1 = (u) => hasProperty(u, TypeId$26);
|
|
761
782
|
const defaultTheme = {
|
|
@@ -790,7 +811,7 @@ const makeTheme = (options) => ({
|
|
|
790
811
|
...process.platform === "win32" ? windowsTheme : defaultTheme,
|
|
791
812
|
...options
|
|
792
813
|
});
|
|
793
|
-
const Theme = Reference("effect/
|
|
814
|
+
const Theme = Reference("effect/cli/Prompt/Theme", { defaultValue: makeTheme });
|
|
794
815
|
const getTheme = (options) => map$5(Theme, (theme) => ({
|
|
795
816
|
...theme,
|
|
796
817
|
...options.theme
|
|
@@ -1036,7 +1057,7 @@ const eraseText = (text, columns) => {
|
|
|
1036
1057
|
};
|
|
1037
1058
|
const lines = (prompt, columns) => {
|
|
1038
1059
|
const lines = prompt.split(NEWLINE_REGEXP);
|
|
1039
|
-
return columns === 0 ? lines.length : pipe(map$
|
|
1060
|
+
return columns === 0 ? lines.length : pipe(map$7(lines, (line) => Math.ceil(line.length / columns)), reduce(0, (left, right) => left + right));
|
|
1040
1061
|
};
|
|
1041
1062
|
const clearOutputWithError = (outputText, columns, errorText) => {
|
|
1042
1063
|
if (errorText !== void 0 && errorText.length > 0) return cursorDown(lines(errorText, columns)) + eraseText(`\n${errorText}`, columns) + eraseText(outputText, columns);
|
|
@@ -1107,7 +1128,7 @@ const renderDateError = (state, pointer, theme) => {
|
|
|
1107
1128
|
const errorLines = state.error.value.split(NEWLINE_REGEXP);
|
|
1108
1129
|
if (isReadonlyArrayNonEmpty(errorLines)) {
|
|
1109
1130
|
const prefix = annotateSymbol(pointer, theme.errorColor);
|
|
1110
|
-
const lines = map$
|
|
1131
|
+
const lines = map$7(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
|
|
1111
1132
|
return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
|
|
1112
1133
|
}
|
|
1113
1134
|
}
|
|
@@ -1512,7 +1533,7 @@ const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, options)
|
|
|
1512
1533
|
return match$3(message.split(NEWLINE_REGEXP), {
|
|
1513
1534
|
onEmpty: () => renderLine(""),
|
|
1514
1535
|
onNonEmpty: (promptLines) => {
|
|
1515
|
-
const lines = map$
|
|
1536
|
+
const lines = map$7(promptLines, (line) => annotate(line));
|
|
1516
1537
|
return renderLine(lines.join("\n"));
|
|
1517
1538
|
}
|
|
1518
1539
|
});
|
|
@@ -1546,7 +1567,7 @@ const renderNumberError = (state, pointer, theme, renderOptions) => {
|
|
|
1546
1567
|
onNonEmpty: (errorLines) => {
|
|
1547
1568
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
1548
1569
|
const prefix = annotateSymbol(pointer, theme.errorColor);
|
|
1549
|
-
const lines = map$
|
|
1570
|
+
const lines = map$7(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
|
|
1550
1571
|
return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
|
|
1551
1572
|
}
|
|
1552
1573
|
});
|
|
@@ -1823,7 +1844,7 @@ const renderTextError = (nextState, pointer, theme, renderOptions) => {
|
|
|
1823
1844
|
onNonEmpty: (errorLines) => {
|
|
1824
1845
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
1825
1846
|
const prefix = annotateSymbol(pointer, theme.errorColor);
|
|
1826
|
-
const lines = map$
|
|
1847
|
+
const lines = map$7(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
|
|
1827
1848
|
return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
|
|
1828
1849
|
}
|
|
1829
1850
|
});
|
|
@@ -2051,7 +2072,7 @@ const entriesToDisplay = (cursor, total, maxVisible) => {
|
|
|
2051
2072
|
};
|
|
2052
2073
|
};
|
|
2053
2074
|
//#endregion
|
|
2054
|
-
//#region node_modules/.pnpm/effect@
|
|
2075
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/HttpBody.js
|
|
2055
2076
|
const TypeId$25 = "~effect/http/HttpBody";
|
|
2056
2077
|
var Proto$14 = class {
|
|
2057
2078
|
[TypeId$25];
|
|
@@ -2113,7 +2134,7 @@ const text = (body, contentType) => {
|
|
|
2113
2134
|
const jsonUnsafe = (body, contentType) => text(JSON.stringify(body), contentType ?? "application/json");
|
|
2114
2135
|
const urlParams = (urlParams, contentType) => text(toString(fromInput$1(urlParams)), contentType ?? "application/x-www-form-urlencoded");
|
|
2115
2136
|
//#endregion
|
|
2116
|
-
//#region node_modules/.pnpm/effect@
|
|
2137
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/HttpClientError.js
|
|
2117
2138
|
const TypeId$24 = "~effect/http/HttpClientError";
|
|
2118
2139
|
const isHttpClientError = (u) => hasProperty(u, TypeId$24);
|
|
2119
2140
|
var HttpClientError = class extends TaggedError("HttpClientError") {
|
|
@@ -2189,7 +2210,7 @@ var EmptyBodyError = class extends TaggedError("EmptyBodyError") {
|
|
|
2189
2210
|
}
|
|
2190
2211
|
};
|
|
2191
2212
|
//#endregion
|
|
2192
|
-
//#region node_modules/.pnpm/effect@
|
|
2213
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/HttpMethod.js
|
|
2193
2214
|
const allShort = [
|
|
2194
2215
|
["GET", "get"],
|
|
2195
2216
|
["POST", "post"],
|
|
@@ -2198,17 +2219,18 @@ const allShort = [
|
|
|
2198
2219
|
["PATCH", "patch"],
|
|
2199
2220
|
["HEAD", "head"],
|
|
2200
2221
|
["OPTIONS", "options"],
|
|
2201
|
-
["TRACE", "trace"]
|
|
2222
|
+
["TRACE", "trace"],
|
|
2223
|
+
["QUERY", "query"]
|
|
2202
2224
|
];
|
|
2203
2225
|
//#endregion
|
|
2204
|
-
//#region node_modules/.pnpm/effect@
|
|
2226
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/internal/httpBody.js
|
|
2205
2227
|
const updateHeaders$1 = (headers, body) => {
|
|
2206
2228
|
if (body._tag === "Empty" || body._tag === "FormData") return remove$1(remove$1(headers, "content-type"), "content-length");
|
|
2207
2229
|
headers = body.contentType === void 0 ? remove$1(headers, "content-type") : set(headers, "content-type", body.contentType);
|
|
2208
2230
|
return body.contentLength === void 0 ? remove$1(headers, "content-length") : set(headers, "content-length", body.contentLength.toString());
|
|
2209
2231
|
};
|
|
2210
2232
|
//#endregion
|
|
2211
|
-
//#region node_modules/.pnpm/effect@
|
|
2233
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/Url.js
|
|
2212
2234
|
var UrlError = class extends TaggedError("UrlError") {};
|
|
2213
2235
|
const make$34 = (url, params, hash) => try_$1({
|
|
2214
2236
|
try: () => {
|
|
@@ -2226,7 +2248,7 @@ const baseUrl = () => {
|
|
|
2226
2248
|
if ("location" in globalThis && globalThis.location !== void 0 && globalThis.location.origin !== void 0 && globalThis.location.pathname !== void 0) return location.origin + location.pathname;
|
|
2227
2249
|
};
|
|
2228
2250
|
//#endregion
|
|
2229
|
-
//#region node_modules/.pnpm/effect@
|
|
2251
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/HttpClientRequest.js
|
|
2230
2252
|
const TypeId$23 = "~effect/http/HttpClientRequest";
|
|
2231
2253
|
const Proto$13 = {
|
|
2232
2254
|
[TypeId$23]: TypeId$23,
|
|
@@ -2314,7 +2336,7 @@ function toUrl(self) {
|
|
|
2314
2336
|
return none();
|
|
2315
2337
|
}
|
|
2316
2338
|
//#endregion
|
|
2317
|
-
//#region node_modules/.pnpm/effect@
|
|
2339
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/HttpIncomingMessage.js
|
|
2318
2340
|
const TypeId$22 = "~effect/http/HttpIncomingMessage";
|
|
2319
2341
|
const schemaBodyJson = (schema, options) => {
|
|
2320
2342
|
const decode = decodeEffect(toCodecJson(schema));
|
|
@@ -2340,7 +2362,7 @@ const inspect = (self, that) => {
|
|
|
2340
2362
|
return obj;
|
|
2341
2363
|
};
|
|
2342
2364
|
//#endregion
|
|
2343
|
-
//#region node_modules/.pnpm/effect@
|
|
2365
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/HttpClientResponse.js
|
|
2344
2366
|
const TypeId$21 = "~effect/http/HttpClientResponse";
|
|
2345
2367
|
const fromWeb = (request, source) => new WebHttpClientResponse(request, source);
|
|
2346
2368
|
const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? succeed$2(self) : fail$2(new HttpClientError({ reason: new StatusCodeError({
|
|
@@ -2455,7 +2477,7 @@ var WebHttpClientResponse = class extends Class {
|
|
|
2455
2477
|
}
|
|
2456
2478
|
};
|
|
2457
2479
|
//#endregion
|
|
2458
|
-
//#region node_modules/.pnpm/effect@
|
|
2480
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/HttpTraceContext.js
|
|
2459
2481
|
const toHeaders = (span) => fromRecordUnsafe({
|
|
2460
2482
|
b3: `${span.traceId}-${span.spanId}-${span.sampled ? "1" : "0"}${match$2(span.parent, {
|
|
2461
2483
|
onNone: () => "",
|
|
@@ -2464,7 +2486,7 @@ const toHeaders = (span) => fromRecordUnsafe({
|
|
|
2464
2486
|
traceparent: `00-${span.traceId}-${span.spanId}-${span.sampled ? "01" : "00"}`
|
|
2465
2487
|
});
|
|
2466
2488
|
//#endregion
|
|
2467
|
-
//#region node_modules/.pnpm/effect@
|
|
2489
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/http/HttpClient.js
|
|
2468
2490
|
const TypeId$20 = "~effect/http/HttpClient";
|
|
2469
2491
|
const isHttpClient = (u) => hasProperty(u, TypeId$20);
|
|
2470
2492
|
const HttpClient = Service("effect/HttpClient");
|
|
@@ -2703,7 +2725,7 @@ const isTransientError = (error) => isTimeoutError(error) || isTransientHttpErro
|
|
|
2703
2725
|
const isTransientHttpError = (error) => isHttpClientError(error) && (error.reason._tag === "TransportError" || error.reason._tag === "StatusCodeError" && isTransientResponse(error.reason.response));
|
|
2704
2726
|
const isTransientResponse = (response) => response.status === 408 || response.status === 429 || response.status === 500 || response.status === 502 || response.status === 503 || response.status === 504;
|
|
2705
2727
|
//#endregion
|
|
2706
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
2728
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodeSink.js
|
|
2707
2729
|
const fromWritable = (options) => fromChannel(mapDone(fromWritableChannel(options), (_) => [_]));
|
|
2708
2730
|
const fromWritableChannel = (options) => fromTransform$1((pull) => {
|
|
2709
2731
|
const writable = options.evaluate();
|
|
@@ -2751,7 +2773,7 @@ const pullIntoWritable = (options) => options.pull.pipe(flatMap$1((chunk) => {
|
|
|
2751
2773
|
});
|
|
2752
2774
|
})));
|
|
2753
2775
|
//#endregion
|
|
2754
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
2776
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodeStream.js
|
|
2755
2777
|
const fromReadable = (options) => fromChannel$1(fromReadableChannel(options));
|
|
2756
2778
|
const fromReadableChannel = (options) => fromTransform$1((_, scope) => readableToPullUnsafe({
|
|
2757
2779
|
scope,
|
|
@@ -2834,7 +2856,7 @@ const readableToPullUnsafe = (options) => {
|
|
|
2834
2856
|
const defaultOnError = (error) => new UnknownError$1(error);
|
|
2835
2857
|
const toMaxBytes = (maxBytes) => maxBytes === void 0 || maxBytes === Infinity ? void 0 : Number(fromInputUnsafe(maxBytes));
|
|
2836
2858
|
//#endregion
|
|
2837
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
2859
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodeHttpIncomingMessage.js
|
|
2838
2860
|
var NodeHttpIncomingMessage = class extends Class {
|
|
2839
2861
|
[TypeId$22];
|
|
2840
2862
|
source;
|
|
@@ -2895,7 +2917,7 @@ var NodeHttpIncomingMessage = class extends Class {
|
|
|
2895
2917
|
}
|
|
2896
2918
|
};
|
|
2897
2919
|
//#endregion
|
|
2898
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
2920
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodeHttpClient.js
|
|
2899
2921
|
function noopErrorHandler(_) {}
|
|
2900
2922
|
var UndiciResponse = class extends Class {
|
|
2901
2923
|
[TypeId$22];
|
|
@@ -3142,7 +3164,7 @@ var NodeHttpResponse = class extends NodeHttpIncomingMessage {
|
|
|
3142
3164
|
};
|
|
3143
3165
|
const layerNodeHttpNoAgent = layerMergedContext(makeNodeHttp);
|
|
3144
3166
|
//#endregion
|
|
3145
|
-
//#region node_modules/.pnpm/effect@
|
|
3167
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Console.js
|
|
3146
3168
|
const Console = ConsoleRef;
|
|
3147
3169
|
const consoleWith = (f) => withFiber$1((fiber) => f(fiber.getRef(Console)));
|
|
3148
3170
|
const error = (...args) => consoleWith((console) => sync$1(() => {
|
|
@@ -3152,7 +3174,7 @@ const log = (...args) => consoleWith((console) => sync$1(() => {
|
|
|
3152
3174
|
console.log(...args);
|
|
3153
3175
|
}));
|
|
3154
3176
|
//#endregion
|
|
3155
|
-
//#region node_modules/.pnpm/effect@
|
|
3177
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Runtime.js
|
|
3156
3178
|
const defaultTeardown = (exit, onExit) => {
|
|
3157
3179
|
if (isSuccess$1(exit)) return onExit(0);
|
|
3158
3180
|
if (hasInterruptsOnly(exit.cause)) return onExit(130);
|
|
@@ -3191,7 +3213,7 @@ const getErrorReported = (u) => {
|
|
|
3191
3213
|
return true;
|
|
3192
3214
|
};
|
|
3193
3215
|
//#endregion
|
|
3194
|
-
//#region node_modules/.pnpm/effect@
|
|
3216
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Stdio.js
|
|
3195
3217
|
const TypeId$19 = "~effect/Stdio";
|
|
3196
3218
|
const Stdio = Service(TypeId$19);
|
|
3197
3219
|
const make$31 = (options) => ({
|
|
@@ -3201,7 +3223,7 @@ const make$31 = (options) => ({
|
|
|
3201
3223
|
...options
|
|
3202
3224
|
});
|
|
3203
3225
|
//#endregion
|
|
3204
|
-
//#region node_modules/.pnpm/effect@
|
|
3226
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/CliOutput.js
|
|
3205
3227
|
const Formatter = Reference("effect/cli/CliOutput", { defaultValue: () => defaultFormatter() });
|
|
3206
3228
|
const escapeControlCharacters = (text) => text.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, (character) => `\\x${character.charCodeAt(0).toString(16).padStart(2, "0")}`);
|
|
3207
3229
|
const defaultFormatter = (options) => {
|
|
@@ -3376,7 +3398,7 @@ const formatHelpDocImpl = (doc, colors) => {
|
|
|
3376
3398
|
return sections.join("\n");
|
|
3377
3399
|
};
|
|
3378
3400
|
//#endregion
|
|
3379
|
-
//#region node_modules/.pnpm/effect@
|
|
3401
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/completions/bash.js
|
|
3380
3402
|
const escapeForBash = (s) => s.replace(/'/g, "'\\''");
|
|
3381
3403
|
const sanitizeFunctionName = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
3382
3404
|
const flagNamesForWordlist = (flag) => {
|
|
@@ -3635,7 +3657,7 @@ const generate$3 = (executableName, descriptor) => {
|
|
|
3635
3657
|
return lines.join("\n");
|
|
3636
3658
|
};
|
|
3637
3659
|
//#endregion
|
|
3638
|
-
//#region node_modules/.pnpm/effect@
|
|
3660
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/completions/fish.js
|
|
3639
3661
|
const escapeFishString = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
|
3640
3662
|
const escapeFishChoice = (s) => escapeFishString(s.replace(/[^A-Za-z0-9_.,/@%+-]/gu, "\\$&"));
|
|
3641
3663
|
const subcommandCondition = (parentPath, childSubcommandNames) => {
|
|
@@ -3768,7 +3790,7 @@ const generate$2 = (executableName, descriptor) => {
|
|
|
3768
3790
|
return lines.join("\n");
|
|
3769
3791
|
};
|
|
3770
3792
|
//#endregion
|
|
3771
|
-
//#region node_modules/.pnpm/effect@
|
|
3793
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/completions/zsh.js
|
|
3772
3794
|
const escapeZsh = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:");
|
|
3773
3795
|
const escapeZshChoice = (s) => s.replace(/[^A-Za-z0-9_.,/@%+-]/gu, "\\$&").replace(/'/g, "'\\''");
|
|
3774
3796
|
const sanitize = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
@@ -3904,7 +3926,7 @@ const generate$1 = (executableName, descriptor) => {
|
|
|
3904
3926
|
return lines.join("\n");
|
|
3905
3927
|
};
|
|
3906
3928
|
//#endregion
|
|
3907
|
-
//#region node_modules/.pnpm/effect@
|
|
3929
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/Completions.js
|
|
3908
3930
|
const generate = (executableName, shell, descriptor) => {
|
|
3909
3931
|
switch (shell) {
|
|
3910
3932
|
case "bash": return generate$3(executableName, descriptor);
|
|
@@ -3913,7 +3935,7 @@ const generate = (executableName, shell, descriptor) => {
|
|
|
3913
3935
|
}
|
|
3914
3936
|
};
|
|
3915
3937
|
//#endregion
|
|
3916
|
-
//#region node_modules/.pnpm/effect@
|
|
3938
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ConfigProvider.js
|
|
3917
3939
|
function makeValue(value) {
|
|
3918
3940
|
return {
|
|
3919
3941
|
_tag: "Value",
|
|
@@ -4000,7 +4022,7 @@ function trieNodeAt(root, path) {
|
|
|
4000
4022
|
return node;
|
|
4001
4023
|
}
|
|
4002
4024
|
//#endregion
|
|
4003
|
-
//#region node_modules/.pnpm/effect@
|
|
4025
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Config.js
|
|
4004
4026
|
const TypeId$18 = "~effect/Config";
|
|
4005
4027
|
var ConfigError = class {
|
|
4006
4028
|
_tag = "ConfigError";
|
|
@@ -4169,7 +4191,7 @@ function Redacted(name) {
|
|
|
4169
4191
|
return schema$1(Redacted$1(String$5), name);
|
|
4170
4192
|
}
|
|
4171
4193
|
//#endregion
|
|
4172
|
-
//#region node_modules/.pnpm/effect@
|
|
4194
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/CliError.js
|
|
4173
4195
|
const TypeId$17 = "~effect/cli/CliError";
|
|
4174
4196
|
const isCliError = (u) => hasProperty(u, TypeId$17);
|
|
4175
4197
|
var UnrecognizedOption = class extends TaggedError$1(`${TypeId$17}/UnrecognizedOption`)("UnrecognizedOption", {
|
|
@@ -4271,7 +4293,7 @@ var ShowHelp = class extends TaggedError$1(`${TypeId$17}/ShowHelp`)("ShowHelp",
|
|
|
4271
4293
|
}
|
|
4272
4294
|
};
|
|
4273
4295
|
//#endregion
|
|
4274
|
-
//#region node_modules/.pnpm/effect@
|
|
4296
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/encoding/Yaml.js
|
|
4275
4297
|
const hasOwn = Object.prototype.hasOwnProperty;
|
|
4276
4298
|
const setProperty = (record, key, value) => {
|
|
4277
4299
|
Object.defineProperty(record, key, {
|
|
@@ -4281,43 +4303,55 @@ const setProperty = (record, key, value) => {
|
|
|
4281
4303
|
value
|
|
4282
4304
|
});
|
|
4283
4305
|
};
|
|
4284
|
-
const
|
|
4285
|
-
let
|
|
4286
|
-
let escaped = false;
|
|
4287
|
-
for (let index = 0; index < input.length; index++) {
|
|
4306
|
+
const closingQuote = (input, quote, start) => {
|
|
4307
|
+
for (let index = start; index < input.length; index++) {
|
|
4288
4308
|
const character = input[index];
|
|
4289
|
-
if (quote === "\"")
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
else
|
|
4293
|
-
}
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
}
|
|
4299
|
-
return input.trimEnd();
|
|
4300
|
-
};
|
|
4301
|
-
const mappingSeparator = (input) => {
|
|
4302
|
-
let quote;
|
|
4303
|
-
let escaped = false;
|
|
4309
|
+
if (quote === "\"" && character === "\\") index++;
|
|
4310
|
+
else if (character === quote) {
|
|
4311
|
+
if (quote === "'" && input[index + 1] === quote) index++;
|
|
4312
|
+
else return index;
|
|
4313
|
+
}
|
|
4314
|
+
}
|
|
4315
|
+
return -1;
|
|
4316
|
+
};
|
|
4317
|
+
const findIndicator = (input, indicator) => {
|
|
4304
4318
|
let depth = 0;
|
|
4319
|
+
let tokenStart = true;
|
|
4305
4320
|
for (let index = 0; index < input.length; index++) {
|
|
4306
4321
|
const character = input[index];
|
|
4307
|
-
if (
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
} else if (
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
else if (
|
|
4322
|
+
if (tokenStart && (character === "'" || character === "\"")) {
|
|
4323
|
+
index = closingQuote(input, character, index + 1);
|
|
4324
|
+
if (index === -1) return -1;
|
|
4325
|
+
tokenStart = false;
|
|
4326
|
+
} else if (tokenStart && character === "&") while (index + 1 < input.length && !/[\s,[\]{}]/.test(input[index + 1])) index++;
|
|
4327
|
+
else if (character === "#" && (index === 0 || /\s/.test(input[index - 1]))) return indicator === "#" ? index : -1;
|
|
4328
|
+
else if (tokenStart && (character === "[" || character === "{")) depth++;
|
|
4329
|
+
else if (depth > 0 && (character === "]" || character === "}")) {
|
|
4330
|
+
depth--;
|
|
4331
|
+
tokenStart = false;
|
|
4332
|
+
} else if (depth > 0 && character === ",") tokenStart = true;
|
|
4333
|
+
else if (character === ":" && (depth > 0 || input[index + 1] === void 0 || /\s/.test(input[index + 1]))) {
|
|
4334
|
+
if (depth === 0 && indicator === ":") return index;
|
|
4335
|
+
tokenStart = true;
|
|
4336
|
+
} else if (tokenStart && character === "-" && /\s/.test(input[index + 1] ?? "")) continue;
|
|
4337
|
+
else if (!/\s/.test(character)) tokenStart = false;
|
|
4318
4338
|
}
|
|
4319
4339
|
return -1;
|
|
4320
4340
|
};
|
|
4341
|
+
const stripComment = (input) => {
|
|
4342
|
+
const index = findIndicator(input, "#");
|
|
4343
|
+
return index === -1 ? input : input.slice(0, index).trimEnd();
|
|
4344
|
+
};
|
|
4345
|
+
const mappingSeparator = (input) => findIndicator(input, ":");
|
|
4346
|
+
const isSequenceEntry = (text) => text === "-" || text.startsWith("- ");
|
|
4347
|
+
const foldLineBreak = (blankLines) => blankLines === 0 ? " " : "\n".repeat(blankLines);
|
|
4348
|
+
const endsWithEscape = (text) => /\\*$/.exec(text)[0].length % 2 === 1;
|
|
4349
|
+
const trimFoldedEnd = (line, quote) => {
|
|
4350
|
+
const trailing = /[ \t]+$/.exec(line);
|
|
4351
|
+
if (trailing === null) return line;
|
|
4352
|
+
const escaped = quote === "\"" && endsWithEscape(line.slice(0, trailing.index));
|
|
4353
|
+
return line.slice(0, trailing.index + (escaped ? 1 : 0));
|
|
4354
|
+
};
|
|
4321
4355
|
const parseDoubleQuoted = (input) => {
|
|
4322
4356
|
if (!input.endsWith("\"") || input.length < 2) throw new SyntaxError("Unterminated double-quoted YAML string");
|
|
4323
4357
|
let output = "";
|
|
@@ -4468,16 +4502,11 @@ var FlowParser = class {
|
|
|
4468
4502
|
return this.readUntil(/:/).trim();
|
|
4469
4503
|
}
|
|
4470
4504
|
readQuoted(quote) {
|
|
4471
|
-
const start = this.index
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
else if (quote === "\"" && character === "\\") escaped = true;
|
|
4477
|
-
else if (quote === "'" && character === quote && this.input[this.index] === quote) this.index++;
|
|
4478
|
-
else if (character === quote) return this.input.slice(start, this.index);
|
|
4479
|
-
}
|
|
4480
|
-
this.fail("Unterminated quoted scalar");
|
|
4505
|
+
const start = this.index;
|
|
4506
|
+
const end = closingQuote(this.input, quote, start + 1);
|
|
4507
|
+
if (end === -1) this.fail("Unterminated quoted scalar");
|
|
4508
|
+
this.index = end + 1;
|
|
4509
|
+
return this.input.slice(start, this.index);
|
|
4481
4510
|
}
|
|
4482
4511
|
readUntil(stop) {
|
|
4483
4512
|
const start = this.index;
|
|
@@ -4501,6 +4530,7 @@ var FlowParser = class {
|
|
|
4501
4530
|
var YamlParser = class {
|
|
4502
4531
|
lines;
|
|
4503
4532
|
index = 0;
|
|
4533
|
+
documentStarted = false;
|
|
4504
4534
|
anchors = new Map();
|
|
4505
4535
|
constructor(lines) {
|
|
4506
4536
|
this.lines = lines;
|
|
@@ -4508,23 +4538,23 @@ var YamlParser = class {
|
|
|
4508
4538
|
parse() {
|
|
4509
4539
|
this.skipIgnored();
|
|
4510
4540
|
if (this.index >= this.lines.length) return null;
|
|
4541
|
+
this.documentStarted = true;
|
|
4511
4542
|
const value = this.parseNode(this.lines[this.index].indent);
|
|
4512
4543
|
this.skipIgnored();
|
|
4513
4544
|
if (this.index < this.lines.length) this.fail(this.lines[this.index], "Unexpected content");
|
|
4514
4545
|
return value;
|
|
4515
4546
|
}
|
|
4516
|
-
parseNode(indent) {
|
|
4547
|
+
parseNode(indent, parentIndent = indent - 1) {
|
|
4517
4548
|
this.skipIgnored();
|
|
4518
4549
|
const line = this.lines[this.index];
|
|
4519
4550
|
if (line === void 0) return null;
|
|
4520
4551
|
if (line.indent !== indent) this.fail(line, `Expected indentation of ${indent} spaces`);
|
|
4521
|
-
if (line.text
|
|
4552
|
+
if (isSequenceEntry(line.text)) return this.parseSequence(indent);
|
|
4522
4553
|
if (mappingSeparator(line.text) !== -1) return this.parseMapping(indent);
|
|
4523
4554
|
this.index++;
|
|
4524
|
-
return this.
|
|
4555
|
+
return this.parseNodeValue(line.text, parentIndent);
|
|
4525
4556
|
}
|
|
4526
|
-
parseMapping(indent) {
|
|
4527
|
-
const output = {};
|
|
4557
|
+
parseMapping(indent, output = {}) {
|
|
4528
4558
|
while (true) {
|
|
4529
4559
|
this.skipIgnored();
|
|
4530
4560
|
const line = this.lines[this.index];
|
|
@@ -4538,8 +4568,8 @@ var YamlParser = class {
|
|
|
4538
4568
|
}
|
|
4539
4569
|
parseMappingEntry(output, text, separator, indent, line) {
|
|
4540
4570
|
const key = parseKey(text.slice(0, separator).trim());
|
|
4541
|
-
const rawValue = text.slice(separator + 1).
|
|
4542
|
-
const value = this.parseNodeValue(rawValue, indent);
|
|
4571
|
+
const rawValue = text.slice(separator + 1).trimStart();
|
|
4572
|
+
const value = this.parseNodeValue(rawValue, indent, true);
|
|
4543
4573
|
if (hasOwn.call(output, key)) this.fail(line, `Duplicate key '${key}'`);
|
|
4544
4574
|
setProperty(output, key, value);
|
|
4545
4575
|
}
|
|
@@ -4550,55 +4580,84 @@ var YamlParser = class {
|
|
|
4550
4580
|
const line = this.lines[this.index];
|
|
4551
4581
|
if (line === void 0 || line.indent < indent) return output;
|
|
4552
4582
|
if (line.indent > indent) this.fail(line, `Unexpected indentation of ${line.indent} spaces`);
|
|
4553
|
-
if (
|
|
4583
|
+
if (!isSequenceEntry(line.text)) return output;
|
|
4554
4584
|
this.index++;
|
|
4555
4585
|
const item = line.text.slice(1).trimStart();
|
|
4586
|
+
if (isSequenceEntry(item)) this.fail(line, "Compact nested block sequences are not supported");
|
|
4556
4587
|
const separator = mappingSeparator(item);
|
|
4557
|
-
if (separator === -1)
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
this.parseMappingEntry(mapping, item, separator, indent + 2, line);
|
|
4563
|
-
while (true) {
|
|
4564
|
-
this.skipIgnored();
|
|
4565
|
-
const continuation = this.lines[this.index];
|
|
4566
|
-
if (continuation === void 0 || continuation.indent <= indent) break;
|
|
4567
|
-
if (continuation.indent !== indent + 2) this.fail(continuation, `Expected indentation of ${indent + 2} spaces`);
|
|
4568
|
-
const nextSeparator = mappingSeparator(continuation.text);
|
|
4569
|
-
if (nextSeparator === -1) this.fail(continuation, "Expected a mapping entry");
|
|
4570
|
-
this.index++;
|
|
4571
|
-
this.parseMappingEntry(mapping, continuation.text, nextSeparator, indent + 2, continuation);
|
|
4588
|
+
if (separator === -1) output.push(this.parseNodeValue(item, indent));
|
|
4589
|
+
else {
|
|
4590
|
+
const mapping = {};
|
|
4591
|
+
this.parseMappingEntry(mapping, item, separator, indent + 2, line);
|
|
4592
|
+
output.push(this.parseMapping(indent + 2, mapping));
|
|
4572
4593
|
}
|
|
4573
|
-
output.push(mapping);
|
|
4574
4594
|
}
|
|
4575
4595
|
}
|
|
4576
|
-
parseNodeValue(rawValue, parentIndent) {
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
const
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
if (
|
|
4596
|
+
parseNodeValue(rawValue, parentIndent, allowIndentless = false) {
|
|
4597
|
+
const anchor = /^&([^\s,[\]{}]+)(?:\s+(.*))?$/.exec(rawValue);
|
|
4598
|
+
if (anchor === null) return this.parseValue(rawValue, parentIndent, allowIndentless);
|
|
4599
|
+
const value = this.parseValue(anchor[2] ?? "", parentIndent, allowIndentless);
|
|
4600
|
+
this.anchors.set(anchor[1], value);
|
|
4601
|
+
return value;
|
|
4602
|
+
}
|
|
4603
|
+
parseValue(value, parentIndent, allowIndentless) {
|
|
4604
|
+
const text = value.trimEnd();
|
|
4605
|
+
if (text.length === 0) {
|
|
4586
4606
|
this.skipIgnored();
|
|
4587
4607
|
const next = this.lines[this.index];
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
if (
|
|
4596
|
-
const name =
|
|
4608
|
+
if (next === void 0) return null;
|
|
4609
|
+
if (next.indent > parentIndent) return this.parseNode(next.indent, parentIndent);
|
|
4610
|
+
if (allowIndentless && next.indent === parentIndent && isSequenceEntry(next.text)) return this.parseSequence(parentIndent);
|
|
4611
|
+
return null;
|
|
4612
|
+
}
|
|
4613
|
+
if (/^[|>](?:[1-9]?[+-]?|[+-]?[1-9]?)$/.test(text)) return this.parseBlockScalar(text, parentIndent);
|
|
4614
|
+
if (value.startsWith("\"") || value.startsWith("'")) return this.parseQuotedValue(value, parentIndent);
|
|
4615
|
+
if (text.startsWith("*")) {
|
|
4616
|
+
const name = text.slice(1).trim();
|
|
4597
4617
|
if (!this.anchors.has(name)) throw new SyntaxError(`Unknown YAML alias '*${name}'`);
|
|
4598
4618
|
return this.anchors.get(name);
|
|
4599
4619
|
}
|
|
4600
|
-
if (
|
|
4601
|
-
return
|
|
4620
|
+
if (text.startsWith("[") || text.startsWith("{")) return new FlowParser(text, this.anchors).parse();
|
|
4621
|
+
return this.parsePlainValue(text, parentIndent);
|
|
4622
|
+
}
|
|
4623
|
+
parsePlainValue(value, parentIndent) {
|
|
4624
|
+
const first = this.lines[this.index - 1];
|
|
4625
|
+
if (/:(?:\s|$)/.test(value)) this.fail(first, "Invalid colon in plain scalar");
|
|
4626
|
+
let output = value;
|
|
4627
|
+
let terminated = findIndicator(first.raw, "#") !== -1;
|
|
4628
|
+
while (!terminated) {
|
|
4629
|
+
const blankLines = this.skipBlankLines();
|
|
4630
|
+
const next = this.lines[this.index];
|
|
4631
|
+
if (next === void 0 || next.indent <= parentIndent) break;
|
|
4632
|
+
const content = next.raw.slice(next.indent);
|
|
4633
|
+
const comment = content.search(/(?:^|[ \t])#/);
|
|
4634
|
+
const text = (comment === -1 ? content : content.slice(0, comment)).trimEnd();
|
|
4635
|
+
if (text.length === 0 || next.indent === 0 && /^(?:---|\.\.\.)(?:\s|$)/.test(text)) break;
|
|
4636
|
+
if (/:(?:\s|$)/.test(text)) this.fail(next, "Invalid colon in plain scalar");
|
|
4637
|
+
output += foldLineBreak(blankLines) + text;
|
|
4638
|
+
this.index++;
|
|
4639
|
+
terminated = comment !== -1;
|
|
4640
|
+
}
|
|
4641
|
+
return parseScalar(output);
|
|
4642
|
+
}
|
|
4643
|
+
parseQuotedValue(value, parentIndent) {
|
|
4644
|
+
const quote = value[0];
|
|
4645
|
+
let output = quote;
|
|
4646
|
+
let line = value.slice(1);
|
|
4647
|
+
while (true) {
|
|
4648
|
+
const end = closingQuote(line, quote, 0);
|
|
4649
|
+
if (end !== -1) {
|
|
4650
|
+
const rest = line.slice(end + 1);
|
|
4651
|
+
if (rest.trim().length > 0 && !/^[ \t]+#/.test(rest)) throw new SyntaxError("Unexpected content after quoted YAML scalar");
|
|
4652
|
+
return parseScalar(output + line.slice(0, end + 1));
|
|
4653
|
+
}
|
|
4654
|
+
if (quote === "\"" && endsWithEscape(line)) output += line.slice(0, -1);
|
|
4655
|
+
else output += trimFoldedEnd(line, quote) + foldLineBreak(this.skipBlankLines());
|
|
4656
|
+
const next = this.lines[this.index++];
|
|
4657
|
+
if (next === void 0) throw new SyntaxError("Unterminated quoted YAML scalar");
|
|
4658
|
+
if (next.raw.trim().length > 0 && next.indent <= parentIndent) this.fail(next, "Invalid quoted scalar indentation");
|
|
4659
|
+
line = next.raw.trimStart();
|
|
4660
|
+
}
|
|
4602
4661
|
}
|
|
4603
4662
|
parseBlockScalar(indicator, parentIndent) {
|
|
4604
4663
|
const style = indicator[0];
|
|
@@ -4644,13 +4703,23 @@ var YamlParser = class {
|
|
|
4644
4703
|
output = output.replace(/\n+$/, "");
|
|
4645
4704
|
return chomp === "strip" ? output : `${output}\n`;
|
|
4646
4705
|
}
|
|
4706
|
+
skipBlankLines() {
|
|
4707
|
+
const start = this.index;
|
|
4708
|
+
while (this.index < this.lines.length && this.lines[this.index].raw.trim().length === 0) this.index++;
|
|
4709
|
+
return this.index - start;
|
|
4710
|
+
}
|
|
4647
4711
|
skipIgnored() {
|
|
4648
4712
|
while (this.index < this.lines.length) {
|
|
4649
4713
|
const line = this.lines[this.index];
|
|
4650
|
-
|
|
4651
|
-
|
|
4714
|
+
const text = line.text.trimEnd();
|
|
4715
|
+
if (text.length === 0 || text.startsWith("%")) this.index++;
|
|
4716
|
+
else if (line.indent === 0 && text === "---") {
|
|
4717
|
+
if (this.documentStarted) this.fail(line, "Multiple YAML documents are not supported");
|
|
4718
|
+
this.documentStarted = true;
|
|
4652
4719
|
this.index++;
|
|
4653
|
-
|
|
4720
|
+
} else if (line.indent === 0 && text === "...") {
|
|
4721
|
+
this.index++;
|
|
4722
|
+
while (this.index < this.lines.length && this.lines[this.index].text.trimEnd().length === 0) this.index++;
|
|
4654
4723
|
if (this.index < this.lines.length) this.fail(this.lines[this.index], "Multiple YAML documents are not supported");
|
|
4655
4724
|
} else return;
|
|
4656
4725
|
}
|
|
@@ -4673,7 +4742,7 @@ const parse = (input) => {
|
|
|
4673
4742
|
return new YamlParser(lines).parse();
|
|
4674
4743
|
};
|
|
4675
4744
|
//#endregion
|
|
4676
|
-
//#region node_modules/.pnpm/effect@
|
|
4745
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/Primitive.js
|
|
4677
4746
|
const Proto$9 = { ["~effect/cli/Primitive"]: { _A: identity } };
|
|
4678
4747
|
const isTrueLiteral = is(TrueLiterals);
|
|
4679
4748
|
const isFalseLiteral = is(FalseLiterals);
|
|
@@ -4735,7 +4804,7 @@ const getTypeName = (primitive) => {
|
|
|
4735
4804
|
const getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.choiceKeys : void 0;
|
|
4736
4805
|
const getPathType = (primitive) => primitive._tag === "Path" ? primitive.pathType : void 0;
|
|
4737
4806
|
//#endregion
|
|
4738
|
-
//#region node_modules/.pnpm/effect@
|
|
4807
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/Param.js
|
|
4739
4808
|
const TypeId$16 = "~effect/cli/Param";
|
|
4740
4809
|
const argumentKind = "argument";
|
|
4741
4810
|
const flagKind = "flag";
|
|
@@ -5021,7 +5090,7 @@ const getParamMetadata = (param) => {
|
|
|
5021
5090
|
});
|
|
5022
5091
|
};
|
|
5023
5092
|
//#endregion
|
|
5024
|
-
//#region node_modules/.pnpm/effect@
|
|
5093
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/Flag.js
|
|
5025
5094
|
const String$1 = (name) => String$2(flagKind, name);
|
|
5026
5095
|
const Boolean = (name) => Boolean$1(flagKind, name);
|
|
5027
5096
|
const ChoiceWithValue = (name, choices) => ChoiceWithValue$1(flagKind, name, choices);
|
|
@@ -5037,7 +5106,7 @@ const withFallbackPrompt = dual(2, (self, prompt) => withFallbackPrompt$1(self,
|
|
|
5037
5106
|
const map$1 = dual(2, (self, f) => map$2(self, f));
|
|
5038
5107
|
const withSchema = dual(2, (self, schema) => withSchema$1(self, schema));
|
|
5039
5108
|
//#endregion
|
|
5040
|
-
//#region node_modules/.pnpm/effect@
|
|
5109
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/config.js
|
|
5041
5110
|
const ConfigInternalTypeId = "~effect/cli/Command/Config/Internal";
|
|
5042
5111
|
const parseConfig = (config) => {
|
|
5043
5112
|
const orderedParams = [];
|
|
@@ -5089,7 +5158,7 @@ const reconstructTree = (tree, results) => {
|
|
|
5089
5158
|
}
|
|
5090
5159
|
};
|
|
5091
5160
|
//#endregion
|
|
5092
|
-
//#region node_modules/.pnpm/effect@
|
|
5161
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/command.js
|
|
5093
5162
|
const TypeId$15 = "~effect/cli/Command";
|
|
5094
5163
|
const toImpl = (self) => self;
|
|
5095
5164
|
const Proto$7 = { ...Prototype({
|
|
@@ -5146,7 +5215,7 @@ const makeCommand = (options) => {
|
|
|
5146
5215
|
if (visible.length === 0) continue;
|
|
5147
5216
|
subcommandDocs.push({
|
|
5148
5217
|
group: group.group,
|
|
5149
|
-
commands: map$
|
|
5218
|
+
commands: map$7(visible, (subcommand) => ({
|
|
5150
5219
|
name: subcommand.name,
|
|
5151
5220
|
alias: subcommand.alias,
|
|
5152
5221
|
shortDescription: subcommand.shortDescription,
|
|
@@ -5248,7 +5317,7 @@ const checkForDuplicateFlags = (parent, subcommands, options) => {
|
|
|
5248
5317
|
}
|
|
5249
5318
|
};
|
|
5250
5319
|
//#endregion
|
|
5251
|
-
//#region node_modules/.pnpm/effect@
|
|
5320
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/completions/descriptor.js
|
|
5252
5321
|
const toFlagType = (single) => {
|
|
5253
5322
|
switch (single.primitiveType._tag) {
|
|
5254
5323
|
case "Boolean": return { _tag: "Boolean" };
|
|
@@ -5349,7 +5418,7 @@ const fromCommand = (cmd, inheritedFlags = []) => {
|
|
|
5349
5418
|
};
|
|
5350
5419
|
};
|
|
5351
5420
|
//#endregion
|
|
5352
|
-
//#region node_modules/.pnpm/effect@
|
|
5421
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/help.js
|
|
5353
5422
|
const dedupeGlobalFlags = (flags) => {
|
|
5354
5423
|
const seen = new Set();
|
|
5355
5424
|
const deduped = [];
|
|
@@ -5435,7 +5504,7 @@ const getHelpForCommandPath = (command, commandPath, builtIns) => gen(function*
|
|
|
5435
5504
|
};
|
|
5436
5505
|
});
|
|
5437
5506
|
//#endregion
|
|
5438
|
-
//#region node_modules/.pnpm/effect@
|
|
5507
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/GlobalFlag.js
|
|
5439
5508
|
const Action = (options) => ({
|
|
5440
5509
|
_tag: "Action",
|
|
5441
5510
|
flag: options.flag,
|
|
@@ -5443,7 +5512,7 @@ const Action = (options) => ({
|
|
|
5443
5512
|
});
|
|
5444
5513
|
const Setting = (id) => (options) => {
|
|
5445
5514
|
settingIdCounter += 1;
|
|
5446
|
-
const ref = Service(`effect/
|
|
5515
|
+
const ref = Service(`effect/cli/GlobalFlag/${id}/${settingIdCounter}`);
|
|
5447
5516
|
return Object.assign(ref, {
|
|
5448
5517
|
_tag: "Setting",
|
|
5449
5518
|
id,
|
|
@@ -5476,7 +5545,7 @@ const Completions = Action({
|
|
|
5476
5545
|
"zsh",
|
|
5477
5546
|
"fish",
|
|
5478
5547
|
"sh"
|
|
5479
|
-
]).pipe(optional, map$1((v) => map$
|
|
5548
|
+
]).pipe(optional, map$1((v) => map$8(v, (s) => s === "sh" ? "bash" : s)), withMetavar("<bash|zsh|fish|sh>"), withDescription$1("Print shell completion script")),
|
|
5480
5549
|
run: fnUntraced(function* (shell, { command }) {
|
|
5481
5550
|
if (isNone(shell)) return;
|
|
5482
5551
|
const descriptor = fromCommand(command);
|
|
@@ -5502,11 +5571,11 @@ const BuiltIns = [
|
|
|
5502
5571
|
LogLevel
|
|
5503
5572
|
];
|
|
5504
5573
|
//#endregion
|
|
5505
|
-
//#region node_modules/.pnpm/effect@
|
|
5506
|
-
var CliConfig = class extends Reference("effect/
|
|
5574
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/CliConfig.js
|
|
5575
|
+
var CliConfig = class extends Reference("effect/cli/CliConfig", { defaultValue: () => defaults }) {};
|
|
5507
5576
|
const defaults = { builtIns: BuiltIns };
|
|
5508
5577
|
//#endregion
|
|
5509
|
-
//#region node_modules/.pnpm/effect@
|
|
5578
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/lexer.js
|
|
5510
5579
|
function lex(argv) {
|
|
5511
5580
|
const endIndex = argv.indexOf("--");
|
|
5512
5581
|
if (endIndex === -1) return {
|
|
@@ -5564,7 +5633,7 @@ const lexTokens = (args) => {
|
|
|
5564
5633
|
return tokens;
|
|
5565
5634
|
};
|
|
5566
5635
|
//#endregion
|
|
5567
|
-
//#region node_modules/.pnpm/effect@
|
|
5636
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/auto-suggest.js
|
|
5568
5637
|
const levenshtein = (a, b) => {
|
|
5569
5638
|
const m = a.length;
|
|
5570
5639
|
const n = b.length;
|
|
@@ -5584,7 +5653,7 @@ const suggest = (input, candidates) => {
|
|
|
5584
5653
|
return distances.filter(([d]) => d === minDistance).map(([, c]) => c);
|
|
5585
5654
|
};
|
|
5586
5655
|
//#endregion
|
|
5587
|
-
//#region node_modules/.pnpm/effect@
|
|
5656
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/parser.js
|
|
5588
5657
|
const getCommandPath = (parsedInput) => match$2(parsedInput.subcommand, {
|
|
5589
5658
|
onNone: () => [],
|
|
5590
5659
|
onSome: (subcommand) => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]
|
|
@@ -6012,7 +6081,7 @@ const scanCommandLevel = (tokens, context) => {
|
|
|
6012
6081
|
return toLeafResult(state);
|
|
6013
6082
|
};
|
|
6014
6083
|
//#endregion
|
|
6015
|
-
//#region node_modules/.pnpm/effect@
|
|
6084
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/internal/wizard.js
|
|
6016
6085
|
const run$2 = fnUntraced(function* (command, options) {
|
|
6017
6086
|
const commandPath = options?.commandPath ?? [command.name];
|
|
6018
6087
|
const selected = getCommandAtPath(command, commandPath);
|
|
@@ -6182,7 +6251,7 @@ const wrapCommand = (commandLine) => {
|
|
|
6182
6251
|
};
|
|
6183
6252
|
const formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
|
|
6184
6253
|
//#endregion
|
|
6185
|
-
//#region node_modules/.pnpm/effect@
|
|
6254
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/cli/Command.js
|
|
6186
6255
|
const isCommand = (u) => hasProperty(u, TypeId$15);
|
|
6187
6256
|
const make$28 = (name, config, handler) => {
|
|
6188
6257
|
const parsedConfig = parseConfig(config ?? {});
|
|
@@ -6420,7 +6489,7 @@ const runWith = (command, config) => {
|
|
|
6420
6489
|
}, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$1(error) : fail$1(error), (error) => andThen(showHelp(command, error, config.renderErrors !== false), fail$2(error))), catchFilter((error) => config.renderErrors !== false && isCliError(error) && error._tag === "UserError" ? succeed$1(error) : fail$1(error), (error) => andThen(showUserError(error), fail$2(error))), catchFilter((e) => isQuitError(e) ? succeed$1(e) : fail$1(e), (_) => interrupt));
|
|
6421
6490
|
};
|
|
6422
6491
|
//#endregion
|
|
6423
|
-
//#region node_modules/.pnpm/effect@
|
|
6492
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Brand.js
|
|
6424
6493
|
function nominal() {
|
|
6425
6494
|
return Object.assign((input) => input, {
|
|
6426
6495
|
option: (input) => some(input),
|
|
@@ -6429,7 +6498,7 @@ function nominal() {
|
|
|
6429
6498
|
});
|
|
6430
6499
|
}
|
|
6431
6500
|
//#endregion
|
|
6432
|
-
//#region node_modules/.pnpm/effect@
|
|
6501
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/process/ChildProcessSpawner.js
|
|
6433
6502
|
const ExitCode = nominal();
|
|
6434
6503
|
const ProcessId = nominal();
|
|
6435
6504
|
const HandleTypeId = "~effect/process/ChildProcessSpawner/ChildProcessHandle";
|
|
@@ -6458,7 +6527,7 @@ const make$27 = (spawn) => {
|
|
|
6458
6527
|
};
|
|
6459
6528
|
var ChildProcessSpawner = class extends Service()("effect/process/ChildProcessSpawner") {};
|
|
6460
6529
|
//#endregion
|
|
6461
|
-
//#region node_modules/.pnpm/effect@
|
|
6530
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/process/ChildProcess.js
|
|
6462
6531
|
const TypeId$14 = "~effect/process/ChildProcess";
|
|
6463
6532
|
const Proto$6 = {
|
|
6464
6533
|
...Prototype({
|
|
@@ -6572,7 +6641,7 @@ const concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || pre
|
|
|
6572
6641
|
...nextTokens.slice(1)
|
|
6573
6642
|
];
|
|
6574
6643
|
//#endregion
|
|
6575
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
6644
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
|
|
6576
6645
|
const buildSpawnOptions = (options, base, platform) => {
|
|
6577
6646
|
const detached = options.detached ?? platform !== "win32";
|
|
6578
6647
|
return {
|
|
@@ -6583,7 +6652,7 @@ const buildSpawnOptions = (options, base, platform) => {
|
|
|
6583
6652
|
};
|
|
6584
6653
|
};
|
|
6585
6654
|
//#endregion
|
|
6586
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
6655
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/internal/utils.js
|
|
6587
6656
|
const handleErrnoException = (module, method) => (err, [path]) => {
|
|
6588
6657
|
let reason = "Unknown";
|
|
6589
6658
|
switch (err.code) {
|
|
@@ -6617,7 +6686,7 @@ const handleErrnoException = (module, method) => (err, [path]) => {
|
|
|
6617
6686
|
});
|
|
6618
6687
|
};
|
|
6619
6688
|
//#endregion
|
|
6620
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
6689
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
|
|
6621
6690
|
const toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
|
|
6622
6691
|
const toPlatformError = (method, error, command) => {
|
|
6623
6692
|
const { commands } = flattenCommand(command);
|
|
@@ -6905,6 +6974,7 @@ const make$25 = gen(function* () {
|
|
|
6905
6974
|
if (yield* isDone(exitSignal)) {
|
|
6906
6975
|
const [code] = yield* _await(exitSignal);
|
|
6907
6976
|
if (code !== 0 && isNotNull(code)) yield* ignore(killProcessGroup(cmd, childProcess, cmd.options.killSignal ?? "SIGTERM"));
|
|
6977
|
+
else if (isReferenced && process.platform !== "win32" && cmd.options.detached !== false) yield* ignore(terminateProcessGroup(cmd, childProcess, exitSignal, cmd.options));
|
|
6908
6978
|
return;
|
|
6909
6979
|
}
|
|
6910
6980
|
if (!isReferenced) return;
|
|
@@ -7041,7 +7111,29 @@ const flattenCommand = (command) => {
|
|
|
7041
7111
|
};
|
|
7042
7112
|
};
|
|
7043
7113
|
//#endregion
|
|
7044
|
-
//#region node_modules/.pnpm/effect@
|
|
7114
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/internal/ulid.js
|
|
7115
|
+
const maxTimestamp = 2 ** 48 - 1;
|
|
7116
|
+
const base32Chars = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
7117
|
+
const ulidString = (timestampMillis, bytes) => {
|
|
7118
|
+
if (bytes.length !== 10) throw new Error(`ULID randomness must be exactly 10 bytes, received ${bytes.length}`);
|
|
7119
|
+
const timestamp = Math.min(Math.max(0, Math.trunc(timestampMillis)), maxTimestamp);
|
|
7120
|
+
let out = "";
|
|
7121
|
+
for (let shift = 45; shift >= 0; shift -= 5) out += base32Chars[Math.floor(timestamp / 2 ** shift) & 31];
|
|
7122
|
+
let accumulator = 0;
|
|
7123
|
+
let bits = 0;
|
|
7124
|
+
for (const byte of bytes) {
|
|
7125
|
+
accumulator = accumulator << 8 | byte;
|
|
7126
|
+
bits += 8;
|
|
7127
|
+
while (bits >= 5) {
|
|
7128
|
+
bits -= 5;
|
|
7129
|
+
out += base32Chars[accumulator >>> bits & 31];
|
|
7130
|
+
}
|
|
7131
|
+
accumulator &= (1 << bits) - 1;
|
|
7132
|
+
}
|
|
7133
|
+
return out;
|
|
7134
|
+
};
|
|
7135
|
+
//#endregion
|
|
7136
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/internal/uuid.js
|
|
7045
7137
|
const hex = (byte) => byte.toString(16).padStart(2, "0");
|
|
7046
7138
|
const stringify = (bytes) => {
|
|
7047
7139
|
return [
|
|
@@ -7074,7 +7166,7 @@ function v7Bytes(timestampMillis, bytes = randomBytes()) {
|
|
|
7074
7166
|
}
|
|
7075
7167
|
const v7String = (timestampMillis, bytes) => stringify(bytes === void 0 ? v7Bytes(timestampMillis) : v7Bytes(timestampMillis, bytes));
|
|
7076
7168
|
//#endregion
|
|
7077
|
-
//#region node_modules/.pnpm/effect@
|
|
7169
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Crypto.js
|
|
7078
7170
|
const TypeId$13 = "~effect/Crypto";
|
|
7079
7171
|
const Crypto = Service("effect/Crypto");
|
|
7080
7172
|
const make$24 = (impl) => {
|
|
@@ -7119,7 +7211,8 @@ const make$24 = (impl) => {
|
|
|
7119
7211
|
return buffer;
|
|
7120
7212
|
}),
|
|
7121
7213
|
randomUUIDv4: sync(() => v4String(randomBytesUnsafe(16))),
|
|
7122
|
-
randomUUIDv7: clockWith((clock) => succeed$2(v7String(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(16))))
|
|
7214
|
+
randomUUIDv7: clockWith((clock) => succeed$2(v7String(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(16)))),
|
|
7215
|
+
randomULID: clockWith((clock) => succeed$2(ulidString(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(10))))
|
|
7123
7216
|
});
|
|
7124
7217
|
};
|
|
7125
7218
|
const validateSize = (method, size) => Number.isSafeInteger(size) && size >= 0 ? succeed$2(size) : fail$2(badArgument({
|
|
@@ -7128,7 +7221,7 @@ const validateSize = (method, size) => Number.isSafeInteger(size) && size >= 0 ?
|
|
|
7128
7221
|
description: "size must be a non-negative safe integer"
|
|
7129
7222
|
}));
|
|
7130
7223
|
//#endregion
|
|
7131
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7224
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
|
|
7132
7225
|
const toHashAlgorithm = (algorithm) => {
|
|
7133
7226
|
switch (algorithm) {
|
|
7134
7227
|
case "SHA-1": return "sha1";
|
|
@@ -7153,10 +7246,10 @@ const make$23 = make$24({
|
|
|
7153
7246
|
});
|
|
7154
7247
|
const layer$18 = succeed$4(Crypto, make$23);
|
|
7155
7248
|
//#endregion
|
|
7156
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7249
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodeCrypto.js
|
|
7157
7250
|
const layer$17 = layer$18;
|
|
7158
7251
|
//#endregion
|
|
7159
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7252
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
|
|
7160
7253
|
const handleBadArgument = (method) => (err) => badArgument({
|
|
7161
7254
|
module: "FileSystem",
|
|
7162
7255
|
method,
|
|
@@ -7520,10 +7613,10 @@ const makeFileSystem = map$5(serviceOption(WatchBackend), (backend) => make$37({
|
|
|
7520
7613
|
}));
|
|
7521
7614
|
const layer$16 = effect(FileSystem)(makeFileSystem);
|
|
7522
7615
|
//#endregion
|
|
7523
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7616
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodeFileSystem.js
|
|
7524
7617
|
const layer$15 = layer$16;
|
|
7525
7618
|
//#endregion
|
|
7526
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7619
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodePath.js
|
|
7527
7620
|
const fileUrlOps = (windows) => ({
|
|
7528
7621
|
fromFileUrl: (url) => try_({
|
|
7529
7622
|
try: () => NodeUrl.fileURLToPath(url, { windows }),
|
|
@@ -7558,10 +7651,10 @@ const layer$14 = succeed$4(Path$3)({
|
|
|
7558
7651
|
...fileUrlOps(void 0)
|
|
7559
7652
|
});
|
|
7560
7653
|
//#endregion
|
|
7561
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7654
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodePath.js
|
|
7562
7655
|
const layer$13 = layer$14;
|
|
7563
7656
|
//#endregion
|
|
7564
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7657
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
|
|
7565
7658
|
const layer$12 = succeed$4(Stdio, make$31({
|
|
7566
7659
|
args: sync(() => process.argv.slice(2)),
|
|
7567
7660
|
stdinIsTerminal: sync(() => process.stdin.isTTY === true),
|
|
@@ -7598,10 +7691,10 @@ const layer$12 = succeed$4(Stdio, make$31({
|
|
|
7598
7691
|
})
|
|
7599
7692
|
}));
|
|
7600
7693
|
//#endregion
|
|
7601
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7694
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodeStdio.js
|
|
7602
7695
|
const layer$11 = layer$12;
|
|
7603
7696
|
//#endregion
|
|
7604
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7697
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
|
|
7605
7698
|
const make$22 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
|
|
7606
7699
|
const stdin = process.stdin;
|
|
7607
7700
|
const stdout = process.stdout;
|
|
@@ -7705,13 +7798,13 @@ function defaultShouldQuit(input) {
|
|
|
7705
7798
|
return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
|
|
7706
7799
|
}
|
|
7707
7800
|
//#endregion
|
|
7708
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7801
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodeTerminal.js
|
|
7709
7802
|
const layer$9 = layer$10;
|
|
7710
7803
|
//#endregion
|
|
7711
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7804
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodeServices.js
|
|
7712
7805
|
const layer$8 = provideMerge(layer$19, mergeAll(layer$15, layer$17, layer$13, layer$11, layer$9));
|
|
7713
7806
|
//#endregion
|
|
7714
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7807
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_b4bf51a71e79135a2a2b14ed65451a87/node_modules/@effect/platform-node-shared/dist/NodeRuntime.js
|
|
7715
7808
|
const runMain$1 = makeRunMain(({ fiber, teardown }) => {
|
|
7716
7809
|
let receivedSignal = false;
|
|
7717
7810
|
fiber.addObserver((exit) => {
|
|
@@ -7729,10 +7822,10 @@ const runMain$1 = makeRunMain(({ fiber, teardown }) => {
|
|
|
7729
7822
|
process.on("SIGTERM", onSigint);
|
|
7730
7823
|
});
|
|
7731
7824
|
//#endregion
|
|
7732
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7825
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@b3032f0_81a81e4f3f1c43fe5d1cd41b38f48c6e/node_modules/@effect/platform-node/dist/NodeRuntime.js
|
|
7733
7826
|
const runMain = runMain$1;
|
|
7734
7827
|
//#endregion
|
|
7735
|
-
//#region node_modules/.pnpm/effect@
|
|
7828
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/socket/Socket.js
|
|
7736
7829
|
const TypeId$12 = "~effect/socket/Socket";
|
|
7737
7830
|
const Socket = Service("effect/socket/Socket");
|
|
7738
7831
|
const make$21 = (options) => Socket.of({
|
|
@@ -7992,7 +8085,7 @@ const layerWebSocketConstructor = succeed$4(WebSocketConstructor)((url, options)
|
|
|
7992
8085
|
return new (webSocketWithOptions())(url, { headers: options.headers });
|
|
7993
8086
|
});
|
|
7994
8087
|
//#endregion
|
|
7995
|
-
//#region node_modules/.pnpm/effect@
|
|
8088
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/Prompt.js
|
|
7996
8089
|
const ProviderOptions = Record(String$5, NullOr(Json));
|
|
7997
8090
|
const PartTypeId$1 = "~effect/ai/Prompt/Part";
|
|
7998
8091
|
const BasePart$1 = Struct({
|
|
@@ -8205,7 +8298,7 @@ const fromResponseParts = (parts) => {
|
|
|
8205
8298
|
break;
|
|
8206
8299
|
case "file":
|
|
8207
8300
|
assistantParts.push(makePart$1("file", {
|
|
8208
|
-
data:
|
|
8301
|
+
data: encode(part.data),
|
|
8209
8302
|
mediaType: part.mediaType,
|
|
8210
8303
|
options: part.metadata
|
|
8211
8304
|
}));
|
|
@@ -8252,11 +8345,11 @@ const setSystem = dual(2, (self, content) => {
|
|
|
8252
8345
|
return makePrompt(messages);
|
|
8253
8346
|
});
|
|
8254
8347
|
//#endregion
|
|
8255
|
-
//#region node_modules/.pnpm/effect@
|
|
8348
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/UndefinedOr.js
|
|
8256
8349
|
const map = dual(2, (self, f) => self === void 0 ? void 0 : f(self));
|
|
8257
8350
|
const match$1 = dual(2, (self, { onDefined, onUndefined }) => self === void 0 ? onUndefined() : onDefined(self));
|
|
8258
8351
|
//#endregion
|
|
8259
|
-
//#region node_modules/.pnpm/effect@
|
|
8352
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/persistence/KeyValueStore.js
|
|
8260
8353
|
const TypeId$10 = "~effect/persistence/KeyValueStore";
|
|
8261
8354
|
const ErrorTypeId = "~effect/persistence/KeyValueStore/KeyValueStoreError";
|
|
8262
8355
|
var KeyValueStoreError = class extends TaggedError("KeyValueStoreError") {
|
|
@@ -8373,7 +8466,7 @@ const toSchemaStore = (self, schema) => {
|
|
|
8373
8466
|
};
|
|
8374
8467
|
};
|
|
8375
8468
|
//#endregion
|
|
8376
|
-
//#region node_modules/.pnpm/effect@
|
|
8469
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/AiError.js
|
|
8377
8470
|
const HttpRequestDetails$1 = Struct({
|
|
8378
8471
|
method: Literals$2([
|
|
8379
8472
|
"GET",
|
|
@@ -8383,7 +8476,8 @@ const HttpRequestDetails$1 = Struct({
|
|
|
8383
8476
|
"DELETE",
|
|
8384
8477
|
"HEAD",
|
|
8385
8478
|
"OPTIONS",
|
|
8386
|
-
"TRACE"
|
|
8479
|
+
"TRACE",
|
|
8480
|
+
"QUERY"
|
|
8387
8481
|
]),
|
|
8388
8482
|
url: String$5,
|
|
8389
8483
|
urlParams: ArraySchema(Tuple([String$5, String$5])),
|
|
@@ -8810,7 +8904,7 @@ const reasonFromHttpStatus = (params) => {
|
|
|
8810
8904
|
}
|
|
8811
8905
|
};
|
|
8812
8906
|
//#endregion
|
|
8813
|
-
//#region node_modules/.pnpm/effect@
|
|
8907
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/FiberSet.js
|
|
8814
8908
|
const TypeId$8 = "~effect/FiberSet";
|
|
8815
8909
|
const isFiberSet = (u) => hasProperty(u, TypeId$8);
|
|
8816
8910
|
const Proto$4 = {
|
|
@@ -8889,12 +8983,12 @@ const awaitEmpty = (self) => whileLoop({
|
|
|
8889
8983
|
step: constVoid
|
|
8890
8984
|
});
|
|
8891
8985
|
//#endregion
|
|
8892
|
-
//#region node_modules/.pnpm/effect@
|
|
8986
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Random.js
|
|
8893
8987
|
const Random = Random$1;
|
|
8894
8988
|
const randomWith = (f) => withFiber((fiber) => succeed$2(f(fiber.getRef(Random))));
|
|
8895
8989
|
const next = randomWith((r) => r.nextDoubleUnsafe());
|
|
8896
8990
|
//#endregion
|
|
8897
|
-
//#region node_modules/.pnpm/effect@
|
|
8991
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/IdGenerator.js
|
|
8898
8992
|
var IdGenerator = class extends Service()("@effect/ai/IdGenerator") {};
|
|
8899
8993
|
const DEFAULT_ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
8900
8994
|
const DEFAULT_SEPARATOR = "_";
|
|
@@ -8914,7 +9008,7 @@ const makeGenerator = ({ alphabet = DEFAULT_ALPHABET, prefix, separator = DEFAUL
|
|
|
8914
9008
|
};
|
|
8915
9009
|
const defaultIdGenerator = { generateId: makeGenerator({ prefix: "id" }) };
|
|
8916
9010
|
//#endregion
|
|
8917
|
-
//#region node_modules/.pnpm/effect@
|
|
9011
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/Tool.js
|
|
8918
9012
|
const TypeId$7 = "~effect/ai/Tool";
|
|
8919
9013
|
const ProviderDefinedTypeId = "~effect/ai/Tool/ProviderDefined";
|
|
8920
9014
|
const DynamicTypeId = "~effect/ai/Tool/Dynamic";
|
|
@@ -9067,7 +9161,7 @@ function isEmptyParamsRecord(indexSignature) {
|
|
|
9067
9161
|
return indexSignature.parameter === string && isNever(indexSignature.type);
|
|
9068
9162
|
}
|
|
9069
9163
|
//#endregion
|
|
9070
|
-
//#region node_modules/.pnpm/effect@
|
|
9164
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/internal/structured-output.js
|
|
9071
9165
|
const REST_PROPERTY_NAME = "__rest__";
|
|
9072
9166
|
const TAIL_PROPERTY_PREFIX = "__tail_";
|
|
9073
9167
|
const RECORD_DESCRIPTION = "Object encoded as array of [key, value] pairs. Apply object constraints to the decoded object";
|
|
@@ -9253,7 +9347,7 @@ function recordCheck(check) {
|
|
|
9253
9347
|
if (!isJsonObject(payload)) return [];
|
|
9254
9348
|
switch (representation?.id) {
|
|
9255
9349
|
case "effect/schema/isMinProperties": return typeof payload.minProperties === "number" ? [withoutDescription(isMinLength(payload.minProperties))] : [];
|
|
9256
|
-
case "effect/schema/
|
|
9350
|
+
case "effect/schema/isBetweenProperties": return typeof payload.minimum === "number" ? [withoutDescription(isMinLength(payload.minimum))] : [];
|
|
9257
9351
|
default: return [];
|
|
9258
9352
|
}
|
|
9259
9353
|
}
|
|
@@ -9316,7 +9410,7 @@ function isJsonSchema(input) {
|
|
|
9316
9410
|
return typeof input === "object" && input !== null && !Array.isArray(input);
|
|
9317
9411
|
}
|
|
9318
9412
|
//#endregion
|
|
9319
|
-
//#region node_modules/.pnpm/effect@
|
|
9413
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/internal/codec-transformer.js
|
|
9320
9414
|
const makeDefaultCodecTransformer = (toJsonSchemaDocument) => {
|
|
9321
9415
|
return (codec) => {
|
|
9322
9416
|
const document = resolveTopLevelReference(toJsonSchemaDocument(codec));
|
|
@@ -9330,7 +9424,7 @@ const makeDefaultCodecTransformer = (toJsonSchemaDocument) => {
|
|
|
9330
9424
|
};
|
|
9331
9425
|
const defaultCodecTransformer$1 = makeDefaultCodecTransformer(toJsonSchemaDocument);
|
|
9332
9426
|
//#endregion
|
|
9333
|
-
//#region node_modules/.pnpm/effect@
|
|
9427
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/Response.js
|
|
9334
9428
|
const PartTypeId = "~effect/ai/Response/Part";
|
|
9335
9429
|
const Part = (toolkit) => {
|
|
9336
9430
|
const toolCalls = [];
|
|
@@ -9577,7 +9671,7 @@ const ErrorPart = Struct({
|
|
|
9577
9671
|
error: Unknown
|
|
9578
9672
|
}).annotate({ identifier: "ErrorPart" });
|
|
9579
9673
|
//#endregion
|
|
9580
|
-
//#region node_modules/.pnpm/effect@
|
|
9674
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/ResponseIdTracker.js
|
|
9581
9675
|
var ResponseIdTracker = class extends Service()("effect/ai/ResponseIdTracker") {};
|
|
9582
9676
|
const make$15 = sync(() => {
|
|
9583
9677
|
const sentParts = new Map();
|
|
@@ -9623,7 +9717,7 @@ const make$15 = sync(() => {
|
|
|
9623
9717
|
};
|
|
9624
9718
|
});
|
|
9625
9719
|
//#endregion
|
|
9626
|
-
//#region node_modules/.pnpm/effect@
|
|
9720
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/Telemetry.js
|
|
9627
9721
|
const addSpanAttributes = (keyPrefix, transformKey) => (span, attributes) => {
|
|
9628
9722
|
for (const [key, value] of Object.entries(attributes)) if (isNotNullish(value)) span.attribute(`${keyPrefix}.${transformKey(key)}`, value);
|
|
9629
9723
|
};
|
|
@@ -9643,8 +9737,10 @@ const addGenAIAnnotations$2 = dual(2, (span, options) => {
|
|
|
9643
9737
|
});
|
|
9644
9738
|
var CurrentSpanTransformer = class extends Service()("effect/ai/Telemetry/CurrentSpanTransformer") {};
|
|
9645
9739
|
//#endregion
|
|
9646
|
-
//#region node_modules/.pnpm/effect@
|
|
9740
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/Toolkit.js
|
|
9647
9741
|
const TypeId$6 = "~effect/ai/Toolkit";
|
|
9742
|
+
const FailureOrigin = Reference("effect/ai/Toolkit/FailureOrigin", { defaultValue: () => "result" });
|
|
9743
|
+
const failureCause = (error, origin) => annotate$1(fail$4(error), make$42(FailureOrigin, origin));
|
|
9648
9744
|
const Proto$2 = {
|
|
9649
9745
|
...Prototype({
|
|
9650
9746
|
label: "Toolkit",
|
|
@@ -9672,7 +9768,7 @@ const Proto$2 = {
|
|
|
9672
9768
|
};
|
|
9673
9769
|
return {
|
|
9674
9770
|
tools,
|
|
9675
|
-
handle: fnUntraced(function* (name, params, toolCallId) {
|
|
9771
|
+
handle: fnUntraced(function* (name, params, toolCallId, options) {
|
|
9676
9772
|
const tool = Object.hasOwn(tools, name) ? tools[name] : void 0;
|
|
9677
9773
|
yield* annotateCurrentSpan({
|
|
9678
9774
|
tool: name,
|
|
@@ -9696,7 +9792,7 @@ const Proto$2 = {
|
|
|
9696
9792
|
description: cause.message
|
|
9697
9793
|
})
|
|
9698
9794
|
})));
|
|
9699
|
-
const decodedParamsResult = yield* result(schemas.decodeParameters(params));
|
|
9795
|
+
const decodedParamsResult = yield* result(schemas.decodeParameters(params, options));
|
|
9700
9796
|
if (isFailure(decodedParamsResult)) {
|
|
9701
9797
|
const error = make$18({
|
|
9702
9798
|
module: "Toolkit",
|
|
@@ -9706,10 +9802,11 @@ const Proto$2 = {
|
|
|
9706
9802
|
description: decodedParamsResult.failure.message
|
|
9707
9803
|
})
|
|
9708
9804
|
});
|
|
9709
|
-
if (tool.failureMode === "error") return yield* error;
|
|
9805
|
+
if (tool.failureMode === "error") return yield* failCause(failureCause(error, "parameters"));
|
|
9710
9806
|
return fromEffect(map$5(encodeResult(error, true), (encodedResult) => ({
|
|
9711
9807
|
result: error,
|
|
9712
9808
|
isFailure: true,
|
|
9809
|
+
failureOrigin: "parameters",
|
|
9713
9810
|
preliminary: false,
|
|
9714
9811
|
encodedResult
|
|
9715
9812
|
})));
|
|
@@ -9748,9 +9845,11 @@ const Proto$2 = {
|
|
|
9748
9845
|
};
|
|
9749
9846
|
return fromQueue(queue).pipe(catch_$1((error) => {
|
|
9750
9847
|
const normalizedError = normalizeError(error);
|
|
9751
|
-
|
|
9848
|
+
const failureOrigin = isSchemaError(error) ? "result" : "handler";
|
|
9849
|
+
return tool.failureMode === "error" ? failCause$3(failureCause(normalizedError, failureOrigin)) : succeed$5({
|
|
9752
9850
|
result: normalizedError,
|
|
9753
9851
|
isFailure: true,
|
|
9852
|
+
failureOrigin,
|
|
9754
9853
|
preliminary: false
|
|
9755
9854
|
});
|
|
9756
9855
|
}), mapEffect$1(fnUntraced(function* (output) {
|
|
@@ -9806,8 +9905,8 @@ const merge = (...toolkits) => {
|
|
|
9806
9905
|
return makeProto$2(tools);
|
|
9807
9906
|
};
|
|
9808
9907
|
//#endregion
|
|
9809
|
-
//#region node_modules/.pnpm/effect@
|
|
9810
|
-
const LanguageModel = Service("effect/
|
|
9908
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/LanguageModel.js
|
|
9909
|
+
const LanguageModel = Service("effect/ai/LanguageModel");
|
|
9811
9910
|
const TypeId$5 = "~effect/ai/LanguageModel";
|
|
9812
9911
|
const defaultCodecTransformer = defaultCodecTransformer$1;
|
|
9813
9912
|
var GenerateTextResponse = class {
|
|
@@ -9973,7 +10072,8 @@ const make$13 = fnUntraced(function* (params) {
|
|
|
9973
10072
|
...requestOptions,
|
|
9974
10073
|
prompt: fallbackPrompt,
|
|
9975
10074
|
incrementalPrompt: void 0,
|
|
9976
|
-
previousResponseId: void 0
|
|
10075
|
+
previousResponseId: void 0,
|
|
10076
|
+
incrementalFallback: true
|
|
9977
10077
|
};
|
|
9978
10078
|
return requestOptions.incrementalPrompt ? params.generateText(requestOptions).pipe(catchReason("AiError", "InvalidRequestError", (_) => params.generateText(fallbackOptions))) : params.generateText(requestOptions);
|
|
9979
10079
|
};
|
|
@@ -10089,7 +10189,8 @@ const make$13 = fnUntraced(function* (params) {
|
|
|
10089
10189
|
...requestOptions,
|
|
10090
10190
|
prompt: fallbackPrompt,
|
|
10091
10191
|
incrementalPrompt: void 0,
|
|
10092
|
-
previousResponseId: void 0
|
|
10192
|
+
previousResponseId: void 0,
|
|
10193
|
+
incrementalFallback: true
|
|
10093
10194
|
};
|
|
10094
10195
|
let emitted = false;
|
|
10095
10196
|
return requestOptions.incrementalPrompt ? params.streamText(requestOptions).pipe(tap$1((part) => sync(() => {
|
|
@@ -10205,7 +10306,10 @@ const make$13 = fnUntraced(function* (params) {
|
|
|
10205
10306
|
id: part.id,
|
|
10206
10307
|
name: part.name,
|
|
10207
10308
|
providerExecuted: false,
|
|
10208
|
-
|
|
10309
|
+
result: result.result,
|
|
10310
|
+
encodedResult: result.encodedResult,
|
|
10311
|
+
isFailure: result.isFailure,
|
|
10312
|
+
preliminary: result.preliminary
|
|
10209
10313
|
});
|
|
10210
10314
|
return sync(() => {
|
|
10211
10315
|
offerUnsafe(queue, toolResultPart);
|
|
@@ -10346,7 +10450,10 @@ const executeApprovedToolCalls = (approvals, toolkit, concurrency) => {
|
|
|
10346
10450
|
return makePart("tool-result", {
|
|
10347
10451
|
id: approval.toolCallId,
|
|
10348
10452
|
name: toolCall.name,
|
|
10349
|
-
|
|
10453
|
+
result: terminalResult.result,
|
|
10454
|
+
encodedResult: terminalResult.encodedResult,
|
|
10455
|
+
isFailure: terminalResult.isFailure,
|
|
10456
|
+
preliminary: terminalResult.preliminary,
|
|
10350
10457
|
providerExecuted: false
|
|
10351
10458
|
});
|
|
10352
10459
|
});
|
|
@@ -10424,11 +10531,14 @@ const resolveToolCalls = (content, toolkit, messages, concurrency) => {
|
|
|
10424
10531
|
preliminary: false
|
|
10425
10532
|
}));
|
|
10426
10533
|
}
|
|
10427
|
-
if (approvedToolCallIds.has(toolCall.id)) return toolkit.handle(toolCall.name, toolCall.params, toolCall.id).pipe(unwrap$3, map$
|
|
10534
|
+
if (approvedToolCallIds.has(toolCall.id)) return toolkit.handle(toolCall.name, toolCall.params, toolCall.id).pipe(unwrap$3, map$9((result) => makePart("tool-result", {
|
|
10428
10535
|
id: toolCall.id,
|
|
10429
10536
|
name: toolCall.name,
|
|
10430
10537
|
providerExecuted: false,
|
|
10431
|
-
|
|
10538
|
+
result: result.result,
|
|
10539
|
+
encodedResult: result.encodedResult,
|
|
10540
|
+
isFailure: result.isFailure,
|
|
10541
|
+
preliminary: result.preliminary
|
|
10432
10542
|
})));
|
|
10433
10543
|
if (yield* isApprovalNeeded(tool, toolCall, messages)) {
|
|
10434
10544
|
const approvalId = yield* (yield* IdGenerator).generateId();
|
|
@@ -10437,11 +10547,14 @@ const resolveToolCalls = (content, toolkit, messages, concurrency) => {
|
|
|
10437
10547
|
toolCallId: toolCall.id
|
|
10438
10548
|
}));
|
|
10439
10549
|
}
|
|
10440
|
-
return toolkit.handle(toolCall.name, toolCall.params, toolCall.id).pipe(unwrap$3, map$
|
|
10550
|
+
return toolkit.handle(toolCall.name, toolCall.params, toolCall.id).pipe(unwrap$3, map$9((result) => makePart("tool-result", {
|
|
10441
10551
|
id: toolCall.id,
|
|
10442
10552
|
name: toolCall.name,
|
|
10443
10553
|
providerExecuted: false,
|
|
10444
|
-
|
|
10554
|
+
result: result.result,
|
|
10555
|
+
encodedResult: result.encodedResult,
|
|
10556
|
+
isFailure: result.isFailure,
|
|
10557
|
+
preliminary: result.preliminary
|
|
10445
10558
|
})));
|
|
10446
10559
|
}).pipe(unwrap$3));
|
|
10447
10560
|
return mergeAll$1(streams, { concurrency });
|
|
@@ -10816,7 +10929,7 @@ const partBytes = (part) => {
|
|
|
10816
10929
|
if (part.data instanceof Uint8Array) return some(part.data);
|
|
10817
10930
|
if (part.data instanceof URL) return none();
|
|
10818
10931
|
const base64 = part.data.startsWith("data:") ? part.data.slice(part.data.indexOf(",") + 1) : part.data;
|
|
10819
|
-
const decoded =
|
|
10932
|
+
const decoded = decode$4(base64);
|
|
10820
10933
|
return decoded._tag === "Success" ? some(decoded.success) : none();
|
|
10821
10934
|
};
|
|
10822
10935
|
const unsupportedImagePattern = /image[^.]{0,80}(only supported|not supported|unsupported|does not support|cannot|can't|invalid)|(only supported|not supported|unsupported|does not support|cannot|can't|invalid)[^.]{0,80}image/i;
|
|
@@ -11221,7 +11334,7 @@ const invalidParams = (message) => new RpcError({
|
|
|
11221
11334
|
});
|
|
11222
11335
|
const decodeBase64 = (data, what) => {
|
|
11223
11336
|
if (data.length > Math.ceil(20971520 / 3) * 4) return fail$2(invalidParams(`Image data in ${what} exceeds the ${maxInputBytes} byte input limit`));
|
|
11224
|
-
const decoded =
|
|
11337
|
+
const decoded = decode$4(data);
|
|
11225
11338
|
return decoded._tag === "Success" ? succeed$2(decoded.success) : fail$2(invalidParams(`Invalid base64 image data in ${what}`));
|
|
11226
11339
|
};
|
|
11227
11340
|
const fileNameOf = (uri) => {
|
|
@@ -11232,9 +11345,9 @@ const textContent = (text) => ({
|
|
|
11232
11345
|
type: "text",
|
|
11233
11346
|
text
|
|
11234
11347
|
});
|
|
11235
|
-
const imageContent = (part) => map$
|
|
11348
|
+
const imageContent = (part) => map$8(partBytes(part), (bytes) => ({
|
|
11236
11349
|
type: "image",
|
|
11237
|
-
data:
|
|
11350
|
+
data: encode(bytes),
|
|
11238
11351
|
mimeType: part.mediaType
|
|
11239
11352
|
}));
|
|
11240
11353
|
const historyUpdates = (history) => {
|
|
@@ -11628,7 +11741,7 @@ const make$12 = fnUntraced(function* (options) {
|
|
|
11628
11741
|
const runStdio = (options) => gen(function* () {
|
|
11629
11742
|
const stdio = yield* Stdio;
|
|
11630
11743
|
const output = yield* make$44();
|
|
11631
|
-
const writer = yield* fromQueue(output).pipe(map$
|
|
11744
|
+
const writer = yield* fromQueue(output).pipe(map$9((line) => `${line}\n`), run$4(stdio.stdout()), forkScoped);
|
|
11632
11745
|
const server = yield* make$12({
|
|
11633
11746
|
...options,
|
|
11634
11747
|
send: (message) => offer(output, JSON.stringify(message)).pipe(asVoid)
|
|
@@ -11982,7 +12095,7 @@ var ExaError = class extends TaggedError$1()("ExaError", { cause: Defect() }) {}
|
|
|
11982
12095
|
const layer$7 = effect(ExaSearch, gen(function* () {
|
|
11983
12096
|
const scope$4 = yield* scope;
|
|
11984
12097
|
const getClient = yield* cachedWithTTL(gen(function* () {
|
|
11985
|
-
const McpClient = yield* tryPromise(() => import("./McpClient-
|
|
12098
|
+
const McpClient = yield* tryPromise(() => import("./McpClient-DP4jlaD1.mjs"));
|
|
11986
12099
|
const context = yield* buildWithScope(McpClient.layer, scope$4);
|
|
11987
12100
|
return get$3(context, McpClient.McpClient);
|
|
11988
12101
|
}), (exit) => isSuccess$1(exit) ? infinity : zero);
|
|
@@ -12428,7 +12541,7 @@ ${prompt}`);
|
|
|
12428
12541
|
}));
|
|
12429
12542
|
const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$7, layer$6]));
|
|
12430
12543
|
const AgentToolHandlersTest = AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
|
|
12431
|
-
var ApplyPatchError = class extends TaggedClass("ApplyPatchError") {};
|
|
12544
|
+
var ApplyPatchError = class extends TaggedClass$1("ApplyPatchError") {};
|
|
12432
12545
|
//#endregion
|
|
12433
12546
|
//#region src/TypeBuilder.ts
|
|
12434
12547
|
const resolveDocumentation = resolveAt("documentation");
|
|
@@ -12752,6 +12865,7 @@ const discover = fnUntraced(function* (options) {
|
|
|
12752
12865
|
const entries = yield* fs.readDirectory(skillsDir).pipe(orElseSucceed(() => []));
|
|
12753
12866
|
entries.sort();
|
|
12754
12867
|
for (const entry of entries) {
|
|
12868
|
+
if (!(yield* fs.readDirectory(path.join(skillsDir, entry)).pipe(orElseSucceed(() => []))).includes("SKILL.md")) continue;
|
|
12755
12869
|
const location = path.join(skillsDir, entry, "SKILL.md");
|
|
12756
12870
|
const content = yield* option$1(fs.stat(location).pipe(filterOrFail((info) => info.type === "File"), andThen(() => fs.readFileString(location))));
|
|
12757
12871
|
if (isNone(content)) continue;
|
|
@@ -12811,7 +12925,7 @@ const renderLocation = (location) => {
|
|
|
12811
12925
|
return encoded.slice(1, -1) === location ? location : encoded;
|
|
12812
12926
|
};
|
|
12813
12927
|
//#endregion
|
|
12814
|
-
//#region node_modules/.pnpm/effect@
|
|
12928
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/workers/Transferable.js
|
|
12815
12929
|
var Collector = class extends Service()("effect/workers/Transferable/Collector") {};
|
|
12816
12930
|
const makeCollectorUnsafe = () => {
|
|
12817
12931
|
let tranferables = [];
|
|
@@ -12834,10 +12948,10 @@ const makeCollectorUnsafe = () => {
|
|
|
12834
12948
|
});
|
|
12835
12949
|
};
|
|
12836
12950
|
//#endregion
|
|
12837
|
-
//#region node_modules/.pnpm/effect@
|
|
12951
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/PrimaryKey.js
|
|
12838
12952
|
const symbol = "~effect/PrimaryKey";
|
|
12839
12953
|
//#endregion
|
|
12840
|
-
//#region node_modules/.pnpm/effect@
|
|
12954
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/rpc/RpcSchema.js
|
|
12841
12955
|
const StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
|
|
12842
12956
|
function isStreamSchema(schema) {
|
|
12843
12957
|
return hasProperty(schema, StreamSchemaTypeId);
|
|
@@ -12864,7 +12978,7 @@ var ClientAbort = class extends Service()("effect/rpc/RpcSchema/ClientAbort") {
|
|
|
12864
12978
|
}));
|
|
12865
12979
|
};
|
|
12866
12980
|
//#endregion
|
|
12867
|
-
//#region node_modules/.pnpm/effect@
|
|
12981
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/rpc/Rpc.js
|
|
12868
12982
|
const TypeId$4 = "~effect/rpc/Rpc";
|
|
12869
12983
|
const Proto$1 = {
|
|
12870
12984
|
[TypeId$4]: TypeId$4,
|
|
@@ -12992,7 +13106,7 @@ const exitSchema = (self) => {
|
|
|
12992
13106
|
const WrapperTypeId = "~effect/rpc/Rpc/Wrapper";
|
|
12993
13107
|
const isWrapper = (u) => WrapperTypeId in u;
|
|
12994
13108
|
//#endregion
|
|
12995
|
-
//#region node_modules/.pnpm/effect@
|
|
13109
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/rpc/RpcMessage.js
|
|
12996
13110
|
const RequestId = (id) => id;
|
|
12997
13111
|
const RequestIdSchema = Union([String$5, Number$2]);
|
|
12998
13112
|
const RequestEncodedSchema = Struct({
|
|
@@ -13035,7 +13149,7 @@ const EncodedSchema = Union([
|
|
|
13035
13149
|
Struct({ _tag: tag("Pong") })
|
|
13036
13150
|
]);
|
|
13037
13151
|
//#endregion
|
|
13038
|
-
//#region node_modules/.pnpm/effect@
|
|
13152
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/rpc/Utils.js
|
|
13039
13153
|
const withRunClient = (f) => suspend(() => {
|
|
13040
13154
|
const clientIds = new Set();
|
|
13041
13155
|
const clientBuffers = new Map();
|
|
@@ -13074,7 +13188,7 @@ const withRunClient = (f) => suspend(() => {
|
|
|
13074
13188
|
}));
|
|
13075
13189
|
});
|
|
13076
13190
|
//#endregion
|
|
13077
|
-
//#region node_modules/.pnpm/effect@
|
|
13191
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/rpc/RpcClient.js
|
|
13078
13192
|
let requestIdCounter = 0;
|
|
13079
13193
|
const makeNoSerialization = fnUntraced(function* (group, options) {
|
|
13080
13194
|
const spanPrefix = options?.spanPrefix ?? "RpcClient";
|
|
@@ -13188,7 +13302,7 @@ const makeNoSerialization = fnUntraced(function* (group, options) {
|
|
|
13188
13302
|
sampled: span.sampled
|
|
13189
13303
|
} : {},
|
|
13190
13304
|
headers: merge$1(fiber.getRef(CurrentHeaders), headers)
|
|
13191
|
-
}).pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity,
|
|
13305
|
+
}).pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity, onError((cause) => failCause$2(queue, cause)), interruptible, forkIn(scope, { startImmediately: true }));
|
|
13192
13306
|
return queue;
|
|
13193
13307
|
});
|
|
13194
13308
|
const getRpcClientMiddleware = (rpc) => {
|
|
@@ -13386,7 +13500,7 @@ const makeRpcSchemas = (codecFor) => {
|
|
|
13386
13500
|
if (entry !== void 0) return entry;
|
|
13387
13501
|
const streamSchemas = getStreamSchemas(rpc.successSchema);
|
|
13388
13502
|
entry = {
|
|
13389
|
-
decodeChunk: map$
|
|
13503
|
+
decodeChunk: map$8(streamSchemas, (streamSchemas) => decodeUnknownEffect$1(codecFor(NonEmptyArray(streamSchemas.success)))),
|
|
13390
13504
|
encodePayload: encodeEffect$1(codecFor(rpc.payloadSchema)),
|
|
13391
13505
|
decodeExit: decodeUnknownEffect$1(codecFor(exitSchema(rpc)))
|
|
13392
13506
|
};
|
|
@@ -13399,7 +13513,7 @@ var Protocol = class extends Service()("effect/rpc/RpcClient/Protocol") {
|
|
|
13399
13513
|
static make = withRunClient;
|
|
13400
13514
|
};
|
|
13401
13515
|
//#endregion
|
|
13402
|
-
//#region node_modules/.pnpm/effect@
|
|
13516
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/rpc/RpcGroup.js
|
|
13403
13517
|
const RpcGroupProto = {
|
|
13404
13518
|
add(...rpcs) {
|
|
13405
13519
|
const requests = new Map(this.requests);
|
|
@@ -14407,13 +14521,13 @@ var QueueWriteStream = class extends Writable {
|
|
|
14407
14521
|
}
|
|
14408
14522
|
};
|
|
14409
14523
|
//#endregion
|
|
14410
|
-
//#region node_modules/.pnpm/effect@
|
|
14411
|
-
const decode$1 = (schema) => () => {
|
|
14412
|
-
const decode = decodeEffect(NonEmptyArray(schema));
|
|
14524
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ChannelSchema.js
|
|
14525
|
+
const decode$1 = (schema, options) => () => {
|
|
14526
|
+
const decode = decodeEffect(NonEmptyArray(schema), options);
|
|
14413
14527
|
return fromTransform$1((upstream, _scope) => succeed$2(flatMap$1(upstream, (chunk) => decode(chunk))));
|
|
14414
14528
|
};
|
|
14415
14529
|
//#endregion
|
|
14416
|
-
//#region node_modules/.pnpm/effect@
|
|
14530
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/encoding/Sse.js
|
|
14417
14531
|
const SseErrorTypeId = "~effect/encoding/Sse/SseError";
|
|
14418
14532
|
var EventTooLarge = class extends TaggedError("EventTooLarge") {
|
|
14419
14533
|
get message() {
|
|
@@ -14455,7 +14569,7 @@ const decodeDataSchema = (schema, options) => {
|
|
|
14455
14569
|
...EventEncoded.fields,
|
|
14456
14570
|
data: fromJsonString(schema)
|
|
14457
14571
|
});
|
|
14458
|
-
return pipeTo(decode(options), map$
|
|
14572
|
+
return pipeTo(decode(options), map$10(decode$1(eventSchema)(), map$7((event) => ({
|
|
14459
14573
|
...event,
|
|
14460
14574
|
id: event.id
|
|
14461
14575
|
}))));
|
|
@@ -14574,7 +14688,7 @@ const Event = Struct({
|
|
|
14574
14688
|
data: String$5
|
|
14575
14689
|
});
|
|
14576
14690
|
const RetryTypeId = "~effect/encoding/Sse/Retry";
|
|
14577
|
-
var Retry = class Retry extends TaggedClass("Retry") {
|
|
14691
|
+
var Retry = class Retry extends TaggedClass$1("Retry") {
|
|
14578
14692
|
[RetryTypeId] = RetryTypeId;
|
|
14579
14693
|
static is(u) {
|
|
14580
14694
|
return hasProperty(u, RetryTypeId);
|
|
@@ -14584,7 +14698,7 @@ var Retry = class Retry extends TaggedClass("Retry") {
|
|
|
14584
14698
|
}
|
|
14585
14699
|
};
|
|
14586
14700
|
//#endregion
|
|
14587
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
14701
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/Generated.js
|
|
14588
14702
|
const AdminApiKey = Struct({
|
|
14589
14703
|
"object": Literal("organization.admin_api_key").annotate({ "description": "The object type, which is always `organization.admin_api_key`" }),
|
|
14590
14704
|
"id": String$5.annotate({ "description": "The identifier, which can be referenced in API endpoints" }),
|
|
@@ -18629,7 +18743,7 @@ const InputItem$1 = Union([
|
|
|
18629
18743
|
"title": "Search queries",
|
|
18630
18744
|
"description": "The search queries.\n"
|
|
18631
18745
|
})),
|
|
18632
|
-
"sources": optionalKey(ArraySchema(Struct({
|
|
18746
|
+
"sources": optionalKey(ArraySchema(Union([Struct({
|
|
18633
18747
|
"type": Literal("url").annotate({ "description": "The type of source. Always `url`.\n" }),
|
|
18634
18748
|
"url": String$5.annotate({
|
|
18635
18749
|
"description": "The URL of the source.\n",
|
|
@@ -18638,7 +18752,13 @@ const InputItem$1 = Union([
|
|
|
18638
18752
|
}).annotate({
|
|
18639
18753
|
"title": "Web search source",
|
|
18640
18754
|
"description": "A source used in the search.\n"
|
|
18641
|
-
})
|
|
18755
|
+
}), Struct({
|
|
18756
|
+
"type": Literal("api").annotate({ "description": "The type of source. Always `api`.\n" }),
|
|
18757
|
+
"name": String$5.annotate({ "description": "The name of the API source, such as `oai-weather`, `oai-sports`, or `oai-finance`.\n" })
|
|
18758
|
+
}).annotate({
|
|
18759
|
+
"title": "Web search API source",
|
|
18760
|
+
"description": "An API source used in the search.\n"
|
|
18761
|
+
})])).annotate({
|
|
18642
18762
|
"title": "Web search sources",
|
|
18643
18763
|
"description": "The sources used in the search.\n"
|
|
18644
18764
|
}))
|
|
@@ -19782,7 +19902,7 @@ const ListSkillVersionsParams = Struct({
|
|
|
19782
19902
|
});
|
|
19783
19903
|
var OpenAiClientErrorImpl = class extends Error$2 {};
|
|
19784
19904
|
//#endregion
|
|
19785
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
19905
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/internal/errors.js
|
|
19786
19906
|
const OpenAiErrorBody$1 = Struct({ error: Struct({
|
|
19787
19907
|
message: String$5,
|
|
19788
19908
|
type: optional$2(NullOr(String$5)),
|
|
@@ -19891,11 +20011,11 @@ const parseRateLimitHeaders$1 = (headers) => {
|
|
|
19891
20011
|
const retryAfterRaw = headers["retry-after"];
|
|
19892
20012
|
let retryAfter;
|
|
19893
20013
|
if (isNotUndefined(retryAfterRaw)) {
|
|
19894
|
-
const parsed = parse$
|
|
20014
|
+
const parsed = parse$1(retryAfterRaw);
|
|
19895
20015
|
if (isSome(parsed)) retryAfter = seconds(parsed.value);
|
|
19896
20016
|
}
|
|
19897
20017
|
const remainingRaw = headers["x-ratelimit-remaining-requests"];
|
|
19898
|
-
const remaining = isNotUndefined(remainingRaw) ? getOrNull(parse$
|
|
20018
|
+
const remaining = isNotUndefined(remainingRaw) ? getOrNull(parse$1(remainingRaw)) : null;
|
|
19899
20019
|
return {
|
|
19900
20020
|
retryAfter,
|
|
19901
20021
|
limit: headers["x-ratelimit-limit-requests"] ?? null,
|
|
@@ -19992,12 +20112,12 @@ const mapStatusCodeToReason$1 = ({ status, headers, message, metadata, http }) =
|
|
|
19992
20112
|
}
|
|
19993
20113
|
};
|
|
19994
20114
|
//#endregion
|
|
19995
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
20115
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/OpenAiConfig.js
|
|
19996
20116
|
var OpenAiConfig$1 = class OpenAiConfig$1 extends Service()("@effect/ai-openai/OpenAiConfig") {
|
|
19997
20117
|
static getOrUndefined = map$5(context(), getOrUndefined$1(OpenAiConfig$1));
|
|
19998
20118
|
};
|
|
19999
20119
|
//#endregion
|
|
20000
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
20120
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/OpenAiSchema.js
|
|
20001
20121
|
const UnknownRecord = Record(String$5, Unknown);
|
|
20002
20122
|
const JsonObject = Record(String$5, Unknown);
|
|
20003
20123
|
const MessageRole = Literals$2([
|
|
@@ -20197,6 +20317,44 @@ const RequestMessageItem = Struct({
|
|
|
20197
20317
|
status: optionalKey(MessageStatus),
|
|
20198
20318
|
content: Union([String$5, ArraySchema(InputContent)])
|
|
20199
20319
|
});
|
|
20320
|
+
const InputCodeInterpreterCall = Struct({
|
|
20321
|
+
id: String$5,
|
|
20322
|
+
type: Literal("code_interpreter_call"),
|
|
20323
|
+
code: optionalKey(NullOr(String$5)),
|
|
20324
|
+
container_id: String$5,
|
|
20325
|
+
outputs: optionalKey(NullOr(ArraySchema(Unknown))),
|
|
20326
|
+
status: optionalKey(Literals$2([
|
|
20327
|
+
"in_progress",
|
|
20328
|
+
"completed",
|
|
20329
|
+
"incomplete",
|
|
20330
|
+
"interpreting",
|
|
20331
|
+
"failed"
|
|
20332
|
+
]))
|
|
20333
|
+
});
|
|
20334
|
+
const InputFileSearchCall = Struct({
|
|
20335
|
+
id: String$5,
|
|
20336
|
+
type: Literal("file_search_call"),
|
|
20337
|
+
status: optionalKey(String$5),
|
|
20338
|
+
queries: optionalKey(ArraySchema(String$5)),
|
|
20339
|
+
results: optionalKey(NullOr(Unknown))
|
|
20340
|
+
});
|
|
20341
|
+
const InputImageGenerationCall = Struct({
|
|
20342
|
+
id: String$5,
|
|
20343
|
+
type: Literal("image_generation_call"),
|
|
20344
|
+
result: optionalKey(NullOr(String$5)),
|
|
20345
|
+
status: optionalKey(Literals$2([
|
|
20346
|
+
"in_progress",
|
|
20347
|
+
"completed",
|
|
20348
|
+
"generating",
|
|
20349
|
+
"failed"
|
|
20350
|
+
]))
|
|
20351
|
+
});
|
|
20352
|
+
const InputWebSearchCall = Struct({
|
|
20353
|
+
id: String$5,
|
|
20354
|
+
type: Literal("web_search_call"),
|
|
20355
|
+
action: optionalKey(Unknown),
|
|
20356
|
+
status: optionalKey(String$5)
|
|
20357
|
+
});
|
|
20200
20358
|
const InputItem = Union([
|
|
20201
20359
|
RequestMessageItem,
|
|
20202
20360
|
OutputMessage,
|
|
@@ -20209,7 +20367,11 @@ const InputItem = Union([
|
|
|
20209
20367
|
ShellCall,
|
|
20210
20368
|
ShellCallOutput,
|
|
20211
20369
|
ApplyPatchCallOutput,
|
|
20212
|
-
McpApprovalResponse
|
|
20370
|
+
McpApprovalResponse,
|
|
20371
|
+
InputCodeInterpreterCall,
|
|
20372
|
+
InputFileSearchCall,
|
|
20373
|
+
InputImageGenerationCall,
|
|
20374
|
+
InputWebSearchCall
|
|
20213
20375
|
]);
|
|
20214
20376
|
const FunctionTool = Struct({
|
|
20215
20377
|
type: Literal("function"),
|
|
@@ -20683,7 +20845,7 @@ const CreateEmbeddingResponse = Struct({
|
|
|
20683
20845
|
}))
|
|
20684
20846
|
});
|
|
20685
20847
|
//#endregion
|
|
20686
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
20848
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/OpenAiClient.js
|
|
20687
20849
|
var OpenAiClient$1 = class extends Service()("@effect/ai-openai/OpenAiClient") {};
|
|
20688
20850
|
const RedactedOpenAiHeaders$1 = {
|
|
20689
20851
|
OpenAiOrganization: "OpenAI-Organization",
|
|
@@ -20701,7 +20863,7 @@ const make$8 = fnUntraced(function* (options) {
|
|
|
20701
20863
|
SchemaError: (error) => fail$2(mapSchemaError$1(error, "createResponse"))
|
|
20702
20864
|
}))), withRedactedHeaders$1);
|
|
20703
20865
|
const buildResponseStream = (response) => {
|
|
20704
|
-
return [response, response.stream.pipe(decodeText(), pipeThroughChannel(decodeDataSchema(ResponseStreamEvent)), takeUntil((event) => event.data.type === "response.completed" || event.data.type === "response.incomplete" || event.data.type === "response.failed"), map$
|
|
20866
|
+
return [response, response.stream.pipe(decodeText(), pipeThroughChannel(decodeDataSchema(ResponseStreamEvent)), takeUntil((event) => event.data.type === "response.completed" || event.data.type === "response.incomplete" || event.data.type === "response.failed"), map$9((event) => event.data), catchTags$1({
|
|
20705
20867
|
Retry: (error) => die$2(error),
|
|
20706
20868
|
SseError: (error) => fail$5(mapSseError$1(error, "createResponseStream")),
|
|
20707
20869
|
HttpClientError: (error) => fromEffect(mapHttpClientError$1(error, "createResponseStream")),
|
|
@@ -20751,64 +20913,74 @@ const makeSocket = gen(function* () {
|
|
|
20751
20913
|
tracker.clearUnsafe();
|
|
20752
20914
|
return void_;
|
|
20753
20915
|
});
|
|
20754
|
-
const
|
|
20755
|
-
|
|
20756
|
-
|
|
20757
|
-
|
|
20758
|
-
|
|
20759
|
-
|
|
20760
|
-
|
|
20761
|
-
|
|
20762
|
-
reason:
|
|
20763
|
-
|
|
20764
|
-
|
|
20765
|
-
|
|
20766
|
-
|
|
20767
|
-
|
|
20768
|
-
|
|
20769
|
-
|
|
20770
|
-
|
|
20771
|
-
|
|
20772
|
-
|
|
20916
|
+
const connection = {
|
|
20917
|
+
current: void 0,
|
|
20918
|
+
send: (message) => writer.write(JSON.stringify({
|
|
20919
|
+
type: "response.create",
|
|
20920
|
+
...message
|
|
20921
|
+
})).pipe(mapError((_error) => make$18({
|
|
20922
|
+
module: "OpenAiClient",
|
|
20923
|
+
method: "createResponseStream",
|
|
20924
|
+
reason: new NetworkError({
|
|
20925
|
+
reason: "TransportError",
|
|
20926
|
+
request: {
|
|
20927
|
+
method: "POST",
|
|
20928
|
+
url: request.url,
|
|
20929
|
+
urlParams: [],
|
|
20930
|
+
hash: void 0,
|
|
20931
|
+
headers: request.headers
|
|
20932
|
+
},
|
|
20933
|
+
description: "Failed to send message over WebSocket"
|
|
20934
|
+
})
|
|
20935
|
+
})))
|
|
20936
|
+
};
|
|
20773
20937
|
const handleMessage = (msg) => {
|
|
20774
|
-
const
|
|
20938
|
+
const turn = connection.current;
|
|
20939
|
+
if (turn === void 0) return;
|
|
20940
|
+
let event;
|
|
20775
20941
|
try {
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20780
|
-
|
|
20781
|
-
|
|
20782
|
-
|
|
20783
|
-
|
|
20784
|
-
|
|
20785
|
-
|
|
20786
|
-
|
|
20787
|
-
|
|
20788
|
-
|
|
20789
|
-
|
|
20790
|
-
|
|
20791
|
-
|
|
20792
|
-
|
|
20793
|
-
|
|
20794
|
-
|
|
20795
|
-
|
|
20796
|
-
|
|
20942
|
+
event = decodeEvent(typeof msg === "string" ? msg : decoder.decode(msg));
|
|
20943
|
+
} catch {
|
|
20944
|
+
return;
|
|
20945
|
+
}
|
|
20946
|
+
if (event.type === "error") {
|
|
20947
|
+
const status = "status" in event ? Number(event.status) : NaN;
|
|
20948
|
+
const error = "error" in event ? event.error : event;
|
|
20949
|
+
const errorType = error.code ?? (error.type === "api_error" && /^gRPC error: Response with id=\S+ not found$/.test(error.message) ? "previous_response_not_found" : error.type ?? "unknown");
|
|
20950
|
+
const json = JSON.stringify(error);
|
|
20951
|
+
if (errorType === "previous_response_not_found") connection.current = void 0;
|
|
20952
|
+
failCauseUnsafe(turn, fail$4(make$18({
|
|
20953
|
+
module: "OpenAiClient",
|
|
20954
|
+
method: "createResponseStream",
|
|
20955
|
+
reason: reasonFromHttpStatus({
|
|
20956
|
+
description: json,
|
|
20957
|
+
status: errorType === "previous_response_not_found" ? 400 : isNaN(status) ? Object.hasOwn(errorTypeToStatus, errorType) ? errorTypeToStatus[errorType] : 500 : status,
|
|
20958
|
+
metadata: error,
|
|
20959
|
+
http: {
|
|
20960
|
+
body: json,
|
|
20961
|
+
request: {
|
|
20962
|
+
method: "POST",
|
|
20963
|
+
url: request.url,
|
|
20964
|
+
urlParams: [],
|
|
20965
|
+
hash: void 0,
|
|
20966
|
+
headers: request.headers
|
|
20797
20967
|
}
|
|
20798
|
-
}
|
|
20799
|
-
})
|
|
20800
|
-
}
|
|
20801
|
-
|
|
20802
|
-
}
|
|
20968
|
+
}
|
|
20969
|
+
})
|
|
20970
|
+
})));
|
|
20971
|
+
return;
|
|
20972
|
+
}
|
|
20973
|
+
offerUnsafe(turn, event);
|
|
20974
|
+
if (event.type === "response.completed" || event.type === "response.incomplete" || event.type === "response.failed") {
|
|
20975
|
+
connection.current = void 0;
|
|
20976
|
+
endUnsafe(turn);
|
|
20977
|
+
}
|
|
20803
20978
|
};
|
|
20804
20979
|
yield* gen(function* () {
|
|
20805
20980
|
const { pull } = yield* socket.reader;
|
|
20806
20981
|
while (true) {
|
|
20807
20982
|
const messages = yield* pull;
|
|
20808
|
-
for (let i = 0; i < messages.length; i++)
|
|
20809
|
-
const result = handleMessage(messages[i]);
|
|
20810
|
-
if (result !== void 0) yield* result;
|
|
20811
|
-
}
|
|
20983
|
+
for (let i = 0; i < messages.length; i++) handleMessage(messages[i]);
|
|
20812
20984
|
}
|
|
20813
20985
|
}).pipe(scoped, catchTag("SocketError", (error) => make$18({
|
|
20814
20986
|
module: "OpenAiClient",
|
|
@@ -20824,11 +20996,8 @@ const makeSocket = gen(function* () {
|
|
|
20824
20996
|
},
|
|
20825
20997
|
description: error.message
|
|
20826
20998
|
})
|
|
20827
|
-
})), catchCause((cause) => failCause$2(
|
|
20828
|
-
return
|
|
20829
|
-
send,
|
|
20830
|
-
incoming
|
|
20831
|
-
};
|
|
20999
|
+
})), catchCause((cause) => connection.current === void 0 ? void_ : failCause$2(connection.current, cause)), ensuring(forkIn(invalidate(queueRef), socketScope, { startImmediately: true })), forkScoped({ startImmediately: true }));
|
|
21000
|
+
return connection;
|
|
20832
21001
|
})
|
|
20833
21002
|
});
|
|
20834
21003
|
yield* scoped(get(queueRef));
|
|
@@ -20838,23 +21007,22 @@ const makeSocket = gen(function* () {
|
|
|
20838
21007
|
const stream = unwrap$3(gen(function* () {
|
|
20839
21008
|
const scope$2 = yield* scope;
|
|
20840
21009
|
yield* acquireRelease(semaphore.take(1), () => semaphore.release(1), { interruptible: true });
|
|
20841
|
-
const
|
|
20842
|
-
|
|
20843
|
-
|
|
20844
|
-
yield*
|
|
20845
|
-
|
|
20846
|
-
|
|
20847
|
-
return done;
|
|
20848
|
-
}));
|
|
21010
|
+
const connection = yield* get(queueRef);
|
|
21011
|
+
const turn = yield* unbounded();
|
|
21012
|
+
connection.current = turn;
|
|
21013
|
+
yield* addFinalizerExit(scope$2, () => connection.current === turn ? invalidate(queueRef) : void_);
|
|
21014
|
+
yield* connection.send(options).pipe(forkScoped({ startImmediately: true }));
|
|
21015
|
+
return fromQueue(turn);
|
|
20849
21016
|
}));
|
|
20850
21017
|
return succeed$2([fromWeb(request, new Response()), stream]);
|
|
20851
21018
|
} }).pipe(add(ResponseIdTracker, tracker));
|
|
20852
21019
|
});
|
|
20853
21020
|
const ErrorEvent = Struct({
|
|
20854
|
-
type: Literal("error"),
|
|
20855
|
-
status: Int$1
|
|
21021
|
+
type: Literal("error").pipe(withDecodingDefault(succeed$2("error"))),
|
|
21022
|
+
status: optionalKey(Int$1),
|
|
20856
21023
|
error: Struct({
|
|
20857
|
-
type: String$5,
|
|
21024
|
+
type: optional$2(String$5),
|
|
21025
|
+
code: optional$2(String$5),
|
|
20858
21026
|
message: String$5
|
|
20859
21027
|
})
|
|
20860
21028
|
});
|
|
@@ -20869,7 +21037,7 @@ const AllEvents = Union([ErrorEvent, ResponseStreamEvent]);
|
|
|
20869
21037
|
const decodeEvent = decodeUnknownSync(fromJsonString(AllEvents));
|
|
20870
21038
|
const layerWebSocketMode = effectContext(makeSocket);
|
|
20871
21039
|
//#endregion
|
|
20872
|
-
//#region node_modules/.pnpm/effect@
|
|
21040
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/RequestResolver.js
|
|
20873
21041
|
const TypeId$3 = "~effect/RequestResolver";
|
|
20874
21042
|
const RequestResolverProto = {
|
|
20875
21043
|
[TypeId$3]: {
|
|
@@ -20951,17 +21119,17 @@ const withSpan = dual((args) => isRequestResolver(args[0]), (self, name, options
|
|
|
20951
21119
|
})
|
|
20952
21120
|
}));
|
|
20953
21121
|
//#endregion
|
|
20954
|
-
//#region node_modules/.pnpm/effect@
|
|
20955
|
-
const EmbeddingModel = Service("effect/
|
|
21122
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/EmbeddingModel.js
|
|
21123
|
+
const EmbeddingModel = Service("effect/ai/EmbeddingModel");
|
|
20956
21124
|
const TypeId$2 = "~effect/ai/EmbeddingModel";
|
|
20957
|
-
var Dimensions = class extends Service()("effect/
|
|
21125
|
+
var Dimensions = class extends Service()("effect/ai/EmbeddingModel/Dimensions") {};
|
|
20958
21126
|
var EmbeddingUsage = class extends Class$1("effect/ai/EmbeddingModel/EmbeddingUsage")({ inputTokens: optional$2(Finite) }) {};
|
|
20959
21127
|
var EmbedResponse = class extends Class$1("effect/ai/EmbeddingModel/EmbedResponse")({ vector: ArraySchema(Finite) }) {};
|
|
20960
21128
|
var EmbedManyResponse = class extends Class$1("effect/ai/EmbeddingModel/EmbedManyResponse")({
|
|
20961
21129
|
embeddings: ArraySchema(EmbedResponse),
|
|
20962
21130
|
usage: EmbeddingUsage
|
|
20963
21131
|
}) {};
|
|
20964
|
-
var EmbeddingRequest = class extends TaggedClass
|
|
21132
|
+
var EmbeddingRequest = class extends TaggedClass("EmbeddingRequest") {};
|
|
20965
21133
|
const invalidProviderResponse = (description) => make$18({
|
|
20966
21134
|
module: "EmbeddingModel",
|
|
20967
21135
|
method: "embedMany",
|
|
@@ -20994,10 +21162,10 @@ const mapProviderResults = (inputLength, results) => {
|
|
|
20994
21162
|
return succeed$2(embeddings);
|
|
20995
21163
|
};
|
|
20996
21164
|
//#endregion
|
|
20997
|
-
//#region node_modules/.pnpm/effect@
|
|
21165
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/Model.js
|
|
20998
21166
|
const TypeId$1 = "~effect/ai/Model";
|
|
20999
|
-
var ProviderName = class extends Service()("effect/
|
|
21000
|
-
var ModelName = class extends Service()("effect/
|
|
21167
|
+
var ProviderName = class extends Service()("effect/ai/Model/ProviderName") {};
|
|
21168
|
+
var ModelName = class extends Service()("effect/ai/Model/ModelName") {};
|
|
21001
21169
|
const Proto = {
|
|
21002
21170
|
[TypeId$1]: TypeId$1,
|
|
21003
21171
|
["~effect/Layer"]: {
|
|
@@ -21019,9 +21187,9 @@ const Proto = {
|
|
|
21019
21187
|
};
|
|
21020
21188
|
const make$5 = (provider, modelName, layer) => Object.assign(Object.create(Proto), { provider }, merge$3(layer, succeedContext(ProviderName.context(provider).pipe(add(ModelName, modelName)))));
|
|
21021
21189
|
//#endregion
|
|
21022
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
21190
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/OpenAiEmbeddingModel.js
|
|
21023
21191
|
var Config$2 = class extends Service()("@effect/ai-openai/OpenAiEmbeddingModel/Config") {};
|
|
21024
|
-
const model$
|
|
21192
|
+
const model$2 = (model, options) => make$5("openai", model, merge$3(layer$4({
|
|
21025
21193
|
model,
|
|
21026
21194
|
config: {
|
|
21027
21195
|
...options.config,
|
|
@@ -21068,7 +21236,7 @@ const invalidOutput = (description) => make$18({
|
|
|
21068
21236
|
reason: new InvalidOutputError({ description })
|
|
21069
21237
|
});
|
|
21070
21238
|
//#endregion
|
|
21071
|
-
//#region node_modules/.pnpm/effect@
|
|
21239
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/ai/OpenAiStructuredOutput.js
|
|
21072
21240
|
function toCodecOpenAI(schema) {
|
|
21073
21241
|
const codec = toCodec(schema);
|
|
21074
21242
|
const document = resolveTopLevelReference(toJsonSchemaDocument(codec, {
|
|
@@ -21077,7 +21245,7 @@ function toCodecOpenAI(schema) {
|
|
|
21077
21245
|
}));
|
|
21078
21246
|
const jsonSchema = rewriteOpenAI(document.schema);
|
|
21079
21247
|
if (jsonSchema.type !== "object" || jsonSchema.anyOf !== void 0) throw new Error(`OpenAiStructuredOutput: Root JSON Schema must have type "object" and must not use "anyOf"`);
|
|
21080
|
-
if (Object.keys(document.definitions).length > 0) jsonSchema.$defs = map$
|
|
21248
|
+
if (Object.keys(document.definitions).length > 0) jsonSchema.$defs = map$11(document.definitions, rewriteOpenAI);
|
|
21081
21249
|
return {
|
|
21082
21250
|
codec,
|
|
21083
21251
|
jsonSchema
|
|
@@ -21276,7 +21444,7 @@ const formats = new Set([
|
|
|
21276
21444
|
"uuid"
|
|
21277
21445
|
]);
|
|
21278
21446
|
//#endregion
|
|
21279
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
21447
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/internal/utilities.js
|
|
21280
21448
|
const finishReasonMap$1 = {
|
|
21281
21449
|
content_filter: "content-filter",
|
|
21282
21450
|
function_call: "tool-calls",
|
|
@@ -21292,7 +21460,7 @@ const resolveFinishReason$1 = (finishReason, hasToolCalls) => {
|
|
|
21292
21460
|
return reason;
|
|
21293
21461
|
};
|
|
21294
21462
|
//#endregion
|
|
21295
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
21463
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/OpenAiTelemetry.js
|
|
21296
21464
|
const addOpenAiRequestAttributes$1 = addSpanAttributes("gen_ai.openai.request", camelToSnake);
|
|
21297
21465
|
const addOpenAiResponseAttributes$1 = addSpanAttributes("gen_ai.openai.response", camelToSnake);
|
|
21298
21466
|
const addGenAIAnnotations$1 = dual(2, (span, options) => {
|
|
@@ -21303,7 +21471,7 @@ const addGenAIAnnotations$1 = dual(2, (span, options) => {
|
|
|
21303
21471
|
}
|
|
21304
21472
|
});
|
|
21305
21473
|
//#endregion
|
|
21306
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
21474
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@b3032f0_effect@_37a89be1fb367830d95352a48fdb718a/node_modules/@effect/ai-openai/dist/OpenAiLanguageModel.js
|
|
21307
21475
|
ModelIdsResponses.members[1];
|
|
21308
21476
|
ModelIdsShared.members[1];
|
|
21309
21477
|
var Config$1 = class extends Service()("@effect/ai-openai/OpenAiLanguageModel/Config") {};
|
|
@@ -21336,7 +21504,7 @@ const make$3 = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
21336
21504
|
config,
|
|
21337
21505
|
options
|
|
21338
21506
|
});
|
|
21339
|
-
const { fileIdPrefixes: _fip, strictJsonSchema: _sjs, ...apiConfig } = config;
|
|
21507
|
+
const { fileIdPrefixes: _fip, strictJsonSchema: _sjs, useItemReferences: _uir, ...apiConfig } = config;
|
|
21340
21508
|
const request = {
|
|
21341
21509
|
...apiConfig,
|
|
21342
21510
|
input: messages,
|
|
@@ -21388,7 +21556,7 @@ const make$3 = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
21388
21556
|
options,
|
|
21389
21557
|
toolNameMapper
|
|
21390
21558
|
});
|
|
21391
|
-
}, (effect, options) => effect.pipe(unwrap$3, map$
|
|
21559
|
+
}, (effect, options) => effect.pipe(unwrap$3, map$9((response) => {
|
|
21392
21560
|
annotateStreamResponse$1(options.span, response);
|
|
21393
21561
|
return response;
|
|
21394
21562
|
})))
|
|
@@ -21402,7 +21570,9 @@ const withConfigOverride$1 = dual(2, (self, overrides) => flatMap$1(serviceOptio
|
|
|
21402
21570
|
const getSystemMessageMode$1 = (model) => model.startsWith("o") || model.startsWith("gpt-5") || model.startsWith("codex-") || model.startsWith("computer-use") ? "developer" : "system";
|
|
21403
21571
|
const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities, include, toolNameMapper }) {
|
|
21404
21572
|
const processedApprovalIds = new Set();
|
|
21573
|
+
const websocketMode = isSome(yield* serviceOption(OpenAiSocket));
|
|
21405
21574
|
const hasConversation = isNotNullish(config.conversation);
|
|
21575
|
+
const useItemReferences = config.store === true && config.useItemReferences !== false && options.incrementalFallback !== true;
|
|
21406
21576
|
const applyPatchTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiApplyPatch");
|
|
21407
21577
|
const codeInterpreterTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiCodeInterpreter");
|
|
21408
21578
|
const shellTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiShell");
|
|
@@ -21410,7 +21580,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21410
21580
|
const webSearchTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiWebSearch");
|
|
21411
21581
|
const webSearchPreviewTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiWebSearchPreview");
|
|
21412
21582
|
if (isNotUndefined(config.top_logprobs)) include.add("message.output_text.logprobs");
|
|
21413
|
-
if (
|
|
21583
|
+
if ((websocketMode || !useItemReferences) && capabilities.isReasoningModel) include.add("reasoning.encrypted_content");
|
|
21414
21584
|
if (codeInterpreterTool) include.add("code_interpreter_call.outputs");
|
|
21415
21585
|
if (webSearchTool || webSearchPreviewTool) include.add("web_search_call.action.sources");
|
|
21416
21586
|
const messages = [];
|
|
@@ -21447,7 +21617,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21447
21617
|
detail
|
|
21448
21618
|
});
|
|
21449
21619
|
else {
|
|
21450
|
-
const imageUrl = part.data instanceof URL ? part.data.toString() : part.data instanceof Uint8Array ? `data:${mediaType};base64,${
|
|
21620
|
+
const imageUrl = part.data instanceof URL ? part.data.toString() : part.data instanceof Uint8Array ? `data:${mediaType};base64,${encode(part.data)}` : /^(data:|https?:\/\/)/i.test(part.data) ? part.data : `data:${mediaType};base64,${part.data}`;
|
|
21451
21621
|
content.push({
|
|
21452
21622
|
type: "input_image",
|
|
21453
21623
|
image_url: imageUrl,
|
|
@@ -21464,7 +21634,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21464
21634
|
file_url: part.data.toString()
|
|
21465
21635
|
});
|
|
21466
21636
|
if (part.data instanceof Uint8Array) {
|
|
21467
|
-
const base64 =
|
|
21637
|
+
const base64 = encode(part.data);
|
|
21468
21638
|
const fileName = part.fileName ?? `part-${index}.pdf`;
|
|
21469
21639
|
const fileData = `data:application/pdf;base64,${base64}`;
|
|
21470
21640
|
content.push({
|
|
@@ -21488,11 +21658,17 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21488
21658
|
}
|
|
21489
21659
|
case "assistant": {
|
|
21490
21660
|
const reasoningMessages = Object.create(null);
|
|
21661
|
+
const providerExecutedParts = message.content.filter((part) => (part.type === "tool-call" || part.type === "tool-result") && part.providerExecuted);
|
|
21662
|
+
const unreplayableProviderItem = (name, id) => make$18({
|
|
21663
|
+
module: "OpenAiLanguageModel",
|
|
21664
|
+
method: "prepareMessages",
|
|
21665
|
+
reason: new InvalidRequestError({ description: `Cannot replay provider-executed tool item '${name}' ('${id}') losslessly` })
|
|
21666
|
+
});
|
|
21491
21667
|
for (const part of message.content) switch (part.type) {
|
|
21492
21668
|
case "text": {
|
|
21493
21669
|
const id = getItemId$1(part);
|
|
21494
21670
|
if (hasConversation && isNotNull(id)) break;
|
|
21495
|
-
if (
|
|
21671
|
+
if (useItemReferences && isNotNull(id)) {
|
|
21496
21672
|
messages.push({
|
|
21497
21673
|
type: "item_reference",
|
|
21498
21674
|
id
|
|
@@ -21519,7 +21695,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21519
21695
|
if (hasConversation && isNotNull(id)) break;
|
|
21520
21696
|
if (isNotNull(id)) {
|
|
21521
21697
|
const message = reasoningMessages[id];
|
|
21522
|
-
if (
|
|
21698
|
+
if (useItemReferences) {
|
|
21523
21699
|
if (isUndefined(message)) {
|
|
21524
21700
|
messages.push({
|
|
21525
21701
|
type: "item_reference",
|
|
@@ -21557,14 +21733,64 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21557
21733
|
const id = getItemId$1(part);
|
|
21558
21734
|
const status = getStatus$1(part);
|
|
21559
21735
|
if (hasConversation && isNotNull(id)) break;
|
|
21560
|
-
if (
|
|
21736
|
+
if (useItemReferences && isNotNull(id)) {
|
|
21561
21737
|
messages.push({
|
|
21562
21738
|
type: "item_reference",
|
|
21563
21739
|
id
|
|
21564
21740
|
});
|
|
21565
21741
|
break;
|
|
21566
21742
|
}
|
|
21567
|
-
if (part.providerExecuted)
|
|
21743
|
+
if (part.providerExecuted) {
|
|
21744
|
+
if (config.store !== true && options.incrementalFallback !== true) break;
|
|
21745
|
+
const result = providerExecutedParts.find((candidate) => candidate.type === "tool-result" && candidate.id === part.id && candidate.name === part.name);
|
|
21746
|
+
if (isUndefined(result) || result.type !== "tool-result") return yield* unreplayableProviderItem(part.name, part.id);
|
|
21747
|
+
if (hasProperty(result.result, "type") && result.result.type === "execution-denied") break;
|
|
21748
|
+
const itemId = getItemId$1(part) ?? getItemId$1(result) ?? part.id;
|
|
21749
|
+
switch (part.name) {
|
|
21750
|
+
case "OpenAiWebSearch":
|
|
21751
|
+
case "OpenAiWebSearchPreview":
|
|
21752
|
+
if (!hasProperty(result.result, "action") || !hasProperty(result.result, "status")) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21753
|
+
messages.push({
|
|
21754
|
+
type: "web_search_call",
|
|
21755
|
+
id: itemId,
|
|
21756
|
+
action: result.result.action,
|
|
21757
|
+
status: result.result.status
|
|
21758
|
+
});
|
|
21759
|
+
break;
|
|
21760
|
+
case "OpenAiCodeInterpreter":
|
|
21761
|
+
if (!hasProperty(part.params, "code") || !hasProperty(part.params, "container_id") || !hasProperty(result.result, "status") || !hasProperty(result.result, "outputs")) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21762
|
+
messages.push({
|
|
21763
|
+
type: "code_interpreter_call",
|
|
21764
|
+
id: itemId,
|
|
21765
|
+
code: part.params.code,
|
|
21766
|
+
container_id: part.params.container_id,
|
|
21767
|
+
status: result.result.status,
|
|
21768
|
+
outputs: result.result.outputs
|
|
21769
|
+
});
|
|
21770
|
+
break;
|
|
21771
|
+
case "OpenAiFileSearch":
|
|
21772
|
+
if (!hasProperty(result.result, "status") || !hasProperty(result.result, "queries") || !hasProperty(result.result, "results")) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21773
|
+
messages.push({
|
|
21774
|
+
type: "file_search_call",
|
|
21775
|
+
id: itemId,
|
|
21776
|
+
status: result.result.status,
|
|
21777
|
+
queries: result.result.queries,
|
|
21778
|
+
results: result.result.results
|
|
21779
|
+
});
|
|
21780
|
+
break;
|
|
21781
|
+
case "OpenAiImageGeneration":
|
|
21782
|
+
if (!hasProperty(result.result, "result")) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21783
|
+
messages.push({
|
|
21784
|
+
type: "image_generation_call",
|
|
21785
|
+
id: itemId,
|
|
21786
|
+
result: result.result.result,
|
|
21787
|
+
status: hasProperty(result.result, "status") ? result.result.status : "completed"
|
|
21788
|
+
});
|
|
21789
|
+
break;
|
|
21790
|
+
default: return yield* unreplayableProviderItem(part.name, part.id);
|
|
21791
|
+
}
|
|
21792
|
+
break;
|
|
21793
|
+
}
|
|
21568
21794
|
const toolName = toolNameMapper.getProviderName(part.name);
|
|
21569
21795
|
if (isNotUndefined(localShellTool) && toolName === "local_shell") {
|
|
21570
21796
|
const params = yield* decodeUnknownEffect$1(localShellTool.parametersSchema)(part.params).pipe(mapError((error) => make$18({
|
|
@@ -21615,12 +21841,15 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21615
21841
|
case "tool-result":
|
|
21616
21842
|
if (hasProperty(part.result, "type") && part.result.type === "execution-denied") break;
|
|
21617
21843
|
if (hasConversation) break;
|
|
21618
|
-
if (
|
|
21844
|
+
if (useItemReferences) {
|
|
21619
21845
|
const id = getItemId$1(part) ?? part.id;
|
|
21620
21846
|
messages.push({
|
|
21621
21847
|
type: "item_reference",
|
|
21622
21848
|
id
|
|
21623
21849
|
});
|
|
21850
|
+
} else if (part.providerExecuted && (config.store === true || options.incrementalFallback === true)) {
|
|
21851
|
+
const call = providerExecutedParts.find((candidate) => candidate.type === "tool-call" && candidate.id === part.id && candidate.name === part.name);
|
|
21852
|
+
if (isUndefined(call)) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21624
21853
|
}
|
|
21625
21854
|
}
|
|
21626
21855
|
break;
|
|
@@ -21629,7 +21858,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21629
21858
|
if (part.type === "tool-approval-response") {
|
|
21630
21859
|
if (processedApprovalIds.has(part.approvalId)) continue;
|
|
21631
21860
|
processedApprovalIds.add(part.approvalId);
|
|
21632
|
-
if (
|
|
21861
|
+
if (useItemReferences) messages.push({
|
|
21633
21862
|
type: "item_reference",
|
|
21634
21863
|
id: part.approvalId
|
|
21635
21864
|
});
|
|
@@ -22045,6 +22274,7 @@ const makeResponse$1 = fnUntraced(function* ({ options, rawResponse, response, t
|
|
|
22045
22274
|
});
|
|
22046
22275
|
const makeStreamResponse$1 = fnUntraced(function* ({ stream, response, config, options, toolNameMapper }) {
|
|
22047
22276
|
const idGenerator = yield* IdGenerator;
|
|
22277
|
+
const websocketMode = isSome(yield* serviceOption(OpenAiSocket));
|
|
22048
22278
|
const approvalRequests = getApprovalRequestIdMapping(options.prompt);
|
|
22049
22279
|
const streamApprovalRequests = new Map();
|
|
22050
22280
|
let hasToolCalls = false;
|
|
@@ -22787,7 +23017,7 @@ const makeStreamResponse$1 = fnUntraced(function* ({ stream, response, config, o
|
|
|
22787
23017
|
break;
|
|
22788
23018
|
case "response.reasoning_summary_part.done": {
|
|
22789
23019
|
const reasoningPart = getOrCreateReasoningPart(event.item_id);
|
|
22790
|
-
if (config.store === true) {
|
|
23020
|
+
if (!websocketMode && config.store === true && config.useItemReferences !== false) {
|
|
22791
23021
|
parts.push({
|
|
22792
23022
|
type: "reasoning-end",
|
|
22793
23023
|
id: `${event.item_id}:${event.summary_index}`,
|
|
@@ -23142,6 +23372,7 @@ const transformToolCallParams$1 = fnUntraced(function* (tools, toolName, toolPar
|
|
|
23142
23372
|
availableTools: tools.map((tool) => tool.name)
|
|
23143
23373
|
})
|
|
23144
23374
|
});
|
|
23375
|
+
if (isDynamic(tool) && tool.jsonSchema !== void 0) return toolParams;
|
|
23145
23376
|
const { codec } = yield* tryCodecTransform$1(tool.parametersSchema, "makeResponse");
|
|
23146
23377
|
return yield* decodeEffect(codec)(toolParams).pipe(flatMap$1((decoded) => encodeUnknownEffect(tool.parametersSchema)(decoded)), orElseSucceed(() => toolParams));
|
|
23147
23378
|
});
|
|
@@ -23221,7 +23452,7 @@ const decodeJwtPayload = (token) => {
|
|
|
23221
23452
|
if (parts.length !== 3) return none();
|
|
23222
23453
|
const payload = parts[1];
|
|
23223
23454
|
if (payload === void 0) return none();
|
|
23224
|
-
return fromNullishOr(getOrUndefined$2(
|
|
23455
|
+
return fromNullishOr(getOrUndefined$2(decodeString(payload)));
|
|
23225
23456
|
};
|
|
23226
23457
|
const parseJwtClaims = (token) => decodeJwtPayload(token).pipe(flatMap$2(decodeJwtJson), flatMap$2(toJwtClaims));
|
|
23227
23458
|
const extractAccountIdFromClaims = (claims) => {
|
|
@@ -23492,7 +23723,7 @@ const make$2 = gen(function* () {
|
|
|
23492
23723
|
const singleTool = yield* SingleTools.pipe(provide$1(SingleToolHandlers));
|
|
23493
23724
|
const capabilities = yield* executor.capabilities;
|
|
23494
23725
|
const pendingMessages = new Set();
|
|
23495
|
-
const agentsMd = map$
|
|
23726
|
+
const agentsMd = map$8(capabilities.agentsMd, (content) => `# AGENTS.md
|
|
23496
23727
|
|
|
23497
23728
|
The following instructions are from ./AGENTS.md in the current directory.
|
|
23498
23729
|
You do not need to read this file again.
|
|
@@ -23778,7 +24009,7 @@ ${content}
|
|
|
23778
24009
|
return void_;
|
|
23779
24010
|
}), modelConfig.systemPromptTransform ? (effect) => modelConfig.systemPromptTransform(system, effect) : identity);
|
|
23780
24011
|
const attempt = pipe(runModel, raceFirst(turnTimeoutEffect), retry({
|
|
23781
|
-
while
|
|
24012
|
+
while(err) {
|
|
23782
24013
|
if (err._tag === "TimeoutError") {
|
|
23783
24014
|
maybeSend({
|
|
23784
24015
|
agentId,
|
|
@@ -23977,7 +24208,7 @@ const responseToSummary = (response) => {
|
|
|
23977
24208
|
//#endregion
|
|
23978
24209
|
//#region src/Codex.ts
|
|
23979
24210
|
const layerClient$2 = layer$5({ apiUrl: "https://chatgpt.com/backend-api/codex" }).pipe(provide$3(CodexAuth.layerClient));
|
|
23980
|
-
const modelWebSocket = (model, options) => make$5("openai", model, layerModel(model, options).pipe(merge$3(fresh(layerWebSocketMode))));
|
|
24211
|
+
const modelWebSocket$1 = (model, options) => make$5("openai", model, layerModel(model, options).pipe(merge$3(fresh(layerWebSocketMode))));
|
|
23981
24212
|
const layerModel = (model, options) => layer$3({
|
|
23982
24213
|
model,
|
|
23983
24214
|
config: {
|
|
@@ -23998,7 +24229,7 @@ const layerModel = (model, options) => layer$3({
|
|
|
23998
24229
|
supportsImages: options?.supportsImages
|
|
23999
24230
|
})));
|
|
24000
24231
|
//#endregion
|
|
24001
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24232
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@b_3cb1e20f378ce4af76925003ed6fd302/node_modules/@effect/ai-openai-compat/dist/internal/errors.js
|
|
24002
24233
|
const OpenAiErrorBody = Struct({ error: Struct({
|
|
24003
24234
|
message: String$5,
|
|
24004
24235
|
type: optional$2(NullOr(String$5)),
|
|
@@ -24081,7 +24312,7 @@ const mapStatusCodeError = fnUntraced(function* (error, method) {
|
|
|
24081
24312
|
}),
|
|
24082
24313
|
metadata: {
|
|
24083
24314
|
errorCode: isSome(decoded) ? decoded.value.error.code?.toString() ?? null : null,
|
|
24084
|
-
errorType: decoded.pipe(flatMapNullishOr((d) => d.error.type ?? d.error.status), map$
|
|
24315
|
+
errorType: decoded.pipe(flatMapNullishOr((d) => d.error.type ?? d.error.status), map$8(toLowerCase), getOrNull),
|
|
24085
24316
|
requestId: requestId ?? null
|
|
24086
24317
|
}
|
|
24087
24318
|
});
|
|
@@ -24095,11 +24326,11 @@ const parseRateLimitHeaders = (headers) => {
|
|
|
24095
24326
|
const retryAfterRaw = headers["retry-after"];
|
|
24096
24327
|
let retryAfter;
|
|
24097
24328
|
if (retryAfterRaw !== void 0) {
|
|
24098
|
-
const parsed = parse$
|
|
24329
|
+
const parsed = parse$1(retryAfterRaw);
|
|
24099
24330
|
if (isSome(parsed)) retryAfter = seconds(parsed.value);
|
|
24100
24331
|
}
|
|
24101
24332
|
const remainingRaw = headers["x-ratelimit-remaining-requests"];
|
|
24102
|
-
const remaining = remainingRaw !== void 0 ? getOrNull(parse$
|
|
24333
|
+
const remaining = remainingRaw !== void 0 ? getOrNull(parse$1(remainingRaw)) : null;
|
|
24103
24334
|
return {
|
|
24104
24335
|
retryAfter,
|
|
24105
24336
|
limit: headers["x-ratelimit-limit-requests"] ?? null,
|
|
@@ -24192,12 +24423,12 @@ const mapStatusCodeToReason = ({ status, headers, message, metadata, http }) =>
|
|
|
24192
24423
|
}
|
|
24193
24424
|
};
|
|
24194
24425
|
//#endregion
|
|
24195
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24426
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@b_3cb1e20f378ce4af76925003ed6fd302/node_modules/@effect/ai-openai-compat/dist/OpenAiConfig.js
|
|
24196
24427
|
var OpenAiConfig = class OpenAiConfig extends Service()("@effect/ai-openai-compat/OpenAiConfig") {
|
|
24197
24428
|
static getOrUndefined = map$5(context(), getOrUndefined$1(OpenAiConfig));
|
|
24198
24429
|
};
|
|
24199
24430
|
//#endregion
|
|
24200
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24431
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@b_3cb1e20f378ce4af76925003ed6fd302/node_modules/@effect/ai-openai-compat/dist/OpenAiClient.js
|
|
24201
24432
|
var OpenAiClient = class extends Service()("@effect/ai-openai-compat/OpenAiClient") {};
|
|
24202
24433
|
const RedactedOpenAiHeaders = {
|
|
24203
24434
|
OpenAiOrganization: "openai-organization",
|
|
@@ -24269,7 +24500,7 @@ const ChatCompletionToolCall = Struct({
|
|
|
24269
24500
|
function: optionalKey(ChatCompletionToolFunction)
|
|
24270
24501
|
});
|
|
24271
24502
|
const ChatCompletionToolCallDelta = Struct({
|
|
24272
|
-
id: optionalKey(String$5),
|
|
24503
|
+
id: optionalKey(NullOr(String$5)),
|
|
24273
24504
|
index: optionalKey(Int$1),
|
|
24274
24505
|
type: optionalKey(String$5),
|
|
24275
24506
|
function: optionalKey(ChatCompletionToolFunctionDelta)
|
|
@@ -24282,7 +24513,7 @@ const ChatCompletionMessage = Struct({
|
|
|
24282
24513
|
tool_calls: optionalKey(ArraySchema(ChatCompletionToolCall))
|
|
24283
24514
|
});
|
|
24284
24515
|
const ChatCompletionDelta = Struct({
|
|
24285
|
-
role: optionalKey(String$5),
|
|
24516
|
+
role: optionalKey(NullOr(String$5)),
|
|
24286
24517
|
content: optionalKey(NullOr(String$5)),
|
|
24287
24518
|
reasoning: optionalKey(NullOr(String$5)),
|
|
24288
24519
|
reasoning_content: optionalKey(NullOr(String$5)),
|
|
@@ -24335,7 +24566,7 @@ const decodeChatCompletionSseData = (data) => {
|
|
|
24335
24566
|
};
|
|
24336
24567
|
};
|
|
24337
24568
|
//#endregion
|
|
24338
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24569
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@b_3cb1e20f378ce4af76925003ed6fd302/node_modules/@effect/ai-openai-compat/dist/internal/utilities.js
|
|
24339
24570
|
const finishReasonMap = {
|
|
24340
24571
|
content_filter: "content-filter",
|
|
24341
24572
|
function_call: "tool-calls",
|
|
@@ -24350,7 +24581,7 @@ const resolveFinishReason = (finishReason, hasToolCalls) => {
|
|
|
24350
24581
|
return reason;
|
|
24351
24582
|
};
|
|
24352
24583
|
//#endregion
|
|
24353
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24584
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@b_3cb1e20f378ce4af76925003ed6fd302/node_modules/@effect/ai-openai-compat/dist/OpenAiTelemetry.js
|
|
24354
24585
|
const addOpenAiRequestAttributes = addSpanAttributes("gen_ai.openai.request", camelToSnake);
|
|
24355
24586
|
const addOpenAiResponseAttributes = addSpanAttributes("gen_ai.openai.response", camelToSnake);
|
|
24356
24587
|
const addGenAIAnnotations = dual(2, (span, options) => {
|
|
@@ -24361,7 +24592,7 @@ const addGenAIAnnotations = dual(2, (span, options) => {
|
|
|
24361
24592
|
}
|
|
24362
24593
|
});
|
|
24363
24594
|
//#endregion
|
|
24364
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24595
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@b_3cb1e20f378ce4af76925003ed6fd302/node_modules/@effect/ai-openai-compat/dist/OpenAiLanguageModel.js
|
|
24365
24596
|
var Config = class extends Service()("@effect/ai-openai-compat/OpenAiLanguageModel/Config") {};
|
|
24366
24597
|
const make = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
24367
24598
|
const client = yield* OpenAiClient;
|
|
@@ -24439,7 +24670,7 @@ const make = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
24439
24670
|
response,
|
|
24440
24671
|
toolNameMapper
|
|
24441
24672
|
});
|
|
24442
|
-
}, (effect, options) => effect.pipe(unwrap$3, map$
|
|
24673
|
+
}, (effect, options) => effect.pipe(unwrap$3, map$9((response) => {
|
|
24443
24674
|
annotateStreamResponse(options.span, response);
|
|
24444
24675
|
return response;
|
|
24445
24676
|
})))
|
|
@@ -24483,7 +24714,7 @@ const prepareMessages = fnUntraced(function* ({ config, options, capabilities, i
|
|
|
24483
24714
|
detail
|
|
24484
24715
|
});
|
|
24485
24716
|
else {
|
|
24486
|
-
const imageUrl = part.data instanceof URL ? part.data.toString() : part.data instanceof Uint8Array ? `data:${mediaType};base64,${
|
|
24717
|
+
const imageUrl = part.data instanceof URL ? part.data.toString() : part.data instanceof Uint8Array ? `data:${mediaType};base64,${encode(part.data)}` : /^(data:|https?:\/\/)/i.test(part.data) ? part.data : `data:${mediaType};base64,${part.data}`;
|
|
24487
24718
|
content.push({
|
|
24488
24719
|
type: "input_image",
|
|
24489
24720
|
image_url: imageUrl,
|
|
@@ -24500,7 +24731,7 @@ const prepareMessages = fnUntraced(function* ({ config, options, capabilities, i
|
|
|
24500
24731
|
file_url: part.data.toString()
|
|
24501
24732
|
});
|
|
24502
24733
|
if (part.data instanceof Uint8Array) {
|
|
24503
|
-
const base64 =
|
|
24734
|
+
const base64 = encode(part.data);
|
|
24504
24735
|
const fileName = part.fileName ?? `part-${index}.pdf`;
|
|
24505
24736
|
const fileData = `data:application/pdf;base64,${base64}`;
|
|
24506
24737
|
content.push({
|
|
@@ -24937,6 +25168,7 @@ const transformToolCallParams = fnUntraced(function* (tools, toolName, toolParam
|
|
|
24937
25168
|
availableTools: tools.map((tool) => tool.name)
|
|
24938
25169
|
})
|
|
24939
25170
|
});
|
|
25171
|
+
if (isDynamic(tool) && tool.jsonSchema !== void 0) return toolParams;
|
|
24940
25172
|
const { codec } = yield* tryCodecTransform(tool.parametersSchema, "makeResponse");
|
|
24941
25173
|
return yield* decodeEffect(codec)(toolParams).pipe(flatMap$1((decoded) => encodeUnknownEffect(tool.parametersSchema)(decoded)), orElseSucceed(() => toolParams));
|
|
24942
25174
|
});
|
|
@@ -25480,7 +25712,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service()("clanka/Github
|
|
|
25480
25712
|
//#endregion
|
|
25481
25713
|
//#region src/Copilot.ts
|
|
25482
25714
|
const layerClient$1 = layer$1({ apiUrl: API_URL }).pipe(provide$3(GithubCopilotAuth.layerClient));
|
|
25483
|
-
const model$
|
|
25715
|
+
const model$1 = (model, options) => make$5("openai", model, mergeAll(layer({
|
|
25484
25716
|
model,
|
|
25485
25717
|
config: omit(options ?? {}, ["systemPromptTransform", "supportsImages"])
|
|
25486
25718
|
}), AgentModelConfig.layer({
|
|
@@ -25631,11 +25863,12 @@ var XaiAuth = class XaiAuth extends Service()("clanka/XaiAuth") {
|
|
|
25631
25863
|
//#endregion
|
|
25632
25864
|
//#region src/Xai.ts
|
|
25633
25865
|
const layerClient = layer$5({ apiUrl: "https://api.x.ai/v1" }).pipe(provide$3(XaiAuth.layerClient));
|
|
25634
|
-
const
|
|
25866
|
+
const modelWebSocket = (model, options) => make$5("xai", model, mergeAll(layer$3({
|
|
25635
25867
|
model,
|
|
25636
25868
|
config: {
|
|
25637
25869
|
...omit(options ?? {}, ["systemPromptTransform", "supportsImages"]),
|
|
25638
|
-
store:
|
|
25870
|
+
store: true,
|
|
25871
|
+
useItemReferences: false,
|
|
25639
25872
|
reasoning: {
|
|
25640
25873
|
effort: "high",
|
|
25641
25874
|
...options?.reasoning
|
|
@@ -25644,13 +25877,13 @@ const model$1 = (model, options) => make$5("xai", model, mergeAll(layer$3({
|
|
|
25644
25877
|
}), AgentModelConfig.layer({
|
|
25645
25878
|
systemPromptTransform: options?.systemPromptTransform,
|
|
25646
25879
|
supportsImages: options?.supportsImages
|
|
25647
|
-
}), succeed$4(SummarizerTransform, (effect) => withConfigOverride$1(effect, { max_output_tokens: summarizerMaxOutputTokens }))));
|
|
25880
|
+
}), succeed$4(SummarizerTransform, (effect) => withConfigOverride$1(effect, { max_output_tokens: summarizerMaxOutputTokens })), fresh(layerWebSocketMode)));
|
|
25648
25881
|
//#endregion
|
|
25649
|
-
//#region node_modules/.pnpm/effect@
|
|
25882
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@b3032f0_f95638f588f5b9b247401a051448b365/node_modules/effect/dist/Logger.js
|
|
25650
25883
|
const LogToStderr = LogToStderr$1;
|
|
25651
25884
|
//#endregion
|
|
25652
25885
|
//#region package.json
|
|
25653
|
-
var version$1 = "0.8.
|
|
25886
|
+
var version$1 = "0.8.2";
|
|
25654
25887
|
//#endregion
|
|
25655
25888
|
//#region src/cli.ts
|
|
25656
25889
|
const version = version$1;
|
|
@@ -25661,7 +25894,7 @@ const providers = [
|
|
|
25661
25894
|
"xai"
|
|
25662
25895
|
];
|
|
25663
25896
|
const withSubagentModel = (model) => merge$3(model, layerSubagentModel(model));
|
|
25664
|
-
const modelLayer = (provider, model, effort) => provider === "openai" ? withSubagentModel(modelWebSocket(model, { reasoning: { effort } })).pipe(provide$3(layerClient$2)) : provider === "xai" ? withSubagentModel(
|
|
25897
|
+
const modelLayer = (provider, model, effort) => provider === "openai" ? withSubagentModel(modelWebSocket$1(model, { reasoning: { effort } })).pipe(provide$3(layerClient$2)) : provider === "xai" ? withSubagentModel(modelWebSocket(model, { reasoning: { effort } })).pipe(provide$3(layerClient)) : withSubagentModel(model$1(model, { reasoning: { effort } })).pipe(provide$3(layerClient$1));
|
|
25665
25898
|
const isProvider = (provider) => providers.includes(provider);
|
|
25666
25899
|
const parseModelId = (modelId) => {
|
|
25667
25900
|
const [provider, model, effort, ...rest] = modelId.split("/");
|
|
@@ -25712,10 +25945,10 @@ const Search = (directory) => unwrap$1(gen(function* () {
|
|
|
25712
25945
|
return empty$9;
|
|
25713
25946
|
}
|
|
25714
25947
|
const path = yield* Path$3;
|
|
25715
|
-
return (yield* promise(() => import("./SemanticSearch-
|
|
25948
|
+
return (yield* promise(() => import("./SemanticSearch-BJGnYhFt.mjs"))).layer({
|
|
25716
25949
|
directory: process.cwd(),
|
|
25717
25950
|
database: path.join(directory, "search.sqlite")
|
|
25718
|
-
}).pipe(provide$3(model$
|
|
25951
|
+
}).pipe(provide$3(model$2("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$5({ apiKey: apiKey.value })));
|
|
25719
25952
|
})).pipe(provide$3([layer$8, HttpClientLive]));
|
|
25720
25953
|
const acpModel = String$1("model").pipe(withAlias("m"), withDescription$1("Default model as <provider>/<model>/<effort>, e.g. openai/gpt-6-astra/medium"), withSchema(ModelId), withDefault("openai/gpt-6-astra/medium"), map$1((modelId) => getOrThrow(parseModelId(modelId))));
|
|
25721
25954
|
const acp = make$28("acp", {
|
|
@@ -25726,7 +25959,7 @@ const acp = make$28("acp", {
|
|
|
25726
25959
|
defaultModel: model.model,
|
|
25727
25960
|
defaultThoughtLevel: model.thoughtLevel,
|
|
25728
25961
|
makeAgent: (cwd) => make$2.pipe(provide$1(layerLocal$1({ directory: cwd }))),
|
|
25729
|
-
makeModel: (modelId, thoughtLevel) => map$
|
|
25962
|
+
makeModel: (modelId, thoughtLevel) => map$8(parseAcpModelId(modelId), ({ provider, model }) => modelLayer(provider, model, thoughtLevel))
|
|
25730
25963
|
})), provide(({ compaction }) => mergeAll(ConversationMode.layer(true), succeed$4(LogToStderr, true), layerLog, CompactionConfig.layer({ enabled: compaction }))));
|
|
25731
25964
|
make$28("clanka", {
|
|
25732
25965
|
provider,
|
|
@@ -25736,7 +25969,7 @@ make$28("clanka", {
|
|
|
25736
25969
|
compaction
|
|
25737
25970
|
}).pipe(withHandler(fnUntraced(function* ({ provider, model: modelRaw, semantic, prompt: nonInteractivePrompt }) {
|
|
25738
25971
|
const stdio = yield* Stdio;
|
|
25739
|
-
const OutputFormatter = yield* promise(() => import("./OutputFormatter-
|
|
25972
|
+
const OutputFormatter = yield* promise(() => import("./OutputFormatter-Ch8yFytV.mjs"));
|
|
25740
25973
|
const [model, reasoning] = (yield* match$2(modelRaw, {
|
|
25741
25974
|
onSome: succeed$2,
|
|
25742
25975
|
onNone: () => String$4({
|