@punks/cli 2.0.1 → 2.1.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/README.md +7 -7
- package/dist/index.js +744 -1490
- package/dist/skills/agnostic/cli/dp-cli/SKILL.md +18 -2
- package/dist/skills/agnostic/cli/dp-cli/references/commands.md +8 -6
- package/dist/skills/agnostic/cli/dp-cli/references/post-command-flow.md +7 -0
- package/dist/skills/agnostic/planning/create-spec/references/discovery.md +3 -3
- package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +1 -1
- package/dist/skills/agnostic/requirements/requirements-grill/references/wiki-output.md +1 -1
- package/dist/skills/phases/bug-discovery-phase/REFERENCE.md +21 -5
- package/dist/skills/phases/bug-discovery-phase/SKILL.md +3 -1
- package/dist/skills/phases/bug-resolution-phase/REFERENCE.md +11 -5
- package/dist/skills/phases/bug-resolution-phase/SKILL.md +3 -1
- package/dist/skills/phases/docs-ingest-phase/SKILL.md +2 -1
- package/dist/skills/phases/docs-ingest-phase/references/concept-pages.md +2 -2
- package/dist/skills/phases/docs-ingest-phase/references/flow-pages.md +1 -1
- package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +22 -7
- package/dist/skills/phases/docs-ingest-phase/references/wiki-ingest.md +1 -1
- package/dist/skills/phases/goalify/EXAMPLES.md +6 -0
- package/dist/skills/phases/goalify/SKILL.md +22 -1
- package/dist/skills/phases/resolve-debt-phase/SKILL.md +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5503,8 +5503,8 @@ ${ctx.indent}`;
|
|
|
5503
5503
|
const nl0 = valueStr.indexOf(`
|
|
5504
5504
|
`);
|
|
5505
5505
|
const hasNewline = nl0 !== -1;
|
|
5506
|
-
const
|
|
5507
|
-
if (hasNewline || !
|
|
5506
|
+
const flow = ctx.inFlow ?? value3.flow ?? value3.items.length === 0;
|
|
5507
|
+
if (hasNewline || !flow) {
|
|
5508
5508
|
let hasPropsLine = false;
|
|
5509
5509
|
if (hasNewline && (vs0 === "&" || vs0 === "!")) {
|
|
5510
5510
|
let sp0 = valueStr.indexOf(" ");
|
|
@@ -5717,8 +5717,8 @@ var require_stringifyCollection = __commonJS((exports) => {
|
|
|
5717
5717
|
var stringify = require_stringify();
|
|
5718
5718
|
var stringifyComment = require_stringifyComment();
|
|
5719
5719
|
function stringifyCollection(collection, ctx, options) {
|
|
5720
|
-
const
|
|
5721
|
-
const stringify2 =
|
|
5720
|
+
const flow = ctx.inFlow ?? collection.flow;
|
|
5721
|
+
const stringify2 = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
5722
5722
|
return stringify2(collection, ctx, options);
|
|
5723
5723
|
}
|
|
5724
5724
|
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
@@ -7227,7 +7227,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
7227
7227
|
options = replacer;
|
|
7228
7228
|
replacer = undefined;
|
|
7229
7229
|
}
|
|
7230
|
-
const { aliasDuplicateObjects, anchorPrefix, flow
|
|
7230
|
+
const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag: tag3 } = options ?? {};
|
|
7231
7231
|
const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(this, anchorPrefix || "a");
|
|
7232
7232
|
const ctx = {
|
|
7233
7233
|
aliasDuplicateObjects: aliasDuplicateObjects ?? true,
|
|
@@ -7239,7 +7239,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
7239
7239
|
sourceObjects
|
|
7240
7240
|
};
|
|
7241
7241
|
const node = createNode.createNode(value3, tag3, ctx);
|
|
7242
|
-
if (
|
|
7242
|
+
if (flow && identity3.isCollection(node))
|
|
7243
7243
|
node.flow = true;
|
|
7244
7244
|
setAnchors();
|
|
7245
7245
|
return node;
|
|
@@ -7433,7 +7433,7 @@ ${pointer}
|
|
|
7433
7433
|
|
|
7434
7434
|
// ../../node_modules/.bun/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-props.js
|
|
7435
7435
|
var require_resolve_props = __commonJS((exports) => {
|
|
7436
|
-
function resolveProps(tokens, { flow
|
|
7436
|
+
function resolveProps(tokens, { flow, indicator, next, offset, onError: onError4, parentIndent, startOnNewline }) {
|
|
7437
7437
|
let spaceBefore = false;
|
|
7438
7438
|
let atNewline = startOnNewline;
|
|
7439
7439
|
let hasSpace = startOnNewline;
|
|
@@ -7462,7 +7462,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
7462
7462
|
}
|
|
7463
7463
|
switch (token.type) {
|
|
7464
7464
|
case "space":
|
|
7465
|
-
if (!
|
|
7465
|
+
if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes("\t")) {
|
|
7466
7466
|
tab = token;
|
|
7467
7467
|
}
|
|
7468
7468
|
hasSpace = true;
|
|
@@ -7518,15 +7518,15 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
7518
7518
|
if (anchor || tag3)
|
|
7519
7519
|
onError4(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`);
|
|
7520
7520
|
if (found)
|
|
7521
|
-
onError4(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${
|
|
7521
|
+
onError4(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`);
|
|
7522
7522
|
found = token;
|
|
7523
7523
|
atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
|
|
7524
7524
|
hasSpace = false;
|
|
7525
7525
|
break;
|
|
7526
7526
|
case "comma":
|
|
7527
|
-
if (
|
|
7527
|
+
if (flow) {
|
|
7528
7528
|
if (comma)
|
|
7529
|
-
onError4(token, "UNEXPECTED_TOKEN", `Unexpected , in ${
|
|
7529
|
+
onError4(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`);
|
|
7530
7530
|
comma = token;
|
|
7531
7531
|
atNewline = false;
|
|
7532
7532
|
hasSpace = false;
|
|
@@ -10891,9 +10891,9 @@ var require_public_api = __commonJS((exports) => {
|
|
|
10891
10891
|
|
|
10892
10892
|
// src/index.ts
|
|
10893
10893
|
import { spawn as spawn2 } from "child_process";
|
|
10894
|
-
import { existsSync as
|
|
10895
|
-
import { homedir as
|
|
10896
|
-
import
|
|
10894
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
|
|
10895
|
+
import { homedir as homedir3 } from "os";
|
|
10896
|
+
import path15 from "path";
|
|
10897
10897
|
|
|
10898
10898
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Array.js
|
|
10899
10899
|
var exports_Array = {};
|
|
@@ -11131,45 +11131,6 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
|
11131
11131
|
}
|
|
11132
11132
|
}
|
|
11133
11133
|
}
|
|
11134
|
-
function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
11135
|
-
switch (arguments.length) {
|
|
11136
|
-
case 1:
|
|
11137
|
-
return ab;
|
|
11138
|
-
case 2:
|
|
11139
|
-
return function() {
|
|
11140
|
-
return bc(ab.apply(this, arguments));
|
|
11141
|
-
};
|
|
11142
|
-
case 3:
|
|
11143
|
-
return function() {
|
|
11144
|
-
return cd(bc(ab.apply(this, arguments)));
|
|
11145
|
-
};
|
|
11146
|
-
case 4:
|
|
11147
|
-
return function() {
|
|
11148
|
-
return de(cd(bc(ab.apply(this, arguments))));
|
|
11149
|
-
};
|
|
11150
|
-
case 5:
|
|
11151
|
-
return function() {
|
|
11152
|
-
return ef(de(cd(bc(ab.apply(this, arguments)))));
|
|
11153
|
-
};
|
|
11154
|
-
case 6:
|
|
11155
|
-
return function() {
|
|
11156
|
-
return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
|
|
11157
|
-
};
|
|
11158
|
-
case 7:
|
|
11159
|
-
return function() {
|
|
11160
|
-
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
|
|
11161
|
-
};
|
|
11162
|
-
case 8:
|
|
11163
|
-
return function() {
|
|
11164
|
-
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
|
|
11165
|
-
};
|
|
11166
|
-
case 9:
|
|
11167
|
-
return function() {
|
|
11168
|
-
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
|
|
11169
|
-
};
|
|
11170
|
-
}
|
|
11171
|
-
return;
|
|
11172
|
-
}
|
|
11173
11134
|
|
|
11174
11135
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Equivalence.js
|
|
11175
11136
|
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
@@ -11243,7 +11204,6 @@ var isDate = (input) => input instanceof Date;
|
|
|
11243
11204
|
var isIterable = (input) => typeof input === "string" || hasProperty(input, Symbol.iterator);
|
|
11244
11205
|
var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input);
|
|
11245
11206
|
var isPromiseLike = (input) => hasProperty(input, "then") && isFunction2(input.then);
|
|
11246
|
-
var or = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) || that(a));
|
|
11247
11207
|
|
|
11248
11208
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/errors.js
|
|
11249
11209
|
var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
|
|
@@ -12014,7 +11974,6 @@ var try_ = (evaluate) => {
|
|
|
12014
11974
|
var isEither2 = isEither;
|
|
12015
11975
|
var isLeft2 = isLeft;
|
|
12016
11976
|
var isRight2 = isRight;
|
|
12017
|
-
var getRight2 = getRight;
|
|
12018
11977
|
var getEquivalence = ({
|
|
12019
11978
|
left: left3,
|
|
12020
11979
|
right: right3
|
|
@@ -12097,7 +12056,7 @@ var match2 = /* @__PURE__ */ dual(2, (self, {
|
|
|
12097
12056
|
onNone,
|
|
12098
12057
|
onSome
|
|
12099
12058
|
}) => isNone2(self) ? onNone() : onSome(self.value));
|
|
12100
|
-
var
|
|
12059
|
+
var getRight2 = getRight;
|
|
12101
12060
|
var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
|
|
12102
12061
|
var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
|
|
12103
12062
|
var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some2(onNone()) : self);
|
|
@@ -13051,31 +13010,6 @@ var InvalidData2 = InvalidData;
|
|
|
13051
13010
|
var isConfigError2 = isConfigError;
|
|
13052
13011
|
var isMissingDataOnly2 = isMissingDataOnly;
|
|
13053
13012
|
|
|
13054
|
-
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Context.js
|
|
13055
|
-
var exports_Context = {};
|
|
13056
|
-
__export(exports_Context, {
|
|
13057
|
-
unsafeMake: () => unsafeMake,
|
|
13058
|
-
unsafeGet: () => unsafeGet3,
|
|
13059
|
-
pick: () => pick2,
|
|
13060
|
-
omit: () => omit2,
|
|
13061
|
-
mergeAll: () => mergeAll2,
|
|
13062
|
-
merge: () => merge3,
|
|
13063
|
-
make: () => make6,
|
|
13064
|
-
isTag: () => isTag2,
|
|
13065
|
-
isReference: () => isReference2,
|
|
13066
|
-
isContext: () => isContext2,
|
|
13067
|
-
getOrElse: () => getOrElse3,
|
|
13068
|
-
getOption: () => getOption2,
|
|
13069
|
-
get: () => get3,
|
|
13070
|
-
empty: () => empty6,
|
|
13071
|
-
add: () => add2,
|
|
13072
|
-
TagTypeId: () => TagTypeId2,
|
|
13073
|
-
Tag: () => Tag2,
|
|
13074
|
-
ReferenceTypeId: () => ReferenceTypeId2,
|
|
13075
|
-
Reference: () => Reference2,
|
|
13076
|
-
GenericTag: () => GenericTag
|
|
13077
|
-
});
|
|
13078
|
-
|
|
13079
13013
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/context.js
|
|
13080
13014
|
var TagTypeId = /* @__PURE__ */ Symbol.for("effect/Context/Tag");
|
|
13081
13015
|
var ReferenceTypeId = /* @__PURE__ */ Symbol.for("effect/Context/Reference");
|
|
@@ -13281,16 +13215,6 @@ var mergeAll = (...ctxs) => {
|
|
|
13281
13215
|
}
|
|
13282
13216
|
return makeContext(map5);
|
|
13283
13217
|
};
|
|
13284
|
-
var pick = (...tags) => (self) => {
|
|
13285
|
-
const tagSet = new Set(tags.map((_) => _.key));
|
|
13286
|
-
const newEnv = new Map;
|
|
13287
|
-
for (const [tag, s] of self.unsafeMap.entries()) {
|
|
13288
|
-
if (tagSet.has(tag)) {
|
|
13289
|
-
newEnv.set(tag, s);
|
|
13290
|
-
}
|
|
13291
|
-
}
|
|
13292
|
-
return makeContext(newEnv);
|
|
13293
|
-
};
|
|
13294
13218
|
var omit = (...tags) => (self) => {
|
|
13295
13219
|
const newEnv = new Map(self.unsafeMap);
|
|
13296
13220
|
for (const tag of tags) {
|
|
@@ -13300,13 +13224,9 @@ var omit = (...tags) => (self) => {
|
|
|
13300
13224
|
};
|
|
13301
13225
|
|
|
13302
13226
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Context.js
|
|
13303
|
-
var TagTypeId2 = TagTypeId;
|
|
13304
|
-
var ReferenceTypeId2 = ReferenceTypeId;
|
|
13305
13227
|
var GenericTag = makeGenericTag;
|
|
13306
|
-
var unsafeMake = makeContext;
|
|
13307
13228
|
var isContext2 = isContext;
|
|
13308
13229
|
var isTag2 = isTag;
|
|
13309
|
-
var isReference2 = isReference;
|
|
13310
13230
|
var empty6 = empty5;
|
|
13311
13231
|
var make6 = make5;
|
|
13312
13232
|
var add2 = add;
|
|
@@ -13316,7 +13236,6 @@ var unsafeGet3 = unsafeGet2;
|
|
|
13316
13236
|
var getOption2 = getOption;
|
|
13317
13237
|
var merge3 = merge2;
|
|
13318
13238
|
var mergeAll2 = mergeAll;
|
|
13319
|
-
var pick2 = pick;
|
|
13320
13239
|
var omit2 = omit;
|
|
13321
13240
|
var Tag2 = Tag;
|
|
13322
13241
|
var Reference2 = Reference;
|
|
@@ -14849,7 +14768,7 @@ var threadName = (self) => {
|
|
|
14849
14768
|
const identifiers = Array.from(ids(self)).map((n) => `#${n}`).join(",");
|
|
14850
14769
|
return identifiers;
|
|
14851
14770
|
};
|
|
14852
|
-
var
|
|
14771
|
+
var unsafeMake = () => {
|
|
14853
14772
|
const id = get6(_fiberCounter);
|
|
14854
14773
|
pipe(_fiberCounter, set3(id + 1));
|
|
14855
14774
|
return new Runtime(id, Date.now());
|
|
@@ -14865,7 +14784,7 @@ var combineAll3 = combineAll2;
|
|
|
14865
14784
|
var ids2 = ids;
|
|
14866
14785
|
var make15 = make14;
|
|
14867
14786
|
var threadName2 = threadName;
|
|
14868
|
-
var
|
|
14787
|
+
var unsafeMake2 = unsafeMake;
|
|
14869
14788
|
|
|
14870
14789
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/HashMap.js
|
|
14871
14790
|
var isHashMap2 = isHashMap;
|
|
@@ -18108,11 +18027,11 @@ var parallel3 = parallel2;
|
|
|
18108
18027
|
var parallelN2 = parallelN;
|
|
18109
18028
|
|
|
18110
18029
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/fiberRefs.js
|
|
18111
|
-
function
|
|
18030
|
+
function unsafeMake3(fiberRefLocals) {
|
|
18112
18031
|
return new FiberRefsImpl(fiberRefLocals);
|
|
18113
18032
|
}
|
|
18114
18033
|
function empty21() {
|
|
18115
|
-
return
|
|
18034
|
+
return unsafeMake3(new Map);
|
|
18116
18035
|
}
|
|
18117
18036
|
var FiberRefsSym = /* @__PURE__ */ Symbol.for("effect/FiberRefs");
|
|
18118
18037
|
|
|
@@ -18965,8 +18884,8 @@ class RefImpl extends Class2 {
|
|
|
18965
18884
|
});
|
|
18966
18885
|
}
|
|
18967
18886
|
}
|
|
18968
|
-
var
|
|
18969
|
-
var make24 = (value) => sync(() =>
|
|
18887
|
+
var unsafeMake4 = (value) => new RefImpl(make13(value));
|
|
18888
|
+
var make24 = (value) => sync(() => unsafeMake4(value));
|
|
18970
18889
|
var get10 = (self) => self.get;
|
|
18971
18890
|
var set5 = /* @__PURE__ */ dual(2, (self, value) => self.modify(() => [undefined, value]));
|
|
18972
18891
|
var getAndSet = /* @__PURE__ */ dual(2, (self, value) => self.modify((a) => [a, value]));
|
|
@@ -19907,7 +19826,7 @@ class Local {
|
|
|
19907
19826
|
}));
|
|
19908
19827
|
}
|
|
19909
19828
|
}
|
|
19910
|
-
var
|
|
19829
|
+
var unsafeMake5 = (fiber) => {
|
|
19911
19830
|
return new Local(fiber.id(), fiber);
|
|
19912
19831
|
};
|
|
19913
19832
|
var globalScope = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberScope/Global"), () => new Global);
|
|
@@ -20929,7 +20848,7 @@ var MetricPairTypeId = /* @__PURE__ */ Symbol.for(MetricPairSymbolKey);
|
|
|
20929
20848
|
var metricPairVariance = {
|
|
20930
20849
|
_Type: (_) => _
|
|
20931
20850
|
};
|
|
20932
|
-
var
|
|
20851
|
+
var unsafeMake6 = (metricKey, metricState) => {
|
|
20933
20852
|
return {
|
|
20934
20853
|
[MetricPairTypeId]: metricPairVariance,
|
|
20935
20854
|
metricKey,
|
|
@@ -20950,7 +20869,7 @@ class MetricRegistryImpl {
|
|
|
20950
20869
|
snapshot() {
|
|
20951
20870
|
const result = [];
|
|
20952
20871
|
for (const [key, hook] of this.map) {
|
|
20953
|
-
result.push(
|
|
20872
|
+
result.push(unsafeMake6(key, hook.get()));
|
|
20954
20873
|
}
|
|
20955
20874
|
return result;
|
|
20956
20875
|
}
|
|
@@ -22061,7 +21980,7 @@ class FiberRuntime extends Class2 {
|
|
|
22061
21980
|
});
|
|
22062
21981
|
}
|
|
22063
21982
|
scope() {
|
|
22064
|
-
return
|
|
21983
|
+
return unsafeMake5(this);
|
|
22065
21984
|
}
|
|
22066
21985
|
get children() {
|
|
22067
21986
|
return this.ask((fiber) => Array.from(fiber.getChildren()));
|
|
@@ -23121,7 +23040,7 @@ var unsafeForkUnstarted = (effect, parentFiber, parentRuntimeFlags, overrideScop
|
|
|
23121
23040
|
return childFiber;
|
|
23122
23041
|
};
|
|
23123
23042
|
var unsafeMakeChildFiber = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {
|
|
23124
|
-
const childId =
|
|
23043
|
+
const childId = unsafeMake2();
|
|
23125
23044
|
const parentFiberRefs = parentFiber.getFiberRefs();
|
|
23126
23045
|
const childFiberRefs = forkAs(parentFiberRefs, childId);
|
|
23127
23046
|
const childFiber = new FiberRuntime(childId, childFiberRefs, parentRuntimeFlags);
|
|
@@ -23537,7 +23456,6 @@ var withSpanScoped = function() {
|
|
|
23537
23456
|
};
|
|
23538
23457
|
|
|
23539
23458
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Cause.js
|
|
23540
|
-
var TimeoutExceptionTypeId2 = TimeoutExceptionTypeId;
|
|
23541
23459
|
var empty28 = empty19;
|
|
23542
23460
|
var fail4 = fail;
|
|
23543
23461
|
var die4 = die;
|
|
@@ -24005,7 +23923,7 @@ class SynchronizedImpl extends Class2 {
|
|
|
24005
23923
|
}
|
|
24006
23924
|
var makeSynchronized = (value) => sync(() => unsafeMakeSynchronized(value));
|
|
24007
23925
|
var unsafeMakeSynchronized = (value) => {
|
|
24008
|
-
const ref =
|
|
23926
|
+
const ref = unsafeMake4(value);
|
|
24009
23927
|
const sem = unsafeMakeSemaphore(1);
|
|
24010
23928
|
return new SynchronizedImpl(ref, sem.withPermits(1));
|
|
24011
23929
|
};
|
|
@@ -24054,7 +23972,7 @@ var makeDual = (f) => function() {
|
|
|
24054
23972
|
return f.apply(this, arguments);
|
|
24055
23973
|
};
|
|
24056
23974
|
var unsafeFork2 = /* @__PURE__ */ makeDual((runtime3, self, options) => {
|
|
24057
|
-
const fiberId2 =
|
|
23975
|
+
const fiberId2 = unsafeMake2();
|
|
24058
23976
|
const fiberRefUpdates = [[currentContext, [[fiberId2, runtime3.context]]]];
|
|
24059
23977
|
if (options?.scheduler) {
|
|
24060
23978
|
fiberRefUpdates.push([currentScheduler, [[fiberId2, options.scheduler]]]);
|
|
@@ -25237,7 +25155,7 @@ var unsafeFromDate = (date) => {
|
|
|
25237
25155
|
}
|
|
25238
25156
|
return makeUtc(epochMillis);
|
|
25239
25157
|
};
|
|
25240
|
-
var
|
|
25158
|
+
var unsafeMake7 = (input) => {
|
|
25241
25159
|
if (isDateTime(input)) {
|
|
25242
25160
|
return input;
|
|
25243
25161
|
} else if (input instanceof Date) {
|
|
@@ -25258,7 +25176,7 @@ var unsafeMakeZoned = (input, options) => {
|
|
|
25258
25176
|
if (options?.timeZone === undefined && isDateTime(input) && isZoned(input)) {
|
|
25259
25177
|
return input;
|
|
25260
25178
|
}
|
|
25261
|
-
const self =
|
|
25179
|
+
const self = unsafeMake7(input);
|
|
25262
25180
|
if (self.epochMillis < minEpochMillis || self.epochMillis > maxEpochMillis) {
|
|
25263
25181
|
throw new RangeError(`Epoch millis out of range: ${self.epochMillis}`);
|
|
25264
25182
|
}
|
|
@@ -25589,7 +25507,7 @@ class ScheduleDriverImpl {
|
|
|
25589
25507
|
}
|
|
25590
25508
|
});
|
|
25591
25509
|
}
|
|
25592
|
-
iterationMeta = /* @__PURE__ */
|
|
25510
|
+
iterationMeta = /* @__PURE__ */ unsafeMake4(defaultIterationMetadata);
|
|
25593
25511
|
get reset() {
|
|
25594
25512
|
return set5(this.ref, [none2(), this.schedule.initial]).pipe(zipLeft(set5(this.iterationMeta, defaultIterationMetadata)));
|
|
25595
25513
|
}
|
|
@@ -25824,7 +25742,7 @@ var failCause6 = deferredFailCause;
|
|
|
25824
25742
|
var interrupt5 = deferredInterrupt;
|
|
25825
25743
|
var isDone5 = deferredIsDone;
|
|
25826
25744
|
var succeed6 = deferredSucceed;
|
|
25827
|
-
var
|
|
25745
|
+
var unsafeMake8 = deferredUnsafeMake;
|
|
25828
25746
|
var unsafeDone = deferredUnsafeDone;
|
|
25829
25747
|
|
|
25830
25748
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/MutableList.js
|
|
@@ -26208,7 +26126,7 @@ class CacheImpl {
|
|
|
26208
26126
|
let deferred = undefined;
|
|
26209
26127
|
let value = getOrUndefined(get12(this.cacheState.map, k));
|
|
26210
26128
|
if (value === undefined) {
|
|
26211
|
-
deferred =
|
|
26129
|
+
deferred = unsafeMake8(this.fiberId);
|
|
26212
26130
|
mapKey = makeMapKey(k);
|
|
26213
26131
|
if (has6(this.cacheState.map, k)) {
|
|
26214
26132
|
value = getOrUndefined(get12(this.cacheState.map, k));
|
|
@@ -26253,7 +26171,7 @@ class CacheImpl {
|
|
|
26253
26171
|
refresh(key) {
|
|
26254
26172
|
return clockWith3((clock2) => suspend(() => {
|
|
26255
26173
|
const k = key;
|
|
26256
|
-
const deferred =
|
|
26174
|
+
const deferred = unsafeMake8(this.fiberId);
|
|
26257
26175
|
let value = getOrUndefined(get12(this.cacheState.map, k));
|
|
26258
26176
|
if (value === undefined) {
|
|
26259
26177
|
if (has6(this.cacheState.map, k)) {
|
|
@@ -28336,10 +28254,10 @@ var record = (key, value) => {
|
|
|
28336
28254
|
indexSignatures
|
|
28337
28255
|
};
|
|
28338
28256
|
};
|
|
28339
|
-
var
|
|
28257
|
+
var pick2 = (ast, keys6) => {
|
|
28340
28258
|
const annotation = getSurrogateAnnotation(ast);
|
|
28341
28259
|
if (isSome2(annotation)) {
|
|
28342
|
-
return
|
|
28260
|
+
return pick2(annotation.value, keys6);
|
|
28343
28261
|
}
|
|
28344
28262
|
switch (ast._tag) {
|
|
28345
28263
|
case "TypeLiteral": {
|
|
@@ -28364,13 +28282,13 @@ var pick3 = (ast, keys6) => {
|
|
|
28364
28282
|
case "Union":
|
|
28365
28283
|
return new TypeLiteral(keys6.map((name) => getPropertyKeyIndexedAccess(ast, name)), []);
|
|
28366
28284
|
case "Suspend":
|
|
28367
|
-
return
|
|
28285
|
+
return pick2(ast.f(), keys6);
|
|
28368
28286
|
case "Refinement":
|
|
28369
|
-
return
|
|
28287
|
+
return pick2(ast.from, keys6);
|
|
28370
28288
|
case "Transformation": {
|
|
28371
28289
|
switch (ast.transformation._tag) {
|
|
28372
28290
|
case "ComposeTransformation":
|
|
28373
|
-
return new Transformation(
|
|
28291
|
+
return new Transformation(pick2(ast.from, keys6), pick2(ast.to, keys6), composeTransformation);
|
|
28374
28292
|
case "TypeLiteralTransformation": {
|
|
28375
28293
|
const ts = [];
|
|
28376
28294
|
const fromKeys = [];
|
|
@@ -28383,7 +28301,7 @@ var pick3 = (ast, keys6) => {
|
|
|
28383
28301
|
fromKeys.push(k);
|
|
28384
28302
|
}
|
|
28385
28303
|
}
|
|
28386
|
-
return isNonEmptyReadonlyArray(ts) ? new Transformation(
|
|
28304
|
+
return isNonEmptyReadonlyArray(ts) ? new Transformation(pick2(ast.from, fromKeys), pick2(ast.to, keys6), new TypeLiteralTransformation(ts)) : pick2(ast.from, fromKeys);
|
|
28387
28305
|
}
|
|
28388
28306
|
}
|
|
28389
28307
|
}
|
|
@@ -28398,7 +28316,7 @@ var omit3 = (ast, keys6) => {
|
|
|
28398
28316
|
}
|
|
28399
28317
|
return new TypeLiteral([], indexSignatures);
|
|
28400
28318
|
}
|
|
28401
|
-
return
|
|
28319
|
+
return pick2(ast, getPropertyKeys(ast).filter((name) => !keys6.includes(name)));
|
|
28402
28320
|
};
|
|
28403
28321
|
var orUndefined = (ast) => Union.make([ast, undefinedKeyword]);
|
|
28404
28322
|
var partial = (ast, options) => {
|
|
@@ -28940,7 +28858,7 @@ var getSync = (ast, isDecoding, options) => {
|
|
|
28940
28858
|
};
|
|
28941
28859
|
var getOption3 = (ast, isDecoding, options) => {
|
|
28942
28860
|
const parser = getEither(ast, isDecoding, options);
|
|
28943
|
-
return (input, overrideOptions) =>
|
|
28861
|
+
return (input, overrideOptions) => getRight2(parser(input, overrideOptions));
|
|
28944
28862
|
};
|
|
28945
28863
|
var getEffect = (ast, isDecoding, options) => {
|
|
28946
28864
|
const parser = goMemo(ast, isDecoding);
|
|
@@ -29921,7 +29839,7 @@ var nominal = () => {
|
|
|
29921
29839
|
};
|
|
29922
29840
|
|
|
29923
29841
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/FiberRef.js
|
|
29924
|
-
var
|
|
29842
|
+
var unsafeMake9 = fiberRefUnsafeMake;
|
|
29925
29843
|
var currentContext2 = currentContext;
|
|
29926
29844
|
var currentLoggers2 = currentLoggers;
|
|
29927
29845
|
var currentTracerEnabled2 = currentTracerEnabled;
|
|
@@ -30327,10 +30245,10 @@ var bounded2 = (requestedCapacity) => pipe(sync(() => bounded(requestedCapacity)
|
|
|
30327
30245
|
var dropping = (requestedCapacity) => pipe(sync(() => bounded(requestedCapacity)), flatMap7((queue) => make42(backingQueueFromMutableQueue(queue), droppingStrategy())));
|
|
30328
30246
|
var sliding = (requestedCapacity) => pipe(sync(() => bounded(requestedCapacity)), flatMap7((queue) => make42(backingQueueFromMutableQueue(queue), slidingStrategy())));
|
|
30329
30247
|
var unbounded2 = () => pipe(sync(() => unbounded()), flatMap7((queue) => make42(backingQueueFromMutableQueue(queue), droppingStrategy())));
|
|
30330
|
-
var
|
|
30248
|
+
var unsafeMake10 = (queue, takers, shutdownHook, shutdownFlag, strategy) => {
|
|
30331
30249
|
return new QueueImpl(queue, takers, shutdownHook, shutdownFlag, strategy);
|
|
30332
30250
|
};
|
|
30333
|
-
var make42 = (queue, strategy) => pipe(deferredMake(), map11((deferred) =>
|
|
30251
|
+
var make42 = (queue, strategy) => pipe(deferredMake(), map11((deferred) => unsafeMake10(queue, unbounded(), deferred, make13(false), strategy)));
|
|
30334
30252
|
|
|
30335
30253
|
class BackingQueueFromMutableQueue {
|
|
30336
30254
|
mutable;
|
|
@@ -32310,8 +32228,6 @@ var runPromiseExit2 = unsafeRunPromiseExit;
|
|
|
32310
32228
|
var updateContext3 = updateContext2;
|
|
32311
32229
|
|
|
32312
32230
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Schedule.js
|
|
32313
|
-
var ScheduleTypeId2 = ScheduleTypeId;
|
|
32314
|
-
var passthrough4 = passthrough2;
|
|
32315
32231
|
var spaced2 = spaced;
|
|
32316
32232
|
|
|
32317
32233
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/stream/emit.js
|
|
@@ -32733,7 +32649,7 @@ __export(exports_Schema, {
|
|
|
32733
32649
|
positive: () => positive,
|
|
32734
32650
|
pluck: () => pluck,
|
|
32735
32651
|
pickLiteral: () => pickLiteral,
|
|
32736
|
-
pick: () =>
|
|
32652
|
+
pick: () => pick4,
|
|
32737
32653
|
pattern: () => pattern,
|
|
32738
32654
|
partialWith: () => partialWith,
|
|
32739
32655
|
partial: () => partial2,
|
|
@@ -33353,7 +33269,6 @@ var value = (self) => {
|
|
|
33353
33269
|
throw new Error("Unable to get redacted value");
|
|
33354
33270
|
}
|
|
33355
33271
|
};
|
|
33356
|
-
var unsafeWipe = (self) => redactedRegistry.delete(self);
|
|
33357
33272
|
|
|
33358
33273
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/secret.js
|
|
33359
33274
|
var SecretSymbolKey = "effect/Secret";
|
|
@@ -33440,7 +33355,7 @@ var isUtc2 = isUtc;
|
|
|
33440
33355
|
var isZoned2 = isZoned;
|
|
33441
33356
|
var Equivalence4 = Equivalence2;
|
|
33442
33357
|
var unsafeFromDate2 = unsafeFromDate;
|
|
33443
|
-
var
|
|
33358
|
+
var unsafeMake11 = unsafeMake7;
|
|
33444
33359
|
var unsafeMakeZoned2 = unsafeMakeZoned;
|
|
33445
33360
|
var makeZonedFromString2 = makeZonedFromString;
|
|
33446
33361
|
var zoneUnsafeMakeNamed2 = zoneUnsafeMakeNamed;
|
|
@@ -34654,24 +34569,13 @@ var MaxItemsSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/MaxItems");
|
|
|
34654
34569
|
var ItemsCountSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/ItemsCount");
|
|
34655
34570
|
|
|
34656
34571
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Redacted.js
|
|
34657
|
-
var exports_Redacted = {};
|
|
34658
|
-
__export(exports_Redacted, {
|
|
34659
|
-
value: () => value2,
|
|
34660
|
-
unsafeWipe: () => unsafeWipe2,
|
|
34661
|
-
make: () => make52,
|
|
34662
|
-
isRedacted: () => isRedacted2,
|
|
34663
|
-
getEquivalence: () => getEquivalence7,
|
|
34664
|
-
RedactedTypeId: () => RedactedTypeId2
|
|
34665
|
-
});
|
|
34666
|
-
var RedactedTypeId2 = RedactedTypeId;
|
|
34667
34572
|
var isRedacted2 = isRedacted;
|
|
34668
34573
|
var make52 = make49;
|
|
34669
34574
|
var value2 = value;
|
|
34670
|
-
var unsafeWipe2 = unsafeWipe;
|
|
34671
34575
|
var getEquivalence7 = (isEquivalent) => make((x, y) => isEquivalent(value2(x), value2(y)));
|
|
34672
34576
|
|
|
34673
34577
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Struct.js
|
|
34674
|
-
var
|
|
34578
|
+
var pick3 = /* @__PURE__ */ dual((args2) => isObject(args2[0]), (s, ...keys6) => {
|
|
34675
34579
|
const out = {};
|
|
34676
34580
|
for (const k of keys6) {
|
|
34677
34581
|
if (k in s) {
|
|
@@ -35518,7 +35422,7 @@ function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fi
|
|
|
35518
35422
|
return getDisableValidationMakeOption(options) ? propsWithDefaults : validateSync(this)(propsWithDefaults);
|
|
35519
35423
|
};
|
|
35520
35424
|
static pick(...keys6) {
|
|
35521
|
-
return Struct(
|
|
35425
|
+
return Struct(pick3(fields, ...keys6));
|
|
35522
35426
|
}
|
|
35523
35427
|
static omit(...keys6) {
|
|
35524
35428
|
return Struct(omit4(fields, ...keys6));
|
|
@@ -35546,12 +35450,12 @@ function makeRecordClass(key, value3, ast) {
|
|
|
35546
35450
|
};
|
|
35547
35451
|
}
|
|
35548
35452
|
var Record = (options) => makeRecordClass(options.key, options.value);
|
|
35549
|
-
var
|
|
35453
|
+
var pick4 = (...keys6) => (self) => make53(pick2(self.ast, keys6));
|
|
35550
35454
|
var omit5 = (...keys6) => (self) => make53(omit3(self.ast, keys6));
|
|
35551
35455
|
var pluck = /* @__PURE__ */ dual(2, (schema, key) => {
|
|
35552
35456
|
const ps = getPropertyKeyIndexedAccess(typeAST(schema.ast), key);
|
|
35553
35457
|
const value3 = make53(ps.isOptional ? orUndefined(ps.type) : ps.type);
|
|
35554
|
-
const out = transform2(schema.pipe(
|
|
35458
|
+
const out = transform2(schema.pipe(pick4(key)), value3, {
|
|
35555
35459
|
strict: true,
|
|
35556
35460
|
decode: (i) => i[key],
|
|
35557
35461
|
encode: (a) => ps.isOptional && a === undefined ? {} : {
|
|
@@ -36909,7 +36813,7 @@ class DateTimeUtcFromSelf extends (/* @__PURE__ */ declare((u) => isDateTime2(u)
|
|
|
36909
36813
|
})) {
|
|
36910
36814
|
}
|
|
36911
36815
|
var decodeDateTimeUtc = (input, ast) => _try({
|
|
36912
|
-
try: () =>
|
|
36816
|
+
try: () => unsafeMake11(input),
|
|
36913
36817
|
catch: () => new Type2(ast, input, `Unable to decode ${formatUnknown(input)} into a DateTime.Utc`)
|
|
36914
36818
|
});
|
|
36915
36819
|
|
|
@@ -46760,51 +46664,6 @@ var multiSelect2 = multiSelect;
|
|
|
46760
46664
|
var succeed18 = succeed16;
|
|
46761
46665
|
var text9 = text5;
|
|
46762
46666
|
var toggle3 = toggle2;
|
|
46763
|
-
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpClient.js
|
|
46764
|
-
var exports_HttpClient = {};
|
|
46765
|
-
__export(exports_HttpClient, {
|
|
46766
|
-
withTracerPropagation: () => withTracerPropagation2,
|
|
46767
|
-
withTracerDisabledWhen: () => withTracerDisabledWhen2,
|
|
46768
|
-
withSpanNameGenerator: () => withSpanNameGenerator2,
|
|
46769
|
-
withScope: () => withScope2,
|
|
46770
|
-
withCookiesRef: () => withCookiesRef2,
|
|
46771
|
-
transformResponse: () => transformResponse2,
|
|
46772
|
-
transform: () => transform4,
|
|
46773
|
-
tapRequest: () => tapRequest2,
|
|
46774
|
-
tapError: () => tapError7,
|
|
46775
|
-
tap: () => tap7,
|
|
46776
|
-
retryTransient: () => retryTransient2,
|
|
46777
|
-
retry: () => retry6,
|
|
46778
|
-
put: () => put3,
|
|
46779
|
-
post: () => post3,
|
|
46780
|
-
patch: () => patch11,
|
|
46781
|
-
options: () => options5,
|
|
46782
|
-
mapRequestInputEffect: () => mapRequestInputEffect2,
|
|
46783
|
-
mapRequestInput: () => mapRequestInput2,
|
|
46784
|
-
mapRequestEffect: () => mapRequestEffect2,
|
|
46785
|
-
mapRequest: () => mapRequest2,
|
|
46786
|
-
makeWith: () => makeWith2,
|
|
46787
|
-
make: () => make66,
|
|
46788
|
-
layerMergedContext: () => layerMergedContext2,
|
|
46789
|
-
head: () => head9,
|
|
46790
|
-
get: () => get19,
|
|
46791
|
-
followRedirects: () => followRedirects2,
|
|
46792
|
-
filterStatusOk: () => filterStatusOk3,
|
|
46793
|
-
filterStatus: () => filterStatus3,
|
|
46794
|
-
filterOrFail: () => filterOrFail4,
|
|
46795
|
-
filterOrElse: () => filterOrElse4,
|
|
46796
|
-
execute: () => execute3,
|
|
46797
|
-
del: () => del3,
|
|
46798
|
-
currentTracerPropagation: () => currentTracerPropagation2,
|
|
46799
|
-
currentTracerDisabledWhen: () => currentTracerDisabledWhen2,
|
|
46800
|
-
catchTags: () => catchTags5,
|
|
46801
|
-
catchTag: () => catchTag5,
|
|
46802
|
-
catchAll: () => catchAll8,
|
|
46803
|
-
TypeId: () => TypeId35,
|
|
46804
|
-
SpanNameGenerator: () => SpanNameGenerator2,
|
|
46805
|
-
HttpClient: () => HttpClient
|
|
46806
|
-
});
|
|
46807
|
-
|
|
46808
46667
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/Cookies.js
|
|
46809
46668
|
var TypeId27 = /* @__PURE__ */ Symbol.for("@effect/platform/Cookies");
|
|
46810
46669
|
var CookieTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/Cookies/Cookie");
|
|
@@ -46967,7 +46826,6 @@ function parseSetCookie(header) {
|
|
|
46967
46826
|
options: Object.keys(options3).length > 0 ? options3 : undefined
|
|
46968
46827
|
}));
|
|
46969
46828
|
}
|
|
46970
|
-
var isEmpty17 = (self) => isEmptyRecord(self.cookies);
|
|
46971
46829
|
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
46972
46830
|
var CookieProto = {
|
|
46973
46831
|
[CookieTypeId]: CookieTypeId,
|
|
@@ -46981,11 +46839,6 @@ var CookieProto = {
|
|
|
46981
46839
|
};
|
|
46982
46840
|
}
|
|
46983
46841
|
};
|
|
46984
|
-
var merge11 = /* @__PURE__ */ dual(2, (self, that) => fromReadonlyRecord({
|
|
46985
|
-
...self.cookies,
|
|
46986
|
-
...that.cookies
|
|
46987
|
-
}));
|
|
46988
|
-
var toCookieHeader = (self) => Object.values(self.cookies).map((cookie) => `${cookie.name}=${cookie.valueEncoded}`).join("; ");
|
|
46989
46842
|
var tryDecodeURIComponent = (str) => {
|
|
46990
46843
|
try {
|
|
46991
46844
|
return decodeURIComponent(str);
|
|
@@ -47034,7 +46887,7 @@ var setAll3 = /* @__PURE__ */ dual(2, (self, headers) => make63({
|
|
|
47034
46887
|
...self,
|
|
47035
46888
|
...fromInput2(headers)
|
|
47036
46889
|
}));
|
|
47037
|
-
var
|
|
46890
|
+
var merge11 = /* @__PURE__ */ dual(2, (self, headers) => {
|
|
47038
46891
|
const out = make63(self);
|
|
47039
46892
|
Object.assign(out, headers);
|
|
47040
46893
|
return out;
|
|
@@ -47091,15 +46944,13 @@ var redact2 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
|
47091
46944
|
}
|
|
47092
46945
|
return out;
|
|
47093
46946
|
});
|
|
47094
|
-
var currentRedactedNames = /* @__PURE__ */ globalValue("@effect/platform/Headers/currentRedactedNames", () =>
|
|
46947
|
+
var currentRedactedNames = /* @__PURE__ */ globalValue("@effect/platform/Headers/currentRedactedNames", () => unsafeMake9(["authorization", "cookie", "set-cookie", "x-api-key"]));
|
|
47095
46948
|
|
|
47096
46949
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpClientError.js
|
|
47097
46950
|
var TypeId28 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientError");
|
|
47098
46951
|
|
|
47099
46952
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpClientError.js
|
|
47100
46953
|
var TypeId29 = TypeId28;
|
|
47101
|
-
var isHttpClientError = (u) => hasProperty(u, TypeId29);
|
|
47102
|
-
|
|
47103
46954
|
class RequestError extends (/* @__PURE__ */ TypeIdError(TypeId29, "RequestError")) {
|
|
47104
46955
|
get methodAndUrl() {
|
|
47105
46956
|
return `${this.request.method} ${this.request.url}`;
|
|
@@ -47158,7 +47009,6 @@ var schemaFromSelf = /* @__PURE__ */ Array$(Tuple(String$, String$)).annotations
|
|
|
47158
47009
|
identifier: "UrlParams"
|
|
47159
47010
|
});
|
|
47160
47011
|
var empty43 = [];
|
|
47161
|
-
var set10 = /* @__PURE__ */ dual(3, (self, key, value6) => append(filter2(self, ([k]) => k !== key), [key, String(value6)]));
|
|
47162
47012
|
var setAll4 = /* @__PURE__ */ dual(2, (self, input) => {
|
|
47163
47013
|
const out = fromInput3(input);
|
|
47164
47014
|
const keys6 = new Set;
|
|
@@ -47172,7 +47022,6 @@ var setAll4 = /* @__PURE__ */ dual(2, (self, input) => {
|
|
|
47172
47022
|
}
|
|
47173
47023
|
return out;
|
|
47174
47024
|
});
|
|
47175
|
-
var append4 = /* @__PURE__ */ dual(3, (self, key, value6) => append(self, [key, String(value6)]));
|
|
47176
47025
|
var appendAll4 = /* @__PURE__ */ dual(2, (self, input) => appendAll(self, fromInput3(input)));
|
|
47177
47026
|
var makeUrl = (url2, params, hash2) => {
|
|
47178
47027
|
try {
|
|
@@ -47265,13 +47114,6 @@ var toHeaders = (span4) => unsafeFromRecord({
|
|
|
47265
47114
|
|
|
47266
47115
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpBody.js
|
|
47267
47116
|
var TypeId31 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpBody");
|
|
47268
|
-
var ErrorTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/HttpBody/HttpBodyError");
|
|
47269
|
-
var bodyError = /* @__PURE__ */ tagged2("HttpBodyError");
|
|
47270
|
-
var HttpBodyError = (reason) => bodyError({
|
|
47271
|
-
[ErrorTypeId]: ErrorTypeId,
|
|
47272
|
-
reason
|
|
47273
|
-
});
|
|
47274
|
-
|
|
47275
47117
|
class BodyBase {
|
|
47276
47118
|
[TypeId31];
|
|
47277
47119
|
constructor() {
|
|
@@ -47321,25 +47163,7 @@ class Uint8ArrayImpl extends BodyBase {
|
|
|
47321
47163
|
var uint8Array = (body, contentType) => new Uint8ArrayImpl(body, contentType ?? "application/octet-stream");
|
|
47322
47164
|
var encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
47323
47165
|
var text10 = (body, contentType) => uint8Array(encoder2.encode(body), contentType ?? "text/plain");
|
|
47324
|
-
var unsafeJson = (body, contentType) => text10(JSON.stringify(body), contentType ?? "application/json");
|
|
47325
|
-
var json = (body, contentType) => try_3({
|
|
47326
|
-
try: () => unsafeJson(body, contentType),
|
|
47327
|
-
catch: (error4) => HttpBodyError({
|
|
47328
|
-
_tag: "JsonError",
|
|
47329
|
-
error: error4
|
|
47330
|
-
})
|
|
47331
|
-
});
|
|
47332
47166
|
var urlParams = (urlParams2, contentType) => text10(toString(urlParams2), contentType ?? "application/x-www-form-urlencoded");
|
|
47333
|
-
var jsonSchema = (schema, options3) => {
|
|
47334
|
-
const encode5 = encode4(schema, options3);
|
|
47335
|
-
return (body, contentType) => flatMap10(mapError3(encode5(body), (error4) => HttpBodyError({
|
|
47336
|
-
_tag: "SchemaError",
|
|
47337
|
-
error: error4
|
|
47338
|
-
})), (body2) => json(body2, contentType));
|
|
47339
|
-
};
|
|
47340
|
-
var file5 = (path2, options3) => flatMap10(FileSystem, (fs) => map17(fs.stat(path2), (info2) => stream3(fs.stream(path2, options3), options3?.contentType, Number(info2.size))));
|
|
47341
|
-
var fileWeb = (file6) => stream3(fromReadableStream2(() => file6.stream(), identity), file6.type, file6.size);
|
|
47342
|
-
|
|
47343
47167
|
class FormDataImpl extends BodyBase {
|
|
47344
47168
|
formData;
|
|
47345
47169
|
_tag = "FormData";
|
|
@@ -47356,43 +47180,6 @@ class FormDataImpl extends BodyBase {
|
|
|
47356
47180
|
}
|
|
47357
47181
|
}
|
|
47358
47182
|
var formData = (body) => new FormDataImpl(body);
|
|
47359
|
-
var formDataRecord = (entries2) => {
|
|
47360
|
-
const formData2 = new FormData;
|
|
47361
|
-
for (const [key, value6] of Object.entries(entries2)) {
|
|
47362
|
-
if (Array.isArray(value6)) {
|
|
47363
|
-
for (const item of value6) {
|
|
47364
|
-
if (item == null)
|
|
47365
|
-
continue;
|
|
47366
|
-
formData2.append(key, typeof value6 === "object" ? item : String(item));
|
|
47367
|
-
}
|
|
47368
|
-
} else if (value6 != null) {
|
|
47369
|
-
formData2.append(key, typeof value6 === "object" ? value6 : String(value6));
|
|
47370
|
-
}
|
|
47371
|
-
}
|
|
47372
|
-
return new FormDataImpl(formData2);
|
|
47373
|
-
};
|
|
47374
|
-
|
|
47375
|
-
class StreamImpl2 extends BodyBase {
|
|
47376
|
-
stream;
|
|
47377
|
-
contentType;
|
|
47378
|
-
contentLength;
|
|
47379
|
-
_tag = "Stream";
|
|
47380
|
-
constructor(stream3, contentType, contentLength) {
|
|
47381
|
-
super();
|
|
47382
|
-
this.stream = stream3;
|
|
47383
|
-
this.contentType = contentType;
|
|
47384
|
-
this.contentLength = contentLength;
|
|
47385
|
-
}
|
|
47386
|
-
toJSON() {
|
|
47387
|
-
return {
|
|
47388
|
-
_id: "@effect/platform/HttpBody",
|
|
47389
|
-
_tag: "Stream",
|
|
47390
|
-
contentType: this.contentType,
|
|
47391
|
-
contentLength: this.contentLength
|
|
47392
|
-
};
|
|
47393
|
-
}
|
|
47394
|
-
}
|
|
47395
|
-
var stream3 = (body, contentType, contentLength) => new StreamImpl2(body, contentType ?? "application/octet-stream", contentLength);
|
|
47396
47183
|
|
|
47397
47184
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpClientRequest.js
|
|
47398
47185
|
var TypeId32 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientRequest");
|
|
@@ -47424,7 +47211,6 @@ function makeInternal(method, url2, urlParams2, hash2, headers, body) {
|
|
|
47424
47211
|
self.body = body;
|
|
47425
47212
|
return self;
|
|
47426
47213
|
}
|
|
47427
|
-
var isClientRequest = (u) => typeof u === "object" && u !== null && (TypeId32 in u);
|
|
47428
47214
|
var empty45 = /* @__PURE__ */ makeInternal("GET", "", empty43, /* @__PURE__ */ none2(), empty42, empty44);
|
|
47429
47215
|
var make64 = (method) => (url2, options3) => modify6(empty45, {
|
|
47430
47216
|
method,
|
|
@@ -47468,9 +47254,6 @@ var modify6 = /* @__PURE__ */ dual(2, (self, options4) => {
|
|
|
47468
47254
|
});
|
|
47469
47255
|
var setHeader = /* @__PURE__ */ dual(3, (self, key, value6) => makeInternal(self.method, self.url, self.urlParams, self.hash, set9(self.headers, key, value6), self.body));
|
|
47470
47256
|
var setHeaders = /* @__PURE__ */ dual(2, (self, input) => makeInternal(self.method, self.url, self.urlParams, self.hash, setAll3(self.headers, input), self.body));
|
|
47471
|
-
var stringOrRedacted = (value6) => typeof value6 === "string" ? value6 : value2(value6);
|
|
47472
|
-
var basicAuth = /* @__PURE__ */ dual(3, (self, username, password3) => setHeader(self, "Authorization", `Basic ${btoa(`${stringOrRedacted(username)}:${stringOrRedacted(password3)}`)}`));
|
|
47473
|
-
var bearerToken = /* @__PURE__ */ dual(2, (self, token) => setHeader(self, "Authorization", `Bearer ${stringOrRedacted(token)}`));
|
|
47474
47257
|
var accept = /* @__PURE__ */ dual(2, (self, mediaType) => setHeader(self, "Accept", mediaType));
|
|
47475
47258
|
var acceptJson = /* @__PURE__ */ accept("application/json");
|
|
47476
47259
|
var setMethod = /* @__PURE__ */ dual(2, (self, method) => makeInternal(method, self.url, self.urlParams, self.hash, self.headers, self.body));
|
|
@@ -47485,23 +47268,10 @@ var setUrl = /* @__PURE__ */ dual(2, (self, url2) => {
|
|
|
47485
47268
|
clone2.hash = "";
|
|
47486
47269
|
return makeInternal(self.method, clone2.toString(), urlParams2, hash2, self.headers, self.body);
|
|
47487
47270
|
});
|
|
47488
|
-
var appendUrl = /* @__PURE__ */ dual(2, (self, path2) => {
|
|
47489
|
-
if (path2 === "") {
|
|
47490
|
-
return self;
|
|
47491
|
-
}
|
|
47492
|
-
const baseUrl2 = self.url.endsWith("/") ? self.url : self.url + "/";
|
|
47493
|
-
const pathSegment = path2.startsWith("/") ? path2.slice(1) : path2;
|
|
47494
|
-
return makeInternal(self.method, baseUrl2 + pathSegment, self.urlParams, self.hash, self.headers, self.body);
|
|
47495
|
-
});
|
|
47496
47271
|
var prependUrl = /* @__PURE__ */ dual(2, (self, url2) => makeInternal(self.method, url2.endsWith("/") && self.url.startsWith("/") ? url2 + self.url.slice(1) : url2 + self.url, self.urlParams, self.hash, self.headers, self.body));
|
|
47497
|
-
var updateUrl = /* @__PURE__ */ dual(2, (self, f) => makeInternal(self.method, f(self.url), self.urlParams, self.hash, self.headers, self.body));
|
|
47498
|
-
var appendUrlParam = /* @__PURE__ */ dual(3, (self, key, value6) => makeInternal(self.method, self.url, append4(self.urlParams, key, value6), self.hash, self.headers, self.body));
|
|
47499
47272
|
var appendUrlParams = /* @__PURE__ */ dual(2, (self, input) => makeInternal(self.method, self.url, appendAll4(self.urlParams, input), self.hash, self.headers, self.body));
|
|
47500
|
-
var setUrlParam = /* @__PURE__ */ dual(3, (self, key, value6) => makeInternal(self.method, self.url, set10(self.urlParams, key, value6), self.hash, self.headers, self.body));
|
|
47501
47273
|
var setUrlParams = /* @__PURE__ */ dual(2, (self, input) => makeInternal(self.method, self.url, setAll4(self.urlParams, input), self.hash, self.headers, self.body));
|
|
47502
47274
|
var setHash = /* @__PURE__ */ dual(2, (self, hash2) => makeInternal(self.method, self.url, self.urlParams, some2(hash2), self.headers, self.body));
|
|
47503
|
-
var removeHash = (self) => makeInternal(self.method, self.url, self.urlParams, none2(), self.headers, self.body);
|
|
47504
|
-
var toUrl = (self) => getRight2(makeUrl(self.url, self.urlParams, self.hash));
|
|
47505
47275
|
var setBody = /* @__PURE__ */ dual(2, (self, body) => {
|
|
47506
47276
|
let headers = self.headers;
|
|
47507
47277
|
if (body._tag === "Empty" || body._tag === "FormData") {
|
|
@@ -47518,23 +47288,7 @@ var setBody = /* @__PURE__ */ dual(2, (self, body) => {
|
|
|
47518
47288
|
}
|
|
47519
47289
|
return makeInternal(self.method, self.url, self.urlParams, self.hash, headers, body);
|
|
47520
47290
|
});
|
|
47521
|
-
var bodyUint8Array = /* @__PURE__ */ dual((args2) => isClientRequest(args2[0]), (self, body, contentType = "application/octet-stream") => setBody(self, uint8Array(body, contentType)));
|
|
47522
|
-
var bodyText = /* @__PURE__ */ dual((args2) => isClientRequest(args2[0]), (self, body, contentType = "text/plain") => setBody(self, text10(body, contentType)));
|
|
47523
|
-
var bodyJson = /* @__PURE__ */ dual(2, (self, body) => map17(json(body), (body2) => setBody(self, body2)));
|
|
47524
|
-
var bodyUnsafeJson = /* @__PURE__ */ dual(2, (self, body) => setBody(self, unsafeJson(body)));
|
|
47525
|
-
var bodyFile = /* @__PURE__ */ dual((args2) => isClientRequest(args2[0]), (self, path2, options4) => map17(file5(path2, options4), (body) => setBody(self, body)));
|
|
47526
|
-
var bodyFileWeb = /* @__PURE__ */ dual(2, (self, file6) => setBody(self, fileWeb(file6)));
|
|
47527
|
-
var schemaBodyJson = (schema, options4) => {
|
|
47528
|
-
const encode5 = jsonSchema(schema, options4);
|
|
47529
|
-
return dual(2, (self, body) => map17(encode5(body), (body2) => setBody(self, body2)));
|
|
47530
|
-
};
|
|
47531
|
-
var bodyUrlParams = /* @__PURE__ */ dual(2, (self, body) => setBody(self, text10(toString(fromInput3(body)), "application/x-www-form-urlencoded")));
|
|
47532
47291
|
var bodyFormData = /* @__PURE__ */ dual(2, (self, body) => setBody(self, formData(body)));
|
|
47533
|
-
var bodyFormDataRecord = /* @__PURE__ */ dual(2, (self, entries2) => setBody(self, formDataRecord(entries2)));
|
|
47534
|
-
var bodyStream = /* @__PURE__ */ dual((args2) => isClientRequest(args2[0]), (self, body, {
|
|
47535
|
-
contentLength,
|
|
47536
|
-
contentType = "application/octet-stream"
|
|
47537
|
-
} = {}) => setBody(self, stream3(body, contentType, contentLength)));
|
|
47538
47292
|
|
|
47539
47293
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpClientResponse.js
|
|
47540
47294
|
var TypeId33 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientResponse");
|
|
@@ -47662,18 +47416,6 @@ var matchStatus = /* @__PURE__ */ dual(2, (self, cases) => {
|
|
|
47662
47416
|
}
|
|
47663
47417
|
return cases.orElse(self);
|
|
47664
47418
|
});
|
|
47665
|
-
var filterStatus = /* @__PURE__ */ dual(2, (self, f) => suspend3(() => f(self.status) ? succeed8(self) : fail9(new ResponseError({
|
|
47666
|
-
response: self,
|
|
47667
|
-
request: self.request,
|
|
47668
|
-
reason: "StatusCode",
|
|
47669
|
-
description: "invalid status code"
|
|
47670
|
-
}))));
|
|
47671
|
-
var filterStatusOk = (self) => self.status >= 200 && self.status < 300 ? succeed8(self) : fail9(new ResponseError({
|
|
47672
|
-
response: self,
|
|
47673
|
-
request: self.request,
|
|
47674
|
-
reason: "StatusCode",
|
|
47675
|
-
description: "non 2xx status code"
|
|
47676
|
-
}));
|
|
47677
47419
|
|
|
47678
47420
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpClient.js
|
|
47679
47421
|
var ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`;
|
|
@@ -47688,14 +47430,11 @@ var ATTR_URL_SCHEME = "url.scheme";
|
|
|
47688
47430
|
var ATTR_URL_QUERY = "url.query";
|
|
47689
47431
|
var TypeId34 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClient");
|
|
47690
47432
|
var tag5 = /* @__PURE__ */ GenericTag("@effect/platform/HttpClient");
|
|
47691
|
-
var currentTracerDisabledWhen = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"), () =>
|
|
47692
|
-
var
|
|
47693
|
-
var currentTracerPropagation = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"), () => unsafeMake10(true));
|
|
47694
|
-
var withTracerPropagation = /* @__PURE__ */ dual(2, (self, enabled2) => transformResponse(self, locally(currentTracerPropagation, enabled2)));
|
|
47433
|
+
var currentTracerDisabledWhen = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"), () => unsafeMake9(constFalse));
|
|
47434
|
+
var currentTracerPropagation = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"), () => unsafeMake9(true));
|
|
47695
47435
|
var SpanNameGenerator = /* @__PURE__ */ Reference2()("@effect/platform/HttpClient/SpanNameGenerator", {
|
|
47696
47436
|
defaultValue: () => (request2) => `http.client ${request2.method}`
|
|
47697
47437
|
});
|
|
47698
|
-
var withSpanNameGenerator = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, provideService2(SpanNameGenerator, f)));
|
|
47699
47438
|
var ClientProto = {
|
|
47700
47439
|
[TypeId34]: TypeId34,
|
|
47701
47440
|
pipe() {
|
|
@@ -47729,7 +47468,6 @@ var ClientProto = {
|
|
|
47729
47468
|
return this.execute(options3(url2, options4));
|
|
47730
47469
|
}
|
|
47731
47470
|
};
|
|
47732
|
-
var isClient = (u) => hasProperty(u, TypeId34);
|
|
47733
47471
|
var makeWith = (postprocess, preprocess) => {
|
|
47734
47472
|
const self = Object.create(ClientProto);
|
|
47735
47473
|
self.preprocess = preprocess;
|
|
@@ -47905,230 +47643,42 @@ class InterruptibleResponse {
|
|
|
47905
47643
|
return this.original[NodeInspectSymbol]();
|
|
47906
47644
|
}
|
|
47907
47645
|
}
|
|
47908
|
-
var withScope = (self) => transform3(self, (effect3, request2) => {
|
|
47909
|
-
const controller = new AbortController;
|
|
47910
|
-
scopedRequests.set(request2, controller);
|
|
47911
|
-
return zipRight3(scopeWith2((scope5) => addFinalizer2(scope5, sync3(() => controller.abort()))), effect3);
|
|
47912
|
-
});
|
|
47913
|
-
var {
|
|
47914
|
-
del: del2,
|
|
47915
|
-
execute: execute2,
|
|
47916
|
-
get: get18,
|
|
47917
|
-
head: head8,
|
|
47918
|
-
options: options4,
|
|
47919
|
-
patch: patch10,
|
|
47920
|
-
post: post2,
|
|
47921
|
-
put: put2
|
|
47922
|
-
} = /* @__PURE__ */ serviceFunctions2(tag5);
|
|
47923
|
-
var transform3 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
47924
|
-
const client = self;
|
|
47925
|
-
return makeWith(flatMap10((request2) => f(client.postprocess(succeed8(request2)), request2)), client.preprocess);
|
|
47926
|
-
});
|
|
47927
|
-
var filterStatus2 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, flatMap10(filterStatus(f))));
|
|
47928
|
-
var filterStatusOk2 = (self) => transformResponse(self, flatMap10(filterStatusOk));
|
|
47929
47646
|
var transformResponse = /* @__PURE__ */ dual(2, (self, f) => {
|
|
47930
47647
|
const client = self;
|
|
47931
47648
|
return makeWith((request2) => f(client.postprocess(request2)), client.preprocess);
|
|
47932
47649
|
});
|
|
47933
|
-
var catchTag4 = /* @__PURE__ */ dual(3, (self, tag6, f) => transformResponse(self, catchTag2(tag6, f)));
|
|
47934
|
-
var catchTags4 = /* @__PURE__ */ dual(2, (self, cases) => transformResponse(self, catchTags2(cases)));
|
|
47935
|
-
var catchAll7 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, catchAll3(f)));
|
|
47936
|
-
var filterOrElse3 = /* @__PURE__ */ dual(3, (self, f, orElse17) => transformResponse(self, filterOrElse2(f, orElse17)));
|
|
47937
|
-
var filterOrFail3 = /* @__PURE__ */ dual(3, (self, f, orFailWith) => transformResponse(self, filterOrFail2(f, orFailWith)));
|
|
47938
47650
|
var mapRequest = /* @__PURE__ */ dual(2, (self, f) => {
|
|
47939
47651
|
const client = self;
|
|
47940
47652
|
return makeWith(client.postprocess, (request2) => map17(client.preprocess(request2), f));
|
|
47941
47653
|
});
|
|
47942
|
-
var mapRequestEffect = /* @__PURE__ */ dual(2, (self, f) => {
|
|
47943
|
-
const client = self;
|
|
47944
|
-
return makeWith(client.postprocess, (request2) => flatMap10(client.preprocess(request2), f));
|
|
47945
|
-
});
|
|
47946
|
-
var mapRequestInput = /* @__PURE__ */ dual(2, (self, f) => {
|
|
47947
|
-
const client = self;
|
|
47948
|
-
return makeWith(client.postprocess, (request2) => client.preprocess(f(request2)));
|
|
47949
|
-
});
|
|
47950
|
-
var mapRequestInputEffect = /* @__PURE__ */ dual(2, (self, f) => {
|
|
47951
|
-
const client = self;
|
|
47952
|
-
return makeWith(client.postprocess, (request2) => flatMap10(f(request2), client.preprocess));
|
|
47953
|
-
});
|
|
47954
|
-
var retry5 = /* @__PURE__ */ dual(2, (self, policy) => transformResponse(self, retry2(policy)));
|
|
47955
|
-
var retryTransient = /* @__PURE__ */ dual(2, (self, options5) => {
|
|
47956
|
-
const isOnlySchedule = ScheduleTypeId2 in options5;
|
|
47957
|
-
const mode = isOnlySchedule ? "both" : options5.mode ?? "both";
|
|
47958
|
-
const schedule3 = isOnlySchedule ? options5 : options5.schedule;
|
|
47959
|
-
const passthroughSchedule = schedule3 && passthrough4(schedule3);
|
|
47960
|
-
const times2 = isOnlySchedule ? undefined : options5.times;
|
|
47961
|
-
return transformResponse(self, flow(mode === "errors-only" ? identity : repeat({
|
|
47962
|
-
schedule: passthroughSchedule,
|
|
47963
|
-
times: times2,
|
|
47964
|
-
while: isTransientResponse
|
|
47965
|
-
}), mode === "response-only" ? identity : retry2({
|
|
47966
|
-
while: isOnlySchedule || options5.while === undefined ? isTransientError : or(isTransientError, options5.while),
|
|
47967
|
-
schedule: schedule3,
|
|
47968
|
-
times: times2
|
|
47969
|
-
})));
|
|
47970
|
-
});
|
|
47971
|
-
var isTransientError = (error4) => hasProperty(error4, TimeoutExceptionTypeId2) || isTransientHttpError(error4);
|
|
47972
|
-
var isTransientHttpError = (error4) => isHttpClientError(error4) && (error4._tag === "RequestError" && error4.reason === "Transport" || error4._tag === "ResponseError" && isTransientResponse(error4.response));
|
|
47973
|
-
var isTransientResponse = (response) => response.status === 408 || response.status === 429 || response.status === 500 || response.status === 502 || response.status === 503 || response.status === 504;
|
|
47974
|
-
var tap6 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tap3(f)));
|
|
47975
|
-
var tapError6 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tapError3(f)));
|
|
47976
|
-
var tapRequest = /* @__PURE__ */ dual(2, (self, f) => {
|
|
47977
|
-
const client = self;
|
|
47978
|
-
return makeWith(client.postprocess, (request2) => tap3(client.preprocess(request2), f));
|
|
47979
|
-
});
|
|
47980
|
-
var withCookiesRef = /* @__PURE__ */ dual(2, (self, ref) => {
|
|
47981
|
-
const client = self;
|
|
47982
|
-
return makeWith((request2) => tap3(client.postprocess(request2), (response) => update3(ref, (cookies) => merge11(cookies, response.cookies))), (request2) => flatMap10(client.preprocess(request2), (request3) => map17(get11(ref), (cookies) => isEmpty17(cookies) ? request3 : setHeader(request3, "cookie", toCookieHeader(cookies)))));
|
|
47983
|
-
});
|
|
47984
|
-
var followRedirects = /* @__PURE__ */ dual((args2) => isClient(args2[0]), (self, maxRedirects) => {
|
|
47985
|
-
const client = self;
|
|
47986
|
-
return makeWith((request2) => {
|
|
47987
|
-
const loop3 = (request3, redirects) => flatMap10(client.postprocess(succeed8(request3)), (response) => response.status >= 300 && response.status < 400 && response.headers.location && redirects < (maxRedirects ?? 10) ? loop3(setUrl(request3, new URL(response.headers.location, response.request.url)), redirects + 1) : succeed8(response));
|
|
47988
|
-
return flatMap10(request2, (request3) => loop3(request3, 0));
|
|
47989
|
-
}, client.preprocess);
|
|
47990
|
-
});
|
|
47991
47654
|
var layerMergedContext = (effect3) => effect(tag5, flatMap10(context3(), (context8) => map17(effect3, (client) => transformResponse(client, mapInputContext2((input) => merge3(context8, input))))));
|
|
47992
47655
|
|
|
47993
47656
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpClient.js
|
|
47994
|
-
var TypeId35 = TypeId34;
|
|
47995
47657
|
var HttpClient = tag5;
|
|
47996
|
-
var execute3 = execute2;
|
|
47997
|
-
var get19 = get18;
|
|
47998
|
-
var head9 = head8;
|
|
47999
|
-
var post3 = post2;
|
|
48000
|
-
var patch11 = patch10;
|
|
48001
|
-
var put3 = put2;
|
|
48002
|
-
var del3 = del2;
|
|
48003
|
-
var options5 = options4;
|
|
48004
|
-
var catchAll8 = catchAll7;
|
|
48005
|
-
var catchTag5 = catchTag4;
|
|
48006
|
-
var catchTags5 = catchTags4;
|
|
48007
|
-
var filterOrElse4 = filterOrElse3;
|
|
48008
|
-
var filterOrFail4 = filterOrFail3;
|
|
48009
|
-
var filterStatus3 = filterStatus2;
|
|
48010
|
-
var filterStatusOk3 = filterStatusOk2;
|
|
48011
|
-
var makeWith2 = makeWith;
|
|
48012
|
-
var make66 = make65;
|
|
48013
|
-
var transform4 = transform3;
|
|
48014
|
-
var transformResponse2 = transformResponse;
|
|
48015
47658
|
var mapRequest2 = mapRequest;
|
|
48016
|
-
var mapRequestEffect2 = mapRequestEffect;
|
|
48017
|
-
var mapRequestInput2 = mapRequestInput;
|
|
48018
|
-
var mapRequestInputEffect2 = mapRequestInputEffect;
|
|
48019
|
-
var retry6 = retry5;
|
|
48020
|
-
var retryTransient2 = retryTransient;
|
|
48021
|
-
var tap7 = tap6;
|
|
48022
|
-
var tapError7 = tapError6;
|
|
48023
|
-
var tapRequest2 = tapRequest;
|
|
48024
|
-
var withCookiesRef2 = withCookiesRef;
|
|
48025
|
-
var followRedirects2 = followRedirects;
|
|
48026
|
-
var currentTracerDisabledWhen2 = currentTracerDisabledWhen;
|
|
48027
|
-
var withTracerDisabledWhen2 = withTracerDisabledWhen;
|
|
48028
|
-
var currentTracerPropagation2 = currentTracerPropagation;
|
|
48029
|
-
var withTracerPropagation2 = withTracerPropagation;
|
|
48030
|
-
var layerMergedContext2 = layerMergedContext;
|
|
48031
|
-
var SpanNameGenerator2 = SpanNameGenerator;
|
|
48032
|
-
var withSpanNameGenerator2 = withSpanNameGenerator;
|
|
48033
|
-
var withScope2 = withScope;
|
|
48034
47659
|
|
|
48035
47660
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpClientRequest.js
|
|
48036
|
-
var
|
|
48037
|
-
__export(exports_HttpClientRequest, {
|
|
48038
|
-
updateUrl: () => updateUrl2,
|
|
48039
|
-
toUrl: () => toUrl2,
|
|
48040
|
-
setUrlParams: () => setUrlParams2,
|
|
48041
|
-
setUrlParam: () => setUrlParam2,
|
|
48042
|
-
setUrl: () => setUrl2,
|
|
48043
|
-
setMethod: () => setMethod2,
|
|
48044
|
-
setHeaders: () => setHeaders2,
|
|
48045
|
-
setHeader: () => setHeader2,
|
|
48046
|
-
setHash: () => setHash2,
|
|
48047
|
-
setBody: () => setBody2,
|
|
48048
|
-
schemaBodyJson: () => schemaBodyJson2,
|
|
48049
|
-
removeHash: () => removeHash2,
|
|
48050
|
-
put: () => put4,
|
|
48051
|
-
prependUrl: () => prependUrl2,
|
|
48052
|
-
post: () => post4,
|
|
48053
|
-
patch: () => patch12,
|
|
48054
|
-
options: () => options6,
|
|
48055
|
-
modify: () => modify7,
|
|
48056
|
-
make: () => make67,
|
|
48057
|
-
head: () => head10,
|
|
48058
|
-
get: () => get20,
|
|
48059
|
-
del: () => del4,
|
|
48060
|
-
bodyUrlParams: () => bodyUrlParams2,
|
|
48061
|
-
bodyUnsafeJson: () => bodyUnsafeJson2,
|
|
48062
|
-
bodyUint8Array: () => bodyUint8Array2,
|
|
48063
|
-
bodyText: () => bodyText2,
|
|
48064
|
-
bodyStream: () => bodyStream2,
|
|
48065
|
-
bodyJson: () => bodyJson2,
|
|
48066
|
-
bodyFormDataRecord: () => bodyFormDataRecord2,
|
|
48067
|
-
bodyFormData: () => bodyFormData2,
|
|
48068
|
-
bodyFileWeb: () => bodyFileWeb2,
|
|
48069
|
-
bodyFile: () => bodyFile2,
|
|
48070
|
-
bearerToken: () => bearerToken2,
|
|
48071
|
-
basicAuth: () => basicAuth2,
|
|
48072
|
-
appendUrlParams: () => appendUrlParams2,
|
|
48073
|
-
appendUrlParam: () => appendUrlParam2,
|
|
48074
|
-
appendUrl: () => appendUrl2,
|
|
48075
|
-
acceptJson: () => acceptJson2,
|
|
48076
|
-
accept: () => accept2,
|
|
48077
|
-
TypeId: () => TypeId36
|
|
48078
|
-
});
|
|
48079
|
-
var TypeId36 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientRequest");
|
|
48080
|
-
var make67 = make64;
|
|
48081
|
-
var get20 = get17;
|
|
48082
|
-
var post4 = post;
|
|
48083
|
-
var patch12 = patch9;
|
|
48084
|
-
var put4 = put;
|
|
48085
|
-
var del4 = del;
|
|
48086
|
-
var head10 = head7;
|
|
48087
|
-
var options6 = options3;
|
|
48088
|
-
var modify7 = modify6;
|
|
48089
|
-
var setMethod2 = setMethod;
|
|
48090
|
-
var setHeader2 = setHeader;
|
|
47661
|
+
var make66 = make64;
|
|
48091
47662
|
var setHeaders2 = setHeaders;
|
|
48092
|
-
var basicAuth2 = basicAuth;
|
|
48093
|
-
var bearerToken2 = bearerToken;
|
|
48094
|
-
var accept2 = accept;
|
|
48095
|
-
var acceptJson2 = acceptJson;
|
|
48096
47663
|
var setUrl2 = setUrl;
|
|
48097
47664
|
var prependUrl2 = prependUrl;
|
|
48098
|
-
var appendUrl2 = appendUrl;
|
|
48099
|
-
var updateUrl2 = updateUrl;
|
|
48100
|
-
var setUrlParam2 = setUrlParam;
|
|
48101
47665
|
var setUrlParams2 = setUrlParams;
|
|
48102
|
-
var appendUrlParam2 = appendUrlParam;
|
|
48103
47666
|
var appendUrlParams2 = appendUrlParams;
|
|
48104
|
-
var setHash2 = setHash;
|
|
48105
|
-
var removeHash2 = removeHash;
|
|
48106
|
-
var toUrl2 = toUrl;
|
|
48107
47667
|
var setBody2 = setBody;
|
|
48108
|
-
var bodyUint8Array2 = bodyUint8Array;
|
|
48109
|
-
var bodyText2 = bodyText;
|
|
48110
|
-
var bodyJson2 = bodyJson;
|
|
48111
|
-
var bodyUnsafeJson2 = bodyUnsafeJson;
|
|
48112
|
-
var schemaBodyJson2 = schemaBodyJson;
|
|
48113
|
-
var bodyUrlParams2 = bodyUrlParams;
|
|
48114
47668
|
var bodyFormData2 = bodyFormData;
|
|
48115
|
-
var bodyFormDataRecord2 = bodyFormDataRecord;
|
|
48116
|
-
var bodyStream2 = bodyStream;
|
|
48117
|
-
var bodyFile2 = bodyFile;
|
|
48118
|
-
var bodyFileWeb2 = bodyFileWeb;
|
|
48119
47669
|
|
|
48120
47670
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpMethod.js
|
|
48121
47671
|
var hasBody = (method) => method !== "GET" && method !== "HEAD" && method !== "OPTIONS";
|
|
48122
47672
|
|
|
48123
47673
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpBody.js
|
|
48124
|
-
var
|
|
48125
|
-
var isHttpBody = (u) => hasProperty(u,
|
|
47674
|
+
var TypeId35 = TypeId31;
|
|
47675
|
+
var isHttpBody = (u) => hasProperty(u, TypeId35);
|
|
48126
47676
|
var uint8Array2 = uint8Array;
|
|
48127
47677
|
var text11 = text10;
|
|
48128
47678
|
var urlParams2 = urlParams;
|
|
48129
47679
|
|
|
48130
47680
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/mailbox.js
|
|
48131
|
-
var
|
|
47681
|
+
var TypeId36 = /* @__PURE__ */ Symbol.for("effect/Mailbox");
|
|
48132
47682
|
var ReadonlyTypeId = /* @__PURE__ */ Symbol.for("effect/Mailbox/ReadonlyMailbox");
|
|
48133
47683
|
var empty46 = /* @__PURE__ */ empty7();
|
|
48134
47684
|
var exitEmpty = /* @__PURE__ */ exitSucceed(empty46);
|
|
@@ -48140,7 +47690,7 @@ class MailboxImpl extends Class2 {
|
|
|
48140
47690
|
scheduler;
|
|
48141
47691
|
capacity;
|
|
48142
47692
|
strategy;
|
|
48143
|
-
[
|
|
47693
|
+
[TypeId36] = TypeId36;
|
|
48144
47694
|
[ReadonlyTypeId] = ReadonlyTypeId;
|
|
48145
47695
|
state = {
|
|
48146
47696
|
_tag: "Open",
|
|
@@ -48536,23 +48086,23 @@ class MailboxImpl extends Class2 {
|
|
|
48536
48086
|
openState.awaiters.clear();
|
|
48537
48087
|
}
|
|
48538
48088
|
}
|
|
48539
|
-
var
|
|
48089
|
+
var make67 = (capacity3) => withFiberRuntime((fiber) => succeed(new MailboxImpl(fiber.currentScheduler, typeof capacity3 === "number" ? capacity3 : capacity3?.capacity ?? Number.POSITIVE_INFINITY, typeof capacity3 === "number" ? "suspend" : capacity3?.strategy ?? "suspend")));
|
|
48540
48090
|
var toChannel3 = (self) => {
|
|
48541
48091
|
const loop3 = flatMap13(self.takeAll, ([messages, done9]) => done9 ? messages.length === 0 ? void_5 : write(messages) : zipRight4(write(messages), loop3));
|
|
48542
48092
|
return loop3;
|
|
48543
48093
|
};
|
|
48544
48094
|
|
|
48545
48095
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Mailbox.js
|
|
48546
|
-
var
|
|
48547
|
-
var isMailbox = (u) => hasProperty(u,
|
|
48548
|
-
var
|
|
48096
|
+
var TypeId37 = TypeId36;
|
|
48097
|
+
var isMailbox = (u) => hasProperty(u, TypeId37);
|
|
48098
|
+
var make68 = make67;
|
|
48549
48099
|
var toChannel4 = toChannel3;
|
|
48550
48100
|
|
|
48551
48101
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/FiberSet.js
|
|
48552
|
-
var
|
|
48553
|
-
var isFiberSet = (u) => hasProperty(u,
|
|
48102
|
+
var TypeId38 = /* @__PURE__ */ Symbol.for("effect/FiberSet");
|
|
48103
|
+
var isFiberSet = (u) => hasProperty(u, TypeId38);
|
|
48554
48104
|
var Proto6 = {
|
|
48555
|
-
[
|
|
48105
|
+
[TypeId38]: TypeId38,
|
|
48556
48106
|
[Symbol.iterator]() {
|
|
48557
48107
|
if (this.state._tag === "Closed") {
|
|
48558
48108
|
return empty2();
|
|
@@ -48575,7 +48125,7 @@ var Proto6 = {
|
|
|
48575
48125
|
return pipeArguments(this, arguments);
|
|
48576
48126
|
}
|
|
48577
48127
|
};
|
|
48578
|
-
var
|
|
48128
|
+
var unsafeMake12 = (backing, deferred) => {
|
|
48579
48129
|
const self = Object.create(Proto6);
|
|
48580
48130
|
self.state = {
|
|
48581
48131
|
_tag: "Open",
|
|
@@ -48584,7 +48134,7 @@ var unsafeMake13 = (backing, deferred) => {
|
|
|
48584
48134
|
self.deferred = deferred;
|
|
48585
48135
|
return self;
|
|
48586
48136
|
};
|
|
48587
|
-
var
|
|
48137
|
+
var make69 = () => acquireRelease2(map17(make40(), (deferred) => unsafeMake12(new Set, deferred)), (set11) => withFiberRuntime2((parent) => {
|
|
48588
48138
|
const state = set11.state;
|
|
48589
48139
|
if (state._tag === "Closed")
|
|
48590
48140
|
return _void;
|
|
@@ -48604,9 +48154,9 @@ var isInternalInterruption = /* @__PURE__ */ reduceWithContext3(undefined, {
|
|
|
48604
48154
|
sequentialCase: (_, left3, right3) => left3 || right3,
|
|
48605
48155
|
parallelCase: (_, left3, right3) => left3 || right3
|
|
48606
48156
|
});
|
|
48607
|
-
var unsafeAdd = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fiber,
|
|
48157
|
+
var unsafeAdd = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fiber, options5) => {
|
|
48608
48158
|
if (self.state._tag === "Closed") {
|
|
48609
|
-
fiber.unsafeInterruptAsFork(combine3(
|
|
48159
|
+
fiber.unsafeInterruptAsFork(combine3(options5?.interruptAs ?? none4, internalFiberId));
|
|
48610
48160
|
return;
|
|
48611
48161
|
} else if (self.state.backing.has(fiber)) {
|
|
48612
48162
|
return;
|
|
@@ -48617,7 +48167,7 @@ var unsafeAdd = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fib
|
|
|
48617
48167
|
return;
|
|
48618
48168
|
}
|
|
48619
48169
|
self.state.backing.delete(fiber);
|
|
48620
|
-
if (isFailure2(exit3) && (
|
|
48170
|
+
if (isFailure2(exit3) && (options5?.propagateInterruption === true ? !isInternalInterruption(exit3.cause) : !isInterruptedOnly2(exit3.cause))) {
|
|
48621
48171
|
unsafeDone(self.deferred, exit3);
|
|
48622
48172
|
}
|
|
48623
48173
|
});
|
|
@@ -48628,9 +48178,9 @@ var join4 = (self) => _await3(self.deferred);
|
|
|
48628
48178
|
var exports_HttpApi = {};
|
|
48629
48179
|
__export(exports_HttpApi, {
|
|
48630
48180
|
reflect: () => reflect,
|
|
48631
|
-
make: () =>
|
|
48181
|
+
make: () => make70,
|
|
48632
48182
|
isHttpApi: () => isHttpApi,
|
|
48633
|
-
TypeId: () =>
|
|
48183
|
+
TypeId: () => TypeId39,
|
|
48634
48184
|
Api: () => Api,
|
|
48635
48185
|
AdditionalSchemas: () => AdditionalSchemas
|
|
48636
48186
|
});
|
|
@@ -48783,23 +48333,23 @@ var param = /* @__PURE__ */ dual(2, (name, schema) => {
|
|
|
48783
48333
|
var Empty = (status2) => Void.annotations(annotations3({
|
|
48784
48334
|
status: status2
|
|
48785
48335
|
}));
|
|
48786
|
-
var asEmpty = /* @__PURE__ */ dual(2, (self,
|
|
48787
|
-
decode:
|
|
48336
|
+
var asEmpty = /* @__PURE__ */ dual(2, (self, options5) => transform2(Void.annotations(self.ast.annotations), typeSchema(self), {
|
|
48337
|
+
decode: options5.decode,
|
|
48788
48338
|
encode: constVoid
|
|
48789
48339
|
}).annotations(annotations3({
|
|
48790
|
-
status:
|
|
48340
|
+
status: options5.status,
|
|
48791
48341
|
[AnnotationEmptyDecodeable]: true
|
|
48792
48342
|
})));
|
|
48793
48343
|
var Created = /* @__PURE__ */ Empty(201);
|
|
48794
48344
|
var Accepted = /* @__PURE__ */ Empty(202);
|
|
48795
48345
|
var NoContent = /* @__PURE__ */ Empty(204);
|
|
48796
48346
|
var MultipartTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiSchema/Multipart");
|
|
48797
|
-
var Multipart = (self,
|
|
48798
|
-
[AnnotationMultipart]:
|
|
48347
|
+
var Multipart = (self, options5) => self.annotations({
|
|
48348
|
+
[AnnotationMultipart]: options5 ?? {}
|
|
48799
48349
|
});
|
|
48800
48350
|
var MultipartStreamTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiSchema/MultipartStream");
|
|
48801
|
-
var MultipartStream = (self,
|
|
48802
|
-
[AnnotationMultipartStream]:
|
|
48351
|
+
var MultipartStream = (self, options5) => self.annotations({
|
|
48352
|
+
[AnnotationMultipartStream]: options5 ?? {}
|
|
48803
48353
|
});
|
|
48804
48354
|
var defaultContentType = (encoding) => {
|
|
48805
48355
|
switch (encoding) {
|
|
@@ -48817,25 +48367,25 @@ var defaultContentType = (encoding) => {
|
|
|
48817
48367
|
}
|
|
48818
48368
|
}
|
|
48819
48369
|
};
|
|
48820
|
-
var withEncoding = /* @__PURE__ */ dual(2, (self,
|
|
48370
|
+
var withEncoding = /* @__PURE__ */ dual(2, (self, options5) => self.annotations({
|
|
48821
48371
|
[AnnotationEncoding]: {
|
|
48822
|
-
kind:
|
|
48823
|
-
contentType:
|
|
48372
|
+
kind: options5.kind,
|
|
48373
|
+
contentType: options5.contentType ?? defaultContentType(options5.kind)
|
|
48824
48374
|
},
|
|
48825
|
-
...
|
|
48375
|
+
...options5.kind === "Uint8Array" ? {
|
|
48826
48376
|
jsonSchema: {
|
|
48827
48377
|
type: "string",
|
|
48828
48378
|
format: "binary"
|
|
48829
48379
|
}
|
|
48830
48380
|
} : undefined
|
|
48831
48381
|
}));
|
|
48832
|
-
var Text = (
|
|
48382
|
+
var Text = (options5) => withEncoding(String$, {
|
|
48833
48383
|
kind: "Text",
|
|
48834
|
-
...
|
|
48384
|
+
...options5
|
|
48835
48385
|
});
|
|
48836
|
-
var Uint8Array2 = (
|
|
48386
|
+
var Uint8Array2 = (options5) => withEncoding(Uint8ArrayFromSelf, {
|
|
48837
48387
|
kind: "Uint8Array",
|
|
48838
|
-
...
|
|
48388
|
+
...options5
|
|
48839
48389
|
});
|
|
48840
48390
|
var astCache2 = /* @__PURE__ */ globalValue("@effect/platform/HttpApiSchema/astCache", () => new WeakMap);
|
|
48841
48391
|
var deunionize = (schemas, schema) => {
|
|
@@ -48862,11 +48412,11 @@ var deunionize = (schemas, schema) => {
|
|
|
48862
48412
|
schemas.add(schema);
|
|
48863
48413
|
}
|
|
48864
48414
|
};
|
|
48865
|
-
var EmptyError = () => (
|
|
48866
|
-
const symbol3 = Symbol.for(`@effect/platform/HttpApiSchema/EmptyError/${
|
|
48415
|
+
var EmptyError = () => (options5) => {
|
|
48416
|
+
const symbol3 = Symbol.for(`@effect/platform/HttpApiSchema/EmptyError/${options5.tag}`);
|
|
48867
48417
|
|
|
48868
48418
|
class EmptyError2 extends StructuralClass {
|
|
48869
|
-
_tag =
|
|
48419
|
+
_tag = options5.tag;
|
|
48870
48420
|
commit() {
|
|
48871
48421
|
return fail9(this);
|
|
48872
48422
|
}
|
|
@@ -48879,21 +48429,21 @@ var EmptyError = () => (options7) => {
|
|
|
48879
48429
|
return make53(this.ast).annotations(annotations4);
|
|
48880
48430
|
}
|
|
48881
48431
|
});
|
|
48882
|
-
let
|
|
48432
|
+
let transform4;
|
|
48883
48433
|
Object.defineProperty(EmptyError2, "ast", {
|
|
48884
48434
|
get() {
|
|
48885
|
-
if (
|
|
48886
|
-
return
|
|
48435
|
+
if (transform4) {
|
|
48436
|
+
return transform4.ast;
|
|
48887
48437
|
}
|
|
48888
48438
|
const self = this;
|
|
48889
|
-
|
|
48890
|
-
identifier:
|
|
48891
|
-
title:
|
|
48439
|
+
transform4 = asEmpty(declare((u) => hasProperty(u, symbol3), {
|
|
48440
|
+
identifier: options5.tag,
|
|
48441
|
+
title: options5.tag
|
|
48892
48442
|
}), {
|
|
48893
|
-
status:
|
|
48443
|
+
status: options5.status,
|
|
48894
48444
|
decode: constant(new self)
|
|
48895
48445
|
});
|
|
48896
|
-
return
|
|
48446
|
+
return transform4.ast;
|
|
48897
48447
|
}
|
|
48898
48448
|
});
|
|
48899
48449
|
return EmptyError2;
|
|
@@ -48925,13 +48475,13 @@ class HttpApiDecodeError extends (/* @__PURE__ */ TaggedError2()("HttpApiDecodeE
|
|
|
48925
48475
|
}
|
|
48926
48476
|
|
|
48927
48477
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApi.js
|
|
48928
|
-
var
|
|
48929
|
-
var isHttpApi = (u) => hasProperty(u,
|
|
48478
|
+
var TypeId39 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApi");
|
|
48479
|
+
var isHttpApi = (u) => hasProperty(u, TypeId39);
|
|
48930
48480
|
|
|
48931
48481
|
class Api extends (/* @__PURE__ */ Tag2("@effect/platform/HttpApi/Api")()) {
|
|
48932
48482
|
}
|
|
48933
48483
|
var Proto7 = {
|
|
48934
|
-
[
|
|
48484
|
+
[TypeId39]: TypeId39,
|
|
48935
48485
|
pipe() {
|
|
48936
48486
|
return pipeArguments(this, arguments);
|
|
48937
48487
|
},
|
|
@@ -49010,41 +48560,41 @@ var Proto7 = {
|
|
|
49010
48560
|
});
|
|
49011
48561
|
}
|
|
49012
48562
|
};
|
|
49013
|
-
var makeProto2 = (
|
|
48563
|
+
var makeProto2 = (options5) => {
|
|
49014
48564
|
function HttpApi() {}
|
|
49015
48565
|
Object.setPrototypeOf(HttpApi, Proto7);
|
|
49016
|
-
HttpApi.groups =
|
|
49017
|
-
HttpApi.errorSchema =
|
|
49018
|
-
HttpApi.annotations =
|
|
49019
|
-
HttpApi.middlewares =
|
|
48566
|
+
HttpApi.groups = options5.groups;
|
|
48567
|
+
HttpApi.errorSchema = options5.errorSchema;
|
|
48568
|
+
HttpApi.annotations = options5.annotations;
|
|
48569
|
+
HttpApi.middlewares = options5.middlewares;
|
|
49020
48570
|
return HttpApi;
|
|
49021
48571
|
};
|
|
49022
|
-
var
|
|
48572
|
+
var make70 = (identifier2) => makeProto2({
|
|
49023
48573
|
identifier: identifier2,
|
|
49024
48574
|
groups: new Map,
|
|
49025
48575
|
errorSchema: HttpApiDecodeError,
|
|
49026
48576
|
annotations: empty6(),
|
|
49027
48577
|
middlewares: new Set
|
|
49028
48578
|
});
|
|
49029
|
-
var reflect = (self,
|
|
48579
|
+
var reflect = (self, options5) => {
|
|
49030
48580
|
const apiErrors = extractMembers(self.errorSchema.ast, new Map, getStatusErrorAST);
|
|
49031
48581
|
const groups = Object.values(self.groups);
|
|
49032
48582
|
for (const group5 of groups) {
|
|
49033
48583
|
const groupErrors = extractMembers(group5.errorSchema.ast, apiErrors, getStatusErrorAST);
|
|
49034
48584
|
const groupAnnotations = merge3(self.annotations, group5.annotations);
|
|
49035
|
-
|
|
48585
|
+
options5.onGroup({
|
|
49036
48586
|
group: group5,
|
|
49037
48587
|
mergedAnnotations: groupAnnotations
|
|
49038
48588
|
});
|
|
49039
48589
|
const endpoints = Object.values(group5.endpoints);
|
|
49040
48590
|
for (const endpoint of endpoints) {
|
|
49041
|
-
if (
|
|
48591
|
+
if (options5.predicate && !options5.predicate({
|
|
49042
48592
|
endpoint,
|
|
49043
48593
|
group: group5
|
|
49044
48594
|
}))
|
|
49045
48595
|
continue;
|
|
49046
48596
|
const errors2 = extractMembers(endpoint.errorSchema.ast, groupErrors, getStatusErrorAST);
|
|
49047
|
-
|
|
48597
|
+
options5.onEndpoint({
|
|
49048
48598
|
group: group5,
|
|
49049
48599
|
endpoint,
|
|
49050
48600
|
middleware: new Set([...group5.middlewares, ...endpoint.middlewares]),
|
|
@@ -49124,46 +48674,8 @@ class AdditionalSchemas extends (/* @__PURE__ */ Tag2("@effect/platform/HttpApi/
|
|
|
49124
48674
|
}
|
|
49125
48675
|
|
|
49126
48676
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiMiddleware.js
|
|
49127
|
-
var exports_HttpApiMiddleware = {};
|
|
49128
|
-
__export(exports_HttpApiMiddleware, {
|
|
49129
|
-
isSecurity: () => isSecurity,
|
|
49130
|
-
TypeId: () => TypeId42,
|
|
49131
|
-
Tag: () => Tag5,
|
|
49132
|
-
SecurityTypeId: () => SecurityTypeId
|
|
49133
|
-
});
|
|
49134
|
-
var TypeId42 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiMiddleware");
|
|
49135
48677
|
var SecurityTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiMiddleware/Security");
|
|
49136
48678
|
var isSecurity = (u) => hasProperty(u, SecurityTypeId);
|
|
49137
|
-
var Tag5 = () => (id2, options7) => {
|
|
49138
|
-
const Err = globalThis.Error;
|
|
49139
|
-
const limit = Err.stackTraceLimit;
|
|
49140
|
-
Err.stackTraceLimit = 2;
|
|
49141
|
-
const creationError = new Err;
|
|
49142
|
-
Err.stackTraceLimit = limit;
|
|
49143
|
-
function TagClass() {}
|
|
49144
|
-
const TagClass_ = TagClass;
|
|
49145
|
-
Object.setPrototypeOf(TagClass, Object.getPrototypeOf(GenericTag(id2)));
|
|
49146
|
-
TagClass.key = id2;
|
|
49147
|
-
Object.defineProperty(TagClass, "stack", {
|
|
49148
|
-
get() {
|
|
49149
|
-
return creationError.stack;
|
|
49150
|
-
}
|
|
49151
|
-
});
|
|
49152
|
-
TagClass_[TypeId42] = TypeId42;
|
|
49153
|
-
TagClass_.failure = options7?.optional === true || options7?.failure === undefined ? Never : options7.failure;
|
|
49154
|
-
if (options7?.provides) {
|
|
49155
|
-
TagClass_.provides = options7.provides;
|
|
49156
|
-
}
|
|
49157
|
-
TagClass_.optional = options7?.optional ?? false;
|
|
49158
|
-
if (options7?.security) {
|
|
49159
|
-
if (Object.keys(options7.security).length === 0) {
|
|
49160
|
-
throw new Error("HttpApiMiddleware.Tag: security object must not be empty");
|
|
49161
|
-
}
|
|
49162
|
-
TagClass_[SecurityTypeId] = SecurityTypeId;
|
|
49163
|
-
TagClass_.security = options7.security;
|
|
49164
|
-
}
|
|
49165
|
-
return TagClass;
|
|
49166
|
-
};
|
|
49167
48679
|
|
|
49168
48680
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpRouter.js
|
|
49169
48681
|
var removeTrailingSlash = (path2) => path2.endsWith("/") ? path2.slice(0, -1) : path2;
|
|
@@ -49196,13 +48708,13 @@ __export(exports_OpenApi, {
|
|
|
49196
48708
|
});
|
|
49197
48709
|
|
|
49198
48710
|
// ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/JSONSchema.js
|
|
49199
|
-
var fromAST = (ast,
|
|
49200
|
-
const definitionPath =
|
|
48711
|
+
var fromAST = (ast, options6) => {
|
|
48712
|
+
const definitionPath = options6.definitionPath ?? "#/$defs/";
|
|
49201
48713
|
const getRef = (id2) => definitionPath + id2;
|
|
49202
|
-
const target =
|
|
49203
|
-
const topLevelReferenceStrategy =
|
|
49204
|
-
const additionalPropertiesStrategy =
|
|
49205
|
-
return go3(ast,
|
|
48714
|
+
const target = options6.target ?? "jsonSchema7";
|
|
48715
|
+
const topLevelReferenceStrategy = options6.topLevelReferenceStrategy ?? "keep";
|
|
48716
|
+
const additionalPropertiesStrategy = options6.additionalPropertiesStrategy ?? "strict";
|
|
48717
|
+
return go3(ast, options6.definitions, "handle-identifier", [], {
|
|
49206
48718
|
getRef,
|
|
49207
48719
|
target,
|
|
49208
48720
|
topLevelReferenceStrategy,
|
|
@@ -49393,8 +48905,8 @@ var mergeRefinements = (from, jsonSchema2, ast) => {
|
|
|
49393
48905
|
}
|
|
49394
48906
|
return out;
|
|
49395
48907
|
};
|
|
49396
|
-
function isContentSchemaSupported(
|
|
49397
|
-
switch (
|
|
48908
|
+
function isContentSchemaSupported(options6) {
|
|
48909
|
+
switch (options6.target) {
|
|
49398
48910
|
case "jsonSchema7":
|
|
49399
48911
|
return false;
|
|
49400
48912
|
case "jsonSchema2019-09":
|
|
@@ -49403,8 +48915,8 @@ function isContentSchemaSupported(options8) {
|
|
|
49403
48915
|
return true;
|
|
49404
48916
|
}
|
|
49405
48917
|
}
|
|
49406
|
-
function getAdditionalProperties(
|
|
49407
|
-
switch (
|
|
48918
|
+
function getAdditionalProperties(options6) {
|
|
48919
|
+
switch (options6.additionalPropertiesStrategy) {
|
|
49408
48920
|
case "allow":
|
|
49409
48921
|
return true;
|
|
49410
48922
|
case "strict":
|
|
@@ -49445,17 +48957,17 @@ function getIdentifierAnnotation2(ast) {
|
|
|
49445
48957
|
}
|
|
49446
48958
|
return identifier2;
|
|
49447
48959
|
}
|
|
49448
|
-
function go3(ast, $defs, identifier2, path2,
|
|
49449
|
-
if (identifier2 === "handle-identifier" && (
|
|
48960
|
+
function go3(ast, $defs, identifier2, path2, options6, annotation, errors2) {
|
|
48961
|
+
if (identifier2 === "handle-identifier" && (options6.topLevelReferenceStrategy !== "skip" || isSuspend(ast))) {
|
|
49450
48962
|
const id2 = getIdentifierAnnotation2(ast);
|
|
49451
48963
|
if (id2 !== undefined) {
|
|
49452
48964
|
const escapedId = id2.replace(/~/ig, "~0").replace(/\//ig, "~1");
|
|
49453
48965
|
const out = {
|
|
49454
|
-
$ref:
|
|
48966
|
+
$ref: options6.getRef(escapedId)
|
|
49455
48967
|
};
|
|
49456
48968
|
if (!has($defs, id2)) {
|
|
49457
48969
|
$defs[id2] = out;
|
|
49458
|
-
$defs[id2] = go3(ast, $defs, "ignore-identifier", path2,
|
|
48970
|
+
$defs[id2] = go3(ast, $defs, "ignore-identifier", path2, options6, "handle-annotation", errors2);
|
|
49459
48971
|
}
|
|
49460
48972
|
return out;
|
|
49461
48973
|
}
|
|
@@ -49476,14 +48988,14 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49476
48988
|
case "Refinement": {
|
|
49477
48989
|
const t = getTransformationFrom(ast);
|
|
49478
48990
|
if (t === undefined) {
|
|
49479
|
-
return mergeRefinements(go3(ast.from, $defs, identifier2, path2,
|
|
48991
|
+
return mergeRefinements(go3(ast.from, $defs, identifier2, path2, options6, "handle-annotation", errors2), handler, ast);
|
|
49480
48992
|
} else {
|
|
49481
|
-
return go3(t, $defs, identifier2, path2,
|
|
48993
|
+
return go3(t, $defs, identifier2, path2, options6, "handle-annotation", errors2);
|
|
49482
48994
|
}
|
|
49483
48995
|
}
|
|
49484
48996
|
default:
|
|
49485
48997
|
return {
|
|
49486
|
-
...go3(ast, $defs, identifier2, path2,
|
|
48998
|
+
...go3(ast, $defs, identifier2, path2, options6, "ignore-annotation", errors2),
|
|
49487
48999
|
...handler
|
|
49488
49000
|
};
|
|
49489
49001
|
}
|
|
@@ -49492,7 +49004,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49492
49004
|
}
|
|
49493
49005
|
const surrogate = getSurrogateAnnotation(ast);
|
|
49494
49006
|
if (isSome2(surrogate)) {
|
|
49495
|
-
return go3(surrogate.value, $defs, identifier2, path2,
|
|
49007
|
+
return go3(surrogate.value, $defs, identifier2, path2, options6, "handle-annotation", errors2);
|
|
49496
49008
|
}
|
|
49497
49009
|
switch (ast._tag) {
|
|
49498
49010
|
case "Declaration":
|
|
@@ -49510,7 +49022,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49510
49022
|
return addASTAnnotations(constAny, ast);
|
|
49511
49023
|
throw new Error(getJSONSchemaMissingIdentifierAnnotationErrorMessage(path2, ast));
|
|
49512
49024
|
}
|
|
49513
|
-
return go3(ast.f(), $defs, "ignore-identifier", path2,
|
|
49025
|
+
return go3(ast.f(), $defs, "ignore-identifier", path2, options6, "handle-annotation", errors2);
|
|
49514
49026
|
}
|
|
49515
49027
|
case "NeverKeyword":
|
|
49516
49028
|
return addASTAnnotations(constNever, ast);
|
|
@@ -49575,15 +49087,15 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49575
49087
|
}, ast) : addASTAnnotations(constNever, ast);
|
|
49576
49088
|
}
|
|
49577
49089
|
case "TupleType": {
|
|
49578
|
-
const elements = ast.elements.map((e, i) => mergeJsonSchemaAnnotations(go3(e.type, $defs, "handle-identifier", path2.concat(i),
|
|
49579
|
-
const rest = ast.rest.map((type2) => mergeJsonSchemaAnnotations(go3(type2.type, $defs, "handle-identifier", path2,
|
|
49090
|
+
const elements = ast.elements.map((e, i) => mergeJsonSchemaAnnotations(go3(e.type, $defs, "handle-identifier", path2.concat(i), options6, "handle-annotation", errors2), getContextJsonSchemaAnnotations(e.type, e)));
|
|
49091
|
+
const rest = ast.rest.map((type2) => mergeJsonSchemaAnnotations(go3(type2.type, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2), getContextJsonSchemaAnnotations(type2.type, type2)));
|
|
49580
49092
|
const output = {
|
|
49581
49093
|
type: "array"
|
|
49582
49094
|
};
|
|
49583
49095
|
const len = ast.elements.length;
|
|
49584
49096
|
if (len > 0) {
|
|
49585
49097
|
output.minItems = len - ast.elements.filter((element2) => element2.isOptional).length;
|
|
49586
|
-
if (
|
|
49098
|
+
if (options6.target === "jsonSchema7") {
|
|
49587
49099
|
output.items = elements;
|
|
49588
49100
|
} else {
|
|
49589
49101
|
output.prefixItems = elements;
|
|
@@ -49591,20 +49103,20 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49591
49103
|
}
|
|
49592
49104
|
const restLength = rest.length;
|
|
49593
49105
|
if (restLength > 0) {
|
|
49594
|
-
const
|
|
49106
|
+
const head10 = rest[0];
|
|
49595
49107
|
const isHomogeneous = restLength === 1 && ast.elements.every((e) => e.type === ast.rest[0].type);
|
|
49596
49108
|
if (isHomogeneous) {
|
|
49597
|
-
if (
|
|
49598
|
-
output.items =
|
|
49109
|
+
if (options6.target === "jsonSchema7") {
|
|
49110
|
+
output.items = head10;
|
|
49599
49111
|
} else {
|
|
49600
|
-
output.items =
|
|
49112
|
+
output.items = head10;
|
|
49601
49113
|
delete output.prefixItems;
|
|
49602
49114
|
}
|
|
49603
49115
|
} else {
|
|
49604
|
-
if (
|
|
49605
|
-
output.additionalItems =
|
|
49116
|
+
if (options6.target === "jsonSchema7") {
|
|
49117
|
+
output.additionalItems = head10;
|
|
49606
49118
|
} else {
|
|
49607
|
-
output.items =
|
|
49119
|
+
output.items = head10;
|
|
49608
49120
|
}
|
|
49609
49121
|
}
|
|
49610
49122
|
if (restLength > 1) {
|
|
@@ -49614,7 +49126,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49614
49126
|
}
|
|
49615
49127
|
} else {
|
|
49616
49128
|
if (len > 0) {
|
|
49617
|
-
if (
|
|
49129
|
+
if (options6.target === "jsonSchema7") {
|
|
49618
49130
|
output.additionalItems = false;
|
|
49619
49131
|
} else {
|
|
49620
49132
|
output.items = false;
|
|
@@ -49633,7 +49145,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49633
49145
|
type: "object",
|
|
49634
49146
|
required: [],
|
|
49635
49147
|
properties: {},
|
|
49636
|
-
additionalProperties: getAdditionalProperties(
|
|
49148
|
+
additionalProperties: getAdditionalProperties(options6)
|
|
49637
49149
|
};
|
|
49638
49150
|
let patternProperties = undefined;
|
|
49639
49151
|
let propertyNames = undefined;
|
|
@@ -49642,11 +49154,11 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49642
49154
|
const parameter = is3.parameter;
|
|
49643
49155
|
switch (parameter._tag) {
|
|
49644
49156
|
case "StringKeyword": {
|
|
49645
|
-
output.additionalProperties = go3(pruned, $defs, "handle-identifier", path2,
|
|
49157
|
+
output.additionalProperties = go3(pruned, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2);
|
|
49646
49158
|
break;
|
|
49647
49159
|
}
|
|
49648
49160
|
case "TemplateLiteral": {
|
|
49649
|
-
patternProperties = go3(pruned, $defs, "handle-identifier", path2,
|
|
49161
|
+
patternProperties = go3(pruned, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2);
|
|
49650
49162
|
propertyNames = {
|
|
49651
49163
|
type: "string",
|
|
49652
49164
|
pattern: getTemplateLiteralRegExp(parameter).source
|
|
@@ -49654,14 +49166,14 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49654
49166
|
break;
|
|
49655
49167
|
}
|
|
49656
49168
|
case "Refinement": {
|
|
49657
|
-
patternProperties = go3(pruned, $defs, "handle-identifier", path2,
|
|
49658
|
-
propertyNames = go3(parameter, $defs, "handle-identifier", path2,
|
|
49169
|
+
patternProperties = go3(pruned, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2);
|
|
49170
|
+
propertyNames = go3(parameter, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2);
|
|
49659
49171
|
break;
|
|
49660
49172
|
}
|
|
49661
49173
|
case "SymbolKeyword": {
|
|
49662
49174
|
const indexSignaturePath = path2.concat("[symbol]");
|
|
49663
|
-
output.additionalProperties = go3(pruned, $defs, "handle-identifier", indexSignaturePath,
|
|
49664
|
-
propertyNames = go3(parameter, $defs, "handle-identifier", indexSignaturePath,
|
|
49175
|
+
output.additionalProperties = go3(pruned, $defs, "handle-identifier", indexSignaturePath, options6, "handle-annotation", errors2);
|
|
49176
|
+
propertyNames = go3(parameter, $defs, "handle-identifier", indexSignaturePath, options6, "handle-annotation", errors2);
|
|
49665
49177
|
break;
|
|
49666
49178
|
}
|
|
49667
49179
|
}
|
|
@@ -49672,7 +49184,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49672
49184
|
if (isString(name)) {
|
|
49673
49185
|
const pruned = pruneUndefined3(ps.type);
|
|
49674
49186
|
const type2 = pruned ?? ps.type;
|
|
49675
|
-
output.properties[name] = mergeJsonSchemaAnnotations(go3(type2, $defs, "handle-identifier", path2.concat(ps.name),
|
|
49187
|
+
output.properties[name] = mergeJsonSchemaAnnotations(go3(type2, $defs, "handle-identifier", path2.concat(ps.name), options6, "handle-annotation", errors2), getContextJsonSchemaAnnotations(type2, ps));
|
|
49676
49188
|
if (!ps.isOptional && pruned === undefined) {
|
|
49677
49189
|
output.required.push(name);
|
|
49678
49190
|
}
|
|
@@ -49694,7 +49206,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49694
49206
|
return addASTAnnotations(output, ast);
|
|
49695
49207
|
}
|
|
49696
49208
|
case "Union": {
|
|
49697
|
-
const members = ast.types.map((t) => go3(t, $defs, "handle-identifier", path2,
|
|
49209
|
+
const members = ast.types.map((t) => go3(t, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2));
|
|
49698
49210
|
const anyOf = compactUnion(members);
|
|
49699
49211
|
switch (anyOf.length) {
|
|
49700
49212
|
case 0:
|
|
@@ -49708,7 +49220,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49708
49220
|
}
|
|
49709
49221
|
}
|
|
49710
49222
|
case "Refinement":
|
|
49711
|
-
return go3(ast.from, $defs, identifier2, path2,
|
|
49223
|
+
return go3(ast.from, $defs, identifier2, path2, options6, "handle-annotation", errors2);
|
|
49712
49224
|
case "TemplateLiteral": {
|
|
49713
49225
|
const regex = getTemplateLiteralRegExp(ast);
|
|
49714
49226
|
return addASTAnnotations({
|
|
@@ -49724,14 +49236,14 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
|
|
|
49724
49236
|
type: "string",
|
|
49725
49237
|
contentMediaType: "application/json"
|
|
49726
49238
|
};
|
|
49727
|
-
if (isContentSchemaSupported(
|
|
49728
|
-
out["contentSchema"] = go3(ast.to, $defs, identifier2, path2,
|
|
49239
|
+
if (isContentSchemaSupported(options6)) {
|
|
49240
|
+
out["contentSchema"] = go3(ast.to, $defs, identifier2, path2, options6, "handle-annotation", errors2);
|
|
49729
49241
|
}
|
|
49730
49242
|
return out;
|
|
49731
49243
|
}
|
|
49732
|
-
const from = go3(ast.from, $defs, identifier2, path2,
|
|
49244
|
+
const from = go3(ast.from, $defs, identifier2, path2, options6, "handle-annotation", errors2);
|
|
49733
49245
|
if (ast.transformation._tag === "TypeLiteralTransformation" && isJsonSchema7Object(from)) {
|
|
49734
|
-
const to = go3(ast.to, {}, "ignore-identifier", path2,
|
|
49246
|
+
const to = go3(ast.to, {}, "ignore-identifier", path2, options6, "handle-annotation", "ignore-errors");
|
|
49735
49247
|
if (isJsonSchema7Object(to)) {
|
|
49736
49248
|
for (const t of ast.transformation.propertySignatureTransformations) {
|
|
49737
49249
|
const toKey = t.to;
|
|
@@ -49803,13 +49315,13 @@ function compactUnion(members) {
|
|
|
49803
49315
|
}
|
|
49804
49316
|
|
|
49805
49317
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/OpenApiJsonSchema.js
|
|
49806
|
-
var fromAST2 = (ast,
|
|
49318
|
+
var fromAST2 = (ast, options6) => {
|
|
49807
49319
|
const jsonSchema2 = fromAST(ast, {
|
|
49808
|
-
definitions:
|
|
49809
|
-
definitionPath:
|
|
49320
|
+
definitions: options6.defs,
|
|
49321
|
+
definitionPath: options6.defsPath ?? "#/components/schemas/",
|
|
49810
49322
|
target: "openApi3.1",
|
|
49811
|
-
topLevelReferenceStrategy:
|
|
49812
|
-
additionalPropertiesStrategy:
|
|
49323
|
+
topLevelReferenceStrategy: options6.topLevelReferenceStrategy,
|
|
49324
|
+
additionalPropertiesStrategy: options6.additionalPropertiesStrategy
|
|
49813
49325
|
});
|
|
49814
49326
|
return jsonSchema2;
|
|
49815
49327
|
};
|
|
@@ -49857,11 +49369,11 @@ class Transform extends (/* @__PURE__ */ Tag2("@effect/platform/OpenApi/Transfor
|
|
|
49857
49369
|
}
|
|
49858
49370
|
var contextPartial = (tags2) => {
|
|
49859
49371
|
const entries2 = Object.entries(tags2);
|
|
49860
|
-
return (
|
|
49372
|
+
return (options6) => {
|
|
49861
49373
|
let context8 = empty6();
|
|
49862
49374
|
for (const [key, tag6] of entries2) {
|
|
49863
|
-
if (
|
|
49864
|
-
context8 = add2(context8, tag6,
|
|
49375
|
+
if (options6[key] !== undefined) {
|
|
49376
|
+
context8 = add2(context8, tag6, options6[key]);
|
|
49865
49377
|
}
|
|
49866
49378
|
}
|
|
49867
49379
|
return context8;
|
|
@@ -49889,7 +49401,7 @@ function processAnnotation(ctx, tag6, f) {
|
|
|
49889
49401
|
f(o.value);
|
|
49890
49402
|
}
|
|
49891
49403
|
}
|
|
49892
|
-
var fromApi = (api,
|
|
49404
|
+
var fromApi = (api, options6) => {
|
|
49893
49405
|
const cached4 = apiCache.get(api);
|
|
49894
49406
|
if (cached4 !== undefined) {
|
|
49895
49407
|
return cached4;
|
|
@@ -49912,7 +49424,7 @@ var fromApi = (api, options8) => {
|
|
|
49912
49424
|
function processAST(ast) {
|
|
49913
49425
|
return fromAST2(ast, {
|
|
49914
49426
|
defs: jsonSchemaDefs,
|
|
49915
|
-
additionalPropertiesStrategy:
|
|
49427
|
+
additionalPropertiesStrategy: options6?.additionalPropertiesStrategy
|
|
49916
49428
|
});
|
|
49917
49429
|
}
|
|
49918
49430
|
function processHttpApiSecurity(name, security) {
|
|
@@ -50265,7 +49777,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
50265
49777
|
const release = sync3(() => requestMap.delete(id3));
|
|
50266
49778
|
return isFailure2(exit3) ? zipRight3(orDie3(backing.send([id3, 1])), release) : release;
|
|
50267
49779
|
};
|
|
50268
|
-
const
|
|
49780
|
+
const execute3 = (request2) => fromChannel4(acquireUseRelease4(executeAcquire(request2, make68()), ({
|
|
50269
49781
|
mailbox
|
|
50270
49782
|
}) => toChannel4(mailbox), executeRelease));
|
|
50271
49783
|
const executeEffect = (request2) => acquireUseRelease2(executeAcquire(request2, make40()), ({
|
|
@@ -50280,7 +49792,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
50280
49792
|
}
|
|
50281
49793
|
return {
|
|
50282
49794
|
id: id2,
|
|
50283
|
-
execute:
|
|
49795
|
+
execute: execute3,
|
|
50284
49796
|
executeEffect
|
|
50285
49797
|
};
|
|
50286
49798
|
});
|
|
@@ -50288,7 +49800,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
|
|
|
50288
49800
|
});
|
|
50289
49801
|
});
|
|
50290
49802
|
var layerManager = /* @__PURE__ */ effect(WorkerManager, makeManager);
|
|
50291
|
-
var makePlatform = () => (
|
|
49803
|
+
var makePlatform = () => (options6) => PlatformWorker.of({
|
|
50292
49804
|
[PlatformWorkerTypeId]: PlatformWorkerTypeId,
|
|
50293
49805
|
spawn(id2) {
|
|
50294
49806
|
return gen2(function* () {
|
|
@@ -50297,7 +49809,7 @@ var makePlatform = () => (options8) => PlatformWorker.of({
|
|
|
50297
49809
|
const buffer3 = [];
|
|
50298
49810
|
const run10 = (handler) => uninterruptibleMask3((restore) => gen2(function* () {
|
|
50299
49811
|
const scope5 = yield* scope3;
|
|
50300
|
-
const port2 = yield*
|
|
49812
|
+
const port2 = yield* options6.setup({
|
|
50301
49813
|
worker: spawn(id2),
|
|
50302
49814
|
scope: scope5
|
|
50303
49815
|
});
|
|
@@ -50306,9 +49818,9 @@ var makePlatform = () => (options8) => PlatformWorker.of({
|
|
|
50306
49818
|
currentPort = undefined;
|
|
50307
49819
|
}));
|
|
50308
49820
|
const runtime5 = (yield* runtime4()).pipe(updateContext3(omit2(Scope)));
|
|
50309
|
-
const fiberSet = yield*
|
|
49821
|
+
const fiberSet = yield* make69();
|
|
50310
49822
|
const runFork4 = runFork3(runtime5);
|
|
50311
|
-
yield*
|
|
49823
|
+
yield* options6.listen({
|
|
50312
49824
|
port: port2,
|
|
50313
49825
|
scope: scope5,
|
|
50314
49826
|
emit(data) {
|
|
@@ -50367,11 +49879,11 @@ var requestInitTagKey = "@effect/platform/FetchHttpClient/FetchOptions";
|
|
|
50367
49879
|
var fetch2 = /* @__PURE__ */ make65((request2, url2, signal, fiber) => {
|
|
50368
49880
|
const context8 = fiber.getFiberRef(currentContext2);
|
|
50369
49881
|
const fetch3 = context8.unsafeMap.get(fetchTagKey) ?? globalThis.fetch;
|
|
50370
|
-
const
|
|
50371
|
-
const headers =
|
|
49882
|
+
const options6 = context8.unsafeMap.get(requestInitTagKey) ?? {};
|
|
49883
|
+
const headers = options6.headers ? merge11(fromInput2(options6.headers), request2.headers) : request2.headers;
|
|
50372
49884
|
const send = (body) => map17(tryPromise2({
|
|
50373
49885
|
try: () => fetch3(url2, {
|
|
50374
|
-
...
|
|
49886
|
+
...options6,
|
|
50375
49887
|
method: request2.method,
|
|
50376
49888
|
headers,
|
|
50377
49889
|
body,
|
|
@@ -50412,7 +49924,7 @@ __export(exports_BunContext, {
|
|
|
50412
49924
|
});
|
|
50413
49925
|
|
|
50414
49926
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/commandExecutor.js
|
|
50415
|
-
var
|
|
49927
|
+
var TypeId41 = /* @__PURE__ */ Symbol.for("@effect/platform/CommandExecutor");
|
|
50416
49928
|
var ProcessTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/Process");
|
|
50417
49929
|
var ExitCode = /* @__PURE__ */ nominal();
|
|
50418
49930
|
var ProcessId = /* @__PURE__ */ nominal();
|
|
@@ -50424,7 +49936,7 @@ var makeExecutor = (start3) => {
|
|
|
50424
49936
|
return splitLines3(mapChunks2(stream5(command), map5((bytes) => decoder2.decode(bytes))));
|
|
50425
49937
|
};
|
|
50426
49938
|
return {
|
|
50427
|
-
[
|
|
49939
|
+
[TypeId41]: TypeId41,
|
|
50428
49940
|
start: start3,
|
|
50429
49941
|
exitCode: (command) => scoped2(flatMap10(start3(command), (process2) => process2.exitCode)),
|
|
50430
49942
|
stream: stream5,
|
|
@@ -50482,7 +49994,7 @@ var StandardProto = {
|
|
|
50482
49994
|
};
|
|
50483
49995
|
}
|
|
50484
49996
|
};
|
|
50485
|
-
var makeStandard = (
|
|
49997
|
+
var makeStandard = (options6) => Object.assign(Object.create(StandardProto), options6);
|
|
50486
49998
|
var PipedProto = {
|
|
50487
49999
|
...Proto8,
|
|
50488
50000
|
_tag: "PipedCommand",
|
|
@@ -50495,7 +50007,7 @@ var PipedProto = {
|
|
|
50495
50007
|
};
|
|
50496
50008
|
}
|
|
50497
50009
|
};
|
|
50498
|
-
var makePiped = (
|
|
50010
|
+
var makePiped = (options6) => Object.assign(Object.create(PipedProto), options6);
|
|
50499
50011
|
var stdin = /* @__PURE__ */ dual(2, (self, input) => {
|
|
50500
50012
|
switch (self._tag) {
|
|
50501
50013
|
case "StandardCommand": {
|
|
@@ -50565,8 +50077,8 @@ var handleErrnoException = (module, method) => (err, [path2]) => {
|
|
|
50565
50077
|
};
|
|
50566
50078
|
|
|
50567
50079
|
// ../../node_modules/.bun/@effect+platform-node-shared@0.59.0+15f69c4693c05b6b/node_modules/@effect/platform-node-shared/dist/esm/internal/stream.js
|
|
50568
|
-
var fromReadable = (evaluate2, onError4,
|
|
50569
|
-
var fromReadableChannel = (evaluate2, onError4,
|
|
50080
|
+
var fromReadable = (evaluate2, onError4, options6) => fromChannel4(fromReadableChannel(evaluate2, onError4, options6));
|
|
50081
|
+
var fromReadableChannel = (evaluate2, onError4, options6) => suspend8(() => unsafeReadableRead(evaluate2(), onError4, make13(undefined), options6));
|
|
50570
50082
|
var writeInput = (writable, onFailure, {
|
|
50571
50083
|
encoding,
|
|
50572
50084
|
endOnDone = true
|
|
@@ -50604,7 +50116,7 @@ var writeEffect = (writable, encoding) => (chunk4) => chunk4.length === 0 ? _voi
|
|
|
50604
50116
|
}
|
|
50605
50117
|
loop3();
|
|
50606
50118
|
});
|
|
50607
|
-
var unsafeReadableRead = (readable, onError4, exit3,
|
|
50119
|
+
var unsafeReadableRead = (readable, onError4, exit3, options6) => {
|
|
50608
50120
|
if (!readable.readable) {
|
|
50609
50121
|
return void_6;
|
|
50610
50122
|
}
|
|
@@ -50623,7 +50135,7 @@ var unsafeReadableRead = (readable, onError4, exit3, options8) => {
|
|
|
50623
50135
|
readable.on("readable", onReadable);
|
|
50624
50136
|
readable.on("error", onErr);
|
|
50625
50137
|
readable.on("end", onEnd2);
|
|
50626
|
-
const chunkSize =
|
|
50138
|
+
const chunkSize = options6?.chunkSize ? Number(options6.chunkSize) : undefined;
|
|
50627
50139
|
const read3 = suspend8(function loop() {
|
|
50628
50140
|
let item = readable.read(chunkSize);
|
|
50629
50141
|
if (item === null) {
|
|
@@ -50646,15 +50158,15 @@ var unsafeReadableRead = (readable, onError4, exit3, options8) => {
|
|
|
50646
50158
|
readable.off("readable", onReadable);
|
|
50647
50159
|
readable.off("error", onErr);
|
|
50648
50160
|
readable.off("end", onEnd2);
|
|
50649
|
-
if (
|
|
50161
|
+
if (options6?.closeOnDone !== false && "closed" in readable && !readable.closed) {
|
|
50650
50162
|
readable.destroy();
|
|
50651
50163
|
}
|
|
50652
50164
|
}));
|
|
50653
50165
|
};
|
|
50654
50166
|
|
|
50655
50167
|
// ../../node_modules/.bun/@effect+platform-node-shared@0.59.0+15f69c4693c05b6b/node_modules/@effect/platform-node-shared/dist/esm/internal/sink.js
|
|
50656
|
-
var fromWritable = (evaluate2, onError4,
|
|
50657
|
-
var fromWritableChannel = (writable, onError4,
|
|
50168
|
+
var fromWritable = (evaluate2, onError4, options6) => fromChannel3(fromWritableChannel(evaluate2, onError4, options6));
|
|
50169
|
+
var fromWritableChannel = (writable, onError4, options6) => flatMap16(zip5(sync3(() => writable()), make40()), ([writable2, deferred]) => embedInput2(writableOutput(writable2, deferred, onError4), writeInput(writable2, (cause3) => failCause6(deferred, cause3), options6, complete2(deferred, _void))));
|
|
50658
50170
|
var writableOutput = (writable, deferred, onError4) => suspend3(() => {
|
|
50659
50171
|
function handleError(err) {
|
|
50660
50172
|
unsafeDone(deferred, fail9(onError4(err)));
|
|
@@ -50774,11 +50286,11 @@ var runCommand = (fileSystem) => (command) => {
|
|
|
50774
50286
|
if (flattened2.length === 1) {
|
|
50775
50287
|
return pipe(flattened2[0], runCommand(fileSystem));
|
|
50776
50288
|
}
|
|
50777
|
-
const
|
|
50289
|
+
const head10 = flattened2[0];
|
|
50778
50290
|
const tail2 = flattened2.slice(1);
|
|
50779
50291
|
const initial = tail2.slice(0, tail2.length - 1);
|
|
50780
50292
|
const last5 = tail2[tail2.length - 1];
|
|
50781
|
-
const stream6 = initial.reduce((stdin3, command2) => pipe(stdin2(command2, stdin3), runCommand(fileSystem), map17((process2) => process2.stdout), unwrapScoped7), pipe(runCommand(fileSystem)(
|
|
50293
|
+
const stream6 = initial.reduce((stdin3, command2) => pipe(stdin2(command2, stdin3), runCommand(fileSystem), map17((process2) => process2.stdout), unwrapScoped7), pipe(runCommand(fileSystem)(head10), map17((process2) => process2.stdout), unwrapScoped7));
|
|
50782
50294
|
return pipe(stdin2(last5, stream6), runCommand(fileSystem));
|
|
50783
50295
|
}
|
|
50784
50296
|
}
|
|
@@ -50821,12 +50333,12 @@ var handleBadArgument = (method) => (cause3) => new BadArgument({
|
|
|
50821
50333
|
});
|
|
50822
50334
|
var access2 = /* @__PURE__ */ (() => {
|
|
50823
50335
|
const nodeAccess = /* @__PURE__ */ effectify2(NFS.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
|
|
50824
|
-
return (path2,
|
|
50336
|
+
return (path2, options6) => {
|
|
50825
50337
|
let mode = NFS.constants.F_OK;
|
|
50826
|
-
if (
|
|
50338
|
+
if (options6?.readable) {
|
|
50827
50339
|
mode |= NFS.constants.R_OK;
|
|
50828
50340
|
}
|
|
50829
|
-
if (
|
|
50341
|
+
if (options6?.writable) {
|
|
50830
50342
|
mode |= NFS.constants.W_OK;
|
|
50831
50343
|
}
|
|
50832
50344
|
return nodeAccess(path2, mode);
|
|
@@ -50834,9 +50346,9 @@ var access2 = /* @__PURE__ */ (() => {
|
|
|
50834
50346
|
})();
|
|
50835
50347
|
var copy3 = /* @__PURE__ */ (() => {
|
|
50836
50348
|
const nodeCp = /* @__PURE__ */ effectify2(NFS.cp, /* @__PURE__ */ handleErrnoException("FileSystem", "copy"), /* @__PURE__ */ handleBadArgument("copy"));
|
|
50837
|
-
return (fromPath, toPath,
|
|
50838
|
-
force:
|
|
50839
|
-
preserveTimestamps:
|
|
50349
|
+
return (fromPath, toPath, options6) => nodeCp(fromPath, toPath, {
|
|
50350
|
+
force: options6?.overwrite ?? false,
|
|
50351
|
+
preserveTimestamps: options6?.preserveTimestamps ?? false,
|
|
50840
50352
|
recursive: true
|
|
50841
50353
|
});
|
|
50842
50354
|
})();
|
|
@@ -50858,39 +50370,39 @@ var link2 = /* @__PURE__ */ (() => {
|
|
|
50858
50370
|
})();
|
|
50859
50371
|
var makeDirectory = /* @__PURE__ */ (() => {
|
|
50860
50372
|
const nodeMkdir = /* @__PURE__ */ effectify2(NFS.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
|
|
50861
|
-
return (path2,
|
|
50862
|
-
recursive:
|
|
50863
|
-
mode:
|
|
50373
|
+
return (path2, options6) => nodeMkdir(path2, {
|
|
50374
|
+
recursive: options6?.recursive ?? false,
|
|
50375
|
+
mode: options6?.mode
|
|
50864
50376
|
});
|
|
50865
50377
|
})();
|
|
50866
50378
|
var makeTempDirectoryFactory = (method) => {
|
|
50867
50379
|
const nodeMkdtemp = effectify2(NFS.mkdtemp, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
50868
|
-
return (
|
|
50869
|
-
const prefix =
|
|
50870
|
-
const directory3 = typeof
|
|
50380
|
+
return (options6) => suspend3(() => {
|
|
50381
|
+
const prefix = options6?.prefix ?? "";
|
|
50382
|
+
const directory3 = typeof options6?.directory === "string" ? Path3.join(options6.directory, ".") : OS.tmpdir();
|
|
50871
50383
|
return nodeMkdtemp(prefix ? Path3.join(directory3, prefix) : directory3 + "/");
|
|
50872
50384
|
});
|
|
50873
50385
|
};
|
|
50874
50386
|
var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
|
|
50875
50387
|
var removeFactory = (method) => {
|
|
50876
50388
|
const nodeRm = effectify2(NFS.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
50877
|
-
return (path2,
|
|
50878
|
-
recursive:
|
|
50879
|
-
force:
|
|
50389
|
+
return (path2, options6) => nodeRm(path2, {
|
|
50390
|
+
recursive: options6?.recursive ?? false,
|
|
50391
|
+
force: options6?.force ?? false
|
|
50880
50392
|
});
|
|
50881
50393
|
};
|
|
50882
50394
|
var remove9 = /* @__PURE__ */ removeFactory("remove");
|
|
50883
50395
|
var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
|
|
50884
50396
|
const makeDirectory2 = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectoryScoped");
|
|
50885
50397
|
const removeDirectory = /* @__PURE__ */ removeFactory("makeTempDirectoryScoped");
|
|
50886
|
-
return (
|
|
50398
|
+
return (options6) => acquireRelease2(makeDirectory2(options6), (directory3) => orDie3(removeDirectory(directory3, {
|
|
50887
50399
|
recursive: true
|
|
50888
50400
|
})));
|
|
50889
50401
|
})();
|
|
50890
50402
|
var openFactory = (method) => {
|
|
50891
50403
|
const nodeOpen = effectify2(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
50892
50404
|
const nodeClose = effectify2(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
50893
|
-
return (path2,
|
|
50405
|
+
return (path2, options6) => pipe(acquireRelease2(nodeOpen(path2, options6?.flag ?? "r", options6?.mode), (fd) => orDie3(nodeClose(fd))), map17((fd) => makeFile(FileDescriptor(fd), options6?.flag?.startsWith("a") ?? false)));
|
|
50894
50406
|
};
|
|
50895
50407
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
50896
50408
|
var makeFile = /* @__PURE__ */ (() => {
|
|
@@ -51006,7 +50518,7 @@ var makeTempFileFactory = (method) => {
|
|
|
51006
50518
|
const makeDirectory2 = makeTempDirectoryFactory(method);
|
|
51007
50519
|
const open3 = openFactory(method);
|
|
51008
50520
|
const randomHexString2 = (bytes) => sync3(() => Crypto.randomBytes(bytes).toString("hex"));
|
|
51009
|
-
return (
|
|
50521
|
+
return (options6) => pipe(zip5(makeDirectory2(options6), randomHexString2(6)), map17(([directory3, random4]) => Path3.join(directory3, random4 + (options6?.suffix ?? ""))), tap3((path2) => scoped2(open3(path2, {
|
|
51010
50522
|
flag: "w+"
|
|
51011
50523
|
}))));
|
|
51012
50524
|
};
|
|
@@ -51014,12 +50526,12 @@ var makeTempFile = /* @__PURE__ */ makeTempFileFactory("makeTempFile");
|
|
|
51014
50526
|
var makeTempFileScoped = /* @__PURE__ */ (() => {
|
|
51015
50527
|
const makeFile2 = /* @__PURE__ */ makeTempFileFactory("makeTempFileScoped");
|
|
51016
50528
|
const removeDirectory = /* @__PURE__ */ removeFactory("makeTempFileScoped");
|
|
51017
|
-
return (
|
|
50529
|
+
return (options6) => acquireRelease2(makeFile2(options6), (file6) => orDie3(removeDirectory(Path3.dirname(file6), {
|
|
51018
50530
|
recursive: true
|
|
51019
50531
|
})));
|
|
51020
50532
|
})();
|
|
51021
|
-
var readDirectory = (path2,
|
|
51022
|
-
try: () => NFS.promises.readdir(path2,
|
|
50533
|
+
var readDirectory = (path2, options6) => tryPromise2({
|
|
50534
|
+
try: () => NFS.promises.readdir(path2, options6),
|
|
51023
50535
|
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path2])
|
|
51024
50536
|
});
|
|
51025
50537
|
var readFile2 = (path2) => async((resume2, signal) => {
|
|
@@ -51081,9 +50593,9 @@ var utimes2 = /* @__PURE__ */ (() => {
|
|
|
51081
50593
|
const nodeUtimes = /* @__PURE__ */ effectify2(NFS.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
|
|
51082
50594
|
return (path2, atime, mtime) => nodeUtimes(path2, atime, mtime);
|
|
51083
50595
|
})();
|
|
51084
|
-
var watchNode = (path2,
|
|
50596
|
+
var watchNode = (path2, options6) => asyncScoped2((emit) => acquireRelease2(sync3(() => {
|
|
51085
50597
|
const watcher = NFS.watch(path2, {
|
|
51086
|
-
recursive:
|
|
50598
|
+
recursive: options6?.recursive
|
|
51087
50599
|
}, (event, path3) => {
|
|
51088
50600
|
if (!path3)
|
|
51089
50601
|
return;
|
|
@@ -51121,13 +50633,13 @@ var watchNode = (path2, options8) => asyncScoped2((emit) => acquireRelease2(sync
|
|
|
51121
50633
|
});
|
|
51122
50634
|
return watcher;
|
|
51123
50635
|
}), (watcher) => sync3(() => watcher.close())));
|
|
51124
|
-
var watch2 = (backend, path2,
|
|
51125
|
-
var writeFile2 = (path2, data,
|
|
50636
|
+
var watch2 = (backend, path2, options6) => stat2(path2).pipe(map17((stat3) => backend.pipe(flatMap((_) => _.register(path2, stat3, options6)), getOrElse(() => watchNode(path2, options6)))), unwrap4);
|
|
50637
|
+
var writeFile2 = (path2, data, options6) => async((resume2, signal) => {
|
|
51126
50638
|
try {
|
|
51127
50639
|
NFS.writeFile(path2, data, {
|
|
51128
50640
|
signal,
|
|
51129
|
-
flag:
|
|
51130
|
-
mode:
|
|
50641
|
+
flag: options6?.flag,
|
|
50642
|
+
mode: options6?.mode
|
|
51131
50643
|
}, (err) => {
|
|
51132
50644
|
if (err) {
|
|
51133
50645
|
resume2(fail9(handleErrnoException("FileSystem", "writeFile")(err, [path2])));
|
|
@@ -51162,8 +50674,8 @@ var makeFileSystem = /* @__PURE__ */ map17(/* @__PURE__ */ serviceOption2(WatchB
|
|
|
51162
50674
|
symlink: symlink2,
|
|
51163
50675
|
truncate: truncate2,
|
|
51164
50676
|
utimes: utimes2,
|
|
51165
|
-
watch(path2,
|
|
51166
|
-
return watch2(backend, path2,
|
|
50677
|
+
watch(path2, options6) {
|
|
50678
|
+
return watch2(backend, path2, options6);
|
|
51167
50679
|
},
|
|
51168
50680
|
writeFile: writeFile2
|
|
51169
50681
|
}));
|
|
@@ -51224,7 +50736,7 @@ var layer12 = layer11;
|
|
|
51224
50736
|
// ../../node_modules/.bun/@effect+platform-node-shared@0.59.0+15f69c4693c05b6b/node_modules/@effect/platform-node-shared/dist/esm/internal/terminal.js
|
|
51225
50737
|
import * as readline from "readline";
|
|
51226
50738
|
var defaultShouldQuit = (input) => input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
|
|
51227
|
-
var
|
|
50739
|
+
var make72 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQuit) {
|
|
51228
50740
|
const stdin3 = process.stdin;
|
|
51229
50741
|
const stdout2 = process.stdout;
|
|
51230
50742
|
const rlRef = yield* make45({
|
|
@@ -51250,7 +50762,7 @@ var make73 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
51250
50762
|
const isTTY = sync3(() => Boolean(stdout2.isTTY));
|
|
51251
50763
|
const readInput = gen2(function* () {
|
|
51252
50764
|
yield* get14(rlRef);
|
|
51253
|
-
const mailbox = yield*
|
|
50765
|
+
const mailbox = yield* make68();
|
|
51254
50766
|
const handleKeypress = (s, k) => {
|
|
51255
50767
|
const userInput = {
|
|
51256
50768
|
input: fromNullable(s),
|
|
@@ -51292,7 +50804,7 @@ var make73 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
51292
50804
|
display
|
|
51293
50805
|
});
|
|
51294
50806
|
});
|
|
51295
|
-
var layer13 = /* @__PURE__ */ scoped3(Terminal, /* @__PURE__ */
|
|
50807
|
+
var layer13 = /* @__PURE__ */ scoped3(Terminal, /* @__PURE__ */ make72(defaultShouldQuit));
|
|
51296
50808
|
|
|
51297
50809
|
// ../../node_modules/.bun/@effect+platform-node-shared@0.59.0+15f69c4693c05b6b/node_modules/@effect/platform-node-shared/dist/esm/NodeTerminal.js
|
|
51298
50810
|
var layer14 = layer13;
|
|
@@ -51368,18 +50880,18 @@ var addPrettyLogger = (refs, fiberId3) => {
|
|
|
51368
50880
|
value: loggers.pipe(remove4(defaultLogger2), add4(prettyLoggerDefault2))
|
|
51369
50881
|
});
|
|
51370
50882
|
};
|
|
51371
|
-
var makeRunMain = (f) => dual((args2) => isEffect2(args2[0]), (effect3,
|
|
51372
|
-
const fiber =
|
|
51373
|
-
updateRefs:
|
|
50883
|
+
var makeRunMain = (f) => dual((args2) => isEffect2(args2[0]), (effect3, options6) => {
|
|
50884
|
+
const fiber = options6?.disableErrorReporting === true ? runFork2(effect3, {
|
|
50885
|
+
updateRefs: options6?.disablePrettyLogger === true ? undefined : addPrettyLogger
|
|
51374
50886
|
}) : runFork2(tapErrorCause3(effect3, (cause3) => {
|
|
51375
50887
|
if (isInterruptedOnly2(cause3)) {
|
|
51376
50888
|
return _void;
|
|
51377
50889
|
}
|
|
51378
50890
|
return logError2(cause3);
|
|
51379
50891
|
}), {
|
|
51380
|
-
updateRefs:
|
|
50892
|
+
updateRefs: options6?.disablePrettyLogger === true ? undefined : addPrettyLogger
|
|
51381
50893
|
});
|
|
51382
|
-
const teardown =
|
|
50894
|
+
const teardown = options6?.teardown ?? defaultTeardown;
|
|
51383
50895
|
return f({
|
|
51384
50896
|
fiber,
|
|
51385
50897
|
teardown
|
|
@@ -51420,176 +50932,21 @@ var runMain2 = runMain;
|
|
|
51420
50932
|
|
|
51421
50933
|
// ../../node_modules/.bun/@effect+platform-bun@0.89.0+15f69c4693c05b6b/node_modules/@effect/platform-bun/dist/esm/BunRuntime.js
|
|
51422
50934
|
var runMain3 = runMain2;
|
|
51423
|
-
// src/auth/device-flow.ts
|
|
51424
|
-
import { execFileSync } from "child_process";
|
|
51425
|
-
import { setTimeout as sleep5 } from "timers/promises";
|
|
51426
|
-
|
|
51427
|
-
// src/auth/store.ts
|
|
51428
|
-
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
51429
|
-
import { homedir } from "os";
|
|
51430
|
-
import path2 from "path";
|
|
51431
|
-
var authFileName = "auth.json";
|
|
51432
|
-
|
|
51433
|
-
class AuthCredential extends Class6("AuthCredential")({
|
|
51434
|
-
accessToken: String$,
|
|
51435
|
-
authenticatedAt: String$,
|
|
51436
|
-
authBaseUrl: optional(String$),
|
|
51437
|
-
expiresAt: optional(String$)
|
|
51438
|
-
}) {
|
|
51439
|
-
}
|
|
51440
|
-
var AuthCredentialJson = parseJson(AuthCredential);
|
|
51441
|
-
var decodeAuthCredential = decodeUnknownSync(AuthCredentialJson);
|
|
51442
|
-
var encodeAuthCredential = encodeSync(AuthCredentialJson);
|
|
51443
|
-
var authConfigDirectory = () => process.env.DP_AUTH_CONFIG_HOME ?? path2.join(process.env.XDG_CONFIG_HOME ?? path2.join(homedir(), ".config"), "devpunks");
|
|
51444
|
-
var authConfigPath = () => process.env.DP_AUTH_CONFIG_FILE ?? path2.join(authConfigDirectory(), authFileName);
|
|
51445
|
-
var readAuthCredential = () => {
|
|
51446
|
-
const filePath = authConfigPath();
|
|
51447
|
-
if (!existsSync(filePath)) {
|
|
51448
|
-
return null;
|
|
51449
|
-
}
|
|
51450
|
-
try {
|
|
51451
|
-
return decodeAuthCredential(readFileSync(filePath, "utf8"));
|
|
51452
|
-
} catch {
|
|
51453
|
-
return null;
|
|
51454
|
-
}
|
|
51455
|
-
};
|
|
51456
|
-
var writeAuthCredential = (credential) => {
|
|
51457
|
-
const filePath = authConfigPath();
|
|
51458
|
-
mkdirSync(path2.dirname(filePath), { recursive: true, mode: 448 });
|
|
51459
|
-
writeFileSync(filePath, `${encodeAuthCredential(credential)}
|
|
51460
|
-
`, {
|
|
51461
|
-
encoding: "utf8",
|
|
51462
|
-
mode: 384
|
|
51463
|
-
});
|
|
51464
|
-
};
|
|
51465
|
-
var clearAuthCredential = () => {
|
|
51466
|
-
const filePath = authConfigPath();
|
|
51467
|
-
if (!existsSync(filePath)) {
|
|
51468
|
-
return false;
|
|
51469
|
-
}
|
|
51470
|
-
rmSync(filePath, { force: true });
|
|
51471
|
-
return true;
|
|
51472
|
-
};
|
|
51473
|
-
var controlPlaneBearerToken = () => {
|
|
51474
|
-
const envToken = process.env.DP_CONTROL_PLANE_TOKEN;
|
|
51475
|
-
if (envToken !== undefined && envToken.length > 0) {
|
|
51476
|
-
return envToken;
|
|
51477
|
-
}
|
|
51478
|
-
return readAuthCredential()?.accessToken;
|
|
51479
|
-
};
|
|
51480
|
-
|
|
51481
|
-
// src/auth/device-flow.ts
|
|
51482
|
-
var deviceGrantType = "urn:ietf:params:oauth:grant-type:device_code";
|
|
51483
|
-
var trimTrailingSlash = (value6) => value6.replace(/\/+$/u, "");
|
|
51484
|
-
var authEndpoint = (authBaseUrl, path3) => `${trimTrailingSlash(authBaseUrl)}${path3}`;
|
|
51485
|
-
var readJson = async (response) => {
|
|
51486
|
-
const value6 = await response.json();
|
|
51487
|
-
if (!response.ok) {
|
|
51488
|
-
throw new Error(`Auth request failed with HTTP ${response.status}.`);
|
|
51489
|
-
}
|
|
51490
|
-
return value6;
|
|
51491
|
-
};
|
|
51492
|
-
var readDeviceToken = async (response) => {
|
|
51493
|
-
const value6 = await response.json();
|
|
51494
|
-
if (!response.ok && value6.error === undefined) {
|
|
51495
|
-
throw new Error(`Auth request failed with HTTP ${response.status}.`);
|
|
51496
|
-
}
|
|
51497
|
-
return value6;
|
|
51498
|
-
};
|
|
51499
|
-
var openInBrowser = (url2) => {
|
|
51500
|
-
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
|
|
51501
|
-
const args2 = process.platform === "win32" ? ["/c", "start", "", url2] : [url2];
|
|
51502
|
-
execFileSync(command, args2, { stdio: "ignore" });
|
|
51503
|
-
};
|
|
51504
|
-
var performDeviceLogin = async ({
|
|
51505
|
-
authBaseUrl,
|
|
51506
|
-
clientId,
|
|
51507
|
-
scope: scope5,
|
|
51508
|
-
openBrowser = true,
|
|
51509
|
-
timeoutMs = 5 * 60 * 1000,
|
|
51510
|
-
fetch: fetchImpl = fetch,
|
|
51511
|
-
sleep: sleepImpl = sleep5,
|
|
51512
|
-
openUrl = openInBrowser,
|
|
51513
|
-
now: now2 = () => new Date,
|
|
51514
|
-
onMessage
|
|
51515
|
-
}) => {
|
|
51516
|
-
const code2 = await readJson(await fetchImpl(authEndpoint(authBaseUrl, "/device/code"), {
|
|
51517
|
-
method: "POST",
|
|
51518
|
-
headers: { "content-type": "application/json" },
|
|
51519
|
-
body: JSON.stringify({
|
|
51520
|
-
client_id: clientId,
|
|
51521
|
-
...scope5 === undefined || scope5.length === 0 ? {} : { scope: scope5 }
|
|
51522
|
-
})
|
|
51523
|
-
}));
|
|
51524
|
-
const verificationUrl = code2.verification_uri_complete ?? code2.verification_uri;
|
|
51525
|
-
onMessage?.(`Open ${verificationUrl} and enter code ${code2.user_code}.`);
|
|
51526
|
-
if (openBrowser) {
|
|
51527
|
-
try {
|
|
51528
|
-
openUrl(verificationUrl);
|
|
51529
|
-
} catch {
|
|
51530
|
-
onMessage?.("Could not open the browser automatically. Open the URL above manually.");
|
|
51531
|
-
}
|
|
51532
|
-
}
|
|
51533
|
-
const startedAt = now2().getTime();
|
|
51534
|
-
const authorizationTimeoutMs = code2.expires_in === undefined ? timeoutMs : Math.max(code2.expires_in, 0) * 1000;
|
|
51535
|
-
const deadline = startedAt + authorizationTimeoutMs;
|
|
51536
|
-
let intervalMs = Math.max(code2.interval ?? 5, 1) * 1000;
|
|
51537
|
-
while (now2().getTime() < deadline) {
|
|
51538
|
-
await sleepImpl(intervalMs);
|
|
51539
|
-
const token = await readDeviceToken(await fetchImpl(authEndpoint(authBaseUrl, "/device/token"), {
|
|
51540
|
-
method: "POST",
|
|
51541
|
-
headers: { "content-type": "application/json" },
|
|
51542
|
-
body: JSON.stringify({
|
|
51543
|
-
grant_type: deviceGrantType,
|
|
51544
|
-
device_code: code2.device_code,
|
|
51545
|
-
client_id: clientId
|
|
51546
|
-
})
|
|
51547
|
-
}));
|
|
51548
|
-
if (token.access_token !== undefined && token.access_token.length > 0) {
|
|
51549
|
-
const authenticatedAt = now2();
|
|
51550
|
-
const expiresAt = token.expires_in === undefined ? undefined : new Date(authenticatedAt.getTime() + token.expires_in * 1000).toISOString();
|
|
51551
|
-
return new AuthCredential({
|
|
51552
|
-
accessToken: token.access_token,
|
|
51553
|
-
authenticatedAt: authenticatedAt.toISOString(),
|
|
51554
|
-
authBaseUrl,
|
|
51555
|
-
...expiresAt === undefined ? {} : { expiresAt }
|
|
51556
|
-
});
|
|
51557
|
-
}
|
|
51558
|
-
switch (token.error) {
|
|
51559
|
-
case "authorization_pending":
|
|
51560
|
-
break;
|
|
51561
|
-
case "slow_down":
|
|
51562
|
-
intervalMs += 5000;
|
|
51563
|
-
break;
|
|
51564
|
-
case "access_denied":
|
|
51565
|
-
throw new Error("Device authorization was denied.");
|
|
51566
|
-
case "expired_token":
|
|
51567
|
-
throw new Error("Device authorization expired. Run `punks auth login` again.");
|
|
51568
|
-
default:
|
|
51569
|
-
throw new Error(token.error_description ?? "Device authorization failed.");
|
|
51570
|
-
}
|
|
51571
|
-
}
|
|
51572
|
-
throw new Error("Device authorization timed out.");
|
|
51573
|
-
};
|
|
51574
|
-
|
|
51575
|
-
// src/telemetry/product.ts
|
|
51576
|
-
import { randomUUID } from "crypto";
|
|
51577
|
-
import { execFileSync as execFileSync2 } from "child_process";
|
|
51578
50935
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiClient.js
|
|
51579
50936
|
var exports_HttpApiClient = {};
|
|
51580
50937
|
__export(exports_HttpApiClient, {
|
|
51581
|
-
makeWith: () =>
|
|
51582
|
-
make: () =>
|
|
50938
|
+
makeWith: () => makeWith2,
|
|
50939
|
+
make: () => make74,
|
|
51583
50940
|
group: () => group5,
|
|
51584
50941
|
endpoint: () => endpoint
|
|
51585
50942
|
});
|
|
51586
|
-
var makeClient = (api,
|
|
50943
|
+
var makeClient = (api, options6) => gen2(function* () {
|
|
51587
50944
|
const context8 = yield* context3();
|
|
51588
|
-
const httpClient =
|
|
50945
|
+
const httpClient = options6.httpClient.pipe(options6?.baseUrl === undefined ? identity : mapRequest2(prependUrl2(options6.baseUrl.toString())));
|
|
51589
50946
|
reflect(api, {
|
|
51590
|
-
predicate:
|
|
50947
|
+
predicate: options6?.predicate,
|
|
51591
50948
|
onGroup(onGroupOptions) {
|
|
51592
|
-
|
|
50949
|
+
options6.onGroup?.(onGroupOptions);
|
|
51593
50950
|
},
|
|
51594
50951
|
onEndpoint(onEndpointOptions) {
|
|
51595
50952
|
const {
|
|
@@ -51627,7 +50984,7 @@ var makeClient = (api, options8) => gen2(function* () {
|
|
|
51627
50984
|
const encodeHeaders = endpoint.headersSchema.pipe(map2(encodeUnknown2));
|
|
51628
50985
|
const encodeUrlParams = endpoint.urlParamsSchema.pipe(map2(encodeUnknown2));
|
|
51629
50986
|
const endpointFn = fnUntraced2(function* (request2) {
|
|
51630
|
-
let httpRequest =
|
|
50987
|
+
let httpRequest = make66(endpoint.method)(endpoint.path);
|
|
51631
50988
|
if (request2 && request2.path) {
|
|
51632
50989
|
const encodedPathParams = encodePath._tag === "Some" ? yield* encodePath.value(request2.path) : request2.path;
|
|
51633
50990
|
httpRequest = setUrl2(httpRequest, makeUrl2(encodedPathParams));
|
|
@@ -51650,24 +51007,24 @@ var makeClient = (api, options8) => gen2(function* () {
|
|
|
51650
51007
|
httpRequest = appendUrlParams2(httpRequest, yield* encodeUrlParams.value(request2.urlParams));
|
|
51651
51008
|
}
|
|
51652
51009
|
const response = yield* httpClient.execute(httpRequest);
|
|
51653
|
-
const value6 = yield*
|
|
51010
|
+
const value6 = yield* options6.transformResponse === undefined ? decodeResponse(response) : options6.transformResponse(decodeResponse(response));
|
|
51654
51011
|
return request2?.withResponse === true ? [value6, response] : value6;
|
|
51655
51012
|
}, mapInputContext2((input) => merge3(context8, input)));
|
|
51656
|
-
|
|
51013
|
+
options6.onEndpoint({
|
|
51657
51014
|
...onEndpointOptions,
|
|
51658
51015
|
endpointFn
|
|
51659
51016
|
});
|
|
51660
51017
|
}
|
|
51661
51018
|
});
|
|
51662
51019
|
});
|
|
51663
|
-
var
|
|
51664
|
-
...
|
|
51665
|
-
httpClient:
|
|
51020
|
+
var make74 = (api, options6) => flatMap10(HttpClient, (httpClient) => makeWith2(api, {
|
|
51021
|
+
...options6,
|
|
51022
|
+
httpClient: options6?.transformClient ? options6.transformClient(httpClient) : httpClient
|
|
51666
51023
|
}));
|
|
51667
|
-
var
|
|
51024
|
+
var makeWith2 = (api, options6) => {
|
|
51668
51025
|
const client = {};
|
|
51669
51026
|
return makeClient(api, {
|
|
51670
|
-
...
|
|
51027
|
+
...options6,
|
|
51671
51028
|
onGroup({
|
|
51672
51029
|
group: group5
|
|
51673
51030
|
}) {
|
|
@@ -51684,13 +51041,13 @@ var makeWith3 = (api, options8) => {
|
|
|
51684
51041
|
}
|
|
51685
51042
|
}).pipe(map17(() => client));
|
|
51686
51043
|
};
|
|
51687
|
-
var group5 = (api,
|
|
51044
|
+
var group5 = (api, options6) => {
|
|
51688
51045
|
const client = {};
|
|
51689
51046
|
return makeClient(api, {
|
|
51690
|
-
...
|
|
51047
|
+
...options6,
|
|
51691
51048
|
predicate: ({
|
|
51692
51049
|
group: group6
|
|
51693
|
-
}) => group6.identifier ===
|
|
51050
|
+
}) => group6.identifier === options6.group,
|
|
51694
51051
|
onEndpoint({
|
|
51695
51052
|
endpoint,
|
|
51696
51053
|
endpointFn
|
|
@@ -51699,14 +51056,14 @@ var group5 = (api, options8) => {
|
|
|
51699
51056
|
}
|
|
51700
51057
|
}).pipe(map17(() => client));
|
|
51701
51058
|
};
|
|
51702
|
-
var endpoint = (api,
|
|
51059
|
+
var endpoint = (api, options6) => {
|
|
51703
51060
|
let client = undefined;
|
|
51704
51061
|
return makeClient(api, {
|
|
51705
|
-
...
|
|
51062
|
+
...options6,
|
|
51706
51063
|
predicate: ({
|
|
51707
51064
|
endpoint: endpoint2,
|
|
51708
51065
|
group: group6
|
|
51709
|
-
}) => group6.identifier ===
|
|
51066
|
+
}) => group6.identifier === options6.group && endpoint2.name === options6.endpoint,
|
|
51710
51067
|
onEndpoint({
|
|
51711
51068
|
endpointFn
|
|
51712
51069
|
}) {
|
|
@@ -51715,11 +51072,11 @@ var endpoint = (api, options8) => {
|
|
|
51715
51072
|
}).pipe(map17(() => client));
|
|
51716
51073
|
};
|
|
51717
51074
|
var paramsRegex = /:(\w+)\??/g;
|
|
51718
|
-
var compilePath = (
|
|
51719
|
-
const segments =
|
|
51075
|
+
var compilePath = (path2) => {
|
|
51076
|
+
const segments = path2.split(paramsRegex);
|
|
51720
51077
|
const len = segments.length;
|
|
51721
51078
|
if (len === 1) {
|
|
51722
|
-
return (_) =>
|
|
51079
|
+
return (_) => path2;
|
|
51723
51080
|
}
|
|
51724
51081
|
return (params2) => {
|
|
51725
51082
|
let url2 = segments[0];
|
|
@@ -51818,7 +51175,7 @@ var bodyFromPayload = (ast) => {
|
|
|
51818
51175
|
}
|
|
51819
51176
|
const schema = make53(ast);
|
|
51820
51177
|
const encoding = getEncoding(ast);
|
|
51821
|
-
const
|
|
51178
|
+
const transform5 = transformOrFail(HttpBodyFromSelf, schema, {
|
|
51822
51179
|
decode(fromA, _, ast2) {
|
|
51823
51180
|
return fail10(new Forbidden(ast2, fromA, "encode only schema"));
|
|
51824
51181
|
},
|
|
@@ -51849,27 +51206,27 @@ var bodyFromPayload = (ast) => {
|
|
|
51849
51206
|
}
|
|
51850
51207
|
}
|
|
51851
51208
|
});
|
|
51852
|
-
bodyFromPayloadCache.set(ast,
|
|
51853
|
-
return
|
|
51209
|
+
bodyFromPayloadCache.set(ast, transform5);
|
|
51210
|
+
return transform5;
|
|
51854
51211
|
};
|
|
51855
51212
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiEndpoint.js
|
|
51856
51213
|
var exports_HttpApiEndpoint = {};
|
|
51857
51214
|
__export(exports_HttpApiEndpoint, {
|
|
51858
|
-
put: () =>
|
|
51859
|
-
post: () =>
|
|
51860
|
-
patch: () =>
|
|
51861
|
-
options: () =>
|
|
51862
|
-
make: () =>
|
|
51215
|
+
put: () => put4,
|
|
51216
|
+
post: () => post4,
|
|
51217
|
+
patch: () => patch12,
|
|
51218
|
+
options: () => options6,
|
|
51219
|
+
make: () => make75,
|
|
51863
51220
|
isHttpApiEndpoint: () => isHttpApiEndpoint,
|
|
51864
|
-
head: () =>
|
|
51865
|
-
get: () =>
|
|
51866
|
-
del: () =>
|
|
51867
|
-
TypeId: () =>
|
|
51221
|
+
head: () => head10,
|
|
51222
|
+
get: () => get20,
|
|
51223
|
+
del: () => del4,
|
|
51224
|
+
TypeId: () => TypeId42
|
|
51868
51225
|
});
|
|
51869
|
-
var
|
|
51870
|
-
var isHttpApiEndpoint = (u) => hasProperty(u,
|
|
51226
|
+
var TypeId42 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiEndpoint");
|
|
51227
|
+
var isHttpApiEndpoint = (u) => hasProperty(u, TypeId42);
|
|
51871
51228
|
var Proto9 = {
|
|
51872
|
-
[
|
|
51229
|
+
[TypeId42]: TypeId42,
|
|
51873
51230
|
pipe() {
|
|
51874
51231
|
return pipeArguments(this, arguments);
|
|
51875
51232
|
},
|
|
@@ -51940,8 +51297,8 @@ var Proto9 = {
|
|
|
51940
51297
|
});
|
|
51941
51298
|
}
|
|
51942
51299
|
};
|
|
51943
|
-
var makeProto3 = (
|
|
51944
|
-
var
|
|
51300
|
+
var makeProto3 = (options6) => Object.assign(Object.create(Proto9), options6);
|
|
51301
|
+
var make75 = (method) => (name, ...args2) => {
|
|
51945
51302
|
if (args2.length === 1) {
|
|
51946
51303
|
return makeProto3({
|
|
51947
51304
|
name,
|
|
@@ -51958,7 +51315,7 @@ var make76 = (method) => (name, ...args2) => {
|
|
|
51958
51315
|
});
|
|
51959
51316
|
}
|
|
51960
51317
|
return (segments, ...schemas) => {
|
|
51961
|
-
let
|
|
51318
|
+
let path2 = segments[0].replace(":", "::");
|
|
51962
51319
|
let pathSchema = none2();
|
|
51963
51320
|
if (schemas.length > 0) {
|
|
51964
51321
|
const obj = {};
|
|
@@ -51967,13 +51324,13 @@ var make76 = (method) => (name, ...args2) => {
|
|
|
51967
51324
|
const key = getParam(schema.ast) ?? String(i);
|
|
51968
51325
|
const optional5 = schema.ast._tag === "PropertySignatureTransformation" && schema.ast.from.isOptional || schema.ast._tag === "PropertySignatureDeclaration" && schema.ast.isOptional;
|
|
51969
51326
|
obj[key] = schema;
|
|
51970
|
-
|
|
51327
|
+
path2 += `:${key}${optional5 ? "?" : ""}${segments[i + 1].replace(":", "::")}`;
|
|
51971
51328
|
}
|
|
51972
51329
|
pathSchema = some2(Struct(obj));
|
|
51973
51330
|
}
|
|
51974
51331
|
return makeProto3({
|
|
51975
51332
|
name,
|
|
51976
|
-
path:
|
|
51333
|
+
path: path2,
|
|
51977
51334
|
method,
|
|
51978
51335
|
pathSchema,
|
|
51979
51336
|
urlParamsSchema: none2(),
|
|
@@ -51986,24 +51343,24 @@ var make76 = (method) => (name, ...args2) => {
|
|
|
51986
51343
|
});
|
|
51987
51344
|
};
|
|
51988
51345
|
};
|
|
51989
|
-
var
|
|
51990
|
-
var
|
|
51991
|
-
var
|
|
51992
|
-
var
|
|
51993
|
-
var
|
|
51994
|
-
var
|
|
51995
|
-
var
|
|
51346
|
+
var get20 = /* @__PURE__ */ make75("GET");
|
|
51347
|
+
var post4 = /* @__PURE__ */ make75("POST");
|
|
51348
|
+
var put4 = /* @__PURE__ */ make75("PUT");
|
|
51349
|
+
var patch12 = /* @__PURE__ */ make75("PATCH");
|
|
51350
|
+
var del4 = /* @__PURE__ */ make75("DELETE");
|
|
51351
|
+
var head10 = /* @__PURE__ */ make75("HEAD");
|
|
51352
|
+
var options6 = /* @__PURE__ */ make75("OPTIONS");
|
|
51996
51353
|
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiGroup.js
|
|
51997
51354
|
var exports_HttpApiGroup = {};
|
|
51998
51355
|
__export(exports_HttpApiGroup, {
|
|
51999
|
-
make: () =>
|
|
51356
|
+
make: () => make76,
|
|
52000
51357
|
isHttpApiGroup: () => isHttpApiGroup,
|
|
52001
|
-
TypeId: () =>
|
|
51358
|
+
TypeId: () => TypeId43
|
|
52002
51359
|
});
|
|
52003
|
-
var
|
|
52004
|
-
var isHttpApiGroup = (u) => hasProperty(u,
|
|
51360
|
+
var TypeId43 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiGroup");
|
|
51361
|
+
var isHttpApiGroup = (u) => hasProperty(u, TypeId43);
|
|
52005
51362
|
var Proto10 = {
|
|
52006
|
-
[
|
|
51363
|
+
[TypeId43]: TypeId43,
|
|
52007
51364
|
add(endpoint2) {
|
|
52008
51365
|
return makeProto4({
|
|
52009
51366
|
identifier: this.identifier,
|
|
@@ -52103,62 +51460,23 @@ var Proto10 = {
|
|
|
52103
51460
|
return pipeArguments(this, arguments);
|
|
52104
51461
|
}
|
|
52105
51462
|
};
|
|
52106
|
-
var makeProto4 = (
|
|
51463
|
+
var makeProto4 = (options7) => {
|
|
52107
51464
|
function HttpApiGroup() {}
|
|
52108
51465
|
Object.setPrototypeOf(HttpApiGroup, Proto10);
|
|
52109
|
-
return Object.assign(HttpApiGroup,
|
|
51466
|
+
return Object.assign(HttpApiGroup, options7);
|
|
52110
51467
|
};
|
|
52111
|
-
var
|
|
51468
|
+
var make76 = (identifier2, options7) => makeProto4({
|
|
52112
51469
|
identifier: identifier2,
|
|
52113
|
-
topLevel:
|
|
51470
|
+
topLevel: options7?.topLevel ?? false,
|
|
52114
51471
|
endpoints: empty3(),
|
|
52115
51472
|
errorSchema: Never,
|
|
52116
51473
|
annotations: empty6(),
|
|
52117
51474
|
middlewares: new Set
|
|
52118
51475
|
});
|
|
52119
|
-
// ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiSecurity.js
|
|
52120
|
-
var exports_HttpApiSecurity = {};
|
|
52121
|
-
__export(exports_HttpApiSecurity, {
|
|
52122
|
-
bearer: () => bearer,
|
|
52123
|
-
basic: () => basic,
|
|
52124
|
-
apiKey: () => apiKey,
|
|
52125
|
-
annotateContext: () => annotateContext,
|
|
52126
|
-
annotate: () => annotate3,
|
|
52127
|
-
TypeId: () => TypeId47
|
|
52128
|
-
});
|
|
52129
|
-
var TypeId47 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiSecurity");
|
|
52130
|
-
var Proto11 = {
|
|
52131
|
-
[TypeId47]: TypeId47,
|
|
52132
|
-
pipe() {
|
|
52133
|
-
return pipeArguments(this, arguments);
|
|
52134
|
-
}
|
|
52135
|
-
};
|
|
52136
|
-
var bearer = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Proto11), {
|
|
52137
|
-
_tag: "Bearer",
|
|
52138
|
-
annotations: /* @__PURE__ */ empty6()
|
|
52139
|
-
});
|
|
52140
|
-
var apiKey = (options9) => Object.assign(Object.create(Proto11), {
|
|
52141
|
-
_tag: "ApiKey",
|
|
52142
|
-
key: options9.key,
|
|
52143
|
-
in: options9.in ?? "header",
|
|
52144
|
-
annotations: empty6()
|
|
52145
|
-
});
|
|
52146
|
-
var basic = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Proto11), {
|
|
52147
|
-
_tag: "Basic",
|
|
52148
|
-
annotations: /* @__PURE__ */ empty6()
|
|
52149
|
-
});
|
|
52150
|
-
var annotateContext = /* @__PURE__ */ dual(2, (self, context8) => Object.assign(Object.create(Proto11), {
|
|
52151
|
-
...self,
|
|
52152
|
-
annotations: merge3(self.annotations, context8)
|
|
52153
|
-
}));
|
|
52154
|
-
var annotate3 = /* @__PURE__ */ dual(3, (self, tag6, value6) => Object.assign(Object.create(Proto11), {
|
|
52155
|
-
...self,
|
|
52156
|
-
annotations: add2(self.annotations, tag6, value6)
|
|
52157
|
-
}));
|
|
52158
51476
|
// ../../packages/contract/src/errors.ts
|
|
52159
51477
|
class Unauthorized extends exports_Schema.TaggedError()("@punks/contract/errors/Unauthorized", {
|
|
52160
51478
|
message: exports_Schema.optionalWith(exports_Schema.String, {
|
|
52161
|
-
default: () => "
|
|
51479
|
+
default: () => "Backoffice session is required."
|
|
52162
51480
|
})
|
|
52163
51481
|
}, exports_HttpApiSchema.annotations({ status: 401, title: "Unauthorized" })) {
|
|
52164
51482
|
}
|
|
@@ -52252,7 +51570,35 @@ class OperatorIdentity extends exports_Schema.Class("OperatorIdentity")({
|
|
|
52252
51570
|
emailVerified: exports_Schema.optional(exports_Schema.Boolean)
|
|
52253
51571
|
}) {
|
|
52254
51572
|
}
|
|
52255
|
-
var
|
|
51573
|
+
var BackofficeAccessRole = exports_Schema.Literal("admin", "member");
|
|
51574
|
+
var BackofficeAccessStatus = exports_Schema.Literal("invited", "active", "revoked");
|
|
51575
|
+
|
|
51576
|
+
class BackofficeAccessSummary extends exports_Schema.Class("BackofficeAccessSummary")({
|
|
51577
|
+
email: exports_Schema.String,
|
|
51578
|
+
role: BackofficeAccessRole,
|
|
51579
|
+
status: BackofficeAccessStatus,
|
|
51580
|
+
userId: exports_Schema.optional(exports_Schema.String),
|
|
51581
|
+
invitedBy: exports_Schema.optional(exports_Schema.String),
|
|
51582
|
+
revokedBy: exports_Schema.optional(exports_Schema.String),
|
|
51583
|
+
invitedAt: exports_Schema.optional(exports_Schema.String),
|
|
51584
|
+
activatedAt: exports_Schema.optional(exports_Schema.String),
|
|
51585
|
+
revokedAt: exports_Schema.optional(exports_Schema.String),
|
|
51586
|
+
createdAt: exports_Schema.String,
|
|
51587
|
+
updatedAt: exports_Schema.String
|
|
51588
|
+
}) {
|
|
51589
|
+
}
|
|
51590
|
+
|
|
51591
|
+
class BackofficeAccessList extends exports_Schema.Class("BackofficeAccessList")({
|
|
51592
|
+
users: exports_Schema.Array(BackofficeAccessSummary)
|
|
51593
|
+
}) {
|
|
51594
|
+
}
|
|
51595
|
+
|
|
51596
|
+
class BackofficeAccessInviteRequest extends exports_Schema.Class("BackofficeAccessInviteRequest")({
|
|
51597
|
+
email: exports_Schema.String,
|
|
51598
|
+
role: BackofficeAccessRole
|
|
51599
|
+
}) {
|
|
51600
|
+
}
|
|
51601
|
+
var ProductTelemetryEventName = exports_Schema.Literal("cli.artifact.pull.completed", "cli.scaffold.setup.completed", "cli.scaffold.update.applied", "cli.harness.report.submitted");
|
|
52256
51602
|
var TelemetrySource = exports_Schema.Literal("normal", "local-dev", "ci", "debug", "test");
|
|
52257
51603
|
var isoDateTimePattern = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2})(?:\.(?<fraction>\d{1,9}))?(?:Z|[+-]\d{2}:\d{2})$/u;
|
|
52258
51604
|
var isValidIsoDateTime = (value6) => {
|
|
@@ -52433,33 +51779,20 @@ class BackofficeReportUpdateRequest extends exports_Schema.Class("BackofficeRepo
|
|
|
52433
51779
|
}) {
|
|
52434
51780
|
}
|
|
52435
51781
|
|
|
52436
|
-
// ../../packages/contract/src/security.ts
|
|
52437
|
-
class CurrentOperator extends exports_Context.Tag("@punks/contract/CurrentOperator")() {
|
|
52438
|
-
}
|
|
52439
|
-
|
|
52440
|
-
class CliBearerAuth extends exports_HttpApiMiddleware.Tag()("@punks/contract/CliBearerAuth", {
|
|
52441
|
-
security: {
|
|
52442
|
-
bearer: exports_HttpApiSecurity.bearer
|
|
52443
|
-
},
|
|
52444
|
-
provides: CurrentOperator,
|
|
52445
|
-
failure: Unauthorized
|
|
52446
|
-
}) {
|
|
52447
|
-
}
|
|
52448
|
-
|
|
52449
51782
|
// ../../packages/contract/src/api.ts
|
|
52450
51783
|
class HealthApi extends exports_HttpApiGroup.make("health", { topLevel: true }).add(exports_HttpApiEndpoint.get("healthz")`/healthz`.addSuccess(exports_HttpApiSchema.NoContent.annotations({ description: "Empty health response" }))) {
|
|
52451
51784
|
}
|
|
52452
51785
|
|
|
52453
|
-
class BaselineApi extends exports_HttpApiGroup.make("baseline").add(exports_HttpApiEndpoint.get("resolve")`/${exports_HttpApiSchema.param("channel", BaselineChannel)}`.addSuccess(BaselineResolution).addError(BaselineNotFound).addError(ControlPlaneUnavailable)).add(exports_HttpApiEndpoint.get("artifact")`/${exports_HttpApiSchema.param("channel", BaselineChannel)}/artifacts/${exports_HttpApiSchema.param("kind", ArtifactKind)}`.addSuccess(ArtifactMetadata).addError(BaselineNotFound).addError(ControlPlaneUnavailable)).
|
|
51786
|
+
class BaselineApi extends exports_HttpApiGroup.make("baseline").add(exports_HttpApiEndpoint.get("resolve")`/${exports_HttpApiSchema.param("channel", BaselineChannel)}`.addSuccess(BaselineResolution).addError(BaselineNotFound).addError(ControlPlaneUnavailable)).add(exports_HttpApiEndpoint.get("artifact")`/${exports_HttpApiSchema.param("channel", BaselineChannel)}/artifacts/${exports_HttpApiSchema.param("kind", ArtifactKind)}`.addSuccess(ArtifactMetadata).addError(BaselineNotFound).addError(ControlPlaneUnavailable)).prefix("/baselines").annotateContext(exports_OpenApi.annotations({ title: "Baseline control plane" })) {
|
|
52454
51787
|
}
|
|
52455
51788
|
|
|
52456
|
-
class TelemetryApi extends exports_HttpApiGroup.make("telemetry").add(exports_HttpApiEndpoint.post("record")`/events`.setPayload(ProductTelemetryEventInput).addSuccess(ProductTelemetryEventAccepted).addError(TelemetryEventRejected).addError(TelemetryPersistenceUnavailable)).
|
|
51789
|
+
class TelemetryApi extends exports_HttpApiGroup.make("telemetry").add(exports_HttpApiEndpoint.post("record")`/events`.setPayload(ProductTelemetryEventInput).addSuccess(ProductTelemetryEventAccepted).addError(TelemetryEventRejected).addError(TelemetryPersistenceUnavailable)).prefix("/telemetry").annotateContext(exports_OpenApi.annotations({ title: "Product telemetry" })) {
|
|
52457
51790
|
}
|
|
52458
51791
|
|
|
52459
|
-
class ReportsApi extends exports_HttpApiGroup.make("reports").add(exports_HttpApiEndpoint.post("submit")`/`.setPayload(HarnessReportInput).addSuccess(HarnessReportCreated).addError(HarnessReportRejected).addError(HarnessReportPersistenceUnavailable)).
|
|
51792
|
+
class ReportsApi extends exports_HttpApiGroup.make("reports").add(exports_HttpApiEndpoint.post("submit")`/`.setPayload(HarnessReportInput).addSuccess(HarnessReportCreated).addError(HarnessReportRejected).addError(HarnessReportPersistenceUnavailable)).prefix("/reports").annotateContext(exports_OpenApi.annotations({ title: "Harness reports" })) {
|
|
52460
51793
|
}
|
|
52461
51794
|
|
|
52462
|
-
class BackofficeApi extends exports_HttpApiGroup.make("backoffice").add(exports_HttpApiEndpoint.get("projectUsageList")`/project-usages`.addSuccess(ProjectUsageList).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("projectUsageDetail")`/project-usages/${exports_HttpApiSchema.param("projectUsageId", exports_Schema.String)}`.addSuccess(ProjectUsageDetail).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("mapRepository")`/project-usages/${exports_HttpApiSchema.param("projectUsageId", exports_Schema.String)}/repositories`.setPayload(BackofficeRepositoryMappingRequest).addSuccess(ObservedRepositorySummary).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.patch("updateReport")`/reports/${exports_HttpApiSchema.param("reportId", exports_Schema.String)}`.setPayload(BackofficeReportUpdateRequest).addSuccess(HarnessReportSummary).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).
|
|
51795
|
+
class BackofficeApi extends exports_HttpApiGroup.make("backoffice").add(exports_HttpApiEndpoint.get("currentAccess")`/access/current`.addSuccess(BackofficeAccessSummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("accessList")`/access-users`.addSuccess(BackofficeAccessList).addError(Unauthorized).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("inviteAccess")`/access-users`.setPayload(BackofficeAccessInviteRequest).addSuccess(BackofficeAccessSummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("revokeAccess")`/access-users/${exports_HttpApiSchema.param("email", exports_Schema.String)}/revoke`.addSuccess(BackofficeAccessSummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("projectUsageList")`/project-usages`.addSuccess(ProjectUsageList).addError(Unauthorized).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("projectUsageDetail")`/project-usages/${exports_HttpApiSchema.param("projectUsageId", exports_Schema.String)}`.addSuccess(ProjectUsageDetail).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("mapRepository")`/project-usages/${exports_HttpApiSchema.param("projectUsageId", exports_Schema.String)}/repositories`.setPayload(BackofficeRepositoryMappingRequest).addSuccess(ObservedRepositorySummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.patch("updateReport")`/reports/${exports_HttpApiSchema.param("reportId", exports_Schema.String)}`.setPayload(BackofficeReportUpdateRequest).addSuccess(HarnessReportSummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).prefix("/backoffice").annotateContext(exports_OpenApi.annotations({ title: "Backoffice project usage" })) {
|
|
52463
51796
|
}
|
|
52464
51797
|
|
|
52465
51798
|
class HarnessApi extends exports_HttpApi.make("harness").add(HealthApi).add(BaselineApi).add(TelemetryApi).add(ReportsApi).add(BackofficeApi).addError(Forbidden2).prefix("/api").annotateContext(exports_OpenApi.annotations({
|
|
@@ -52468,46 +51801,46 @@ class HarnessApi extends exports_HttpApi.make("harness").add(HealthApi).add(Base
|
|
|
52468
51801
|
})) {
|
|
52469
51802
|
}
|
|
52470
51803
|
// ../../packages/contract/src/client.ts
|
|
52471
|
-
var makeHarnessClient = ({ baseUrl: baseUrl2
|
|
52472
|
-
baseUrl: baseUrl2
|
|
52473
|
-
transformClient: bearerToken3 === undefined || bearerToken3.length === 0 ? undefined : exports_HttpClient.mapRequest(exports_HttpClientRequest.bearerToken(exports_Redacted.make(bearerToken3)))
|
|
51804
|
+
var makeHarnessClient = ({ baseUrl: baseUrl2 }) => exports_HttpApiClient.make(HarnessApi, {
|
|
51805
|
+
baseUrl: baseUrl2
|
|
52474
51806
|
}).pipe(exports_Effect.provide(exports_FetchHttpClient.layer));
|
|
52475
51807
|
// src/control-plane/client.ts
|
|
52476
|
-
var resolveStableBaselineMetadata = (
|
|
51808
|
+
var resolveStableBaselineMetadata = (options7) => exports_Effect.gen(function* () {
|
|
52477
51809
|
const client2 = yield* makeHarnessClient({
|
|
52478
|
-
baseUrl:
|
|
52479
|
-
bearerToken: options9.bearerToken
|
|
51810
|
+
baseUrl: options7.baseUrl
|
|
52480
51811
|
});
|
|
52481
51812
|
return yield* client2.baseline.resolve({
|
|
52482
51813
|
path: { channel: "stable" }
|
|
52483
51814
|
});
|
|
52484
51815
|
});
|
|
52485
|
-
var recordProductTelemetryEvent = (
|
|
51816
|
+
var recordProductTelemetryEvent = (options7) => exports_Effect.gen(function* () {
|
|
52486
51817
|
const client2 = yield* makeHarnessClient({
|
|
52487
|
-
baseUrl:
|
|
52488
|
-
bearerToken: options9.bearerToken
|
|
51818
|
+
baseUrl: options7.baseUrl
|
|
52489
51819
|
});
|
|
52490
51820
|
return yield* client2.telemetry.record({
|
|
52491
|
-
payload:
|
|
51821
|
+
payload: options7.event
|
|
52492
51822
|
});
|
|
52493
51823
|
});
|
|
52494
|
-
var submitHarnessReport = (
|
|
51824
|
+
var submitHarnessReport = (options7) => exports_Effect.gen(function* () {
|
|
52495
51825
|
const client2 = yield* makeHarnessClient({
|
|
52496
|
-
baseUrl:
|
|
52497
|
-
bearerToken: options9.bearerToken
|
|
51826
|
+
baseUrl: options7.baseUrl
|
|
52498
51827
|
});
|
|
52499
51828
|
return yield* client2.reports.submit({
|
|
52500
|
-
payload:
|
|
51829
|
+
payload: options7.report
|
|
52501
51830
|
});
|
|
52502
51831
|
});
|
|
52503
51832
|
|
|
51833
|
+
// src/telemetry/product.ts
|
|
51834
|
+
import { randomUUID } from "crypto";
|
|
51835
|
+
import { execFileSync } from "child_process";
|
|
51836
|
+
|
|
52504
51837
|
// package.json
|
|
52505
51838
|
var name = "@punks/cli";
|
|
52506
|
-
var version = "2.
|
|
51839
|
+
var version = "2.1.1";
|
|
52507
51840
|
// src/telemetry/product.ts
|
|
52508
51841
|
var git = (cwd, args2) => {
|
|
52509
51842
|
try {
|
|
52510
|
-
return
|
|
51843
|
+
return execFileSync("git", args2, {
|
|
52511
51844
|
cwd,
|
|
52512
51845
|
encoding: "utf8",
|
|
52513
51846
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -52602,7 +51935,6 @@ var submitProductTelemetryEffect = (event) => {
|
|
|
52602
51935
|
}
|
|
52603
51936
|
return recordProductTelemetryEvent({
|
|
52604
51937
|
baseUrl: baseUrl2,
|
|
52605
|
-
bearerToken: controlPlaneBearerToken(),
|
|
52606
51938
|
event
|
|
52607
51939
|
}).pipe(exports_Effect.asVoid, exports_Effect.catchAll(() => exports_Effect.void));
|
|
52608
51940
|
};
|
|
@@ -52610,14 +51942,14 @@ var telemetryTransportEnabled = () => process.env.DP_CONTROL_PLANE_URL !== undef
|
|
|
52610
51942
|
var submitProductTelemetry = (event) => {
|
|
52611
51943
|
exports_Effect.runPromise(submitProductTelemetryEffect(event));
|
|
52612
51944
|
};
|
|
52613
|
-
var makeCliEvent = (name2,
|
|
51945
|
+
var makeCliEvent = (name2, options7 = {}) => makeProductTelemetryEvent({
|
|
52614
51946
|
name: name2,
|
|
52615
|
-
cwd:
|
|
52616
|
-
baseline:
|
|
51947
|
+
cwd: options7.cwd ?? process.cwd(),
|
|
51948
|
+
baseline: options7.baseline
|
|
52617
51949
|
});
|
|
52618
|
-
var submitCliEvent = (name2,
|
|
51950
|
+
var submitCliEvent = (name2, options7 = {}) => {
|
|
52619
51951
|
if (telemetryTransportEnabled()) {
|
|
52620
|
-
submitProductTelemetry(makeCliEvent(name2,
|
|
51952
|
+
submitProductTelemetry(makeCliEvent(name2, options7));
|
|
52621
51953
|
}
|
|
52622
51954
|
};
|
|
52623
51955
|
|
|
@@ -52760,23 +52092,24 @@ var renderCommandGuide = () => [
|
|
|
52760
52092
|
title: "Available commands",
|
|
52761
52093
|
body: [
|
|
52762
52094
|
"commands:",
|
|
52763
|
-
" \u203A punks
|
|
52764
|
-
" \u2514
|
|
52095
|
+
" \u203A punks report",
|
|
52096
|
+
" \u2514 submit structured Harness friction for maintainer triage",
|
|
52765
52097
|
" \u203A punks scaffold",
|
|
52766
|
-
" \u2514 show the scaffold lifecycle index and available setup
|
|
52098
|
+
" \u2514 show the scaffold lifecycle index and available setup commands",
|
|
52767
52099
|
" \u203A punks update",
|
|
52768
52100
|
" \u2514 refresh managed scaffold assets from `.devpunks/scaffold-manifest.json`",
|
|
52769
52101
|
"",
|
|
52770
52102
|
"usage:",
|
|
52103
|
+
" \u2022 agents should activate `$dp-cli` before acting on `.devpunks` output",
|
|
52771
52104
|
" \u2022 start with `punks scaffold` to inspect the lifecycle",
|
|
52772
52105
|
" \u2022 use `punks scaffold init` for requirements grilling, backlog authoring, and wiki schema seeding",
|
|
52773
|
-
" \u2022
|
|
52774
|
-
" \u2022 use `punks scaffold setup` after repo boilerplate is ready",
|
|
52106
|
+
" \u2022 reconcile the seeded wiki into the real repo layout before writing durable docs",
|
|
52107
|
+
" \u2022 use `punks scaffold setup` for repo-aware pack detection after repo boilerplate is ready",
|
|
52775
52108
|
" \u2022 use `punks update` after setup to pull newer scaffolded skills/prompts/manifests/hooks",
|
|
52776
|
-
" \u2022 use `punks
|
|
52109
|
+
" \u2022 use `punks report` when reusable Harness friction should enter the support loop",
|
|
52777
52110
|
"",
|
|
52778
52111
|
"operator notes:",
|
|
52779
|
-
" \u2022
|
|
52112
|
+
" \u2022 init copies only requirements/backlog skills and the initial wiki structure",
|
|
52780
52113
|
" \u2022 `setup` remains the repo-aware pack-driven scaffold flow",
|
|
52781
52114
|
" \u2022 each command prints an operator-facing next-step prompt"
|
|
52782
52115
|
].join(`
|
|
@@ -52796,9 +52129,11 @@ var renderStageIntro = ({
|
|
|
52796
52129
|
body,
|
|
52797
52130
|
"",
|
|
52798
52131
|
"usage:",
|
|
52799
|
-
|
|
52132
|
+
" \u2022 agents should activate `$dp-cli` before following generated output",
|
|
52133
|
+
" \u2022 use this to scaffold requirements grill/backlog skills and seed the initial wiki tree",
|
|
52134
|
+
" \u2022 reconcile the wiki into the real repo layout, such as `apps/wiki` in a monorepo",
|
|
52800
52135
|
" \u2022 rerunning this command overwrites only the files for this stage",
|
|
52801
|
-
" \u2022 read the generated prompt/output and follow it before
|
|
52136
|
+
" \u2022 read the generated prompt/output and follow it before running repo-aware setup"
|
|
52802
52137
|
].join(`
|
|
52803
52138
|
`)
|
|
52804
52139
|
});
|
|
@@ -52809,8 +52144,10 @@ var renderSetupIntro = () => renderCommandIntro({
|
|
|
52809
52144
|
"Detect repo stack, resolve scaffold packs, and prepare prompt/manifest output.",
|
|
52810
52145
|
"",
|
|
52811
52146
|
"usage:",
|
|
52147
|
+
" \u2022 agents should activate `$dp-cli` before following `.devpunks` handoff artifacts",
|
|
52812
52148
|
" \u2022 run this from the outer repo root so docs/wiki and nested app/package workspaces stay in one scan",
|
|
52813
52149
|
" \u2022 review detected manifests, technologies, and packs before confirming",
|
|
52150
|
+
" \u2022 reconcile generic scaffold output with the real repo layout before committing final guidance",
|
|
52814
52151
|
" \u2022 if detection looks incomplete or suspicious, answer `n` and edit the pack selection before accepting",
|
|
52815
52152
|
" \u2022 after scaffold completes, use the generated next-agent prompt instead of relying on the terminal summary alone"
|
|
52816
52153
|
].join(`
|
|
@@ -52828,15 +52165,15 @@ var renderScaffoldGuide = () => [
|
|
|
52828
52165
|
"commands:",
|
|
52829
52166
|
" \u203A punks scaffold init",
|
|
52830
52167
|
" \u2514 requirements gate: scaffold `requirements-grill`, `write-backlog`, and seed the wiki tree",
|
|
52831
|
-
" \u203A punks scaffold backlog",
|
|
52832
|
-
" \u2514 backlog gate: no scaffolded packs right now; print the operator handoff",
|
|
52833
52168
|
" \u203A punks scaffold setup",
|
|
52834
52169
|
" \u2514 repo-aware setup: detect packs, scaffold prompts/manifests/hooks",
|
|
52835
52170
|
"",
|
|
52836
52171
|
"operator notes:",
|
|
52837
|
-
" \u2022
|
|
52172
|
+
" \u2022 agents should activate `$dp-cli` before acting on generated scaffold output",
|
|
52173
|
+
" \u2022 `init` overwrites only its scaffolded skill files on rerun",
|
|
52174
|
+
" \u2022 `init` seeds a wiki root that agents must reconcile with the real repo layout",
|
|
52838
52175
|
" \u2022 `setup` is the first repo-aware command in the lifecycle",
|
|
52839
|
-
" \u2022
|
|
52176
|
+
" \u2022 setup output must be followed from `.devpunks`, not summarized from terminal text alone"
|
|
52840
52177
|
].join(`
|
|
52841
52178
|
`)
|
|
52842
52179
|
})
|
|
@@ -52879,79 +52216,6 @@ var renderQuestion = (value6) => [paint(`${brandPalette.bold}${brandPalette.gree
|
|
|
52879
52216
|
var renderJsonLabel = () => paint(`${brandPalette.bold}${brandPalette.lilac}`, "Resolved JSON payload");
|
|
52880
52217
|
var renderDivider = () => paint(`${brandPalette.dim}${brandPalette.border}`, "\u2500".repeat(sectionWidth));
|
|
52881
52218
|
|
|
52882
|
-
// src/cli/auth-command.ts
|
|
52883
|
-
var tokenOption = exports_Options.optional(exports_Options.text("token").pipe(exports_Options.withDescription("Store an existing bearer token instead of starting device login.")));
|
|
52884
|
-
var authUrlOption = exports_Options.optional(exports_Options.text("auth-url").pipe(exports_Options.withDescription("Better Auth base URL. Defaults to DP_AUTH_URL.")));
|
|
52885
|
-
var clientIdOption = exports_Options.text("client-id").pipe(exports_Options.withDefault("devpunks-cli"), exports_Options.withDescription("OAuth device-flow client id."));
|
|
52886
|
-
var scopeOption = exports_Options.optional(exports_Options.text("scope").pipe(exports_Options.withDescription("Optional OAuth scopes for Better Auth device login.")));
|
|
52887
|
-
var noOpenOption = exports_Options.boolean("no-open").pipe(exports_Options.withDescription("Print the verification URL without opening a browser."));
|
|
52888
|
-
var nonEmptyText = (value6) => {
|
|
52889
|
-
const trimmed2 = value6?.trim();
|
|
52890
|
-
return trimmed2 === undefined || trimmed2.length === 0 ? null : trimmed2;
|
|
52891
|
-
};
|
|
52892
|
-
var authBaseUrl = (authUrl) => nonEmptyText(getOrUndefined(authUrl)) ?? nonEmptyText(process.env.DP_AUTH_URL);
|
|
52893
|
-
var authToken = (token) => nonEmptyText(getOrUndefined(token));
|
|
52894
|
-
var loginCommand = exports_Command.make("login", {
|
|
52895
|
-
token: tokenOption,
|
|
52896
|
-
authUrl: authUrlOption,
|
|
52897
|
-
clientId: clientIdOption,
|
|
52898
|
-
scope: scopeOption,
|
|
52899
|
-
noOpen: noOpenOption
|
|
52900
|
-
}, ({ token, authUrl, clientId, scope: scope5, noOpen }) => exports_Effect.gen(function* () {
|
|
52901
|
-
const configuredAuthBaseUrl = authBaseUrl(authUrl);
|
|
52902
|
-
const configuredToken = authToken(token);
|
|
52903
|
-
if (isSome2(token) && configuredToken === null) {
|
|
52904
|
-
return yield* exports_Effect.fail(new Error("Missing token. Pass a non-empty `--token` value or use device login."));
|
|
52905
|
-
}
|
|
52906
|
-
const credential = configuredToken !== null ? new AuthCredential({
|
|
52907
|
-
accessToken: configuredToken,
|
|
52908
|
-
authenticatedAt: new Date().toISOString(),
|
|
52909
|
-
...configuredAuthBaseUrl === null ? {} : { authBaseUrl: configuredAuthBaseUrl }
|
|
52910
|
-
}) : yield* exports_Effect.tryPromise({
|
|
52911
|
-
try: () => {
|
|
52912
|
-
if (configuredAuthBaseUrl === null) {
|
|
52913
|
-
throw new Error("Missing auth URL. Pass `--auth-url`, set `DP_AUTH_URL`, or use `--token` for local development.");
|
|
52914
|
-
}
|
|
52915
|
-
return performDeviceLogin({
|
|
52916
|
-
authBaseUrl: configuredAuthBaseUrl,
|
|
52917
|
-
clientId,
|
|
52918
|
-
scope: getOrUndefined(scope5),
|
|
52919
|
-
openBrowser: !noOpen,
|
|
52920
|
-
onMessage: (message) => console.log(renderHint(message))
|
|
52921
|
-
});
|
|
52922
|
-
},
|
|
52923
|
-
catch: (cause3) => cause3 instanceof Error ? cause3 : new Error("Auth login failed.")
|
|
52924
|
-
});
|
|
52925
|
-
writeAuthCredential(credential);
|
|
52926
|
-
submitCliEvent("cli.auth.login.completed");
|
|
52927
|
-
console.log(renderCommandSection("Auth", [
|
|
52928
|
-
"Authenticated CLI credential stored.",
|
|
52929
|
-
`Credential file: ${authConfigPath()}`,
|
|
52930
|
-
credential.authBaseUrl === undefined ? null : `Auth URL: ${credential.authBaseUrl}`
|
|
52931
|
-
].filter((line4) => line4 !== null).join(`
|
|
52932
|
-
`)));
|
|
52933
|
-
})).pipe(exports_Command.withDescription("Authenticate the CLI for internal baseline access."));
|
|
52934
|
-
var statusCommand = exports_Command.make("status", {}, () => exports_Effect.sync(() => {
|
|
52935
|
-
const envToken = process.env.DP_CONTROL_PLANE_TOKEN;
|
|
52936
|
-
if (envToken !== undefined && envToken.length > 0) {
|
|
52937
|
-
console.log(renderCommandSection("Auth", "Authenticated via DP_CONTROL_PLANE_TOKEN."));
|
|
52938
|
-
return;
|
|
52939
|
-
}
|
|
52940
|
-
const credential = readAuthCredential();
|
|
52941
|
-
console.log(renderCommandSection("Auth", credential === null ? "Not authenticated." : [
|
|
52942
|
-
"Authenticated.",
|
|
52943
|
-
`Credential file: ${authConfigPath()}`,
|
|
52944
|
-
`Authenticated at: ${credential.authenticatedAt}`,
|
|
52945
|
-
credential.expiresAt === undefined ? null : `Expires at: ${credential.expiresAt}`
|
|
52946
|
-
].filter((line4) => line4 !== null).join(`
|
|
52947
|
-
`)));
|
|
52948
|
-
})).pipe(exports_Command.withDescription("Show CLI authentication status."));
|
|
52949
|
-
var logoutCommand = exports_Command.make("logout", {}, () => exports_Effect.sync(() => {
|
|
52950
|
-
const cleared = clearAuthCredential();
|
|
52951
|
-
console.log(renderCommandSection("Auth", cleared ? "Stored CLI credential cleared." : "No stored CLI credential found."));
|
|
52952
|
-
})).pipe(exports_Command.withDescription("Clear stored CLI authentication."));
|
|
52953
|
-
var authCommand = exports_Command.make("auth", {}, () => exports_Effect.sync(() => console.log(renderCommandSection("Auth", "Use auth subcommands to manage CLI credentials.")))).pipe(exports_Command.withDescription("Authenticate the CLI for internal Harness Intelligence resources."), exports_Command.withSubcommands([loginCommand, statusCommand, logoutCommand]));
|
|
52954
|
-
|
|
52955
52219
|
// src/cli/report-command.ts
|
|
52956
52220
|
var titleOption = exports_Options.text("title").pipe(exports_Options.withDescription("Short harness friction report title."));
|
|
52957
52221
|
var bodyOption = exports_Options.text("body").pipe(exports_Options.withDescription("Report body with the observed friction and expected behavior."));
|
|
@@ -53017,7 +52281,6 @@ var reportCommand = exports_Command.make("report", {
|
|
|
53017
52281
|
});
|
|
53018
52282
|
const response = await exports_Effect.runPromise(submitHarnessReport({
|
|
53019
52283
|
baseUrl: requiredControlPlaneUrl(),
|
|
53020
|
-
bearerToken: controlPlaneBearerToken(),
|
|
53021
52284
|
report
|
|
53022
52285
|
}));
|
|
53023
52286
|
submitCliEvent("cli.harness.report.submitted", { cwd: repoRoot });
|
|
@@ -53034,52 +52297,52 @@ var reportCommand = exports_Command.make("report", {
|
|
|
53034
52297
|
`)));
|
|
53035
52298
|
},
|
|
53036
52299
|
catch: (cause3) => cause3 instanceof Error ? cause3 : new Error("Harness report submission failed.")
|
|
53037
|
-
})).pipe(exports_Command.withDescription("Submit structured Harness
|
|
52300
|
+
})).pipe(exports_Command.withDescription("Submit structured Harness friction for maintainer triage. Agents: use after $dp-cli evidence gathering."));
|
|
53038
52301
|
|
|
53039
52302
|
// src/cli/scaffold-command.ts
|
|
53040
|
-
import
|
|
52303
|
+
import path12 from "path";
|
|
53041
52304
|
|
|
53042
52305
|
// src/baseline/resolve.ts
|
|
53043
52306
|
import { createHash } from "crypto";
|
|
53044
|
-
import { execFileSync as
|
|
53045
|
-
import { existsSync as
|
|
52307
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
52308
|
+
import { existsSync as existsSync2, mkdirSync, mkdtempSync, readFileSync as readFileSync3, rmSync, writeFileSync } from "fs";
|
|
53046
52309
|
import { tmpdir as tmpdir2 } from "os";
|
|
53047
|
-
import
|
|
52310
|
+
import path5 from "path";
|
|
53048
52311
|
|
|
53049
52312
|
// src/baseline/bundled.ts
|
|
53050
|
-
import
|
|
52313
|
+
import path3 from "path";
|
|
53051
52314
|
|
|
53052
52315
|
// src/content/data.ts
|
|
53053
|
-
import { existsSync
|
|
53054
|
-
import
|
|
53055
|
-
var findFirst8 = (candidates) => candidates.find((candidate) =>
|
|
52316
|
+
import { existsSync, readFileSync } from "fs";
|
|
52317
|
+
import path2 from "path";
|
|
52318
|
+
var findFirst8 = (candidates) => candidates.find((candidate) => existsSync(candidate));
|
|
53056
52319
|
var findBundledPackageRoot = () => {
|
|
53057
|
-
let currentDirectory =
|
|
52320
|
+
let currentDirectory = path2.resolve(import.meta.dirname, "../..");
|
|
53058
52321
|
while (true) {
|
|
53059
|
-
if (
|
|
52322
|
+
if (existsSync(path2.join(currentDirectory, "package.json"))) {
|
|
53060
52323
|
return currentDirectory;
|
|
53061
52324
|
}
|
|
53062
|
-
const parentDirectory =
|
|
52325
|
+
const parentDirectory = path2.dirname(currentDirectory);
|
|
53063
52326
|
if (parentDirectory === currentDirectory) {
|
|
53064
52327
|
break;
|
|
53065
52328
|
}
|
|
53066
52329
|
currentDirectory = parentDirectory;
|
|
53067
52330
|
}
|
|
53068
|
-
return
|
|
52331
|
+
return path2.resolve(import.meta.dirname, "../..");
|
|
53069
52332
|
};
|
|
53070
52333
|
var packageRoot = findBundledPackageRoot();
|
|
53071
52334
|
var runtimeRoot = import.meta.dirname;
|
|
53072
52335
|
var dataCandidates = [
|
|
53073
|
-
|
|
53074
|
-
|
|
53075
|
-
|
|
53076
|
-
|
|
52336
|
+
path2.join(runtimeRoot, "data"),
|
|
52337
|
+
path2.resolve(import.meta.dirname, "../data"),
|
|
52338
|
+
path2.join(packageRoot, "src/data"),
|
|
52339
|
+
path2.resolve(import.meta.dirname, "../../src/data")
|
|
53077
52340
|
];
|
|
53078
52341
|
var skillCandidates = [
|
|
53079
|
-
|
|
53080
|
-
|
|
53081
|
-
|
|
53082
|
-
|
|
52342
|
+
path2.join(runtimeRoot, "skills"),
|
|
52343
|
+
path2.join(packageRoot, "skills"),
|
|
52344
|
+
path2.resolve(import.meta.dirname, "../../skills"),
|
|
52345
|
+
path2.resolve(import.meta.dirname, "../skills")
|
|
53083
52346
|
];
|
|
53084
52347
|
var resolvedDataRoot = findFirst8(dataCandidates);
|
|
53085
52348
|
var resolvedSkillsRoot = findFirst8(skillCandidates);
|
|
@@ -53091,18 +52354,18 @@ if (resolvedSkillsRoot === undefined) {
|
|
|
53091
52354
|
}
|
|
53092
52355
|
var dataRoot = resolvedDataRoot;
|
|
53093
52356
|
var skillsRoot = resolvedSkillsRoot;
|
|
53094
|
-
var dataPath = (...segments) =>
|
|
53095
|
-
var readDataFile = (...segments) =>
|
|
53096
|
-
var readBaselineDataFile = (baselineDataRoot, ...segments) =>
|
|
52357
|
+
var dataPath = (...segments) => path2.join(dataRoot, ...segments);
|
|
52358
|
+
var readDataFile = (...segments) => readFileSync(dataPath(...segments), "utf8");
|
|
52359
|
+
var readBaselineDataFile = (baselineDataRoot, ...segments) => readFileSync(path2.join(baselineDataRoot, ...segments), "utf8");
|
|
53097
52360
|
var resolveBaselinePath = ({
|
|
53098
52361
|
baselineRoot,
|
|
53099
52362
|
baselineSkillsRoot,
|
|
53100
52363
|
relativePath
|
|
53101
52364
|
}) => {
|
|
53102
52365
|
const resolvedPath = relativePath.startsWith("skills/") ? findFirst8([
|
|
53103
|
-
|
|
53104
|
-
|
|
53105
|
-
]) : findFirst8([
|
|
52366
|
+
path2.join(baselineSkillsRoot, relativePath.slice("skills/".length)),
|
|
52367
|
+
path2.join(baselineRoot, relativePath)
|
|
52368
|
+
]) : findFirst8([path2.join(baselineRoot, relativePath)]);
|
|
53106
52369
|
if (resolvedPath !== undefined) {
|
|
53107
52370
|
return resolvedPath;
|
|
53108
52371
|
}
|
|
@@ -54109,7 +53372,7 @@ var bundledBaseline = {
|
|
|
54109
53372
|
commit: null,
|
|
54110
53373
|
sha256: null
|
|
54111
53374
|
},
|
|
54112
|
-
root:
|
|
53375
|
+
root: path3.dirname(dataRoot),
|
|
54113
53376
|
dataRoot,
|
|
54114
53377
|
skillsRoot,
|
|
54115
53378
|
packs: packCatalog,
|
|
@@ -54120,12 +53383,12 @@ var bundledBaseline = {
|
|
|
54120
53383
|
};
|
|
54121
53384
|
|
|
54122
53385
|
// src/baseline/load.ts
|
|
54123
|
-
import { readFileSync as
|
|
54124
|
-
import
|
|
54125
|
-
var
|
|
53386
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
53387
|
+
import path4 from "path";
|
|
53388
|
+
var readJson = (filePath) => JSON.parse(readFileSync2(filePath, "utf8"));
|
|
54126
53389
|
var loadBaselineFromDirectory = (root, source) => {
|
|
54127
|
-
const metadata =
|
|
54128
|
-
const dataRoot2 =
|
|
53390
|
+
const metadata = readJson(path4.join(root, "baseline.json"));
|
|
53391
|
+
const dataRoot2 = path4.join(root, "data");
|
|
54129
53392
|
return {
|
|
54130
53393
|
summary: {
|
|
54131
53394
|
source,
|
|
@@ -54137,12 +53400,12 @@ var loadBaselineFromDirectory = (root, source) => {
|
|
|
54137
53400
|
},
|
|
54138
53401
|
root,
|
|
54139
53402
|
dataRoot: dataRoot2,
|
|
54140
|
-
skillsRoot:
|
|
54141
|
-
packs:
|
|
54142
|
-
skills:
|
|
54143
|
-
tools:
|
|
54144
|
-
hooks:
|
|
54145
|
-
lintAssets: validateLintCatalog(
|
|
53403
|
+
skillsRoot: path4.join(root, "skills"),
|
|
53404
|
+
packs: readJson(path4.join(dataRoot2, "catalog", "packs.json")),
|
|
53405
|
+
skills: readJson(path4.join(dataRoot2, "catalog", "skills.json")),
|
|
53406
|
+
tools: readJson(path4.join(dataRoot2, "catalog", "tools.json")),
|
|
53407
|
+
hooks: readJson(path4.join(dataRoot2, "catalog", "hooks.json")),
|
|
53408
|
+
lintAssets: validateLintCatalog(readJson(path4.join(dataRoot2, "catalog", "lint-assets.json")))
|
|
54146
53409
|
};
|
|
54147
53410
|
};
|
|
54148
53411
|
|
|
@@ -54150,9 +53413,9 @@ var loadBaselineFromDirectory = (root, source) => {
|
|
|
54150
53413
|
var repoReleasesUrl = "https://api.github.com/repos/wearedevpunks/harness-intelligence/releases?per_page=30";
|
|
54151
53414
|
var assetManifestName = "scaffold-baseline.json";
|
|
54152
53415
|
var assetArchiveName = "scaffold-baseline.tgz";
|
|
54153
|
-
var cacheRoot = () =>
|
|
54154
|
-
var sha256File = (filePath) => createHash("sha256").update(
|
|
54155
|
-
var isSafeTarPath = (entry) => entry.length > 0 && !
|
|
53416
|
+
var cacheRoot = () => path5.join(process.env.XDG_CACHE_HOME ?? path5.join(process.env.HOME ?? tmpdir2(), ".cache"), "devpunks", "baselines");
|
|
53417
|
+
var sha256File = (filePath) => createHash("sha256").update(readFileSync3(filePath)).digest("hex");
|
|
53418
|
+
var isSafeTarPath = (entry) => entry.length > 0 && !path5.isAbsolute(entry) && !entry.split("/").includes("..");
|
|
54156
53419
|
var isBaselineReleaseTag = (tag6) => tag6.startsWith("baseline/stable/") && !/^v\d+\.\d+\.\d+(?:$|-)/u.test(tag6);
|
|
54157
53420
|
var fetchJson = async (url2, timeoutMs) => {
|
|
54158
53421
|
const controller = new AbortController;
|
|
@@ -54179,21 +53442,21 @@ var download = async (url2, targetPath, timeoutMs) => {
|
|
|
54179
53442
|
throw new Error(`Failed to download ${url2}: ${response.status}`);
|
|
54180
53443
|
}
|
|
54181
53444
|
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
54182
|
-
|
|
53445
|
+
writeFileSync(targetPath, bytes);
|
|
54183
53446
|
} finally {
|
|
54184
53447
|
clearTimeout(timeout4);
|
|
54185
53448
|
}
|
|
54186
53449
|
};
|
|
54187
53450
|
var extractSafeTgz = (archivePath, targetDirectory) => {
|
|
54188
|
-
const listing =
|
|
53451
|
+
const listing = execFileSync2("tar", ["-tzf", archivePath], {
|
|
54189
53452
|
encoding: "utf8"
|
|
54190
53453
|
}).split(/\r?\n/u).filter((line4) => line4.length > 0);
|
|
54191
53454
|
const unsafe = listing.find((entry) => !isSafeTarPath(entry));
|
|
54192
53455
|
if (unsafe !== undefined) {
|
|
54193
53456
|
throw new Error(`Unsafe baseline archive path: ${unsafe}`);
|
|
54194
53457
|
}
|
|
54195
|
-
|
|
54196
|
-
|
|
53458
|
+
mkdirSync(targetDirectory, { recursive: true });
|
|
53459
|
+
execFileSync2("tar", ["-xzf", archivePath, "-C", targetDirectory], {
|
|
54197
53460
|
stdio: "ignore"
|
|
54198
53461
|
});
|
|
54199
53462
|
};
|
|
@@ -54214,25 +53477,25 @@ var submitArtifactPullTelemetry = (baseline, cwd) => {
|
|
|
54214
53477
|
});
|
|
54215
53478
|
};
|
|
54216
53479
|
var materializeControlPlaneBaseline = async (resolution, refresh, timeoutMs) => {
|
|
54217
|
-
const targetDirectory =
|
|
54218
|
-
if (!refresh &&
|
|
53480
|
+
const targetDirectory = path5.join(cacheRoot(), "control-plane", resolution.version);
|
|
53481
|
+
if (!refresh && existsSync2(path5.join(targetDirectory, "baseline.json"))) {
|
|
54219
53482
|
return {
|
|
54220
53483
|
baseline: loadBaselineFromDirectory(targetDirectory, "remote"),
|
|
54221
53484
|
artifactPulled: false
|
|
54222
53485
|
};
|
|
54223
53486
|
}
|
|
54224
|
-
const tempDirectory = mkdtempSync(
|
|
54225
|
-
const archivePath =
|
|
53487
|
+
const tempDirectory = mkdtempSync(path5.join(tmpdir2(), "punks-control-plane-baseline-"));
|
|
53488
|
+
const archivePath = path5.join(tempDirectory, assetArchiveName);
|
|
54226
53489
|
await download(resolution.archive.url, archivePath, timeoutMs);
|
|
54227
53490
|
const archiveSha256 = sha256File(archivePath);
|
|
54228
53491
|
if (archiveSha256 !== resolution.archive.sha256) {
|
|
54229
53492
|
throw new Error("Downloaded control plane baseline archive checksum mismatch.");
|
|
54230
53493
|
}
|
|
54231
|
-
|
|
53494
|
+
rmSync(targetDirectory, { recursive: true, force: true });
|
|
54232
53495
|
extractSafeTgz(archivePath, targetDirectory);
|
|
54233
|
-
const extractedMetadataPath =
|
|
54234
|
-
const extractedMetadata = JSON.parse(
|
|
54235
|
-
|
|
53496
|
+
const extractedMetadataPath = path5.join(targetDirectory, "baseline.json");
|
|
53497
|
+
const extractedMetadata = JSON.parse(readFileSync3(extractedMetadataPath, "utf8"));
|
|
53498
|
+
writeFileSync(extractedMetadataPath, JSON.stringify({
|
|
54236
53499
|
...extractedMetadata,
|
|
54237
53500
|
channel: resolution.channel,
|
|
54238
53501
|
version: resolution.version,
|
|
@@ -54240,7 +53503,7 @@ var materializeControlPlaneBaseline = async (resolution, refresh, timeoutMs) =>
|
|
|
54240
53503
|
commit: resolution.commitSha ?? null,
|
|
54241
53504
|
sha256: archiveSha256
|
|
54242
53505
|
}, null, 2), "utf8");
|
|
54243
|
-
|
|
53506
|
+
rmSync(tempDirectory, { recursive: true, force: true });
|
|
54244
53507
|
return {
|
|
54245
53508
|
baseline: loadBaselineFromDirectory(targetDirectory, "remote"),
|
|
54246
53509
|
artifactPulled: true
|
|
@@ -54259,8 +53522,7 @@ var resolveControlPlaneStableBaseline = async ({
|
|
|
54259
53522
|
try {
|
|
54260
53523
|
const resolution = await Promise.race([
|
|
54261
53524
|
exports_Effect.runPromise(resolveStableBaselineMetadata({
|
|
54262
|
-
baseUrl: baseUrl2
|
|
54263
|
-
bearerToken: controlPlaneBearerToken()
|
|
53525
|
+
baseUrl: baseUrl2
|
|
54264
53526
|
})),
|
|
54265
53527
|
new Promise((_, reject) => {
|
|
54266
53528
|
timeout4 = setTimeout(() => reject(new Error("Control plane baseline resolution timed out.")), timeoutMs);
|
|
@@ -54311,38 +53573,38 @@ var resolveRemoteStableBaseline = async ({
|
|
|
54311
53573
|
throw new Error(`Baseline release ${release.tag_name} is missing required assets.`);
|
|
54312
53574
|
}
|
|
54313
53575
|
const manifest = await fetchJson(manifestAsset.browser_download_url, timeoutMs);
|
|
54314
|
-
const targetDirectory =
|
|
54315
|
-
if (!refresh &&
|
|
53576
|
+
const targetDirectory = path5.join(cacheRoot(), "stable", manifest.version);
|
|
53577
|
+
if (!refresh && existsSync2(path5.join(targetDirectory, "baseline.json"))) {
|
|
54316
53578
|
return loadBaselineFromDirectory(targetDirectory, "remote");
|
|
54317
53579
|
}
|
|
54318
|
-
const tempDirectory = mkdtempSync(
|
|
54319
|
-
const archivePath =
|
|
53580
|
+
const tempDirectory = mkdtempSync(path5.join(tmpdir2(), "punks-baseline-"));
|
|
53581
|
+
const archivePath = path5.join(tempDirectory, assetArchiveName);
|
|
54320
53582
|
await download(archiveAsset.browser_download_url, archivePath, timeoutMs);
|
|
54321
53583
|
const archiveSha256 = sha256File(archivePath);
|
|
54322
53584
|
if (archiveSha256 !== manifest.archiveSha256) {
|
|
54323
53585
|
throw new Error("Downloaded baseline archive checksum mismatch.");
|
|
54324
53586
|
}
|
|
54325
|
-
|
|
53587
|
+
rmSync(targetDirectory, { recursive: true, force: true });
|
|
54326
53588
|
extractSafeTgz(archivePath, targetDirectory);
|
|
54327
|
-
const extractedMetadataPath =
|
|
54328
|
-
const extractedMetadata = JSON.parse(
|
|
54329
|
-
|
|
54330
|
-
|
|
53589
|
+
const extractedMetadataPath = path5.join(targetDirectory, "baseline.json");
|
|
53590
|
+
const extractedMetadata = JSON.parse(readFileSync3(extractedMetadataPath, "utf8"));
|
|
53591
|
+
writeFileSync(extractedMetadataPath, JSON.stringify({ ...extractedMetadata, sha256: archiveSha256 }, null, 2), "utf8");
|
|
53592
|
+
rmSync(tempDirectory, { recursive: true, force: true });
|
|
54331
53593
|
const baseline = loadBaselineFromDirectory(targetDirectory, "remote");
|
|
54332
53594
|
submitArtifactPullTelemetry(baseline, cwd);
|
|
54333
53595
|
return baseline;
|
|
54334
53596
|
};
|
|
54335
|
-
var resolveBaseline = async (
|
|
54336
|
-
const requested = process.env.DP_BASELINE === "bundled" ? "bundled" :
|
|
53597
|
+
var resolveBaseline = async (options7 = {}) => {
|
|
53598
|
+
const requested = process.env.DP_BASELINE === "bundled" ? "bundled" : options7.baseline ?? "stable";
|
|
54337
53599
|
if (requested === "bundled") {
|
|
54338
53600
|
return bundledBaseline;
|
|
54339
53601
|
}
|
|
54340
53602
|
try {
|
|
54341
53603
|
return await resolveRemoteStableBaseline({
|
|
54342
|
-
refresh:
|
|
54343
|
-
timeoutMs:
|
|
54344
|
-
releasesUrl:
|
|
54345
|
-
...
|
|
53604
|
+
refresh: options7.refresh ?? process.env.DP_BASELINE_REFRESH === "1",
|
|
53605
|
+
timeoutMs: options7.timeoutMs ?? 1500,
|
|
53606
|
+
releasesUrl: options7.releasesUrl ?? repoReleasesUrl,
|
|
53607
|
+
...options7.cwd === undefined ? {} : { cwd: options7.cwd }
|
|
54346
53608
|
});
|
|
54347
53609
|
} catch {
|
|
54348
53610
|
return bundledBaseline;
|
|
@@ -54430,13 +53692,13 @@ var renderError5 = (state) => match2(state.error, {
|
|
|
54430
53692
|
var renderChoiceDescription3 = (choice4, isHighlighted) => choice4.description && isHighlighted ? char3("-").pipe(cat2(space2), cat2(text3(choice4.description)), annotate2(blackBright2)) : empty38;
|
|
54431
53693
|
var metaOptionsCount2 = 1;
|
|
54432
53694
|
var withStem = (prefix) => prefix.pipe(cat2(space2), cat2(space2));
|
|
54433
|
-
var renderChoices3 = (state,
|
|
54434
|
-
const allSelected = state.selectedIndices.size ===
|
|
53695
|
+
var renderChoices3 = (state, options7) => {
|
|
53696
|
+
const allSelected = state.selectedIndices.size === options7.choices.length;
|
|
54435
53697
|
const metaOptions = [
|
|
54436
|
-
{ title: allSelected ? "Clear all selected packs" :
|
|
53698
|
+
{ title: allSelected ? "Clear all selected packs" : options7.selectAll }
|
|
54437
53699
|
];
|
|
54438
|
-
const allChoices = [...metaOptions, ...
|
|
54439
|
-
const toDisplay = entriesToDisplay2(state.index, allChoices.length,
|
|
53700
|
+
const allChoices = [...metaOptions, ...options7.choices];
|
|
53701
|
+
const toDisplay = entriesToDisplay2(state.index, allChoices.length, options7.maxPerPage);
|
|
54440
53702
|
const documents = [];
|
|
54441
53703
|
for (let index = toDisplay.startIndex;index < toDisplay.endIndex; index++) {
|
|
54442
53704
|
const choice4 = allChoices[index];
|
|
@@ -54464,34 +53726,34 @@ var renderChoices3 = (state, options9) => {
|
|
|
54464
53726
|
}
|
|
54465
53727
|
return vsep2(documents);
|
|
54466
53728
|
};
|
|
54467
|
-
var renderNextFrame9 = (state,
|
|
53729
|
+
var renderNextFrame9 = (state, options7) => exports_Effect.gen(function* () {
|
|
54468
53730
|
const terminal = yield* Terminal;
|
|
54469
53731
|
const columns = yield* terminal.columns;
|
|
54470
|
-
const promptMessage = renderOutput8(
|
|
54471
|
-
const choices = renderChoices3(state,
|
|
53732
|
+
const promptMessage = renderOutput8(options7.message);
|
|
53733
|
+
const choices = renderChoices3(state, options7);
|
|
54472
53734
|
const error4 = renderError5(state);
|
|
54473
53735
|
return cursorHide3.pipe(cat2(promptMessage), cat2(hardLine2), cat2(choices), cat2(error4), render3({ style: "pretty", options: { lineWidth: columns } }));
|
|
54474
53736
|
});
|
|
54475
|
-
var renderSubmission9 = (state,
|
|
53737
|
+
var renderSubmission9 = (state, options7) => exports_Effect.gen(function* () {
|
|
54476
53738
|
const terminal = yield* Terminal;
|
|
54477
53739
|
const columns = yield* terminal.columns;
|
|
54478
|
-
const selectedChoices = Array.from(state.selectedIndices).sort(Order2).map((index) =>
|
|
54479
|
-
return renderOutput8(
|
|
53740
|
+
const selectedChoices = Array.from(state.selectedIndices).sort(Order2).map((index) => options7.choices[index].title).join(", ");
|
|
53741
|
+
return renderOutput8(options7.message).pipe(cat2(annotate2(figures2.tick, green3)), cat2(space2), cat2(annotate2(text3(selectedChoices), white3)), cat2(hardLine2), render3({ style: "pretty", options: { lineWidth: columns } }));
|
|
54480
53742
|
});
|
|
54481
|
-
var clearPrompt = (
|
|
53743
|
+
var clearPrompt = (options7) => exports_Effect.gen(function* () {
|
|
54482
53744
|
const terminal = yield* Terminal;
|
|
54483
53745
|
const columns = yield* terminal.columns;
|
|
54484
53746
|
const text12 = `
|
|
54485
|
-
`.repeat(Math.min(
|
|
53747
|
+
`.repeat(Math.min(options7.choices.length + 1, options7.maxPerPage)) + options7.message;
|
|
54486
53748
|
return eraseText2(text12, columns).pipe(cat2(eraseLine3), cat2(cursorLeft3), optimize3(Deep), render3({ style: "pretty", options: { lineWidth: columns } }));
|
|
54487
53749
|
});
|
|
54488
|
-
var processSpace2 = (state,
|
|
53750
|
+
var processSpace2 = (state, options7) => {
|
|
54489
53751
|
const selectedIndices = new Set(state.selectedIndices);
|
|
54490
53752
|
if (state.index === 0) {
|
|
54491
|
-
if (selectedIndices.size ===
|
|
53753
|
+
if (selectedIndices.size === options7.choices.length) {
|
|
54492
53754
|
selectedIndices.clear();
|
|
54493
53755
|
} else {
|
|
54494
|
-
for (let index = 0;index <
|
|
53756
|
+
for (let index = 0;index < options7.choices.length; index++) {
|
|
54495
53757
|
selectedIndices.add(index);
|
|
54496
53758
|
}
|
|
54497
53759
|
}
|
|
@@ -54505,11 +53767,11 @@ var processSpace2 = (state, options9) => {
|
|
|
54505
53767
|
}
|
|
54506
53768
|
return exports_Effect.succeed(Action2.NextFrame({ state: { ...state, selectedIndices, error: none2() } }));
|
|
54507
53769
|
};
|
|
54508
|
-
var localMultiSelect = (
|
|
53770
|
+
var localMultiSelect = (options7) => {
|
|
54509
53771
|
const resolvedOptions = {
|
|
54510
53772
|
maxPerPage: 10,
|
|
54511
53773
|
selectAll: "Select all packs on this step",
|
|
54512
|
-
...
|
|
53774
|
+
...options7
|
|
54513
53775
|
};
|
|
54514
53776
|
const prompt4 = exports_Prompt.custom({
|
|
54515
53777
|
index: 0,
|
|
@@ -54586,10 +53848,10 @@ var PromptLive = exports_Effect.acquireRelease(exports_Effect.sync(() => createI
|
|
|
54586
53848
|
})));
|
|
54587
53849
|
|
|
54588
53850
|
// src/scaffold/run.ts
|
|
54589
|
-
import { execFileSync as
|
|
54590
|
-
import { mkdirSync as
|
|
54591
|
-
import { homedir as
|
|
54592
|
-
import
|
|
53851
|
+
import { execFileSync as execFileSync5 } from "child_process";
|
|
53852
|
+
import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
53853
|
+
import { homedir as homedir2 } from "os";
|
|
53854
|
+
import path10 from "path";
|
|
54593
53855
|
|
|
54594
53856
|
// src/content/packs.ts
|
|
54595
53857
|
var packContents = packCatalog;
|
|
@@ -54630,8 +53892,8 @@ var requiredToolsForSkills = (skillIds, baseline = bundledBaseline) => [
|
|
|
54630
53892
|
].toSorted();
|
|
54631
53893
|
|
|
54632
53894
|
// src/core/detect.ts
|
|
54633
|
-
import { existsSync as
|
|
54634
|
-
import
|
|
53895
|
+
import { existsSync as existsSync3, readFileSync as readFileSync4, readdirSync } from "fs";
|
|
53896
|
+
import path6 from "path";
|
|
54635
53897
|
var ignoredDirectoryNames = new Set([
|
|
54636
53898
|
".git",
|
|
54637
53899
|
".agents",
|
|
@@ -54710,7 +53972,7 @@ var recursiveFindFiles = (cwd, filename) => {
|
|
|
54710
53972
|
if (ignoredDirectoryNames.has(entry.name)) {
|
|
54711
53973
|
continue;
|
|
54712
53974
|
}
|
|
54713
|
-
const absolutePath =
|
|
53975
|
+
const absolutePath = path6.join(directory3, entry.name);
|
|
54714
53976
|
if (entry.isDirectory()) {
|
|
54715
53977
|
visit2(absolutePath);
|
|
54716
53978
|
continue;
|
|
@@ -54720,18 +53982,18 @@ var recursiveFindFiles = (cwd, filename) => {
|
|
|
54720
53982
|
}
|
|
54721
53983
|
}
|
|
54722
53984
|
};
|
|
54723
|
-
if (
|
|
53985
|
+
if (existsSync3(cwd)) {
|
|
54724
53986
|
visit2(cwd);
|
|
54725
53987
|
}
|
|
54726
53988
|
return results.toSorted();
|
|
54727
53989
|
};
|
|
54728
53990
|
var discoverPackageJsonPaths = (cwd) => {
|
|
54729
|
-
const rootPackageJsonPath =
|
|
53991
|
+
const rootPackageJsonPath = path6.join(cwd, "package.json");
|
|
54730
53992
|
const recursivePackageJsonPaths = recursiveFindFiles(cwd, "package.json");
|
|
54731
|
-
if (!
|
|
53993
|
+
if (!existsSync3(rootPackageJsonPath)) {
|
|
54732
53994
|
return recursivePackageJsonPaths;
|
|
54733
53995
|
}
|
|
54734
|
-
const rootPackageJson = parsePackageJsonRecord(
|
|
53996
|
+
const rootPackageJson = parsePackageJsonRecord(readFileSync4(rootPackageJsonPath, "utf8"));
|
|
54735
53997
|
const workspacePatterns = new Set([
|
|
54736
53998
|
...readPackageJsonWorkspacePatterns(rootPackageJson),
|
|
54737
53999
|
...readPnpmWorkspacePatterns(cwd)
|
|
@@ -54747,13 +54009,13 @@ var discoverPackageJsonPaths = (cwd) => {
|
|
|
54747
54009
|
].filter((value6, index, values4) => values4.indexOf(value6) === index).toSorted();
|
|
54748
54010
|
};
|
|
54749
54011
|
var discoverConventionalWorkspacePackageJsonPaths = (cwd) => conventionalWorkspaceRoots.flatMap((rootDirectoryName) => {
|
|
54750
|
-
const rootDirectory =
|
|
54751
|
-
if (!
|
|
54012
|
+
const rootDirectory = path6.join(cwd, rootDirectoryName);
|
|
54013
|
+
if (!existsSync3(rootDirectory)) {
|
|
54752
54014
|
return [];
|
|
54753
54015
|
}
|
|
54754
|
-
return readdirSync(rootDirectory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) =>
|
|
54016
|
+
return readdirSync(rootDirectory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path6.join(rootDirectory, entry.name, "package.json")).filter((manifestPath) => existsSync3(manifestPath));
|
|
54755
54017
|
});
|
|
54756
|
-
var discoverTopLevelPackageJsonPaths = (cwd) => readdirSync(cwd, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) =>
|
|
54018
|
+
var discoverTopLevelPackageJsonPaths = (cwd) => readdirSync(cwd, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path6.join(cwd, entry.name, "package.json")).filter((manifestPath) => existsSync3(manifestPath));
|
|
54757
54019
|
var readPackageJsonWorkspacePatterns = (pkg) => {
|
|
54758
54020
|
const { workspaces } = pkg;
|
|
54759
54021
|
if (exports_Array.isArray(workspaces)) {
|
|
@@ -54765,13 +54027,13 @@ var readPackageJsonWorkspacePatterns = (pkg) => {
|
|
|
54765
54027
|
return [];
|
|
54766
54028
|
};
|
|
54767
54029
|
var readPnpmWorkspacePatterns = (cwd) => {
|
|
54768
|
-
const workspacePath =
|
|
54769
|
-
if (!
|
|
54030
|
+
const workspacePath = path6.join(cwd, "pnpm-workspace.yaml");
|
|
54031
|
+
if (!existsSync3(workspacePath)) {
|
|
54770
54032
|
return [];
|
|
54771
54033
|
}
|
|
54772
54034
|
const patterns = [];
|
|
54773
54035
|
let inPackagesSection = false;
|
|
54774
|
-
for (const rawLine of
|
|
54036
|
+
for (const rawLine of readFileSync4(workspacePath, "utf8").split(/\r?\n/u)) {
|
|
54775
54037
|
const line4 = rawLine.trim();
|
|
54776
54038
|
if (line4 === "packages:") {
|
|
54777
54039
|
inPackagesSection = true;
|
|
@@ -54795,17 +54057,17 @@ var readPnpmWorkspacePatterns = (cwd) => {
|
|
|
54795
54057
|
};
|
|
54796
54058
|
var expandWorkspacePattern = (cwd, pattern2) => {
|
|
54797
54059
|
if (pattern2.endsWith("/*")) {
|
|
54798
|
-
const baseDirectory =
|
|
54799
|
-
if (!
|
|
54060
|
+
const baseDirectory = path6.join(cwd, pattern2.slice(0, -2));
|
|
54061
|
+
if (!existsSync3(baseDirectory)) {
|
|
54800
54062
|
return [];
|
|
54801
54063
|
}
|
|
54802
|
-
return readdirSync(baseDirectory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) =>
|
|
54064
|
+
return readdirSync(baseDirectory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path6.join(baseDirectory, entry.name, "package.json")).filter((manifestPath2) => existsSync3(manifestPath2)).toSorted();
|
|
54803
54065
|
}
|
|
54804
54066
|
if (pattern2.includes("*")) {
|
|
54805
54067
|
return [];
|
|
54806
54068
|
}
|
|
54807
|
-
const manifestPath =
|
|
54808
|
-
return
|
|
54069
|
+
const manifestPath = path6.join(cwd, pattern2, "package.json");
|
|
54070
|
+
return existsSync3(manifestPath) ? [manifestPath] : [];
|
|
54809
54071
|
};
|
|
54810
54072
|
var detectTechnologies = (manifests) => {
|
|
54811
54073
|
const packageNames = new Set(manifests.flatMap((manifest) => manifest.dependencies));
|
|
@@ -54843,7 +54105,7 @@ var detectTechnologies = (manifests) => {
|
|
|
54843
54105
|
return detectionOrder.filter((technology) => detected.has(technology));
|
|
54844
54106
|
};
|
|
54845
54107
|
var hasPackageTrigger = (packageNames, trigger) => trigger.endsWith("/") ? [...packageNames].some((packageName) => packageName.startsWith(trigger)) : packageNames.has(trigger);
|
|
54846
|
-
var isSourceDirectoryPath = (cwd, directory3) =>
|
|
54108
|
+
var isSourceDirectoryPath = (cwd, directory3) => path6.relative(cwd, directory3) !== "";
|
|
54847
54109
|
var detectSourceLanguages = (cwd) => {
|
|
54848
54110
|
const detected = new Set;
|
|
54849
54111
|
const visit2 = (directory3) => {
|
|
@@ -54851,7 +54113,7 @@ var detectSourceLanguages = (cwd) => {
|
|
|
54851
54113
|
if (ignoredDirectoryNames.has(entry.name)) {
|
|
54852
54114
|
continue;
|
|
54853
54115
|
}
|
|
54854
|
-
const absolutePath =
|
|
54116
|
+
const absolutePath = path6.join(directory3, entry.name);
|
|
54855
54117
|
if (entry.isDirectory()) {
|
|
54856
54118
|
visit2(absolutePath);
|
|
54857
54119
|
continue;
|
|
@@ -54865,7 +54127,7 @@ var detectSourceLanguages = (cwd) => {
|
|
|
54865
54127
|
}
|
|
54866
54128
|
}
|
|
54867
54129
|
};
|
|
54868
|
-
if (
|
|
54130
|
+
if (existsSync3(cwd)) {
|
|
54869
54131
|
visit2(cwd);
|
|
54870
54132
|
}
|
|
54871
54133
|
return languageDetectionOrder.filter((language) => detected.has(language));
|
|
@@ -54893,7 +54155,7 @@ var detectMonorepoSignals = (cwd, manifests) => {
|
|
|
54893
54155
|
});
|
|
54894
54156
|
}
|
|
54895
54157
|
for (const manifest of manifests) {
|
|
54896
|
-
const pkg = parsePackageJsonRecord(
|
|
54158
|
+
const pkg = parsePackageJsonRecord(readFileSync4(manifest.path, "utf8"));
|
|
54897
54159
|
const workspaces = pkg.workspaces;
|
|
54898
54160
|
const hasWorkspaces = exports_Array.isArray(workspaces) || isRecord2(workspaces) && exports_Array.isArray(workspaces.packages);
|
|
54899
54161
|
if (hasWorkspaces) {
|
|
@@ -54904,7 +54166,7 @@ var detectMonorepoSignals = (cwd, manifests) => {
|
|
|
54904
54166
|
}
|
|
54905
54167
|
}
|
|
54906
54168
|
const workspaceManifests = manifests.filter((manifest) => {
|
|
54907
|
-
const pkg = parsePackageJsonRecord(
|
|
54169
|
+
const pkg = parsePackageJsonRecord(readFileSync4(manifest.path, "utf8"));
|
|
54908
54170
|
const workspaces = pkg.workspaces;
|
|
54909
54171
|
return !(exports_Array.isArray(workspaces) || isRecord2(workspaces) && exports_Array.isArray(workspaces.packages));
|
|
54910
54172
|
});
|
|
@@ -54920,10 +54182,10 @@ var detectRepository = (cwd) => exports_Effect.try({
|
|
|
54920
54182
|
try: () => {
|
|
54921
54183
|
const manifestPaths = discoverPackageJsonPaths(cwd);
|
|
54922
54184
|
const manifests = manifestPaths.map((manifestPath) => {
|
|
54923
|
-
const pkg = parsePackageJsonRecord(
|
|
54185
|
+
const pkg = parsePackageJsonRecord(readFileSync4(manifestPath, "utf8"));
|
|
54924
54186
|
return {
|
|
54925
54187
|
path: manifestPath,
|
|
54926
|
-
relativePath:
|
|
54188
|
+
relativePath: path6.relative(cwd, manifestPath) || "package.json",
|
|
54927
54189
|
packageName: pkg.name ?? null,
|
|
54928
54190
|
dependencies: collectPackageNames(pkg)
|
|
54929
54191
|
};
|
|
@@ -54945,7 +54207,7 @@ var detectRepository = (cwd) => exports_Effect.try({
|
|
|
54945
54207
|
message: "Failed to detect repository shape."
|
|
54946
54208
|
})
|
|
54947
54209
|
});
|
|
54948
|
-
var manifestPaths = (result) => result.manifests.map((manifest) =>
|
|
54210
|
+
var manifestPaths = (result) => result.manifests.map((manifest) => path6.relative(result.cwd, manifest.path) || "package.json");
|
|
54949
54211
|
var applyRepoShapeMode = (result, repoShapeMode) => repoShapeMode === "auto" ? result : {
|
|
54950
54212
|
...result,
|
|
54951
54213
|
monorepo: repoShapeMode === "monorepo"
|
|
@@ -54954,7 +54216,7 @@ var hasFrontendSurface = (result) => exports_Array.some(result.detectedTechnolog
|
|
|
54954
54216
|
var backendWorkspacePathSegments = new Set(["api", "backend", "server", "services"]);
|
|
54955
54217
|
var backendPackageNameSegments = new Set(["api", "backend", "server", "service"]);
|
|
54956
54218
|
var hasBackendWorkspaceName = (manifest) => {
|
|
54957
|
-
const pathSegments = manifest.relativePath.split(
|
|
54219
|
+
const pathSegments = manifest.relativePath.split(path6.sep).slice(0, -1);
|
|
54958
54220
|
if (pathSegments.some((segment) => backendWorkspacePathSegments.has(segment))) {
|
|
54959
54221
|
return true;
|
|
54960
54222
|
}
|
|
@@ -54967,7 +54229,7 @@ var hasBackendWorkspaceName = (manifest) => {
|
|
|
54967
54229
|
var hasBackendSurface = (result) => exports_Array.some(result.detectedTechnologies, (technology) => technology === "better-auth" || technology === "drizzle" || technology === "elysia" || technology === "trpc") || result.manifests.some(hasBackendWorkspaceName);
|
|
54968
54230
|
|
|
54969
54231
|
// src/core/format-summary.ts
|
|
54970
|
-
import
|
|
54232
|
+
import path7 from "path";
|
|
54971
54233
|
var formatList = (values4) => values4.length === 0 ? [" \u2205"] : values4.map((value6) => ` \u2022 ${value6}`);
|
|
54972
54234
|
var wrapInlineValues = ({
|
|
54973
54235
|
values: values4,
|
|
@@ -55038,8 +54300,8 @@ var formatDetectionSummary = (detection) => [
|
|
|
55038
54300
|
`cwd: ${detection.cwd}`,
|
|
55039
54301
|
...section("detected languages:", formatList(detection.detectedLanguages)),
|
|
55040
54302
|
...section("detected technologies:", formatList(detection.detectedTechnologies)),
|
|
55041
|
-
...section("manifest files:", formatList(detection.manifests.map((manifest) =>
|
|
55042
|
-
...section("monorepo signals:", formatList(detection.monorepoSignals.map((signal) => `${signal.type} (${
|
|
54303
|
+
...section("manifest files:", formatList(detection.manifests.map((manifest) => path7.relative(detection.cwd, manifest.path) || "package.json"))),
|
|
54304
|
+
...section("monorepo signals:", formatList(detection.monorepoSignals.map((signal) => `${signal.type} (${path7.relative(detection.cwd, signal.path) || "."})`)))
|
|
55043
54305
|
].join(`
|
|
55044
54306
|
`);
|
|
55045
54307
|
var formatConfirmationSummary = (result, baseline = bundledBaseline) => [
|
|
@@ -55118,29 +54380,29 @@ var formatAgentHandoffSummary = (result) => [
|
|
|
55118
54380
|
" 13. Run `opensrc path <package>` or `opensrc path owner/repo` for those core libraries, then inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically."
|
|
55119
54381
|
].join(`
|
|
55120
54382
|
`);
|
|
55121
|
-
var formatSelectionPreview = (
|
|
54383
|
+
var formatSelectionPreview = (options7) => [
|
|
55122
54384
|
"Review scaffold selection before continuing",
|
|
55123
|
-
...section("prefilled packs:", formatPackList(
|
|
55124
|
-
...maybeSection("added packs:", formatPackList(
|
|
55125
|
-
...maybeSection("removed packs:", formatPackList(
|
|
55126
|
-
...section("final packs:", formatCompactPackList(
|
|
55127
|
-
`output directory: ${
|
|
54385
|
+
...section("prefilled packs:", formatPackList(options7.preselectedPacks, options7.baseline)),
|
|
54386
|
+
...maybeSection("added packs:", formatPackList(options7.addedPacks, options7.baseline)),
|
|
54387
|
+
...maybeSection("removed packs:", formatPackList(options7.removedPacks, options7.baseline)),
|
|
54388
|
+
...section("final packs:", formatCompactPackList(options7.finalPacks)),
|
|
54389
|
+
`output directory: ${options7.outputDirectory}`
|
|
55128
54390
|
].join(`
|
|
55129
54391
|
`);
|
|
55130
|
-
var formatResolvedPackSummary = (
|
|
55131
|
-
...section("default packs:", formatPackList(
|
|
55132
|
-
...section("language packs:", formatPackList(
|
|
55133
|
-
...section("detected packs:", formatPackList(
|
|
55134
|
-
...section("surface packs:", formatPackList(
|
|
54392
|
+
var formatResolvedPackSummary = (options7) => options7.optionalPacks.length === 0 ? [
|
|
54393
|
+
...section("default packs:", formatPackList(options7.defaultPacks, options7.baseline)),
|
|
54394
|
+
...section("language packs:", formatPackList(options7.languagePacks, options7.baseline)),
|
|
54395
|
+
...section("detected packs:", formatPackList(options7.detectedPacks, options7.baseline)),
|
|
54396
|
+
...section("surface packs:", formatPackList(options7.surfacePacks, options7.baseline)),
|
|
55135
54397
|
"additional packs available:",
|
|
55136
54398
|
" all known packs are already included in the prefilled selection."
|
|
55137
54399
|
].join(`
|
|
55138
54400
|
`) : [
|
|
55139
|
-
...section("default packs:", formatPackList(
|
|
55140
|
-
...section("language packs:", formatPackList(
|
|
55141
|
-
...section("detected packs:", formatPackList(
|
|
55142
|
-
...section("surface packs:", formatPackList(
|
|
55143
|
-
...section("additional packs available:", formatPackList(
|
|
54401
|
+
...section("default packs:", formatPackList(options7.defaultPacks, options7.baseline)),
|
|
54402
|
+
...section("language packs:", formatPackList(options7.languagePacks, options7.baseline)),
|
|
54403
|
+
...section("detected packs:", formatPackList(options7.detectedPacks, options7.baseline)),
|
|
54404
|
+
...section("surface packs:", formatPackList(options7.surfacePacks, options7.baseline)),
|
|
54405
|
+
...section("additional packs available:", formatPackList(options7.optionalPacks, options7.baseline))
|
|
55144
54406
|
].join(`
|
|
55145
54407
|
`);
|
|
55146
54408
|
|
|
@@ -55226,10 +54488,10 @@ var finalizePackSelection = (resolved, additions, removals) => {
|
|
|
55226
54488
|
var canRemovePack = (resolved, packId) => resolved.preselectedPacks.includes(packId) && !resolved.defaultPacks.includes(packId);
|
|
55227
54489
|
|
|
55228
54490
|
// src/core/tools.ts
|
|
55229
|
-
import { execFileSync as
|
|
54491
|
+
import { execFileSync as execFileSync3 } from "child_process";
|
|
55230
54492
|
import { accessSync, constants as constants2 } from "fs";
|
|
55231
|
-
import { homedir
|
|
55232
|
-
import
|
|
54493
|
+
import { homedir } from "os";
|
|
54494
|
+
import path8 from "path";
|
|
55233
54495
|
var commandExistsOnPath = (command, env2 = process.env, platform = process.platform) => {
|
|
55234
54496
|
const pathValue = env2.PATH ?? env2.Path;
|
|
55235
54497
|
if (pathValue === undefined || pathValue.length === 0) {
|
|
@@ -55239,9 +54501,9 @@ var commandExistsOnPath = (command, env2 = process.env, platform = process.platf
|
|
|
55239
54501
|
const pathSeparator = isWindows ? ";" : ":";
|
|
55240
54502
|
const pathEntries = pathValue.split(pathSeparator).filter((entry) => entry.length > 0);
|
|
55241
54503
|
const pathExtensions = isWindows ? (env2.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter((extension) => extension.length > 0) : [""];
|
|
55242
|
-
const commandExtensions = isWindows &&
|
|
54504
|
+
const commandExtensions = isWindows && path8.extname(command).length === 0 ? pathExtensions : [""];
|
|
55243
54505
|
const hasPathSegment = command.includes("/") || command.includes("\\");
|
|
55244
|
-
const candidates = (hasPathSegment ? [""] : pathEntries).flatMap((entry) => commandExtensions.map((extension) => hasPathSegment ? `${command}${extension}` :
|
|
54506
|
+
const candidates = (hasPathSegment ? [""] : pathEntries).flatMap((entry) => commandExtensions.map((extension) => hasPathSegment ? `${command}${extension}` : path8.join(entry, `${command}${extension}`)));
|
|
55245
54507
|
return candidates.some((candidate) => {
|
|
55246
54508
|
try {
|
|
55247
54509
|
accessSync(candidate, isWindows ? constants2.F_OK : constants2.X_OK);
|
|
@@ -55252,12 +54514,12 @@ var commandExistsOnPath = (command, env2 = process.env, platform = process.platf
|
|
|
55252
54514
|
});
|
|
55253
54515
|
};
|
|
55254
54516
|
var defaultRuntime3 = {
|
|
55255
|
-
cwd:
|
|
54517
|
+
cwd: homedir(),
|
|
55256
54518
|
commandExists: commandExistsOnPath,
|
|
55257
|
-
execFile: (command, args2,
|
|
55258
|
-
|
|
55259
|
-
cwd:
|
|
55260
|
-
stdio:
|
|
54519
|
+
execFile: (command, args2, options7) => {
|
|
54520
|
+
execFileSync3(command, [...args2], {
|
|
54521
|
+
cwd: options7?.cwd,
|
|
54522
|
+
stdio: options7?.stdio ?? "inherit"
|
|
55261
54523
|
});
|
|
55262
54524
|
}
|
|
55263
54525
|
};
|
|
@@ -55291,7 +54553,7 @@ var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defa
|
|
|
55291
54553
|
throw new Error("Cannot install required tools because no supported global package manager was found on PATH. Install Bun, pnpm, or npm first.");
|
|
55292
54554
|
}
|
|
55293
54555
|
const globalPackageManager = packageManager;
|
|
55294
|
-
const cwd = runtime5.cwd ??
|
|
54556
|
+
const cwd = runtime5.cwd ?? homedir();
|
|
55295
54557
|
for (const toolId of toolIds) {
|
|
55296
54558
|
const tool = toolCatalogById[toolId];
|
|
55297
54559
|
if (tool === undefined) {
|
|
@@ -55327,20 +54589,20 @@ var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defa
|
|
|
55327
54589
|
};
|
|
55328
54590
|
|
|
55329
54591
|
// src/scaffold/output.ts
|
|
55330
|
-
import { execFileSync as
|
|
54592
|
+
import { execFileSync as execFileSync4 } from "child_process";
|
|
55331
54593
|
import { createHash as createHash2 } from "crypto";
|
|
55332
54594
|
import {
|
|
55333
54595
|
cpSync,
|
|
55334
|
-
existsSync as
|
|
54596
|
+
existsSync as existsSync4,
|
|
55335
54597
|
lstatSync,
|
|
55336
|
-
mkdirSync as
|
|
54598
|
+
mkdirSync as mkdirSync2,
|
|
55337
54599
|
readdirSync as readdirSync2,
|
|
55338
|
-
readFileSync as
|
|
54600
|
+
readFileSync as readFileSync5,
|
|
55339
54601
|
readlinkSync,
|
|
55340
|
-
rmSync as
|
|
55341
|
-
writeFileSync as
|
|
54602
|
+
rmSync as rmSync2,
|
|
54603
|
+
writeFileSync as writeFileSync2
|
|
55342
54604
|
} from "fs";
|
|
55343
|
-
import
|
|
54605
|
+
import path9 from "path";
|
|
55344
54606
|
|
|
55345
54607
|
// src/content/prompts.ts
|
|
55346
54608
|
var phaseSkillIds = [
|
|
@@ -55864,9 +55126,9 @@ var sortSubagentSpecialists = (spec) => ({
|
|
|
55864
55126
|
|
|
55865
55127
|
// src/scaffold/output.ts
|
|
55866
55128
|
var encodeJson = encodeSync(parseJson(Unknown));
|
|
55867
|
-
var toPosixPath = (value6) => value6.split(
|
|
55129
|
+
var toPosixPath = (value6) => value6.split(path9.sep).join("/");
|
|
55868
55130
|
var relativePosixPath = (from, to) => {
|
|
55869
|
-
const relativePath =
|
|
55131
|
+
const relativePath = path9.relative(from, to);
|
|
55870
55132
|
return relativePath === "" ? "." : toPosixPath(relativePath);
|
|
55871
55133
|
};
|
|
55872
55134
|
var specPathForPromptTarget = (relativePath) => {
|
|
@@ -55880,7 +55142,7 @@ var specPathForPromptTarget = (relativePath) => {
|
|
|
55880
55142
|
if (promptTargetPath === "docs/AGENTS.md") {
|
|
55881
55143
|
return ".devpunks/specs/prompts/docs.md";
|
|
55882
55144
|
}
|
|
55883
|
-
return
|
|
55145
|
+
return path9.posix.join(".devpunks/specs/prompts", path9.posix.dirname(promptTargetPath), "prompt.md");
|
|
55884
55146
|
};
|
|
55885
55147
|
var uniqueSorted = (values4) => [...new Set(values4)].toSorted();
|
|
55886
55148
|
var collectOpensrcReferences = (promptSpecs) => uniqueSorted(promptSpecs.flatMap((spec) => spec.opensrcReferences));
|
|
@@ -55889,7 +55151,7 @@ var detectionHasPackage = (detection, packageName) => detection.manifests.some((
|
|
|
55889
55151
|
var selectedSkills = (finalPacks, baseline) => uniqueSorted(finalPacks.flatMap((packId) => skillsForPack(packId, baseline)));
|
|
55890
55152
|
var selectedHookIds = (finalPacks, baseline) => uniqueSorted(finalPacks.flatMap((packId) => hooksForPack(packId, baseline)));
|
|
55891
55153
|
var oxlintConfigCandidates = [".oxlintrc.json", ".oxlintrc.jsonc", "oxlint.config.ts"];
|
|
55892
|
-
var existingOxlintConfigFiles = (scanDirectory) => oxlintConfigCandidates.filter((candidate) =>
|
|
55154
|
+
var existingOxlintConfigFiles = (scanDirectory) => oxlintConfigCandidates.filter((candidate) => existsSync4(path9.join(scanDirectory, candidate)));
|
|
55893
55155
|
var oxlintStarterConfig = {
|
|
55894
55156
|
$schema: "./node_modules/oxlint/configuration_schema.json",
|
|
55895
55157
|
env: {
|
|
@@ -55915,7 +55177,7 @@ var oxlintStarterConfig = {
|
|
|
55915
55177
|
],
|
|
55916
55178
|
overrides: []
|
|
55917
55179
|
};
|
|
55918
|
-
var detectedWorkspaces = (scanDirectory, detection) => detection.manifests.map((manifest) =>
|
|
55180
|
+
var detectedWorkspaces = (scanDirectory, detection) => detection.manifests.map((manifest) => path9.posix.dirname(relativePosixPath(scanDirectory, manifest.path))).filter((workspace) => workspace !== "" && workspace !== ".").toSorted();
|
|
55919
55181
|
var packsForWorkspace = ({
|
|
55920
55182
|
relativeWorkspacePath,
|
|
55921
55183
|
manifest,
|
|
@@ -56070,9 +55332,9 @@ var buildPromptSpec = ({
|
|
|
56070
55332
|
finalPacks,
|
|
56071
55333
|
baseline
|
|
56072
55334
|
}) => {
|
|
56073
|
-
const sourcePath =
|
|
56074
|
-
const source =
|
|
56075
|
-
const workspacePath = relativePath === ".agents/AGENTS.md" ? ".agents" : relativePath === "AGENTS.md" ? "." : relativePath === "docs/AGENTS.md" ? "docs" :
|
|
55335
|
+
const sourcePath = path9.join(scanDirectory, relativePath);
|
|
55336
|
+
const source = existsSync4(sourcePath) ? "copied" : "generated";
|
|
55337
|
+
const workspacePath = relativePath === ".agents/AGENTS.md" ? ".agents" : relativePath === "AGENTS.md" ? "." : relativePath === "docs/AGENTS.md" ? "docs" : path9.dirname(relativePath);
|
|
56076
55338
|
const packs = packsForWorkspace({
|
|
56077
55339
|
relativeWorkspacePath: workspacePath,
|
|
56078
55340
|
manifest,
|
|
@@ -56140,9 +55402,9 @@ var writeArtifact = ({
|
|
|
56140
55402
|
relativePath,
|
|
56141
55403
|
content
|
|
56142
55404
|
}) => {
|
|
56143
|
-
const absolutePath =
|
|
56144
|
-
|
|
56145
|
-
|
|
55405
|
+
const absolutePath = path9.join(outputDirectory, relativePath);
|
|
55406
|
+
mkdirSync2(path9.dirname(absolutePath), { recursive: true });
|
|
55407
|
+
writeFileSync2(absolutePath, content, "utf8");
|
|
56146
55408
|
return relativePath;
|
|
56147
55409
|
};
|
|
56148
55410
|
var resolvePromptContent = ({
|
|
@@ -56153,9 +55415,9 @@ var resolvePromptContent = ({
|
|
|
56153
55415
|
baseline,
|
|
56154
55416
|
preserveExistingManagedFiles
|
|
56155
55417
|
}) => {
|
|
56156
|
-
const sourcePath =
|
|
56157
|
-
if (preserveExistingManagedFiles &&
|
|
56158
|
-
return
|
|
55418
|
+
const sourcePath = path9.join(scanDirectory, relativePath);
|
|
55419
|
+
if (preserveExistingManagedFiles && existsSync4(sourcePath)) {
|
|
55420
|
+
return readFileSync5(sourcePath, "utf8");
|
|
56159
55421
|
}
|
|
56160
55422
|
if (relativePath === ".agents/AGENTS.md") {
|
|
56161
55423
|
return sharedAgentsPromptTemplate;
|
|
@@ -56167,7 +55429,7 @@ var resolvePromptContent = ({
|
|
|
56167
55429
|
return docsPromptTemplate;
|
|
56168
55430
|
}
|
|
56169
55431
|
if (manifest) {
|
|
56170
|
-
const relativeWorkspacePath =
|
|
55432
|
+
const relativeWorkspacePath = path9.dirname(relativePath);
|
|
56171
55433
|
const packs = packsForWorkspace({
|
|
56172
55434
|
relativeWorkspacePath,
|
|
56173
55435
|
manifest,
|
|
@@ -56188,15 +55450,15 @@ var resolvePromptContent = ({
|
|
|
56188
55450
|
return "";
|
|
56189
55451
|
};
|
|
56190
55452
|
var collectRelativeFiles = (outputDirectory, relativeDirectory) => {
|
|
56191
|
-
const absoluteDirectory =
|
|
56192
|
-
if (!
|
|
55453
|
+
const absoluteDirectory = path9.join(outputDirectory, relativeDirectory);
|
|
55454
|
+
if (!existsSync4(absoluteDirectory)) {
|
|
56193
55455
|
return [];
|
|
56194
55456
|
}
|
|
56195
55457
|
const files = [];
|
|
56196
55458
|
const visit2 = (currentDirectory) => {
|
|
56197
55459
|
for (const entry of readdirSync2(currentDirectory, { withFileTypes: true })) {
|
|
56198
|
-
const absolutePath =
|
|
56199
|
-
const relativePath =
|
|
55460
|
+
const absolutePath = path9.join(currentDirectory, entry.name);
|
|
55461
|
+
const relativePath = path9.relative(outputDirectory, absolutePath).split(path9.sep).join("/");
|
|
56200
55462
|
const stat3 = lstatSync(absolutePath);
|
|
56201
55463
|
if (stat3.isSymbolicLink()) {
|
|
56202
55464
|
files.push(relativePath);
|
|
@@ -56251,8 +55513,8 @@ var managedKindForPath = (relativePath) => {
|
|
|
56251
55513
|
var expandManagedFiles = (outputDirectory, relativePaths) => {
|
|
56252
55514
|
const files = new Set;
|
|
56253
55515
|
for (const relativePath of relativePaths) {
|
|
56254
|
-
const absolutePath =
|
|
56255
|
-
if (!
|
|
55516
|
+
const absolutePath = path9.join(outputDirectory, relativePath);
|
|
55517
|
+
if (!existsSync4(absolutePath)) {
|
|
56256
55518
|
continue;
|
|
56257
55519
|
}
|
|
56258
55520
|
const stat3 = lstatSync(absolutePath);
|
|
@@ -56267,9 +55529,9 @@ var expandManagedFiles = (outputDirectory, relativePaths) => {
|
|
|
56267
55529
|
}
|
|
56268
55530
|
}
|
|
56269
55531
|
return [...files].toSorted().map((relativePath) => {
|
|
56270
|
-
const absolutePath =
|
|
55532
|
+
const absolutePath = path9.join(outputDirectory, relativePath);
|
|
56271
55533
|
const stat3 = lstatSync(absolutePath);
|
|
56272
|
-
const content = stat3.isSymbolicLink() ? `symlink:${readlinkSync(absolutePath)}` :
|
|
55534
|
+
const content = stat3.isSymbolicLink() ? `symlink:${readlinkSync(absolutePath)}` : readFileSync5(absolutePath);
|
|
56273
55535
|
return {
|
|
56274
55536
|
path: relativePath,
|
|
56275
55537
|
sha256: hashContent(content),
|
|
@@ -56282,7 +55544,7 @@ var promptTargetsForDetection = (scanDirectory, detection) => {
|
|
|
56282
55544
|
{ relativePath: ".agents/AGENTS.md", manifest: null },
|
|
56283
55545
|
{ relativePath: "AGENTS.md", manifest: null }
|
|
56284
55546
|
];
|
|
56285
|
-
if (
|
|
55547
|
+
if (existsSync4(path9.join(scanDirectory, "docs"))) {
|
|
56286
55548
|
targets.push({ relativePath: "docs/AGENTS.md", manifest: null });
|
|
56287
55549
|
}
|
|
56288
55550
|
if (!detection.monorepo) {
|
|
@@ -56294,7 +55556,7 @@ var promptTargetsForDetection = (scanDirectory, detection) => {
|
|
|
56294
55556
|
continue;
|
|
56295
55557
|
}
|
|
56296
55558
|
targets.push({
|
|
56297
|
-
relativePath:
|
|
55559
|
+
relativePath: path9.posix.join(path9.posix.dirname(relativeManifestPath), "AGENTS.md"),
|
|
56298
55560
|
manifest
|
|
56299
55561
|
});
|
|
56300
55562
|
}
|
|
@@ -56313,7 +55575,7 @@ var writeScaffoldOutput = ({
|
|
|
56313
55575
|
}) => exports_Effect.sync(() => {
|
|
56314
55576
|
const shouldPreserveExistingManagedFiles = preserveExistingManagedFiles ?? true;
|
|
56315
55577
|
const renderedOutputDirectory = displayOutputDirectory ?? outputDirectory;
|
|
56316
|
-
|
|
55578
|
+
mkdirSync2(outputDirectory, { recursive: true });
|
|
56317
55579
|
const generatedFiles = [];
|
|
56318
55580
|
const promptOutputs = [];
|
|
56319
55581
|
const promptSpecFiles = [];
|
|
@@ -56410,10 +55672,10 @@ var writeScaffoldOutput = ({
|
|
|
56410
55672
|
}
|
|
56411
55673
|
for (const skillId of finalSkills) {
|
|
56412
55674
|
const sourceDirectory = skillRegistryByIdForBaseline(baseline)[skillId].sourceDirectory;
|
|
56413
|
-
const targetDirectory =
|
|
56414
|
-
const absoluteTargetDirectory =
|
|
56415
|
-
|
|
56416
|
-
|
|
55675
|
+
const targetDirectory = path9.posix.join(".agents/skills", skillId);
|
|
55676
|
+
const absoluteTargetDirectory = path9.join(outputDirectory, targetDirectory);
|
|
55677
|
+
mkdirSync2(path9.join(outputDirectory, ".agents/skills"), { recursive: true });
|
|
55678
|
+
rmSync2(absoluteTargetDirectory, { recursive: true, force: true });
|
|
56417
55679
|
cpSync(resolveBaselinePath({
|
|
56418
55680
|
baselineRoot: baseline.root,
|
|
56419
55681
|
baselineSkillsRoot: baseline.skillsRoot,
|
|
@@ -56450,11 +55712,11 @@ var writeScaffoldOutput = ({
|
|
|
56450
55712
|
content: encodeJson(subagentManifestSpec)
|
|
56451
55713
|
}));
|
|
56452
55714
|
subagentFiles.push(subagentManifestSpec.specFile);
|
|
56453
|
-
const sourceManifestPath =
|
|
55715
|
+
const sourceManifestPath = path9.join(scanDirectory, ".agents/subagents/manifest.mjs");
|
|
56454
55716
|
generatedFiles.push(writeArtifact({
|
|
56455
55717
|
outputDirectory,
|
|
56456
55718
|
relativePath: ".agents/subagents/manifest.mjs",
|
|
56457
|
-
content: shouldPreserveExistingManagedFiles &&
|
|
55719
|
+
content: shouldPreserveExistingManagedFiles && existsSync4(sourceManifestPath) ? readFileSync5(sourceManifestPath, "utf8") : renderSubagentManifestModule({
|
|
56458
55720
|
spec: subagentManifestSpec,
|
|
56459
55721
|
baseline,
|
|
56460
55722
|
fallback: defaultSubagentManifestTemplate
|
|
@@ -56469,7 +55731,7 @@ var writeScaffoldOutput = ({
|
|
|
56469
55731
|
}));
|
|
56470
55732
|
hookFiles.push(hook.outputPath);
|
|
56471
55733
|
}
|
|
56472
|
-
|
|
55734
|
+
execFileSync4(process.execPath, [path9.join(outputDirectory, syncScriptFile)], {
|
|
56473
55735
|
cwd: outputDirectory,
|
|
56474
55736
|
stdio: "ignore"
|
|
56475
55737
|
});
|
|
@@ -56584,14 +55846,14 @@ var yesValues = new Set(["", "y", "yes"]);
|
|
|
56584
55846
|
var encodeJson2 = encodeSync(parseJson(Unknown));
|
|
56585
55847
|
var encodePrettyJson = (value6) => JSON.stringify(JSON.parse(encodeJson2(value6)), null, 2);
|
|
56586
55848
|
var agentSystemPromptFile = ".devpunks/AGENT-SYSTEM-PROMPT.md";
|
|
56587
|
-
var clipboardWorkingDirectory =
|
|
55849
|
+
var clipboardWorkingDirectory = homedir2();
|
|
56588
55850
|
var writeAgentSystemPrompt = ({
|
|
56589
55851
|
outputDirectory,
|
|
56590
55852
|
content
|
|
56591
55853
|
}) => {
|
|
56592
|
-
const absolutePath =
|
|
56593
|
-
|
|
56594
|
-
|
|
55854
|
+
const absolutePath = path10.join(outputDirectory, agentSystemPromptFile);
|
|
55855
|
+
mkdirSync3(path10.dirname(absolutePath), { recursive: true });
|
|
55856
|
+
writeFileSync3(absolutePath, `${content}
|
|
56595
55857
|
`, "utf8");
|
|
56596
55858
|
return agentSystemPromptFile;
|
|
56597
55859
|
};
|
|
@@ -56604,7 +55866,7 @@ var tryClipboardCommand = ({
|
|
|
56604
55866
|
return { ok: false };
|
|
56605
55867
|
}
|
|
56606
55868
|
try {
|
|
56607
|
-
|
|
55869
|
+
execFileSync5(command, args2, {
|
|
56608
55870
|
cwd: clipboardWorkingDirectory,
|
|
56609
55871
|
input: text12,
|
|
56610
55872
|
stdio: ["pipe", "ignore", "ignore"]
|
|
@@ -56630,16 +55892,16 @@ var copyToClipboard = (text12) => {
|
|
|
56630
55892
|
var selectedSkills2 = (finalPacks, baseline) => [
|
|
56631
55893
|
...new Set(finalPacks.flatMap((packId) => skillsForPack(packId, baseline)))
|
|
56632
55894
|
].toSorted();
|
|
56633
|
-
var promptForPackMultiSelect = (prompt4,
|
|
55895
|
+
var promptForPackMultiSelect = (prompt4, options7) => exports_Effect.gen(function* () {
|
|
56634
55896
|
yield* prompt4.writeLine("");
|
|
56635
|
-
yield* prompt4.writeLine(renderCommandSection(
|
|
55897
|
+
yield* prompt4.writeLine(renderCommandSection(options7.title, [options7.intro, "", `available packs: ${options7.allowed.length}`].join(`
|
|
56636
55898
|
`)));
|
|
56637
55899
|
return yield* prompt4.multiSelect({
|
|
56638
|
-
message:
|
|
56639
|
-
...
|
|
56640
|
-
...
|
|
56641
|
-
choices:
|
|
56642
|
-
const description =
|
|
55900
|
+
message: options7.message,
|
|
55901
|
+
...options7.selectAll ? { selectAll: options7.selectAll } : {},
|
|
55902
|
+
...options7.selectNone ? { selectNone: options7.selectNone } : {},
|
|
55903
|
+
choices: options7.allowed.map((packId) => {
|
|
55904
|
+
const description = options7.descriptions?.[packId];
|
|
56643
55905
|
return description ? {
|
|
56644
55906
|
title: packId,
|
|
56645
55907
|
value: packId,
|
|
@@ -56662,7 +55924,7 @@ var runScaffold = ({
|
|
|
56662
55924
|
}) => exports_Effect.gen(function* () {
|
|
56663
55925
|
const baseRequiredTools = requiredToolsForSkills([], baseline);
|
|
56664
55926
|
let toolBootstrapStatuses = [];
|
|
56665
|
-
const resolvedOutputDirectory =
|
|
55927
|
+
const resolvedOutputDirectory = path10.resolve(outputDirectory ?? scanDirectory);
|
|
56666
55928
|
yield* prompt4.writeLine(renderScaffoldTitle());
|
|
56667
55929
|
yield* prompt4.writeLine("");
|
|
56668
55930
|
yield* prompt4.writeLine(renderSetupIntro());
|
|
@@ -56882,8 +56144,8 @@ var runScaffold = ({
|
|
|
56882
56144
|
});
|
|
56883
56145
|
|
|
56884
56146
|
// src/scaffold/stage.ts
|
|
56885
|
-
import { cpSync as cpSync2, existsSync as
|
|
56886
|
-
import
|
|
56147
|
+
import { cpSync as cpSync2, existsSync as existsSync5, mkdirSync as mkdirSync4, rmSync as rmSync3, symlinkSync, writeFileSync as writeFileSync4 } from "fs";
|
|
56148
|
+
import path11 from "path";
|
|
56887
56149
|
|
|
56888
56150
|
// src/content/wiki.ts
|
|
56889
56151
|
var makeWikiScaffoldTemplate = (wikiRoot) => ({
|
|
@@ -57647,31 +56909,24 @@ Required skills:
|
|
|
57647
56909
|
- \`write-backlog\`
|
|
57648
56910
|
|
|
57649
56911
|
Scaffolded wiki base:
|
|
57650
|
-
- treat \`${wikiRoot
|
|
56912
|
+
- treat \`${wikiRoot}\` as the dedicated wiki root for specs, raw inputs, routed wiki/project docs, and ingest bookkeeping
|
|
57651
56913
|
- this is not the same thing as \`docs/\`
|
|
57652
|
-
- if the repo is monorepo-shaped, the wiki
|
|
57653
|
-
-
|
|
56914
|
+
- if the repo is monorepo-shaped, reconcile the scaffolded wiki into the real app layout, usually \`apps/wiki\`
|
|
56915
|
+
- if the CLI guessed the wrong root, move or refactor the scaffolded wiki before creating specs, plans, or ingesting domain knowledge
|
|
56916
|
+
- keep using the reconciled wiki root when later steps create specs, plans, or ingest domain knowledge
|
|
57654
56917
|
|
|
57655
56918
|
Execution order:
|
|
57656
56919
|
1. Start with \`requirements-grill\` and run the requirements grill session.
|
|
57657
56920
|
2. Follow the skill's artifact and wiki-synthesis guidance.
|
|
57658
56921
|
3. Run \`write-backlog\` only after the grill gate is closed.
|
|
57659
|
-
4. Use \`punks scaffold
|
|
56922
|
+
4. Use \`punks scaffold setup\` only after the repo shape is ready for repo-aware AI setup.
|
|
57660
56923
|
|
|
57661
56924
|
Gate:
|
|
57662
56925
|
- do not create backlog items while active requirement branches remain unresolved
|
|
57663
56926
|
- treat this as the canonical step before backlog creation
|
|
57664
56927
|
|
|
57665
56928
|
When this gate is complete, the next CLI step is:
|
|
57666
|
-
- \`punks scaffold
|
|
57667
|
-
},
|
|
57668
|
-
{
|
|
57669
|
-
id: "backlog",
|
|
57670
|
-
summary: "Backlog scaffolding is currently unavailable.",
|
|
57671
|
-
skills: [],
|
|
57672
|
-
renderPrompt: () => `You are the operator agent continuing a \`punks scaffold backlog\` run.
|
|
57673
|
-
|
|
57674
|
-
No scaffolded backlog packs are currently available.`
|
|
56929
|
+
- \`punks scaffold setup\``
|
|
57675
56930
|
}
|
|
57676
56931
|
];
|
|
57677
56932
|
var stageScaffoldById = Object.fromEntries(stageScaffoldCatalog.map((stage) => [stage.id, stage]));
|
|
@@ -57683,10 +56938,10 @@ var copySkillDirectory = ({
|
|
|
57683
56938
|
baseline
|
|
57684
56939
|
}) => {
|
|
57685
56940
|
const sourceDirectory = skillRegistryByIdForBaseline(baseline)[skillId].sourceDirectory;
|
|
57686
|
-
const targetDirectory =
|
|
57687
|
-
const absoluteTargetDirectory =
|
|
57688
|
-
|
|
57689
|
-
|
|
56941
|
+
const targetDirectory = path11.posix.join(".agents/skills", skillId);
|
|
56942
|
+
const absoluteTargetDirectory = path11.join(outputDirectory, targetDirectory);
|
|
56943
|
+
mkdirSync4(path11.join(outputDirectory, ".agents/skills"), { recursive: true });
|
|
56944
|
+
rmSync3(absoluteTargetDirectory, { recursive: true, force: true });
|
|
57690
56945
|
cpSync2(resolveBaselinePath({
|
|
57691
56946
|
baselineRoot: baseline.root,
|
|
57692
56947
|
baselineSkillsRoot: baseline.skillsRoot,
|
|
@@ -57694,17 +56949,17 @@ var copySkillDirectory = ({
|
|
|
57694
56949
|
}), absoluteTargetDirectory, { recursive: true });
|
|
57695
56950
|
return targetDirectory;
|
|
57696
56951
|
};
|
|
57697
|
-
var relativePosixPath2 = (from, to) =>
|
|
56952
|
+
var relativePosixPath2 = (from, to) => path11.relative(from, to).split(path11.sep).join("/");
|
|
57698
56953
|
var writeMissingFile = ({
|
|
57699
56954
|
outputDirectory,
|
|
57700
56955
|
targetPath,
|
|
57701
56956
|
content
|
|
57702
56957
|
}) => {
|
|
57703
|
-
if (
|
|
56958
|
+
if (existsSync5(targetPath)) {
|
|
57704
56959
|
return null;
|
|
57705
56960
|
}
|
|
57706
|
-
|
|
57707
|
-
|
|
56961
|
+
mkdirSync4(path11.dirname(targetPath), { recursive: true });
|
|
56962
|
+
writeFileSync4(targetPath, content);
|
|
57708
56963
|
return relativePosixPath2(outputDirectory, targetPath);
|
|
57709
56964
|
};
|
|
57710
56965
|
var scaffoldWiki = ({
|
|
@@ -57713,23 +56968,23 @@ var scaffoldWiki = ({
|
|
|
57713
56968
|
}) => {
|
|
57714
56969
|
const template = makeWikiScaffoldTemplate(wikiRoot);
|
|
57715
56970
|
const createdFiles = [];
|
|
57716
|
-
const wikiDirectory =
|
|
56971
|
+
const wikiDirectory = path11.join(outputDirectory, wikiRoot);
|
|
57717
56972
|
for (const directory3 of template.topLevelDirectories) {
|
|
57718
|
-
|
|
56973
|
+
mkdirSync4(path11.join(wikiDirectory, directory3), { recursive: true });
|
|
57719
56974
|
}
|
|
57720
56975
|
for (const rawSubdirectory of template.rawSubdirectories) {
|
|
57721
|
-
|
|
56976
|
+
mkdirSync4(path11.join(wikiDirectory, "raw", rawSubdirectory), {
|
|
57722
56977
|
recursive: true
|
|
57723
56978
|
});
|
|
57724
|
-
const keepFile =
|
|
56979
|
+
const keepFile = path11.join(wikiDirectory, "raw", rawSubdirectory, ".gitkeep");
|
|
57725
56980
|
const createdFile = writeMissingFile({ outputDirectory, targetPath: keepFile, content: "" });
|
|
57726
56981
|
if (createdFile !== null) {
|
|
57727
56982
|
createdFiles.push(createdFile);
|
|
57728
56983
|
}
|
|
57729
56984
|
}
|
|
57730
56985
|
const directoryKeepFiles = [
|
|
57731
|
-
|
|
57732
|
-
|
|
56986
|
+
path11.join(wikiDirectory, "content", "docs", "project", ".gitkeep"),
|
|
56987
|
+
path11.join(wikiDirectory, "specs", ".gitkeep")
|
|
57733
56988
|
];
|
|
57734
56989
|
for (const keepFile of directoryKeepFiles) {
|
|
57735
56990
|
const createdFile = writeMissingFile({ outputDirectory, targetPath: keepFile, content: "" });
|
|
@@ -57740,14 +56995,14 @@ var scaffoldWiki = ({
|
|
|
57740
56995
|
for (const file6 of template.files) {
|
|
57741
56996
|
const createdFile = writeMissingFile({
|
|
57742
56997
|
outputDirectory,
|
|
57743
|
-
targetPath:
|
|
56998
|
+
targetPath: path11.join(wikiDirectory, file6.path),
|
|
57744
56999
|
content: file6.content
|
|
57745
57000
|
});
|
|
57746
57001
|
if (createdFile !== null) {
|
|
57747
57002
|
createdFiles.push(createdFile);
|
|
57748
57003
|
}
|
|
57749
57004
|
}
|
|
57750
|
-
const agentsPath =
|
|
57005
|
+
const agentsPath = path11.join(wikiDirectory, "AGENTS.md");
|
|
57751
57006
|
const agentsFile = writeMissingFile({
|
|
57752
57007
|
outputDirectory,
|
|
57753
57008
|
targetPath: agentsPath,
|
|
@@ -57756,12 +57011,12 @@ var scaffoldWiki = ({
|
|
|
57756
57011
|
if (agentsFile !== null) {
|
|
57757
57012
|
createdFiles.push(agentsFile);
|
|
57758
57013
|
}
|
|
57759
|
-
const claudePath =
|
|
57760
|
-
if (!
|
|
57014
|
+
const claudePath = path11.join(wikiDirectory, "CLAUDE.md");
|
|
57015
|
+
if (!existsSync5(claudePath)) {
|
|
57761
57016
|
symlinkSync("AGENTS.md", claudePath);
|
|
57762
57017
|
createdFiles.push(relativePosixPath2(outputDirectory, claudePath));
|
|
57763
57018
|
}
|
|
57764
|
-
const indexPath =
|
|
57019
|
+
const indexPath = path11.join(wikiDirectory, "index.md");
|
|
57765
57020
|
const indexFile = writeMissingFile({
|
|
57766
57021
|
outputDirectory,
|
|
57767
57022
|
targetPath: indexPath,
|
|
@@ -57770,7 +57025,7 @@ var scaffoldWiki = ({
|
|
|
57770
57025
|
if (indexFile !== null) {
|
|
57771
57026
|
createdFiles.push(indexFile);
|
|
57772
57027
|
}
|
|
57773
|
-
const logPath =
|
|
57028
|
+
const logPath = path11.join(wikiDirectory, "log.md");
|
|
57774
57029
|
const logFile = writeMissingFile({
|
|
57775
57030
|
outputDirectory,
|
|
57776
57031
|
targetPath: logPath,
|
|
@@ -57788,23 +57043,23 @@ var runStageScaffold = ({
|
|
|
57788
57043
|
baseline = bundledBaseline
|
|
57789
57044
|
}) => exports_Effect.gen(function* () {
|
|
57790
57045
|
const stage = stageScaffoldById[commandId];
|
|
57791
|
-
const detection =
|
|
57792
|
-
const wikiRoot =
|
|
57046
|
+
const detection = yield* detectRepository(outputDirectory).pipe(exports_Effect.catchAll(() => exports_Effect.succeed(null)));
|
|
57047
|
+
const wikiRoot = detection?.monorepo === true ? "apps/wiki" : "wiki";
|
|
57793
57048
|
const skillFiles = stage.skills.map((skillId) => copySkillDirectory({
|
|
57794
57049
|
outputDirectory,
|
|
57795
57050
|
skillId,
|
|
57796
57051
|
baseline
|
|
57797
57052
|
}));
|
|
57798
|
-
const wikiFiles =
|
|
57053
|
+
const wikiFiles = scaffoldWiki({
|
|
57799
57054
|
outputDirectory,
|
|
57800
57055
|
wikiRoot
|
|
57801
|
-
})
|
|
57056
|
+
});
|
|
57802
57057
|
const operatorPrompt = stage.renderPrompt({ wikiRoot });
|
|
57803
57058
|
yield* prompt4.writeLine(renderScaffoldTitle());
|
|
57804
57059
|
yield* prompt4.writeLine("");
|
|
57805
57060
|
yield* prompt4.writeLine(renderStageIntro({
|
|
57806
57061
|
commandId,
|
|
57807
|
-
title:
|
|
57062
|
+
title: "Requirements",
|
|
57808
57063
|
body: stage.summary
|
|
57809
57064
|
}));
|
|
57810
57065
|
yield* prompt4.writeLine("");
|
|
@@ -57835,7 +57090,7 @@ var baselineOption = exports_Options.optional(exports_Options.choice("baseline",
|
|
|
57835
57090
|
var refreshBaselineOption = exports_Options.boolean("refresh-baseline").pipe(exports_Options.withDescription("Refetch the stable baseline instead of reusing the local cache."));
|
|
57836
57091
|
var stageCommand = (id2, description) => exports_Command.make(id2, { output: outputOption, baseline: baselineOption, refreshBaseline: refreshBaselineOption }, ({ output: output2, baseline, refreshBaseline }) => exports_Effect.scoped(exports_Effect.gen(function* () {
|
|
57837
57092
|
const prompt4 = yield* PromptLive;
|
|
57838
|
-
const outputDirectory =
|
|
57093
|
+
const outputDirectory = path12.resolve(process.cwd(), getOrElse(output2, () => "."));
|
|
57839
57094
|
const resolvedBaseline = yield* exports_Effect.promise(() => resolveBaseline(baselineResolveOptions(baseline, refreshBaseline, outputDirectory)));
|
|
57840
57095
|
yield* runStageScaffold({
|
|
57841
57096
|
commandId: id2,
|
|
@@ -57853,9 +57108,9 @@ var setupCommand = exports_Command.make("setup", {
|
|
|
57853
57108
|
refreshBaseline: refreshBaselineOption
|
|
57854
57109
|
}, ({ input: input2, output: output2, json: json2, repoShape, baseline, refreshBaseline }) => exports_Effect.scoped(exports_Effect.gen(function* () {
|
|
57855
57110
|
const prompt4 = yield* PromptLive;
|
|
57856
|
-
const scanDirectory =
|
|
57111
|
+
const scanDirectory = path12.resolve(process.cwd(), getOrElse(input2, () => "."));
|
|
57857
57112
|
const resolvedBaseline = yield* exports_Effect.promise(() => resolveBaseline(baselineResolveOptions(baseline, refreshBaseline, scanDirectory)));
|
|
57858
|
-
const outputDirectory = map2(output2, (value6) =>
|
|
57113
|
+
const outputDirectory = map2(output2, (value6) => path12.resolve(process.cwd(), value6));
|
|
57859
57114
|
const resolvedRepoShape = getOrElse(repoShape, () => "auto");
|
|
57860
57115
|
yield* runScaffold(isSome2(outputDirectory) ? {
|
|
57861
57116
|
scanDirectory,
|
|
@@ -57878,52 +57133,51 @@ var setupCommand = exports_Command.make("setup", {
|
|
|
57878
57133
|
}) : exports_Effect.fail(new CliPromptError({
|
|
57879
57134
|
cause: error4.cause,
|
|
57880
57135
|
message: error4.message
|
|
57881
|
-
})))))).pipe(exports_Command.withDescription("
|
|
57882
|
-
var scaffoldCommand = exports_Command.make("scaffold", {}, () => exports_Effect.sync(() => console.log(renderScaffoldGuide()))).pipe(exports_Command.withDescription("Scaffold
|
|
57883
|
-
stageCommand("init", "
|
|
57884
|
-
stageCommand("backlog", "Print the backlog-stage operator prompt even though no backlog-stage packs are currently scaffolded."),
|
|
57136
|
+
})))))).pipe(exports_Command.withDescription("Repo-aware AI setup. Agents: activate $dp-cli, then reconcile .devpunks output with the real repo layout."));
|
|
57137
|
+
var scaffoldCommand = exports_Command.make("scaffold", {}, () => exports_Effect.sync(() => console.log(renderScaffoldGuide()))).pipe(exports_Command.withDescription("Scaffold init or setup. Agents: activate $dp-cli before following generated handoffs."), exports_Command.withSubcommands([
|
|
57138
|
+
stageCommand("init", "Seed requirements/backlog skills and wiki structure. Agents: activate $dp-cli and reconcile wiki layout."),
|
|
57885
57139
|
setupCommand
|
|
57886
57140
|
]));
|
|
57887
57141
|
|
|
57888
57142
|
// src/cli/update-command.ts
|
|
57889
|
-
import
|
|
57143
|
+
import path14 from "path";
|
|
57890
57144
|
|
|
57891
57145
|
// src/update/run.ts
|
|
57892
57146
|
import { createHash as createHash3 } from "crypto";
|
|
57893
57147
|
import {
|
|
57894
57148
|
cpSync as cpSync3,
|
|
57895
|
-
existsSync as
|
|
57149
|
+
existsSync as existsSync6,
|
|
57896
57150
|
lstatSync as lstatSync2,
|
|
57897
|
-
mkdirSync as
|
|
57151
|
+
mkdirSync as mkdirSync5,
|
|
57898
57152
|
mkdtempSync as mkdtempSync2,
|
|
57899
|
-
readFileSync as
|
|
57153
|
+
readFileSync as readFileSync6,
|
|
57900
57154
|
readlinkSync as readlinkSync2,
|
|
57901
|
-
rmSync as
|
|
57155
|
+
rmSync as rmSync4,
|
|
57902
57156
|
symlinkSync as symlinkSync2
|
|
57903
57157
|
} from "fs";
|
|
57904
57158
|
import { tmpdir as tmpdir3 } from "os";
|
|
57905
|
-
import
|
|
57159
|
+
import path13 from "path";
|
|
57906
57160
|
|
|
57907
57161
|
// ../../node_modules/.bun/diff@9.0.0/node_modules/diff/libesm/diff/base.js
|
|
57908
57162
|
class Diff {
|
|
57909
|
-
diff(oldStr, newStr,
|
|
57163
|
+
diff(oldStr, newStr, options7 = {}) {
|
|
57910
57164
|
let callback;
|
|
57911
|
-
if (typeof
|
|
57912
|
-
callback =
|
|
57913
|
-
|
|
57914
|
-
} else if ("callback" in
|
|
57915
|
-
callback =
|
|
57916
|
-
}
|
|
57917
|
-
const oldString = this.castInput(oldStr,
|
|
57918
|
-
const newString = this.castInput(newStr,
|
|
57919
|
-
const oldTokens = this.removeEmpty(this.tokenize(oldString,
|
|
57920
|
-
const newTokens = this.removeEmpty(this.tokenize(newString,
|
|
57921
|
-
return this.diffWithOptionsObj(oldTokens, newTokens,
|
|
57922
|
-
}
|
|
57923
|
-
diffWithOptionsObj(oldTokens, newTokens,
|
|
57165
|
+
if (typeof options7 === "function") {
|
|
57166
|
+
callback = options7;
|
|
57167
|
+
options7 = {};
|
|
57168
|
+
} else if ("callback" in options7) {
|
|
57169
|
+
callback = options7.callback;
|
|
57170
|
+
}
|
|
57171
|
+
const oldString = this.castInput(oldStr, options7);
|
|
57172
|
+
const newString = this.castInput(newStr, options7);
|
|
57173
|
+
const oldTokens = this.removeEmpty(this.tokenize(oldString, options7));
|
|
57174
|
+
const newTokens = this.removeEmpty(this.tokenize(newString, options7));
|
|
57175
|
+
return this.diffWithOptionsObj(oldTokens, newTokens, options7, callback);
|
|
57176
|
+
}
|
|
57177
|
+
diffWithOptionsObj(oldTokens, newTokens, options7, callback) {
|
|
57924
57178
|
var _a;
|
|
57925
57179
|
const done9 = (value6) => {
|
|
57926
|
-
value6 = this.postProcess(value6,
|
|
57180
|
+
value6 = this.postProcess(value6, options7);
|
|
57927
57181
|
if (callback) {
|
|
57928
57182
|
setTimeout(function() {
|
|
57929
57183
|
callback(value6);
|
|
@@ -57936,13 +57190,13 @@ class Diff {
|
|
|
57936
57190
|
const newLen = newTokens.length, oldLen = oldTokens.length;
|
|
57937
57191
|
let editLength = 1;
|
|
57938
57192
|
let maxEditLength = newLen + oldLen;
|
|
57939
|
-
if (
|
|
57940
|
-
maxEditLength = Math.min(maxEditLength,
|
|
57193
|
+
if (options7.maxEditLength != null) {
|
|
57194
|
+
maxEditLength = Math.min(maxEditLength, options7.maxEditLength);
|
|
57941
57195
|
}
|
|
57942
|
-
const maxExecutionTime = (_a =
|
|
57196
|
+
const maxExecutionTime = (_a = options7.timeout) !== null && _a !== undefined ? _a : Infinity;
|
|
57943
57197
|
const abortAfterTimestamp = Date.now() + maxExecutionTime;
|
|
57944
57198
|
const bestPath = [{ oldPos: -1, lastComponent: undefined }];
|
|
57945
|
-
let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0,
|
|
57199
|
+
let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options7);
|
|
57946
57200
|
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
|
57947
57201
|
return done9(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));
|
|
57948
57202
|
}
|
|
@@ -57965,11 +57219,11 @@ class Diff {
|
|
|
57965
57219
|
continue;
|
|
57966
57220
|
}
|
|
57967
57221
|
if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
|
|
57968
|
-
basePath = this.addToPath(addPath, true, false, 0,
|
|
57222
|
+
basePath = this.addToPath(addPath, true, false, 0, options7);
|
|
57969
57223
|
} else {
|
|
57970
|
-
basePath = this.addToPath(removePath, false, true, 1,
|
|
57224
|
+
basePath = this.addToPath(removePath, false, true, 1, options7);
|
|
57971
57225
|
}
|
|
57972
|
-
newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath,
|
|
57226
|
+
newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options7);
|
|
57973
57227
|
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
|
57974
57228
|
return done9(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;
|
|
57975
57229
|
} else {
|
|
@@ -58004,42 +57258,42 @@ class Diff {
|
|
|
58004
57258
|
}
|
|
58005
57259
|
}
|
|
58006
57260
|
}
|
|
58007
|
-
addToPath(
|
|
58008
|
-
const last5 =
|
|
58009
|
-
if (last5 && !
|
|
57261
|
+
addToPath(path13, added, removed, oldPosInc, options7) {
|
|
57262
|
+
const last5 = path13.lastComponent;
|
|
57263
|
+
if (last5 && !options7.oneChangePerToken && last5.added === added && last5.removed === removed) {
|
|
58010
57264
|
return {
|
|
58011
|
-
oldPos:
|
|
57265
|
+
oldPos: path13.oldPos + oldPosInc,
|
|
58012
57266
|
lastComponent: { count: last5.count + 1, added, removed, previousComponent: last5.previousComponent }
|
|
58013
57267
|
};
|
|
58014
57268
|
} else {
|
|
58015
57269
|
return {
|
|
58016
|
-
oldPos:
|
|
57270
|
+
oldPos: path13.oldPos + oldPosInc,
|
|
58017
57271
|
lastComponent: { count: 1, added, removed, previousComponent: last5 }
|
|
58018
57272
|
};
|
|
58019
57273
|
}
|
|
58020
57274
|
}
|
|
58021
|
-
extractCommon(basePath, newTokens, oldTokens, diagonalPath,
|
|
57275
|
+
extractCommon(basePath, newTokens, oldTokens, diagonalPath, options7) {
|
|
58022
57276
|
const newLen = newTokens.length, oldLen = oldTokens.length;
|
|
58023
57277
|
let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
|
|
58024
|
-
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1],
|
|
57278
|
+
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options7)) {
|
|
58025
57279
|
newPos++;
|
|
58026
57280
|
oldPos++;
|
|
58027
57281
|
commonCount++;
|
|
58028
|
-
if (
|
|
57282
|
+
if (options7.oneChangePerToken) {
|
|
58029
57283
|
basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };
|
|
58030
57284
|
}
|
|
58031
57285
|
}
|
|
58032
|
-
if (commonCount && !
|
|
57286
|
+
if (commonCount && !options7.oneChangePerToken) {
|
|
58033
57287
|
basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };
|
|
58034
57288
|
}
|
|
58035
57289
|
basePath.oldPos = oldPos;
|
|
58036
57290
|
return newPos;
|
|
58037
57291
|
}
|
|
58038
|
-
equals(left3, right3,
|
|
58039
|
-
if (
|
|
58040
|
-
return
|
|
57292
|
+
equals(left3, right3, options7) {
|
|
57293
|
+
if (options7.comparator) {
|
|
57294
|
+
return options7.comparator(left3, right3);
|
|
58041
57295
|
} else {
|
|
58042
|
-
return left3 === right3 || !!
|
|
57296
|
+
return left3 === right3 || !!options7.ignoreCase && left3.toLowerCase() === right3.toLowerCase();
|
|
58043
57297
|
}
|
|
58044
57298
|
}
|
|
58045
57299
|
removeEmpty(array9) {
|
|
@@ -58051,16 +57305,16 @@ class Diff {
|
|
|
58051
57305
|
}
|
|
58052
57306
|
return ret;
|
|
58053
57307
|
}
|
|
58054
|
-
castInput(value6,
|
|
57308
|
+
castInput(value6, options7) {
|
|
58055
57309
|
return value6;
|
|
58056
57310
|
}
|
|
58057
|
-
tokenize(value6,
|
|
57311
|
+
tokenize(value6, options7) {
|
|
58058
57312
|
return Array.from(value6);
|
|
58059
57313
|
}
|
|
58060
57314
|
join(chars) {
|
|
58061
57315
|
return chars.join("");
|
|
58062
57316
|
}
|
|
58063
|
-
postProcess(changeObjects,
|
|
57317
|
+
postProcess(changeObjects, options7) {
|
|
58064
57318
|
return changeObjects;
|
|
58065
57319
|
}
|
|
58066
57320
|
get useLongestToken() {
|
|
@@ -58232,9 +57486,9 @@ function leadingAndTrailingWs(string8, segmenter) {
|
|
|
58232
57486
|
const segments = segment(string8, segmenter);
|
|
58233
57487
|
const firstSeg = segments[0];
|
|
58234
57488
|
const lastSeg = segments[segments.length - 1];
|
|
58235
|
-
const
|
|
57489
|
+
const head11 = /\s/.test(firstSeg) ? firstSeg : "";
|
|
58236
57490
|
const tail2 = /\s/.test(lastSeg) ? lastSeg : "";
|
|
58237
|
-
return [
|
|
57491
|
+
return [head11, tail2];
|
|
58238
57492
|
}
|
|
58239
57493
|
|
|
58240
57494
|
// ../../node_modules/.bun/diff@9.0.0/node_modules/diff/libesm/diff/word.js
|
|
@@ -58242,17 +57496,17 @@ var extendedWordChars = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-
|
|
|
58242
57496
|
var tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`, "ug");
|
|
58243
57497
|
|
|
58244
57498
|
class WordDiff extends Diff {
|
|
58245
|
-
equals(left3, right3,
|
|
58246
|
-
if (
|
|
57499
|
+
equals(left3, right3, options7) {
|
|
57500
|
+
if (options7.ignoreCase) {
|
|
58247
57501
|
left3 = left3.toLowerCase();
|
|
58248
57502
|
right3 = right3.toLowerCase();
|
|
58249
57503
|
}
|
|
58250
57504
|
return left3.trim() === right3.trim();
|
|
58251
57505
|
}
|
|
58252
|
-
tokenize(value6,
|
|
57506
|
+
tokenize(value6, options7 = {}) {
|
|
58253
57507
|
let parts2;
|
|
58254
|
-
if (
|
|
58255
|
-
const segmenter =
|
|
57508
|
+
if (options7.intlSegmenter) {
|
|
57509
|
+
const segmenter = options7.intlSegmenter;
|
|
58256
57510
|
if (segmenter.resolvedOptions().granularity != "word") {
|
|
58257
57511
|
throw new Error('The segmenter passed must have a granularity of "word"');
|
|
58258
57512
|
}
|
|
@@ -58291,8 +57545,8 @@ class WordDiff extends Diff {
|
|
|
58291
57545
|
}
|
|
58292
57546
|
}).join("");
|
|
58293
57547
|
}
|
|
58294
|
-
postProcess(changes2,
|
|
58295
|
-
if (!changes2 ||
|
|
57548
|
+
postProcess(changes2, options7) {
|
|
57549
|
+
if (!changes2 || options7.oneChangePerToken) {
|
|
58296
57550
|
return changes2;
|
|
58297
57551
|
}
|
|
58298
57552
|
let lastKeep = null;
|
|
@@ -58305,7 +57559,7 @@ class WordDiff extends Diff {
|
|
|
58305
57559
|
deletion = change;
|
|
58306
57560
|
} else {
|
|
58307
57561
|
if (insertion || deletion) {
|
|
58308
|
-
dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change,
|
|
57562
|
+
dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options7.intlSegmenter);
|
|
58309
57563
|
}
|
|
58310
57564
|
lastKeep = change;
|
|
58311
57565
|
insertion = null;
|
|
@@ -58313,7 +57567,7 @@ class WordDiff extends Diff {
|
|
|
58313
57567
|
}
|
|
58314
57568
|
});
|
|
58315
57569
|
if (insertion || deletion) {
|
|
58316
|
-
dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null,
|
|
57570
|
+
dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options7.intlSegmenter);
|
|
58317
57571
|
}
|
|
58318
57572
|
return changes2;
|
|
58319
57573
|
}
|
|
@@ -58379,17 +57633,17 @@ class LineDiff extends Diff {
|
|
|
58379
57633
|
super(...arguments);
|
|
58380
57634
|
this.tokenize = tokenize;
|
|
58381
57635
|
}
|
|
58382
|
-
equals(left3, right3,
|
|
58383
|
-
if (
|
|
58384
|
-
if (!
|
|
57636
|
+
equals(left3, right3, options7) {
|
|
57637
|
+
if (options7.ignoreWhitespace) {
|
|
57638
|
+
if (!options7.newlineIsToken || !left3.includes(`
|
|
58385
57639
|
`)) {
|
|
58386
57640
|
left3 = left3.trim();
|
|
58387
57641
|
}
|
|
58388
|
-
if (!
|
|
57642
|
+
if (!options7.newlineIsToken || !right3.includes(`
|
|
58389
57643
|
`)) {
|
|
58390
57644
|
right3 = right3.trim();
|
|
58391
57645
|
}
|
|
58392
|
-
} else if (
|
|
57646
|
+
} else if (options7.ignoreNewlineAtEof && !options7.newlineIsToken) {
|
|
58393
57647
|
if (left3.endsWith(`
|
|
58394
57648
|
`)) {
|
|
58395
57649
|
left3 = left3.slice(0, -1);
|
|
@@ -58399,15 +57653,15 @@ class LineDiff extends Diff {
|
|
|
58399
57653
|
right3 = right3.slice(0, -1);
|
|
58400
57654
|
}
|
|
58401
57655
|
}
|
|
58402
|
-
return super.equals(left3, right3,
|
|
57656
|
+
return super.equals(left3, right3, options7);
|
|
58403
57657
|
}
|
|
58404
57658
|
}
|
|
58405
57659
|
var lineDiff = new LineDiff;
|
|
58406
|
-
function diffLines(oldStr, newStr,
|
|
58407
|
-
return lineDiff.diff(oldStr, newStr,
|
|
57660
|
+
function diffLines(oldStr, newStr, options7) {
|
|
57661
|
+
return lineDiff.diff(oldStr, newStr, options7);
|
|
58408
57662
|
}
|
|
58409
|
-
function tokenize(value6,
|
|
58410
|
-
if (
|
|
57663
|
+
function tokenize(value6, options7) {
|
|
57664
|
+
if (options7.stripTrailingCr) {
|
|
58411
57665
|
value6 = value6.replace(/\r\n/g, `
|
|
58412
57666
|
`);
|
|
58413
57667
|
}
|
|
@@ -58417,7 +57671,7 @@ function tokenize(value6, options9) {
|
|
|
58417
57671
|
}
|
|
58418
57672
|
for (let i = 0;i < linesAndNewlines.length; i++) {
|
|
58419
57673
|
const line4 = linesAndNewlines[i];
|
|
58420
|
-
if (i % 2 && !
|
|
57674
|
+
if (i % 2 && !options7.newlineIsToken) {
|
|
58421
57675
|
retLines[retLines.length - 1] += line4;
|
|
58422
57676
|
} else {
|
|
58423
57677
|
retLines.push(line4);
|
|
@@ -58473,12 +57727,12 @@ class JsonDiff extends Diff {
|
|
|
58473
57727
|
get useLongestToken() {
|
|
58474
57728
|
return true;
|
|
58475
57729
|
}
|
|
58476
|
-
castInput(value6,
|
|
58477
|
-
const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === "undefined" ? undefinedReplacement : v } =
|
|
57730
|
+
castInput(value6, options7) {
|
|
57731
|
+
const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === "undefined" ? undefinedReplacement : v } = options7;
|
|
58478
57732
|
return typeof value6 === "string" ? value6 : JSON.stringify(canonicalize(value6, null, null, stringifyReplacer), null, " ");
|
|
58479
57733
|
}
|
|
58480
|
-
equals(left3, right3,
|
|
58481
|
-
return super.equals(left3.replace(/,([\r\n])/g, "$1"), right3.replace(/,([\r\n])/g, "$1"),
|
|
57734
|
+
equals(left3, right3, options7) {
|
|
57735
|
+
return super.equals(left3.replace(/,([\r\n])/g, "$1"), right3.replace(/,([\r\n])/g, "$1"), options7);
|
|
58482
57736
|
}
|
|
58483
57737
|
}
|
|
58484
57738
|
var jsonDiff = new JsonDiff;
|
|
@@ -58598,14 +57852,14 @@ var INCLUDE_HEADERS = {
|
|
|
58598
57852
|
includeUnderline: true,
|
|
58599
57853
|
includeFileHeaders: true
|
|
58600
57854
|
};
|
|
58601
|
-
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader,
|
|
57855
|
+
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options7) {
|
|
58602
57856
|
let optionsObj;
|
|
58603
|
-
if (!
|
|
57857
|
+
if (!options7) {
|
|
58604
57858
|
optionsObj = {};
|
|
58605
|
-
} else if (typeof
|
|
58606
|
-
optionsObj = { callback:
|
|
57859
|
+
} else if (typeof options7 === "function") {
|
|
57860
|
+
optionsObj = { callback: options7 };
|
|
58607
57861
|
} else {
|
|
58608
|
-
optionsObj =
|
|
57862
|
+
optionsObj = options7;
|
|
58609
57863
|
}
|
|
58610
57864
|
if (typeof optionsObj.context === "undefined") {
|
|
58611
57865
|
optionsObj.context = 4;
|
|
@@ -58619,8 +57873,8 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
|
|
|
58619
57873
|
} else {
|
|
58620
57874
|
const { callback } = optionsObj;
|
|
58621
57875
|
diffLines(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff8) => {
|
|
58622
|
-
const
|
|
58623
|
-
callback(
|
|
57876
|
+
const patch13 = diffLinesResultToPatch(diff8);
|
|
57877
|
+
callback(patch13);
|
|
58624
57878
|
} }));
|
|
58625
57879
|
}
|
|
58626
57880
|
function diffLinesResultToPatch(diff8) {
|
|
@@ -58705,68 +57959,68 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
|
|
|
58705
57959
|
};
|
|
58706
57960
|
}
|
|
58707
57961
|
}
|
|
58708
|
-
function formatPatch(
|
|
57962
|
+
function formatPatch(patch13, headerOptions) {
|
|
58709
57963
|
var _a, _b, _c, _d, _e, _f;
|
|
58710
57964
|
if (!headerOptions) {
|
|
58711
57965
|
headerOptions = INCLUDE_HEADERS;
|
|
58712
57966
|
}
|
|
58713
|
-
if (Array.isArray(
|
|
58714
|
-
if (
|
|
57967
|
+
if (Array.isArray(patch13)) {
|
|
57968
|
+
if (patch13.length > 1 && !headerOptions.includeFileHeaders && !patch13.every((p3) => p3.isGit)) {
|
|
58715
57969
|
throw new Error("Cannot omit file headers on a multi-file patch. " + "(The result would be unparseable; how would a tool trying to apply " + "the patch know which changes are to which file?)");
|
|
58716
57970
|
}
|
|
58717
|
-
return
|
|
57971
|
+
return patch13.map((p3) => formatPatch(p3, headerOptions)).join(`
|
|
58718
57972
|
`);
|
|
58719
57973
|
}
|
|
58720
57974
|
const ret = [];
|
|
58721
|
-
if (
|
|
57975
|
+
if (patch13.isGit) {
|
|
58722
57976
|
headerOptions = INCLUDE_HEADERS;
|
|
58723
|
-
if (!
|
|
57977
|
+
if (!patch13.oldFileName) {
|
|
58724
57978
|
throw new Error("oldFileName must be specified for Git patches");
|
|
58725
57979
|
}
|
|
58726
|
-
if (!
|
|
57980
|
+
if (!patch13.newFileName) {
|
|
58727
57981
|
throw new Error("newFileName must be specified for Git patches");
|
|
58728
57982
|
}
|
|
58729
|
-
let gitOldName =
|
|
58730
|
-
let gitNewName =
|
|
58731
|
-
if (
|
|
57983
|
+
let gitOldName = patch13.oldFileName;
|
|
57984
|
+
let gitNewName = patch13.newFileName;
|
|
57985
|
+
if (patch13.isCreate && gitOldName === "/dev/null") {
|
|
58732
57986
|
gitOldName = gitNewName.replace(/^b\//, "a/");
|
|
58733
|
-
} else if (
|
|
57987
|
+
} else if (patch13.isDelete && gitNewName === "/dev/null") {
|
|
58734
57988
|
gitNewName = gitOldName.replace(/^a\//, "b/");
|
|
58735
57989
|
}
|
|
58736
57990
|
ret.push("diff --git " + quoteFileNameIfNeeded(gitOldName) + " " + quoteFileNameIfNeeded(gitNewName));
|
|
58737
|
-
if (
|
|
58738
|
-
ret.push("deleted file mode " + ((_a =
|
|
57991
|
+
if (patch13.isDelete) {
|
|
57992
|
+
ret.push("deleted file mode " + ((_a = patch13.oldMode) !== null && _a !== undefined ? _a : "100644"));
|
|
58739
57993
|
}
|
|
58740
|
-
if (
|
|
58741
|
-
ret.push("new file mode " + ((_b =
|
|
57994
|
+
if (patch13.isCreate) {
|
|
57995
|
+
ret.push("new file mode " + ((_b = patch13.newMode) !== null && _b !== undefined ? _b : "100644"));
|
|
58742
57996
|
}
|
|
58743
|
-
if (
|
|
58744
|
-
ret.push("old mode " +
|
|
58745
|
-
ret.push("new mode " +
|
|
57997
|
+
if (patch13.oldMode && patch13.newMode && !patch13.isDelete && !patch13.isCreate) {
|
|
57998
|
+
ret.push("old mode " + patch13.oldMode);
|
|
57999
|
+
ret.push("new mode " + patch13.newMode);
|
|
58746
58000
|
}
|
|
58747
|
-
if (
|
|
58748
|
-
ret.push("rename from " + quoteFileNameIfNeeded(((_c =
|
|
58749
|
-
ret.push("rename to " + quoteFileNameIfNeeded(((_d =
|
|
58001
|
+
if (patch13.isRename) {
|
|
58002
|
+
ret.push("rename from " + quoteFileNameIfNeeded(((_c = patch13.oldFileName) !== null && _c !== undefined ? _c : "").replace(/^a\//, "")));
|
|
58003
|
+
ret.push("rename to " + quoteFileNameIfNeeded(((_d = patch13.newFileName) !== null && _d !== undefined ? _d : "").replace(/^b\//, "")));
|
|
58750
58004
|
}
|
|
58751
|
-
if (
|
|
58752
|
-
ret.push("copy from " + quoteFileNameIfNeeded(((_e =
|
|
58753
|
-
ret.push("copy to " + quoteFileNameIfNeeded(((_f =
|
|
58005
|
+
if (patch13.isCopy) {
|
|
58006
|
+
ret.push("copy from " + quoteFileNameIfNeeded(((_e = patch13.oldFileName) !== null && _e !== undefined ? _e : "").replace(/^a\//, "")));
|
|
58007
|
+
ret.push("copy to " + quoteFileNameIfNeeded(((_f = patch13.newFileName) !== null && _f !== undefined ? _f : "").replace(/^b\//, "")));
|
|
58754
58008
|
}
|
|
58755
58009
|
} else {
|
|
58756
|
-
if (headerOptions.includeIndex &&
|
|
58757
|
-
ret.push("Index: " +
|
|
58010
|
+
if (headerOptions.includeIndex && patch13.oldFileName == patch13.newFileName && patch13.oldFileName !== undefined) {
|
|
58011
|
+
ret.push("Index: " + patch13.oldFileName);
|
|
58758
58012
|
}
|
|
58759
58013
|
if (headerOptions.includeUnderline) {
|
|
58760
58014
|
ret.push("===================================================================");
|
|
58761
58015
|
}
|
|
58762
58016
|
}
|
|
58763
|
-
const hasHunks =
|
|
58764
|
-
if (headerOptions.includeFileHeaders &&
|
|
58765
|
-
ret.push("--- " + quoteFileNameIfNeeded(
|
|
58766
|
-
ret.push("+++ " + quoteFileNameIfNeeded(
|
|
58017
|
+
const hasHunks = patch13.hunks.length > 0;
|
|
58018
|
+
if (headerOptions.includeFileHeaders && patch13.oldFileName !== undefined && patch13.newFileName !== undefined && (!patch13.isGit || hasHunks)) {
|
|
58019
|
+
ret.push("--- " + quoteFileNameIfNeeded(patch13.oldFileName) + (patch13.oldHeader ? "\t" + patch13.oldHeader : ""));
|
|
58020
|
+
ret.push("+++ " + quoteFileNameIfNeeded(patch13.newFileName) + (patch13.newHeader ? "\t" + patch13.newHeader : ""));
|
|
58767
58021
|
}
|
|
58768
|
-
for (let i = 0;i <
|
|
58769
|
-
const hunk =
|
|
58022
|
+
for (let i = 0;i < patch13.hunks.length; i++) {
|
|
58023
|
+
const hunk = patch13.hunks[i];
|
|
58770
58024
|
const oldStart = hunk.oldLines === 0 ? hunk.oldStart - 1 : hunk.oldStart;
|
|
58771
58025
|
const newStart = hunk.newLines === 0 ? hunk.newStart - 1 : hunk.newStart;
|
|
58772
58026
|
ret.push("@@ -" + oldStart + "," + hunk.oldLines + " +" + newStart + "," + hunk.newLines + " @@");
|
|
@@ -58778,23 +58032,23 @@ function formatPatch(patch15, headerOptions) {
|
|
|
58778
58032
|
`) + `
|
|
58779
58033
|
`;
|
|
58780
58034
|
}
|
|
58781
|
-
function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader,
|
|
58782
|
-
if (typeof
|
|
58783
|
-
|
|
58035
|
+
function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options7) {
|
|
58036
|
+
if (typeof options7 === "function") {
|
|
58037
|
+
options7 = { callback: options7 };
|
|
58784
58038
|
}
|
|
58785
|
-
if (!(
|
|
58786
|
-
const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader,
|
|
58039
|
+
if (!(options7 === null || options7 === undefined ? undefined : options7.callback)) {
|
|
58040
|
+
const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options7);
|
|
58787
58041
|
if (!patchObj) {
|
|
58788
58042
|
return;
|
|
58789
58043
|
}
|
|
58790
|
-
return formatPatch(patchObj,
|
|
58044
|
+
return formatPatch(patchObj, options7 === null || options7 === undefined ? undefined : options7.headerOptions);
|
|
58791
58045
|
} else {
|
|
58792
|
-
const { callback } =
|
|
58793
|
-
structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({},
|
|
58046
|
+
const { callback } = options7;
|
|
58047
|
+
structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({}, options7), { callback: (patchObj) => {
|
|
58794
58048
|
if (!patchObj) {
|
|
58795
58049
|
callback(undefined);
|
|
58796
58050
|
} else {
|
|
58797
|
-
callback(formatPatch(patchObj,
|
|
58051
|
+
callback(formatPatch(patchObj, options7.headerOptions));
|
|
58798
58052
|
}
|
|
58799
58053
|
} }));
|
|
58800
58054
|
}
|
|
@@ -58846,15 +58100,15 @@ var selectedSkills3 = (finalPacks, baseline) => [
|
|
|
58846
58100
|
...new Set(finalPacks.flatMap((packId) => skillsForPack(packId, baseline)))
|
|
58847
58101
|
].toSorted();
|
|
58848
58102
|
var readManifest = (rootDirectory) => {
|
|
58849
|
-
const manifestPath =
|
|
58850
|
-
if (!
|
|
58103
|
+
const manifestPath = path13.join(rootDirectory, scaffoldManifestFile);
|
|
58104
|
+
if (!existsSync6(manifestPath)) {
|
|
58851
58105
|
throw new Error(`Missing ${scaffoldManifestFile}. Run \`punks scaffold setup\` first.`);
|
|
58852
58106
|
}
|
|
58853
|
-
return parseManifest(
|
|
58107
|
+
return parseManifest(readFileSync6(manifestPath, "utf8"));
|
|
58854
58108
|
};
|
|
58855
58109
|
var contentForDiff = (rootDirectory, relativePath) => {
|
|
58856
|
-
const absolutePath =
|
|
58857
|
-
if (!
|
|
58110
|
+
const absolutePath = path13.join(rootDirectory, relativePath);
|
|
58111
|
+
if (!existsSync6(absolutePath)) {
|
|
58858
58112
|
return "";
|
|
58859
58113
|
}
|
|
58860
58114
|
const stat3 = lstatSync2(absolutePath);
|
|
@@ -58862,15 +58116,15 @@ var contentForDiff = (rootDirectory, relativePath) => {
|
|
|
58862
58116
|
return `symlink:${readlinkSync2(absolutePath)}
|
|
58863
58117
|
`;
|
|
58864
58118
|
}
|
|
58865
|
-
return
|
|
58119
|
+
return readFileSync6(absolutePath, "utf8");
|
|
58866
58120
|
};
|
|
58867
58121
|
var hashPath = (rootDirectory, relativePath) => {
|
|
58868
|
-
const absolutePath =
|
|
58869
|
-
if (!
|
|
58122
|
+
const absolutePath = path13.join(rootDirectory, relativePath);
|
|
58123
|
+
if (!existsSync6(absolutePath)) {
|
|
58870
58124
|
return null;
|
|
58871
58125
|
}
|
|
58872
58126
|
const stat3 = lstatSync2(absolutePath);
|
|
58873
|
-
const content = stat3.isSymbolicLink() ? `symlink:${readlinkSync2(absolutePath)}` :
|
|
58127
|
+
const content = stat3.isSymbolicLink() ? `symlink:${readlinkSync2(absolutePath)}` : readFileSync6(absolutePath);
|
|
58874
58128
|
return hashContent2(content);
|
|
58875
58129
|
};
|
|
58876
58130
|
var copyManagedFile = ({
|
|
@@ -58878,12 +58132,12 @@ var copyManagedFile = ({
|
|
|
58878
58132
|
toDirectory,
|
|
58879
58133
|
relativePath
|
|
58880
58134
|
}) => {
|
|
58881
|
-
const sourcePath =
|
|
58882
|
-
const targetPath =
|
|
58135
|
+
const sourcePath = path13.join(fromDirectory, relativePath);
|
|
58136
|
+
const targetPath = path13.join(toDirectory, relativePath);
|
|
58883
58137
|
const stat3 = lstatSync2(sourcePath);
|
|
58884
|
-
|
|
58885
|
-
if (
|
|
58886
|
-
|
|
58138
|
+
mkdirSync5(path13.dirname(targetPath), { recursive: true });
|
|
58139
|
+
if (existsSync6(targetPath)) {
|
|
58140
|
+
rmSync4(targetPath, { recursive: true, force: true });
|
|
58887
58141
|
}
|
|
58888
58142
|
if (stat3.isSymbolicLink()) {
|
|
58889
58143
|
symlinkSync2(readlinkSync2(sourcePath), targetPath);
|
|
@@ -59000,7 +58254,7 @@ var runUpdate = ({
|
|
|
59000
58254
|
const baselineDrift = typeof manifestBaseline?.version === "string" && manifestBaseline.version !== baseline.summary.version;
|
|
59001
58255
|
const resolvedPacks = resolved.preselectedPacks;
|
|
59002
58256
|
const packDrift = !comparePacks(finalPacks, resolvedPacks);
|
|
59003
|
-
const expectedDirectory = mkdtempSync2(
|
|
58257
|
+
const expectedDirectory = mkdtempSync2(path13.join(tmpdir3(), "punks-update-"));
|
|
59004
58258
|
const expected = yield* writeScaffoldOutput({
|
|
59005
58259
|
scanDirectory: rootDirectory,
|
|
59006
58260
|
detection,
|
|
@@ -59095,7 +58349,7 @@ var runUpdate = ({
|
|
|
59095
58349
|
});
|
|
59096
58350
|
}
|
|
59097
58351
|
for (const staleFile of staleFiles) {
|
|
59098
|
-
|
|
58352
|
+
rmSync4(path13.join(rootDirectory, staleFile), { recursive: true, force: true });
|
|
59099
58353
|
}
|
|
59100
58354
|
}
|
|
59101
58355
|
if (check2 && needsAttention) {
|
|
@@ -59130,7 +58384,7 @@ var runUpdate = ({
|
|
|
59130
58384
|
yield* prompt4.writeLine(renderJsonLabel());
|
|
59131
58385
|
yield* prompt4.writeLine(encodePrettyJson2(result));
|
|
59132
58386
|
}
|
|
59133
|
-
|
|
58387
|
+
rmSync4(expectedDirectory, { recursive: true, force: true });
|
|
59134
58388
|
if (result.applied) {
|
|
59135
58389
|
submitCliEvent("cli.scaffold.update.applied", {
|
|
59136
58390
|
cwd: rootDirectory,
|
|
@@ -59158,7 +58412,7 @@ var updateCommand = exports_Command.make("update", {
|
|
|
59158
58412
|
refreshBaseline: refreshBaselineOption2
|
|
59159
58413
|
}, ({ input: input2, check: check2, write: write4, json: json2, baseline, refreshBaseline }) => exports_Effect.scoped(exports_Effect.gen(function* () {
|
|
59160
58414
|
const prompt4 = yield* PromptLive;
|
|
59161
|
-
const rootDirectory =
|
|
58415
|
+
const rootDirectory = path14.resolve(process.cwd(), getOrElse(input2, () => "."));
|
|
59162
58416
|
const resolvedBaseline = yield* exports_Effect.promise(() => resolveBaseline(baselineResolveOptions(baseline, refreshBaseline, rootDirectory)));
|
|
59163
58417
|
yield* runUpdate({
|
|
59164
58418
|
rootDirectory,
|
|
@@ -59453,8 +58707,8 @@ var startupCheckWorkerEnv = "DP_STARTUP_CHECK_WORKER";
|
|
|
59453
58707
|
var startupCheckCliEnv = "DP_STARTUP_CHECK_CLI";
|
|
59454
58708
|
var startupCheckSkillEnv = "DP_STARTUP_CHECK_SKILL";
|
|
59455
58709
|
var startupCheckIntervalMs = Number.parseInt(process.env.DP_STARTUP_CHECK_INTERVAL_MS ?? String(12 * 60 * 60 * 1000), 10);
|
|
59456
|
-
var startupCheckCacheFile =
|
|
59457
|
-
var app = exports_Command.make("punks", {}, () => exports_Effect.sync(() => console.log(renderCommandGuide()))).pipe(exports_Command.withDescription("Harness Intelligence
|
|
58710
|
+
var startupCheckCacheFile = path15.join(homedir3(), ".cache", "punks", "startup-check.json");
|
|
58711
|
+
var app = exports_Command.make("punks", {}, () => exports_Effect.sync(() => console.log(renderCommandGuide()))).pipe(exports_Command.withDescription("Harness Intelligence CLI. Agents: activate $dp-cli before acting on generated .devpunks output."), exports_Command.withSubcommands([reportCommand, scaffoldCommand, updateCommand]));
|
|
59458
58712
|
var cli = exports_Command.run(app, {
|
|
59459
58713
|
name: "punks",
|
|
59460
58714
|
version
|
|
@@ -59501,15 +58755,15 @@ var hasFreshStartupCheck = () => {
|
|
|
59501
58755
|
return false;
|
|
59502
58756
|
}
|
|
59503
58757
|
try {
|
|
59504
|
-
const parsed = JSON.parse(
|
|
58758
|
+
const parsed = JSON.parse(readFileSync7(startupCheckCacheFile, "utf8"));
|
|
59505
58759
|
return typeof parsed.checkedAt === "number" && Date.now() - parsed.checkedAt < startupCheckIntervalMs;
|
|
59506
58760
|
} catch {
|
|
59507
58761
|
return false;
|
|
59508
58762
|
}
|
|
59509
58763
|
};
|
|
59510
58764
|
var markStartupCheckStarted = () => {
|
|
59511
|
-
|
|
59512
|
-
|
|
58765
|
+
mkdirSync6(path15.dirname(startupCheckCacheFile), { recursive: true });
|
|
58766
|
+
writeFileSync5(startupCheckCacheFile, JSON.stringify({ checkedAt: Date.now() }, null, 2));
|
|
59513
58767
|
};
|
|
59514
58768
|
var startBackgroundStartupChecks = () => {
|
|
59515
58769
|
const checkCli = shouldCheckSelfUpdate();
|
|
@@ -59518,7 +58772,7 @@ var startBackgroundStartupChecks = () => {
|
|
|
59518
58772
|
return;
|
|
59519
58773
|
}
|
|
59520
58774
|
const entrypoint = process.argv[1];
|
|
59521
|
-
if (entrypoint === undefined || !
|
|
58775
|
+
if (entrypoint === undefined || !existsSync7(entrypoint)) {
|
|
59522
58776
|
return;
|
|
59523
58777
|
}
|
|
59524
58778
|
markStartupCheckStarted();
|