clanka 0.7.7 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Acp.d.ts +4 -4
- package/dist/Acp.d.ts.map +1 -1
- package/dist/Acp.js +8 -6
- package/dist/Acp.js.map +1 -1
- package/dist/Acp.test.js +66 -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 +17 -7
- package/dist/Agent.js.map +1 -1
- package/dist/Agent.test.js +53 -8
- 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 +10 -2
- package/dist/AgentOutput.d.ts.map +1 -1
- package/dist/AgentOutput.js +10 -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 +1 -1
- 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-DvI8YVcR.mjs} +81 -387
- package/dist/bin/Effect-DvI8YVcR.mjs.map +1 -0
- package/dist/bin/{McpClient-zQibhsnA.mjs → McpClient-CM7u8ZVd.mjs} +3 -3
- package/dist/bin/{McpClient-zQibhsnA.mjs.map → McpClient-CM7u8ZVd.mjs.map} +1 -1
- package/dist/bin/{OutputFormatter-C7Awn0DS.mjs → OutputFormatter-BpggeGvI.mjs} +3 -3
- package/dist/bin/{OutputFormatter-C7Awn0DS.mjs.map → OutputFormatter-BpggeGvI.mjs.map} +1 -1
- package/dist/bin/{Schema-Bc06DxcV.mjs → Schema-DyJ738Wp.mjs} +1979 -1663
- package/dist/bin/Schema-DyJ738Wp.mjs.map +1 -0
- package/dist/bin/{SemanticSearch-BPxQoRSC.mjs → SemanticSearch-BHUGFT1y.mjs} +46 -42
- package/dist/bin/SemanticSearch-BHUGFT1y.mjs.map +1 -0
- package/dist/bin/{Stream-DlGXvw0L.mjs → Stream-Dg7AGCgJ.mjs} +60 -61
- package/dist/bin/Stream-Dg7AGCgJ.mjs.map +1 -0
- package/dist/bin/cli.mjs +614 -371
- 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 +107 -5
- package/src/Acp.ts +10 -8
- package/src/AcpImage.test.ts +9 -9
- package/src/Agent.test.ts +61 -9
- package/src/Agent.ts +20 -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 +10 -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 +3 -3
- 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-DvI8YVcR.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-Dg7AGCgJ.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-DyJ738Wp.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@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/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@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/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@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/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@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/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@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/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@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/MutableHashMap.js
|
|
342
342
|
const TypeId$32 = "~effect/MutableHashMap";
|
|
343
343
|
const MutableHashMapProto = {
|
|
344
344
|
[TypeId$32]: TypeId$32,
|
|
@@ -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@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/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,7 +479,7 @@ 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;
|
|
@@ -551,12 +551,12 @@ const invalidate$1 = (self_) => {
|
|
|
551
551
|
}));
|
|
552
552
|
};
|
|
553
553
|
//#endregion
|
|
554
|
-
//#region node_modules/.pnpm/effect@
|
|
554
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/RcRef.js
|
|
555
555
|
const make$38 = make$39;
|
|
556
556
|
const get = get$1;
|
|
557
557
|
const invalidate = invalidate$1;
|
|
558
558
|
//#endregion
|
|
559
|
-
//#region node_modules/.pnpm/effect@
|
|
559
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/FileSystem.js
|
|
560
560
|
const TypeId$30 = "~effect/FileSystem";
|
|
561
561
|
const FileSystem = Service("effect/FileSystem");
|
|
562
562
|
const make$37 = (impl) => FileSystem.of({
|
|
@@ -608,11 +608,11 @@ const make$37 = (impl) => FileSystem.of({
|
|
|
608
608
|
const FileTypeId = "~effect/FileSystem/File";
|
|
609
609
|
var WatchBackend = class extends Service()("effect/FileSystem/WatchBackend") {};
|
|
610
610
|
//#endregion
|
|
611
|
-
//#region node_modules/.pnpm/effect@
|
|
611
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Path.js
|
|
612
612
|
const TypeId$29 = "~effect/Path";
|
|
613
613
|
const Path$3 = Service("effect/Path");
|
|
614
614
|
//#endregion
|
|
615
|
-
//#region node_modules/.pnpm/effect@
|
|
615
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/Headers.js
|
|
616
616
|
const TypeId$28 = Symbol.for("~effect/http/Headers");
|
|
617
617
|
const Proto$15 = Object.defineProperties(Object.create(null), {
|
|
618
618
|
[TypeId$28]: { value: TypeId$28 },
|
|
@@ -694,7 +694,30 @@ const CurrentRedactedNames = Reference("effect/Headers/CurrentRedactedNames", {
|
|
|
694
694
|
"x-api-key"
|
|
695
695
|
] });
|
|
696
696
|
//#endregion
|
|
697
|
-
//#region node_modules/.pnpm/effect@
|
|
697
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/encoding/Base64Url.js
|
|
698
|
+
const decode$3 = (str) => {
|
|
699
|
+
const stripped = str.replace(/[\n\r]/g, "");
|
|
700
|
+
const length = stripped.length;
|
|
701
|
+
if (length % 4 === 1) return fail$1(new EncodingError({
|
|
702
|
+
module: "Base64Url",
|
|
703
|
+
kind: "Decode",
|
|
704
|
+
input: stripped,
|
|
705
|
+
message: `Length should be a multiple of 4, but is ${length}`
|
|
706
|
+
}));
|
|
707
|
+
if (!/^[-_A-Z0-9]*?={0,2}$/i.test(stripped)) return fail$1(new EncodingError({
|
|
708
|
+
module: "Base64Url",
|
|
709
|
+
kind: "Decode",
|
|
710
|
+
input: stripped,
|
|
711
|
+
message: "Invalid input"
|
|
712
|
+
}));
|
|
713
|
+
let sanitized = length % 4 === 2 ? `${stripped}==` : length % 4 === 3 ? `${stripped}=` : stripped;
|
|
714
|
+
sanitized = sanitized.replace(/-/g, "+").replace(/_/g, "/");
|
|
715
|
+
return decode$4(sanitized);
|
|
716
|
+
};
|
|
717
|
+
const decodeString = (str) => map$6(decode$3(str), (_) => decoder.decode(_));
|
|
718
|
+
const decoder = new TextDecoder();
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Terminal.js
|
|
698
721
|
const TypeId$27 = "~effect/Terminal";
|
|
699
722
|
const QuitErrorTypeId = "~effect/Terminal/QuitError";
|
|
700
723
|
var QuitError = class extends Error$3("QuitError")({ _tag: tag("QuitError") }) {
|
|
@@ -707,7 +730,7 @@ const make$35 = (impl) => Terminal.of({
|
|
|
707
730
|
[TypeId$27]: TypeId$27
|
|
708
731
|
});
|
|
709
732
|
//#endregion
|
|
710
|
-
//#region node_modules/.pnpm/effect@
|
|
733
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/ansi.js
|
|
711
734
|
const ESC = "\x1B[";
|
|
712
735
|
const BEL = "\x07";
|
|
713
736
|
const SEP = ";";
|
|
@@ -755,7 +778,7 @@ const eraseLines = (rows) => {
|
|
|
755
778
|
return command;
|
|
756
779
|
};
|
|
757
780
|
//#endregion
|
|
758
|
-
//#region node_modules/.pnpm/effect@
|
|
781
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/Prompt.js
|
|
759
782
|
const TypeId$26 = "~effect/cli/Prompt";
|
|
760
783
|
const isPrompt$1 = (u) => hasProperty(u, TypeId$26);
|
|
761
784
|
const defaultTheme = {
|
|
@@ -790,7 +813,7 @@ const makeTheme = (options) => ({
|
|
|
790
813
|
...process.platform === "win32" ? windowsTheme : defaultTheme,
|
|
791
814
|
...options
|
|
792
815
|
});
|
|
793
|
-
const Theme = Reference("effect/
|
|
816
|
+
const Theme = Reference("effect/cli/Prompt/Theme", { defaultValue: makeTheme });
|
|
794
817
|
const getTheme = (options) => map$5(Theme, (theme) => ({
|
|
795
818
|
...theme,
|
|
796
819
|
...options.theme
|
|
@@ -1036,7 +1059,7 @@ const eraseText = (text, columns) => {
|
|
|
1036
1059
|
};
|
|
1037
1060
|
const lines = (prompt, columns) => {
|
|
1038
1061
|
const lines = prompt.split(NEWLINE_REGEXP);
|
|
1039
|
-
return columns === 0 ? lines.length : pipe(map$
|
|
1062
|
+
return columns === 0 ? lines.length : pipe(map$7(lines, (line) => Math.ceil(line.length / columns)), reduce(0, (left, right) => left + right));
|
|
1040
1063
|
};
|
|
1041
1064
|
const clearOutputWithError = (outputText, columns, errorText) => {
|
|
1042
1065
|
if (errorText !== void 0 && errorText.length > 0) return cursorDown(lines(errorText, columns)) + eraseText(`\n${errorText}`, columns) + eraseText(outputText, columns);
|
|
@@ -1107,7 +1130,7 @@ const renderDateError = (state, pointer, theme) => {
|
|
|
1107
1130
|
const errorLines = state.error.value.split(NEWLINE_REGEXP);
|
|
1108
1131
|
if (isReadonlyArrayNonEmpty(errorLines)) {
|
|
1109
1132
|
const prefix = annotateSymbol(pointer, theme.errorColor);
|
|
1110
|
-
const lines = map$
|
|
1133
|
+
const lines = map$7(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
|
|
1111
1134
|
return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
|
|
1112
1135
|
}
|
|
1113
1136
|
}
|
|
@@ -1512,7 +1535,7 @@ const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, options)
|
|
|
1512
1535
|
return match$3(message.split(NEWLINE_REGEXP), {
|
|
1513
1536
|
onEmpty: () => renderLine(""),
|
|
1514
1537
|
onNonEmpty: (promptLines) => {
|
|
1515
|
-
const lines = map$
|
|
1538
|
+
const lines = map$7(promptLines, (line) => annotate(line));
|
|
1516
1539
|
return renderLine(lines.join("\n"));
|
|
1517
1540
|
}
|
|
1518
1541
|
});
|
|
@@ -1546,7 +1569,7 @@ const renderNumberError = (state, pointer, theme, renderOptions) => {
|
|
|
1546
1569
|
onNonEmpty: (errorLines) => {
|
|
1547
1570
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
1548
1571
|
const prefix = annotateSymbol(pointer, theme.errorColor);
|
|
1549
|
-
const lines = map$
|
|
1572
|
+
const lines = map$7(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
|
|
1550
1573
|
return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
|
|
1551
1574
|
}
|
|
1552
1575
|
});
|
|
@@ -1823,7 +1846,7 @@ const renderTextError = (nextState, pointer, theme, renderOptions) => {
|
|
|
1823
1846
|
onNonEmpty: (errorLines) => {
|
|
1824
1847
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
1825
1848
|
const prefix = annotateSymbol(pointer, theme.errorColor);
|
|
1826
|
-
const lines = map$
|
|
1849
|
+
const lines = map$7(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
|
|
1827
1850
|
return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
|
|
1828
1851
|
}
|
|
1829
1852
|
});
|
|
@@ -2051,7 +2074,7 @@ const entriesToDisplay = (cursor, total, maxVisible) => {
|
|
|
2051
2074
|
};
|
|
2052
2075
|
};
|
|
2053
2076
|
//#endregion
|
|
2054
|
-
//#region node_modules/.pnpm/effect@
|
|
2077
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/HttpBody.js
|
|
2055
2078
|
const TypeId$25 = "~effect/http/HttpBody";
|
|
2056
2079
|
var Proto$14 = class {
|
|
2057
2080
|
[TypeId$25];
|
|
@@ -2113,7 +2136,7 @@ const text = (body, contentType) => {
|
|
|
2113
2136
|
const jsonUnsafe = (body, contentType) => text(JSON.stringify(body), contentType ?? "application/json");
|
|
2114
2137
|
const urlParams = (urlParams, contentType) => text(toString(fromInput$1(urlParams)), contentType ?? "application/x-www-form-urlencoded");
|
|
2115
2138
|
//#endregion
|
|
2116
|
-
//#region node_modules/.pnpm/effect@
|
|
2139
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/HttpClientError.js
|
|
2117
2140
|
const TypeId$24 = "~effect/http/HttpClientError";
|
|
2118
2141
|
const isHttpClientError = (u) => hasProperty(u, TypeId$24);
|
|
2119
2142
|
var HttpClientError = class extends TaggedError("HttpClientError") {
|
|
@@ -2189,7 +2212,7 @@ var EmptyBodyError = class extends TaggedError("EmptyBodyError") {
|
|
|
2189
2212
|
}
|
|
2190
2213
|
};
|
|
2191
2214
|
//#endregion
|
|
2192
|
-
//#region node_modules/.pnpm/effect@
|
|
2215
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/HttpMethod.js
|
|
2193
2216
|
const allShort = [
|
|
2194
2217
|
["GET", "get"],
|
|
2195
2218
|
["POST", "post"],
|
|
@@ -2198,17 +2221,18 @@ const allShort = [
|
|
|
2198
2221
|
["PATCH", "patch"],
|
|
2199
2222
|
["HEAD", "head"],
|
|
2200
2223
|
["OPTIONS", "options"],
|
|
2201
|
-
["TRACE", "trace"]
|
|
2224
|
+
["TRACE", "trace"],
|
|
2225
|
+
["QUERY", "query"]
|
|
2202
2226
|
];
|
|
2203
2227
|
//#endregion
|
|
2204
|
-
//#region node_modules/.pnpm/effect@
|
|
2228
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/internal/httpBody.js
|
|
2205
2229
|
const updateHeaders$1 = (headers, body) => {
|
|
2206
2230
|
if (body._tag === "Empty" || body._tag === "FormData") return remove$1(remove$1(headers, "content-type"), "content-length");
|
|
2207
2231
|
headers = body.contentType === void 0 ? remove$1(headers, "content-type") : set(headers, "content-type", body.contentType);
|
|
2208
2232
|
return body.contentLength === void 0 ? remove$1(headers, "content-length") : set(headers, "content-length", body.contentLength.toString());
|
|
2209
2233
|
};
|
|
2210
2234
|
//#endregion
|
|
2211
|
-
//#region node_modules/.pnpm/effect@
|
|
2235
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/Url.js
|
|
2212
2236
|
var UrlError = class extends TaggedError("UrlError") {};
|
|
2213
2237
|
const make$34 = (url, params, hash) => try_$1({
|
|
2214
2238
|
try: () => {
|
|
@@ -2226,7 +2250,7 @@ const baseUrl = () => {
|
|
|
2226
2250
|
if ("location" in globalThis && globalThis.location !== void 0 && globalThis.location.origin !== void 0 && globalThis.location.pathname !== void 0) return location.origin + location.pathname;
|
|
2227
2251
|
};
|
|
2228
2252
|
//#endregion
|
|
2229
|
-
//#region node_modules/.pnpm/effect@
|
|
2253
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/HttpClientRequest.js
|
|
2230
2254
|
const TypeId$23 = "~effect/http/HttpClientRequest";
|
|
2231
2255
|
const Proto$13 = {
|
|
2232
2256
|
[TypeId$23]: TypeId$23,
|
|
@@ -2314,7 +2338,7 @@ function toUrl(self) {
|
|
|
2314
2338
|
return none();
|
|
2315
2339
|
}
|
|
2316
2340
|
//#endregion
|
|
2317
|
-
//#region node_modules/.pnpm/effect@
|
|
2341
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/HttpIncomingMessage.js
|
|
2318
2342
|
const TypeId$22 = "~effect/http/HttpIncomingMessage";
|
|
2319
2343
|
const schemaBodyJson = (schema, options) => {
|
|
2320
2344
|
const decode = decodeEffect(toCodecJson(schema));
|
|
@@ -2340,7 +2364,7 @@ const inspect = (self, that) => {
|
|
|
2340
2364
|
return obj;
|
|
2341
2365
|
};
|
|
2342
2366
|
//#endregion
|
|
2343
|
-
//#region node_modules/.pnpm/effect@
|
|
2367
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/HttpClientResponse.js
|
|
2344
2368
|
const TypeId$21 = "~effect/http/HttpClientResponse";
|
|
2345
2369
|
const fromWeb = (request, source) => new WebHttpClientResponse(request, source);
|
|
2346
2370
|
const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? succeed$2(self) : fail$2(new HttpClientError({ reason: new StatusCodeError({
|
|
@@ -2455,7 +2479,7 @@ var WebHttpClientResponse = class extends Class {
|
|
|
2455
2479
|
}
|
|
2456
2480
|
};
|
|
2457
2481
|
//#endregion
|
|
2458
|
-
//#region node_modules/.pnpm/effect@
|
|
2482
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/HttpTraceContext.js
|
|
2459
2483
|
const toHeaders = (span) => fromRecordUnsafe({
|
|
2460
2484
|
b3: `${span.traceId}-${span.spanId}-${span.sampled ? "1" : "0"}${match$2(span.parent, {
|
|
2461
2485
|
onNone: () => "",
|
|
@@ -2464,7 +2488,7 @@ const toHeaders = (span) => fromRecordUnsafe({
|
|
|
2464
2488
|
traceparent: `00-${span.traceId}-${span.spanId}-${span.sampled ? "01" : "00"}`
|
|
2465
2489
|
});
|
|
2466
2490
|
//#endregion
|
|
2467
|
-
//#region node_modules/.pnpm/effect@
|
|
2491
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/http/HttpClient.js
|
|
2468
2492
|
const TypeId$20 = "~effect/http/HttpClient";
|
|
2469
2493
|
const isHttpClient = (u) => hasProperty(u, TypeId$20);
|
|
2470
2494
|
const HttpClient = Service("effect/HttpClient");
|
|
@@ -2703,7 +2727,7 @@ const isTransientError = (error) => isTimeoutError(error) || isTransientHttpErro
|
|
|
2703
2727
|
const isTransientHttpError = (error) => isHttpClientError(error) && (error.reason._tag === "TransportError" || error.reason._tag === "StatusCodeError" && isTransientResponse(error.reason.response));
|
|
2704
2728
|
const isTransientResponse = (response) => response.status === 408 || response.status === 429 || response.status === 500 || response.status === 502 || response.status === 503 || response.status === 504;
|
|
2705
2729
|
//#endregion
|
|
2706
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
2730
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodeSink.js
|
|
2707
2731
|
const fromWritable = (options) => fromChannel(mapDone(fromWritableChannel(options), (_) => [_]));
|
|
2708
2732
|
const fromWritableChannel = (options) => fromTransform$1((pull) => {
|
|
2709
2733
|
const writable = options.evaluate();
|
|
@@ -2751,7 +2775,7 @@ const pullIntoWritable = (options) => options.pull.pipe(flatMap$1((chunk) => {
|
|
|
2751
2775
|
});
|
|
2752
2776
|
})));
|
|
2753
2777
|
//#endregion
|
|
2754
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
2778
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodeStream.js
|
|
2755
2779
|
const fromReadable = (options) => fromChannel$1(fromReadableChannel(options));
|
|
2756
2780
|
const fromReadableChannel = (options) => fromTransform$1((_, scope) => readableToPullUnsafe({
|
|
2757
2781
|
scope,
|
|
@@ -2834,7 +2858,7 @@ const readableToPullUnsafe = (options) => {
|
|
|
2834
2858
|
const defaultOnError = (error) => new UnknownError$1(error);
|
|
2835
2859
|
const toMaxBytes = (maxBytes) => maxBytes === void 0 || maxBytes === Infinity ? void 0 : Number(fromInputUnsafe(maxBytes));
|
|
2836
2860
|
//#endregion
|
|
2837
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
2861
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodeHttpIncomingMessage.js
|
|
2838
2862
|
var NodeHttpIncomingMessage = class extends Class {
|
|
2839
2863
|
[TypeId$22];
|
|
2840
2864
|
source;
|
|
@@ -2895,7 +2919,7 @@ var NodeHttpIncomingMessage = class extends Class {
|
|
|
2895
2919
|
}
|
|
2896
2920
|
};
|
|
2897
2921
|
//#endregion
|
|
2898
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
2922
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodeHttpClient.js
|
|
2899
2923
|
function noopErrorHandler(_) {}
|
|
2900
2924
|
var UndiciResponse = class extends Class {
|
|
2901
2925
|
[TypeId$22];
|
|
@@ -3142,7 +3166,7 @@ var NodeHttpResponse = class extends NodeHttpIncomingMessage {
|
|
|
3142
3166
|
};
|
|
3143
3167
|
const layerNodeHttpNoAgent = layerMergedContext(makeNodeHttp);
|
|
3144
3168
|
//#endregion
|
|
3145
|
-
//#region node_modules/.pnpm/effect@
|
|
3169
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Console.js
|
|
3146
3170
|
const Console = ConsoleRef;
|
|
3147
3171
|
const consoleWith = (f) => withFiber$1((fiber) => f(fiber.getRef(Console)));
|
|
3148
3172
|
const error = (...args) => consoleWith((console) => sync$1(() => {
|
|
@@ -3152,7 +3176,7 @@ const log = (...args) => consoleWith((console) => sync$1(() => {
|
|
|
3152
3176
|
console.log(...args);
|
|
3153
3177
|
}));
|
|
3154
3178
|
//#endregion
|
|
3155
|
-
//#region node_modules/.pnpm/effect@
|
|
3179
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Runtime.js
|
|
3156
3180
|
const defaultTeardown = (exit, onExit) => {
|
|
3157
3181
|
if (isSuccess$1(exit)) return onExit(0);
|
|
3158
3182
|
if (hasInterruptsOnly(exit.cause)) return onExit(130);
|
|
@@ -3191,7 +3215,7 @@ const getErrorReported = (u) => {
|
|
|
3191
3215
|
return true;
|
|
3192
3216
|
};
|
|
3193
3217
|
//#endregion
|
|
3194
|
-
//#region node_modules/.pnpm/effect@
|
|
3218
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Stdio.js
|
|
3195
3219
|
const TypeId$19 = "~effect/Stdio";
|
|
3196
3220
|
const Stdio = Service(TypeId$19);
|
|
3197
3221
|
const make$31 = (options) => ({
|
|
@@ -3201,7 +3225,7 @@ const make$31 = (options) => ({
|
|
|
3201
3225
|
...options
|
|
3202
3226
|
});
|
|
3203
3227
|
//#endregion
|
|
3204
|
-
//#region node_modules/.pnpm/effect@
|
|
3228
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/CliOutput.js
|
|
3205
3229
|
const Formatter = Reference("effect/cli/CliOutput", { defaultValue: () => defaultFormatter() });
|
|
3206
3230
|
const escapeControlCharacters = (text) => text.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, (character) => `\\x${character.charCodeAt(0).toString(16).padStart(2, "0")}`);
|
|
3207
3231
|
const defaultFormatter = (options) => {
|
|
@@ -3376,7 +3400,7 @@ const formatHelpDocImpl = (doc, colors) => {
|
|
|
3376
3400
|
return sections.join("\n");
|
|
3377
3401
|
};
|
|
3378
3402
|
//#endregion
|
|
3379
|
-
//#region node_modules/.pnpm/effect@
|
|
3403
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/completions/bash.js
|
|
3380
3404
|
const escapeForBash = (s) => s.replace(/'/g, "'\\''");
|
|
3381
3405
|
const sanitizeFunctionName = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
3382
3406
|
const flagNamesForWordlist = (flag) => {
|
|
@@ -3635,7 +3659,7 @@ const generate$3 = (executableName, descriptor) => {
|
|
|
3635
3659
|
return lines.join("\n");
|
|
3636
3660
|
};
|
|
3637
3661
|
//#endregion
|
|
3638
|
-
//#region node_modules/.pnpm/effect@
|
|
3662
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/completions/fish.js
|
|
3639
3663
|
const escapeFishString = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
|
3640
3664
|
const escapeFishChoice = (s) => escapeFishString(s.replace(/[^A-Za-z0-9_.,/@%+-]/gu, "\\$&"));
|
|
3641
3665
|
const subcommandCondition = (parentPath, childSubcommandNames) => {
|
|
@@ -3768,7 +3792,7 @@ const generate$2 = (executableName, descriptor) => {
|
|
|
3768
3792
|
return lines.join("\n");
|
|
3769
3793
|
};
|
|
3770
3794
|
//#endregion
|
|
3771
|
-
//#region node_modules/.pnpm/effect@
|
|
3795
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/completions/zsh.js
|
|
3772
3796
|
const escapeZsh = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:");
|
|
3773
3797
|
const escapeZshChoice = (s) => s.replace(/[^A-Za-z0-9_.,/@%+-]/gu, "\\$&").replace(/'/g, "'\\''");
|
|
3774
3798
|
const sanitize = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
@@ -3904,7 +3928,7 @@ const generate$1 = (executableName, descriptor) => {
|
|
|
3904
3928
|
return lines.join("\n");
|
|
3905
3929
|
};
|
|
3906
3930
|
//#endregion
|
|
3907
|
-
//#region node_modules/.pnpm/effect@
|
|
3931
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/Completions.js
|
|
3908
3932
|
const generate = (executableName, shell, descriptor) => {
|
|
3909
3933
|
switch (shell) {
|
|
3910
3934
|
case "bash": return generate$3(executableName, descriptor);
|
|
@@ -3913,7 +3937,7 @@ const generate = (executableName, shell, descriptor) => {
|
|
|
3913
3937
|
}
|
|
3914
3938
|
};
|
|
3915
3939
|
//#endregion
|
|
3916
|
-
//#region node_modules/.pnpm/effect@
|
|
3940
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ConfigProvider.js
|
|
3917
3941
|
function makeValue(value) {
|
|
3918
3942
|
return {
|
|
3919
3943
|
_tag: "Value",
|
|
@@ -4000,7 +4024,7 @@ function trieNodeAt(root, path) {
|
|
|
4000
4024
|
return node;
|
|
4001
4025
|
}
|
|
4002
4026
|
//#endregion
|
|
4003
|
-
//#region node_modules/.pnpm/effect@
|
|
4027
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Config.js
|
|
4004
4028
|
const TypeId$18 = "~effect/Config";
|
|
4005
4029
|
var ConfigError = class {
|
|
4006
4030
|
_tag = "ConfigError";
|
|
@@ -4169,7 +4193,7 @@ function Redacted(name) {
|
|
|
4169
4193
|
return schema$1(Redacted$1(String$5), name);
|
|
4170
4194
|
}
|
|
4171
4195
|
//#endregion
|
|
4172
|
-
//#region node_modules/.pnpm/effect@
|
|
4196
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/CliError.js
|
|
4173
4197
|
const TypeId$17 = "~effect/cli/CliError";
|
|
4174
4198
|
const isCliError = (u) => hasProperty(u, TypeId$17);
|
|
4175
4199
|
var UnrecognizedOption = class extends TaggedError$1(`${TypeId$17}/UnrecognizedOption`)("UnrecognizedOption", {
|
|
@@ -4271,7 +4295,7 @@ var ShowHelp = class extends TaggedError$1(`${TypeId$17}/ShowHelp`)("ShowHelp",
|
|
|
4271
4295
|
}
|
|
4272
4296
|
};
|
|
4273
4297
|
//#endregion
|
|
4274
|
-
//#region node_modules/.pnpm/effect@
|
|
4298
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/encoding/Yaml.js
|
|
4275
4299
|
const hasOwn = Object.prototype.hasOwnProperty;
|
|
4276
4300
|
const setProperty = (record, key, value) => {
|
|
4277
4301
|
Object.defineProperty(record, key, {
|
|
@@ -4281,43 +4305,55 @@ const setProperty = (record, key, value) => {
|
|
|
4281
4305
|
value
|
|
4282
4306
|
});
|
|
4283
4307
|
};
|
|
4284
|
-
const
|
|
4285
|
-
let
|
|
4286
|
-
let escaped = false;
|
|
4287
|
-
for (let index = 0; index < input.length; index++) {
|
|
4308
|
+
const closingQuote = (input, quote, start) => {
|
|
4309
|
+
for (let index = start; index < input.length; index++) {
|
|
4288
4310
|
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;
|
|
4311
|
+
if (quote === "\"" && character === "\\") index++;
|
|
4312
|
+
else if (character === quote) {
|
|
4313
|
+
if (quote === "'" && input[index + 1] === quote) index++;
|
|
4314
|
+
else return index;
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
return -1;
|
|
4318
|
+
};
|
|
4319
|
+
const findIndicator = (input, indicator) => {
|
|
4304
4320
|
let depth = 0;
|
|
4321
|
+
let tokenStart = true;
|
|
4305
4322
|
for (let index = 0; index < input.length; index++) {
|
|
4306
4323
|
const character = input[index];
|
|
4307
|
-
if (
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
} else if (
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
else if (
|
|
4324
|
+
if (tokenStart && (character === "'" || character === "\"")) {
|
|
4325
|
+
index = closingQuote(input, character, index + 1);
|
|
4326
|
+
if (index === -1) return -1;
|
|
4327
|
+
tokenStart = false;
|
|
4328
|
+
} else if (tokenStart && character === "&") while (index + 1 < input.length && !/[\s,[\]{}]/.test(input[index + 1])) index++;
|
|
4329
|
+
else if (character === "#" && (index === 0 || /\s/.test(input[index - 1]))) return indicator === "#" ? index : -1;
|
|
4330
|
+
else if (tokenStart && (character === "[" || character === "{")) depth++;
|
|
4331
|
+
else if (depth > 0 && (character === "]" || character === "}")) {
|
|
4332
|
+
depth--;
|
|
4333
|
+
tokenStart = false;
|
|
4334
|
+
} else if (depth > 0 && character === ",") tokenStart = true;
|
|
4335
|
+
else if (character === ":" && (depth > 0 || input[index + 1] === void 0 || /\s/.test(input[index + 1]))) {
|
|
4336
|
+
if (depth === 0 && indicator === ":") return index;
|
|
4337
|
+
tokenStart = true;
|
|
4338
|
+
} else if (tokenStart && character === "-" && /\s/.test(input[index + 1] ?? "")) continue;
|
|
4339
|
+
else if (!/\s/.test(character)) tokenStart = false;
|
|
4318
4340
|
}
|
|
4319
4341
|
return -1;
|
|
4320
4342
|
};
|
|
4343
|
+
const stripComment = (input) => {
|
|
4344
|
+
const index = findIndicator(input, "#");
|
|
4345
|
+
return index === -1 ? input : input.slice(0, index).trimEnd();
|
|
4346
|
+
};
|
|
4347
|
+
const mappingSeparator = (input) => findIndicator(input, ":");
|
|
4348
|
+
const isSequenceEntry = (text) => text === "-" || text.startsWith("- ");
|
|
4349
|
+
const foldLineBreak = (blankLines) => blankLines === 0 ? " " : "\n".repeat(blankLines);
|
|
4350
|
+
const endsWithEscape = (text) => /\\*$/.exec(text)[0].length % 2 === 1;
|
|
4351
|
+
const trimFoldedEnd = (line, quote) => {
|
|
4352
|
+
const trailing = /[ \t]+$/.exec(line);
|
|
4353
|
+
if (trailing === null) return line;
|
|
4354
|
+
const escaped = quote === "\"" && endsWithEscape(line.slice(0, trailing.index));
|
|
4355
|
+
return line.slice(0, trailing.index + (escaped ? 1 : 0));
|
|
4356
|
+
};
|
|
4321
4357
|
const parseDoubleQuoted = (input) => {
|
|
4322
4358
|
if (!input.endsWith("\"") || input.length < 2) throw new SyntaxError("Unterminated double-quoted YAML string");
|
|
4323
4359
|
let output = "";
|
|
@@ -4468,16 +4504,11 @@ var FlowParser = class {
|
|
|
4468
4504
|
return this.readUntil(/:/).trim();
|
|
4469
4505
|
}
|
|
4470
4506
|
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");
|
|
4507
|
+
const start = this.index;
|
|
4508
|
+
const end = closingQuote(this.input, quote, start + 1);
|
|
4509
|
+
if (end === -1) this.fail("Unterminated quoted scalar");
|
|
4510
|
+
this.index = end + 1;
|
|
4511
|
+
return this.input.slice(start, this.index);
|
|
4481
4512
|
}
|
|
4482
4513
|
readUntil(stop) {
|
|
4483
4514
|
const start = this.index;
|
|
@@ -4501,6 +4532,7 @@ var FlowParser = class {
|
|
|
4501
4532
|
var YamlParser = class {
|
|
4502
4533
|
lines;
|
|
4503
4534
|
index = 0;
|
|
4535
|
+
documentStarted = false;
|
|
4504
4536
|
anchors = new Map();
|
|
4505
4537
|
constructor(lines) {
|
|
4506
4538
|
this.lines = lines;
|
|
@@ -4508,23 +4540,23 @@ var YamlParser = class {
|
|
|
4508
4540
|
parse() {
|
|
4509
4541
|
this.skipIgnored();
|
|
4510
4542
|
if (this.index >= this.lines.length) return null;
|
|
4543
|
+
this.documentStarted = true;
|
|
4511
4544
|
const value = this.parseNode(this.lines[this.index].indent);
|
|
4512
4545
|
this.skipIgnored();
|
|
4513
4546
|
if (this.index < this.lines.length) this.fail(this.lines[this.index], "Unexpected content");
|
|
4514
4547
|
return value;
|
|
4515
4548
|
}
|
|
4516
|
-
parseNode(indent) {
|
|
4549
|
+
parseNode(indent, parentIndent = indent - 1) {
|
|
4517
4550
|
this.skipIgnored();
|
|
4518
4551
|
const line = this.lines[this.index];
|
|
4519
4552
|
if (line === void 0) return null;
|
|
4520
4553
|
if (line.indent !== indent) this.fail(line, `Expected indentation of ${indent} spaces`);
|
|
4521
|
-
if (line.text
|
|
4554
|
+
if (isSequenceEntry(line.text)) return this.parseSequence(indent);
|
|
4522
4555
|
if (mappingSeparator(line.text) !== -1) return this.parseMapping(indent);
|
|
4523
4556
|
this.index++;
|
|
4524
|
-
return this.
|
|
4557
|
+
return this.parseNodeValue(line.text, parentIndent);
|
|
4525
4558
|
}
|
|
4526
|
-
parseMapping(indent) {
|
|
4527
|
-
const output = {};
|
|
4559
|
+
parseMapping(indent, output = {}) {
|
|
4528
4560
|
while (true) {
|
|
4529
4561
|
this.skipIgnored();
|
|
4530
4562
|
const line = this.lines[this.index];
|
|
@@ -4538,8 +4570,8 @@ var YamlParser = class {
|
|
|
4538
4570
|
}
|
|
4539
4571
|
parseMappingEntry(output, text, separator, indent, line) {
|
|
4540
4572
|
const key = parseKey(text.slice(0, separator).trim());
|
|
4541
|
-
const rawValue = text.slice(separator + 1).
|
|
4542
|
-
const value = this.parseNodeValue(rawValue, indent);
|
|
4573
|
+
const rawValue = text.slice(separator + 1).trimStart();
|
|
4574
|
+
const value = this.parseNodeValue(rawValue, indent, true);
|
|
4543
4575
|
if (hasOwn.call(output, key)) this.fail(line, `Duplicate key '${key}'`);
|
|
4544
4576
|
setProperty(output, key, value);
|
|
4545
4577
|
}
|
|
@@ -4550,55 +4582,84 @@ var YamlParser = class {
|
|
|
4550
4582
|
const line = this.lines[this.index];
|
|
4551
4583
|
if (line === void 0 || line.indent < indent) return output;
|
|
4552
4584
|
if (line.indent > indent) this.fail(line, `Unexpected indentation of ${line.indent} spaces`);
|
|
4553
|
-
if (
|
|
4585
|
+
if (!isSequenceEntry(line.text)) return output;
|
|
4554
4586
|
this.index++;
|
|
4555
4587
|
const item = line.text.slice(1).trimStart();
|
|
4588
|
+
if (isSequenceEntry(item)) this.fail(line, "Compact nested block sequences are not supported");
|
|
4556
4589
|
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);
|
|
4590
|
+
if (separator === -1) output.push(this.parseNodeValue(item, indent));
|
|
4591
|
+
else {
|
|
4592
|
+
const mapping = {};
|
|
4593
|
+
this.parseMappingEntry(mapping, item, separator, indent + 2, line);
|
|
4594
|
+
output.push(this.parseMapping(indent + 2, mapping));
|
|
4572
4595
|
}
|
|
4573
|
-
output.push(mapping);
|
|
4574
4596
|
}
|
|
4575
4597
|
}
|
|
4576
|
-
parseNodeValue(rawValue, parentIndent) {
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
const
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
if (
|
|
4598
|
+
parseNodeValue(rawValue, parentIndent, allowIndentless = false) {
|
|
4599
|
+
const anchor = /^&([^\s,[\]{}]+)(?:\s+(.*))?$/.exec(rawValue);
|
|
4600
|
+
if (anchor === null) return this.parseValue(rawValue, parentIndent, allowIndentless);
|
|
4601
|
+
const value = this.parseValue(anchor[2] ?? "", parentIndent, allowIndentless);
|
|
4602
|
+
this.anchors.set(anchor[1], value);
|
|
4603
|
+
return value;
|
|
4604
|
+
}
|
|
4605
|
+
parseValue(value, parentIndent, allowIndentless) {
|
|
4606
|
+
const text = value.trimEnd();
|
|
4607
|
+
if (text.length === 0) {
|
|
4586
4608
|
this.skipIgnored();
|
|
4587
4609
|
const next = this.lines[this.index];
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
if (
|
|
4596
|
-
const name =
|
|
4610
|
+
if (next === void 0) return null;
|
|
4611
|
+
if (next.indent > parentIndent) return this.parseNode(next.indent, parentIndent);
|
|
4612
|
+
if (allowIndentless && next.indent === parentIndent && isSequenceEntry(next.text)) return this.parseSequence(parentIndent);
|
|
4613
|
+
return null;
|
|
4614
|
+
}
|
|
4615
|
+
if (/^[|>](?:[1-9]?[+-]?|[+-]?[1-9]?)$/.test(text)) return this.parseBlockScalar(text, parentIndent);
|
|
4616
|
+
if (value.startsWith("\"") || value.startsWith("'")) return this.parseQuotedValue(value, parentIndent);
|
|
4617
|
+
if (text.startsWith("*")) {
|
|
4618
|
+
const name = text.slice(1).trim();
|
|
4597
4619
|
if (!this.anchors.has(name)) throw new SyntaxError(`Unknown YAML alias '*${name}'`);
|
|
4598
4620
|
return this.anchors.get(name);
|
|
4599
4621
|
}
|
|
4600
|
-
if (
|
|
4601
|
-
return
|
|
4622
|
+
if (text.startsWith("[") || text.startsWith("{")) return new FlowParser(text, this.anchors).parse();
|
|
4623
|
+
return this.parsePlainValue(text, parentIndent);
|
|
4624
|
+
}
|
|
4625
|
+
parsePlainValue(value, parentIndent) {
|
|
4626
|
+
const first = this.lines[this.index - 1];
|
|
4627
|
+
if (/:(?:\s|$)/.test(value)) this.fail(first, "Invalid colon in plain scalar");
|
|
4628
|
+
let output = value;
|
|
4629
|
+
let terminated = findIndicator(first.raw, "#") !== -1;
|
|
4630
|
+
while (!terminated) {
|
|
4631
|
+
const blankLines = this.skipBlankLines();
|
|
4632
|
+
const next = this.lines[this.index];
|
|
4633
|
+
if (next === void 0 || next.indent <= parentIndent) break;
|
|
4634
|
+
const content = next.raw.slice(next.indent);
|
|
4635
|
+
const comment = content.search(/(?:^|[ \t])#/);
|
|
4636
|
+
const text = (comment === -1 ? content : content.slice(0, comment)).trimEnd();
|
|
4637
|
+
if (text.length === 0 || next.indent === 0 && /^(?:---|\.\.\.)(?:\s|$)/.test(text)) break;
|
|
4638
|
+
if (/:(?:\s|$)/.test(text)) this.fail(next, "Invalid colon in plain scalar");
|
|
4639
|
+
output += foldLineBreak(blankLines) + text;
|
|
4640
|
+
this.index++;
|
|
4641
|
+
terminated = comment !== -1;
|
|
4642
|
+
}
|
|
4643
|
+
return parseScalar(output);
|
|
4644
|
+
}
|
|
4645
|
+
parseQuotedValue(value, parentIndent) {
|
|
4646
|
+
const quote = value[0];
|
|
4647
|
+
let output = quote;
|
|
4648
|
+
let line = value.slice(1);
|
|
4649
|
+
while (true) {
|
|
4650
|
+
const end = closingQuote(line, quote, 0);
|
|
4651
|
+
if (end !== -1) {
|
|
4652
|
+
const rest = line.slice(end + 1);
|
|
4653
|
+
if (rest.trim().length > 0 && !/^[ \t]+#/.test(rest)) throw new SyntaxError("Unexpected content after quoted YAML scalar");
|
|
4654
|
+
return parseScalar(output + line.slice(0, end + 1));
|
|
4655
|
+
}
|
|
4656
|
+
if (quote === "\"" && endsWithEscape(line)) output += line.slice(0, -1);
|
|
4657
|
+
else output += trimFoldedEnd(line, quote) + foldLineBreak(this.skipBlankLines());
|
|
4658
|
+
const next = this.lines[this.index++];
|
|
4659
|
+
if (next === void 0) throw new SyntaxError("Unterminated quoted YAML scalar");
|
|
4660
|
+
if (next.raw.trim().length > 0 && next.indent <= parentIndent) this.fail(next, "Invalid quoted scalar indentation");
|
|
4661
|
+
line = next.raw.trimStart();
|
|
4662
|
+
}
|
|
4602
4663
|
}
|
|
4603
4664
|
parseBlockScalar(indicator, parentIndent) {
|
|
4604
4665
|
const style = indicator[0];
|
|
@@ -4644,13 +4705,23 @@ var YamlParser = class {
|
|
|
4644
4705
|
output = output.replace(/\n+$/, "");
|
|
4645
4706
|
return chomp === "strip" ? output : `${output}\n`;
|
|
4646
4707
|
}
|
|
4708
|
+
skipBlankLines() {
|
|
4709
|
+
const start = this.index;
|
|
4710
|
+
while (this.index < this.lines.length && this.lines[this.index].raw.trim().length === 0) this.index++;
|
|
4711
|
+
return this.index - start;
|
|
4712
|
+
}
|
|
4647
4713
|
skipIgnored() {
|
|
4648
4714
|
while (this.index < this.lines.length) {
|
|
4649
4715
|
const line = this.lines[this.index];
|
|
4650
|
-
|
|
4651
|
-
|
|
4716
|
+
const text = line.text.trimEnd();
|
|
4717
|
+
if (text.length === 0 || text.startsWith("%")) this.index++;
|
|
4718
|
+
else if (line.indent === 0 && text === "---") {
|
|
4719
|
+
if (this.documentStarted) this.fail(line, "Multiple YAML documents are not supported");
|
|
4720
|
+
this.documentStarted = true;
|
|
4721
|
+
this.index++;
|
|
4722
|
+
} else if (line.indent === 0 && text === "...") {
|
|
4652
4723
|
this.index++;
|
|
4653
|
-
while (this.index < this.lines.length && this.lines[this.index].text.length === 0) this.index++;
|
|
4724
|
+
while (this.index < this.lines.length && this.lines[this.index].text.trimEnd().length === 0) this.index++;
|
|
4654
4725
|
if (this.index < this.lines.length) this.fail(this.lines[this.index], "Multiple YAML documents are not supported");
|
|
4655
4726
|
} else return;
|
|
4656
4727
|
}
|
|
@@ -4673,7 +4744,7 @@ const parse = (input) => {
|
|
|
4673
4744
|
return new YamlParser(lines).parse();
|
|
4674
4745
|
};
|
|
4675
4746
|
//#endregion
|
|
4676
|
-
//#region node_modules/.pnpm/effect@
|
|
4747
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/Primitive.js
|
|
4677
4748
|
const Proto$9 = { ["~effect/cli/Primitive"]: { _A: identity } };
|
|
4678
4749
|
const isTrueLiteral = is(TrueLiterals);
|
|
4679
4750
|
const isFalseLiteral = is(FalseLiterals);
|
|
@@ -4735,7 +4806,7 @@ const getTypeName = (primitive) => {
|
|
|
4735
4806
|
const getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.choiceKeys : void 0;
|
|
4736
4807
|
const getPathType = (primitive) => primitive._tag === "Path" ? primitive.pathType : void 0;
|
|
4737
4808
|
//#endregion
|
|
4738
|
-
//#region node_modules/.pnpm/effect@
|
|
4809
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/Param.js
|
|
4739
4810
|
const TypeId$16 = "~effect/cli/Param";
|
|
4740
4811
|
const argumentKind = "argument";
|
|
4741
4812
|
const flagKind = "flag";
|
|
@@ -5021,7 +5092,7 @@ const getParamMetadata = (param) => {
|
|
|
5021
5092
|
});
|
|
5022
5093
|
};
|
|
5023
5094
|
//#endregion
|
|
5024
|
-
//#region node_modules/.pnpm/effect@
|
|
5095
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/Flag.js
|
|
5025
5096
|
const String$1 = (name) => String$2(flagKind, name);
|
|
5026
5097
|
const Boolean = (name) => Boolean$1(flagKind, name);
|
|
5027
5098
|
const ChoiceWithValue = (name, choices) => ChoiceWithValue$1(flagKind, name, choices);
|
|
@@ -5037,7 +5108,7 @@ const withFallbackPrompt = dual(2, (self, prompt) => withFallbackPrompt$1(self,
|
|
|
5037
5108
|
const map$1 = dual(2, (self, f) => map$2(self, f));
|
|
5038
5109
|
const withSchema = dual(2, (self, schema) => withSchema$1(self, schema));
|
|
5039
5110
|
//#endregion
|
|
5040
|
-
//#region node_modules/.pnpm/effect@
|
|
5111
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/config.js
|
|
5041
5112
|
const ConfigInternalTypeId = "~effect/cli/Command/Config/Internal";
|
|
5042
5113
|
const parseConfig = (config) => {
|
|
5043
5114
|
const orderedParams = [];
|
|
@@ -5089,7 +5160,7 @@ const reconstructTree = (tree, results) => {
|
|
|
5089
5160
|
}
|
|
5090
5161
|
};
|
|
5091
5162
|
//#endregion
|
|
5092
|
-
//#region node_modules/.pnpm/effect@
|
|
5163
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/command.js
|
|
5093
5164
|
const TypeId$15 = "~effect/cli/Command";
|
|
5094
5165
|
const toImpl = (self) => self;
|
|
5095
5166
|
const Proto$7 = { ...Prototype({
|
|
@@ -5146,7 +5217,7 @@ const makeCommand = (options) => {
|
|
|
5146
5217
|
if (visible.length === 0) continue;
|
|
5147
5218
|
subcommandDocs.push({
|
|
5148
5219
|
group: group.group,
|
|
5149
|
-
commands: map$
|
|
5220
|
+
commands: map$7(visible, (subcommand) => ({
|
|
5150
5221
|
name: subcommand.name,
|
|
5151
5222
|
alias: subcommand.alias,
|
|
5152
5223
|
shortDescription: subcommand.shortDescription,
|
|
@@ -5248,7 +5319,7 @@ const checkForDuplicateFlags = (parent, subcommands, options) => {
|
|
|
5248
5319
|
}
|
|
5249
5320
|
};
|
|
5250
5321
|
//#endregion
|
|
5251
|
-
//#region node_modules/.pnpm/effect@
|
|
5322
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/completions/descriptor.js
|
|
5252
5323
|
const toFlagType = (single) => {
|
|
5253
5324
|
switch (single.primitiveType._tag) {
|
|
5254
5325
|
case "Boolean": return { _tag: "Boolean" };
|
|
@@ -5349,7 +5420,7 @@ const fromCommand = (cmd, inheritedFlags = []) => {
|
|
|
5349
5420
|
};
|
|
5350
5421
|
};
|
|
5351
5422
|
//#endregion
|
|
5352
|
-
//#region node_modules/.pnpm/effect@
|
|
5423
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/help.js
|
|
5353
5424
|
const dedupeGlobalFlags = (flags) => {
|
|
5354
5425
|
const seen = new Set();
|
|
5355
5426
|
const deduped = [];
|
|
@@ -5435,7 +5506,7 @@ const getHelpForCommandPath = (command, commandPath, builtIns) => gen(function*
|
|
|
5435
5506
|
};
|
|
5436
5507
|
});
|
|
5437
5508
|
//#endregion
|
|
5438
|
-
//#region node_modules/.pnpm/effect@
|
|
5509
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/GlobalFlag.js
|
|
5439
5510
|
const Action = (options) => ({
|
|
5440
5511
|
_tag: "Action",
|
|
5441
5512
|
flag: options.flag,
|
|
@@ -5443,7 +5514,7 @@ const Action = (options) => ({
|
|
|
5443
5514
|
});
|
|
5444
5515
|
const Setting = (id) => (options) => {
|
|
5445
5516
|
settingIdCounter += 1;
|
|
5446
|
-
const ref = Service(`effect/
|
|
5517
|
+
const ref = Service(`effect/cli/GlobalFlag/${id}/${settingIdCounter}`);
|
|
5447
5518
|
return Object.assign(ref, {
|
|
5448
5519
|
_tag: "Setting",
|
|
5449
5520
|
id,
|
|
@@ -5476,7 +5547,7 @@ const Completions = Action({
|
|
|
5476
5547
|
"zsh",
|
|
5477
5548
|
"fish",
|
|
5478
5549
|
"sh"
|
|
5479
|
-
]).pipe(optional, map$1((v) => map$
|
|
5550
|
+
]).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
5551
|
run: fnUntraced(function* (shell, { command }) {
|
|
5481
5552
|
if (isNone(shell)) return;
|
|
5482
5553
|
const descriptor = fromCommand(command);
|
|
@@ -5502,11 +5573,11 @@ const BuiltIns = [
|
|
|
5502
5573
|
LogLevel
|
|
5503
5574
|
];
|
|
5504
5575
|
//#endregion
|
|
5505
|
-
//#region node_modules/.pnpm/effect@
|
|
5506
|
-
var CliConfig = class extends Reference("effect/
|
|
5576
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/CliConfig.js
|
|
5577
|
+
var CliConfig = class extends Reference("effect/cli/CliConfig", { defaultValue: () => defaults }) {};
|
|
5507
5578
|
const defaults = { builtIns: BuiltIns };
|
|
5508
5579
|
//#endregion
|
|
5509
|
-
//#region node_modules/.pnpm/effect@
|
|
5580
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/lexer.js
|
|
5510
5581
|
function lex(argv) {
|
|
5511
5582
|
const endIndex = argv.indexOf("--");
|
|
5512
5583
|
if (endIndex === -1) return {
|
|
@@ -5564,7 +5635,7 @@ const lexTokens = (args) => {
|
|
|
5564
5635
|
return tokens;
|
|
5565
5636
|
};
|
|
5566
5637
|
//#endregion
|
|
5567
|
-
//#region node_modules/.pnpm/effect@
|
|
5638
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/auto-suggest.js
|
|
5568
5639
|
const levenshtein = (a, b) => {
|
|
5569
5640
|
const m = a.length;
|
|
5570
5641
|
const n = b.length;
|
|
@@ -5584,7 +5655,7 @@ const suggest = (input, candidates) => {
|
|
|
5584
5655
|
return distances.filter(([d]) => d === minDistance).map(([, c]) => c);
|
|
5585
5656
|
};
|
|
5586
5657
|
//#endregion
|
|
5587
|
-
//#region node_modules/.pnpm/effect@
|
|
5658
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/parser.js
|
|
5588
5659
|
const getCommandPath = (parsedInput) => match$2(parsedInput.subcommand, {
|
|
5589
5660
|
onNone: () => [],
|
|
5590
5661
|
onSome: (subcommand) => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]
|
|
@@ -6012,7 +6083,7 @@ const scanCommandLevel = (tokens, context) => {
|
|
|
6012
6083
|
return toLeafResult(state);
|
|
6013
6084
|
};
|
|
6014
6085
|
//#endregion
|
|
6015
|
-
//#region node_modules/.pnpm/effect@
|
|
6086
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/internal/wizard.js
|
|
6016
6087
|
const run$2 = fnUntraced(function* (command, options) {
|
|
6017
6088
|
const commandPath = options?.commandPath ?? [command.name];
|
|
6018
6089
|
const selected = getCommandAtPath(command, commandPath);
|
|
@@ -6182,7 +6253,7 @@ const wrapCommand = (commandLine) => {
|
|
|
6182
6253
|
};
|
|
6183
6254
|
const formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
|
|
6184
6255
|
//#endregion
|
|
6185
|
-
//#region node_modules/.pnpm/effect@
|
|
6256
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/cli/Command.js
|
|
6186
6257
|
const isCommand = (u) => hasProperty(u, TypeId$15);
|
|
6187
6258
|
const make$28 = (name, config, handler) => {
|
|
6188
6259
|
const parsedConfig = parseConfig(config ?? {});
|
|
@@ -6420,7 +6491,7 @@ const runWith = (command, config) => {
|
|
|
6420
6491
|
}, 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
6492
|
};
|
|
6422
6493
|
//#endregion
|
|
6423
|
-
//#region node_modules/.pnpm/effect@
|
|
6494
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Brand.js
|
|
6424
6495
|
function nominal() {
|
|
6425
6496
|
return Object.assign((input) => input, {
|
|
6426
6497
|
option: (input) => some(input),
|
|
@@ -6429,7 +6500,7 @@ function nominal() {
|
|
|
6429
6500
|
});
|
|
6430
6501
|
}
|
|
6431
6502
|
//#endregion
|
|
6432
|
-
//#region node_modules/.pnpm/effect@
|
|
6503
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/process/ChildProcessSpawner.js
|
|
6433
6504
|
const ExitCode = nominal();
|
|
6434
6505
|
const ProcessId = nominal();
|
|
6435
6506
|
const HandleTypeId = "~effect/process/ChildProcessSpawner/ChildProcessHandle";
|
|
@@ -6458,7 +6529,7 @@ const make$27 = (spawn) => {
|
|
|
6458
6529
|
};
|
|
6459
6530
|
var ChildProcessSpawner = class extends Service()("effect/process/ChildProcessSpawner") {};
|
|
6460
6531
|
//#endregion
|
|
6461
|
-
//#region node_modules/.pnpm/effect@
|
|
6532
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/process/ChildProcess.js
|
|
6462
6533
|
const TypeId$14 = "~effect/process/ChildProcess";
|
|
6463
6534
|
const Proto$6 = {
|
|
6464
6535
|
...Prototype({
|
|
@@ -6572,7 +6643,7 @@ const concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || pre
|
|
|
6572
6643
|
...nextTokens.slice(1)
|
|
6573
6644
|
];
|
|
6574
6645
|
//#endregion
|
|
6575
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
6646
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
|
|
6576
6647
|
const buildSpawnOptions = (options, base, platform) => {
|
|
6577
6648
|
const detached = options.detached ?? platform !== "win32";
|
|
6578
6649
|
return {
|
|
@@ -6583,7 +6654,7 @@ const buildSpawnOptions = (options, base, platform) => {
|
|
|
6583
6654
|
};
|
|
6584
6655
|
};
|
|
6585
6656
|
//#endregion
|
|
6586
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
6657
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/internal/utils.js
|
|
6587
6658
|
const handleErrnoException = (module, method) => (err, [path]) => {
|
|
6588
6659
|
let reason = "Unknown";
|
|
6589
6660
|
switch (err.code) {
|
|
@@ -6617,7 +6688,7 @@ const handleErrnoException = (module, method) => (err, [path]) => {
|
|
|
6617
6688
|
});
|
|
6618
6689
|
};
|
|
6619
6690
|
//#endregion
|
|
6620
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
6691
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
|
|
6621
6692
|
const toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
|
|
6622
6693
|
const toPlatformError = (method, error, command) => {
|
|
6623
6694
|
const { commands } = flattenCommand(command);
|
|
@@ -6905,6 +6976,7 @@ const make$25 = gen(function* () {
|
|
|
6905
6976
|
if (yield* isDone(exitSignal)) {
|
|
6906
6977
|
const [code] = yield* _await(exitSignal);
|
|
6907
6978
|
if (code !== 0 && isNotNull(code)) yield* ignore(killProcessGroup(cmd, childProcess, cmd.options.killSignal ?? "SIGTERM"));
|
|
6979
|
+
else if (isReferenced && process.platform !== "win32" && cmd.options.detached !== false) yield* ignore(terminateProcessGroup(cmd, childProcess, exitSignal, cmd.options));
|
|
6908
6980
|
return;
|
|
6909
6981
|
}
|
|
6910
6982
|
if (!isReferenced) return;
|
|
@@ -7041,7 +7113,29 @@ const flattenCommand = (command) => {
|
|
|
7041
7113
|
};
|
|
7042
7114
|
};
|
|
7043
7115
|
//#endregion
|
|
7044
|
-
//#region node_modules/.pnpm/effect@
|
|
7116
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/internal/ulid.js
|
|
7117
|
+
const maxTimestamp = 2 ** 48 - 1;
|
|
7118
|
+
const base32Chars = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
7119
|
+
const ulidString = (timestampMillis, bytes) => {
|
|
7120
|
+
if (bytes.length !== 10) throw new Error(`ULID randomness must be exactly 10 bytes, received ${bytes.length}`);
|
|
7121
|
+
const timestamp = Math.min(Math.max(0, Math.trunc(timestampMillis)), maxTimestamp);
|
|
7122
|
+
let out = "";
|
|
7123
|
+
for (let shift = 45; shift >= 0; shift -= 5) out += base32Chars[Math.floor(timestamp / 2 ** shift) & 31];
|
|
7124
|
+
let accumulator = 0;
|
|
7125
|
+
let bits = 0;
|
|
7126
|
+
for (const byte of bytes) {
|
|
7127
|
+
accumulator = accumulator << 8 | byte;
|
|
7128
|
+
bits += 8;
|
|
7129
|
+
while (bits >= 5) {
|
|
7130
|
+
bits -= 5;
|
|
7131
|
+
out += base32Chars[accumulator >>> bits & 31];
|
|
7132
|
+
}
|
|
7133
|
+
accumulator &= (1 << bits) - 1;
|
|
7134
|
+
}
|
|
7135
|
+
return out;
|
|
7136
|
+
};
|
|
7137
|
+
//#endregion
|
|
7138
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/internal/uuid.js
|
|
7045
7139
|
const hex = (byte) => byte.toString(16).padStart(2, "0");
|
|
7046
7140
|
const stringify = (bytes) => {
|
|
7047
7141
|
return [
|
|
@@ -7074,7 +7168,7 @@ function v7Bytes(timestampMillis, bytes = randomBytes()) {
|
|
|
7074
7168
|
}
|
|
7075
7169
|
const v7String = (timestampMillis, bytes) => stringify(bytes === void 0 ? v7Bytes(timestampMillis) : v7Bytes(timestampMillis, bytes));
|
|
7076
7170
|
//#endregion
|
|
7077
|
-
//#region node_modules/.pnpm/effect@
|
|
7171
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Crypto.js
|
|
7078
7172
|
const TypeId$13 = "~effect/Crypto";
|
|
7079
7173
|
const Crypto = Service("effect/Crypto");
|
|
7080
7174
|
const make$24 = (impl) => {
|
|
@@ -7119,7 +7213,8 @@ const make$24 = (impl) => {
|
|
|
7119
7213
|
return buffer;
|
|
7120
7214
|
}),
|
|
7121
7215
|
randomUUIDv4: sync(() => v4String(randomBytesUnsafe(16))),
|
|
7122
|
-
randomUUIDv7: clockWith((clock) => succeed$2(v7String(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(16))))
|
|
7216
|
+
randomUUIDv7: clockWith((clock) => succeed$2(v7String(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(16)))),
|
|
7217
|
+
randomULID: clockWith((clock) => succeed$2(ulidString(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(10))))
|
|
7123
7218
|
});
|
|
7124
7219
|
};
|
|
7125
7220
|
const validateSize = (method, size) => Number.isSafeInteger(size) && size >= 0 ? succeed$2(size) : fail$2(badArgument({
|
|
@@ -7128,7 +7223,7 @@ const validateSize = (method, size) => Number.isSafeInteger(size) && size >= 0 ?
|
|
|
7128
7223
|
description: "size must be a non-negative safe integer"
|
|
7129
7224
|
}));
|
|
7130
7225
|
//#endregion
|
|
7131
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7226
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
|
|
7132
7227
|
const toHashAlgorithm = (algorithm) => {
|
|
7133
7228
|
switch (algorithm) {
|
|
7134
7229
|
case "SHA-1": return "sha1";
|
|
@@ -7153,10 +7248,10 @@ const make$23 = make$24({
|
|
|
7153
7248
|
});
|
|
7154
7249
|
const layer$18 = succeed$4(Crypto, make$23);
|
|
7155
7250
|
//#endregion
|
|
7156
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7251
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodeCrypto.js
|
|
7157
7252
|
const layer$17 = layer$18;
|
|
7158
7253
|
//#endregion
|
|
7159
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7254
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
|
|
7160
7255
|
const handleBadArgument = (method) => (err) => badArgument({
|
|
7161
7256
|
module: "FileSystem",
|
|
7162
7257
|
method,
|
|
@@ -7520,10 +7615,10 @@ const makeFileSystem = map$5(serviceOption(WatchBackend), (backend) => make$37({
|
|
|
7520
7615
|
}));
|
|
7521
7616
|
const layer$16 = effect(FileSystem)(makeFileSystem);
|
|
7522
7617
|
//#endregion
|
|
7523
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7618
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodeFileSystem.js
|
|
7524
7619
|
const layer$15 = layer$16;
|
|
7525
7620
|
//#endregion
|
|
7526
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7621
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodePath.js
|
|
7527
7622
|
const fileUrlOps = (windows) => ({
|
|
7528
7623
|
fromFileUrl: (url) => try_({
|
|
7529
7624
|
try: () => NodeUrl.fileURLToPath(url, { windows }),
|
|
@@ -7558,10 +7653,10 @@ const layer$14 = succeed$4(Path$3)({
|
|
|
7558
7653
|
...fileUrlOps(void 0)
|
|
7559
7654
|
});
|
|
7560
7655
|
//#endregion
|
|
7561
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7656
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodePath.js
|
|
7562
7657
|
const layer$13 = layer$14;
|
|
7563
7658
|
//#endregion
|
|
7564
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7659
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
|
|
7565
7660
|
const layer$12 = succeed$4(Stdio, make$31({
|
|
7566
7661
|
args: sync(() => process.argv.slice(2)),
|
|
7567
7662
|
stdinIsTerminal: sync(() => process.stdin.isTTY === true),
|
|
@@ -7598,10 +7693,10 @@ const layer$12 = succeed$4(Stdio, make$31({
|
|
|
7598
7693
|
})
|
|
7599
7694
|
}));
|
|
7600
7695
|
//#endregion
|
|
7601
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7696
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodeStdio.js
|
|
7602
7697
|
const layer$11 = layer$12;
|
|
7603
7698
|
//#endregion
|
|
7604
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7699
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
|
|
7605
7700
|
const make$22 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
|
|
7606
7701
|
const stdin = process.stdin;
|
|
7607
7702
|
const stdout = process.stdout;
|
|
@@ -7705,13 +7800,13 @@ function defaultShouldQuit(input) {
|
|
|
7705
7800
|
return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
|
|
7706
7801
|
}
|
|
7707
7802
|
//#endregion
|
|
7708
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7803
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodeTerminal.js
|
|
7709
7804
|
const layer$9 = layer$10;
|
|
7710
7805
|
//#endregion
|
|
7711
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7806
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodeServices.js
|
|
7712
7807
|
const layer$8 = provideMerge(layer$19, mergeAll(layer$15, layer$17, layer$13, layer$11, layer$9));
|
|
7713
7808
|
//#endregion
|
|
7714
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@
|
|
7809
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node-_030e452c69f408f48629a6c0e398166a/node_modules/@effect/platform-node-shared/dist/NodeRuntime.js
|
|
7715
7810
|
const runMain$1 = makeRunMain(({ fiber, teardown }) => {
|
|
7716
7811
|
let receivedSignal = false;
|
|
7717
7812
|
fiber.addObserver((exit) => {
|
|
@@ -7729,10 +7824,10 @@ const runMain$1 = makeRunMain(({ fiber, teardown }) => {
|
|
|
7729
7824
|
process.on("SIGTERM", onSigint);
|
|
7730
7825
|
});
|
|
7731
7826
|
//#endregion
|
|
7732
|
-
//#region node_modules/.pnpm/@effect+platform-node@
|
|
7827
|
+
//#region node_modules/.pnpm/@effect+platform-node@https+++pkg.pr.new+Effect-TS+effect+@effect+platform-node@24fa0ab_253e0b118100a6acaa31d05da031305b/node_modules/@effect/platform-node/dist/NodeRuntime.js
|
|
7733
7828
|
const runMain = runMain$1;
|
|
7734
7829
|
//#endregion
|
|
7735
|
-
//#region node_modules/.pnpm/effect@
|
|
7830
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/socket/Socket.js
|
|
7736
7831
|
const TypeId$12 = "~effect/socket/Socket";
|
|
7737
7832
|
const Socket = Service("effect/socket/Socket");
|
|
7738
7833
|
const make$21 = (options) => Socket.of({
|
|
@@ -7992,7 +8087,7 @@ const layerWebSocketConstructor = succeed$4(WebSocketConstructor)((url, options)
|
|
|
7992
8087
|
return new (webSocketWithOptions())(url, { headers: options.headers });
|
|
7993
8088
|
});
|
|
7994
8089
|
//#endregion
|
|
7995
|
-
//#region node_modules/.pnpm/effect@
|
|
8090
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/Prompt.js
|
|
7996
8091
|
const ProviderOptions = Record(String$5, NullOr(Json));
|
|
7997
8092
|
const PartTypeId$1 = "~effect/ai/Prompt/Part";
|
|
7998
8093
|
const BasePart$1 = Struct({
|
|
@@ -8205,7 +8300,7 @@ const fromResponseParts = (parts) => {
|
|
|
8205
8300
|
break;
|
|
8206
8301
|
case "file":
|
|
8207
8302
|
assistantParts.push(makePart$1("file", {
|
|
8208
|
-
data:
|
|
8303
|
+
data: encode(part.data),
|
|
8209
8304
|
mediaType: part.mediaType,
|
|
8210
8305
|
options: part.metadata
|
|
8211
8306
|
}));
|
|
@@ -8252,11 +8347,11 @@ const setSystem = dual(2, (self, content) => {
|
|
|
8252
8347
|
return makePrompt(messages);
|
|
8253
8348
|
});
|
|
8254
8349
|
//#endregion
|
|
8255
|
-
//#region node_modules/.pnpm/effect@
|
|
8350
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/UndefinedOr.js
|
|
8256
8351
|
const map = dual(2, (self, f) => self === void 0 ? void 0 : f(self));
|
|
8257
8352
|
const match$1 = dual(2, (self, { onDefined, onUndefined }) => self === void 0 ? onUndefined() : onDefined(self));
|
|
8258
8353
|
//#endregion
|
|
8259
|
-
//#region node_modules/.pnpm/effect@
|
|
8354
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/persistence/KeyValueStore.js
|
|
8260
8355
|
const TypeId$10 = "~effect/persistence/KeyValueStore";
|
|
8261
8356
|
const ErrorTypeId = "~effect/persistence/KeyValueStore/KeyValueStoreError";
|
|
8262
8357
|
var KeyValueStoreError = class extends TaggedError("KeyValueStoreError") {
|
|
@@ -8373,7 +8468,7 @@ const toSchemaStore = (self, schema) => {
|
|
|
8373
8468
|
};
|
|
8374
8469
|
};
|
|
8375
8470
|
//#endregion
|
|
8376
|
-
//#region node_modules/.pnpm/effect@
|
|
8471
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/AiError.js
|
|
8377
8472
|
const HttpRequestDetails$1 = Struct({
|
|
8378
8473
|
method: Literals$2([
|
|
8379
8474
|
"GET",
|
|
@@ -8383,7 +8478,8 @@ const HttpRequestDetails$1 = Struct({
|
|
|
8383
8478
|
"DELETE",
|
|
8384
8479
|
"HEAD",
|
|
8385
8480
|
"OPTIONS",
|
|
8386
|
-
"TRACE"
|
|
8481
|
+
"TRACE",
|
|
8482
|
+
"QUERY"
|
|
8387
8483
|
]),
|
|
8388
8484
|
url: String$5,
|
|
8389
8485
|
urlParams: ArraySchema(Tuple([String$5, String$5])),
|
|
@@ -8810,7 +8906,7 @@ const reasonFromHttpStatus = (params) => {
|
|
|
8810
8906
|
}
|
|
8811
8907
|
};
|
|
8812
8908
|
//#endregion
|
|
8813
|
-
//#region node_modules/.pnpm/effect@
|
|
8909
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/FiberSet.js
|
|
8814
8910
|
const TypeId$8 = "~effect/FiberSet";
|
|
8815
8911
|
const isFiberSet = (u) => hasProperty(u, TypeId$8);
|
|
8816
8912
|
const Proto$4 = {
|
|
@@ -8889,12 +8985,12 @@ const awaitEmpty = (self) => whileLoop({
|
|
|
8889
8985
|
step: constVoid
|
|
8890
8986
|
});
|
|
8891
8987
|
//#endregion
|
|
8892
|
-
//#region node_modules/.pnpm/effect@
|
|
8988
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Random.js
|
|
8893
8989
|
const Random = Random$1;
|
|
8894
8990
|
const randomWith = (f) => withFiber((fiber) => succeed$2(f(fiber.getRef(Random))));
|
|
8895
8991
|
const next = randomWith((r) => r.nextDoubleUnsafe());
|
|
8896
8992
|
//#endregion
|
|
8897
|
-
//#region node_modules/.pnpm/effect@
|
|
8993
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/IdGenerator.js
|
|
8898
8994
|
var IdGenerator = class extends Service()("@effect/ai/IdGenerator") {};
|
|
8899
8995
|
const DEFAULT_ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
8900
8996
|
const DEFAULT_SEPARATOR = "_";
|
|
@@ -8914,7 +9010,7 @@ const makeGenerator = ({ alphabet = DEFAULT_ALPHABET, prefix, separator = DEFAUL
|
|
|
8914
9010
|
};
|
|
8915
9011
|
const defaultIdGenerator = { generateId: makeGenerator({ prefix: "id" }) };
|
|
8916
9012
|
//#endregion
|
|
8917
|
-
//#region node_modules/.pnpm/effect@
|
|
9013
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/Tool.js
|
|
8918
9014
|
const TypeId$7 = "~effect/ai/Tool";
|
|
8919
9015
|
const ProviderDefinedTypeId = "~effect/ai/Tool/ProviderDefined";
|
|
8920
9016
|
const DynamicTypeId = "~effect/ai/Tool/Dynamic";
|
|
@@ -9067,7 +9163,7 @@ function isEmptyParamsRecord(indexSignature) {
|
|
|
9067
9163
|
return indexSignature.parameter === string && isNever(indexSignature.type);
|
|
9068
9164
|
}
|
|
9069
9165
|
//#endregion
|
|
9070
|
-
//#region node_modules/.pnpm/effect@
|
|
9166
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/internal/structured-output.js
|
|
9071
9167
|
const REST_PROPERTY_NAME = "__rest__";
|
|
9072
9168
|
const TAIL_PROPERTY_PREFIX = "__tail_";
|
|
9073
9169
|
const RECORD_DESCRIPTION = "Object encoded as array of [key, value] pairs. Apply object constraints to the decoded object";
|
|
@@ -9316,7 +9412,7 @@ function isJsonSchema(input) {
|
|
|
9316
9412
|
return typeof input === "object" && input !== null && !Array.isArray(input);
|
|
9317
9413
|
}
|
|
9318
9414
|
//#endregion
|
|
9319
|
-
//#region node_modules/.pnpm/effect@
|
|
9415
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/internal/codec-transformer.js
|
|
9320
9416
|
const makeDefaultCodecTransformer = (toJsonSchemaDocument) => {
|
|
9321
9417
|
return (codec) => {
|
|
9322
9418
|
const document = resolveTopLevelReference(toJsonSchemaDocument(codec));
|
|
@@ -9330,7 +9426,7 @@ const makeDefaultCodecTransformer = (toJsonSchemaDocument) => {
|
|
|
9330
9426
|
};
|
|
9331
9427
|
const defaultCodecTransformer$1 = makeDefaultCodecTransformer(toJsonSchemaDocument);
|
|
9332
9428
|
//#endregion
|
|
9333
|
-
//#region node_modules/.pnpm/effect@
|
|
9429
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/Response.js
|
|
9334
9430
|
const PartTypeId = "~effect/ai/Response/Part";
|
|
9335
9431
|
const Part = (toolkit) => {
|
|
9336
9432
|
const toolCalls = [];
|
|
@@ -9577,7 +9673,7 @@ const ErrorPart = Struct({
|
|
|
9577
9673
|
error: Unknown
|
|
9578
9674
|
}).annotate({ identifier: "ErrorPart" });
|
|
9579
9675
|
//#endregion
|
|
9580
|
-
//#region node_modules/.pnpm/effect@
|
|
9676
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/ResponseIdTracker.js
|
|
9581
9677
|
var ResponseIdTracker = class extends Service()("effect/ai/ResponseIdTracker") {};
|
|
9582
9678
|
const make$15 = sync(() => {
|
|
9583
9679
|
const sentParts = new Map();
|
|
@@ -9623,7 +9719,7 @@ const make$15 = sync(() => {
|
|
|
9623
9719
|
};
|
|
9624
9720
|
});
|
|
9625
9721
|
//#endregion
|
|
9626
|
-
//#region node_modules/.pnpm/effect@
|
|
9722
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/Telemetry.js
|
|
9627
9723
|
const addSpanAttributes = (keyPrefix, transformKey) => (span, attributes) => {
|
|
9628
9724
|
for (const [key, value] of Object.entries(attributes)) if (isNotNullish(value)) span.attribute(`${keyPrefix}.${transformKey(key)}`, value);
|
|
9629
9725
|
};
|
|
@@ -9643,8 +9739,10 @@ const addGenAIAnnotations$2 = dual(2, (span, options) => {
|
|
|
9643
9739
|
});
|
|
9644
9740
|
var CurrentSpanTransformer = class extends Service()("effect/ai/Telemetry/CurrentSpanTransformer") {};
|
|
9645
9741
|
//#endregion
|
|
9646
|
-
//#region node_modules/.pnpm/effect@
|
|
9742
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/Toolkit.js
|
|
9647
9743
|
const TypeId$6 = "~effect/ai/Toolkit";
|
|
9744
|
+
const FailureOrigin = Reference("effect/ai/Toolkit/FailureOrigin", { defaultValue: () => "result" });
|
|
9745
|
+
const failureCause = (error, origin) => annotate$1(fail$4(error), make$42(FailureOrigin, origin));
|
|
9648
9746
|
const Proto$2 = {
|
|
9649
9747
|
...Prototype({
|
|
9650
9748
|
label: "Toolkit",
|
|
@@ -9672,7 +9770,7 @@ const Proto$2 = {
|
|
|
9672
9770
|
};
|
|
9673
9771
|
return {
|
|
9674
9772
|
tools,
|
|
9675
|
-
handle: fnUntraced(function* (name, params, toolCallId) {
|
|
9773
|
+
handle: fnUntraced(function* (name, params, toolCallId, options) {
|
|
9676
9774
|
const tool = Object.hasOwn(tools, name) ? tools[name] : void 0;
|
|
9677
9775
|
yield* annotateCurrentSpan({
|
|
9678
9776
|
tool: name,
|
|
@@ -9696,7 +9794,7 @@ const Proto$2 = {
|
|
|
9696
9794
|
description: cause.message
|
|
9697
9795
|
})
|
|
9698
9796
|
})));
|
|
9699
|
-
const decodedParamsResult = yield* result(schemas.decodeParameters(params));
|
|
9797
|
+
const decodedParamsResult = yield* result(schemas.decodeParameters(params, options));
|
|
9700
9798
|
if (isFailure(decodedParamsResult)) {
|
|
9701
9799
|
const error = make$18({
|
|
9702
9800
|
module: "Toolkit",
|
|
@@ -9706,10 +9804,11 @@ const Proto$2 = {
|
|
|
9706
9804
|
description: decodedParamsResult.failure.message
|
|
9707
9805
|
})
|
|
9708
9806
|
});
|
|
9709
|
-
if (tool.failureMode === "error") return yield* error;
|
|
9807
|
+
if (tool.failureMode === "error") return yield* failCause(failureCause(error, "parameters"));
|
|
9710
9808
|
return fromEffect(map$5(encodeResult(error, true), (encodedResult) => ({
|
|
9711
9809
|
result: error,
|
|
9712
9810
|
isFailure: true,
|
|
9811
|
+
failureOrigin: "parameters",
|
|
9713
9812
|
preliminary: false,
|
|
9714
9813
|
encodedResult
|
|
9715
9814
|
})));
|
|
@@ -9748,9 +9847,11 @@ const Proto$2 = {
|
|
|
9748
9847
|
};
|
|
9749
9848
|
return fromQueue(queue).pipe(catch_$1((error) => {
|
|
9750
9849
|
const normalizedError = normalizeError(error);
|
|
9751
|
-
|
|
9850
|
+
const failureOrigin = isSchemaError(error) ? "result" : "handler";
|
|
9851
|
+
return tool.failureMode === "error" ? failCause$3(failureCause(normalizedError, failureOrigin)) : succeed$5({
|
|
9752
9852
|
result: normalizedError,
|
|
9753
9853
|
isFailure: true,
|
|
9854
|
+
failureOrigin,
|
|
9754
9855
|
preliminary: false
|
|
9755
9856
|
});
|
|
9756
9857
|
}), mapEffect$1(fnUntraced(function* (output) {
|
|
@@ -9806,8 +9907,8 @@ const merge = (...toolkits) => {
|
|
|
9806
9907
|
return makeProto$2(tools);
|
|
9807
9908
|
};
|
|
9808
9909
|
//#endregion
|
|
9809
|
-
//#region node_modules/.pnpm/effect@
|
|
9810
|
-
const LanguageModel = Service("effect/
|
|
9910
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/LanguageModel.js
|
|
9911
|
+
const LanguageModel = Service("effect/ai/LanguageModel");
|
|
9811
9912
|
const TypeId$5 = "~effect/ai/LanguageModel";
|
|
9812
9913
|
const defaultCodecTransformer = defaultCodecTransformer$1;
|
|
9813
9914
|
var GenerateTextResponse = class {
|
|
@@ -9973,7 +10074,8 @@ const make$13 = fnUntraced(function* (params) {
|
|
|
9973
10074
|
...requestOptions,
|
|
9974
10075
|
prompt: fallbackPrompt,
|
|
9975
10076
|
incrementalPrompt: void 0,
|
|
9976
|
-
previousResponseId: void 0
|
|
10077
|
+
previousResponseId: void 0,
|
|
10078
|
+
incrementalFallback: true
|
|
9977
10079
|
};
|
|
9978
10080
|
return requestOptions.incrementalPrompt ? params.generateText(requestOptions).pipe(catchReason("AiError", "InvalidRequestError", (_) => params.generateText(fallbackOptions))) : params.generateText(requestOptions);
|
|
9979
10081
|
};
|
|
@@ -10089,7 +10191,8 @@ const make$13 = fnUntraced(function* (params) {
|
|
|
10089
10191
|
...requestOptions,
|
|
10090
10192
|
prompt: fallbackPrompt,
|
|
10091
10193
|
incrementalPrompt: void 0,
|
|
10092
|
-
previousResponseId: void 0
|
|
10194
|
+
previousResponseId: void 0,
|
|
10195
|
+
incrementalFallback: true
|
|
10093
10196
|
};
|
|
10094
10197
|
let emitted = false;
|
|
10095
10198
|
return requestOptions.incrementalPrompt ? params.streamText(requestOptions).pipe(tap$1((part) => sync(() => {
|
|
@@ -10205,7 +10308,10 @@ const make$13 = fnUntraced(function* (params) {
|
|
|
10205
10308
|
id: part.id,
|
|
10206
10309
|
name: part.name,
|
|
10207
10310
|
providerExecuted: false,
|
|
10208
|
-
|
|
10311
|
+
result: result.result,
|
|
10312
|
+
encodedResult: result.encodedResult,
|
|
10313
|
+
isFailure: result.isFailure,
|
|
10314
|
+
preliminary: result.preliminary
|
|
10209
10315
|
});
|
|
10210
10316
|
return sync(() => {
|
|
10211
10317
|
offerUnsafe(queue, toolResultPart);
|
|
@@ -10346,7 +10452,10 @@ const executeApprovedToolCalls = (approvals, toolkit, concurrency) => {
|
|
|
10346
10452
|
return makePart("tool-result", {
|
|
10347
10453
|
id: approval.toolCallId,
|
|
10348
10454
|
name: toolCall.name,
|
|
10349
|
-
|
|
10455
|
+
result: terminalResult.result,
|
|
10456
|
+
encodedResult: terminalResult.encodedResult,
|
|
10457
|
+
isFailure: terminalResult.isFailure,
|
|
10458
|
+
preliminary: terminalResult.preliminary,
|
|
10350
10459
|
providerExecuted: false
|
|
10351
10460
|
});
|
|
10352
10461
|
});
|
|
@@ -10424,11 +10533,14 @@ const resolveToolCalls = (content, toolkit, messages, concurrency) => {
|
|
|
10424
10533
|
preliminary: false
|
|
10425
10534
|
}));
|
|
10426
10535
|
}
|
|
10427
|
-
if (approvedToolCallIds.has(toolCall.id)) return toolkit.handle(toolCall.name, toolCall.params, toolCall.id).pipe(unwrap$3, map$
|
|
10536
|
+
if (approvedToolCallIds.has(toolCall.id)) return toolkit.handle(toolCall.name, toolCall.params, toolCall.id).pipe(unwrap$3, map$9((result) => makePart("tool-result", {
|
|
10428
10537
|
id: toolCall.id,
|
|
10429
10538
|
name: toolCall.name,
|
|
10430
10539
|
providerExecuted: false,
|
|
10431
|
-
|
|
10540
|
+
result: result.result,
|
|
10541
|
+
encodedResult: result.encodedResult,
|
|
10542
|
+
isFailure: result.isFailure,
|
|
10543
|
+
preliminary: result.preliminary
|
|
10432
10544
|
})));
|
|
10433
10545
|
if (yield* isApprovalNeeded(tool, toolCall, messages)) {
|
|
10434
10546
|
const approvalId = yield* (yield* IdGenerator).generateId();
|
|
@@ -10437,11 +10549,14 @@ const resolveToolCalls = (content, toolkit, messages, concurrency) => {
|
|
|
10437
10549
|
toolCallId: toolCall.id
|
|
10438
10550
|
}));
|
|
10439
10551
|
}
|
|
10440
|
-
return toolkit.handle(toolCall.name, toolCall.params, toolCall.id).pipe(unwrap$3, map$
|
|
10552
|
+
return toolkit.handle(toolCall.name, toolCall.params, toolCall.id).pipe(unwrap$3, map$9((result) => makePart("tool-result", {
|
|
10441
10553
|
id: toolCall.id,
|
|
10442
10554
|
name: toolCall.name,
|
|
10443
10555
|
providerExecuted: false,
|
|
10444
|
-
|
|
10556
|
+
result: result.result,
|
|
10557
|
+
encodedResult: result.encodedResult,
|
|
10558
|
+
isFailure: result.isFailure,
|
|
10559
|
+
preliminary: result.preliminary
|
|
10445
10560
|
})));
|
|
10446
10561
|
}).pipe(unwrap$3));
|
|
10447
10562
|
return mergeAll$1(streams, { concurrency });
|
|
@@ -10816,7 +10931,7 @@ const partBytes = (part) => {
|
|
|
10816
10931
|
if (part.data instanceof Uint8Array) return some(part.data);
|
|
10817
10932
|
if (part.data instanceof URL) return none();
|
|
10818
10933
|
const base64 = part.data.startsWith("data:") ? part.data.slice(part.data.indexOf(",") + 1) : part.data;
|
|
10819
|
-
const decoded =
|
|
10934
|
+
const decoded = decode$4(base64);
|
|
10820
10935
|
return decoded._tag === "Success" ? some(decoded.success) : none();
|
|
10821
10936
|
};
|
|
10822
10937
|
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 +11336,7 @@ const invalidParams = (message) => new RpcError({
|
|
|
11221
11336
|
});
|
|
11222
11337
|
const decodeBase64 = (data, what) => {
|
|
11223
11338
|
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 =
|
|
11339
|
+
const decoded = decode$4(data);
|
|
11225
11340
|
return decoded._tag === "Success" ? succeed$2(decoded.success) : fail$2(invalidParams(`Invalid base64 image data in ${what}`));
|
|
11226
11341
|
};
|
|
11227
11342
|
const fileNameOf = (uri) => {
|
|
@@ -11232,9 +11347,9 @@ const textContent = (text) => ({
|
|
|
11232
11347
|
type: "text",
|
|
11233
11348
|
text
|
|
11234
11349
|
});
|
|
11235
|
-
const imageContent = (part) => map$
|
|
11350
|
+
const imageContent = (part) => map$8(partBytes(part), (bytes) => ({
|
|
11236
11351
|
type: "image",
|
|
11237
|
-
data:
|
|
11352
|
+
data: encode(bytes),
|
|
11238
11353
|
mimeType: part.mediaType
|
|
11239
11354
|
}));
|
|
11240
11355
|
const historyUpdates = (history) => {
|
|
@@ -11449,7 +11564,9 @@ const make$12 = fnUntraced(function* (options) {
|
|
|
11449
11564
|
sessionUpdate: "usage_update",
|
|
11450
11565
|
usage: {
|
|
11451
11566
|
inputTokens: part.inputTokens,
|
|
11452
|
-
outputTokens: part.outputTokens
|
|
11567
|
+
outputTokens: part.outputTokens,
|
|
11568
|
+
cacheRead: part.cacheRead,
|
|
11569
|
+
cacheWrite: part.cacheWrite
|
|
11453
11570
|
}
|
|
11454
11571
|
});
|
|
11455
11572
|
case "ErrorRetry": return update(session.id, {
|
|
@@ -11626,7 +11743,7 @@ const make$12 = fnUntraced(function* (options) {
|
|
|
11626
11743
|
const runStdio = (options) => gen(function* () {
|
|
11627
11744
|
const stdio = yield* Stdio;
|
|
11628
11745
|
const output = yield* make$44();
|
|
11629
|
-
const writer = yield* fromQueue(output).pipe(map$
|
|
11746
|
+
const writer = yield* fromQueue(output).pipe(map$9((line) => `${line}\n`), run$4(stdio.stdout()), forkScoped);
|
|
11630
11747
|
const server = yield* make$12({
|
|
11631
11748
|
...options,
|
|
11632
11749
|
send: (message) => offer(output, JSON.stringify(message)).pipe(asVoid)
|
|
@@ -11980,7 +12097,7 @@ var ExaError = class extends TaggedError$1()("ExaError", { cause: Defect() }) {}
|
|
|
11980
12097
|
const layer$7 = effect(ExaSearch, gen(function* () {
|
|
11981
12098
|
const scope$4 = yield* scope;
|
|
11982
12099
|
const getClient = yield* cachedWithTTL(gen(function* () {
|
|
11983
|
-
const McpClient = yield* tryPromise(() => import("./McpClient-
|
|
12100
|
+
const McpClient = yield* tryPromise(() => import("./McpClient-CM7u8ZVd.mjs"));
|
|
11984
12101
|
const context = yield* buildWithScope(McpClient.layer, scope$4);
|
|
11985
12102
|
return get$3(context, McpClient.McpClient);
|
|
11986
12103
|
}), (exit) => isSuccess$1(exit) ? infinity : zero);
|
|
@@ -12426,7 +12543,7 @@ ${prompt}`);
|
|
|
12426
12543
|
}));
|
|
12427
12544
|
const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$7, layer$6]));
|
|
12428
12545
|
const AgentToolHandlersTest = AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
|
|
12429
|
-
var ApplyPatchError = class extends TaggedClass("ApplyPatchError") {};
|
|
12546
|
+
var ApplyPatchError = class extends TaggedClass$1("ApplyPatchError") {};
|
|
12430
12547
|
//#endregion
|
|
12431
12548
|
//#region src/TypeBuilder.ts
|
|
12432
12549
|
const resolveDocumentation = resolveAt("documentation");
|
|
@@ -12750,6 +12867,7 @@ const discover = fnUntraced(function* (options) {
|
|
|
12750
12867
|
const entries = yield* fs.readDirectory(skillsDir).pipe(orElseSucceed(() => []));
|
|
12751
12868
|
entries.sort();
|
|
12752
12869
|
for (const entry of entries) {
|
|
12870
|
+
if (!(yield* fs.readDirectory(path.join(skillsDir, entry)).pipe(orElseSucceed(() => []))).includes("SKILL.md")) continue;
|
|
12753
12871
|
const location = path.join(skillsDir, entry, "SKILL.md");
|
|
12754
12872
|
const content = yield* option$1(fs.stat(location).pipe(filterOrFail((info) => info.type === "File"), andThen(() => fs.readFileString(location))));
|
|
12755
12873
|
if (isNone(content)) continue;
|
|
@@ -12809,7 +12927,7 @@ const renderLocation = (location) => {
|
|
|
12809
12927
|
return encoded.slice(1, -1) === location ? location : encoded;
|
|
12810
12928
|
};
|
|
12811
12929
|
//#endregion
|
|
12812
|
-
//#region node_modules/.pnpm/effect@
|
|
12930
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/workers/Transferable.js
|
|
12813
12931
|
var Collector = class extends Service()("effect/workers/Transferable/Collector") {};
|
|
12814
12932
|
const makeCollectorUnsafe = () => {
|
|
12815
12933
|
let tranferables = [];
|
|
@@ -12832,10 +12950,10 @@ const makeCollectorUnsafe = () => {
|
|
|
12832
12950
|
});
|
|
12833
12951
|
};
|
|
12834
12952
|
//#endregion
|
|
12835
|
-
//#region node_modules/.pnpm/effect@
|
|
12953
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/PrimaryKey.js
|
|
12836
12954
|
const symbol = "~effect/PrimaryKey";
|
|
12837
12955
|
//#endregion
|
|
12838
|
-
//#region node_modules/.pnpm/effect@
|
|
12956
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/rpc/RpcSchema.js
|
|
12839
12957
|
const StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
|
|
12840
12958
|
function isStreamSchema(schema) {
|
|
12841
12959
|
return hasProperty(schema, StreamSchemaTypeId);
|
|
@@ -12862,7 +12980,7 @@ var ClientAbort = class extends Service()("effect/rpc/RpcSchema/ClientAbort") {
|
|
|
12862
12980
|
}));
|
|
12863
12981
|
};
|
|
12864
12982
|
//#endregion
|
|
12865
|
-
//#region node_modules/.pnpm/effect@
|
|
12983
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/rpc/Rpc.js
|
|
12866
12984
|
const TypeId$4 = "~effect/rpc/Rpc";
|
|
12867
12985
|
const Proto$1 = {
|
|
12868
12986
|
[TypeId$4]: TypeId$4,
|
|
@@ -12990,7 +13108,7 @@ const exitSchema = (self) => {
|
|
|
12990
13108
|
const WrapperTypeId = "~effect/rpc/Rpc/Wrapper";
|
|
12991
13109
|
const isWrapper = (u) => WrapperTypeId in u;
|
|
12992
13110
|
//#endregion
|
|
12993
|
-
//#region node_modules/.pnpm/effect@
|
|
13111
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/rpc/RpcMessage.js
|
|
12994
13112
|
const RequestId = (id) => id;
|
|
12995
13113
|
const RequestIdSchema = Union([String$5, Number$2]);
|
|
12996
13114
|
const RequestEncodedSchema = Struct({
|
|
@@ -13033,7 +13151,7 @@ const EncodedSchema = Union([
|
|
|
13033
13151
|
Struct({ _tag: tag("Pong") })
|
|
13034
13152
|
]);
|
|
13035
13153
|
//#endregion
|
|
13036
|
-
//#region node_modules/.pnpm/effect@
|
|
13154
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/rpc/Utils.js
|
|
13037
13155
|
const withRunClient = (f) => suspend(() => {
|
|
13038
13156
|
const clientIds = new Set();
|
|
13039
13157
|
const clientBuffers = new Map();
|
|
@@ -13072,7 +13190,7 @@ const withRunClient = (f) => suspend(() => {
|
|
|
13072
13190
|
}));
|
|
13073
13191
|
});
|
|
13074
13192
|
//#endregion
|
|
13075
|
-
//#region node_modules/.pnpm/effect@
|
|
13193
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/rpc/RpcClient.js
|
|
13076
13194
|
let requestIdCounter = 0;
|
|
13077
13195
|
const makeNoSerialization = fnUntraced(function* (group, options) {
|
|
13078
13196
|
const spanPrefix = options?.spanPrefix ?? "RpcClient";
|
|
@@ -13186,7 +13304,7 @@ const makeNoSerialization = fnUntraced(function* (group, options) {
|
|
|
13186
13304
|
sampled: span.sampled
|
|
13187
13305
|
} : {},
|
|
13188
13306
|
headers: merge$1(fiber.getRef(CurrentHeaders), headers)
|
|
13189
|
-
}).pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity,
|
|
13307
|
+
}).pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity, onError((cause) => failCause$2(queue, cause)), interruptible, forkIn(scope, { startImmediately: true }));
|
|
13190
13308
|
return queue;
|
|
13191
13309
|
});
|
|
13192
13310
|
const getRpcClientMiddleware = (rpc) => {
|
|
@@ -13384,7 +13502,7 @@ const makeRpcSchemas = (codecFor) => {
|
|
|
13384
13502
|
if (entry !== void 0) return entry;
|
|
13385
13503
|
const streamSchemas = getStreamSchemas(rpc.successSchema);
|
|
13386
13504
|
entry = {
|
|
13387
|
-
decodeChunk: map$
|
|
13505
|
+
decodeChunk: map$8(streamSchemas, (streamSchemas) => decodeUnknownEffect$1(codecFor(NonEmptyArray(streamSchemas.success)))),
|
|
13388
13506
|
encodePayload: encodeEffect$1(codecFor(rpc.payloadSchema)),
|
|
13389
13507
|
decodeExit: decodeUnknownEffect$1(codecFor(exitSchema(rpc)))
|
|
13390
13508
|
};
|
|
@@ -13397,7 +13515,7 @@ var Protocol = class extends Service()("effect/rpc/RpcClient/Protocol") {
|
|
|
13397
13515
|
static make = withRunClient;
|
|
13398
13516
|
};
|
|
13399
13517
|
//#endregion
|
|
13400
|
-
//#region node_modules/.pnpm/effect@
|
|
13518
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/rpc/RpcGroup.js
|
|
13401
13519
|
const RpcGroupProto = {
|
|
13402
13520
|
add(...rpcs) {
|
|
13403
13521
|
const requests = new Map(this.requests);
|
|
@@ -14405,13 +14523,13 @@ var QueueWriteStream = class extends Writable {
|
|
|
14405
14523
|
}
|
|
14406
14524
|
};
|
|
14407
14525
|
//#endregion
|
|
14408
|
-
//#region node_modules/.pnpm/effect@
|
|
14409
|
-
const decode$1 = (schema) => () => {
|
|
14410
|
-
const decode = decodeEffect(NonEmptyArray(schema));
|
|
14526
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ChannelSchema.js
|
|
14527
|
+
const decode$1 = (schema, options) => () => {
|
|
14528
|
+
const decode = decodeEffect(NonEmptyArray(schema), options);
|
|
14411
14529
|
return fromTransform$1((upstream, _scope) => succeed$2(flatMap$1(upstream, (chunk) => decode(chunk))));
|
|
14412
14530
|
};
|
|
14413
14531
|
//#endregion
|
|
14414
|
-
//#region node_modules/.pnpm/effect@
|
|
14532
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/encoding/Sse.js
|
|
14415
14533
|
const SseErrorTypeId = "~effect/encoding/Sse/SseError";
|
|
14416
14534
|
var EventTooLarge = class extends TaggedError("EventTooLarge") {
|
|
14417
14535
|
get message() {
|
|
@@ -14453,7 +14571,7 @@ const decodeDataSchema = (schema, options) => {
|
|
|
14453
14571
|
...EventEncoded.fields,
|
|
14454
14572
|
data: fromJsonString(schema)
|
|
14455
14573
|
});
|
|
14456
|
-
return pipeTo(decode(options), map$
|
|
14574
|
+
return pipeTo(decode(options), map$10(decode$1(eventSchema)(), map$7((event) => ({
|
|
14457
14575
|
...event,
|
|
14458
14576
|
id: event.id
|
|
14459
14577
|
}))));
|
|
@@ -14572,7 +14690,7 @@ const Event = Struct({
|
|
|
14572
14690
|
data: String$5
|
|
14573
14691
|
});
|
|
14574
14692
|
const RetryTypeId = "~effect/encoding/Sse/Retry";
|
|
14575
|
-
var Retry = class Retry extends TaggedClass("Retry") {
|
|
14693
|
+
var Retry = class Retry extends TaggedClass$1("Retry") {
|
|
14576
14694
|
[RetryTypeId] = RetryTypeId;
|
|
14577
14695
|
static is(u) {
|
|
14578
14696
|
return hasProperty(u, RetryTypeId);
|
|
@@ -14582,7 +14700,7 @@ var Retry = class Retry extends TaggedClass("Retry") {
|
|
|
14582
14700
|
}
|
|
14583
14701
|
};
|
|
14584
14702
|
//#endregion
|
|
14585
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
14703
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/Generated.js
|
|
14586
14704
|
const AdminApiKey = Struct({
|
|
14587
14705
|
"object": Literal("organization.admin_api_key").annotate({ "description": "The object type, which is always `organization.admin_api_key`" }),
|
|
14588
14706
|
"id": String$5.annotate({ "description": "The identifier, which can be referenced in API endpoints" }),
|
|
@@ -18627,7 +18745,7 @@ const InputItem$1 = Union([
|
|
|
18627
18745
|
"title": "Search queries",
|
|
18628
18746
|
"description": "The search queries.\n"
|
|
18629
18747
|
})),
|
|
18630
|
-
"sources": optionalKey(ArraySchema(Struct({
|
|
18748
|
+
"sources": optionalKey(ArraySchema(Union([Struct({
|
|
18631
18749
|
"type": Literal("url").annotate({ "description": "The type of source. Always `url`.\n" }),
|
|
18632
18750
|
"url": String$5.annotate({
|
|
18633
18751
|
"description": "The URL of the source.\n",
|
|
@@ -18636,7 +18754,13 @@ const InputItem$1 = Union([
|
|
|
18636
18754
|
}).annotate({
|
|
18637
18755
|
"title": "Web search source",
|
|
18638
18756
|
"description": "A source used in the search.\n"
|
|
18639
|
-
})
|
|
18757
|
+
}), Struct({
|
|
18758
|
+
"type": Literal("api").annotate({ "description": "The type of source. Always `api`.\n" }),
|
|
18759
|
+
"name": String$5.annotate({ "description": "The name of the API source, such as `oai-weather`, `oai-sports`, or `oai-finance`.\n" })
|
|
18760
|
+
}).annotate({
|
|
18761
|
+
"title": "Web search API source",
|
|
18762
|
+
"description": "An API source used in the search.\n"
|
|
18763
|
+
})])).annotate({
|
|
18640
18764
|
"title": "Web search sources",
|
|
18641
18765
|
"description": "The sources used in the search.\n"
|
|
18642
18766
|
}))
|
|
@@ -19780,7 +19904,7 @@ const ListSkillVersionsParams = Struct({
|
|
|
19780
19904
|
});
|
|
19781
19905
|
var OpenAiClientErrorImpl = class extends Error$2 {};
|
|
19782
19906
|
//#endregion
|
|
19783
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
19907
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/internal/errors.js
|
|
19784
19908
|
const OpenAiErrorBody$1 = Struct({ error: Struct({
|
|
19785
19909
|
message: String$5,
|
|
19786
19910
|
type: optional$2(NullOr(String$5)),
|
|
@@ -19889,11 +20013,11 @@ const parseRateLimitHeaders$1 = (headers) => {
|
|
|
19889
20013
|
const retryAfterRaw = headers["retry-after"];
|
|
19890
20014
|
let retryAfter;
|
|
19891
20015
|
if (isNotUndefined(retryAfterRaw)) {
|
|
19892
|
-
const parsed = parse$
|
|
20016
|
+
const parsed = parse$1(retryAfterRaw);
|
|
19893
20017
|
if (isSome(parsed)) retryAfter = seconds(parsed.value);
|
|
19894
20018
|
}
|
|
19895
20019
|
const remainingRaw = headers["x-ratelimit-remaining-requests"];
|
|
19896
|
-
const remaining = isNotUndefined(remainingRaw) ? getOrNull(parse$
|
|
20020
|
+
const remaining = isNotUndefined(remainingRaw) ? getOrNull(parse$1(remainingRaw)) : null;
|
|
19897
20021
|
return {
|
|
19898
20022
|
retryAfter,
|
|
19899
20023
|
limit: headers["x-ratelimit-limit-requests"] ?? null,
|
|
@@ -19990,12 +20114,12 @@ const mapStatusCodeToReason$1 = ({ status, headers, message, metadata, http }) =
|
|
|
19990
20114
|
}
|
|
19991
20115
|
};
|
|
19992
20116
|
//#endregion
|
|
19993
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
20117
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/OpenAiConfig.js
|
|
19994
20118
|
var OpenAiConfig$1 = class OpenAiConfig$1 extends Service()("@effect/ai-openai/OpenAiConfig") {
|
|
19995
20119
|
static getOrUndefined = map$5(context(), getOrUndefined$1(OpenAiConfig$1));
|
|
19996
20120
|
};
|
|
19997
20121
|
//#endregion
|
|
19998
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
20122
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/OpenAiSchema.js
|
|
19999
20123
|
const UnknownRecord = Record(String$5, Unknown);
|
|
20000
20124
|
const JsonObject = Record(String$5, Unknown);
|
|
20001
20125
|
const MessageRole = Literals$2([
|
|
@@ -20195,6 +20319,44 @@ const RequestMessageItem = Struct({
|
|
|
20195
20319
|
status: optionalKey(MessageStatus),
|
|
20196
20320
|
content: Union([String$5, ArraySchema(InputContent)])
|
|
20197
20321
|
});
|
|
20322
|
+
const InputCodeInterpreterCall = Struct({
|
|
20323
|
+
id: String$5,
|
|
20324
|
+
type: Literal("code_interpreter_call"),
|
|
20325
|
+
code: optionalKey(NullOr(String$5)),
|
|
20326
|
+
container_id: String$5,
|
|
20327
|
+
outputs: optionalKey(NullOr(ArraySchema(Unknown))),
|
|
20328
|
+
status: optionalKey(Literals$2([
|
|
20329
|
+
"in_progress",
|
|
20330
|
+
"completed",
|
|
20331
|
+
"incomplete",
|
|
20332
|
+
"interpreting",
|
|
20333
|
+
"failed"
|
|
20334
|
+
]))
|
|
20335
|
+
});
|
|
20336
|
+
const InputFileSearchCall = Struct({
|
|
20337
|
+
id: String$5,
|
|
20338
|
+
type: Literal("file_search_call"),
|
|
20339
|
+
status: optionalKey(String$5),
|
|
20340
|
+
queries: optionalKey(ArraySchema(String$5)),
|
|
20341
|
+
results: optionalKey(NullOr(Unknown))
|
|
20342
|
+
});
|
|
20343
|
+
const InputImageGenerationCall = Struct({
|
|
20344
|
+
id: String$5,
|
|
20345
|
+
type: Literal("image_generation_call"),
|
|
20346
|
+
result: optionalKey(NullOr(String$5)),
|
|
20347
|
+
status: optionalKey(Literals$2([
|
|
20348
|
+
"in_progress",
|
|
20349
|
+
"completed",
|
|
20350
|
+
"generating",
|
|
20351
|
+
"failed"
|
|
20352
|
+
]))
|
|
20353
|
+
});
|
|
20354
|
+
const InputWebSearchCall = Struct({
|
|
20355
|
+
id: String$5,
|
|
20356
|
+
type: Literal("web_search_call"),
|
|
20357
|
+
action: optionalKey(Unknown),
|
|
20358
|
+
status: optionalKey(String$5)
|
|
20359
|
+
});
|
|
20198
20360
|
const InputItem = Union([
|
|
20199
20361
|
RequestMessageItem,
|
|
20200
20362
|
OutputMessage,
|
|
@@ -20207,7 +20369,11 @@ const InputItem = Union([
|
|
|
20207
20369
|
ShellCall,
|
|
20208
20370
|
ShellCallOutput,
|
|
20209
20371
|
ApplyPatchCallOutput,
|
|
20210
|
-
McpApprovalResponse
|
|
20372
|
+
McpApprovalResponse,
|
|
20373
|
+
InputCodeInterpreterCall,
|
|
20374
|
+
InputFileSearchCall,
|
|
20375
|
+
InputImageGenerationCall,
|
|
20376
|
+
InputWebSearchCall
|
|
20211
20377
|
]);
|
|
20212
20378
|
const FunctionTool = Struct({
|
|
20213
20379
|
type: Literal("function"),
|
|
@@ -20681,7 +20847,7 @@ const CreateEmbeddingResponse = Struct({
|
|
|
20681
20847
|
}))
|
|
20682
20848
|
});
|
|
20683
20849
|
//#endregion
|
|
20684
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
20850
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/OpenAiClient.js
|
|
20685
20851
|
var OpenAiClient$1 = class extends Service()("@effect/ai-openai/OpenAiClient") {};
|
|
20686
20852
|
const RedactedOpenAiHeaders$1 = {
|
|
20687
20853
|
OpenAiOrganization: "OpenAI-Organization",
|
|
@@ -20699,7 +20865,7 @@ const make$8 = fnUntraced(function* (options) {
|
|
|
20699
20865
|
SchemaError: (error) => fail$2(mapSchemaError$1(error, "createResponse"))
|
|
20700
20866
|
}))), withRedactedHeaders$1);
|
|
20701
20867
|
const buildResponseStream = (response) => {
|
|
20702
|
-
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$
|
|
20868
|
+
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({
|
|
20703
20869
|
Retry: (error) => die$2(error),
|
|
20704
20870
|
SseError: (error) => fail$5(mapSseError$1(error, "createResponseStream")),
|
|
20705
20871
|
HttpClientError: (error) => fromEffect(mapHttpClientError$1(error, "createResponseStream")),
|
|
@@ -20749,64 +20915,74 @@ const makeSocket = gen(function* () {
|
|
|
20749
20915
|
tracker.clearUnsafe();
|
|
20750
20916
|
return void_;
|
|
20751
20917
|
});
|
|
20752
|
-
const
|
|
20753
|
-
|
|
20754
|
-
|
|
20755
|
-
|
|
20756
|
-
|
|
20757
|
-
|
|
20758
|
-
|
|
20759
|
-
|
|
20760
|
-
reason:
|
|
20761
|
-
|
|
20762
|
-
|
|
20763
|
-
|
|
20764
|
-
|
|
20765
|
-
|
|
20766
|
-
|
|
20767
|
-
|
|
20768
|
-
|
|
20769
|
-
|
|
20770
|
-
|
|
20918
|
+
const connection = {
|
|
20919
|
+
current: void 0,
|
|
20920
|
+
send: (message) => writer.write(JSON.stringify({
|
|
20921
|
+
type: "response.create",
|
|
20922
|
+
...message
|
|
20923
|
+
})).pipe(mapError((_error) => make$18({
|
|
20924
|
+
module: "OpenAiClient",
|
|
20925
|
+
method: "createResponseStream",
|
|
20926
|
+
reason: new NetworkError({
|
|
20927
|
+
reason: "TransportError",
|
|
20928
|
+
request: {
|
|
20929
|
+
method: "POST",
|
|
20930
|
+
url: request.url,
|
|
20931
|
+
urlParams: [],
|
|
20932
|
+
hash: void 0,
|
|
20933
|
+
headers: request.headers
|
|
20934
|
+
},
|
|
20935
|
+
description: "Failed to send message over WebSocket"
|
|
20936
|
+
})
|
|
20937
|
+
})))
|
|
20938
|
+
};
|
|
20771
20939
|
const handleMessage = (msg) => {
|
|
20772
|
-
const
|
|
20940
|
+
const turn = connection.current;
|
|
20941
|
+
if (turn === void 0) return;
|
|
20942
|
+
let event;
|
|
20773
20943
|
try {
|
|
20774
|
-
|
|
20775
|
-
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20780
|
-
|
|
20781
|
-
|
|
20782
|
-
|
|
20783
|
-
|
|
20784
|
-
|
|
20785
|
-
|
|
20786
|
-
|
|
20787
|
-
|
|
20788
|
-
|
|
20789
|
-
|
|
20790
|
-
|
|
20791
|
-
|
|
20792
|
-
|
|
20793
|
-
|
|
20794
|
-
|
|
20944
|
+
event = decodeEvent(typeof msg === "string" ? msg : decoder.decode(msg));
|
|
20945
|
+
} catch {
|
|
20946
|
+
return;
|
|
20947
|
+
}
|
|
20948
|
+
if (event.type === "error") {
|
|
20949
|
+
const status = "status" in event ? Number(event.status) : NaN;
|
|
20950
|
+
const error = "error" in event ? event.error : event;
|
|
20951
|
+
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");
|
|
20952
|
+
const json = JSON.stringify(error);
|
|
20953
|
+
if (errorType === "previous_response_not_found") connection.current = void 0;
|
|
20954
|
+
failCauseUnsafe(turn, fail$4(make$18({
|
|
20955
|
+
module: "OpenAiClient",
|
|
20956
|
+
method: "createResponseStream",
|
|
20957
|
+
reason: reasonFromHttpStatus({
|
|
20958
|
+
description: json,
|
|
20959
|
+
status: errorType === "previous_response_not_found" ? 400 : isNaN(status) ? Object.hasOwn(errorTypeToStatus, errorType) ? errorTypeToStatus[errorType] : 500 : status,
|
|
20960
|
+
metadata: error,
|
|
20961
|
+
http: {
|
|
20962
|
+
body: json,
|
|
20963
|
+
request: {
|
|
20964
|
+
method: "POST",
|
|
20965
|
+
url: request.url,
|
|
20966
|
+
urlParams: [],
|
|
20967
|
+
hash: void 0,
|
|
20968
|
+
headers: request.headers
|
|
20795
20969
|
}
|
|
20796
|
-
}
|
|
20797
|
-
})
|
|
20798
|
-
}
|
|
20799
|
-
|
|
20800
|
-
}
|
|
20970
|
+
}
|
|
20971
|
+
})
|
|
20972
|
+
})));
|
|
20973
|
+
return;
|
|
20974
|
+
}
|
|
20975
|
+
offerUnsafe(turn, event);
|
|
20976
|
+
if (event.type === "response.completed" || event.type === "response.incomplete" || event.type === "response.failed") {
|
|
20977
|
+
connection.current = void 0;
|
|
20978
|
+
endUnsafe(turn);
|
|
20979
|
+
}
|
|
20801
20980
|
};
|
|
20802
20981
|
yield* gen(function* () {
|
|
20803
20982
|
const { pull } = yield* socket.reader;
|
|
20804
20983
|
while (true) {
|
|
20805
20984
|
const messages = yield* pull;
|
|
20806
|
-
for (let i = 0; i < messages.length; i++)
|
|
20807
|
-
const result = handleMessage(messages[i]);
|
|
20808
|
-
if (result !== void 0) yield* result;
|
|
20809
|
-
}
|
|
20985
|
+
for (let i = 0; i < messages.length; i++) handleMessage(messages[i]);
|
|
20810
20986
|
}
|
|
20811
20987
|
}).pipe(scoped, catchTag("SocketError", (error) => make$18({
|
|
20812
20988
|
module: "OpenAiClient",
|
|
@@ -20822,11 +20998,8 @@ const makeSocket = gen(function* () {
|
|
|
20822
20998
|
},
|
|
20823
20999
|
description: error.message
|
|
20824
21000
|
})
|
|
20825
|
-
})), catchCause((cause) => failCause$2(
|
|
20826
|
-
return
|
|
20827
|
-
send,
|
|
20828
|
-
incoming
|
|
20829
|
-
};
|
|
21001
|
+
})), catchCause((cause) => connection.current === void 0 ? void_ : failCause$2(connection.current, cause)), ensuring(forkIn(invalidate(queueRef), socketScope, { startImmediately: true })), forkScoped({ startImmediately: true }));
|
|
21002
|
+
return connection;
|
|
20830
21003
|
})
|
|
20831
21004
|
});
|
|
20832
21005
|
yield* scoped(get(queueRef));
|
|
@@ -20836,23 +21009,22 @@ const makeSocket = gen(function* () {
|
|
|
20836
21009
|
const stream = unwrap$3(gen(function* () {
|
|
20837
21010
|
const scope$2 = yield* scope;
|
|
20838
21011
|
yield* acquireRelease(semaphore.take(1), () => semaphore.release(1), { interruptible: true });
|
|
20839
|
-
const
|
|
20840
|
-
|
|
20841
|
-
|
|
20842
|
-
yield*
|
|
20843
|
-
|
|
20844
|
-
|
|
20845
|
-
return done;
|
|
20846
|
-
}));
|
|
21012
|
+
const connection = yield* get(queueRef);
|
|
21013
|
+
const turn = yield* unbounded();
|
|
21014
|
+
connection.current = turn;
|
|
21015
|
+
yield* addFinalizerExit(scope$2, () => connection.current === turn ? invalidate(queueRef) : void_);
|
|
21016
|
+
yield* connection.send(options).pipe(forkScoped({ startImmediately: true }));
|
|
21017
|
+
return fromQueue(turn);
|
|
20847
21018
|
}));
|
|
20848
21019
|
return succeed$2([fromWeb(request, new Response()), stream]);
|
|
20849
21020
|
} }).pipe(add(ResponseIdTracker, tracker));
|
|
20850
21021
|
});
|
|
20851
21022
|
const ErrorEvent = Struct({
|
|
20852
|
-
type: Literal("error"),
|
|
20853
|
-
status: Int$1
|
|
21023
|
+
type: Literal("error").pipe(withDecodingDefault(succeed$2("error"))),
|
|
21024
|
+
status: optionalKey(Int$1),
|
|
20854
21025
|
error: Struct({
|
|
20855
|
-
type: String$5,
|
|
21026
|
+
type: optional$2(String$5),
|
|
21027
|
+
code: optional$2(String$5),
|
|
20856
21028
|
message: String$5
|
|
20857
21029
|
})
|
|
20858
21030
|
});
|
|
@@ -20867,7 +21039,7 @@ const AllEvents = Union([ErrorEvent, ResponseStreamEvent]);
|
|
|
20867
21039
|
const decodeEvent = decodeUnknownSync(fromJsonString(AllEvents));
|
|
20868
21040
|
const layerWebSocketMode = effectContext(makeSocket);
|
|
20869
21041
|
//#endregion
|
|
20870
|
-
//#region node_modules/.pnpm/effect@
|
|
21042
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/RequestResolver.js
|
|
20871
21043
|
const TypeId$3 = "~effect/RequestResolver";
|
|
20872
21044
|
const RequestResolverProto = {
|
|
20873
21045
|
[TypeId$3]: {
|
|
@@ -20949,17 +21121,17 @@ const withSpan = dual((args) => isRequestResolver(args[0]), (self, name, options
|
|
|
20949
21121
|
})
|
|
20950
21122
|
}));
|
|
20951
21123
|
//#endregion
|
|
20952
|
-
//#region node_modules/.pnpm/effect@
|
|
20953
|
-
const EmbeddingModel = Service("effect/
|
|
21124
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/EmbeddingModel.js
|
|
21125
|
+
const EmbeddingModel = Service("effect/ai/EmbeddingModel");
|
|
20954
21126
|
const TypeId$2 = "~effect/ai/EmbeddingModel";
|
|
20955
|
-
var Dimensions = class extends Service()("effect/
|
|
21127
|
+
var Dimensions = class extends Service()("effect/ai/EmbeddingModel/Dimensions") {};
|
|
20956
21128
|
var EmbeddingUsage = class extends Class$1("effect/ai/EmbeddingModel/EmbeddingUsage")({ inputTokens: optional$2(Finite) }) {};
|
|
20957
21129
|
var EmbedResponse = class extends Class$1("effect/ai/EmbeddingModel/EmbedResponse")({ vector: ArraySchema(Finite) }) {};
|
|
20958
21130
|
var EmbedManyResponse = class extends Class$1("effect/ai/EmbeddingModel/EmbedManyResponse")({
|
|
20959
21131
|
embeddings: ArraySchema(EmbedResponse),
|
|
20960
21132
|
usage: EmbeddingUsage
|
|
20961
21133
|
}) {};
|
|
20962
|
-
var EmbeddingRequest = class extends TaggedClass
|
|
21134
|
+
var EmbeddingRequest = class extends TaggedClass("EmbeddingRequest") {};
|
|
20963
21135
|
const invalidProviderResponse = (description) => make$18({
|
|
20964
21136
|
module: "EmbeddingModel",
|
|
20965
21137
|
method: "embedMany",
|
|
@@ -20992,10 +21164,10 @@ const mapProviderResults = (inputLength, results) => {
|
|
|
20992
21164
|
return succeed$2(embeddings);
|
|
20993
21165
|
};
|
|
20994
21166
|
//#endregion
|
|
20995
|
-
//#region node_modules/.pnpm/effect@
|
|
21167
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/Model.js
|
|
20996
21168
|
const TypeId$1 = "~effect/ai/Model";
|
|
20997
|
-
var ProviderName = class extends Service()("effect/
|
|
20998
|
-
var ModelName = class extends Service()("effect/
|
|
21169
|
+
var ProviderName = class extends Service()("effect/ai/Model/ProviderName") {};
|
|
21170
|
+
var ModelName = class extends Service()("effect/ai/Model/ModelName") {};
|
|
20999
21171
|
const Proto = {
|
|
21000
21172
|
[TypeId$1]: TypeId$1,
|
|
21001
21173
|
["~effect/Layer"]: {
|
|
@@ -21017,9 +21189,9 @@ const Proto = {
|
|
|
21017
21189
|
};
|
|
21018
21190
|
const make$5 = (provider, modelName, layer) => Object.assign(Object.create(Proto), { provider }, merge$3(layer, succeedContext(ProviderName.context(provider).pipe(add(ModelName, modelName)))));
|
|
21019
21191
|
//#endregion
|
|
21020
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
21192
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/OpenAiEmbeddingModel.js
|
|
21021
21193
|
var Config$2 = class extends Service()("@effect/ai-openai/OpenAiEmbeddingModel/Config") {};
|
|
21022
|
-
const model$
|
|
21194
|
+
const model$2 = (model, options) => make$5("openai", model, merge$3(layer$4({
|
|
21023
21195
|
model,
|
|
21024
21196
|
config: {
|
|
21025
21197
|
...options.config,
|
|
@@ -21066,7 +21238,7 @@ const invalidOutput = (description) => make$18({
|
|
|
21066
21238
|
reason: new InvalidOutputError({ description })
|
|
21067
21239
|
});
|
|
21068
21240
|
//#endregion
|
|
21069
|
-
//#region node_modules/.pnpm/effect@
|
|
21241
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/ai/OpenAiStructuredOutput.js
|
|
21070
21242
|
function toCodecOpenAI(schema) {
|
|
21071
21243
|
const codec = toCodec(schema);
|
|
21072
21244
|
const document = resolveTopLevelReference(toJsonSchemaDocument(codec, {
|
|
@@ -21075,7 +21247,7 @@ function toCodecOpenAI(schema) {
|
|
|
21075
21247
|
}));
|
|
21076
21248
|
const jsonSchema = rewriteOpenAI(document.schema);
|
|
21077
21249
|
if (jsonSchema.type !== "object" || jsonSchema.anyOf !== void 0) throw new Error(`OpenAiStructuredOutput: Root JSON Schema must have type "object" and must not use "anyOf"`);
|
|
21078
|
-
if (Object.keys(document.definitions).length > 0) jsonSchema.$defs = map$
|
|
21250
|
+
if (Object.keys(document.definitions).length > 0) jsonSchema.$defs = map$11(document.definitions, rewriteOpenAI);
|
|
21079
21251
|
return {
|
|
21080
21252
|
codec,
|
|
21081
21253
|
jsonSchema
|
|
@@ -21274,7 +21446,7 @@ const formats = new Set([
|
|
|
21274
21446
|
"uuid"
|
|
21275
21447
|
]);
|
|
21276
21448
|
//#endregion
|
|
21277
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
21449
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/internal/utilities.js
|
|
21278
21450
|
const finishReasonMap$1 = {
|
|
21279
21451
|
content_filter: "content-filter",
|
|
21280
21452
|
function_call: "tool-calls",
|
|
@@ -21290,7 +21462,7 @@ const resolveFinishReason$1 = (finishReason, hasToolCalls) => {
|
|
|
21290
21462
|
return reason;
|
|
21291
21463
|
};
|
|
21292
21464
|
//#endregion
|
|
21293
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
21465
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/OpenAiTelemetry.js
|
|
21294
21466
|
const addOpenAiRequestAttributes$1 = addSpanAttributes("gen_ai.openai.request", camelToSnake);
|
|
21295
21467
|
const addOpenAiResponseAttributes$1 = addSpanAttributes("gen_ai.openai.response", camelToSnake);
|
|
21296
21468
|
const addGenAIAnnotations$1 = dual(2, (span, options) => {
|
|
@@ -21301,7 +21473,7 @@ const addGenAIAnnotations$1 = dual(2, (span, options) => {
|
|
|
21301
21473
|
}
|
|
21302
21474
|
});
|
|
21303
21475
|
//#endregion
|
|
21304
|
-
//#region node_modules/.pnpm/@effect+ai-openai@
|
|
21476
|
+
//#region node_modules/.pnpm/@effect+ai-openai@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai@24fa0ab_effect@_ad8b44c56063c2250840e50add3b7a66/node_modules/@effect/ai-openai/dist/OpenAiLanguageModel.js
|
|
21305
21477
|
ModelIdsResponses.members[1];
|
|
21306
21478
|
ModelIdsShared.members[1];
|
|
21307
21479
|
var Config$1 = class extends Service()("@effect/ai-openai/OpenAiLanguageModel/Config") {};
|
|
@@ -21334,7 +21506,7 @@ const make$3 = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
21334
21506
|
config,
|
|
21335
21507
|
options
|
|
21336
21508
|
});
|
|
21337
|
-
const { fileIdPrefixes: _fip, strictJsonSchema: _sjs, ...apiConfig } = config;
|
|
21509
|
+
const { fileIdPrefixes: _fip, strictJsonSchema: _sjs, useItemReferences: _uir, ...apiConfig } = config;
|
|
21338
21510
|
const request = {
|
|
21339
21511
|
...apiConfig,
|
|
21340
21512
|
input: messages,
|
|
@@ -21386,7 +21558,7 @@ const make$3 = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
21386
21558
|
options,
|
|
21387
21559
|
toolNameMapper
|
|
21388
21560
|
});
|
|
21389
|
-
}, (effect, options) => effect.pipe(unwrap$3, map$
|
|
21561
|
+
}, (effect, options) => effect.pipe(unwrap$3, map$9((response) => {
|
|
21390
21562
|
annotateStreamResponse$1(options.span, response);
|
|
21391
21563
|
return response;
|
|
21392
21564
|
})))
|
|
@@ -21400,7 +21572,9 @@ const withConfigOverride$1 = dual(2, (self, overrides) => flatMap$1(serviceOptio
|
|
|
21400
21572
|
const getSystemMessageMode$1 = (model) => model.startsWith("o") || model.startsWith("gpt-5") || model.startsWith("codex-") || model.startsWith("computer-use") ? "developer" : "system";
|
|
21401
21573
|
const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities, include, toolNameMapper }) {
|
|
21402
21574
|
const processedApprovalIds = new Set();
|
|
21575
|
+
const websocketMode = isSome(yield* serviceOption(OpenAiSocket));
|
|
21403
21576
|
const hasConversation = isNotNullish(config.conversation);
|
|
21577
|
+
const useItemReferences = config.store === true && config.useItemReferences !== false && options.incrementalFallback !== true;
|
|
21404
21578
|
const applyPatchTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiApplyPatch");
|
|
21405
21579
|
const codeInterpreterTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiCodeInterpreter");
|
|
21406
21580
|
const shellTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiShell");
|
|
@@ -21408,7 +21582,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21408
21582
|
const webSearchTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiWebSearch");
|
|
21409
21583
|
const webSearchPreviewTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiWebSearchPreview");
|
|
21410
21584
|
if (isNotUndefined(config.top_logprobs)) include.add("message.output_text.logprobs");
|
|
21411
|
-
if (
|
|
21585
|
+
if ((websocketMode || !useItemReferences) && capabilities.isReasoningModel) include.add("reasoning.encrypted_content");
|
|
21412
21586
|
if (codeInterpreterTool) include.add("code_interpreter_call.outputs");
|
|
21413
21587
|
if (webSearchTool || webSearchPreviewTool) include.add("web_search_call.action.sources");
|
|
21414
21588
|
const messages = [];
|
|
@@ -21445,7 +21619,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21445
21619
|
detail
|
|
21446
21620
|
});
|
|
21447
21621
|
else {
|
|
21448
|
-
const imageUrl = part.data instanceof URL ? part.data.toString() : part.data instanceof Uint8Array ? `data:${mediaType};base64,${
|
|
21622
|
+
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}`;
|
|
21449
21623
|
content.push({
|
|
21450
21624
|
type: "input_image",
|
|
21451
21625
|
image_url: imageUrl,
|
|
@@ -21462,7 +21636,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21462
21636
|
file_url: part.data.toString()
|
|
21463
21637
|
});
|
|
21464
21638
|
if (part.data instanceof Uint8Array) {
|
|
21465
|
-
const base64 =
|
|
21639
|
+
const base64 = encode(part.data);
|
|
21466
21640
|
const fileName = part.fileName ?? `part-${index}.pdf`;
|
|
21467
21641
|
const fileData = `data:application/pdf;base64,${base64}`;
|
|
21468
21642
|
content.push({
|
|
@@ -21486,11 +21660,17 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21486
21660
|
}
|
|
21487
21661
|
case "assistant": {
|
|
21488
21662
|
const reasoningMessages = Object.create(null);
|
|
21663
|
+
const providerExecutedParts = message.content.filter((part) => (part.type === "tool-call" || part.type === "tool-result") && part.providerExecuted);
|
|
21664
|
+
const unreplayableProviderItem = (name, id) => make$18({
|
|
21665
|
+
module: "OpenAiLanguageModel",
|
|
21666
|
+
method: "prepareMessages",
|
|
21667
|
+
reason: new InvalidRequestError({ description: `Cannot replay provider-executed tool item '${name}' ('${id}') losslessly` })
|
|
21668
|
+
});
|
|
21489
21669
|
for (const part of message.content) switch (part.type) {
|
|
21490
21670
|
case "text": {
|
|
21491
21671
|
const id = getItemId$1(part);
|
|
21492
21672
|
if (hasConversation && isNotNull(id)) break;
|
|
21493
|
-
if (
|
|
21673
|
+
if (useItemReferences && isNotNull(id)) {
|
|
21494
21674
|
messages.push({
|
|
21495
21675
|
type: "item_reference",
|
|
21496
21676
|
id
|
|
@@ -21517,7 +21697,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21517
21697
|
if (hasConversation && isNotNull(id)) break;
|
|
21518
21698
|
if (isNotNull(id)) {
|
|
21519
21699
|
const message = reasoningMessages[id];
|
|
21520
|
-
if (
|
|
21700
|
+
if (useItemReferences) {
|
|
21521
21701
|
if (isUndefined(message)) {
|
|
21522
21702
|
messages.push({
|
|
21523
21703
|
type: "item_reference",
|
|
@@ -21555,14 +21735,64 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21555
21735
|
const id = getItemId$1(part);
|
|
21556
21736
|
const status = getStatus$1(part);
|
|
21557
21737
|
if (hasConversation && isNotNull(id)) break;
|
|
21558
|
-
if (
|
|
21738
|
+
if (useItemReferences && isNotNull(id)) {
|
|
21559
21739
|
messages.push({
|
|
21560
21740
|
type: "item_reference",
|
|
21561
21741
|
id
|
|
21562
21742
|
});
|
|
21563
21743
|
break;
|
|
21564
21744
|
}
|
|
21565
|
-
if (part.providerExecuted)
|
|
21745
|
+
if (part.providerExecuted) {
|
|
21746
|
+
if (config.store !== true && options.incrementalFallback !== true) break;
|
|
21747
|
+
const result = providerExecutedParts.find((candidate) => candidate.type === "tool-result" && candidate.id === part.id && candidate.name === part.name);
|
|
21748
|
+
if (isUndefined(result) || result.type !== "tool-result") return yield* unreplayableProviderItem(part.name, part.id);
|
|
21749
|
+
if (hasProperty(result.result, "type") && result.result.type === "execution-denied") break;
|
|
21750
|
+
const itemId = getItemId$1(part) ?? getItemId$1(result) ?? part.id;
|
|
21751
|
+
switch (part.name) {
|
|
21752
|
+
case "OpenAiWebSearch":
|
|
21753
|
+
case "OpenAiWebSearchPreview":
|
|
21754
|
+
if (!hasProperty(result.result, "action") || !hasProperty(result.result, "status")) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21755
|
+
messages.push({
|
|
21756
|
+
type: "web_search_call",
|
|
21757
|
+
id: itemId,
|
|
21758
|
+
action: result.result.action,
|
|
21759
|
+
status: result.result.status
|
|
21760
|
+
});
|
|
21761
|
+
break;
|
|
21762
|
+
case "OpenAiCodeInterpreter":
|
|
21763
|
+
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);
|
|
21764
|
+
messages.push({
|
|
21765
|
+
type: "code_interpreter_call",
|
|
21766
|
+
id: itemId,
|
|
21767
|
+
code: part.params.code,
|
|
21768
|
+
container_id: part.params.container_id,
|
|
21769
|
+
status: result.result.status,
|
|
21770
|
+
outputs: result.result.outputs
|
|
21771
|
+
});
|
|
21772
|
+
break;
|
|
21773
|
+
case "OpenAiFileSearch":
|
|
21774
|
+
if (!hasProperty(result.result, "status") || !hasProperty(result.result, "queries") || !hasProperty(result.result, "results")) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21775
|
+
messages.push({
|
|
21776
|
+
type: "file_search_call",
|
|
21777
|
+
id: itemId,
|
|
21778
|
+
status: result.result.status,
|
|
21779
|
+
queries: result.result.queries,
|
|
21780
|
+
results: result.result.results
|
|
21781
|
+
});
|
|
21782
|
+
break;
|
|
21783
|
+
case "OpenAiImageGeneration":
|
|
21784
|
+
if (!hasProperty(result.result, "result")) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21785
|
+
messages.push({
|
|
21786
|
+
type: "image_generation_call",
|
|
21787
|
+
id: itemId,
|
|
21788
|
+
result: result.result.result,
|
|
21789
|
+
status: hasProperty(result.result, "status") ? result.result.status : "completed"
|
|
21790
|
+
});
|
|
21791
|
+
break;
|
|
21792
|
+
default: return yield* unreplayableProviderItem(part.name, part.id);
|
|
21793
|
+
}
|
|
21794
|
+
break;
|
|
21795
|
+
}
|
|
21566
21796
|
const toolName = toolNameMapper.getProviderName(part.name);
|
|
21567
21797
|
if (isNotUndefined(localShellTool) && toolName === "local_shell") {
|
|
21568
21798
|
const params = yield* decodeUnknownEffect$1(localShellTool.parametersSchema)(part.params).pipe(mapError((error) => make$18({
|
|
@@ -21613,12 +21843,15 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21613
21843
|
case "tool-result":
|
|
21614
21844
|
if (hasProperty(part.result, "type") && part.result.type === "execution-denied") break;
|
|
21615
21845
|
if (hasConversation) break;
|
|
21616
|
-
if (
|
|
21846
|
+
if (useItemReferences) {
|
|
21617
21847
|
const id = getItemId$1(part) ?? part.id;
|
|
21618
21848
|
messages.push({
|
|
21619
21849
|
type: "item_reference",
|
|
21620
21850
|
id
|
|
21621
21851
|
});
|
|
21852
|
+
} else if (part.providerExecuted && (config.store === true || options.incrementalFallback === true)) {
|
|
21853
|
+
const call = providerExecutedParts.find((candidate) => candidate.type === "tool-call" && candidate.id === part.id && candidate.name === part.name);
|
|
21854
|
+
if (isUndefined(call)) return yield* unreplayableProviderItem(part.name, part.id);
|
|
21622
21855
|
}
|
|
21623
21856
|
}
|
|
21624
21857
|
break;
|
|
@@ -21627,7 +21860,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21627
21860
|
if (part.type === "tool-approval-response") {
|
|
21628
21861
|
if (processedApprovalIds.has(part.approvalId)) continue;
|
|
21629
21862
|
processedApprovalIds.add(part.approvalId);
|
|
21630
|
-
if (
|
|
21863
|
+
if (useItemReferences) messages.push({
|
|
21631
21864
|
type: "item_reference",
|
|
21632
21865
|
id: part.approvalId
|
|
21633
21866
|
});
|
|
@@ -22043,6 +22276,7 @@ const makeResponse$1 = fnUntraced(function* ({ options, rawResponse, response, t
|
|
|
22043
22276
|
});
|
|
22044
22277
|
const makeStreamResponse$1 = fnUntraced(function* ({ stream, response, config, options, toolNameMapper }) {
|
|
22045
22278
|
const idGenerator = yield* IdGenerator;
|
|
22279
|
+
const websocketMode = isSome(yield* serviceOption(OpenAiSocket));
|
|
22046
22280
|
const approvalRequests = getApprovalRequestIdMapping(options.prompt);
|
|
22047
22281
|
const streamApprovalRequests = new Map();
|
|
22048
22282
|
let hasToolCalls = false;
|
|
@@ -22785,7 +23019,7 @@ const makeStreamResponse$1 = fnUntraced(function* ({ stream, response, config, o
|
|
|
22785
23019
|
break;
|
|
22786
23020
|
case "response.reasoning_summary_part.done": {
|
|
22787
23021
|
const reasoningPart = getOrCreateReasoningPart(event.item_id);
|
|
22788
|
-
if (config.store === true) {
|
|
23022
|
+
if (!websocketMode && config.store === true && config.useItemReferences !== false) {
|
|
22789
23023
|
parts.push({
|
|
22790
23024
|
type: "reasoning-end",
|
|
22791
23025
|
id: `${event.item_id}:${event.summary_index}`,
|
|
@@ -23219,7 +23453,7 @@ const decodeJwtPayload = (token) => {
|
|
|
23219
23453
|
if (parts.length !== 3) return none();
|
|
23220
23454
|
const payload = parts[1];
|
|
23221
23455
|
if (payload === void 0) return none();
|
|
23222
|
-
return fromNullishOr(getOrUndefined$2(
|
|
23456
|
+
return fromNullishOr(getOrUndefined$2(decodeString(payload)));
|
|
23223
23457
|
};
|
|
23224
23458
|
const parseJwtClaims = (token) => decodeJwtPayload(token).pipe(flatMap$2(decodeJwtJson), flatMap$2(toJwtClaims));
|
|
23225
23459
|
const extractAccountIdFromClaims = (claims) => {
|
|
@@ -23424,7 +23658,9 @@ var ScriptEnd = class extends TaggedClass$2()("ScriptEnd", {}) {};
|
|
|
23424
23658
|
var Usage = class extends TaggedClass$2()("Usage", {
|
|
23425
23659
|
contextTokens: Number$2,
|
|
23426
23660
|
inputTokens: Number$2,
|
|
23427
|
-
outputTokens: Number$2
|
|
23661
|
+
outputTokens: Number$2,
|
|
23662
|
+
cacheRead: Number$2,
|
|
23663
|
+
cacheWrite: Number$2
|
|
23428
23664
|
}) {};
|
|
23429
23665
|
var ErrorRetry = class extends TaggedClass$2()("ErrorRetry", { error: AiError }) {};
|
|
23430
23666
|
var ScriptOutput = class extends TaggedClass$2()("ScriptOutput", { output: String$5 }) {};
|
|
@@ -23488,7 +23724,7 @@ const make$2 = gen(function* () {
|
|
|
23488
23724
|
const singleTool = yield* SingleTools.pipe(provide$1(SingleToolHandlers));
|
|
23489
23725
|
const capabilities = yield* executor.capabilities;
|
|
23490
23726
|
const pendingMessages = new Set();
|
|
23491
|
-
const agentsMd = map$
|
|
23727
|
+
const agentsMd = map$8(capabilities.agentsMd, (content) => `# AGENTS.md
|
|
23492
23728
|
|
|
23493
23729
|
The following instructions are from ./AGENTS.md in the current directory.
|
|
23494
23730
|
You do not need to read this file again.
|
|
@@ -23516,6 +23752,8 @@ ${content}
|
|
|
23516
23752
|
const output = yield* make$44();
|
|
23517
23753
|
let inputTokens = 0;
|
|
23518
23754
|
let outputTokens = 0;
|
|
23755
|
+
let cacheRead = 0;
|
|
23756
|
+
let cacheWrite = 0;
|
|
23519
23757
|
const prompt = opts.disableHistory ? make$43(empty$1) : history;
|
|
23520
23758
|
update(prompt, concat(opts.prompt));
|
|
23521
23759
|
let system = (typeof opts.system === "function" ? opts.system : defaultSystem)({
|
|
@@ -23750,6 +23988,8 @@ ${content}
|
|
|
23750
23988
|
case "finish":
|
|
23751
23989
|
const usage = part.usage;
|
|
23752
23990
|
if (usage.outputTokens.total !== void 0) outputTokens += usage.outputTokens.total;
|
|
23991
|
+
if (usage.inputTokens.cacheRead !== void 0) cacheRead += usage.inputTokens.cacheRead;
|
|
23992
|
+
if (usage.inputTokens.cacheWrite !== void 0) cacheWrite += usage.inputTokens.cacheWrite;
|
|
23753
23993
|
if (usage.inputTokens.total !== void 0) {
|
|
23754
23994
|
lastContextTokens = usage.inputTokens.total;
|
|
23755
23995
|
inputTokens += usage.inputTokens.total;
|
|
@@ -23758,7 +23998,9 @@ ${content}
|
|
|
23758
23998
|
part: new Usage({
|
|
23759
23999
|
contextTokens: usage.inputTokens.total,
|
|
23760
24000
|
inputTokens,
|
|
23761
|
-
outputTokens
|
|
24001
|
+
outputTokens,
|
|
24002
|
+
cacheRead,
|
|
24003
|
+
cacheWrite
|
|
23762
24004
|
})
|
|
23763
24005
|
});
|
|
23764
24006
|
}
|
|
@@ -23768,7 +24010,7 @@ ${content}
|
|
|
23768
24010
|
return void_;
|
|
23769
24011
|
}), modelConfig.systemPromptTransform ? (effect) => modelConfig.systemPromptTransform(system, effect) : identity);
|
|
23770
24012
|
const attempt = pipe(runModel, raceFirst(turnTimeoutEffect), retry({
|
|
23771
|
-
while
|
|
24013
|
+
while(err) {
|
|
23772
24014
|
if (err._tag === "TimeoutError") {
|
|
23773
24015
|
maybeSend({
|
|
23774
24016
|
agentId,
|
|
@@ -23967,7 +24209,7 @@ const responseToSummary = (response) => {
|
|
|
23967
24209
|
//#endregion
|
|
23968
24210
|
//#region src/Codex.ts
|
|
23969
24211
|
const layerClient$2 = layer$5({ apiUrl: "https://chatgpt.com/backend-api/codex" }).pipe(provide$3(CodexAuth.layerClient));
|
|
23970
|
-
const modelWebSocket = (model, options) => make$5("openai", model, layerModel(model, options).pipe(merge$3(fresh(layerWebSocketMode))));
|
|
24212
|
+
const modelWebSocket$1 = (model, options) => make$5("openai", model, layerModel(model, options).pipe(merge$3(fresh(layerWebSocketMode))));
|
|
23971
24213
|
const layerModel = (model, options) => layer$3({
|
|
23972
24214
|
model,
|
|
23973
24215
|
config: {
|
|
@@ -23988,7 +24230,7 @@ const layerModel = (model, options) => layer$3({
|
|
|
23988
24230
|
supportsImages: options?.supportsImages
|
|
23989
24231
|
})));
|
|
23990
24232
|
//#endregion
|
|
23991
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24233
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@2_81be1e8a1f9fd3a8a762e6538f848210/node_modules/@effect/ai-openai-compat/dist/internal/errors.js
|
|
23992
24234
|
const OpenAiErrorBody = Struct({ error: Struct({
|
|
23993
24235
|
message: String$5,
|
|
23994
24236
|
type: optional$2(NullOr(String$5)),
|
|
@@ -24071,7 +24313,7 @@ const mapStatusCodeError = fnUntraced(function* (error, method) {
|
|
|
24071
24313
|
}),
|
|
24072
24314
|
metadata: {
|
|
24073
24315
|
errorCode: isSome(decoded) ? decoded.value.error.code?.toString() ?? null : null,
|
|
24074
|
-
errorType: decoded.pipe(flatMapNullishOr((d) => d.error.type ?? d.error.status), map$
|
|
24316
|
+
errorType: decoded.pipe(flatMapNullishOr((d) => d.error.type ?? d.error.status), map$8(toLowerCase), getOrNull),
|
|
24075
24317
|
requestId: requestId ?? null
|
|
24076
24318
|
}
|
|
24077
24319
|
});
|
|
@@ -24085,11 +24327,11 @@ const parseRateLimitHeaders = (headers) => {
|
|
|
24085
24327
|
const retryAfterRaw = headers["retry-after"];
|
|
24086
24328
|
let retryAfter;
|
|
24087
24329
|
if (retryAfterRaw !== void 0) {
|
|
24088
|
-
const parsed = parse$
|
|
24330
|
+
const parsed = parse$1(retryAfterRaw);
|
|
24089
24331
|
if (isSome(parsed)) retryAfter = seconds(parsed.value);
|
|
24090
24332
|
}
|
|
24091
24333
|
const remainingRaw = headers["x-ratelimit-remaining-requests"];
|
|
24092
|
-
const remaining = remainingRaw !== void 0 ? getOrNull(parse$
|
|
24334
|
+
const remaining = remainingRaw !== void 0 ? getOrNull(parse$1(remainingRaw)) : null;
|
|
24093
24335
|
return {
|
|
24094
24336
|
retryAfter,
|
|
24095
24337
|
limit: headers["x-ratelimit-limit-requests"] ?? null,
|
|
@@ -24182,12 +24424,12 @@ const mapStatusCodeToReason = ({ status, headers, message, metadata, http }) =>
|
|
|
24182
24424
|
}
|
|
24183
24425
|
};
|
|
24184
24426
|
//#endregion
|
|
24185
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24427
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@2_81be1e8a1f9fd3a8a762e6538f848210/node_modules/@effect/ai-openai-compat/dist/OpenAiConfig.js
|
|
24186
24428
|
var OpenAiConfig = class OpenAiConfig extends Service()("@effect/ai-openai-compat/OpenAiConfig") {
|
|
24187
24429
|
static getOrUndefined = map$5(context(), getOrUndefined$1(OpenAiConfig));
|
|
24188
24430
|
};
|
|
24189
24431
|
//#endregion
|
|
24190
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24432
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@2_81be1e8a1f9fd3a8a762e6538f848210/node_modules/@effect/ai-openai-compat/dist/OpenAiClient.js
|
|
24191
24433
|
var OpenAiClient = class extends Service()("@effect/ai-openai-compat/OpenAiClient") {};
|
|
24192
24434
|
const RedactedOpenAiHeaders = {
|
|
24193
24435
|
OpenAiOrganization: "openai-organization",
|
|
@@ -24259,7 +24501,7 @@ const ChatCompletionToolCall = Struct({
|
|
|
24259
24501
|
function: optionalKey(ChatCompletionToolFunction)
|
|
24260
24502
|
});
|
|
24261
24503
|
const ChatCompletionToolCallDelta = Struct({
|
|
24262
|
-
id: optionalKey(String$5),
|
|
24504
|
+
id: optionalKey(NullOr(String$5)),
|
|
24263
24505
|
index: optionalKey(Int$1),
|
|
24264
24506
|
type: optionalKey(String$5),
|
|
24265
24507
|
function: optionalKey(ChatCompletionToolFunctionDelta)
|
|
@@ -24272,7 +24514,7 @@ const ChatCompletionMessage = Struct({
|
|
|
24272
24514
|
tool_calls: optionalKey(ArraySchema(ChatCompletionToolCall))
|
|
24273
24515
|
});
|
|
24274
24516
|
const ChatCompletionDelta = Struct({
|
|
24275
|
-
role: optionalKey(String$5),
|
|
24517
|
+
role: optionalKey(NullOr(String$5)),
|
|
24276
24518
|
content: optionalKey(NullOr(String$5)),
|
|
24277
24519
|
reasoning: optionalKey(NullOr(String$5)),
|
|
24278
24520
|
reasoning_content: optionalKey(NullOr(String$5)),
|
|
@@ -24325,7 +24567,7 @@ const decodeChatCompletionSseData = (data) => {
|
|
|
24325
24567
|
};
|
|
24326
24568
|
};
|
|
24327
24569
|
//#endregion
|
|
24328
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24570
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@2_81be1e8a1f9fd3a8a762e6538f848210/node_modules/@effect/ai-openai-compat/dist/internal/utilities.js
|
|
24329
24571
|
const finishReasonMap = {
|
|
24330
24572
|
content_filter: "content-filter",
|
|
24331
24573
|
function_call: "tool-calls",
|
|
@@ -24340,7 +24582,7 @@ const resolveFinishReason = (finishReason, hasToolCalls) => {
|
|
|
24340
24582
|
return reason;
|
|
24341
24583
|
};
|
|
24342
24584
|
//#endregion
|
|
24343
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24585
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@2_81be1e8a1f9fd3a8a762e6538f848210/node_modules/@effect/ai-openai-compat/dist/OpenAiTelemetry.js
|
|
24344
24586
|
const addOpenAiRequestAttributes = addSpanAttributes("gen_ai.openai.request", camelToSnake);
|
|
24345
24587
|
const addOpenAiResponseAttributes = addSpanAttributes("gen_ai.openai.response", camelToSnake);
|
|
24346
24588
|
const addGenAIAnnotations = dual(2, (span, options) => {
|
|
@@ -24351,7 +24593,7 @@ const addGenAIAnnotations = dual(2, (span, options) => {
|
|
|
24351
24593
|
}
|
|
24352
24594
|
});
|
|
24353
24595
|
//#endregion
|
|
24354
|
-
//#region node_modules/.pnpm/@effect+ai-openai-compat@
|
|
24596
|
+
//#region node_modules/.pnpm/@effect+ai-openai-compat@https+++pkg.pr.new+Effect-TS+effect+@effect+ai-openai-compat@2_81be1e8a1f9fd3a8a762e6538f848210/node_modules/@effect/ai-openai-compat/dist/OpenAiLanguageModel.js
|
|
24355
24597
|
var Config = class extends Service()("@effect/ai-openai-compat/OpenAiLanguageModel/Config") {};
|
|
24356
24598
|
const make = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
24357
24599
|
const client = yield* OpenAiClient;
|
|
@@ -24429,7 +24671,7 @@ const make = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
24429
24671
|
response,
|
|
24430
24672
|
toolNameMapper
|
|
24431
24673
|
});
|
|
24432
|
-
}, (effect, options) => effect.pipe(unwrap$3, map$
|
|
24674
|
+
}, (effect, options) => effect.pipe(unwrap$3, map$9((response) => {
|
|
24433
24675
|
annotateStreamResponse(options.span, response);
|
|
24434
24676
|
return response;
|
|
24435
24677
|
})))
|
|
@@ -24473,7 +24715,7 @@ const prepareMessages = fnUntraced(function* ({ config, options, capabilities, i
|
|
|
24473
24715
|
detail
|
|
24474
24716
|
});
|
|
24475
24717
|
else {
|
|
24476
|
-
const imageUrl = part.data instanceof URL ? part.data.toString() : part.data instanceof Uint8Array ? `data:${mediaType};base64,${
|
|
24718
|
+
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}`;
|
|
24477
24719
|
content.push({
|
|
24478
24720
|
type: "input_image",
|
|
24479
24721
|
image_url: imageUrl,
|
|
@@ -24490,7 +24732,7 @@ const prepareMessages = fnUntraced(function* ({ config, options, capabilities, i
|
|
|
24490
24732
|
file_url: part.data.toString()
|
|
24491
24733
|
});
|
|
24492
24734
|
if (part.data instanceof Uint8Array) {
|
|
24493
|
-
const base64 =
|
|
24735
|
+
const base64 = encode(part.data);
|
|
24494
24736
|
const fileName = part.fileName ?? `part-${index}.pdf`;
|
|
24495
24737
|
const fileData = `data:application/pdf;base64,${base64}`;
|
|
24496
24738
|
content.push({
|
|
@@ -25470,7 +25712,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service()("clanka/Github
|
|
|
25470
25712
|
//#endregion
|
|
25471
25713
|
//#region src/Copilot.ts
|
|
25472
25714
|
const layerClient$1 = layer$1({ apiUrl: API_URL }).pipe(provide$3(GithubCopilotAuth.layerClient));
|
|
25473
|
-
const model$
|
|
25715
|
+
const model$1 = (model, options) => make$5("openai", model, mergeAll(layer({
|
|
25474
25716
|
model,
|
|
25475
25717
|
config: omit(options ?? {}, ["systemPromptTransform", "supportsImages"])
|
|
25476
25718
|
}), AgentModelConfig.layer({
|
|
@@ -25621,11 +25863,12 @@ var XaiAuth = class XaiAuth extends Service()("clanka/XaiAuth") {
|
|
|
25621
25863
|
//#endregion
|
|
25622
25864
|
//#region src/Xai.ts
|
|
25623
25865
|
const layerClient = layer$5({ apiUrl: "https://api.x.ai/v1" }).pipe(provide$3(XaiAuth.layerClient));
|
|
25624
|
-
const
|
|
25866
|
+
const modelWebSocket = (model, options) => make$5("xai", model, mergeAll(layer$3({
|
|
25625
25867
|
model,
|
|
25626
25868
|
config: {
|
|
25627
25869
|
...omit(options ?? {}, ["systemPromptTransform", "supportsImages"]),
|
|
25628
|
-
store:
|
|
25870
|
+
store: true,
|
|
25871
|
+
useItemReferences: false,
|
|
25629
25872
|
reasoning: {
|
|
25630
25873
|
effort: "high",
|
|
25631
25874
|
...options?.reasoning
|
|
@@ -25634,13 +25877,13 @@ const model$1 = (model, options) => make$5("xai", model, mergeAll(layer$3({
|
|
|
25634
25877
|
}), AgentModelConfig.layer({
|
|
25635
25878
|
systemPromptTransform: options?.systemPromptTransform,
|
|
25636
25879
|
supportsImages: options?.supportsImages
|
|
25637
|
-
}), 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)));
|
|
25638
25881
|
//#endregion
|
|
25639
|
-
//#region node_modules/.pnpm/effect@
|
|
25882
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Logger.js
|
|
25640
25883
|
const LogToStderr = LogToStderr$1;
|
|
25641
25884
|
//#endregion
|
|
25642
25885
|
//#region package.json
|
|
25643
|
-
var version$1 = "0.
|
|
25886
|
+
var version$1 = "0.8.1";
|
|
25644
25887
|
//#endregion
|
|
25645
25888
|
//#region src/cli.ts
|
|
25646
25889
|
const version = version$1;
|
|
@@ -25651,7 +25894,7 @@ const providers = [
|
|
|
25651
25894
|
"xai"
|
|
25652
25895
|
];
|
|
25653
25896
|
const withSubagentModel = (model) => merge$3(model, layerSubagentModel(model));
|
|
25654
|
-
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));
|
|
25655
25898
|
const isProvider = (provider) => providers.includes(provider);
|
|
25656
25899
|
const parseModelId = (modelId) => {
|
|
25657
25900
|
const [provider, model, effort, ...rest] = modelId.split("/");
|
|
@@ -25702,10 +25945,10 @@ const Search = (directory) => unwrap$1(gen(function* () {
|
|
|
25702
25945
|
return empty$9;
|
|
25703
25946
|
}
|
|
25704
25947
|
const path = yield* Path$3;
|
|
25705
|
-
return (yield* promise(() => import("./SemanticSearch-
|
|
25948
|
+
return (yield* promise(() => import("./SemanticSearch-BHUGFT1y.mjs"))).layer({
|
|
25706
25949
|
directory: process.cwd(),
|
|
25707
25950
|
database: path.join(directory, "search.sqlite")
|
|
25708
|
-
}).pipe(provide$3(model$
|
|
25951
|
+
}).pipe(provide$3(model$2("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$5({ apiKey: apiKey.value })));
|
|
25709
25952
|
})).pipe(provide$3([layer$8, HttpClientLive]));
|
|
25710
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))));
|
|
25711
25954
|
const acp = make$28("acp", {
|
|
@@ -25716,7 +25959,7 @@ const acp = make$28("acp", {
|
|
|
25716
25959
|
defaultModel: model.model,
|
|
25717
25960
|
defaultThoughtLevel: model.thoughtLevel,
|
|
25718
25961
|
makeAgent: (cwd) => make$2.pipe(provide$1(layerLocal$1({ directory: cwd }))),
|
|
25719
|
-
makeModel: (modelId, thoughtLevel) => map$
|
|
25962
|
+
makeModel: (modelId, thoughtLevel) => map$8(parseAcpModelId(modelId), ({ provider, model }) => modelLayer(provider, model, thoughtLevel))
|
|
25720
25963
|
})), provide(({ compaction }) => mergeAll(ConversationMode.layer(true), succeed$4(LogToStderr, true), layerLog, CompactionConfig.layer({ enabled: compaction }))));
|
|
25721
25964
|
make$28("clanka", {
|
|
25722
25965
|
provider,
|
|
@@ -25726,7 +25969,7 @@ make$28("clanka", {
|
|
|
25726
25969
|
compaction
|
|
25727
25970
|
}).pipe(withHandler(fnUntraced(function* ({ provider, model: modelRaw, semantic, prompt: nonInteractivePrompt }) {
|
|
25728
25971
|
const stdio = yield* Stdio;
|
|
25729
|
-
const OutputFormatter = yield* promise(() => import("./OutputFormatter-
|
|
25972
|
+
const OutputFormatter = yield* promise(() => import("./OutputFormatter-BpggeGvI.mjs"));
|
|
25730
25973
|
const [model, reasoning] = (yield* match$2(modelRaw, {
|
|
25731
25974
|
onSome: succeed$2,
|
|
25732
25975
|
onNone: () => String$4({
|