clanka 0.8.0 → 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 +6 -6
- package/dist/Acp.js.map +1 -1
- package/dist/Acp.test.js +4 -4
- package/dist/Acp.test.js.map +1 -1
- package/dist/AcpImage.test.js +7 -7
- package/dist/AcpImage.test.js.map +1 -1
- package/dist/Agent.d.ts +8 -8
- package/dist/Agent.d.ts.map +1 -1
- package/dist/Agent.js +7 -7
- package/dist/Agent.js.map +1 -1
- package/dist/Agent.test.js +6 -6
- package/dist/Agent.test.js.map +1 -1
- package/dist/AgentExecutor.d.ts +9 -9
- package/dist/AgentExecutor.d.ts.map +1 -1
- package/dist/AgentExecutor.js +5 -5
- package/dist/AgentExecutor.js.map +1 -1
- package/dist/AgentExecutorImage.test.js +6 -6
- package/dist/AgentExecutorImage.test.js.map +1 -1
- package/dist/AgentImage.test.js +3 -3
- package/dist/AgentImage.test.js.map +1 -1
- package/dist/AgentOutput.d.ts +2 -2
- package/dist/AgentOutput.d.ts.map +1 -1
- package/dist/AgentOutput.js +2 -2
- package/dist/AgentOutput.js.map +1 -1
- package/dist/AgentSkills.d.ts.map +1 -1
- package/dist/AgentSkills.js +6 -1
- package/dist/AgentSkills.js.map +1 -1
- package/dist/AgentSkills.test.js +21 -4
- package/dist/AgentSkills.test.js.map +1 -1
- package/dist/AgentTools.d.ts +4 -4
- package/dist/AgentTools.d.ts.map +1 -1
- package/dist/AgentTools.js +4 -4
- package/dist/AgentTools.js.map +1 -1
- package/dist/AgentToolsImage.test.js +2 -2
- package/dist/AgentToolsImage.test.js.map +1 -1
- package/dist/ChunkRepo.d.ts +10 -10
- package/dist/ChunkRepo.d.ts.map +1 -1
- package/dist/ChunkRepo.js +7 -7
- package/dist/ChunkRepo.js.map +1 -1
- package/dist/ChunkRepo.test.js +2 -2
- package/dist/ChunkRepo.test.js.map +1 -1
- package/dist/CodeChunker.d.ts +1 -1
- package/dist/CodeChunker.d.ts.map +1 -1
- package/dist/CodeChunker.js +2 -2
- package/dist/CodeChunker.js.map +1 -1
- package/dist/Codex.d.ts +5 -5
- package/dist/Codex.d.ts.map +1 -1
- package/dist/Codex.js +1 -1
- package/dist/Codex.js.map +1 -1
- package/dist/CodexAuth.d.ts +2 -2
- package/dist/CodexAuth.d.ts.map +1 -1
- package/dist/CodexAuth.js +6 -6
- package/dist/CodexAuth.js.map +1 -1
- package/dist/CodexAuth.test.js +3 -3
- package/dist/CodexAuth.test.js.map +1 -1
- package/dist/Compaction.d.ts +3 -3
- package/dist/Compaction.d.ts.map +1 -1
- package/dist/Compaction.js +3 -3
- package/dist/Compaction.js.map +1 -1
- package/dist/Compaction.test.js +3 -3
- package/dist/Compaction.test.js.map +1 -1
- package/dist/CompactionImage.test.js +4 -4
- package/dist/CompactionImage.test.js.map +1 -1
- package/dist/CompactionTokens.test.js +3 -3
- package/dist/CompactionTokens.test.js.map +1 -1
- package/dist/CompactionTransport.test.js +5 -5
- package/dist/CompactionTransport.test.js.map +1 -1
- package/dist/Copilot.d.ts +3 -3
- package/dist/Copilot.d.ts.map +1 -1
- package/dist/Copilot.js +1 -1
- package/dist/Copilot.js.map +1 -1
- package/dist/CopilotAuth.d.ts +2 -2
- package/dist/CopilotAuth.d.ts.map +1 -1
- package/dist/CopilotAuth.js +4 -4
- package/dist/CopilotAuth.js.map +1 -1
- package/dist/CopilotAuth.test.js +2 -2
- package/dist/CopilotAuth.test.js.map +1 -1
- package/dist/GlobalWebSocket.d.ts +1 -1
- package/dist/GlobalWebSocket.d.ts.map +1 -1
- package/dist/GlobalWebSocket.js +1 -1
- package/dist/GlobalWebSocket.js.map +1 -1
- package/dist/Image.d.ts +2 -2
- package/dist/Image.d.ts.map +1 -1
- package/dist/Image.js +3 -3
- package/dist/Image.js.map +1 -1
- package/dist/Image.test.js +2 -2
- package/dist/Image.test.js.map +1 -1
- package/dist/SemanticSearch.d.ts +3 -3
- package/dist/SemanticSearch.d.ts.map +1 -1
- package/dist/SemanticSearch.js +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 +601 -368
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/cli.js +7 -5
- package/dist/cli.js.map +1 -1
- package/dist/fixtures/TestImages.js +2 -2
- package/dist/fixtures/TestImages.js.map +1 -1
- package/package.json +7 -7
- package/src/Acp.test.ts +5 -5
- package/src/Acp.ts +8 -8
- package/src/AcpImage.test.ts +9 -9
- package/src/Agent.test.ts +7 -7
- package/src/Agent.ts +10 -10
- package/src/AgentExecutor.ts +8 -8
- package/src/AgentExecutorImage.test.ts +6 -6
- package/src/AgentImage.test.ts +5 -5
- package/src/AgentOutput.ts +2 -2
- package/src/AgentSkills.test.ts +81 -37
- package/src/AgentSkills.ts +5 -1
- package/src/AgentTools.ts +5 -5
- package/src/AgentToolsImage.test.ts +4 -4
- package/src/ChunkRepo.test.ts +2 -2
- package/src/ChunkRepo.ts +7 -7
- package/src/CodeChunker.ts +2 -2
- package/src/Codex.ts +4 -4
- package/src/CodexAuth.test.ts +3 -3
- package/src/CodexAuth.ts +6 -6
- package/src/Compaction.test.ts +3 -3
- package/src/Compaction.ts +3 -3
- package/src/CompactionImage.test.ts +4 -4
- package/src/CompactionTokens.test.ts +3 -3
- package/src/CompactionTransport.test.ts +6 -6
- package/src/Copilot.ts +2 -2
- package/src/CopilotAuth.test.ts +2 -6
- package/src/CopilotAuth.ts +4 -4
- package/src/GlobalWebSocket.ts +1 -1
- package/src/Image.test.ts +2 -2
- package/src/Image.ts +4 -4
- package/src/OutputFormatter.ts +1 -1
- package/src/SemanticSearch.test.ts +1 -1
- package/src/SemanticSearch.ts +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) => {
|
|
@@ -11628,7 +11743,7 @@ const make$12 = fnUntraced(function* (options) {
|
|
|
11628
11743
|
const runStdio = (options) => gen(function* () {
|
|
11629
11744
|
const stdio = yield* Stdio;
|
|
11630
11745
|
const output = yield* make$44();
|
|
11631
|
-
const writer = yield* fromQueue(output).pipe(map$
|
|
11746
|
+
const writer = yield* fromQueue(output).pipe(map$9((line) => `${line}\n`), run$4(stdio.stdout()), forkScoped);
|
|
11632
11747
|
const server = yield* make$12({
|
|
11633
11748
|
...options,
|
|
11634
11749
|
send: (message) => offer(output, JSON.stringify(message)).pipe(asVoid)
|
|
@@ -11982,7 +12097,7 @@ var ExaError = class extends TaggedError$1()("ExaError", { cause: Defect() }) {}
|
|
|
11982
12097
|
const layer$7 = effect(ExaSearch, gen(function* () {
|
|
11983
12098
|
const scope$4 = yield* scope;
|
|
11984
12099
|
const getClient = yield* cachedWithTTL(gen(function* () {
|
|
11985
|
-
const McpClient = yield* tryPromise(() => import("./McpClient-
|
|
12100
|
+
const McpClient = yield* tryPromise(() => import("./McpClient-CM7u8ZVd.mjs"));
|
|
11986
12101
|
const context = yield* buildWithScope(McpClient.layer, scope$4);
|
|
11987
12102
|
return get$3(context, McpClient.McpClient);
|
|
11988
12103
|
}), (exit) => isSuccess$1(exit) ? infinity : zero);
|
|
@@ -12428,7 +12543,7 @@ ${prompt}`);
|
|
|
12428
12543
|
}));
|
|
12429
12544
|
const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$7, layer$6]));
|
|
12430
12545
|
const AgentToolHandlersTest = AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
|
|
12431
|
-
var ApplyPatchError = class extends TaggedClass("ApplyPatchError") {};
|
|
12546
|
+
var ApplyPatchError = class extends TaggedClass$1("ApplyPatchError") {};
|
|
12432
12547
|
//#endregion
|
|
12433
12548
|
//#region src/TypeBuilder.ts
|
|
12434
12549
|
const resolveDocumentation = resolveAt("documentation");
|
|
@@ -12752,6 +12867,7 @@ const discover = fnUntraced(function* (options) {
|
|
|
12752
12867
|
const entries = yield* fs.readDirectory(skillsDir).pipe(orElseSucceed(() => []));
|
|
12753
12868
|
entries.sort();
|
|
12754
12869
|
for (const entry of entries) {
|
|
12870
|
+
if (!(yield* fs.readDirectory(path.join(skillsDir, entry)).pipe(orElseSucceed(() => []))).includes("SKILL.md")) continue;
|
|
12755
12871
|
const location = path.join(skillsDir, entry, "SKILL.md");
|
|
12756
12872
|
const content = yield* option$1(fs.stat(location).pipe(filterOrFail((info) => info.type === "File"), andThen(() => fs.readFileString(location))));
|
|
12757
12873
|
if (isNone(content)) continue;
|
|
@@ -12811,7 +12927,7 @@ const renderLocation = (location) => {
|
|
|
12811
12927
|
return encoded.slice(1, -1) === location ? location : encoded;
|
|
12812
12928
|
};
|
|
12813
12929
|
//#endregion
|
|
12814
|
-
//#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
|
|
12815
12931
|
var Collector = class extends Service()("effect/workers/Transferable/Collector") {};
|
|
12816
12932
|
const makeCollectorUnsafe = () => {
|
|
12817
12933
|
let tranferables = [];
|
|
@@ -12834,10 +12950,10 @@ const makeCollectorUnsafe = () => {
|
|
|
12834
12950
|
});
|
|
12835
12951
|
};
|
|
12836
12952
|
//#endregion
|
|
12837
|
-
//#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
|
|
12838
12954
|
const symbol = "~effect/PrimaryKey";
|
|
12839
12955
|
//#endregion
|
|
12840
|
-
//#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
|
|
12841
12957
|
const StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
|
|
12842
12958
|
function isStreamSchema(schema) {
|
|
12843
12959
|
return hasProperty(schema, StreamSchemaTypeId);
|
|
@@ -12864,7 +12980,7 @@ var ClientAbort = class extends Service()("effect/rpc/RpcSchema/ClientAbort") {
|
|
|
12864
12980
|
}));
|
|
12865
12981
|
};
|
|
12866
12982
|
//#endregion
|
|
12867
|
-
//#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
|
|
12868
12984
|
const TypeId$4 = "~effect/rpc/Rpc";
|
|
12869
12985
|
const Proto$1 = {
|
|
12870
12986
|
[TypeId$4]: TypeId$4,
|
|
@@ -12992,7 +13108,7 @@ const exitSchema = (self) => {
|
|
|
12992
13108
|
const WrapperTypeId = "~effect/rpc/Rpc/Wrapper";
|
|
12993
13109
|
const isWrapper = (u) => WrapperTypeId in u;
|
|
12994
13110
|
//#endregion
|
|
12995
|
-
//#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
|
|
12996
13112
|
const RequestId = (id) => id;
|
|
12997
13113
|
const RequestIdSchema = Union([String$5, Number$2]);
|
|
12998
13114
|
const RequestEncodedSchema = Struct({
|
|
@@ -13035,7 +13151,7 @@ const EncodedSchema = Union([
|
|
|
13035
13151
|
Struct({ _tag: tag("Pong") })
|
|
13036
13152
|
]);
|
|
13037
13153
|
//#endregion
|
|
13038
|
-
//#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
|
|
13039
13155
|
const withRunClient = (f) => suspend(() => {
|
|
13040
13156
|
const clientIds = new Set();
|
|
13041
13157
|
const clientBuffers = new Map();
|
|
@@ -13074,7 +13190,7 @@ const withRunClient = (f) => suspend(() => {
|
|
|
13074
13190
|
}));
|
|
13075
13191
|
});
|
|
13076
13192
|
//#endregion
|
|
13077
|
-
//#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
|
|
13078
13194
|
let requestIdCounter = 0;
|
|
13079
13195
|
const makeNoSerialization = fnUntraced(function* (group, options) {
|
|
13080
13196
|
const spanPrefix = options?.spanPrefix ?? "RpcClient";
|
|
@@ -13188,7 +13304,7 @@ const makeNoSerialization = fnUntraced(function* (group, options) {
|
|
|
13188
13304
|
sampled: span.sampled
|
|
13189
13305
|
} : {},
|
|
13190
13306
|
headers: merge$1(fiber.getRef(CurrentHeaders), headers)
|
|
13191
|
-
}).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 }));
|
|
13192
13308
|
return queue;
|
|
13193
13309
|
});
|
|
13194
13310
|
const getRpcClientMiddleware = (rpc) => {
|
|
@@ -13386,7 +13502,7 @@ const makeRpcSchemas = (codecFor) => {
|
|
|
13386
13502
|
if (entry !== void 0) return entry;
|
|
13387
13503
|
const streamSchemas = getStreamSchemas(rpc.successSchema);
|
|
13388
13504
|
entry = {
|
|
13389
|
-
decodeChunk: map$
|
|
13505
|
+
decodeChunk: map$8(streamSchemas, (streamSchemas) => decodeUnknownEffect$1(codecFor(NonEmptyArray(streamSchemas.success)))),
|
|
13390
13506
|
encodePayload: encodeEffect$1(codecFor(rpc.payloadSchema)),
|
|
13391
13507
|
decodeExit: decodeUnknownEffect$1(codecFor(exitSchema(rpc)))
|
|
13392
13508
|
};
|
|
@@ -13399,7 +13515,7 @@ var Protocol = class extends Service()("effect/rpc/RpcClient/Protocol") {
|
|
|
13399
13515
|
static make = withRunClient;
|
|
13400
13516
|
};
|
|
13401
13517
|
//#endregion
|
|
13402
|
-
//#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
|
|
13403
13519
|
const RpcGroupProto = {
|
|
13404
13520
|
add(...rpcs) {
|
|
13405
13521
|
const requests = new Map(this.requests);
|
|
@@ -14407,13 +14523,13 @@ var QueueWriteStream = class extends Writable {
|
|
|
14407
14523
|
}
|
|
14408
14524
|
};
|
|
14409
14525
|
//#endregion
|
|
14410
|
-
//#region node_modules/.pnpm/effect@
|
|
14411
|
-
const decode$1 = (schema) => () => {
|
|
14412
|
-
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);
|
|
14413
14529
|
return fromTransform$1((upstream, _scope) => succeed$2(flatMap$1(upstream, (chunk) => decode(chunk))));
|
|
14414
14530
|
};
|
|
14415
14531
|
//#endregion
|
|
14416
|
-
//#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
|
|
14417
14533
|
const SseErrorTypeId = "~effect/encoding/Sse/SseError";
|
|
14418
14534
|
var EventTooLarge = class extends TaggedError("EventTooLarge") {
|
|
14419
14535
|
get message() {
|
|
@@ -14455,7 +14571,7 @@ const decodeDataSchema = (schema, options) => {
|
|
|
14455
14571
|
...EventEncoded.fields,
|
|
14456
14572
|
data: fromJsonString(schema)
|
|
14457
14573
|
});
|
|
14458
|
-
return pipeTo(decode(options), map$
|
|
14574
|
+
return pipeTo(decode(options), map$10(decode$1(eventSchema)(), map$7((event) => ({
|
|
14459
14575
|
...event,
|
|
14460
14576
|
id: event.id
|
|
14461
14577
|
}))));
|
|
@@ -14574,7 +14690,7 @@ const Event = Struct({
|
|
|
14574
14690
|
data: String$5
|
|
14575
14691
|
});
|
|
14576
14692
|
const RetryTypeId = "~effect/encoding/Sse/Retry";
|
|
14577
|
-
var Retry = class Retry extends TaggedClass("Retry") {
|
|
14693
|
+
var Retry = class Retry extends TaggedClass$1("Retry") {
|
|
14578
14694
|
[RetryTypeId] = RetryTypeId;
|
|
14579
14695
|
static is(u) {
|
|
14580
14696
|
return hasProperty(u, RetryTypeId);
|
|
@@ -14584,7 +14700,7 @@ var Retry = class Retry extends TaggedClass("Retry") {
|
|
|
14584
14700
|
}
|
|
14585
14701
|
};
|
|
14586
14702
|
//#endregion
|
|
14587
|
-
//#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
|
|
14588
14704
|
const AdminApiKey = Struct({
|
|
14589
14705
|
"object": Literal("organization.admin_api_key").annotate({ "description": "The object type, which is always `organization.admin_api_key`" }),
|
|
14590
14706
|
"id": String$5.annotate({ "description": "The identifier, which can be referenced in API endpoints" }),
|
|
@@ -18629,7 +18745,7 @@ const InputItem$1 = Union([
|
|
|
18629
18745
|
"title": "Search queries",
|
|
18630
18746
|
"description": "The search queries.\n"
|
|
18631
18747
|
})),
|
|
18632
|
-
"sources": optionalKey(ArraySchema(Struct({
|
|
18748
|
+
"sources": optionalKey(ArraySchema(Union([Struct({
|
|
18633
18749
|
"type": Literal("url").annotate({ "description": "The type of source. Always `url`.\n" }),
|
|
18634
18750
|
"url": String$5.annotate({
|
|
18635
18751
|
"description": "The URL of the source.\n",
|
|
@@ -18638,7 +18754,13 @@ const InputItem$1 = Union([
|
|
|
18638
18754
|
}).annotate({
|
|
18639
18755
|
"title": "Web search source",
|
|
18640
18756
|
"description": "A source used in the search.\n"
|
|
18641
|
-
})
|
|
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({
|
|
18642
18764
|
"title": "Web search sources",
|
|
18643
18765
|
"description": "The sources used in the search.\n"
|
|
18644
18766
|
}))
|
|
@@ -19782,7 +19904,7 @@ const ListSkillVersionsParams = Struct({
|
|
|
19782
19904
|
});
|
|
19783
19905
|
var OpenAiClientErrorImpl = class extends Error$2 {};
|
|
19784
19906
|
//#endregion
|
|
19785
|
-
//#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
|
|
19786
19908
|
const OpenAiErrorBody$1 = Struct({ error: Struct({
|
|
19787
19909
|
message: String$5,
|
|
19788
19910
|
type: optional$2(NullOr(String$5)),
|
|
@@ -19891,11 +20013,11 @@ const parseRateLimitHeaders$1 = (headers) => {
|
|
|
19891
20013
|
const retryAfterRaw = headers["retry-after"];
|
|
19892
20014
|
let retryAfter;
|
|
19893
20015
|
if (isNotUndefined(retryAfterRaw)) {
|
|
19894
|
-
const parsed = parse$
|
|
20016
|
+
const parsed = parse$1(retryAfterRaw);
|
|
19895
20017
|
if (isSome(parsed)) retryAfter = seconds(parsed.value);
|
|
19896
20018
|
}
|
|
19897
20019
|
const remainingRaw = headers["x-ratelimit-remaining-requests"];
|
|
19898
|
-
const remaining = isNotUndefined(remainingRaw) ? getOrNull(parse$
|
|
20020
|
+
const remaining = isNotUndefined(remainingRaw) ? getOrNull(parse$1(remainingRaw)) : null;
|
|
19899
20021
|
return {
|
|
19900
20022
|
retryAfter,
|
|
19901
20023
|
limit: headers["x-ratelimit-limit-requests"] ?? null,
|
|
@@ -19992,12 +20114,12 @@ const mapStatusCodeToReason$1 = ({ status, headers, message, metadata, http }) =
|
|
|
19992
20114
|
}
|
|
19993
20115
|
};
|
|
19994
20116
|
//#endregion
|
|
19995
|
-
//#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
|
|
19996
20118
|
var OpenAiConfig$1 = class OpenAiConfig$1 extends Service()("@effect/ai-openai/OpenAiConfig") {
|
|
19997
20119
|
static getOrUndefined = map$5(context(), getOrUndefined$1(OpenAiConfig$1));
|
|
19998
20120
|
};
|
|
19999
20121
|
//#endregion
|
|
20000
|
-
//#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
|
|
20001
20123
|
const UnknownRecord = Record(String$5, Unknown);
|
|
20002
20124
|
const JsonObject = Record(String$5, Unknown);
|
|
20003
20125
|
const MessageRole = Literals$2([
|
|
@@ -20197,6 +20319,44 @@ const RequestMessageItem = Struct({
|
|
|
20197
20319
|
status: optionalKey(MessageStatus),
|
|
20198
20320
|
content: Union([String$5, ArraySchema(InputContent)])
|
|
20199
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
|
+
});
|
|
20200
20360
|
const InputItem = Union([
|
|
20201
20361
|
RequestMessageItem,
|
|
20202
20362
|
OutputMessage,
|
|
@@ -20209,7 +20369,11 @@ const InputItem = Union([
|
|
|
20209
20369
|
ShellCall,
|
|
20210
20370
|
ShellCallOutput,
|
|
20211
20371
|
ApplyPatchCallOutput,
|
|
20212
|
-
McpApprovalResponse
|
|
20372
|
+
McpApprovalResponse,
|
|
20373
|
+
InputCodeInterpreterCall,
|
|
20374
|
+
InputFileSearchCall,
|
|
20375
|
+
InputImageGenerationCall,
|
|
20376
|
+
InputWebSearchCall
|
|
20213
20377
|
]);
|
|
20214
20378
|
const FunctionTool = Struct({
|
|
20215
20379
|
type: Literal("function"),
|
|
@@ -20683,7 +20847,7 @@ const CreateEmbeddingResponse = Struct({
|
|
|
20683
20847
|
}))
|
|
20684
20848
|
});
|
|
20685
20849
|
//#endregion
|
|
20686
|
-
//#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
|
|
20687
20851
|
var OpenAiClient$1 = class extends Service()("@effect/ai-openai/OpenAiClient") {};
|
|
20688
20852
|
const RedactedOpenAiHeaders$1 = {
|
|
20689
20853
|
OpenAiOrganization: "OpenAI-Organization",
|
|
@@ -20701,7 +20865,7 @@ const make$8 = fnUntraced(function* (options) {
|
|
|
20701
20865
|
SchemaError: (error) => fail$2(mapSchemaError$1(error, "createResponse"))
|
|
20702
20866
|
}))), withRedactedHeaders$1);
|
|
20703
20867
|
const buildResponseStream = (response) => {
|
|
20704
|
-
return [response, response.stream.pipe(decodeText(), pipeThroughChannel(decodeDataSchema(ResponseStreamEvent)), takeUntil((event) => event.data.type === "response.completed" || event.data.type === "response.incomplete" || event.data.type === "response.failed"), map$
|
|
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({
|
|
20705
20869
|
Retry: (error) => die$2(error),
|
|
20706
20870
|
SseError: (error) => fail$5(mapSseError$1(error, "createResponseStream")),
|
|
20707
20871
|
HttpClientError: (error) => fromEffect(mapHttpClientError$1(error, "createResponseStream")),
|
|
@@ -20751,64 +20915,74 @@ const makeSocket = gen(function* () {
|
|
|
20751
20915
|
tracker.clearUnsafe();
|
|
20752
20916
|
return void_;
|
|
20753
20917
|
});
|
|
20754
|
-
const
|
|
20755
|
-
|
|
20756
|
-
|
|
20757
|
-
|
|
20758
|
-
|
|
20759
|
-
|
|
20760
|
-
|
|
20761
|
-
|
|
20762
|
-
reason:
|
|
20763
|
-
|
|
20764
|
-
|
|
20765
|
-
|
|
20766
|
-
|
|
20767
|
-
|
|
20768
|
-
|
|
20769
|
-
|
|
20770
|
-
|
|
20771
|
-
|
|
20772
|
-
|
|
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
|
+
};
|
|
20773
20939
|
const handleMessage = (msg) => {
|
|
20774
|
-
const
|
|
20940
|
+
const turn = connection.current;
|
|
20941
|
+
if (turn === void 0) return;
|
|
20942
|
+
let event;
|
|
20775
20943
|
try {
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20780
|
-
|
|
20781
|
-
|
|
20782
|
-
|
|
20783
|
-
|
|
20784
|
-
|
|
20785
|
-
|
|
20786
|
-
|
|
20787
|
-
|
|
20788
|
-
|
|
20789
|
-
|
|
20790
|
-
|
|
20791
|
-
|
|
20792
|
-
|
|
20793
|
-
|
|
20794
|
-
|
|
20795
|
-
|
|
20796
|
-
|
|
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
|
|
20797
20969
|
}
|
|
20798
|
-
}
|
|
20799
|
-
})
|
|
20800
|
-
}
|
|
20801
|
-
|
|
20802
|
-
}
|
|
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
|
+
}
|
|
20803
20980
|
};
|
|
20804
20981
|
yield* gen(function* () {
|
|
20805
20982
|
const { pull } = yield* socket.reader;
|
|
20806
20983
|
while (true) {
|
|
20807
20984
|
const messages = yield* pull;
|
|
20808
|
-
for (let i = 0; i < messages.length; i++)
|
|
20809
|
-
const result = handleMessage(messages[i]);
|
|
20810
|
-
if (result !== void 0) yield* result;
|
|
20811
|
-
}
|
|
20985
|
+
for (let i = 0; i < messages.length; i++) handleMessage(messages[i]);
|
|
20812
20986
|
}
|
|
20813
20987
|
}).pipe(scoped, catchTag("SocketError", (error) => make$18({
|
|
20814
20988
|
module: "OpenAiClient",
|
|
@@ -20824,11 +20998,8 @@ const makeSocket = gen(function* () {
|
|
|
20824
20998
|
},
|
|
20825
20999
|
description: error.message
|
|
20826
21000
|
})
|
|
20827
|
-
})), catchCause((cause) => failCause$2(
|
|
20828
|
-
return
|
|
20829
|
-
send,
|
|
20830
|
-
incoming
|
|
20831
|
-
};
|
|
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;
|
|
20832
21003
|
})
|
|
20833
21004
|
});
|
|
20834
21005
|
yield* scoped(get(queueRef));
|
|
@@ -20838,23 +21009,22 @@ const makeSocket = gen(function* () {
|
|
|
20838
21009
|
const stream = unwrap$3(gen(function* () {
|
|
20839
21010
|
const scope$2 = yield* scope;
|
|
20840
21011
|
yield* acquireRelease(semaphore.take(1), () => semaphore.release(1), { interruptible: true });
|
|
20841
|
-
const
|
|
20842
|
-
|
|
20843
|
-
|
|
20844
|
-
yield*
|
|
20845
|
-
|
|
20846
|
-
|
|
20847
|
-
return done;
|
|
20848
|
-
}));
|
|
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);
|
|
20849
21018
|
}));
|
|
20850
21019
|
return succeed$2([fromWeb(request, new Response()), stream]);
|
|
20851
21020
|
} }).pipe(add(ResponseIdTracker, tracker));
|
|
20852
21021
|
});
|
|
20853
21022
|
const ErrorEvent = Struct({
|
|
20854
|
-
type: Literal("error"),
|
|
20855
|
-
status: Int$1
|
|
21023
|
+
type: Literal("error").pipe(withDecodingDefault(succeed$2("error"))),
|
|
21024
|
+
status: optionalKey(Int$1),
|
|
20856
21025
|
error: Struct({
|
|
20857
|
-
type: String$5,
|
|
21026
|
+
type: optional$2(String$5),
|
|
21027
|
+
code: optional$2(String$5),
|
|
20858
21028
|
message: String$5
|
|
20859
21029
|
})
|
|
20860
21030
|
});
|
|
@@ -20869,7 +21039,7 @@ const AllEvents = Union([ErrorEvent, ResponseStreamEvent]);
|
|
|
20869
21039
|
const decodeEvent = decodeUnknownSync(fromJsonString(AllEvents));
|
|
20870
21040
|
const layerWebSocketMode = effectContext(makeSocket);
|
|
20871
21041
|
//#endregion
|
|
20872
|
-
//#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
|
|
20873
21043
|
const TypeId$3 = "~effect/RequestResolver";
|
|
20874
21044
|
const RequestResolverProto = {
|
|
20875
21045
|
[TypeId$3]: {
|
|
@@ -20951,17 +21121,17 @@ const withSpan = dual((args) => isRequestResolver(args[0]), (self, name, options
|
|
|
20951
21121
|
})
|
|
20952
21122
|
}));
|
|
20953
21123
|
//#endregion
|
|
20954
|
-
//#region node_modules/.pnpm/effect@
|
|
20955
|
-
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");
|
|
20956
21126
|
const TypeId$2 = "~effect/ai/EmbeddingModel";
|
|
20957
|
-
var Dimensions = class extends Service()("effect/
|
|
21127
|
+
var Dimensions = class extends Service()("effect/ai/EmbeddingModel/Dimensions") {};
|
|
20958
21128
|
var EmbeddingUsage = class extends Class$1("effect/ai/EmbeddingModel/EmbeddingUsage")({ inputTokens: optional$2(Finite) }) {};
|
|
20959
21129
|
var EmbedResponse = class extends Class$1("effect/ai/EmbeddingModel/EmbedResponse")({ vector: ArraySchema(Finite) }) {};
|
|
20960
21130
|
var EmbedManyResponse = class extends Class$1("effect/ai/EmbeddingModel/EmbedManyResponse")({
|
|
20961
21131
|
embeddings: ArraySchema(EmbedResponse),
|
|
20962
21132
|
usage: EmbeddingUsage
|
|
20963
21133
|
}) {};
|
|
20964
|
-
var EmbeddingRequest = class extends TaggedClass
|
|
21134
|
+
var EmbeddingRequest = class extends TaggedClass("EmbeddingRequest") {};
|
|
20965
21135
|
const invalidProviderResponse = (description) => make$18({
|
|
20966
21136
|
module: "EmbeddingModel",
|
|
20967
21137
|
method: "embedMany",
|
|
@@ -20994,10 +21164,10 @@ const mapProviderResults = (inputLength, results) => {
|
|
|
20994
21164
|
return succeed$2(embeddings);
|
|
20995
21165
|
};
|
|
20996
21166
|
//#endregion
|
|
20997
|
-
//#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
|
|
20998
21168
|
const TypeId$1 = "~effect/ai/Model";
|
|
20999
|
-
var ProviderName = class extends Service()("effect/
|
|
21000
|
-
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") {};
|
|
21001
21171
|
const Proto = {
|
|
21002
21172
|
[TypeId$1]: TypeId$1,
|
|
21003
21173
|
["~effect/Layer"]: {
|
|
@@ -21019,9 +21189,9 @@ const Proto = {
|
|
|
21019
21189
|
};
|
|
21020
21190
|
const make$5 = (provider, modelName, layer) => Object.assign(Object.create(Proto), { provider }, merge$3(layer, succeedContext(ProviderName.context(provider).pipe(add(ModelName, modelName)))));
|
|
21021
21191
|
//#endregion
|
|
21022
|
-
//#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
|
|
21023
21193
|
var Config$2 = class extends Service()("@effect/ai-openai/OpenAiEmbeddingModel/Config") {};
|
|
21024
|
-
const model$
|
|
21194
|
+
const model$2 = (model, options) => make$5("openai", model, merge$3(layer$4({
|
|
21025
21195
|
model,
|
|
21026
21196
|
config: {
|
|
21027
21197
|
...options.config,
|
|
@@ -21068,7 +21238,7 @@ const invalidOutput = (description) => make$18({
|
|
|
21068
21238
|
reason: new InvalidOutputError({ description })
|
|
21069
21239
|
});
|
|
21070
21240
|
//#endregion
|
|
21071
|
-
//#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
|
|
21072
21242
|
function toCodecOpenAI(schema) {
|
|
21073
21243
|
const codec = toCodec(schema);
|
|
21074
21244
|
const document = resolveTopLevelReference(toJsonSchemaDocument(codec, {
|
|
@@ -21077,7 +21247,7 @@ function toCodecOpenAI(schema) {
|
|
|
21077
21247
|
}));
|
|
21078
21248
|
const jsonSchema = rewriteOpenAI(document.schema);
|
|
21079
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"`);
|
|
21080
|
-
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);
|
|
21081
21251
|
return {
|
|
21082
21252
|
codec,
|
|
21083
21253
|
jsonSchema
|
|
@@ -21276,7 +21446,7 @@ const formats = new Set([
|
|
|
21276
21446
|
"uuid"
|
|
21277
21447
|
]);
|
|
21278
21448
|
//#endregion
|
|
21279
|
-
//#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
|
|
21280
21450
|
const finishReasonMap$1 = {
|
|
21281
21451
|
content_filter: "content-filter",
|
|
21282
21452
|
function_call: "tool-calls",
|
|
@@ -21292,7 +21462,7 @@ const resolveFinishReason$1 = (finishReason, hasToolCalls) => {
|
|
|
21292
21462
|
return reason;
|
|
21293
21463
|
};
|
|
21294
21464
|
//#endregion
|
|
21295
|
-
//#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
|
|
21296
21466
|
const addOpenAiRequestAttributes$1 = addSpanAttributes("gen_ai.openai.request", camelToSnake);
|
|
21297
21467
|
const addOpenAiResponseAttributes$1 = addSpanAttributes("gen_ai.openai.response", camelToSnake);
|
|
21298
21468
|
const addGenAIAnnotations$1 = dual(2, (span, options) => {
|
|
@@ -21303,7 +21473,7 @@ const addGenAIAnnotations$1 = dual(2, (span, options) => {
|
|
|
21303
21473
|
}
|
|
21304
21474
|
});
|
|
21305
21475
|
//#endregion
|
|
21306
|
-
//#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
|
|
21307
21477
|
ModelIdsResponses.members[1];
|
|
21308
21478
|
ModelIdsShared.members[1];
|
|
21309
21479
|
var Config$1 = class extends Service()("@effect/ai-openai/OpenAiLanguageModel/Config") {};
|
|
@@ -21336,7 +21506,7 @@ const make$3 = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
21336
21506
|
config,
|
|
21337
21507
|
options
|
|
21338
21508
|
});
|
|
21339
|
-
const { fileIdPrefixes: _fip, strictJsonSchema: _sjs, ...apiConfig } = config;
|
|
21509
|
+
const { fileIdPrefixes: _fip, strictJsonSchema: _sjs, useItemReferences: _uir, ...apiConfig } = config;
|
|
21340
21510
|
const request = {
|
|
21341
21511
|
...apiConfig,
|
|
21342
21512
|
input: messages,
|
|
@@ -21388,7 +21558,7 @@ const make$3 = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
21388
21558
|
options,
|
|
21389
21559
|
toolNameMapper
|
|
21390
21560
|
});
|
|
21391
|
-
}, (effect, options) => effect.pipe(unwrap$3, map$
|
|
21561
|
+
}, (effect, options) => effect.pipe(unwrap$3, map$9((response) => {
|
|
21392
21562
|
annotateStreamResponse$1(options.span, response);
|
|
21393
21563
|
return response;
|
|
21394
21564
|
})))
|
|
@@ -21402,7 +21572,9 @@ const withConfigOverride$1 = dual(2, (self, overrides) => flatMap$1(serviceOptio
|
|
|
21402
21572
|
const getSystemMessageMode$1 = (model) => model.startsWith("o") || model.startsWith("gpt-5") || model.startsWith("codex-") || model.startsWith("computer-use") ? "developer" : "system";
|
|
21403
21573
|
const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities, include, toolNameMapper }) {
|
|
21404
21574
|
const processedApprovalIds = new Set();
|
|
21575
|
+
const websocketMode = isSome(yield* serviceOption(OpenAiSocket));
|
|
21405
21576
|
const hasConversation = isNotNullish(config.conversation);
|
|
21577
|
+
const useItemReferences = config.store === true && config.useItemReferences !== false && options.incrementalFallback !== true;
|
|
21406
21578
|
const applyPatchTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiApplyPatch");
|
|
21407
21579
|
const codeInterpreterTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiCodeInterpreter");
|
|
21408
21580
|
const shellTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiShell");
|
|
@@ -21410,7 +21582,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21410
21582
|
const webSearchTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiWebSearch");
|
|
21411
21583
|
const webSearchPreviewTool = options.tools.find((tool) => isProviderDefined(tool) && tool.name === "OpenAiWebSearchPreview");
|
|
21412
21584
|
if (isNotUndefined(config.top_logprobs)) include.add("message.output_text.logprobs");
|
|
21413
|
-
if (
|
|
21585
|
+
if ((websocketMode || !useItemReferences) && capabilities.isReasoningModel) include.add("reasoning.encrypted_content");
|
|
21414
21586
|
if (codeInterpreterTool) include.add("code_interpreter_call.outputs");
|
|
21415
21587
|
if (webSearchTool || webSearchPreviewTool) include.add("web_search_call.action.sources");
|
|
21416
21588
|
const messages = [];
|
|
@@ -21447,7 +21619,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21447
21619
|
detail
|
|
21448
21620
|
});
|
|
21449
21621
|
else {
|
|
21450
|
-
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}`;
|
|
21451
21623
|
content.push({
|
|
21452
21624
|
type: "input_image",
|
|
21453
21625
|
image_url: imageUrl,
|
|
@@ -21464,7 +21636,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21464
21636
|
file_url: part.data.toString()
|
|
21465
21637
|
});
|
|
21466
21638
|
if (part.data instanceof Uint8Array) {
|
|
21467
|
-
const base64 =
|
|
21639
|
+
const base64 = encode(part.data);
|
|
21468
21640
|
const fileName = part.fileName ?? `part-${index}.pdf`;
|
|
21469
21641
|
const fileData = `data:application/pdf;base64,${base64}`;
|
|
21470
21642
|
content.push({
|
|
@@ -21488,11 +21660,17 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21488
21660
|
}
|
|
21489
21661
|
case "assistant": {
|
|
21490
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
|
+
});
|
|
21491
21669
|
for (const part of message.content) switch (part.type) {
|
|
21492
21670
|
case "text": {
|
|
21493
21671
|
const id = getItemId$1(part);
|
|
21494
21672
|
if (hasConversation && isNotNull(id)) break;
|
|
21495
|
-
if (
|
|
21673
|
+
if (useItemReferences && isNotNull(id)) {
|
|
21496
21674
|
messages.push({
|
|
21497
21675
|
type: "item_reference",
|
|
21498
21676
|
id
|
|
@@ -21519,7 +21697,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21519
21697
|
if (hasConversation && isNotNull(id)) break;
|
|
21520
21698
|
if (isNotNull(id)) {
|
|
21521
21699
|
const message = reasoningMessages[id];
|
|
21522
|
-
if (
|
|
21700
|
+
if (useItemReferences) {
|
|
21523
21701
|
if (isUndefined(message)) {
|
|
21524
21702
|
messages.push({
|
|
21525
21703
|
type: "item_reference",
|
|
@@ -21557,14 +21735,64 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21557
21735
|
const id = getItemId$1(part);
|
|
21558
21736
|
const status = getStatus$1(part);
|
|
21559
21737
|
if (hasConversation && isNotNull(id)) break;
|
|
21560
|
-
if (
|
|
21738
|
+
if (useItemReferences && isNotNull(id)) {
|
|
21561
21739
|
messages.push({
|
|
21562
21740
|
type: "item_reference",
|
|
21563
21741
|
id
|
|
21564
21742
|
});
|
|
21565
21743
|
break;
|
|
21566
21744
|
}
|
|
21567
|
-
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
|
+
}
|
|
21568
21796
|
const toolName = toolNameMapper.getProviderName(part.name);
|
|
21569
21797
|
if (isNotUndefined(localShellTool) && toolName === "local_shell") {
|
|
21570
21798
|
const params = yield* decodeUnknownEffect$1(localShellTool.parametersSchema)(part.params).pipe(mapError((error) => make$18({
|
|
@@ -21615,12 +21843,15 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21615
21843
|
case "tool-result":
|
|
21616
21844
|
if (hasProperty(part.result, "type") && part.result.type === "execution-denied") break;
|
|
21617
21845
|
if (hasConversation) break;
|
|
21618
|
-
if (
|
|
21846
|
+
if (useItemReferences) {
|
|
21619
21847
|
const id = getItemId$1(part) ?? part.id;
|
|
21620
21848
|
messages.push({
|
|
21621
21849
|
type: "item_reference",
|
|
21622
21850
|
id
|
|
21623
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);
|
|
21624
21855
|
}
|
|
21625
21856
|
}
|
|
21626
21857
|
break;
|
|
@@ -21629,7 +21860,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, capabilities,
|
|
|
21629
21860
|
if (part.type === "tool-approval-response") {
|
|
21630
21861
|
if (processedApprovalIds.has(part.approvalId)) continue;
|
|
21631
21862
|
processedApprovalIds.add(part.approvalId);
|
|
21632
|
-
if (
|
|
21863
|
+
if (useItemReferences) messages.push({
|
|
21633
21864
|
type: "item_reference",
|
|
21634
21865
|
id: part.approvalId
|
|
21635
21866
|
});
|
|
@@ -22045,6 +22276,7 @@ const makeResponse$1 = fnUntraced(function* ({ options, rawResponse, response, t
|
|
|
22045
22276
|
});
|
|
22046
22277
|
const makeStreamResponse$1 = fnUntraced(function* ({ stream, response, config, options, toolNameMapper }) {
|
|
22047
22278
|
const idGenerator = yield* IdGenerator;
|
|
22279
|
+
const websocketMode = isSome(yield* serviceOption(OpenAiSocket));
|
|
22048
22280
|
const approvalRequests = getApprovalRequestIdMapping(options.prompt);
|
|
22049
22281
|
const streamApprovalRequests = new Map();
|
|
22050
22282
|
let hasToolCalls = false;
|
|
@@ -22787,7 +23019,7 @@ const makeStreamResponse$1 = fnUntraced(function* ({ stream, response, config, o
|
|
|
22787
23019
|
break;
|
|
22788
23020
|
case "response.reasoning_summary_part.done": {
|
|
22789
23021
|
const reasoningPart = getOrCreateReasoningPart(event.item_id);
|
|
22790
|
-
if (config.store === true) {
|
|
23022
|
+
if (!websocketMode && config.store === true && config.useItemReferences !== false) {
|
|
22791
23023
|
parts.push({
|
|
22792
23024
|
type: "reasoning-end",
|
|
22793
23025
|
id: `${event.item_id}:${event.summary_index}`,
|
|
@@ -23221,7 +23453,7 @@ const decodeJwtPayload = (token) => {
|
|
|
23221
23453
|
if (parts.length !== 3) return none();
|
|
23222
23454
|
const payload = parts[1];
|
|
23223
23455
|
if (payload === void 0) return none();
|
|
23224
|
-
return fromNullishOr(getOrUndefined$2(
|
|
23456
|
+
return fromNullishOr(getOrUndefined$2(decodeString(payload)));
|
|
23225
23457
|
};
|
|
23226
23458
|
const parseJwtClaims = (token) => decodeJwtPayload(token).pipe(flatMap$2(decodeJwtJson), flatMap$2(toJwtClaims));
|
|
23227
23459
|
const extractAccountIdFromClaims = (claims) => {
|
|
@@ -23492,7 +23724,7 @@ const make$2 = gen(function* () {
|
|
|
23492
23724
|
const singleTool = yield* SingleTools.pipe(provide$1(SingleToolHandlers));
|
|
23493
23725
|
const capabilities = yield* executor.capabilities;
|
|
23494
23726
|
const pendingMessages = new Set();
|
|
23495
|
-
const agentsMd = map$
|
|
23727
|
+
const agentsMd = map$8(capabilities.agentsMd, (content) => `# AGENTS.md
|
|
23496
23728
|
|
|
23497
23729
|
The following instructions are from ./AGENTS.md in the current directory.
|
|
23498
23730
|
You do not need to read this file again.
|
|
@@ -23778,7 +24010,7 @@ ${content}
|
|
|
23778
24010
|
return void_;
|
|
23779
24011
|
}), modelConfig.systemPromptTransform ? (effect) => modelConfig.systemPromptTransform(system, effect) : identity);
|
|
23780
24012
|
const attempt = pipe(runModel, raceFirst(turnTimeoutEffect), retry({
|
|
23781
|
-
while
|
|
24013
|
+
while(err) {
|
|
23782
24014
|
if (err._tag === "TimeoutError") {
|
|
23783
24015
|
maybeSend({
|
|
23784
24016
|
agentId,
|
|
@@ -23977,7 +24209,7 @@ const responseToSummary = (response) => {
|
|
|
23977
24209
|
//#endregion
|
|
23978
24210
|
//#region src/Codex.ts
|
|
23979
24211
|
const layerClient$2 = layer$5({ apiUrl: "https://chatgpt.com/backend-api/codex" }).pipe(provide$3(CodexAuth.layerClient));
|
|
23980
|
-
const modelWebSocket = (model, options) => make$5("openai", model, layerModel(model, options).pipe(merge$3(fresh(layerWebSocketMode))));
|
|
24212
|
+
const modelWebSocket$1 = (model, options) => make$5("openai", model, layerModel(model, options).pipe(merge$3(fresh(layerWebSocketMode))));
|
|
23981
24213
|
const layerModel = (model, options) => layer$3({
|
|
23982
24214
|
model,
|
|
23983
24215
|
config: {
|
|
@@ -23998,7 +24230,7 @@ const layerModel = (model, options) => layer$3({
|
|
|
23998
24230
|
supportsImages: options?.supportsImages
|
|
23999
24231
|
})));
|
|
24000
24232
|
//#endregion
|
|
24001
|
-
//#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
|
|
24002
24234
|
const OpenAiErrorBody = Struct({ error: Struct({
|
|
24003
24235
|
message: String$5,
|
|
24004
24236
|
type: optional$2(NullOr(String$5)),
|
|
@@ -24081,7 +24313,7 @@ const mapStatusCodeError = fnUntraced(function* (error, method) {
|
|
|
24081
24313
|
}),
|
|
24082
24314
|
metadata: {
|
|
24083
24315
|
errorCode: isSome(decoded) ? decoded.value.error.code?.toString() ?? null : null,
|
|
24084
|
-
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),
|
|
24085
24317
|
requestId: requestId ?? null
|
|
24086
24318
|
}
|
|
24087
24319
|
});
|
|
@@ -24095,11 +24327,11 @@ const parseRateLimitHeaders = (headers) => {
|
|
|
24095
24327
|
const retryAfterRaw = headers["retry-after"];
|
|
24096
24328
|
let retryAfter;
|
|
24097
24329
|
if (retryAfterRaw !== void 0) {
|
|
24098
|
-
const parsed = parse$
|
|
24330
|
+
const parsed = parse$1(retryAfterRaw);
|
|
24099
24331
|
if (isSome(parsed)) retryAfter = seconds(parsed.value);
|
|
24100
24332
|
}
|
|
24101
24333
|
const remainingRaw = headers["x-ratelimit-remaining-requests"];
|
|
24102
|
-
const remaining = remainingRaw !== void 0 ? getOrNull(parse$
|
|
24334
|
+
const remaining = remainingRaw !== void 0 ? getOrNull(parse$1(remainingRaw)) : null;
|
|
24103
24335
|
return {
|
|
24104
24336
|
retryAfter,
|
|
24105
24337
|
limit: headers["x-ratelimit-limit-requests"] ?? null,
|
|
@@ -24192,12 +24424,12 @@ const mapStatusCodeToReason = ({ status, headers, message, metadata, http }) =>
|
|
|
24192
24424
|
}
|
|
24193
24425
|
};
|
|
24194
24426
|
//#endregion
|
|
24195
|
-
//#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
|
|
24196
24428
|
var OpenAiConfig = class OpenAiConfig extends Service()("@effect/ai-openai-compat/OpenAiConfig") {
|
|
24197
24429
|
static getOrUndefined = map$5(context(), getOrUndefined$1(OpenAiConfig));
|
|
24198
24430
|
};
|
|
24199
24431
|
//#endregion
|
|
24200
|
-
//#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
|
|
24201
24433
|
var OpenAiClient = class extends Service()("@effect/ai-openai-compat/OpenAiClient") {};
|
|
24202
24434
|
const RedactedOpenAiHeaders = {
|
|
24203
24435
|
OpenAiOrganization: "openai-organization",
|
|
@@ -24269,7 +24501,7 @@ const ChatCompletionToolCall = Struct({
|
|
|
24269
24501
|
function: optionalKey(ChatCompletionToolFunction)
|
|
24270
24502
|
});
|
|
24271
24503
|
const ChatCompletionToolCallDelta = Struct({
|
|
24272
|
-
id: optionalKey(String$5),
|
|
24504
|
+
id: optionalKey(NullOr(String$5)),
|
|
24273
24505
|
index: optionalKey(Int$1),
|
|
24274
24506
|
type: optionalKey(String$5),
|
|
24275
24507
|
function: optionalKey(ChatCompletionToolFunctionDelta)
|
|
@@ -24282,7 +24514,7 @@ const ChatCompletionMessage = Struct({
|
|
|
24282
24514
|
tool_calls: optionalKey(ArraySchema(ChatCompletionToolCall))
|
|
24283
24515
|
});
|
|
24284
24516
|
const ChatCompletionDelta = Struct({
|
|
24285
|
-
role: optionalKey(String$5),
|
|
24517
|
+
role: optionalKey(NullOr(String$5)),
|
|
24286
24518
|
content: optionalKey(NullOr(String$5)),
|
|
24287
24519
|
reasoning: optionalKey(NullOr(String$5)),
|
|
24288
24520
|
reasoning_content: optionalKey(NullOr(String$5)),
|
|
@@ -24335,7 +24567,7 @@ const decodeChatCompletionSseData = (data) => {
|
|
|
24335
24567
|
};
|
|
24336
24568
|
};
|
|
24337
24569
|
//#endregion
|
|
24338
|
-
//#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
|
|
24339
24571
|
const finishReasonMap = {
|
|
24340
24572
|
content_filter: "content-filter",
|
|
24341
24573
|
function_call: "tool-calls",
|
|
@@ -24350,7 +24582,7 @@ const resolveFinishReason = (finishReason, hasToolCalls) => {
|
|
|
24350
24582
|
return reason;
|
|
24351
24583
|
};
|
|
24352
24584
|
//#endregion
|
|
24353
|
-
//#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
|
|
24354
24586
|
const addOpenAiRequestAttributes = addSpanAttributes("gen_ai.openai.request", camelToSnake);
|
|
24355
24587
|
const addOpenAiResponseAttributes = addSpanAttributes("gen_ai.openai.response", camelToSnake);
|
|
24356
24588
|
const addGenAIAnnotations = dual(2, (span, options) => {
|
|
@@ -24361,7 +24593,7 @@ const addGenAIAnnotations = dual(2, (span, options) => {
|
|
|
24361
24593
|
}
|
|
24362
24594
|
});
|
|
24363
24595
|
//#endregion
|
|
24364
|
-
//#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
|
|
24365
24597
|
var Config = class extends Service()("@effect/ai-openai-compat/OpenAiLanguageModel/Config") {};
|
|
24366
24598
|
const make = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
24367
24599
|
const client = yield* OpenAiClient;
|
|
@@ -24439,7 +24671,7 @@ const make = fnUntraced(function* ({ model, config: providerConfig }) {
|
|
|
24439
24671
|
response,
|
|
24440
24672
|
toolNameMapper
|
|
24441
24673
|
});
|
|
24442
|
-
}, (effect, options) => effect.pipe(unwrap$3, map$
|
|
24674
|
+
}, (effect, options) => effect.pipe(unwrap$3, map$9((response) => {
|
|
24443
24675
|
annotateStreamResponse(options.span, response);
|
|
24444
24676
|
return response;
|
|
24445
24677
|
})))
|
|
@@ -24483,7 +24715,7 @@ const prepareMessages = fnUntraced(function* ({ config, options, capabilities, i
|
|
|
24483
24715
|
detail
|
|
24484
24716
|
});
|
|
24485
24717
|
else {
|
|
24486
|
-
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}`;
|
|
24487
24719
|
content.push({
|
|
24488
24720
|
type: "input_image",
|
|
24489
24721
|
image_url: imageUrl,
|
|
@@ -24500,7 +24732,7 @@ const prepareMessages = fnUntraced(function* ({ config, options, capabilities, i
|
|
|
24500
24732
|
file_url: part.data.toString()
|
|
24501
24733
|
});
|
|
24502
24734
|
if (part.data instanceof Uint8Array) {
|
|
24503
|
-
const base64 =
|
|
24735
|
+
const base64 = encode(part.data);
|
|
24504
24736
|
const fileName = part.fileName ?? `part-${index}.pdf`;
|
|
24505
24737
|
const fileData = `data:application/pdf;base64,${base64}`;
|
|
24506
24738
|
content.push({
|
|
@@ -25480,7 +25712,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service()("clanka/Github
|
|
|
25480
25712
|
//#endregion
|
|
25481
25713
|
//#region src/Copilot.ts
|
|
25482
25714
|
const layerClient$1 = layer$1({ apiUrl: API_URL }).pipe(provide$3(GithubCopilotAuth.layerClient));
|
|
25483
|
-
const model$
|
|
25715
|
+
const model$1 = (model, options) => make$5("openai", model, mergeAll(layer({
|
|
25484
25716
|
model,
|
|
25485
25717
|
config: omit(options ?? {}, ["systemPromptTransform", "supportsImages"])
|
|
25486
25718
|
}), AgentModelConfig.layer({
|
|
@@ -25631,11 +25863,12 @@ var XaiAuth = class XaiAuth extends Service()("clanka/XaiAuth") {
|
|
|
25631
25863
|
//#endregion
|
|
25632
25864
|
//#region src/Xai.ts
|
|
25633
25865
|
const layerClient = layer$5({ apiUrl: "https://api.x.ai/v1" }).pipe(provide$3(XaiAuth.layerClient));
|
|
25634
|
-
const
|
|
25866
|
+
const modelWebSocket = (model, options) => make$5("xai", model, mergeAll(layer$3({
|
|
25635
25867
|
model,
|
|
25636
25868
|
config: {
|
|
25637
25869
|
...omit(options ?? {}, ["systemPromptTransform", "supportsImages"]),
|
|
25638
|
-
store:
|
|
25870
|
+
store: true,
|
|
25871
|
+
useItemReferences: false,
|
|
25639
25872
|
reasoning: {
|
|
25640
25873
|
effort: "high",
|
|
25641
25874
|
...options?.reasoning
|
|
@@ -25644,13 +25877,13 @@ const model$1 = (model, options) => make$5("xai", model, mergeAll(layer$3({
|
|
|
25644
25877
|
}), AgentModelConfig.layer({
|
|
25645
25878
|
systemPromptTransform: options?.systemPromptTransform,
|
|
25646
25879
|
supportsImages: options?.supportsImages
|
|
25647
|
-
}), succeed$4(SummarizerTransform, (effect) => withConfigOverride$1(effect, { max_output_tokens: summarizerMaxOutputTokens }))));
|
|
25880
|
+
}), succeed$4(SummarizerTransform, (effect) => withConfigOverride$1(effect, { max_output_tokens: summarizerMaxOutputTokens })), fresh(layerWebSocketMode)));
|
|
25648
25881
|
//#endregion
|
|
25649
|
-
//#region node_modules/.pnpm/effect@
|
|
25882
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Logger.js
|
|
25650
25883
|
const LogToStderr = LogToStderr$1;
|
|
25651
25884
|
//#endregion
|
|
25652
25885
|
//#region package.json
|
|
25653
|
-
var version$1 = "0.8.
|
|
25886
|
+
var version$1 = "0.8.1";
|
|
25654
25887
|
//#endregion
|
|
25655
25888
|
//#region src/cli.ts
|
|
25656
25889
|
const version = version$1;
|
|
@@ -25661,7 +25894,7 @@ const providers = [
|
|
|
25661
25894
|
"xai"
|
|
25662
25895
|
];
|
|
25663
25896
|
const withSubagentModel = (model) => merge$3(model, layerSubagentModel(model));
|
|
25664
|
-
const modelLayer = (provider, model, effort) => provider === "openai" ? withSubagentModel(modelWebSocket(model, { reasoning: { effort } })).pipe(provide$3(layerClient$2)) : provider === "xai" ? withSubagentModel(
|
|
25897
|
+
const modelLayer = (provider, model, effort) => provider === "openai" ? withSubagentModel(modelWebSocket$1(model, { reasoning: { effort } })).pipe(provide$3(layerClient$2)) : provider === "xai" ? withSubagentModel(modelWebSocket(model, { reasoning: { effort } })).pipe(provide$3(layerClient)) : withSubagentModel(model$1(model, { reasoning: { effort } })).pipe(provide$3(layerClient$1));
|
|
25665
25898
|
const isProvider = (provider) => providers.includes(provider);
|
|
25666
25899
|
const parseModelId = (modelId) => {
|
|
25667
25900
|
const [provider, model, effort, ...rest] = modelId.split("/");
|
|
@@ -25712,10 +25945,10 @@ const Search = (directory) => unwrap$1(gen(function* () {
|
|
|
25712
25945
|
return empty$9;
|
|
25713
25946
|
}
|
|
25714
25947
|
const path = yield* Path$3;
|
|
25715
|
-
return (yield* promise(() => import("./SemanticSearch-
|
|
25948
|
+
return (yield* promise(() => import("./SemanticSearch-BHUGFT1y.mjs"))).layer({
|
|
25716
25949
|
directory: process.cwd(),
|
|
25717
25950
|
database: path.join(directory, "search.sqlite")
|
|
25718
|
-
}).pipe(provide$3(model$
|
|
25951
|
+
}).pipe(provide$3(model$2("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$5({ apiKey: apiKey.value })));
|
|
25719
25952
|
})).pipe(provide$3([layer$8, HttpClientLive]));
|
|
25720
25953
|
const acpModel = String$1("model").pipe(withAlias("m"), withDescription$1("Default model as <provider>/<model>/<effort>, e.g. openai/gpt-6-astra/medium"), withSchema(ModelId), withDefault("openai/gpt-6-astra/medium"), map$1((modelId) => getOrThrow(parseModelId(modelId))));
|
|
25721
25954
|
const acp = make$28("acp", {
|
|
@@ -25726,7 +25959,7 @@ const acp = make$28("acp", {
|
|
|
25726
25959
|
defaultModel: model.model,
|
|
25727
25960
|
defaultThoughtLevel: model.thoughtLevel,
|
|
25728
25961
|
makeAgent: (cwd) => make$2.pipe(provide$1(layerLocal$1({ directory: cwd }))),
|
|
25729
|
-
makeModel: (modelId, thoughtLevel) => map$
|
|
25962
|
+
makeModel: (modelId, thoughtLevel) => map$8(parseAcpModelId(modelId), ({ provider, model }) => modelLayer(provider, model, thoughtLevel))
|
|
25730
25963
|
})), provide(({ compaction }) => mergeAll(ConversationMode.layer(true), succeed$4(LogToStderr, true), layerLog, CompactionConfig.layer({ enabled: compaction }))));
|
|
25731
25964
|
make$28("clanka", {
|
|
25732
25965
|
provider,
|
|
@@ -25736,7 +25969,7 @@ make$28("clanka", {
|
|
|
25736
25969
|
compaction
|
|
25737
25970
|
}).pipe(withHandler(fnUntraced(function* ({ provider, model: modelRaw, semantic, prompt: nonInteractivePrompt }) {
|
|
25738
25971
|
const stdio = yield* Stdio;
|
|
25739
|
-
const OutputFormatter = yield* promise(() => import("./OutputFormatter-
|
|
25972
|
+
const OutputFormatter = yield* promise(() => import("./OutputFormatter-BpggeGvI.mjs"));
|
|
25740
25973
|
const [model, reasoning] = (yield* match$2(modelRaw, {
|
|
25741
25974
|
onSome: succeed$2,
|
|
25742
25975
|
onNone: () => String$4({
|