@eigenpal/cli 0.5.3 → 0.5.4
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/CHANGELOG.md +1 -0
- package/dist/cli.js +1215 -255
- package/dist/skill/reference/cli/git.md +213 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -28726,11 +28726,11 @@ var init_otel = __esm(() => {
|
|
|
28726
28726
|
});
|
|
28727
28727
|
|
|
28728
28728
|
// ../types/src/execution-row.ts
|
|
28729
|
-
function isTerminalExecutionStatus(
|
|
28730
|
-
return
|
|
28729
|
+
function isTerminalExecutionStatus(status) {
|
|
28730
|
+
return status != null && TERMINAL_STATUS_SET.has(status);
|
|
28731
28731
|
}
|
|
28732
|
-
function isNonSuccessTerminalExecutionStatus(
|
|
28733
|
-
return
|
|
28732
|
+
function isNonSuccessTerminalExecutionStatus(status) {
|
|
28733
|
+
return status != null && NON_SUCCESS_TERMINAL_SET.has(status);
|
|
28734
28734
|
}
|
|
28735
28735
|
function executionWallClockMs(startedAt, completedAt) {
|
|
28736
28736
|
if (startedAt == null || completedAt == null)
|
|
@@ -32687,13 +32687,13 @@ var require_lib = __commonJS((exports) => {
|
|
|
32687
32687
|
flowEnumMemberRaw() {
|
|
32688
32688
|
const loc = this.state.startLoc;
|
|
32689
32689
|
const id = this.parseIdentifier(true);
|
|
32690
|
-
const
|
|
32690
|
+
const init = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
32691
32691
|
type: "none",
|
|
32692
32692
|
loc
|
|
32693
32693
|
};
|
|
32694
32694
|
return {
|
|
32695
32695
|
id,
|
|
32696
|
-
init
|
|
32696
|
+
init
|
|
32697
32697
|
};
|
|
32698
32698
|
}
|
|
32699
32699
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -32727,7 +32727,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
32727
32727
|
const memberNode = this.startNode();
|
|
32728
32728
|
const {
|
|
32729
32729
|
id,
|
|
32730
|
-
init
|
|
32730
|
+
init
|
|
32731
32731
|
} = this.flowEnumMemberRaw();
|
|
32732
32732
|
const memberName = id.name;
|
|
32733
32733
|
if (memberName === "") {
|
|
@@ -32753,35 +32753,35 @@ var require_lib = __commonJS((exports) => {
|
|
|
32753
32753
|
memberName
|
|
32754
32754
|
};
|
|
32755
32755
|
memberNode.id = id;
|
|
32756
|
-
switch (
|
|
32756
|
+
switch (init.type) {
|
|
32757
32757
|
case "boolean": {
|
|
32758
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
32759
|
-
memberNode.init =
|
|
32758
|
+
this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean");
|
|
32759
|
+
memberNode.init = init.value;
|
|
32760
32760
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
32761
32761
|
break;
|
|
32762
32762
|
}
|
|
32763
32763
|
case "number": {
|
|
32764
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
32765
|
-
memberNode.init =
|
|
32764
|
+
this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number");
|
|
32765
|
+
memberNode.init = init.value;
|
|
32766
32766
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
32767
32767
|
break;
|
|
32768
32768
|
}
|
|
32769
32769
|
case "string": {
|
|
32770
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
32771
|
-
memberNode.init =
|
|
32770
|
+
this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string");
|
|
32771
|
+
memberNode.init = init.value;
|
|
32772
32772
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
32773
32773
|
break;
|
|
32774
32774
|
}
|
|
32775
32775
|
case "invalid": {
|
|
32776
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
32776
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);
|
|
32777
32777
|
}
|
|
32778
32778
|
case "none": {
|
|
32779
32779
|
switch (explicitType) {
|
|
32780
32780
|
case "boolean":
|
|
32781
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
32781
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context);
|
|
32782
32782
|
break;
|
|
32783
32783
|
case "number":
|
|
32784
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
32784
|
+
this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);
|
|
32785
32785
|
break;
|
|
32786
32786
|
default:
|
|
32787
32787
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -38411,14 +38411,14 @@ var require_lib = __commonJS((exports) => {
|
|
|
38411
38411
|
}
|
|
38412
38412
|
for (const {
|
|
38413
38413
|
id,
|
|
38414
|
-
init
|
|
38414
|
+
init
|
|
38415
38415
|
} of declaration.declarations) {
|
|
38416
|
-
if (!
|
|
38416
|
+
if (!init)
|
|
38417
38417
|
continue;
|
|
38418
38418
|
if (kind === "var" || kind === "let" || !!id.typeAnnotation) {
|
|
38419
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
38420
|
-
} else if (!isValidAmbientConstInitializer(
|
|
38421
|
-
this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
38419
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init);
|
|
38420
|
+
} else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) {
|
|
38421
|
+
this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init);
|
|
38422
38422
|
}
|
|
38423
38423
|
}
|
|
38424
38424
|
return declaration;
|
|
@@ -42098,47 +42098,47 @@ var require_lib = __commonJS((exports) => {
|
|
|
42098
42098
|
}
|
|
42099
42099
|
this.next();
|
|
42100
42100
|
this.parseVar(initNode, true, kind);
|
|
42101
|
-
const
|
|
42101
|
+
const init2 = this.finishNode(initNode, "VariableDeclaration");
|
|
42102
42102
|
const isForIn = this.match(58);
|
|
42103
42103
|
if (isForIn && starsWithUsingDeclaration) {
|
|
42104
|
-
this.raise(Errors.ForInUsing,
|
|
42104
|
+
this.raise(Errors.ForInUsing, init2);
|
|
42105
42105
|
}
|
|
42106
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
42107
|
-
return this.parseForIn(node,
|
|
42106
|
+
if ((isForIn || this.isContextual(102)) && init2.declarations.length === 1) {
|
|
42107
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
42108
42108
|
}
|
|
42109
42109
|
if (awaitAt !== null) {
|
|
42110
42110
|
this.unexpected(awaitAt);
|
|
42111
42111
|
}
|
|
42112
|
-
return this.parseFor(node,
|
|
42112
|
+
return this.parseFor(node, init2);
|
|
42113
42113
|
}
|
|
42114
42114
|
}
|
|
42115
42115
|
const startsWithAsync = this.isContextual(95);
|
|
42116
42116
|
const refExpressionErrors = new ExpressionErrors;
|
|
42117
|
-
const
|
|
42117
|
+
const init = this.parseExpression(true, refExpressionErrors);
|
|
42118
42118
|
const isForOf = this.isContextual(102);
|
|
42119
42119
|
if (isForOf) {
|
|
42120
42120
|
if (startsWithLet) {
|
|
42121
|
-
this.raise(Errors.ForOfLet,
|
|
42121
|
+
this.raise(Errors.ForOfLet, init);
|
|
42122
42122
|
}
|
|
42123
|
-
if (awaitAt === null && startsWithAsync &&
|
|
42124
|
-
this.raise(Errors.ForOfAsync,
|
|
42123
|
+
if (awaitAt === null && startsWithAsync && init.type === "Identifier") {
|
|
42124
|
+
this.raise(Errors.ForOfAsync, init);
|
|
42125
42125
|
}
|
|
42126
42126
|
}
|
|
42127
42127
|
if (isForOf || this.match(58)) {
|
|
42128
42128
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
42129
|
-
this.toAssignable(
|
|
42129
|
+
this.toAssignable(init, true);
|
|
42130
42130
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
42131
|
-
this.checkLVal(
|
|
42131
|
+
this.checkLVal(init, {
|
|
42132
42132
|
type
|
|
42133
42133
|
});
|
|
42134
|
-
return this.parseForIn(node,
|
|
42134
|
+
return this.parseForIn(node, init, awaitAt);
|
|
42135
42135
|
} else {
|
|
42136
42136
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
42137
42137
|
}
|
|
42138
42138
|
if (awaitAt !== null) {
|
|
42139
42139
|
this.unexpected(awaitAt);
|
|
42140
42140
|
}
|
|
42141
|
-
return this.parseFor(node,
|
|
42141
|
+
return this.parseFor(node, init);
|
|
42142
42142
|
}
|
|
42143
42143
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
42144
42144
|
this.next();
|
|
@@ -42357,8 +42357,8 @@ var require_lib = __commonJS((exports) => {
|
|
|
42357
42357
|
}
|
|
42358
42358
|
this.next();
|
|
42359
42359
|
}
|
|
42360
|
-
parseFor(node,
|
|
42361
|
-
node.init =
|
|
42360
|
+
parseFor(node, init) {
|
|
42361
|
+
node.init = init;
|
|
42362
42362
|
this.semicolon(false);
|
|
42363
42363
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
42364
42364
|
this.semicolon(false);
|
|
@@ -42369,7 +42369,7 @@ var require_lib = __commonJS((exports) => {
|
|
|
42369
42369
|
this.state.labels.pop();
|
|
42370
42370
|
return this.finishNode(node, "ForStatement");
|
|
42371
42371
|
}
|
|
42372
|
-
parseForIn(node,
|
|
42372
|
+
parseForIn(node, init, awaitAt) {
|
|
42373
42373
|
const isForIn = this.match(58);
|
|
42374
42374
|
this.next();
|
|
42375
42375
|
if (isForIn) {
|
|
@@ -42378,19 +42378,19 @@ var require_lib = __commonJS((exports) => {
|
|
|
42378
42378
|
} else {
|
|
42379
42379
|
node.await = awaitAt !== null;
|
|
42380
42380
|
}
|
|
42381
|
-
if (
|
|
42382
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
42381
|
+
if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
|
|
42382
|
+
this.raise(Errors.ForInOfLoopInitializer, init, {
|
|
42383
42383
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
42384
42384
|
});
|
|
42385
42385
|
}
|
|
42386
|
-
if (
|
|
42387
|
-
this.raise(Errors.InvalidLhs,
|
|
42386
|
+
if (init.type === "AssignmentPattern") {
|
|
42387
|
+
this.raise(Errors.InvalidLhs, init, {
|
|
42388
42388
|
ancestor: {
|
|
42389
42389
|
type: "ForStatement"
|
|
42390
42390
|
}
|
|
42391
42391
|
});
|
|
42392
42392
|
}
|
|
42393
|
-
node.left =
|
|
42393
|
+
node.left = init;
|
|
42394
42394
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
42395
42395
|
this.expect(11);
|
|
42396
42396
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -55779,7 +55779,7 @@ var require_sourcemap_codec_umd = __commonJS((exports, module) => {
|
|
|
55779
55779
|
intToChar[i] = c2;
|
|
55780
55780
|
charToInt[c2] = i;
|
|
55781
55781
|
}
|
|
55782
|
-
function decodeInteger(reader,
|
|
55782
|
+
function decodeInteger(reader, relative) {
|
|
55783
55783
|
let value = 0;
|
|
55784
55784
|
let shift = 0;
|
|
55785
55785
|
let integer2 = 0;
|
|
@@ -55794,10 +55794,10 @@ var require_sourcemap_codec_umd = __commonJS((exports, module) => {
|
|
|
55794
55794
|
if (shouldNegate) {
|
|
55795
55795
|
value = -2147483648 | -value;
|
|
55796
55796
|
}
|
|
55797
|
-
return
|
|
55797
|
+
return relative + value;
|
|
55798
55798
|
}
|
|
55799
|
-
function encodeInteger(builder, num,
|
|
55800
|
-
let delta = num -
|
|
55799
|
+
function encodeInteger(builder, num, relative) {
|
|
55800
|
+
let delta = num - relative;
|
|
55801
55801
|
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
55802
55802
|
do {
|
|
55803
55803
|
let clamped = delta & 31;
|
|
@@ -56305,7 +56305,7 @@ var require_resolve_uri_umd = __commonJS((exports, module) => {
|
|
|
56305
56305
|
}
|
|
56306
56306
|
url2.path = path2;
|
|
56307
56307
|
}
|
|
56308
|
-
function
|
|
56308
|
+
function resolve(input, base) {
|
|
56309
56309
|
if (!input && !base)
|
|
56310
56310
|
return "";
|
|
56311
56311
|
const url2 = parseUrl(input);
|
|
@@ -56352,7 +56352,7 @@ var require_resolve_uri_umd = __commonJS((exports, module) => {
|
|
|
56352
56352
|
return url2.scheme + "//" + url2.user + url2.host + url2.port + url2.path + queryHash;
|
|
56353
56353
|
}
|
|
56354
56354
|
}
|
|
56355
|
-
return
|
|
56355
|
+
return resolve;
|
|
56356
56356
|
});
|
|
56357
56357
|
});
|
|
56358
56358
|
|
|
@@ -56681,8 +56681,8 @@ var require_trace_mapping_umd = __commonJS((exports, module) => {
|
|
|
56681
56681
|
this.sources = sources;
|
|
56682
56682
|
this.sourcesContent = sourcesContent;
|
|
56683
56683
|
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || undefined;
|
|
56684
|
-
const
|
|
56685
|
-
this.resolvedSources = sources.map(
|
|
56684
|
+
const resolve = resolver(mapUrl, sourceRoot);
|
|
56685
|
+
this.resolvedSources = sources.map(resolve);
|
|
56686
56686
|
const { mappings } = parsed;
|
|
56687
56687
|
if (typeof mappings === "string") {
|
|
56688
56688
|
this._encoded = mappings;
|
|
@@ -68033,14 +68033,28 @@ function parseReleaseTag(tag) {
|
|
|
68033
68033
|
version: version2
|
|
68034
68034
|
};
|
|
68035
68035
|
}
|
|
68036
|
+
function formatHostedSourceExportPath({
|
|
68037
|
+
gitRepositoryPath,
|
|
68038
|
+
ref,
|
|
68039
|
+
packagePath
|
|
68040
|
+
}) {
|
|
68041
|
+
const parsedPackagePath = SourcePackagePathSchema.parse(packagePath);
|
|
68042
|
+
if (!gitRepositoryPath.trim()) {
|
|
68043
|
+
throw new Error("gitRepositoryPath is required");
|
|
68044
|
+
}
|
|
68045
|
+
if (!ref.trim()) {
|
|
68046
|
+
throw new Error("ref is required");
|
|
68047
|
+
}
|
|
68048
|
+
return `/export/orgs/${encodeURIComponent(gitRepositoryPath)}/${encodeURIComponent(ref)}/${parsedPackagePath}`;
|
|
68049
|
+
}
|
|
68036
68050
|
var SOURCE_PACKAGE_SEGMENT_PATTERN, SOURCE_COMMIT_SHA_PATTERN, SOURCE_SEMVER_PATTERN, SOURCE_VERSION_RANGE_PATTERN, SourcePackageSegmentSchema, SourcePackageTypeSchema, SourcePackagePathSchema, DottedPackageNameSchema, SourceVersionRefSchema, ReleaseTagSchema, WorkspaceDependencySchema, AutomationTargetSchema;
|
|
68037
68051
|
var init_grammar = __esm(() => {
|
|
68038
68052
|
init_zod();
|
|
68039
|
-
SOURCE_PACKAGE_SEGMENT_PATTERN = /^[a-z0-9][a-z0-
|
|
68053
|
+
SOURCE_PACKAGE_SEGMENT_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
|
|
68040
68054
|
SOURCE_COMMIT_SHA_PATTERN = /^[0-9a-f]{40}$/;
|
|
68041
68055
|
SOURCE_SEMVER_PATTERN = /^[0-9]+\.[0-9]+\.[0-9]+$/;
|
|
68042
68056
|
SOURCE_VERSION_RANGE_PATTERN = /^[0-9]+(?:\.[0-9]+)?\.(?:x|\*)$/;
|
|
68043
|
-
SourcePackageSegmentSchema = exports_external.string().regex(SOURCE_PACKAGE_SEGMENT_PATTERN, "Use lowercase letters, numbers, and
|
|
68057
|
+
SourcePackageSegmentSchema = exports_external.string().regex(SOURCE_PACKAGE_SEGMENT_PATTERN, "Use lowercase letters, numbers, dashes, and underscores");
|
|
68044
68058
|
SourcePackageTypeSchema = exports_external.enum(["agents", "workflows", "resources", "evaluators"]);
|
|
68045
68059
|
SourcePackagePathSchema = exports_external.string().superRefine((value, ctx) => {
|
|
68046
68060
|
const parts = value.split("/");
|
|
@@ -68135,12 +68149,197 @@ var init_grammar = __esm(() => {
|
|
|
68135
68149
|
});
|
|
68136
68150
|
|
|
68137
68151
|
// ../types/src/git-source/manifests.ts
|
|
68138
|
-
|
|
68152
|
+
function aggregateEvaluatorCompositionScore(results, passThreshold = 0.7) {
|
|
68153
|
+
const threshold = ScoreInUnitIntervalSchema.parse(passThreshold);
|
|
68154
|
+
let numerator = 0;
|
|
68155
|
+
let denominator = 0;
|
|
68156
|
+
for (const result of results) {
|
|
68157
|
+
const score2 = ScoreInUnitIntervalSchema.parse(result.score);
|
|
68158
|
+
const weight = exports_external.number().min(0).parse(result.weight ?? 1);
|
|
68159
|
+
if (weight === 0) {
|
|
68160
|
+
continue;
|
|
68161
|
+
}
|
|
68162
|
+
numerator += score2 * weight;
|
|
68163
|
+
denominator += weight;
|
|
68164
|
+
}
|
|
68165
|
+
if (denominator === 0) {
|
|
68166
|
+
return { score: null, passed: false };
|
|
68167
|
+
}
|
|
68168
|
+
const score = numerator / denominator;
|
|
68169
|
+
return { score, passed: score >= threshold };
|
|
68170
|
+
}
|
|
68171
|
+
function workspaceDependencyNameToPackagePath(name) {
|
|
68172
|
+
const parsedName = WorkspaceDependencyNameSchema.parse(name);
|
|
68173
|
+
return dottedPackageNameToPath(DottedPackageNameSchema.parse(parsedName.slice("workspace:".length)));
|
|
68174
|
+
}
|
|
68175
|
+
function hasFile(files, file2) {
|
|
68176
|
+
return files.includes(file2);
|
|
68177
|
+
}
|
|
68178
|
+
function hasMatchingFile(files, predicate) {
|
|
68179
|
+
return files.some((file2) => !file2.startsWith("../") && !file2.startsWith("/") && predicate(file2));
|
|
68180
|
+
}
|
|
68181
|
+
function isLocalAgentResourcePath({
|
|
68182
|
+
packagePath,
|
|
68183
|
+
relativePath
|
|
68184
|
+
}) {
|
|
68185
|
+
const parsedPath = SourcePackagePathSchema.parse(packagePath);
|
|
68186
|
+
const [root] = parsedPath.split("/");
|
|
68187
|
+
if (root !== "agents") {
|
|
68188
|
+
return false;
|
|
68189
|
+
}
|
|
68190
|
+
const [directory] = relativePath.split("/");
|
|
68191
|
+
return LocalAgentResourceDirectorySchema.safeParse(directory).success;
|
|
68192
|
+
}
|
|
68193
|
+
function validateSourcePackageRequiredFiles({
|
|
68194
|
+
packagePath,
|
|
68195
|
+
files
|
|
68196
|
+
}) {
|
|
68197
|
+
const parsedPath = SourcePackagePathSchema.parse(packagePath);
|
|
68198
|
+
const [root, resourceKind] = parsedPath.split("/");
|
|
68199
|
+
const issues = [];
|
|
68200
|
+
if (root === "agents" && !hasFile(files, "AGENT.md")) {
|
|
68201
|
+
issues.push({
|
|
68202
|
+
code: "missing-required-file",
|
|
68203
|
+
path: "AGENT.md",
|
|
68204
|
+
message: "Agent packages must include AGENT.md"
|
|
68205
|
+
});
|
|
68206
|
+
}
|
|
68207
|
+
if (root === "evaluators" && !hasFile(files, "evaluator.yaml")) {
|
|
68208
|
+
issues.push({
|
|
68209
|
+
code: "missing-required-file",
|
|
68210
|
+
path: "evaluator.yaml",
|
|
68211
|
+
message: "Shared evaluator packages must include evaluator.yaml"
|
|
68212
|
+
});
|
|
68213
|
+
}
|
|
68214
|
+
if (root !== "resources") {
|
|
68215
|
+
return issues;
|
|
68216
|
+
}
|
|
68217
|
+
if (resourceKind === "skills") {
|
|
68218
|
+
if (!hasFile(files, "SKILL.md")) {
|
|
68219
|
+
issues.push({
|
|
68220
|
+
code: "missing-required-file",
|
|
68221
|
+
path: "SKILL.md",
|
|
68222
|
+
message: "Shared skill packages must include SKILL.md"
|
|
68223
|
+
});
|
|
68224
|
+
}
|
|
68225
|
+
return issues;
|
|
68226
|
+
}
|
|
68227
|
+
if (resourceKind === "templates") {
|
|
68228
|
+
if (!hasMatchingFile(files, (file2) => SOURCE_TEMPLATE_FILE_PATTERN.test(file2))) {
|
|
68229
|
+
issues.push({
|
|
68230
|
+
code: "missing-content-file",
|
|
68231
|
+
message: "Template packages must include at least one .docx or .xlsx file"
|
|
68232
|
+
});
|
|
68233
|
+
}
|
|
68234
|
+
return issues;
|
|
68235
|
+
}
|
|
68236
|
+
if (resourceKind === "rules" || resourceKind === "knowledge") {
|
|
68237
|
+
if (!hasMatchingFile(files, (file2) => file2.toLowerCase().endsWith(".md"))) {
|
|
68238
|
+
issues.push({
|
|
68239
|
+
code: "missing-content-file",
|
|
68240
|
+
message: `${resourceKind === "rules" ? "Rule" : "Knowledge"} packages must include at least one markdown file`
|
|
68241
|
+
});
|
|
68242
|
+
}
|
|
68243
|
+
return issues;
|
|
68244
|
+
}
|
|
68245
|
+
issues.push({
|
|
68246
|
+
code: "unsupported-resource-kind",
|
|
68247
|
+
message: `Unsupported resource package kind: ${resourceKind ?? "(missing)"}`
|
|
68248
|
+
});
|
|
68249
|
+
return issues;
|
|
68250
|
+
}
|
|
68251
|
+
var SOURCE_MANIFEST_FILENAME = "eigenpal.yaml", UNSUPPORTED_SOURCE_MANIFEST_FILENAME = "eigenpal.yml", SourceManifestSchemaVersionSchema, SourceManifestFilenameSchema, LocalAgentResourceDirectorySchema, WorkspaceDependencyNameSchema, WorkspaceDependencyVersionSchema, ScoreInUnitIntervalSchema, LocalEvaluatorReferenceSchema, SharedEvaluatorReferenceSchema, EvaluatorCompositionItemBaseSchema, LocalEvaluatorCompositionItemSchema, SharedEvaluatorCompositionItemSchema, EvaluatorCompositionItemSchema, EvaluatorCompositionSchema, DependencyMapSchema, TriggerConfigSchema, CommonPackageManifestFields, RootSourceManifestSchema, AgentPackageManifestSchema, WorkflowPackageManifestSchema, SharedResourcePackageManifestSchema, EvaluatorPackageManifestSchema, EvaluatorDefinitionSchema, SourcePackageManifestSchema, SOURCE_TEMPLATE_FILE_PATTERN;
|
|
68139
68252
|
var init_manifests = __esm(() => {
|
|
68140
68253
|
init_zod();
|
|
68254
|
+
init_evaluator_config();
|
|
68141
68255
|
init_grammar();
|
|
68142
68256
|
SourceManifestSchemaVersionSchema = exports_external.literal(1);
|
|
68143
|
-
|
|
68257
|
+
SourceManifestFilenameSchema = exports_external.string().superRefine((value, ctx) => {
|
|
68258
|
+
const filename = value.split(/[\\/]/).pop() ?? value;
|
|
68259
|
+
if (filename === UNSUPPORTED_SOURCE_MANIFEST_FILENAME) {
|
|
68260
|
+
ctx.addIssue({
|
|
68261
|
+
code: "custom",
|
|
68262
|
+
message: "Use eigenpal.yaml; eigenpal.yml package manifests are not supported"
|
|
68263
|
+
});
|
|
68264
|
+
return;
|
|
68265
|
+
}
|
|
68266
|
+
if (filename !== SOURCE_MANIFEST_FILENAME) {
|
|
68267
|
+
ctx.addIssue({
|
|
68268
|
+
code: "custom",
|
|
68269
|
+
message: "Source manifests must be named eigenpal.yaml"
|
|
68270
|
+
});
|
|
68271
|
+
}
|
|
68272
|
+
});
|
|
68273
|
+
LocalAgentResourceDirectorySchema = exports_external.enum([
|
|
68274
|
+
"skills",
|
|
68275
|
+
"templates",
|
|
68276
|
+
"rules",
|
|
68277
|
+
"knowledge"
|
|
68278
|
+
]);
|
|
68279
|
+
WorkspaceDependencyNameSchema = exports_external.string().superRefine((value, ctx) => {
|
|
68280
|
+
if (!value.startsWith("workspace:")) {
|
|
68281
|
+
ctx.addIssue({ code: "custom", message: "Dependency names must start with workspace:" });
|
|
68282
|
+
return;
|
|
68283
|
+
}
|
|
68284
|
+
const packageName = value.slice("workspace:".length);
|
|
68285
|
+
if (!DottedPackageNameSchema.safeParse(packageName).success) {
|
|
68286
|
+
ctx.addIssue({ code: "custom", message: `Invalid dependency package: ${packageName}` });
|
|
68287
|
+
}
|
|
68288
|
+
});
|
|
68289
|
+
WorkspaceDependencyVersionSchema = exports_external.string().regex(SOURCE_SEMVER_PATTERN, {
|
|
68290
|
+
message: "Dependency versions must be exact X.Y.Z versions in v0"
|
|
68291
|
+
});
|
|
68292
|
+
ScoreInUnitIntervalSchema = exports_external.number().min(0).max(1);
|
|
68293
|
+
LocalEvaluatorReferenceSchema = exports_external.string().superRefine((value, ctx) => {
|
|
68294
|
+
if (!value.startsWith("./evaluators/")) {
|
|
68295
|
+
ctx.addIssue({
|
|
68296
|
+
code: "custom",
|
|
68297
|
+
message: "Local evaluator refs must start with ./evaluators/"
|
|
68298
|
+
});
|
|
68299
|
+
}
|
|
68300
|
+
if (!value.endsWith(".yaml")) {
|
|
68301
|
+
ctx.addIssue({ code: "custom", message: "Local evaluator refs must point to .yaml files" });
|
|
68302
|
+
}
|
|
68303
|
+
if (value.includes("..") || value.includes("\\")) {
|
|
68304
|
+
ctx.addIssue({ code: "custom", message: "Local evaluator refs must stay inside evaluators/" });
|
|
68305
|
+
}
|
|
68306
|
+
});
|
|
68307
|
+
SharedEvaluatorReferenceSchema = exports_external.string().superRefine((value, ctx) => {
|
|
68308
|
+
const nameResult = WorkspaceDependencyNameSchema.safeParse(value);
|
|
68309
|
+
if (!nameResult.success) {
|
|
68310
|
+
for (const issue2 of nameResult.error.issues) {
|
|
68311
|
+
ctx.addIssue({ code: "custom", message: issue2.message });
|
|
68312
|
+
}
|
|
68313
|
+
return;
|
|
68314
|
+
}
|
|
68315
|
+
const packagePath = workspaceDependencyNameToPackagePath(nameResult.data);
|
|
68316
|
+
const [root] = packagePath.split("/");
|
|
68317
|
+
if (root !== "evaluators") {
|
|
68318
|
+
ctx.addIssue({
|
|
68319
|
+
code: "custom",
|
|
68320
|
+
message: "Shared evaluator refs must use workspace:evaluators.*"
|
|
68321
|
+
});
|
|
68322
|
+
}
|
|
68323
|
+
});
|
|
68324
|
+
EvaluatorCompositionItemBaseSchema = exports_external.object({
|
|
68325
|
+
weight: exports_external.number().min(0).default(1)
|
|
68326
|
+
});
|
|
68327
|
+
LocalEvaluatorCompositionItemSchema = EvaluatorCompositionItemBaseSchema.extend({
|
|
68328
|
+
use: LocalEvaluatorReferenceSchema
|
|
68329
|
+
}).strict();
|
|
68330
|
+
SharedEvaluatorCompositionItemSchema = EvaluatorCompositionItemBaseSchema.extend({
|
|
68331
|
+
use: SharedEvaluatorReferenceSchema,
|
|
68332
|
+
version: WorkspaceDependencyVersionSchema
|
|
68333
|
+
}).strict();
|
|
68334
|
+
EvaluatorCompositionItemSchema = exports_external.union([
|
|
68335
|
+
LocalEvaluatorCompositionItemSchema,
|
|
68336
|
+
SharedEvaluatorCompositionItemSchema
|
|
68337
|
+
]);
|
|
68338
|
+
EvaluatorCompositionSchema = exports_external.object({
|
|
68339
|
+
passThreshold: ScoreInUnitIntervalSchema.default(0.7),
|
|
68340
|
+
items: exports_external.array(EvaluatorCompositionItemSchema).default([])
|
|
68341
|
+
}).strict();
|
|
68342
|
+
DependencyMapSchema = exports_external.record(WorkspaceDependencyNameSchema, WorkspaceDependencyVersionSchema);
|
|
68144
68343
|
TriggerConfigSchema = exports_external.object({
|
|
68145
68344
|
api: exports_external.boolean().optional(),
|
|
68146
68345
|
email: exports_external.object({
|
|
@@ -68162,8 +68361,24 @@ var init_manifests = __esm(() => {
|
|
|
68162
68361
|
model: exports_external.string().optional(),
|
|
68163
68362
|
triggers: TriggerConfigSchema.optional(),
|
|
68164
68363
|
dependencies: DependencyMapSchema.optional(),
|
|
68165
|
-
evaluators:
|
|
68166
|
-
}).strict()
|
|
68364
|
+
evaluators: EvaluatorCompositionSchema.optional()
|
|
68365
|
+
}).strict().superRefine((manifest, ctx) => {
|
|
68366
|
+
for (const dependencyName of Object.keys(manifest.dependencies ?? {})) {
|
|
68367
|
+
const nameResult = WorkspaceDependencyNameSchema.safeParse(dependencyName);
|
|
68368
|
+
if (!nameResult.success) {
|
|
68369
|
+
continue;
|
|
68370
|
+
}
|
|
68371
|
+
const packagePath = workspaceDependencyNameToPackagePath(nameResult.data);
|
|
68372
|
+
const [root] = packagePath.split("/");
|
|
68373
|
+
if (root !== "agents" && root !== "resources") {
|
|
68374
|
+
ctx.addIssue({
|
|
68375
|
+
code: "custom",
|
|
68376
|
+
path: ["dependencies", dependencyName],
|
|
68377
|
+
message: "Agent dependencies may only reference agents or shared resources in v0"
|
|
68378
|
+
});
|
|
68379
|
+
}
|
|
68380
|
+
}
|
|
68381
|
+
});
|
|
68167
68382
|
WorkflowPackageManifestSchema = exports_external.object({
|
|
68168
68383
|
...CommonPackageManifestFields,
|
|
68169
68384
|
triggers: TriggerConfigSchema.optional(),
|
|
@@ -68172,12 +68387,30 @@ var init_manifests = __esm(() => {
|
|
|
68172
68387
|
}).strict();
|
|
68173
68388
|
SharedResourcePackageManifestSchema = exports_external.object(CommonPackageManifestFields).strict();
|
|
68174
68389
|
EvaluatorPackageManifestSchema = exports_external.object(CommonPackageManifestFields).strict();
|
|
68390
|
+
EvaluatorDefinitionSchema = exports_external.discriminatedUnion("type", [
|
|
68391
|
+
exports_external.object({
|
|
68392
|
+
schemaVersion: SourceManifestSchemaVersionSchema,
|
|
68393
|
+
type: exports_external.literal("exact-diff"),
|
|
68394
|
+
config: ExactDiffConfigSchema
|
|
68395
|
+
}).strict(),
|
|
68396
|
+
exports_external.object({
|
|
68397
|
+
schemaVersion: SourceManifestSchemaVersionSchema,
|
|
68398
|
+
type: exports_external.literal("llm-judge"),
|
|
68399
|
+
config: LlmJudgeConfigSchema
|
|
68400
|
+
}).strict(),
|
|
68401
|
+
exports_external.object({
|
|
68402
|
+
schemaVersion: SourceManifestSchemaVersionSchema,
|
|
68403
|
+
type: exports_external.literal("custom-script"),
|
|
68404
|
+
config: CustomScriptConfigSchema
|
|
68405
|
+
}).strict()
|
|
68406
|
+
]);
|
|
68175
68407
|
SourcePackageManifestSchema = exports_external.union([
|
|
68176
68408
|
AgentPackageManifestSchema,
|
|
68177
68409
|
WorkflowPackageManifestSchema,
|
|
68178
68410
|
SharedResourcePackageManifestSchema,
|
|
68179
68411
|
EvaluatorPackageManifestSchema
|
|
68180
68412
|
]);
|
|
68413
|
+
SOURCE_TEMPLATE_FILE_PATTERN = /\.(?:docx|xlsx)$/i;
|
|
68181
68414
|
});
|
|
68182
68415
|
|
|
68183
68416
|
// ../types/src/git-source/index.ts
|
|
@@ -68471,9 +68704,11 @@ var init_s3_path_grammar = __esm(() => {
|
|
|
68471
68704
|
// ../types/src/index.ts
|
|
68472
68705
|
var exports_src = {};
|
|
68473
68706
|
__export(exports_src, {
|
|
68707
|
+
workspaceDependencyNameToPackagePath: () => workspaceDependencyNameToPackagePath,
|
|
68474
68708
|
workflowTriggerConfigSchema: () => workflowTriggerConfigSchema,
|
|
68475
68709
|
valuesMatch: () => valuesMatch,
|
|
68476
68710
|
validateStepConfig: () => validateStepConfig,
|
|
68711
|
+
validateSourcePackageRequiredFiles: () => validateSourcePackageRequiredFiles,
|
|
68477
68712
|
validateConfig: () => validateConfig,
|
|
68478
68713
|
toJsonSchema: () => toJsonSchema,
|
|
68479
68714
|
suppressRequiredMissingErrorsForSchemaFileFields: () => suppressRequiredMissingErrorsForSchemaFileFields,
|
|
@@ -68503,6 +68738,7 @@ __export(exports_src, {
|
|
|
68503
68738
|
isStepCategory: () => isStepCategory,
|
|
68504
68739
|
isOutputSchemaUnknown: () => isOutputSchemaUnknown,
|
|
68505
68740
|
isNonSuccessTerminalExecutionStatus: () => isNonSuccessTerminalExecutionStatus,
|
|
68741
|
+
isLocalAgentResourcePath: () => isLocalAgentResourcePath,
|
|
68506
68742
|
isFilePathDescriptor: () => isFilePathDescriptor,
|
|
68507
68743
|
isFileOutput: () => isFileOutput,
|
|
68508
68744
|
hasTriggerMethod: () => hasTriggerMethod,
|
|
@@ -68525,6 +68761,7 @@ __export(exports_src, {
|
|
|
68525
68761
|
generateId: () => generateId,
|
|
68526
68762
|
formatZodError: () => formatZodError,
|
|
68527
68763
|
formatReleaseTag: () => formatReleaseTag,
|
|
68764
|
+
formatHostedSourceExportPath: () => formatHostedSourceExportPath,
|
|
68528
68765
|
formatDiffValue: () => formatDiffValue,
|
|
68529
68766
|
fileFieldNamesFromJsonSchema: () => fileFieldNamesFromJsonSchema,
|
|
68530
68767
|
fieldStemFromGoldenName: () => fieldStemFromGoldenName,
|
|
@@ -68545,11 +68782,14 @@ __export(exports_src, {
|
|
|
68545
68782
|
buildDiscreteJudgeSystemPrompt: () => buildDiscreteJudgeSystemPrompt,
|
|
68546
68783
|
buildContinuousJudgeSystemPrompt: () => buildContinuousJudgeSystemPrompt,
|
|
68547
68784
|
aliasReplyConfigSchema: () => aliasReplyConfigSchema,
|
|
68785
|
+
aggregateEvaluatorCompositionScore: () => aggregateEvaluatorCompositionScore,
|
|
68548
68786
|
addEigenpalContext: () => addEigenpalContext,
|
|
68549
68787
|
XlsxToJsonOutputSchema: () => XlsxToJsonOutputSchema,
|
|
68550
68788
|
XlsxToJsonInputSchema: () => XlsxToJsonInputSchema,
|
|
68551
68789
|
XlsxToJsonConfigSchema: () => XlsxToJsonConfigSchema,
|
|
68790
|
+
WorkspaceDependencyVersionSchema: () => WorkspaceDependencyVersionSchema,
|
|
68552
68791
|
WorkspaceDependencySchema: () => WorkspaceDependencySchema,
|
|
68792
|
+
WorkspaceDependencyNameSchema: () => WorkspaceDependencyNameSchema,
|
|
68553
68793
|
WorkflowSettingsSchema: () => WorkflowSettingsSchema,
|
|
68554
68794
|
WorkflowResultSchema: () => WorkflowResultSchema,
|
|
68555
68795
|
WorkflowPackageManifestSchema: () => WorkflowPackageManifestSchema,
|
|
@@ -68565,6 +68805,7 @@ __export(exports_src, {
|
|
|
68565
68805
|
WORKFLOW_TOOL_METADATA: () => WORKFLOW_TOOL_METADATA,
|
|
68566
68806
|
WORKFLOW_NAME_PATTERN: () => WORKFLOW_NAME_PATTERN,
|
|
68567
68807
|
WORKFLOW_EXECUTION_STATUSES: () => WORKFLOW_EXECUTION_STATUSES,
|
|
68808
|
+
UNSUPPORTED_SOURCE_MANIFEST_FILENAME: () => UNSUPPORTED_SOURCE_MANIFEST_FILENAME,
|
|
68568
68809
|
TriggerTypeValue: () => TriggerTypeValue,
|
|
68569
68810
|
TriggerTypeSchema: () => TriggerTypeSchema,
|
|
68570
68811
|
TriggerMethodsSchema: () => TriggerMethodsSchema,
|
|
@@ -68618,7 +68859,10 @@ __export(exports_src, {
|
|
|
68618
68859
|
SourcePackagePathSchema: () => SourcePackagePathSchema,
|
|
68619
68860
|
SourcePackageManifestSchema: () => SourcePackageManifestSchema,
|
|
68620
68861
|
SourceManifestSchemaVersionSchema: () => SourceManifestSchemaVersionSchema,
|
|
68862
|
+
SourceManifestFilenameSchema: () => SourceManifestFilenameSchema,
|
|
68621
68863
|
SharedResourcePackageManifestSchema: () => SharedResourcePackageManifestSchema,
|
|
68864
|
+
SharedEvaluatorReferenceSchema: () => SharedEvaluatorReferenceSchema,
|
|
68865
|
+
SharedEvaluatorCompositionItemSchema: () => SharedEvaluatorCompositionItemSchema,
|
|
68622
68866
|
ScopeStackSchema: () => ScopeStackSchema,
|
|
68623
68867
|
ScopeEntryTypeSchema: () => ScopeEntryTypeSchema,
|
|
68624
68868
|
ScopeEntrySchema: () => ScopeEntrySchema,
|
|
@@ -68628,6 +68872,7 @@ __export(exports_src, {
|
|
|
68628
68872
|
SOURCE_VERSION_RANGE_PATTERN: () => SOURCE_VERSION_RANGE_PATTERN,
|
|
68629
68873
|
SOURCE_SEMVER_PATTERN: () => SOURCE_SEMVER_PATTERN,
|
|
68630
68874
|
SOURCE_PACKAGE_SEGMENT_PATTERN: () => SOURCE_PACKAGE_SEGMENT_PATTERN,
|
|
68875
|
+
SOURCE_MANIFEST_FILENAME: () => SOURCE_MANIFEST_FILENAME,
|
|
68631
68876
|
SOURCE_COMMIT_SHA_PATTERN: () => SOURCE_COMMIT_SHA_PATTERN,
|
|
68632
68877
|
SCRIPT_FN_MAX_BYTES: () => SCRIPT_FN_MAX_BYTES,
|
|
68633
68878
|
S3_PATH_GRAMMAR: () => S3_PATH_GRAMMAR,
|
|
@@ -68664,6 +68909,9 @@ __export(exports_src, {
|
|
|
68664
68909
|
MergeConfigSchema: () => MergeConfigSchema,
|
|
68665
68910
|
ManualTriggerMethodSchema: () => ManualTriggerMethodSchema,
|
|
68666
68911
|
MAX_PAGE_SIZE: () => MAX_PAGE_SIZE,
|
|
68912
|
+
LocalEvaluatorReferenceSchema: () => LocalEvaluatorReferenceSchema,
|
|
68913
|
+
LocalEvaluatorCompositionItemSchema: () => LocalEvaluatorCompositionItemSchema,
|
|
68914
|
+
LocalAgentResourceDirectorySchema: () => LocalAgentResourceDirectorySchema,
|
|
68667
68915
|
LlmJudgeConfigSchema: () => LlmJudgeConfigSchema,
|
|
68668
68916
|
LayoutElementTypeSchema: () => LayoutElementTypeSchema,
|
|
68669
68917
|
LayoutElementSchema: () => LayoutElementSchema,
|
|
@@ -68693,7 +68941,10 @@ __export(exports_src, {
|
|
|
68693
68941
|
EvaluatorTypeSchema: () => EvaluatorTypeSchema,
|
|
68694
68942
|
EvaluatorResultSchema: () => EvaluatorResultSchema,
|
|
68695
68943
|
EvaluatorPackageManifestSchema: () => EvaluatorPackageManifestSchema,
|
|
68944
|
+
EvaluatorDefinitionSchema: () => EvaluatorDefinitionSchema,
|
|
68696
68945
|
EvaluatorConfigSchema: () => EvaluatorConfigSchema,
|
|
68946
|
+
EvaluatorCompositionSchema: () => EvaluatorCompositionSchema,
|
|
68947
|
+
EvaluatorCompositionItemSchema: () => EvaluatorCompositionItemSchema,
|
|
68697
68948
|
EvaluatorBaseEntrySchema: () => EvaluatorBaseEntrySchema,
|
|
68698
68949
|
EvalResultsExportQuerySchema: () => EvalResultsExportQuerySchema,
|
|
68699
68950
|
EvalResultsExportJsonSchema: () => EvalResultsExportJsonSchema,
|
|
@@ -69860,7 +70111,7 @@ var __defProp2, __export2 = (target, all) => {
|
|
|
69860
70111
|
}
|
|
69861
70112
|
const implementation = getImplementation.call(object2) ?? object2[methodName];
|
|
69862
70113
|
return implementation.apply(object2, arguments_);
|
|
69863
|
-
}, at3, method_at_default, noop = () => {}, noop_default, DOC_TYPE_STRING = "string", DOC_TYPE_ARRAY = "array", DOC_TYPE_CURSOR = "cursor", DOC_TYPE_INDENT = "indent", DOC_TYPE_ALIGN = "align", DOC_TYPE_TRIM = "trim", DOC_TYPE_GROUP = "group", DOC_TYPE_FILL = "fill", DOC_TYPE_IF_BREAK = "if-break", DOC_TYPE_INDENT_IF_BREAK = "indent-if-break", DOC_TYPE_LINE_SUFFIX = "line-suffix", DOC_TYPE_LINE_SUFFIX_BOUNDARY = "line-suffix-boundary", DOC_TYPE_LINE = "line", DOC_TYPE_LABEL = "label", DOC_TYPE_BREAK_PARENT = "break-parent", VALID_OBJECT_DOC_TYPES, get_doc_type_default, disjunctionListFormat = (
|
|
70114
|
+
}, at3, method_at_default, noop = () => {}, noop_default, DOC_TYPE_STRING = "string", DOC_TYPE_ARRAY = "array", DOC_TYPE_CURSOR = "cursor", DOC_TYPE_INDENT = "indent", DOC_TYPE_ALIGN = "align", DOC_TYPE_TRIM = "trim", DOC_TYPE_GROUP = "group", DOC_TYPE_FILL = "fill", DOC_TYPE_IF_BREAK = "if-break", DOC_TYPE_INDENT_IF_BREAK = "indent-if-break", DOC_TYPE_LINE_SUFFIX = "line-suffix", DOC_TYPE_LINE_SUFFIX_BOUNDARY = "line-suffix-boundary", DOC_TYPE_LINE = "line", DOC_TYPE_LABEL = "label", DOC_TYPE_BREAK_PARENT = "break-parent", VALID_OBJECT_DOC_TYPES, get_doc_type_default, disjunctionListFormat = (list2) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(list2), InvalidDocError, invalid_doc_error_default, traverseDocOnExitStackMarker, traverse_doc_default, assertDoc, assertDocArray, assertDocFillParts, assertAlignType, breakParent, cursor, line, softline, hardlineWithoutBreakParent, hardline, literallineWithoutBreakParent, literalline, lineSuffixBoundary, trim, stringReplaceAll, replaceAll, method_replace_all_default, OPTION_CR = "cr", OPTION_CRLF = "crlf", CHARACTER_CR = "\r", CHARACTER_CRLF = `\r
|
|
69864
70115
|
`, CHARACTER_LF = `
|
|
69865
70116
|
`, DEFAULT_EOL, emoji_regex_default = () => {
|
|
69866
70117
|
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
@@ -157192,14 +157443,14 @@ import { createRequire as __prettierCreateRequire } from "module";
|
|
|
157192
157443
|
import { fileURLToPath as __prettierFileUrlToPath } from "url";
|
|
157193
157444
|
import { dirname as __prettierDirname } from "path";
|
|
157194
157445
|
import path10 from "path";
|
|
157195
|
-
import * as
|
|
157446
|
+
import * as path3 from "path";
|
|
157196
157447
|
import * as url2 from "url";
|
|
157197
157448
|
import path5 from "path";
|
|
157198
157449
|
import * as path4 from "path";
|
|
157199
157450
|
import * as fs8 from "fs/promises";
|
|
157200
157451
|
import * as path22 from "path";
|
|
157201
157452
|
import process22 from "process";
|
|
157202
|
-
import * as
|
|
157453
|
+
import * as path32 from "path";
|
|
157203
157454
|
import process3 from "process";
|
|
157204
157455
|
import path9 from "path";
|
|
157205
157456
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
@@ -157207,7 +157458,7 @@ import fs22 from "fs/promises";
|
|
|
157207
157458
|
import path8 from "path";
|
|
157208
157459
|
import { pathToFileURL as pathToFileURL4 } from "url";
|
|
157209
157460
|
import assert3 from "assert";
|
|
157210
|
-
import { statSync as
|
|
157461
|
+
import { statSync as statSync5, realpathSync as realpathSync2 } from "fs";
|
|
157211
157462
|
import process4 from "process";
|
|
157212
157463
|
import { fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL3 } from "url";
|
|
157213
157464
|
import path7 from "path";
|
|
@@ -157544,13 +157795,13 @@ function getDescription(key2, value, expected, descriptor) {
|
|
|
157544
157795
|
`but received ${value === VALUE_NOT_EXIST ? import_picocolors22.default.gray("nothing") : import_picocolors22.default.red(descriptor.value(value))}.`
|
|
157545
157796
|
].join(" ");
|
|
157546
157797
|
}
|
|
157547
|
-
function getListDescription({ text, list }, printWidth) {
|
|
157798
|
+
function getListDescription({ text, list: list2 }, printWidth) {
|
|
157548
157799
|
const descriptions = [];
|
|
157549
157800
|
if (text) {
|
|
157550
157801
|
descriptions.push(`- ${import_picocolors22.default.blue(text)}`);
|
|
157551
157802
|
}
|
|
157552
|
-
if (
|
|
157553
|
-
descriptions.push([`- ${import_picocolors22.default.blue(
|
|
157803
|
+
if (list2) {
|
|
157804
|
+
descriptions.push([`- ${import_picocolors22.default.blue(list2.title)}:`].concat(list2.values.map((valueDescription) => getListDescription(valueDescription, printWidth - INDENTATION.length).replace(/^|\n/g, `$&${INDENTATION}`))).join(`
|
|
157554
157805
|
`));
|
|
157555
157806
|
}
|
|
157556
157807
|
return chooseDescription(descriptions, printWidth);
|
|
@@ -157662,16 +157913,16 @@ function normalizeExpectedResult(result) {
|
|
|
157662
157913
|
if (typeof result === "string") {
|
|
157663
157914
|
return { text: result };
|
|
157664
157915
|
}
|
|
157665
|
-
const { text, list } = result;
|
|
157666
|
-
assert4((text ||
|
|
157667
|
-
if (!
|
|
157916
|
+
const { text, list: list2 } = result;
|
|
157917
|
+
assert4((text || list2) !== undefined, "Unexpected `expected` result, there should be at least one field.");
|
|
157918
|
+
if (!list2) {
|
|
157668
157919
|
return { text };
|
|
157669
157920
|
}
|
|
157670
157921
|
return {
|
|
157671
157922
|
text,
|
|
157672
157923
|
list: {
|
|
157673
|
-
title:
|
|
157674
|
-
values:
|
|
157924
|
+
title: list2.title,
|
|
157925
|
+
values: list2.values.map(normalizeExpectedResult)
|
|
157675
157926
|
}
|
|
157676
157927
|
};
|
|
157677
157928
|
}
|
|
@@ -157755,15 +158006,15 @@ function* iterateDirectoryUp(from, to5) {
|
|
|
157755
158006
|
let directory = toAbsolutePath(from) ?? process3.cwd();
|
|
157756
158007
|
let stopDirectory = toAbsolutePath(to5);
|
|
157757
158008
|
if (stopDirectory) {
|
|
157758
|
-
const relation =
|
|
158009
|
+
const relation = path32.relative(stopDirectory, directory);
|
|
157759
158010
|
if (relation[0] === "." || relation === directory) {
|
|
157760
158011
|
return;
|
|
157761
158012
|
}
|
|
157762
158013
|
}
|
|
157763
|
-
stopDirectory = stopDirectory ? directory.slice(0, stopDirectory.length) :
|
|
158014
|
+
stopDirectory = stopDirectory ? directory.slice(0, stopDirectory.length) : path32.parse(directory).root;
|
|
157764
158015
|
while (directory !== stopDirectory) {
|
|
157765
158016
|
yield directory;
|
|
157766
|
-
directory =
|
|
158017
|
+
directory = path32.dirname(directory);
|
|
157767
158018
|
}
|
|
157768
158019
|
yield stopDirectory;
|
|
157769
158020
|
}
|
|
@@ -159251,11 +159502,11 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
159251
159502
|
}
|
|
159252
159503
|
function tryStatSync(path15) {
|
|
159253
159504
|
try {
|
|
159254
|
-
return
|
|
159505
|
+
return statSync5(path15);
|
|
159255
159506
|
} catch {}
|
|
159256
159507
|
}
|
|
159257
159508
|
function fileExists(url3) {
|
|
159258
|
-
const stats =
|
|
159509
|
+
const stats = statSync5(url3, { throwIfNoEntry: false });
|
|
159259
159510
|
const isFile2 = stats ? stats.isFile() : undefined;
|
|
159260
159511
|
return isFile2 === null || isFile2 === undefined ? false : isFile2;
|
|
159261
159512
|
}
|
|
@@ -159324,7 +159575,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
159324
159575
|
throw error52;
|
|
159325
159576
|
}
|
|
159326
159577
|
if (!preserveSymlinks) {
|
|
159327
|
-
const real =
|
|
159578
|
+
const real = realpathSync2(filePath);
|
|
159328
159579
|
const { search, hash: hash2 } = resolved;
|
|
159329
159580
|
resolved = pathToFileURL3(real + (filePath.endsWith(path7.sep) ? "/" : ""));
|
|
159330
159581
|
resolved.search = search;
|
|
@@ -160969,7 +161220,7 @@ async function printEmbedFrontMatter(textToDoc2, print, path15, options8) {
|
|
|
160969
161220
|
}
|
|
160970
161221
|
return markAsRoot2([node.startDelimiter, node.explicitLanguage ?? "", hardline22, doc2, doc2 ? hardline22 : "", node.endDelimiter]);
|
|
160971
161222
|
}
|
|
160972
|
-
function
|
|
161223
|
+
function clean2(original, cloned) {
|
|
160973
161224
|
if (isEmbedFrontMatter({ node: original })) {
|
|
160974
161225
|
delete cloned.end;
|
|
160975
161226
|
delete cloned.raw;
|
|
@@ -161429,8 +161680,8 @@ function massageAst(ast, options8) {
|
|
|
161429
161680
|
const {
|
|
161430
161681
|
printer: printer2
|
|
161431
161682
|
} = options8;
|
|
161432
|
-
const
|
|
161433
|
-
if (!
|
|
161683
|
+
const clean22 = printer2.massageAstNode;
|
|
161684
|
+
if (!clean22) {
|
|
161434
161685
|
return ast;
|
|
161435
161686
|
}
|
|
161436
161687
|
const {
|
|
@@ -161438,7 +161689,7 @@ function massageAst(ast, options8) {
|
|
|
161438
161689
|
} = printer2;
|
|
161439
161690
|
const {
|
|
161440
161691
|
ignoredProperties
|
|
161441
|
-
} =
|
|
161692
|
+
} = clean22;
|
|
161442
161693
|
return recurse(ast);
|
|
161443
161694
|
function recurse(original, parent) {
|
|
161444
161695
|
if (!is_object_default(original)) {
|
|
@@ -161459,7 +161710,7 @@ function massageAst(ast, options8) {
|
|
|
161459
161710
|
cloned[key2] = original[key2];
|
|
161460
161711
|
}
|
|
161461
161712
|
}
|
|
161462
|
-
const result =
|
|
161713
|
+
const result = clean22(original, cloned, parent);
|
|
161463
161714
|
if (result === null) {
|
|
161464
161715
|
return;
|
|
161465
161716
|
}
|
|
@@ -162410,13 +162661,13 @@ var require3, __filename2, __dirname2, __create2, __defProp3, __getOwnPropDesc,
|
|
|
162410
162661
|
}
|
|
162411
162662
|
return messages2.join("; ") + ".";
|
|
162412
162663
|
}, import_picocolors22, VALUE_NOT_EXIST, VALUE_UNCHANGED, INDENTATION, commonInvalidHandler = (key2, value, utils2) => {
|
|
162413
|
-
const { text, list } = utils2.normalizeExpectedResult(utils2.schemas[key2].expected(utils2));
|
|
162664
|
+
const { text, list: list2 } = utils2.normalizeExpectedResult(utils2.schemas[key2].expected(utils2));
|
|
162414
162665
|
const descriptions = [];
|
|
162415
162666
|
if (text) {
|
|
162416
162667
|
descriptions.push(getDescription(key2, value, text, utils2.descriptor));
|
|
162417
162668
|
}
|
|
162418
|
-
if (
|
|
162419
|
-
descriptions.push([getDescription(key2, value,
|
|
162669
|
+
if (list2) {
|
|
162670
|
+
descriptions.push([getDescription(key2, value, list2.title, utils2.descriptor)].concat(list2.values.map((valueDescription) => getListDescription(valueDescription, utils2.loggerPrintWidth))).join(`
|
|
162420
162671
|
`));
|
|
162421
162672
|
}
|
|
162422
162673
|
return chooseDescription(descriptions, utils2.loggerPrintWidth);
|
|
@@ -162642,7 +162893,7 @@ var require3, __filename2, __dirname2, __create2, __defProp3, __getOwnPropDesc,
|
|
|
162642
162893
|
}
|
|
162643
162894
|
}
|
|
162644
162895
|
}
|
|
162645
|
-
}, errors_exports, ConfigError, UndefinedParserError, ArgExpansionBailout, create_mockable_default, mockable, mockable_default, import_micromatch, URL_STRING_PREFIX = "file:", isUrlInstance = (value) => value instanceof URL, isUrlString = (value) => typeof value === "string" && value.startsWith(URL_STRING_PREFIX), isUrl = (urlOrPath) => isUrlInstance(urlOrPath) || isUrlString(urlOrPath), toPath = (urlOrPath) => isUrl(urlOrPath) ? url2.fileURLToPath(urlOrPath) : urlOrPath, toAbsolutePath = (urlOrPath) => urlOrPath ?
|
|
162896
|
+
}, errors_exports, ConfigError, UndefinedParserError, ArgExpansionBailout, create_mockable_default, mockable, mockable_default, import_micromatch, URL_STRING_PREFIX = "file:", isUrlInstance = (value) => value instanceof URL, isUrlString = (value) => typeof value === "string" && value.startsWith(URL_STRING_PREFIX), isUrl = (urlOrPath) => isUrlInstance(urlOrPath) || isUrlString(urlOrPath), toPath = (urlOrPath) => isUrl(urlOrPath) ? url2.fileURLToPath(urlOrPath) : urlOrPath, toAbsolutePath = (urlOrPath) => urlOrPath ? path3.resolve(isUrl(urlOrPath) ? url2.fileURLToPath(urlOrPath) : urlOrPath) : urlOrPath, partition_default, import_editorconfig, isFile = (stats) => stats?.isFile(), isDirectory = (stats) => stats?.isDirectory(), iterate_directory_up_default, Searcher = class {
|
|
162646
162897
|
#stopDirectory;
|
|
162647
162898
|
#cache;
|
|
162648
162899
|
#resultCache = /* @__PURE__ */ new Map;
|
|
@@ -165698,9 +165949,9 @@ var init_prettier = __esm(() => {
|
|
|
165698
165949
|
const index = v11.indexOf("{");
|
|
165699
165950
|
return index > -1 && v11.indexOf("}", index) > -1;
|
|
165700
165951
|
};
|
|
165701
|
-
var micromatch2 = (
|
|
165952
|
+
var micromatch2 = (list2, patterns, options8) => {
|
|
165702
165953
|
patterns = [].concat(patterns);
|
|
165703
|
-
|
|
165954
|
+
list2 = [].concat(list2);
|
|
165704
165955
|
let omit2 = /* @__PURE__ */ new Set;
|
|
165705
165956
|
let keep = /* @__PURE__ */ new Set;
|
|
165706
165957
|
let items = /* @__PURE__ */ new Set;
|
|
@@ -165716,7 +165967,7 @@ var init_prettier = __esm(() => {
|
|
|
165716
165967
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
165717
165968
|
if (negated)
|
|
165718
165969
|
negatives++;
|
|
165719
|
-
for (let item of
|
|
165970
|
+
for (let item of list2) {
|
|
165720
165971
|
let matched = isMatch(item, true);
|
|
165721
165972
|
let match = negated ? !matched.isMatch : matched.isMatch;
|
|
165722
165973
|
if (!match)
|
|
@@ -165745,7 +165996,7 @@ var init_prettier = __esm(() => {
|
|
|
165745
165996
|
micromatch2.matcher = (pattern, options8) => picomatch(pattern, options8);
|
|
165746
165997
|
micromatch2.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
|
|
165747
165998
|
micromatch2.any = micromatch2.isMatch;
|
|
165748
|
-
micromatch2.not = (
|
|
165999
|
+
micromatch2.not = (list2, patterns, options8 = {}) => {
|
|
165749
166000
|
patterns = [].concat(patterns).map(String);
|
|
165750
166001
|
let result = /* @__PURE__ */ new Set;
|
|
165751
166002
|
let items = [];
|
|
@@ -165754,7 +166005,7 @@ var init_prettier = __esm(() => {
|
|
|
165754
166005
|
options8.onResult(state);
|
|
165755
166006
|
items.push(state.output);
|
|
165756
166007
|
};
|
|
165757
|
-
let matches = new Set(micromatch2(
|
|
166008
|
+
let matches = new Set(micromatch2(list2, patterns, { ...options8, onResult }));
|
|
165758
166009
|
for (let item of items) {
|
|
165759
166010
|
if (!matches.has(item)) {
|
|
165760
166011
|
result.add(item);
|
|
@@ -165789,8 +166040,8 @@ var init_prettier = __esm(() => {
|
|
|
165789
166040
|
res[key2] = obj[key2];
|
|
165790
166041
|
return res;
|
|
165791
166042
|
};
|
|
165792
|
-
micromatch2.some = (
|
|
165793
|
-
let items = [].concat(
|
|
166043
|
+
micromatch2.some = (list2, patterns, options8) => {
|
|
166044
|
+
let items = [].concat(list2);
|
|
165794
166045
|
for (let pattern of [].concat(patterns)) {
|
|
165795
166046
|
let isMatch = picomatch(String(pattern), options8);
|
|
165796
166047
|
if (items.some((item) => isMatch(item))) {
|
|
@@ -165799,8 +166050,8 @@ var init_prettier = __esm(() => {
|
|
|
165799
166050
|
}
|
|
165800
166051
|
return false;
|
|
165801
166052
|
};
|
|
165802
|
-
micromatch2.every = (
|
|
165803
|
-
let items = [].concat(
|
|
166053
|
+
micromatch2.every = (list2, patterns, options8) => {
|
|
166054
|
+
let items = [].concat(list2);
|
|
165804
166055
|
for (let pattern of [].concat(patterns)) {
|
|
165805
166056
|
let isMatch = picomatch(String(pattern), options8);
|
|
165806
166057
|
if (!items.every((item) => isMatch(item))) {
|
|
@@ -166374,7 +166625,7 @@ var init_prettier = __esm(() => {
|
|
|
166374
166625
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
166375
166626
|
exports.statSync = exports.stat = exports.Settings = undefined;
|
|
166376
166627
|
var async = require_async();
|
|
166377
|
-
var
|
|
166628
|
+
var sync2 = require_sync();
|
|
166378
166629
|
var settings_1 = require_settings();
|
|
166379
166630
|
exports.Settings = settings_1.default;
|
|
166380
166631
|
function stat2(path15, optionsOrSettingsOrCallback, callback) {
|
|
@@ -166387,7 +166638,7 @@ var init_prettier = __esm(() => {
|
|
|
166387
166638
|
exports.stat = stat2;
|
|
166388
166639
|
function statSync22(path15, optionsOrSettings) {
|
|
166389
166640
|
const settings = getSettings(optionsOrSettings);
|
|
166390
|
-
return
|
|
166641
|
+
return sync2.read(path15, settings);
|
|
166391
166642
|
}
|
|
166392
166643
|
exports.statSync = statSync22;
|
|
166393
166644
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -166734,7 +166985,7 @@ var init_prettier = __esm(() => {
|
|
|
166734
166985
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
166735
166986
|
exports.Settings = exports.scandirSync = exports.scandir = undefined;
|
|
166736
166987
|
var async = require_async2();
|
|
166737
|
-
var
|
|
166988
|
+
var sync2 = require_sync2();
|
|
166738
166989
|
var settings_1 = require_settings2();
|
|
166739
166990
|
exports.Settings = settings_1.default;
|
|
166740
166991
|
function scandir(path15, optionsOrSettingsOrCallback, callback) {
|
|
@@ -166747,7 +166998,7 @@ var init_prettier = __esm(() => {
|
|
|
166747
166998
|
exports.scandir = scandir;
|
|
166748
166999
|
function scandirSync(path15, optionsOrSettings) {
|
|
166749
167000
|
const settings = getSettings(optionsOrSettings);
|
|
166750
|
-
return
|
|
167001
|
+
return sync2.read(path15, settings);
|
|
166751
167002
|
}
|
|
166752
167003
|
exports.scandirSync = scandirSync;
|
|
166753
167004
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -166774,13 +167025,13 @@ var init_prettier = __esm(() => {
|
|
|
166774
167025
|
current.next = null;
|
|
166775
167026
|
return current;
|
|
166776
167027
|
}
|
|
166777
|
-
function
|
|
167028
|
+
function release2(obj) {
|
|
166778
167029
|
tail.next = obj;
|
|
166779
167030
|
tail = obj;
|
|
166780
167031
|
}
|
|
166781
167032
|
return {
|
|
166782
167033
|
get,
|
|
166783
|
-
release
|
|
167034
|
+
release: release2
|
|
166784
167035
|
};
|
|
166785
167036
|
}
|
|
166786
167037
|
module.exports = reusify;
|
|
@@ -166821,7 +167072,7 @@ var init_prettier = __esm(() => {
|
|
|
166821
167072
|
return;
|
|
166822
167073
|
for (;queueHead && _running < _concurrency; ) {
|
|
166823
167074
|
_running++;
|
|
166824
|
-
|
|
167075
|
+
release2();
|
|
166825
167076
|
}
|
|
166826
167077
|
},
|
|
166827
167078
|
running,
|
|
@@ -166866,12 +167117,12 @@ var init_prettier = __esm(() => {
|
|
|
166866
167117
|
self2.paused = false;
|
|
166867
167118
|
if (queueHead === null) {
|
|
166868
167119
|
_running++;
|
|
166869
|
-
|
|
167120
|
+
release2();
|
|
166870
167121
|
return;
|
|
166871
167122
|
}
|
|
166872
167123
|
for (;queueHead && _running < _concurrency; ) {
|
|
166873
167124
|
_running++;
|
|
166874
|
-
|
|
167125
|
+
release2();
|
|
166875
167126
|
}
|
|
166876
167127
|
}
|
|
166877
167128
|
function idle() {
|
|
@@ -166880,7 +167131,7 @@ var init_prettier = __esm(() => {
|
|
|
166880
167131
|
function push2(value, done) {
|
|
166881
167132
|
var current = cache3.get();
|
|
166882
167133
|
current.context = context;
|
|
166883
|
-
current.release =
|
|
167134
|
+
current.release = release2;
|
|
166884
167135
|
current.value = value;
|
|
166885
167136
|
current.callback = done || noop2;
|
|
166886
167137
|
current.errorHandler = errorHandler;
|
|
@@ -166901,7 +167152,7 @@ var init_prettier = __esm(() => {
|
|
|
166901
167152
|
function unshift(value, done) {
|
|
166902
167153
|
var current = cache3.get();
|
|
166903
167154
|
current.context = context;
|
|
166904
|
-
current.release =
|
|
167155
|
+
current.release = release2;
|
|
166905
167156
|
current.value = value;
|
|
166906
167157
|
current.callback = done || noop2;
|
|
166907
167158
|
current.errorHandler = errorHandler;
|
|
@@ -166919,7 +167170,7 @@ var init_prettier = __esm(() => {
|
|
|
166919
167170
|
worker.call(context, current.value, current.worked);
|
|
166920
167171
|
}
|
|
166921
167172
|
}
|
|
166922
|
-
function
|
|
167173
|
+
function release2(holder) {
|
|
166923
167174
|
if (holder) {
|
|
166924
167175
|
cache3.release(holder);
|
|
166925
167176
|
}
|
|
@@ -168058,15 +168309,15 @@ var init_prettier = __esm(() => {
|
|
|
168058
168309
|
}
|
|
168059
168310
|
(function(FastGlob2) {
|
|
168060
168311
|
FastGlob2.glob = FastGlob2;
|
|
168061
|
-
FastGlob2.globSync =
|
|
168312
|
+
FastGlob2.globSync = sync2;
|
|
168062
168313
|
FastGlob2.globStream = stream;
|
|
168063
168314
|
FastGlob2.async = FastGlob2;
|
|
168064
|
-
function
|
|
168315
|
+
function sync2(source2, options8) {
|
|
168065
168316
|
assertPatternsInput(source2);
|
|
168066
168317
|
const works = getWorks(source2, sync_1.default, options8);
|
|
168067
168318
|
return utils2.array.flatten(works);
|
|
168068
168319
|
}
|
|
168069
|
-
FastGlob2.sync =
|
|
168320
|
+
FastGlob2.sync = sync2;
|
|
168070
168321
|
function stream(source2, options8) {
|
|
168071
168322
|
assertPatternsInput(source2);
|
|
168072
168323
|
const works = getWorks(source2, stream_1.default, options8);
|
|
@@ -168524,8 +168775,8 @@ var init_prettier = __esm(() => {
|
|
|
168524
168775
|
}
|
|
168525
168776
|
} while (++i5);
|
|
168526
168777
|
}
|
|
168527
|
-
inc(
|
|
168528
|
-
if (
|
|
168778
|
+
inc(release2, identifier, identifierBase) {
|
|
168779
|
+
if (release2.startsWith("pre")) {
|
|
168529
168780
|
if (!identifier && identifierBase === false) {
|
|
168530
168781
|
throw new Error("invalid increment argument: identifier is empty");
|
|
168531
168782
|
}
|
|
@@ -168536,7 +168787,7 @@ var init_prettier = __esm(() => {
|
|
|
168536
168787
|
}
|
|
168537
168788
|
}
|
|
168538
168789
|
}
|
|
168539
|
-
switch (
|
|
168790
|
+
switch (release2) {
|
|
168540
168791
|
case "premajor":
|
|
168541
168792
|
this.prerelease.length = 0;
|
|
168542
168793
|
this.patch = 0;
|
|
@@ -168623,7 +168874,7 @@ var init_prettier = __esm(() => {
|
|
|
168623
168874
|
break;
|
|
168624
168875
|
}
|
|
168625
168876
|
default:
|
|
168626
|
-
throw new Error(`invalid increment argument: ${
|
|
168877
|
+
throw new Error(`invalid increment argument: ${release2}`);
|
|
168627
168878
|
}
|
|
168628
168879
|
this.raw = this.format();
|
|
168629
168880
|
if (this.build.length) {
|
|
@@ -168757,7 +169008,7 @@ var init_prettier = __esm(() => {
|
|
|
168757
169008
|
module.exports = Yallist;
|
|
168758
169009
|
Yallist.Node = Node;
|
|
168759
169010
|
Yallist.create = Yallist;
|
|
168760
|
-
function Yallist(
|
|
169011
|
+
function Yallist(list2) {
|
|
168761
169012
|
var self2 = this;
|
|
168762
169013
|
if (!(self2 instanceof Yallist)) {
|
|
168763
169014
|
self2 = new Yallist;
|
|
@@ -168765,8 +169016,8 @@ var init_prettier = __esm(() => {
|
|
|
168765
169016
|
self2.tail = null;
|
|
168766
169017
|
self2.head = null;
|
|
168767
169018
|
self2.length = 0;
|
|
168768
|
-
if (
|
|
168769
|
-
|
|
169019
|
+
if (list2 && typeof list2.forEach === "function") {
|
|
169020
|
+
list2.forEach(function(item) {
|
|
168770
169021
|
self2.push(item);
|
|
168771
169022
|
});
|
|
168772
169023
|
} else if (arguments.length > 0) {
|
|
@@ -169055,11 +169306,11 @@ var init_prettier = __esm(() => {
|
|
|
169055
169306
|
}
|
|
169056
169307
|
self2.length++;
|
|
169057
169308
|
}
|
|
169058
|
-
function Node(value, prev, next,
|
|
169309
|
+
function Node(value, prev, next, list2) {
|
|
169059
169310
|
if (!(this instanceof Node)) {
|
|
169060
|
-
return new Node(value, prev, next,
|
|
169311
|
+
return new Node(value, prev, next, list2);
|
|
169061
169312
|
}
|
|
169062
|
-
this.list =
|
|
169313
|
+
this.list = list2;
|
|
169063
169314
|
this.value = value;
|
|
169064
169315
|
if (prev) {
|
|
169065
169316
|
prev.next = this;
|
|
@@ -169557,7 +169808,7 @@ var init_prettier = __esm(() => {
|
|
|
169557
169808
|
minimatch.filter = filter2;
|
|
169558
169809
|
function filter2(pattern, options8) {
|
|
169559
169810
|
options8 = options8 || {};
|
|
169560
|
-
return function(p4, i5,
|
|
169811
|
+
return function(p4, i5, list2) {
|
|
169561
169812
|
return minimatch(p4, pattern, options8);
|
|
169562
169813
|
};
|
|
169563
169814
|
}
|
|
@@ -169998,15 +170249,15 @@ var init_prettier = __esm(() => {
|
|
|
169998
170249
|
return this.regexp = false;
|
|
169999
170250
|
}
|
|
170000
170251
|
}
|
|
170001
|
-
minimatch.match = function(
|
|
170252
|
+
minimatch.match = function(list2, pattern, options8) {
|
|
170002
170253
|
var mm3 = new Minimatch(pattern, options8);
|
|
170003
|
-
|
|
170254
|
+
list2 = list2.filter(function(f7) {
|
|
170004
170255
|
return mm3.match(f7);
|
|
170005
170256
|
});
|
|
170006
|
-
if (options8.nonull && !
|
|
170007
|
-
|
|
170257
|
+
if (options8.nonull && !list2.length) {
|
|
170258
|
+
list2.push(pattern);
|
|
170008
170259
|
}
|
|
170009
|
-
return
|
|
170260
|
+
return list2;
|
|
170010
170261
|
};
|
|
170011
170262
|
Minimatch.prototype.match = match;
|
|
170012
170263
|
function match(f7, partial2) {
|
|
@@ -171681,12 +171932,12 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
171681
171932
|
this._valueSchema = valueSchema;
|
|
171682
171933
|
}
|
|
171683
171934
|
expected(utils2) {
|
|
171684
|
-
const { text, list } = utils2.normalizeExpectedResult(this._valueSchema.expected(utils2));
|
|
171935
|
+
const { text, list: list2 } = utils2.normalizeExpectedResult(this._valueSchema.expected(utils2));
|
|
171685
171936
|
return {
|
|
171686
171937
|
text: text && `an array of ${text}`,
|
|
171687
|
-
list:
|
|
171938
|
+
list: list2 && {
|
|
171688
171939
|
title: `an array of the following values`,
|
|
171689
|
-
values: [{ list }]
|
|
171940
|
+
values: [{ list: list2 }]
|
|
171690
171941
|
}
|
|
171691
171942
|
};
|
|
171692
171943
|
}
|
|
@@ -173245,7 +173496,7 @@ The range will extend backwards to the start of the first line containing the se
|
|
|
173245
173496
|
markAsRoot: markAsRoot2
|
|
173246
173497
|
} = builders);
|
|
173247
173498
|
SUPPORTED_EMBED_LANGUAGES = /* @__PURE__ */ new Set(["yaml", "toml"]);
|
|
173248
|
-
clean_default =
|
|
173499
|
+
clean_default = clean2;
|
|
173249
173500
|
print_default = printFrontMatter;
|
|
173250
173501
|
nonTraversableKeys = /* @__PURE__ */ new Set([
|
|
173251
173502
|
"tokens",
|
|
@@ -180389,15 +180640,15 @@ var require_parser3 = __commonJS((exports) => {
|
|
|
180389
180640
|
var node_process = __require("process");
|
|
180390
180641
|
var cst = require_cst2();
|
|
180391
180642
|
var lexer = require_lexer2();
|
|
180392
|
-
function includesToken(
|
|
180393
|
-
for (let i5 = 0;i5 <
|
|
180394
|
-
if (
|
|
180643
|
+
function includesToken(list2, type) {
|
|
180644
|
+
for (let i5 = 0;i5 < list2.length; ++i5)
|
|
180645
|
+
if (list2[i5].type === type)
|
|
180395
180646
|
return true;
|
|
180396
180647
|
return false;
|
|
180397
180648
|
}
|
|
180398
|
-
function findNonEmptyIndex(
|
|
180399
|
-
for (let i5 = 0;i5 <
|
|
180400
|
-
switch (
|
|
180649
|
+
function findNonEmptyIndex(list2) {
|
|
180650
|
+
for (let i5 = 0;i5 < list2.length; ++i5) {
|
|
180651
|
+
switch (list2[i5].type) {
|
|
180401
180652
|
case "space":
|
|
180402
180653
|
case "comment":
|
|
180403
180654
|
case "newline":
|
|
@@ -181344,13 +181595,13 @@ var {
|
|
|
181344
181595
|
} = import__.default;
|
|
181345
181596
|
|
|
181346
181597
|
// src/cli.ts
|
|
181347
|
-
import { realpathSync as
|
|
181598
|
+
import { realpathSync as realpathSync3 } from "fs";
|
|
181348
181599
|
import path17 from "path";
|
|
181349
181600
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
181350
181601
|
// package.json
|
|
181351
181602
|
var package_default = {
|
|
181352
181603
|
name: "@eigenpal/cli",
|
|
181353
|
-
version: "0.5.
|
|
181604
|
+
version: "0.5.4",
|
|
181354
181605
|
description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
|
|
181355
181606
|
keywords: [
|
|
181356
181607
|
"eigenpal",
|
|
@@ -181692,6 +181943,9 @@ var env = createEnv({
|
|
|
181692
181943
|
emptyStringAsUndefined: true,
|
|
181693
181944
|
skipValidation: process.env.SKIP_ENV_VALIDATION === "true" || process.env.npm_lifecycle_event === "lint"
|
|
181694
181945
|
});
|
|
181946
|
+
function getProcessEnv() {
|
|
181947
|
+
return process.env;
|
|
181948
|
+
}
|
|
181695
181949
|
|
|
181696
181950
|
// src/lib/credentials.ts
|
|
181697
181951
|
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "fs";
|
|
@@ -183843,15 +184097,716 @@ async function completion(shell, program2) {
|
|
|
183843
184097
|
`);
|
|
183844
184098
|
}
|
|
183845
184099
|
|
|
184100
|
+
// src/commands/git.ts
|
|
184101
|
+
init_src();
|
|
184102
|
+
init_zod();
|
|
184103
|
+
var import_yaml2 = __toESM(require_dist(), 1);
|
|
184104
|
+
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
184105
|
+
import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync3, realpathSync, statSync } from "node:fs";
|
|
184106
|
+
import path2 from "node:path";
|
|
184107
|
+
var SourceRepositorySchema = exports_external.object({
|
|
184108
|
+
gitRepositoryPath: exports_external.string(),
|
|
184109
|
+
remoteUrl: exports_external.string().url()
|
|
184110
|
+
});
|
|
184111
|
+
var AgentsListSchema = exports_external.object({
|
|
184112
|
+
data: exports_external.array(exports_external.record(exports_external.string(), exports_external.unknown())),
|
|
184113
|
+
total: exports_external.number().optional()
|
|
184114
|
+
});
|
|
184115
|
+
var ReleaseSchema = exports_external.object({
|
|
184116
|
+
version: exports_external.string(),
|
|
184117
|
+
tag: exports_external.string(),
|
|
184118
|
+
commit: exports_external.string(),
|
|
184119
|
+
date: exports_external.string().optional()
|
|
184120
|
+
});
|
|
184121
|
+
var ReleasesSchema = exports_external.object({
|
|
184122
|
+
packagePath: exports_external.string(),
|
|
184123
|
+
releases: exports_external.array(ReleaseSchema)
|
|
184124
|
+
});
|
|
184125
|
+
var AuthCheckSchema = exports_external.object({
|
|
184126
|
+
ok: exports_external.literal(true),
|
|
184127
|
+
email: exports_external.string().email().nullable().optional(),
|
|
184128
|
+
name: exports_external.string().nullable().optional(),
|
|
184129
|
+
keyId: exports_external.string()
|
|
184130
|
+
});
|
|
184131
|
+
function runGit(args, opts = {}) {
|
|
184132
|
+
const env2 = opts.config ? gitAuthEnv(opts.config, opts.env, opts.gitRemoteUrl) : { ...getProcessEnv(), ...opts.env };
|
|
184133
|
+
const result = spawnSync2("git", args, {
|
|
184134
|
+
cwd: opts.cwd,
|
|
184135
|
+
env: env2,
|
|
184136
|
+
stdio: "inherit"
|
|
184137
|
+
});
|
|
184138
|
+
if (result.error)
|
|
184139
|
+
throw result.error;
|
|
184140
|
+
if (result.status && result.status !== 0)
|
|
184141
|
+
process.exit(result.status);
|
|
184142
|
+
}
|
|
184143
|
+
function gitOutput(args, cwd, config2, gitRemoteUrl) {
|
|
184144
|
+
const result = spawnSync2("git", args, {
|
|
184145
|
+
cwd,
|
|
184146
|
+
encoding: "utf8",
|
|
184147
|
+
env: config2 ? gitAuthEnv(config2, {}, gitRemoteUrl) : undefined
|
|
184148
|
+
});
|
|
184149
|
+
if (result.status !== 0)
|
|
184150
|
+
return null;
|
|
184151
|
+
return result.stdout.trim();
|
|
184152
|
+
}
|
|
184153
|
+
function gitAuthEnv(config2, extra = {}, gitRemoteUrl) {
|
|
184154
|
+
const env2 = {
|
|
184155
|
+
...getProcessEnv(),
|
|
184156
|
+
...extra
|
|
184157
|
+
};
|
|
184158
|
+
if (!gitRemoteUrl)
|
|
184159
|
+
return env2;
|
|
184160
|
+
return {
|
|
184161
|
+
...env2,
|
|
184162
|
+
GIT_CONFIG_COUNT: "1",
|
|
184163
|
+
GIT_CONFIG_KEY_0: `http.${gitRemoteUrl.replace(/\/+$/, "")}.extraHeader`,
|
|
184164
|
+
GIT_CONFIG_VALUE_0: `Authorization: Bearer ${requireApiKey(config2)}`
|
|
184165
|
+
};
|
|
184166
|
+
}
|
|
184167
|
+
async function resolveGitAuthorEnv(config2) {
|
|
184168
|
+
const auth = AuthCheckSchema.parse(await new ApiClient(config2).get("/api/v1/auth/check"));
|
|
184169
|
+
const email3 = auth.email ?? `${auth.keyId}@api-keys.eigenpal.local`;
|
|
184170
|
+
const name = auth.name?.trim() || auth.email || `Eigenpal API Key ${auth.keyId}`;
|
|
184171
|
+
return {
|
|
184172
|
+
GIT_AUTHOR_NAME: name,
|
|
184173
|
+
GIT_AUTHOR_EMAIL: email3,
|
|
184174
|
+
GIT_COMMITTER_NAME: name,
|
|
184175
|
+
GIT_COMMITTER_EMAIL: email3
|
|
184176
|
+
};
|
|
184177
|
+
}
|
|
184178
|
+
async function getSourceRepository(config2) {
|
|
184179
|
+
const client = new ApiClient(config2);
|
|
184180
|
+
return SourceRepositorySchema.parse(await client.get("/api/v1/source/repository"));
|
|
184181
|
+
}
|
|
184182
|
+
function sourcePathFromPackageRoot(gitRoot, packageRoot) {
|
|
184183
|
+
const relativePath = path2.relative(gitRoot, packageRoot).replace(/\\/g, "/");
|
|
184184
|
+
const result = SourcePackagePathSchema.safeParse(relativePath);
|
|
184185
|
+
return result.success ? result.data : null;
|
|
184186
|
+
}
|
|
184187
|
+
function resolveGitRoot(dir) {
|
|
184188
|
+
return gitOutput(["rev-parse", "--show-toplevel"], dir);
|
|
184189
|
+
}
|
|
184190
|
+
function findNearestPackageRoot(startDir, gitRoot) {
|
|
184191
|
+
let current = path2.resolve(startDir);
|
|
184192
|
+
while (true) {
|
|
184193
|
+
if (existsSync3(path2.join(current, "eigenpal.yaml")))
|
|
184194
|
+
return current;
|
|
184195
|
+
if (gitRoot && current === gitRoot)
|
|
184196
|
+
return null;
|
|
184197
|
+
const parent = path2.dirname(current);
|
|
184198
|
+
if (parent === current)
|
|
184199
|
+
return null;
|
|
184200
|
+
current = parent;
|
|
184201
|
+
}
|
|
184202
|
+
}
|
|
184203
|
+
function resolveGitSourceContext(opts = {}) {
|
|
184204
|
+
const startDir = realpathSync(path2.resolve(opts.dir ?? process.cwd()));
|
|
184205
|
+
const gitRoot = resolveGitRoot(startDir);
|
|
184206
|
+
const packageRoot = findNearestPackageRoot(startDir, gitRoot);
|
|
184207
|
+
const resolvedPackageRoot = packageRoot ? realpathSync(packageRoot) : null;
|
|
184208
|
+
return {
|
|
184209
|
+
gitRoot,
|
|
184210
|
+
packageRoot: resolvedPackageRoot,
|
|
184211
|
+
packagePath: gitRoot && resolvedPackageRoot ? sourcePathFromPackageRoot(gitRoot, resolvedPackageRoot) : null
|
|
184212
|
+
};
|
|
184213
|
+
}
|
|
184214
|
+
function listRelativeFiles(dir) {
|
|
184215
|
+
const files = [];
|
|
184216
|
+
const visit = (current) => {
|
|
184217
|
+
for (const entry of readdirSync(current)) {
|
|
184218
|
+
if (entry === ".git" || entry === "eigenpal_modules" || entry === ".eigenpal")
|
|
184219
|
+
continue;
|
|
184220
|
+
const fullPath = path2.join(current, entry);
|
|
184221
|
+
const rel = path2.relative(dir, fullPath).replace(/\\/g, "/");
|
|
184222
|
+
if (statSync(fullPath).isDirectory())
|
|
184223
|
+
visit(fullPath);
|
|
184224
|
+
else
|
|
184225
|
+
files.push(rel);
|
|
184226
|
+
}
|
|
184227
|
+
};
|
|
184228
|
+
visit(dir);
|
|
184229
|
+
return files;
|
|
184230
|
+
}
|
|
184231
|
+
function readYamlFile(filePath) {
|
|
184232
|
+
return import_yaml2.default.parse(readFileSync3(filePath, "utf8"));
|
|
184233
|
+
}
|
|
184234
|
+
function packageManifestExists(gitRoot, packagePath) {
|
|
184235
|
+
return existsSync3(path2.join(gitRoot, packagePath, "eigenpal.yaml"));
|
|
184236
|
+
}
|
|
184237
|
+
function releaseTagExists(gitRoot, packagePath, version2) {
|
|
184238
|
+
const tag = formatReleaseTag(pathToDottedPackageName(packagePath), version2);
|
|
184239
|
+
return gitOutput(["tag", "--list", tag], gitRoot) === tag;
|
|
184240
|
+
}
|
|
184241
|
+
function validatePackageReferences(input) {
|
|
184242
|
+
const errors3 = [];
|
|
184243
|
+
const dependencies = "dependencies" in input.manifest ? Object.entries(input.manifest.dependencies ?? {}) : [];
|
|
184244
|
+
for (const [dependencyName, version2] of dependencies) {
|
|
184245
|
+
const packagePath = workspaceDependencyNameToPackagePath(dependencyName);
|
|
184246
|
+
if (!packageManifestExists(input.gitRoot, packagePath)) {
|
|
184247
|
+
errors3.push(`Dependency ${dependencyName}@${version2} does not exist in this repository.`);
|
|
184248
|
+
continue;
|
|
184249
|
+
}
|
|
184250
|
+
if (!releaseTagExists(input.gitRoot, packagePath, version2)) {
|
|
184251
|
+
errors3.push(`Dependency ${dependencyName}@${version2} is missing its release tag.`);
|
|
184252
|
+
}
|
|
184253
|
+
}
|
|
184254
|
+
const evaluatorItems = "evaluators" in input.manifest && input.manifest.evaluators && typeof input.manifest.evaluators === "object" && !Array.isArray(input.manifest.evaluators) && "items" in input.manifest.evaluators ? input.manifest.evaluators.items : [];
|
|
184255
|
+
for (const item of evaluatorItems) {
|
|
184256
|
+
if (item.use.startsWith("./")) {
|
|
184257
|
+
const evaluatorPath = path2.normalize(path2.join(input.packageRoot, item.use));
|
|
184258
|
+
if (!evaluatorPath.startsWith(`${input.packageRoot}${path2.sep}`) || !existsSync3(evaluatorPath)) {
|
|
184259
|
+
errors3.push(`Local evaluator ${item.use} does not exist.`);
|
|
184260
|
+
}
|
|
184261
|
+
continue;
|
|
184262
|
+
}
|
|
184263
|
+
if (!("version" in item))
|
|
184264
|
+
continue;
|
|
184265
|
+
const packagePath = workspaceDependencyNameToPackagePath(item.use);
|
|
184266
|
+
if (!packageManifestExists(input.gitRoot, packagePath)) {
|
|
184267
|
+
errors3.push(`Shared evaluator ${item.use}@${item.version} does not exist in this repository.`);
|
|
184268
|
+
continue;
|
|
184269
|
+
}
|
|
184270
|
+
if (!releaseTagExists(input.gitRoot, packagePath, item.version)) {
|
|
184271
|
+
errors3.push(`Shared evaluator ${item.use}@${item.version} is missing its release tag.`);
|
|
184272
|
+
}
|
|
184273
|
+
}
|
|
184274
|
+
return errors3;
|
|
184275
|
+
}
|
|
184276
|
+
function validatePackage(dir) {
|
|
184277
|
+
const context = resolveGitSourceContext({ dir });
|
|
184278
|
+
const errors3 = [];
|
|
184279
|
+
const manifestPath = context.packageRoot ? path2.join(context.packageRoot, "eigenpal.yaml") : null;
|
|
184280
|
+
let parsedManifest = null;
|
|
184281
|
+
if (!context.gitRoot)
|
|
184282
|
+
errors3.push("Not inside a Git repository.");
|
|
184283
|
+
if (!context.packageRoot || !manifestPath)
|
|
184284
|
+
errors3.push("No package eigenpal.yaml found.");
|
|
184285
|
+
if (context.packageRoot && existsSync3(path2.join(context.packageRoot, "eigenpal.yml"))) {
|
|
184286
|
+
errors3.push("Use eigenpal.yaml; eigenpal.yml package manifests are not supported.");
|
|
184287
|
+
}
|
|
184288
|
+
if (!context.packagePath)
|
|
184289
|
+
errors3.push("Package must live under agents/, workflows/, resources/, or evaluators/.");
|
|
184290
|
+
if (manifestPath && existsSync3(manifestPath)) {
|
|
184291
|
+
const filename = SourceManifestFilenameSchema.safeParse(manifestPath);
|
|
184292
|
+
if (!filename.success)
|
|
184293
|
+
errors3.push(filename.error.issues.map((issue2) => issue2.message).join("; "));
|
|
184294
|
+
const manifest = SourcePackageManifestSchema.safeParse(readYamlFile(manifestPath));
|
|
184295
|
+
if (!manifest.success)
|
|
184296
|
+
errors3.push(manifest.error.issues.map((issue2) => issue2.message).join("; "));
|
|
184297
|
+
else
|
|
184298
|
+
parsedManifest = manifest.data;
|
|
184299
|
+
}
|
|
184300
|
+
if (context.packageRoot && context.packagePath) {
|
|
184301
|
+
const fileIssues = validateSourcePackageRequiredFiles({
|
|
184302
|
+
packagePath: context.packagePath,
|
|
184303
|
+
files: listRelativeFiles(context.packageRoot)
|
|
184304
|
+
});
|
|
184305
|
+
errors3.push(...fileIssues.map((issue2) => issue2.message));
|
|
184306
|
+
}
|
|
184307
|
+
if (context.gitRoot && context.packageRoot && parsedManifest) {
|
|
184308
|
+
errors3.push(...validatePackageReferences({
|
|
184309
|
+
gitRoot: context.gitRoot,
|
|
184310
|
+
packageRoot: context.packageRoot,
|
|
184311
|
+
manifest: parsedManifest
|
|
184312
|
+
}));
|
|
184313
|
+
}
|
|
184314
|
+
return { valid: errors3.length === 0, errors: errors3, packagePath: context.packagePath ?? undefined };
|
|
184315
|
+
}
|
|
184316
|
+
function readRootManifest(gitRoot) {
|
|
184317
|
+
const manifestPath = path2.join(gitRoot, "eigenpal.yaml");
|
|
184318
|
+
if (!existsSync3(manifestPath))
|
|
184319
|
+
return { ok: false, error: "Root eigenpal.yaml is missing." };
|
|
184320
|
+
const parsed = RootSourceManifestSchema.safeParse(readYamlFile(manifestPath));
|
|
184321
|
+
if (!parsed.success)
|
|
184322
|
+
return { ok: false, error: parsed.error.issues.map((issue2) => issue2.message).join("; ") };
|
|
184323
|
+
return { ok: true, version: parsed.data.eigenpalVersion };
|
|
184324
|
+
}
|
|
184325
|
+
function checkRepoVersion(gitRoot, mutation) {
|
|
184326
|
+
const manifest = readRootManifest(gitRoot);
|
|
184327
|
+
if (!manifest.ok)
|
|
184328
|
+
return;
|
|
184329
|
+
const repoMajor = manifest.version.split(".")[0];
|
|
184330
|
+
const cliMajor = "1";
|
|
184331
|
+
if (repoMajor !== cliMajor && mutation) {
|
|
184332
|
+
throw new Error(`Repository source version ${manifest.version} is incompatible with this CLI. Run the repository upgrade flow first.`);
|
|
184333
|
+
}
|
|
184334
|
+
if (repoMajor !== cliMajor) {
|
|
184335
|
+
warn(`Repository source version is ${manifest.version}; this development CLI is dev-compatible.`);
|
|
184336
|
+
}
|
|
184337
|
+
}
|
|
184338
|
+
function resolvePackagePath(target) {
|
|
184339
|
+
return target.includes("/") ? SourcePackagePathSchema.parse(target) : dottedPackageNameToPath(DottedPackageNameSchema.parse(target));
|
|
184340
|
+
}
|
|
184341
|
+
function semverParts(version2) {
|
|
184342
|
+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version2);
|
|
184343
|
+
if (!match)
|
|
184344
|
+
return null;
|
|
184345
|
+
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
184346
|
+
}
|
|
184347
|
+
function compareSemverDesc(a, b2) {
|
|
184348
|
+
const left = semverParts(a);
|
|
184349
|
+
const right = semverParts(b2);
|
|
184350
|
+
if (!left || !right)
|
|
184351
|
+
return b2.localeCompare(a);
|
|
184352
|
+
for (let index = 0;index < 3; index += 1) {
|
|
184353
|
+
if (left[index] !== right[index])
|
|
184354
|
+
return right[index] - left[index];
|
|
184355
|
+
}
|
|
184356
|
+
return 0;
|
|
184357
|
+
}
|
|
184358
|
+
function sortReleasesNewestFirst(releases) {
|
|
184359
|
+
return [...releases].sort((a, b2) => compareSemverDesc(a.version, b2.version));
|
|
184360
|
+
}
|
|
184361
|
+
function bumpReleaseVersion(releases, bump) {
|
|
184362
|
+
const latest = sortReleasesNewestFirst(releases)[0]?.version ?? "0.0.0";
|
|
184363
|
+
const parts = semverParts(latest);
|
|
184364
|
+
if (!parts)
|
|
184365
|
+
throw new Error(`Cannot bump from non-semver latest version ${latest}.`);
|
|
184366
|
+
const [major, minor, patch] = parts;
|
|
184367
|
+
if (bump === "major")
|
|
184368
|
+
return `${major + 1}.0.0`;
|
|
184369
|
+
if (bump === "minor")
|
|
184370
|
+
return `${major}.${minor + 1}.0`;
|
|
184371
|
+
return `${major}.${minor}.${patch + 1}`;
|
|
184372
|
+
}
|
|
184373
|
+
function requirePackageClean(context) {
|
|
184374
|
+
if (!context.gitRoot || !context.packagePath)
|
|
184375
|
+
throw new Error("No package context found.");
|
|
184376
|
+
const status = gitOutput(["status", "--short", "--", context.packagePath], context.gitRoot) ?? "";
|
|
184377
|
+
if (status.length > 0) {
|
|
184378
|
+
throw new Error(`Release requires a clean package working tree:
|
|
184379
|
+
${status}`);
|
|
184380
|
+
}
|
|
184381
|
+
}
|
|
184382
|
+
function requirePushedMain(gitRoot, config2) {
|
|
184383
|
+
const branch = gitOutput(["rev-parse", "--abbrev-ref", "HEAD"], gitRoot);
|
|
184384
|
+
if (branch !== "main")
|
|
184385
|
+
throw new Error("Release must be run from the main branch.");
|
|
184386
|
+
const remoteUrl = gitOutput(["remote", "get-url", "origin"], gitRoot);
|
|
184387
|
+
runGit(["fetch", "origin", "main"], {
|
|
184388
|
+
cwd: gitRoot,
|
|
184389
|
+
config: config2,
|
|
184390
|
+
gitRemoteUrl: remoteUrl ?? undefined
|
|
184391
|
+
});
|
|
184392
|
+
const head = gitOutput(["rev-parse", "HEAD"], gitRoot);
|
|
184393
|
+
const originMain = gitOutput(["rev-parse", "origin/main"], gitRoot);
|
|
184394
|
+
if (!head || !originMain || head !== originMain) {
|
|
184395
|
+
throw new Error("Release requires local main to match pushed origin/main.");
|
|
184396
|
+
}
|
|
184397
|
+
}
|
|
184398
|
+
async function syncLatestAutomation(client, packagePath) {
|
|
184399
|
+
const automation = pathToDottedPackageName(packagePath);
|
|
184400
|
+
try {
|
|
184401
|
+
await client.post(`/api/automations/${encodeURIComponent(automation)}/sync`);
|
|
184402
|
+
success2(`Synced ${automation} to latest release.`);
|
|
184403
|
+
} catch (err) {
|
|
184404
|
+
if (err instanceof ApiError && err.status === 404 || err instanceof HtmlResponseError) {
|
|
184405
|
+
warn("Automation sync endpoint is not available yet; run sync after it lands.");
|
|
184406
|
+
return;
|
|
184407
|
+
}
|
|
184408
|
+
throw err;
|
|
184409
|
+
}
|
|
184410
|
+
}
|
|
184411
|
+
async function cloneSource(opts) {
|
|
184412
|
+
const config2 = resolveConfig(opts);
|
|
184413
|
+
const repo = await getSourceRepository(config2);
|
|
184414
|
+
runGit(["clone", repo.remoteUrl, opts.out ?? path2.basename(repo.gitRepositoryPath)], {
|
|
184415
|
+
config: config2,
|
|
184416
|
+
gitRemoteUrl: repo.remoteUrl
|
|
184417
|
+
});
|
|
184418
|
+
success2(`Cloned ${repo.remoteUrl}`);
|
|
184419
|
+
}
|
|
184420
|
+
async function gitPassthrough(args, opts) {
|
|
184421
|
+
if (args.length === 0) {
|
|
184422
|
+
error51("Pass Git arguments after `--`, for example `eigenpal git -- status`.");
|
|
184423
|
+
process.exit(2);
|
|
184424
|
+
}
|
|
184425
|
+
const config2 = resolveConfig(opts);
|
|
184426
|
+
const cwd = gitCwdFromArgs(args);
|
|
184427
|
+
const remoteUrl = gitOutput(["remote", "get-url", "origin"], cwd);
|
|
184428
|
+
runGit(args, {
|
|
184429
|
+
config: config2,
|
|
184430
|
+
env: gitCommandCreatesObjects(args) ? await resolveGitAuthorEnv(config2) : undefined,
|
|
184431
|
+
gitRemoteUrl: remoteUrl ?? undefined
|
|
184432
|
+
});
|
|
184433
|
+
}
|
|
184434
|
+
function gitCommandCreatesObjects(args) {
|
|
184435
|
+
const objectCreatingCommands = new Set([
|
|
184436
|
+
"cherry-pick",
|
|
184437
|
+
"commit",
|
|
184438
|
+
"merge",
|
|
184439
|
+
"rebase",
|
|
184440
|
+
"revert",
|
|
184441
|
+
"tag"
|
|
184442
|
+
]);
|
|
184443
|
+
return args.some((arg) => objectCreatingCommands.has(arg));
|
|
184444
|
+
}
|
|
184445
|
+
function gitCwdFromArgs(args) {
|
|
184446
|
+
let cwd = process.cwd();
|
|
184447
|
+
for (let i = 0;i < args.length; i += 1) {
|
|
184448
|
+
if (args[i] === "-C" && args[i + 1]) {
|
|
184449
|
+
cwd = path2.resolve(cwd, args[i + 1]);
|
|
184450
|
+
i += 1;
|
|
184451
|
+
}
|
|
184452
|
+
}
|
|
184453
|
+
return cwd;
|
|
184454
|
+
}
|
|
184455
|
+
async function runGitPassthroughFromArgv(argv) {
|
|
184456
|
+
const gitIndex = argv.indexOf("git");
|
|
184457
|
+
const separatorIndex = argv.indexOf("--", gitIndex + 1);
|
|
184458
|
+
if (gitIndex === -1 || separatorIndex === -1)
|
|
184459
|
+
return false;
|
|
184460
|
+
const beforeSeparator = argv.slice(gitIndex + 1, separatorIndex);
|
|
184461
|
+
const baseUrlIndex = beforeSeparator.indexOf("--base-url");
|
|
184462
|
+
const baseUrl = baseUrlIndex >= 0 && beforeSeparator[baseUrlIndex + 1] ? beforeSeparator[baseUrlIndex + 1] : undefined;
|
|
184463
|
+
await gitPassthrough(argv.slice(separatorIndex + 1), { baseUrl });
|
|
184464
|
+
return true;
|
|
184465
|
+
}
|
|
184466
|
+
function hasGitPassthroughSeparator(argv) {
|
|
184467
|
+
const gitIndex = argv.indexOf("git");
|
|
184468
|
+
return gitIndex !== -1 && argv.indexOf("--", gitIndex + 1) !== -1;
|
|
184469
|
+
}
|
|
184470
|
+
function doctor(opts) {
|
|
184471
|
+
const context = resolveGitSourceContext(opts);
|
|
184472
|
+
const checks3 = [];
|
|
184473
|
+
checks3.push({
|
|
184474
|
+
check: "git",
|
|
184475
|
+
status: gitOutput(["--version"]) ? "pass" : "fail",
|
|
184476
|
+
detail: gitOutput(["--version"]) ?? "git not found"
|
|
184477
|
+
});
|
|
184478
|
+
checks3.push({
|
|
184479
|
+
check: "repo",
|
|
184480
|
+
status: context.gitRoot ? "pass" : "fail",
|
|
184481
|
+
detail: context.gitRoot ?? "not inside a Git repository"
|
|
184482
|
+
});
|
|
184483
|
+
if (context.gitRoot) {
|
|
184484
|
+
const root = readRootManifest(context.gitRoot);
|
|
184485
|
+
checks3.push({
|
|
184486
|
+
check: "root manifest",
|
|
184487
|
+
status: root.ok ? "pass" : "fail",
|
|
184488
|
+
detail: root.ok ? `eigenpalVersion ${root.version}` : root.error
|
|
184489
|
+
});
|
|
184490
|
+
if (root.ok) {
|
|
184491
|
+
const repoMajor = root.version.split(".")[0];
|
|
184492
|
+
checks3.push({
|
|
184493
|
+
check: "repo version",
|
|
184494
|
+
status: repoMajor === "1" ? "pass" : "fail",
|
|
184495
|
+
detail: repoMajor === "1" ? `compatible ${root.version}` : `incompatible ${root.version}; run repository upgrade first`
|
|
184496
|
+
});
|
|
184497
|
+
}
|
|
184498
|
+
const gitignore = existsSync3(path2.join(context.gitRoot, ".gitignore")) ? readFileSync3(path2.join(context.gitRoot, ".gitignore"), "utf8") : "";
|
|
184499
|
+
for (const ignored of [".eigenpal/", "eigenpal_modules/"]) {
|
|
184500
|
+
checks3.push({
|
|
184501
|
+
check: `ignore ${ignored}`,
|
|
184502
|
+
status: gitignore.includes(ignored) ? "pass" : "fail",
|
|
184503
|
+
detail: gitignore.includes(ignored) ? ignored : `add ${ignored} to .gitignore`
|
|
184504
|
+
});
|
|
184505
|
+
}
|
|
184506
|
+
checks3.push({
|
|
184507
|
+
check: "unsupported manifest",
|
|
184508
|
+
status: existsSync3(path2.join(context.gitRoot, "eigenpal.yml")) ? "fail" : "pass",
|
|
184509
|
+
detail: "root eigenpal.yml must not exist"
|
|
184510
|
+
});
|
|
184511
|
+
const remoteUrl = gitOutput(["remote", "get-url", "origin"], context.gitRoot);
|
|
184512
|
+
checks3.push({
|
|
184513
|
+
check: "remote origin",
|
|
184514
|
+
status: remoteUrl ? "pass" : "fail",
|
|
184515
|
+
detail: remoteUrl ?? "origin remote is not configured"
|
|
184516
|
+
});
|
|
184517
|
+
if (remoteUrl) {
|
|
184518
|
+
let authDetail = "git ls-remote origin succeeded";
|
|
184519
|
+
let authStatus = "pass";
|
|
184520
|
+
try {
|
|
184521
|
+
const config2 = resolveConfig(opts);
|
|
184522
|
+
if (!gitOutput(["ls-remote", "--heads", "origin"], context.gitRoot, config2, remoteUrl)) {
|
|
184523
|
+
authStatus = "fail";
|
|
184524
|
+
authDetail = "git ls-remote origin failed";
|
|
184525
|
+
}
|
|
184526
|
+
} catch (err) {
|
|
184527
|
+
authStatus = "fail";
|
|
184528
|
+
authDetail = err instanceof Error ? err.message : "Git auth check failed";
|
|
184529
|
+
}
|
|
184530
|
+
checks3.push({
|
|
184531
|
+
check: "remote auth",
|
|
184532
|
+
status: authStatus,
|
|
184533
|
+
detail: authDetail
|
|
184534
|
+
});
|
|
184535
|
+
}
|
|
184536
|
+
}
|
|
184537
|
+
if (context.packageRoot) {
|
|
184538
|
+
const result = validatePackage(context.packageRoot);
|
|
184539
|
+
checks3.push({
|
|
184540
|
+
check: "package structure",
|
|
184541
|
+
status: result.valid ? "pass" : "fail",
|
|
184542
|
+
detail: result.valid ? result.packagePath ?? "-" : result.errors.join("; ")
|
|
184543
|
+
});
|
|
184544
|
+
}
|
|
184545
|
+
if (opts.json)
|
|
184546
|
+
console.log(JSON.stringify({ checks: checks3 }, null, 2));
|
|
184547
|
+
else
|
|
184548
|
+
console.log(table(checks3, [
|
|
184549
|
+
{ key: "check", header: "check" },
|
|
184550
|
+
{ key: "status", header: "status" },
|
|
184551
|
+
{ key: "detail", header: "detail" }
|
|
184552
|
+
]));
|
|
184553
|
+
if (checks3.some((check2) => check2.status === "fail"))
|
|
184554
|
+
process.exit(1);
|
|
184555
|
+
}
|
|
184556
|
+
function validate(opts) {
|
|
184557
|
+
const context = resolveGitSourceContext({ dir: opts.dir });
|
|
184558
|
+
if (context.gitRoot)
|
|
184559
|
+
checkRepoVersion(context.gitRoot, false);
|
|
184560
|
+
const result = validatePackage(opts.dir ?? process.cwd());
|
|
184561
|
+
if (opts.json)
|
|
184562
|
+
console.log(JSON.stringify(result, null, 2));
|
|
184563
|
+
else if (result.valid)
|
|
184564
|
+
success2(`Valid package ${result.packagePath ?? ""}`.trim());
|
|
184565
|
+
else {
|
|
184566
|
+
error51("Package validation failed.");
|
|
184567
|
+
for (const issue2 of result.errors)
|
|
184568
|
+
dim(` ${issue2}`);
|
|
184569
|
+
}
|
|
184570
|
+
if (!result.valid)
|
|
184571
|
+
process.exit(1);
|
|
184572
|
+
}
|
|
184573
|
+
function packageStatus(opts) {
|
|
184574
|
+
const context = resolveGitSourceContext(opts);
|
|
184575
|
+
if (context.gitRoot)
|
|
184576
|
+
checkRepoVersion(context.gitRoot, false);
|
|
184577
|
+
const validation = context.packageRoot ? validatePackage(context.packageRoot) : null;
|
|
184578
|
+
const gitStatus = context.gitRoot ? gitOutput(["status", "--short"], context.gitRoot) ?? "" : "";
|
|
184579
|
+
const payload = {
|
|
184580
|
+
gitRoot: context.gitRoot,
|
|
184581
|
+
packageRoot: context.packageRoot,
|
|
184582
|
+
packagePath: context.packagePath,
|
|
184583
|
+
clean: gitStatus.length === 0,
|
|
184584
|
+
valid: validation?.valid ?? false,
|
|
184585
|
+
errors: validation?.errors ?? []
|
|
184586
|
+
};
|
|
184587
|
+
if (opts.json)
|
|
184588
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
184589
|
+
else {
|
|
184590
|
+
console.log(table([payload], [
|
|
184591
|
+
{ key: "packagePath", header: "package" },
|
|
184592
|
+
{ key: "clean", header: "clean" },
|
|
184593
|
+
{ key: "valid", header: "valid" }
|
|
184594
|
+
]));
|
|
184595
|
+
}
|
|
184596
|
+
}
|
|
184597
|
+
function deps(opts) {
|
|
184598
|
+
const context = resolveGitSourceContext(opts);
|
|
184599
|
+
if (!context.packageRoot)
|
|
184600
|
+
throw new Error("No package eigenpal.yaml found.");
|
|
184601
|
+
const manifest = SourcePackageManifestSchema.parse(readYamlFile(path2.join(context.packageRoot, "eigenpal.yaml")));
|
|
184602
|
+
const rows = Object.entries(manifest.dependencies ?? {}).map(([name, version2]) => ({
|
|
184603
|
+
name,
|
|
184604
|
+
version: version2
|
|
184605
|
+
}));
|
|
184606
|
+
if (opts.json)
|
|
184607
|
+
console.log(JSON.stringify({ dependencies: rows }, null, 2));
|
|
184608
|
+
else
|
|
184609
|
+
console.log(table(rows, [
|
|
184610
|
+
{ key: "name", header: "dependency" },
|
|
184611
|
+
{ key: "version", header: "version" }
|
|
184612
|
+
]));
|
|
184613
|
+
}
|
|
184614
|
+
function clean(opts) {
|
|
184615
|
+
const context = resolveGitSourceContext(opts);
|
|
184616
|
+
if (!context.gitRoot)
|
|
184617
|
+
throw new Error("Not inside a Git repository.");
|
|
184618
|
+
const status = gitOutput(["status", "--short"], context.gitRoot) ?? "";
|
|
184619
|
+
if (status.length > 0) {
|
|
184620
|
+
error51("Working tree is not clean.");
|
|
184621
|
+
process.stdout.write(`${status}
|
|
184622
|
+
`);
|
|
184623
|
+
process.exit(1);
|
|
184624
|
+
}
|
|
184625
|
+
success2("Working tree is clean.");
|
|
184626
|
+
}
|
|
184627
|
+
async function list(opts) {
|
|
184628
|
+
if (opts.type && opts.type !== "agent") {
|
|
184629
|
+
throw new Error("Only agent automation listing is available before workflow cutover.");
|
|
184630
|
+
}
|
|
184631
|
+
const client = new ApiClient(resolveConfig(opts));
|
|
184632
|
+
const raw = await client.get("/api/v1/agents", {
|
|
184633
|
+
limit: String(opts.limit),
|
|
184634
|
+
offset: String(opts.offset),
|
|
184635
|
+
...opts.search ? { search: opts.search } : {},
|
|
184636
|
+
...opts.includeArchived ? { includeArchived: "true" } : {}
|
|
184637
|
+
});
|
|
184638
|
+
const parsed = AgentsListSchema.parse(raw);
|
|
184639
|
+
if (opts.json)
|
|
184640
|
+
console.log(JSON.stringify(parsed, null, 2));
|
|
184641
|
+
else {
|
|
184642
|
+
const rows = parsed.data.map((row) => ({
|
|
184643
|
+
...row,
|
|
184644
|
+
inconsistency: typeof row.sourceIntegrity === "string" && row.sourceIntegrity !== "healthy" ? row.sourceIntegrity : ""
|
|
184645
|
+
}));
|
|
184646
|
+
renderListResult({ ...parsed, data: rows }, [
|
|
184647
|
+
{ key: "type", header: "type", format: () => "agent" },
|
|
184648
|
+
{ key: "slug", header: "slug" },
|
|
184649
|
+
{ key: "name", header: "name" },
|
|
184650
|
+
{ key: "status", header: "status" },
|
|
184651
|
+
{ key: "sourceIntegrity", header: "source" },
|
|
184652
|
+
{ key: "latestVersion", header: "latest" },
|
|
184653
|
+
{ key: "inconsistency", header: "inconsistency" }
|
|
184654
|
+
], { entityLabel: "automation" });
|
|
184655
|
+
}
|
|
184656
|
+
}
|
|
184657
|
+
async function show(target, opts) {
|
|
184658
|
+
const packagePath = resolvePackagePath(target);
|
|
184659
|
+
const slug = packagePath.replace(/^agents\//, "");
|
|
184660
|
+
const client = new ApiClient(resolveConfig(opts));
|
|
184661
|
+
const payload = await client.get(`/api/v1/agents/${encodeURIComponent(slug)}`, {
|
|
184662
|
+
include: "files,dataset,runs"
|
|
184663
|
+
});
|
|
184664
|
+
if (opts.json)
|
|
184665
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
184666
|
+
else {
|
|
184667
|
+
const agent = payload.agent;
|
|
184668
|
+
console.log(table([
|
|
184669
|
+
{
|
|
184670
|
+
type: "agent",
|
|
184671
|
+
slug: agent.slug ?? slug,
|
|
184672
|
+
path: packagePath,
|
|
184673
|
+
name: agent.name ?? "",
|
|
184674
|
+
status: agent.status ?? "",
|
|
184675
|
+
source: agent.sourceIntegrity ?? "",
|
|
184676
|
+
latest: agent.latestVersion ?? "",
|
|
184677
|
+
commit: agent.latestCommit ?? ""
|
|
184678
|
+
}
|
|
184679
|
+
], [
|
|
184680
|
+
{ key: "type", header: "type" },
|
|
184681
|
+
{ key: "slug", header: "slug" },
|
|
184682
|
+
{ key: "path", header: "path" },
|
|
184683
|
+
{ key: "name", header: "name" },
|
|
184684
|
+
{ key: "status", header: "status" },
|
|
184685
|
+
{ key: "source", header: "source" },
|
|
184686
|
+
{ key: "latest", header: "latest" },
|
|
184687
|
+
{ key: "commit", header: "commit", format: (value) => String(value || "-").slice(0, 12) }
|
|
184688
|
+
]));
|
|
184689
|
+
if (agent.description)
|
|
184690
|
+
console.log(`
|
|
184691
|
+
description: ${agent.description}`);
|
|
184692
|
+
const runs = agent.recentRuns ?? agent.runs ?? [];
|
|
184693
|
+
console.log(`
|
|
184694
|
+
recent runs`);
|
|
184695
|
+
console.log(table(runs.slice(0, 5), [
|
|
184696
|
+
{ key: "id", header: "id" },
|
|
184697
|
+
{ key: "createdAt", header: "time", format: (value) => formatTimestamp(value) },
|
|
184698
|
+
{ key: "durationMs", header: "duration", format: (value) => formatDuration(Number(value)) },
|
|
184699
|
+
{ key: "triggeredBy", header: "triggered-by" },
|
|
184700
|
+
{ key: "requestedVersion", header: "requested" },
|
|
184701
|
+
{ key: "resolvedVersion", header: "resolved" },
|
|
184702
|
+
{ key: "status", header: "status" }
|
|
184703
|
+
]));
|
|
184704
|
+
}
|
|
184705
|
+
}
|
|
184706
|
+
async function versions2(target, opts) {
|
|
184707
|
+
const packagePath = resolvePackagePath(target);
|
|
184708
|
+
const client = new ApiClient(resolveConfig(opts));
|
|
184709
|
+
const parsed = ReleasesSchema.parse(await client.get("/api/v1/source/releases", { packagePath }));
|
|
184710
|
+
const sorted = { ...parsed, releases: sortReleasesNewestFirst(parsed.releases) };
|
|
184711
|
+
if (opts.json)
|
|
184712
|
+
console.log(JSON.stringify(sorted, null, 2));
|
|
184713
|
+
else
|
|
184714
|
+
console.log(table(sorted.releases, [
|
|
184715
|
+
{ key: "version", header: "version" },
|
|
184716
|
+
{ key: "tag", header: "tag" },
|
|
184717
|
+
{ key: "commit", header: "commit", format: (value) => String(value).slice(0, 12) },
|
|
184718
|
+
{ key: "date", header: "date", format: (value) => formatTimestamp(value) }
|
|
184719
|
+
]));
|
|
184720
|
+
}
|
|
184721
|
+
async function release(versionOrBump, dir, opts) {
|
|
184722
|
+
const context = resolveGitSourceContext({ dir });
|
|
184723
|
+
if (!context.gitRoot || !context.packageRoot || !context.packagePath) {
|
|
184724
|
+
throw new Error("Run release inside a source package in an organization Git repo.");
|
|
184725
|
+
}
|
|
184726
|
+
const config2 = resolveConfig(opts);
|
|
184727
|
+
checkRepoVersion(context.gitRoot, true);
|
|
184728
|
+
const validation = validatePackage(context.packageRoot);
|
|
184729
|
+
if (!validation.valid)
|
|
184730
|
+
throw new Error(`Package validation failed: ${validation.errors.join("; ")}`);
|
|
184731
|
+
requirePackageClean(context);
|
|
184732
|
+
requirePushedMain(context.gitRoot, config2);
|
|
184733
|
+
if (!opts.message)
|
|
184734
|
+
throw new Error("Release requires -m <message>.");
|
|
184735
|
+
const client = new ApiClient(config2);
|
|
184736
|
+
const version2 = ["patch", "minor", "major"].includes(versionOrBump) ? bumpReleaseVersion(ReleasesSchema.parse(await client.get("/api/v1/source/releases", { packagePath: context.packagePath })).releases, versionOrBump) : versionOrBump;
|
|
184737
|
+
if (!/^\d+\.\d+\.\d+$/.test(version2)) {
|
|
184738
|
+
throw new Error("Release version must be X.Y.Z, patch, minor, or major.");
|
|
184739
|
+
}
|
|
184740
|
+
const existing = ReleasesSchema.parse(await client.get("/api/v1/source/releases", {
|
|
184741
|
+
packagePath: context.packagePath,
|
|
184742
|
+
version: version2
|
|
184743
|
+
}));
|
|
184744
|
+
if (existing.releases.length > 0) {
|
|
184745
|
+
throw new Error(`Release ${version2} already exists for ${context.packagePath}.`);
|
|
184746
|
+
}
|
|
184747
|
+
const tag = formatReleaseTag(pathToDottedPackageName(context.packagePath), version2);
|
|
184748
|
+
const authorEnv = await resolveGitAuthorEnv(config2);
|
|
184749
|
+
runGit(["tag", "-a", tag, "-m", opts.message], { cwd: context.gitRoot, env: authorEnv });
|
|
184750
|
+
const remoteUrl = gitOutput(["remote", "get-url", "origin"], context.gitRoot);
|
|
184751
|
+
try {
|
|
184752
|
+
runGit(["push", "origin", tag], {
|
|
184753
|
+
cwd: context.gitRoot,
|
|
184754
|
+
config: config2,
|
|
184755
|
+
gitRemoteUrl: remoteUrl ?? undefined
|
|
184756
|
+
});
|
|
184757
|
+
} catch (err) {
|
|
184758
|
+
runGit(["tag", "-d", tag], { cwd: context.gitRoot });
|
|
184759
|
+
throw err;
|
|
184760
|
+
}
|
|
184761
|
+
success2(`Released ${tag}.`);
|
|
184762
|
+
await syncLatestAutomation(client, context.packagePath);
|
|
184763
|
+
}
|
|
184764
|
+
async function sync(target, opts) {
|
|
184765
|
+
const context = resolveGitSourceContext({ dir: opts.dir });
|
|
184766
|
+
const packagePath = target ? resolvePackagePath(target) : context.packagePath;
|
|
184767
|
+
if (!packagePath) {
|
|
184768
|
+
throw new Error("Pass an automation target or run sync inside a source package.");
|
|
184769
|
+
}
|
|
184770
|
+
if (target?.includes("@")) {
|
|
184771
|
+
throw new Error("Sync always uses latest; do not pass a versioned target.");
|
|
184772
|
+
}
|
|
184773
|
+
await syncLatestAutomation(new ApiClient(resolveConfig(opts)), packagePath);
|
|
184774
|
+
}
|
|
184775
|
+
function parseReleaseVersion(value) {
|
|
184776
|
+
if (!/^\d+\.\d+\.\d+$/.test(value) && !["patch", "minor", "major"].includes(value)) {
|
|
184777
|
+
throw new InvalidArgumentError("version must be X.Y.Z, patch, minor, or major");
|
|
184778
|
+
}
|
|
184779
|
+
return value;
|
|
184780
|
+
}
|
|
184781
|
+
function parseType(value) {
|
|
184782
|
+
if (!["agent", "workflow"].includes(value))
|
|
184783
|
+
throw new InvalidArgumentError("type must be agent or workflow");
|
|
184784
|
+
return value;
|
|
184785
|
+
}
|
|
184786
|
+
function registerGitCommands(program2) {
|
|
184787
|
+
const git = program2.command("git", { hidden: true }).description("Experimental Git-backed source commands.").allowUnknownOption(true).allowExcessArguments(true).argument("[gitArgs...]", "Git arguments after --").action(action(async (gitArgs, opts) => gitPassthrough(gitArgs ?? [], opts)));
|
|
184788
|
+
withBaseUrl(git.command("clone")).description("Clone the organization source repository.").option("--out <dir>", "Output directory").action(action(cloneSource));
|
|
184789
|
+
addJsonFlag(git.command("doctor")).description("Check organization source repository health.").option("--dir <dir>", "Directory to inspect").action(action(async (opts) => doctor(opts)));
|
|
184790
|
+
addJsonFlag(git.command("validate [dir]")).description("Validate the nearest source package.").action(action(async (dir, opts) => validate({ ...opts, dir })));
|
|
184791
|
+
addJsonFlag(git.command("status")).description("Show source repo and package status.").option("--dir <dir>", "Directory to inspect").action(action(async (opts) => packageStatus(opts)));
|
|
184792
|
+
addJsonFlag(git.command("deps")).description("List package workspace dependencies.").option("--dir <dir>", "Directory to inspect").action(action(async (opts) => deps(opts)));
|
|
184793
|
+
git.command("clean").description("Require a clean source working tree.").option("--dir <dir>", "Directory to inspect").action(action(async (opts) => clean(opts)));
|
|
184794
|
+
addJsonFlag(withPagination(withBaseUrl(git.command("list")), 50)).description("List Git-backed automations.").option("--type <type>", "Filter by automation type", parseType).option("--search <q>", "Search by slug, name, or description").option("--include-archived", "Include archived automations").action(action(list));
|
|
184795
|
+
addJsonFlag(withBaseUrl(git.command("show <automation>"))).description("Show Git-backed automation details.").action(action(show));
|
|
184796
|
+
addJsonFlag(withBaseUrl(git.command("versions <package>"))).description("List package release versions.").action(action(versions2));
|
|
184797
|
+
withBaseUrl(git.command("release")).description("Create and push a package release tag.").argument("<version>", "Version or bump level", parseReleaseVersion).argument("[dir]", "Package directory").addOption(new Option("-m, --message <message>", "Annotated tag message").makeOptionMandatory()).action(action(async (versionOrBump, dir, opts) => release(versionOrBump, dir, opts)));
|
|
184798
|
+
withBaseUrl(git.command("sync [automation]")).description("Sync an automation from the latest Git source release.").option("--dir <dir>", "Directory to inspect").action(action(sync));
|
|
184799
|
+
}
|
|
184800
|
+
|
|
183846
184801
|
// src/commands/init.ts
|
|
183847
184802
|
init_dist4();
|
|
183848
184803
|
import {
|
|
183849
184804
|
copyFileSync,
|
|
183850
|
-
existsSync as
|
|
184805
|
+
existsSync as existsSync4,
|
|
183851
184806
|
mkdirSync as mkdirSync2,
|
|
183852
|
-
readdirSync,
|
|
183853
|
-
readFileSync as
|
|
183854
|
-
statSync,
|
|
184807
|
+
readdirSync as readdirSync2,
|
|
184808
|
+
readFileSync as readFileSync4,
|
|
184809
|
+
statSync as statSync2,
|
|
183855
184810
|
writeFileSync as writeFileSync2
|
|
183856
184811
|
} from "node:fs";
|
|
183857
184812
|
import { dirname as dirname2, join as join2, relative, resolve } from "node:path";
|
|
@@ -183868,10 +184823,10 @@ function isValidProjectName(name) {
|
|
|
183868
184823
|
function resolveTemplatesRoot() {
|
|
183869
184824
|
const here = dirname2(fileURLToPath(import.meta.url));
|
|
183870
184825
|
const srcCandidate = resolve(here, "..", "templates");
|
|
183871
|
-
if (
|
|
184826
|
+
if (existsSync4(srcCandidate))
|
|
183872
184827
|
return srcCandidate;
|
|
183873
184828
|
const distCandidate = resolve(here, "templates");
|
|
183874
|
-
if (
|
|
184829
|
+
if (existsSync4(distCandidate))
|
|
183875
184830
|
return distCandidate;
|
|
183876
184831
|
throw new Error(`Cannot locate bundled templates. Looked in:
|
|
183877
184832
|
${srcCandidate}
|
|
@@ -183885,22 +184840,22 @@ async function init(name, opts) {
|
|
|
183885
184840
|
if (opts.dir !== undefined && !opts.dir.startsWith("/") && opts.dir.split(/[/\\]/).some((s) => s === "..")) {
|
|
183886
184841
|
throw new Error(`Refusing to scaffold into ${target}: --dir contains "..". Pass an absolute path if you intend this.`);
|
|
183887
184842
|
}
|
|
183888
|
-
if (
|
|
184843
|
+
if (existsSync4(target) && readdirSync2(target).length > 0) {
|
|
183889
184844
|
throw new Error(`Target directory ${relative(process.cwd(), target)} exists and is not empty.`);
|
|
183890
184845
|
}
|
|
183891
|
-
let
|
|
184846
|
+
let template2;
|
|
183892
184847
|
if (opts.template) {
|
|
183893
184848
|
if (!isTemplateName(opts.template)) {
|
|
183894
184849
|
throw new Error(`Unknown template "${opts.template}". Available: ${TEMPLATE_NAMES.join(", ")}.`);
|
|
183895
184850
|
}
|
|
183896
|
-
|
|
184851
|
+
template2 = opts.template;
|
|
183897
184852
|
} else if (opts.yes || !process.stdin.isTTY) {
|
|
183898
|
-
|
|
184853
|
+
template2 = "blank";
|
|
183899
184854
|
} else {
|
|
183900
|
-
|
|
184855
|
+
template2 = await promptForTemplate();
|
|
183901
184856
|
}
|
|
183902
|
-
const sourceRoot = join2(resolveTemplatesRoot(),
|
|
183903
|
-
if (!
|
|
184857
|
+
const sourceRoot = join2(resolveTemplatesRoot(), template2);
|
|
184858
|
+
if (!existsSync4(sourceRoot)) {
|
|
183904
184859
|
throw new Error(`Template directory missing on disk: ${sourceRoot}`);
|
|
183905
184860
|
}
|
|
183906
184861
|
const written = copyTemplate(sourceRoot, target, name);
|
|
@@ -183937,18 +184892,18 @@ function copyTemplate(src, dst, projectName) {
|
|
|
183937
184892
|
const stack = [src];
|
|
183938
184893
|
while (stack.length > 0) {
|
|
183939
184894
|
const dir = stack.pop();
|
|
183940
|
-
for (const entry of
|
|
184895
|
+
for (const entry of readdirSync2(dir)) {
|
|
183941
184896
|
const sourcePath = join2(dir, entry);
|
|
183942
184897
|
const relativePath = relative(src, sourcePath);
|
|
183943
184898
|
const targetPath = join2(dst, relativePath);
|
|
183944
|
-
const stats =
|
|
184899
|
+
const stats = statSync2(sourcePath);
|
|
183945
184900
|
if (stats.isDirectory()) {
|
|
183946
184901
|
stack.push(sourcePath);
|
|
183947
184902
|
continue;
|
|
183948
184903
|
}
|
|
183949
184904
|
mkdirSync2(dirname2(targetPath), { recursive: true });
|
|
183950
184905
|
if (isTextFile(sourcePath)) {
|
|
183951
|
-
const text =
|
|
184906
|
+
const text = readFileSync4(sourcePath, "utf-8").replaceAll(PLACEHOLDER, projectName);
|
|
183952
184907
|
writeFileSync2(targetPath, text);
|
|
183953
184908
|
} else {
|
|
183954
184909
|
copyFileSync(sourcePath, targetPath);
|
|
@@ -183971,22 +184926,22 @@ var TEXT_EXTENSIONS = new Set([
|
|
|
183971
184926
|
".html",
|
|
183972
184927
|
".css"
|
|
183973
184928
|
]);
|
|
183974
|
-
function isTextFile(
|
|
183975
|
-
const dotIndex =
|
|
184929
|
+
function isTextFile(path3) {
|
|
184930
|
+
const dotIndex = path3.lastIndexOf(".");
|
|
183976
184931
|
if (dotIndex < 0)
|
|
183977
184932
|
return false;
|
|
183978
|
-
return TEXT_EXTENSIONS.has(
|
|
184933
|
+
return TEXT_EXTENSIONS.has(path3.slice(dotIndex).toLowerCase());
|
|
183979
184934
|
}
|
|
183980
184935
|
|
|
183981
184936
|
// src/commands/skill.ts
|
|
183982
184937
|
init_dist4();
|
|
183983
184938
|
import { createHash as createHash2 } from "node:crypto";
|
|
183984
184939
|
import {
|
|
183985
|
-
existsSync as
|
|
184940
|
+
existsSync as existsSync5,
|
|
183986
184941
|
lstatSync,
|
|
183987
184942
|
mkdirSync as mkdirSync3,
|
|
183988
|
-
readFileSync as
|
|
183989
|
-
readdirSync as
|
|
184943
|
+
readFileSync as readFileSync5,
|
|
184944
|
+
readdirSync as readdirSync3,
|
|
183990
184945
|
rmSync,
|
|
183991
184946
|
rmdirSync,
|
|
183992
184947
|
unlinkSync as unlinkSync2,
|
|
@@ -184063,10 +185018,10 @@ var TOOLS = [
|
|
|
184063
185018
|
function resolveSkillSource() {
|
|
184064
185019
|
const here = dirname3(fileURLToPath2(import.meta.url));
|
|
184065
185020
|
const srcCandidate = resolve2(here, "..", "skill");
|
|
184066
|
-
if (
|
|
185021
|
+
if (existsSync5(srcCandidate))
|
|
184067
185022
|
return srcCandidate;
|
|
184068
185023
|
const distCandidate = resolve2(here, "skill");
|
|
184069
|
-
if (
|
|
185024
|
+
if (existsSync5(distCandidate))
|
|
184070
185025
|
return distCandidate;
|
|
184071
185026
|
throw new Error(`Cannot locate bundled skill content. Looked in:
|
|
184072
185027
|
${srcCandidate}
|
|
@@ -184103,15 +185058,15 @@ async function installSkill(opts) {
|
|
|
184103
185058
|
for (const relativePath of sourceFiles) {
|
|
184104
185059
|
const sourcePath = join3(source, relativePath);
|
|
184105
185060
|
const targetPath = join3(target, relativePath);
|
|
184106
|
-
const sourceBytes = templateSourceFile(relativePath,
|
|
185061
|
+
const sourceBytes = templateSourceFile(relativePath, readFileSync5(sourcePath), cliVersion);
|
|
184107
185062
|
const sourceHash = sha256(sourceBytes);
|
|
184108
|
-
if (!
|
|
185063
|
+
if (!existsSync5(targetPath)) {
|
|
184109
185064
|
mkdirSync3(dirname3(targetPath), { recursive: true });
|
|
184110
185065
|
writeFileSync3(targetPath, sourceBytes);
|
|
184111
185066
|
written += 1;
|
|
184112
185067
|
continue;
|
|
184113
185068
|
}
|
|
184114
|
-
const targetBytes =
|
|
185069
|
+
const targetBytes = readFileSync5(targetPath);
|
|
184115
185070
|
const targetHash = sha256(targetBytes);
|
|
184116
185071
|
if (targetHash === sourceHash) {
|
|
184117
185072
|
skipped += 1;
|
|
@@ -184140,9 +185095,9 @@ async function installSkill(opts) {
|
|
|
184140
185095
|
const manifestEntries = [];
|
|
184141
185096
|
for (const relativePath of sourceFiles) {
|
|
184142
185097
|
const targetPath = join3(target, relativePath);
|
|
184143
|
-
if (!
|
|
185098
|
+
if (!existsSync5(targetPath))
|
|
184144
185099
|
continue;
|
|
184145
|
-
manifestEntries.push({ path: relativePath, sha256: sha256(
|
|
185100
|
+
manifestEntries.push({ path: relativePath, sha256: sha256(readFileSync5(targetPath)) });
|
|
184146
185101
|
}
|
|
184147
185102
|
const manifest = {
|
|
184148
185103
|
cliVersion,
|
|
@@ -184176,19 +185131,19 @@ async function uninstallSkill(opts) {
|
|
|
184176
185131
|
let removed = 0;
|
|
184177
185132
|
let kept = 0;
|
|
184178
185133
|
for (const entry of manifest.files) {
|
|
184179
|
-
const
|
|
184180
|
-
if (
|
|
184181
|
-
console.error(`Refusing to touch ${
|
|
185134
|
+
const path3 = resolve2(targetReal, entry.path);
|
|
185135
|
+
if (path3 !== targetReal && !path3.startsWith(safeBase)) {
|
|
185136
|
+
console.error(`Refusing to touch ${path3}: manifest path escapes ${targetReal}`);
|
|
184182
185137
|
continue;
|
|
184183
185138
|
}
|
|
184184
|
-
if (!
|
|
185139
|
+
if (!existsSync5(path3))
|
|
184185
185140
|
continue;
|
|
184186
|
-
const currentHash = sha256(
|
|
185141
|
+
const currentHash = sha256(readFileSync5(path3));
|
|
184187
185142
|
if (currentHash !== entry.sha256 && !opts.yes) {
|
|
184188
185143
|
kept += 1;
|
|
184189
185144
|
continue;
|
|
184190
185145
|
}
|
|
184191
|
-
unlinkSync2(
|
|
185146
|
+
unlinkSync2(path3);
|
|
184192
185147
|
removed += 1;
|
|
184193
185148
|
}
|
|
184194
185149
|
rmSync(join3(target, MANIFEST_NAME), { force: true });
|
|
@@ -184383,17 +185338,17 @@ function hintFor(tool, installed, detected) {
|
|
|
184383
185338
|
return tool.relativePath;
|
|
184384
185339
|
}
|
|
184385
185340
|
function isInstalled(cwd, tool) {
|
|
184386
|
-
return
|
|
185341
|
+
return existsSync5(join3(cwd, tool.relativePath, MANIFEST_NAME));
|
|
184387
185342
|
}
|
|
184388
185343
|
function isProjectUsing(cwd, tool) {
|
|
184389
|
-
return tool.detectPaths.some((p2) =>
|
|
185344
|
+
return tool.detectPaths.some((p2) => existsSync5(join3(cwd, p2)));
|
|
184390
185345
|
}
|
|
184391
185346
|
function listFiles(root) {
|
|
184392
185347
|
const out = [];
|
|
184393
185348
|
const stack = [root];
|
|
184394
185349
|
while (stack.length > 0) {
|
|
184395
185350
|
const dir = stack.pop();
|
|
184396
|
-
for (const entry of
|
|
185351
|
+
for (const entry of readdirSync3(dir)) {
|
|
184397
185352
|
const full = join3(dir, entry);
|
|
184398
185353
|
const rel = relative2(root, full);
|
|
184399
185354
|
const stats = lstatSync(full);
|
|
@@ -184409,11 +185364,11 @@ function listFiles(root) {
|
|
|
184409
185364
|
return out.sort();
|
|
184410
185365
|
}
|
|
184411
185366
|
function readManifest(target) {
|
|
184412
|
-
const
|
|
184413
|
-
if (!
|
|
185367
|
+
const path3 = join3(target, MANIFEST_NAME);
|
|
185368
|
+
if (!existsSync5(path3))
|
|
184414
185369
|
return null;
|
|
184415
185370
|
try {
|
|
184416
|
-
return JSON.parse(
|
|
185371
|
+
return JSON.parse(readFileSync5(path3, "utf-8"));
|
|
184417
185372
|
} catch {
|
|
184418
185373
|
return null;
|
|
184419
185374
|
}
|
|
@@ -184426,8 +185381,8 @@ function readCliVersion() {
|
|
|
184426
185381
|
resolve2(here, "..", "package.json")
|
|
184427
185382
|
];
|
|
184428
185383
|
for (const candidate of candidates) {
|
|
184429
|
-
if (
|
|
184430
|
-
const pkg = JSON.parse(
|
|
185384
|
+
if (existsSync5(candidate)) {
|
|
185385
|
+
const pkg = JSON.parse(readFileSync5(candidate, "utf-8"));
|
|
184431
185386
|
if (pkg.version)
|
|
184432
185387
|
return pkg.version;
|
|
184433
185388
|
}
|
|
@@ -184436,11 +185391,11 @@ function readCliVersion() {
|
|
|
184436
185391
|
return "unknown";
|
|
184437
185392
|
}
|
|
184438
185393
|
function pruneEmptyDirs(root) {
|
|
184439
|
-
if (!
|
|
185394
|
+
if (!existsSync5(root))
|
|
184440
185395
|
return;
|
|
184441
185396
|
const stack = [];
|
|
184442
185397
|
const collect2 = (dir) => {
|
|
184443
|
-
for (const entry of
|
|
185398
|
+
for (const entry of readdirSync3(dir)) {
|
|
184444
185399
|
const full = join3(dir, entry);
|
|
184445
185400
|
if (lstatSync(full).isDirectory())
|
|
184446
185401
|
collect2(full);
|
|
@@ -184450,13 +185405,13 @@ function pruneEmptyDirs(root) {
|
|
|
184450
185405
|
collect2(root);
|
|
184451
185406
|
for (const dir of stack) {
|
|
184452
185407
|
try {
|
|
184453
|
-
if (
|
|
185408
|
+
if (readdirSync3(dir).length === 0)
|
|
184454
185409
|
rmdirSync(dir);
|
|
184455
185410
|
} catch {}
|
|
184456
185411
|
}
|
|
184457
185412
|
}
|
|
184458
|
-
async function promptThreeWay(
|
|
184459
|
-
const display = relative2(process.cwd(),
|
|
185413
|
+
async function promptThreeWay(path3, source, current) {
|
|
185414
|
+
const display = relative2(process.cwd(), path3) || path3;
|
|
184460
185415
|
while (true) {
|
|
184461
185416
|
const choice = await Ee({
|
|
184462
185417
|
message: `${display} has been edited locally`,
|
|
@@ -184561,9 +185516,9 @@ async function status(opts) {
|
|
|
184561
185516
|
console.log(lines.join(`
|
|
184562
185517
|
`));
|
|
184563
185518
|
}
|
|
184564
|
-
async function fetchAuthOrNull(client,
|
|
185519
|
+
async function fetchAuthOrNull(client, path3) {
|
|
184565
185520
|
try {
|
|
184566
|
-
return await client.get(
|
|
185521
|
+
return await client.get(path3);
|
|
184567
185522
|
} catch (err) {
|
|
184568
185523
|
if (err instanceof ApiError && (err.status === 401 || err.status === 403)) {
|
|
184569
185524
|
return null;
|
|
@@ -184571,9 +185526,9 @@ async function fetchAuthOrNull(client, path2) {
|
|
|
184571
185526
|
throw err;
|
|
184572
185527
|
}
|
|
184573
185528
|
}
|
|
184574
|
-
async function fetchOrNull(client,
|
|
185529
|
+
async function fetchOrNull(client, path3) {
|
|
184575
185530
|
try {
|
|
184576
|
-
return await client.get(
|
|
185531
|
+
return await client.get(path3);
|
|
184577
185532
|
} catch {
|
|
184578
185533
|
return null;
|
|
184579
185534
|
}
|
|
@@ -185224,13 +186179,13 @@ function zipSync(data, opts) {
|
|
|
185224
186179
|
}
|
|
185225
186180
|
|
|
185226
186181
|
// src/commands/workflow/index.ts
|
|
185227
|
-
import { existsSync as
|
|
186182
|
+
import { existsSync as existsSync11, promises as fs10 } from "node:fs";
|
|
185228
186183
|
import path15 from "node:path";
|
|
185229
186184
|
import { createInterface as createInterface3 } from "node:readline/promises";
|
|
185230
186185
|
|
|
185231
186186
|
// src/lib/format-eigenpal.ts
|
|
185232
|
-
import { spawnSync as
|
|
185233
|
-
import { existsSync as
|
|
186187
|
+
import { spawnSync as spawnSync3 } from "child_process";
|
|
186188
|
+
import { existsSync as existsSync6, readFileSync as readFileSync6 } from "fs";
|
|
185234
186189
|
import { join as join4, resolve as resolve3 } from "path";
|
|
185235
186190
|
var PRETTRC_NAMES = [
|
|
185236
186191
|
".prettierrc",
|
|
@@ -185244,14 +186199,14 @@ var PRETTRC_NAMES = [
|
|
|
185244
186199
|
];
|
|
185245
186200
|
function hasPrettierConfig(cwd) {
|
|
185246
186201
|
for (const name of PRETTRC_NAMES) {
|
|
185247
|
-
if (
|
|
186202
|
+
if (existsSync6(join4(cwd, name)))
|
|
185248
186203
|
return true;
|
|
185249
186204
|
}
|
|
185250
186205
|
try {
|
|
185251
186206
|
const pkgPath = join4(cwd, "package.json");
|
|
185252
|
-
if (!
|
|
186207
|
+
if (!existsSync6(pkgPath))
|
|
185253
186208
|
return false;
|
|
185254
|
-
const raw =
|
|
186209
|
+
const raw = readFileSync6(pkgPath, "utf-8");
|
|
185255
186210
|
const pkg = JSON.parse(raw);
|
|
185256
186211
|
return pkg != null && typeof pkg === "object" && "prettier" in pkg;
|
|
185257
186212
|
} catch {
|
|
@@ -185261,12 +186216,12 @@ function hasPrettierConfig(cwd) {
|
|
|
185261
186216
|
function formatEigenpalDirIfAvailable(dir) {
|
|
185262
186217
|
const cwd = process.cwd();
|
|
185263
186218
|
const absDir = resolve3(cwd, dir);
|
|
185264
|
-
if (!
|
|
186219
|
+
if (!existsSync6(absDir))
|
|
185265
186220
|
return;
|
|
185266
186221
|
if (!hasPrettierConfig(cwd))
|
|
185267
186222
|
return;
|
|
185268
186223
|
const runner = typeof Bun !== "undefined" ? "bunx" : "npx";
|
|
185269
|
-
|
|
186224
|
+
spawnSync3(runner, ["prettier", "--write", absDir], {
|
|
185270
186225
|
cwd,
|
|
185271
186226
|
stdio: "ignore",
|
|
185272
186227
|
shell: false
|
|
@@ -185348,19 +186303,19 @@ async function resolveWorkflowId(client, idOrSlug) {
|
|
|
185348
186303
|
}
|
|
185349
186304
|
|
|
185350
186305
|
// src/commands/clear.ts
|
|
185351
|
-
import { existsSync as
|
|
186306
|
+
import { existsSync as existsSync8, readdirSync as readdirSync5, rmSync as rmSync2, statSync as statSync4 } from "fs";
|
|
185352
186307
|
import { basename, join as join7 } from "path";
|
|
185353
186308
|
|
|
185354
186309
|
// src/lib/payload.ts
|
|
185355
|
-
import { existsSync as
|
|
186310
|
+
import { existsSync as existsSync7, readdirSync as readdirSync4, readFileSync as readFileSync7, statSync as statSync3 } from "fs";
|
|
185356
186311
|
import { join as join6 } from "path";
|
|
185357
186312
|
|
|
185358
186313
|
// src/lib/fs-helpers.ts
|
|
185359
|
-
var
|
|
186314
|
+
var import_yaml4 = __toESM(require_dist(), 1);
|
|
185360
186315
|
import { extname, join as join5 } from "path";
|
|
185361
186316
|
|
|
185362
186317
|
// src/lib/normalize.ts
|
|
185363
|
-
var
|
|
186318
|
+
var import_yaml3 = __toESM(require_dist(), 1);
|
|
185364
186319
|
|
|
185365
186320
|
// src/lib/fs-helpers.ts
|
|
185366
186321
|
var EXT_MIME = {
|
|
@@ -185391,7 +186346,7 @@ var DATASET_EXAMPLES_DIR = ["dataset", "examples"];
|
|
|
185391
186346
|
function resolveEvalBaseDir(dir) {
|
|
185392
186347
|
const candidates = [join6(dir, ...DATASET_EXAMPLES_DIR), join6(...DATASET_EXAMPLES_DIR)];
|
|
185393
186348
|
for (const candidate of candidates) {
|
|
185394
|
-
if (
|
|
186349
|
+
if (existsSync7(candidate))
|
|
185395
186350
|
return candidate;
|
|
185396
186351
|
}
|
|
185397
186352
|
return null;
|
|
@@ -185401,7 +186356,7 @@ function getExampleNames(dir, exampleNamesFilter) {
|
|
|
185401
186356
|
if (!baseDir) {
|
|
185402
186357
|
throw new Error(`No dataset/examples directory found at ${join6(dir, ...DATASET_EXAMPLES_DIR)}. Run \`eigenpal init workflow <name>\` to scaffold one.`);
|
|
185403
186358
|
}
|
|
185404
|
-
const all =
|
|
186359
|
+
const all = readdirSync4(baseDir).filter((name) => statSync3(join6(baseDir, name)).isDirectory() && existsSync7(join6(baseDir, name, "input", "arguments.json"))).sort((a, b2) => a.localeCompare(b2, undefined, { numeric: true }));
|
|
185405
186360
|
if (!exampleNamesFilter?.length)
|
|
185406
186361
|
return all;
|
|
185407
186362
|
return all.filter((n) => exampleNamesFilter.includes(n));
|
|
@@ -185409,18 +186364,18 @@ function getExampleNames(dir, exampleNamesFilter) {
|
|
|
185409
186364
|
function readInput(exampleDir) {
|
|
185410
186365
|
const argsPath = join6(exampleDir, "input", "arguments.json");
|
|
185411
186366
|
const inputDir = join6(exampleDir, "input");
|
|
185412
|
-
const scalars = JSON.parse(
|
|
186367
|
+
const scalars = JSON.parse(readFileSync7(argsPath, "utf-8"));
|
|
185413
186368
|
const files = [];
|
|
185414
|
-
for (const entry of
|
|
186369
|
+
for (const entry of readdirSync4(inputDir)) {
|
|
185415
186370
|
const full = join6(inputDir, entry);
|
|
185416
|
-
if (!
|
|
186371
|
+
if (!statSync3(full).isDirectory())
|
|
185417
186372
|
continue;
|
|
185418
|
-
const filenames =
|
|
186373
|
+
const filenames = readdirSync4(full).filter((f) => statSync3(join6(full, f)).isFile()).sort();
|
|
185419
186374
|
for (const filename of filenames) {
|
|
185420
186375
|
files.push({
|
|
185421
186376
|
argument: entry,
|
|
185422
186377
|
filename,
|
|
185423
|
-
content:
|
|
186378
|
+
content: readFileSync7(join6(full, filename)),
|
|
185424
186379
|
mimeType: guessMimeType(filename)
|
|
185425
186380
|
});
|
|
185426
186381
|
}
|
|
@@ -185429,9 +186384,9 @@ function readInput(exampleDir) {
|
|
|
185429
186384
|
}
|
|
185430
186385
|
function readOverrides(exampleDir) {
|
|
185431
186386
|
const metaPath = join6(exampleDir, "meta.json");
|
|
185432
|
-
if (!
|
|
186387
|
+
if (!existsSync7(metaPath))
|
|
185433
186388
|
return null;
|
|
185434
|
-
const raw = JSON.parse(
|
|
186389
|
+
const raw = JSON.parse(readFileSync7(metaPath, "utf-8"));
|
|
185435
186390
|
const ov = raw.overrides;
|
|
185436
186391
|
if (ov && typeof ov === "object" && "steps" in ov && typeof ov.steps === "object") {
|
|
185437
186392
|
return ov;
|
|
@@ -185449,13 +186404,13 @@ function buildExamplePayload(exampleDir) {
|
|
|
185449
186404
|
|
|
185450
186405
|
// src/commands/clear.ts
|
|
185451
186406
|
var EMPTY_REPORT = { removed: 0, kept: 0, touched: 0 };
|
|
185452
|
-
function getDirectoryEntries(
|
|
185453
|
-
if (!
|
|
186407
|
+
function getDirectoryEntries(path3) {
|
|
186408
|
+
if (!existsSync8(path3))
|
|
185454
186409
|
return [];
|
|
185455
|
-
return
|
|
186410
|
+
return readdirSync5(path3).filter((entry) => statSync4(join7(path3, entry)).isDirectory()).sort();
|
|
185456
186411
|
}
|
|
185457
|
-
function removeDirEntriesWithRetention(
|
|
185458
|
-
const entries = getDirectoryEntries(
|
|
186412
|
+
function removeDirEntriesWithRetention(path3, removeAll) {
|
|
186413
|
+
const entries = getDirectoryEntries(path3);
|
|
185459
186414
|
if (entries.length === 0)
|
|
185460
186415
|
return EMPTY_REPORT;
|
|
185461
186416
|
const keepSet = new Set;
|
|
@@ -185465,16 +186420,16 @@ function removeDirEntriesWithRetention(path2, removeAll) {
|
|
|
185465
186420
|
for (const entry of entries) {
|
|
185466
186421
|
if (keepSet.has(entry))
|
|
185467
186422
|
continue;
|
|
185468
|
-
rmSync2(join7(
|
|
186423
|
+
rmSync2(join7(path3, entry), { recursive: true, force: true });
|
|
185469
186424
|
removed++;
|
|
185470
186425
|
}
|
|
185471
186426
|
return { removed, kept: keepSet.size, touched: entries.length };
|
|
185472
186427
|
}
|
|
185473
186428
|
function removeJudgeSummaryFilesWithRetention(exampleDir, removeAll) {
|
|
185474
|
-
if (!
|
|
186429
|
+
if (!existsSync8(exampleDir))
|
|
185475
186430
|
return EMPTY_REPORT;
|
|
185476
186431
|
const stampByFile = new Map;
|
|
185477
|
-
for (const fileName of
|
|
186432
|
+
for (const fileName of readdirSync5(exampleDir).sort()) {
|
|
185478
186433
|
const match = /^llm-judge-summary-(.+)\.(json|md)$/.exec(fileName);
|
|
185479
186434
|
if (match)
|
|
185480
186435
|
stampByFile.set(fileName, match[1]);
|
|
@@ -185503,7 +186458,7 @@ function getTargetExampleDirs(dir, exampleNames) {
|
|
|
185503
186458
|
error51(`No dataset/examples directory at ${join7(dir, "dataset", "examples")}`);
|
|
185504
186459
|
process.exit(1);
|
|
185505
186460
|
}
|
|
185506
|
-
const all =
|
|
186461
|
+
const all = readdirSync5(baseDir).filter((entry) => statSync4(join7(baseDir, entry)).isDirectory());
|
|
185507
186462
|
if (exampleNames.length === 0)
|
|
185508
186463
|
return all.map((name) => join7(baseDir, name));
|
|
185509
186464
|
const matched = all.filter((name) => exampleNames.includes(name));
|
|
@@ -185543,7 +186498,7 @@ async function clearEvalOutputs(dir, exampleNames = [], options = {}) {
|
|
|
185543
186498
|
runSection({
|
|
185544
186499
|
exampleDirs,
|
|
185545
186500
|
clean: (exampleDir) => removeDirEntriesWithRetention(join7(exampleDir, "executions"), removeAll),
|
|
185546
|
-
shouldCount: (exampleDir) =>
|
|
186501
|
+
shouldCount: (exampleDir) => existsSync8(join7(exampleDir, "executions")),
|
|
185547
186502
|
successLabel: "Execution cleanup complete",
|
|
185548
186503
|
scannedLabel: "examples scanned:",
|
|
185549
186504
|
seenLabel: "runs seen: ",
|
|
@@ -185555,7 +186510,7 @@ async function clearEvalOutputs(dir, exampleNames = [], options = {}) {
|
|
|
185555
186510
|
runSection({
|
|
185556
186511
|
exampleDirs,
|
|
185557
186512
|
clean: (exampleDir) => removeJudgeSummaryFilesWithRetention(exampleDir, removeAll),
|
|
185558
|
-
shouldCount: (exampleDir) =>
|
|
186513
|
+
shouldCount: (exampleDir) => existsSync8(exampleDir),
|
|
185559
186514
|
successLabel: "Judge summary cleanup complete",
|
|
185560
186515
|
scannedLabel: "examples scanned: ",
|
|
185561
186516
|
seenLabel: "summary files seen: ",
|
|
@@ -185688,18 +186643,18 @@ async function watchExecution(opts) {
|
|
|
185688
186643
|
import { join as join11 } from "path";
|
|
185689
186644
|
|
|
185690
186645
|
// src/lib/execution-artifacts.ts
|
|
185691
|
-
import { existsSync as
|
|
186646
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync4, readdirSync as readdirSync6, readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "fs";
|
|
185692
186647
|
import { join as join10 } from "path";
|
|
185693
186648
|
|
|
185694
186649
|
// src/lib/format.ts
|
|
185695
|
-
import { readFileSync as
|
|
186650
|
+
import { readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "fs";
|
|
185696
186651
|
import { extname as extname3, resolve as resolve5 } from "path";
|
|
185697
186652
|
var PRETTIER_EXTENSIONS = new Set([".json", ".yaml", ".yml"]);
|
|
185698
186653
|
async function formatFileIfAvailable(filepath) {
|
|
185699
186654
|
if (!PRETTIER_EXTENSIONS.has(extname3(filepath)))
|
|
185700
186655
|
return;
|
|
185701
186656
|
try {
|
|
185702
|
-
const content =
|
|
186657
|
+
const content = readFileSync8(filepath, "utf-8");
|
|
185703
186658
|
const prettier = await Promise.resolve().then(() => (init_prettier(), exports_prettier));
|
|
185704
186659
|
const formatted = await prettier.format(content, {
|
|
185705
186660
|
filepath: resolve5(filepath)
|
|
@@ -186465,13 +187420,13 @@ function parseWorkflow(yaml) {
|
|
|
186465
187420
|
return result.data;
|
|
186466
187421
|
}
|
|
186467
187422
|
// src/commands/validate.ts
|
|
186468
|
-
var
|
|
186469
|
-
import { existsSync as
|
|
187423
|
+
var import_yaml6 = __toESM(require_dist(), 1);
|
|
187424
|
+
import { existsSync as existsSync10, readdirSync as readdirSync7, readFileSync as readFileSync10, statSync as statSync6 } from "fs";
|
|
186470
187425
|
import { join as join12, resolve as resolve6 } from "path";
|
|
186471
187426
|
var NAME_RE = /^[a-z0-9][a-z0-9-_]*$/;
|
|
186472
187427
|
function isDirSafe(path15, issues, field) {
|
|
186473
187428
|
try {
|
|
186474
|
-
return
|
|
187429
|
+
return statSync6(path15).isDirectory();
|
|
186475
187430
|
} catch (err2) {
|
|
186476
187431
|
issues.push({
|
|
186477
187432
|
field,
|
|
@@ -186481,10 +187436,10 @@ function isDirSafe(path15, issues, field) {
|
|
|
186481
187436
|
}
|
|
186482
187437
|
}
|
|
186483
187438
|
function validateWorkflowYaml(path15) {
|
|
186484
|
-
if (!
|
|
187439
|
+
if (!existsSync10(path15)) {
|
|
186485
187440
|
return [{ field: path15, message: "File not found." }];
|
|
186486
187441
|
}
|
|
186487
|
-
const text =
|
|
187442
|
+
const text = readFileSync10(path15, "utf-8");
|
|
186488
187443
|
try {
|
|
186489
187444
|
parseWorkflow(text);
|
|
186490
187445
|
return [];
|
|
@@ -186503,13 +187458,13 @@ function validateWorkflowYaml(path15) {
|
|
|
186503
187458
|
}
|
|
186504
187459
|
}
|
|
186505
187460
|
function validateEvaluatorsYaml(path15) {
|
|
186506
|
-
if (!
|
|
187461
|
+
if (!existsSync10(path15)) {
|
|
186507
187462
|
return [{ field: path15, message: "File not found." }];
|
|
186508
187463
|
}
|
|
186509
|
-
const text =
|
|
187464
|
+
const text = readFileSync10(path15, "utf-8");
|
|
186510
187465
|
let parsed;
|
|
186511
187466
|
try {
|
|
186512
|
-
parsed =
|
|
187467
|
+
parsed = import_yaml6.parse(text);
|
|
186513
187468
|
} catch (err2) {
|
|
186514
187469
|
return [{ field: "yaml", message: err2 instanceof Error ? err2.message : "YAML parse error" }];
|
|
186515
187470
|
}
|
|
@@ -186523,21 +187478,21 @@ function validateEvaluatorsYaml(path15) {
|
|
|
186523
187478
|
}
|
|
186524
187479
|
function validateDatasetFolder(root2) {
|
|
186525
187480
|
const issues = [];
|
|
186526
|
-
if (!
|
|
187481
|
+
if (!existsSync10(root2)) {
|
|
186527
187482
|
return [{ field: root2, message: "Folder not found." }];
|
|
186528
187483
|
}
|
|
186529
|
-
if (
|
|
187484
|
+
if (existsSync10(join12(root2, "manifest.json"))) {
|
|
186530
187485
|
issues.push({
|
|
186531
187486
|
field: "manifest.json",
|
|
186532
187487
|
message: "Top-level manifest.json is the legacy format. Re-export the dataset using the folder convention."
|
|
186533
187488
|
});
|
|
186534
187489
|
}
|
|
186535
187490
|
const examplesDir = join12(root2, "examples");
|
|
186536
|
-
if (!
|
|
187491
|
+
if (!existsSync10(examplesDir)) {
|
|
186537
187492
|
issues.push({ field: "examples/", message: "No examples/ directory found at dataset root." });
|
|
186538
187493
|
return issues;
|
|
186539
187494
|
}
|
|
186540
|
-
for (const exampleName of
|
|
187495
|
+
for (const exampleName of readdirSync7(examplesDir)) {
|
|
186541
187496
|
const exampleFolder = join12(examplesDir, exampleName);
|
|
186542
187497
|
if (!isDirSafe(exampleFolder, issues, `examples/${exampleName}`))
|
|
186543
187498
|
continue;
|
|
@@ -186549,7 +187504,7 @@ function validateDatasetFolder(root2) {
|
|
|
186549
187504
|
continue;
|
|
186550
187505
|
}
|
|
186551
187506
|
const argsPath = join12(exampleFolder, "input", "arguments.json");
|
|
186552
|
-
if (!
|
|
187507
|
+
if (!existsSync10(argsPath)) {
|
|
186553
187508
|
issues.push({
|
|
186554
187509
|
field: `examples/${exampleName}/input/arguments.json`,
|
|
186555
187510
|
message: "Missing required arguments.json."
|
|
@@ -186558,7 +187513,7 @@ function validateDatasetFolder(root2) {
|
|
|
186558
187513
|
}
|
|
186559
187514
|
let args;
|
|
186560
187515
|
try {
|
|
186561
|
-
const parsed = JSON.parse(
|
|
187516
|
+
const parsed = JSON.parse(readFileSync10(argsPath, "utf-8"));
|
|
186562
187517
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
186563
187518
|
issues.push({
|
|
186564
187519
|
field: `examples/${exampleName}/input/arguments.json`,
|
|
@@ -186575,14 +187530,14 @@ function validateDatasetFolder(root2) {
|
|
|
186575
187530
|
continue;
|
|
186576
187531
|
}
|
|
186577
187532
|
const inputDir = join12(exampleFolder, "input");
|
|
186578
|
-
for (const entry of
|
|
187533
|
+
for (const entry of readdirSync7(inputDir)) {
|
|
186579
187534
|
if (entry === "arguments.json")
|
|
186580
187535
|
continue;
|
|
186581
187536
|
const sub = join12(inputDir, entry);
|
|
186582
187537
|
const field = `examples/${exampleName}/input/${entry}`;
|
|
186583
187538
|
let isDir;
|
|
186584
187539
|
try {
|
|
186585
|
-
isDir =
|
|
187540
|
+
isDir = statSync6(sub).isDirectory();
|
|
186586
187541
|
} catch (err2) {
|
|
186587
187542
|
issues.push({
|
|
186588
187543
|
field,
|
|
@@ -186611,12 +187566,12 @@ function validateDatasetFolder(root2) {
|
|
|
186611
187566
|
}
|
|
186612
187567
|
}
|
|
186613
187568
|
const expectedDir = join12(exampleFolder, "expected");
|
|
186614
|
-
if (
|
|
187569
|
+
if (existsSync10(expectedDir)) {
|
|
186615
187570
|
const expectedPath = join12(expectedDir, "output.json");
|
|
186616
|
-
if (
|
|
187571
|
+
if (existsSync10(expectedPath)) {
|
|
186617
187572
|
let parsed;
|
|
186618
187573
|
try {
|
|
186619
|
-
parsed = JSON.parse(
|
|
187574
|
+
parsed = JSON.parse(readFileSync10(expectedPath, "utf-8"));
|
|
186620
187575
|
} catch {
|
|
186621
187576
|
issues.push({
|
|
186622
187577
|
field: `examples/${exampleName}/expected/output.json`,
|
|
@@ -186631,14 +187586,14 @@ function validateDatasetFolder(root2) {
|
|
|
186631
187586
|
});
|
|
186632
187587
|
}
|
|
186633
187588
|
}
|
|
186634
|
-
for (const entry of
|
|
187589
|
+
for (const entry of readdirSync7(expectedDir)) {
|
|
186635
187590
|
if (entry === "output.json")
|
|
186636
187591
|
continue;
|
|
186637
187592
|
const sub = join12(expectedDir, entry);
|
|
186638
187593
|
const field = `examples/${exampleName}/expected/${entry}`;
|
|
186639
187594
|
let isDir;
|
|
186640
187595
|
try {
|
|
186641
|
-
isDir =
|
|
187596
|
+
isDir = statSync6(sub).isDirectory();
|
|
186642
187597
|
} catch (err2) {
|
|
186643
187598
|
issues.push({
|
|
186644
187599
|
field,
|
|
@@ -186873,9 +187828,9 @@ function buildBatchDiff(args) {
|
|
|
186873
187828
|
function aggregateByEvaluator(rows) {
|
|
186874
187829
|
const buckets = new Map;
|
|
186875
187830
|
for (const r5 of rows) {
|
|
186876
|
-
const
|
|
186877
|
-
if (
|
|
186878
|
-
|
|
187831
|
+
const list2 = buckets.get(r5.evaluator);
|
|
187832
|
+
if (list2)
|
|
187833
|
+
list2.push(r5);
|
|
186879
187834
|
else
|
|
186880
187835
|
buckets.set(r5.evaluator, [r5]);
|
|
186881
187836
|
}
|
|
@@ -187284,7 +188239,7 @@ flag would otherwise shadow it. Validation failures come back as
|
|
|
187284
188239
|
defaultValue: "workflow.yaml",
|
|
187285
188240
|
validate: (value) => {
|
|
187286
188241
|
const p4 = value || "workflow.yaml";
|
|
187287
|
-
if (!
|
|
188242
|
+
if (!existsSync11(p4))
|
|
187288
188243
|
return `Not found: ${p4}`;
|
|
187289
188244
|
return;
|
|
187290
188245
|
}
|
|
@@ -187706,11 +188661,11 @@ async function resolveExampleIds(client, workflowId, raw) {
|
|
|
187706
188661
|
const bySlug = new Map;
|
|
187707
188662
|
let offset = 0;
|
|
187708
188663
|
while (true) {
|
|
187709
|
-
const
|
|
188664
|
+
const list2 = await client.get(`/api/v1/workflows/${workflowId}/eval-examples`, {
|
|
187710
188665
|
limit: String(PAGE_SIZE),
|
|
187711
188666
|
offset: String(offset)
|
|
187712
188667
|
});
|
|
187713
|
-
const rows =
|
|
188668
|
+
const rows = list2.data ?? [];
|
|
187714
188669
|
for (const row of rows) {
|
|
187715
188670
|
if (row.name)
|
|
187716
188671
|
bySlug.set(row.name, row.id);
|
|
@@ -187985,7 +188940,7 @@ Behavior:
|
|
|
187985
188940
|
const dest = opts.pull ? opts.pullOnComplete ?? `./results-${batchId}.${opts.format}` : null;
|
|
187986
188941
|
if (dest) {
|
|
187987
188942
|
const dir = path15.dirname(dest);
|
|
187988
|
-
if (!
|
|
188943
|
+
if (!existsSync11(dir)) {
|
|
187989
188944
|
error51(`Destination directory does not exist: ${dir}. Create it first or pass a path under an existing directory.`);
|
|
187990
188945
|
process.exit(2);
|
|
187991
188946
|
}
|
|
@@ -188124,8 +189079,8 @@ async function pollExperimentUntilTerminal({
|
|
|
188124
189079
|
}
|
|
188125
189080
|
}
|
|
188126
189081
|
function registerVersionsCommands(parent) {
|
|
188127
|
-
const
|
|
188128
|
-
const listCmd =
|
|
189082
|
+
const versions3 = parent.command("versions").description("Inspect and restore historical workflow versions.");
|
|
189083
|
+
const listCmd = versions3.command("list <workflow-id>").description(descriptionFor("workflow_list_versions"));
|
|
188129
189084
|
addJsonFlag(withBaseUrl(withPagination(listCmd))).action(action(async (workflow2, opts) => {
|
|
188130
189085
|
const { client, workflowId } = await buildClientForWorkflow(workflow2, opts);
|
|
188131
189086
|
const raw = await client.get(`/api/v1/workflows/${workflowId}/versions`, {
|
|
@@ -188139,7 +189094,7 @@ function registerVersionsCommands(parent) {
|
|
|
188139
189094
|
{ key: "createdAt", header: "createdAt", format: formatTimestamp }
|
|
188140
189095
|
], { ...opts, entityLabel: "version" });
|
|
188141
189096
|
}));
|
|
188142
|
-
const restoreCmd =
|
|
189097
|
+
const restoreCmd = versions3.command("restore <workflow-id> <versionId>").description(descriptionFor("workflow_restore_version"));
|
|
188143
189098
|
addJsonFlag(withBaseUrl(restoreCmd)).action(action(async (workflow2, versionId, opts) => {
|
|
188144
189099
|
const { client, workflowId } = await buildClientForWorkflow(workflow2, opts);
|
|
188145
189100
|
const result = await client.post(`/api/v1/workflows/${workflowId}/history/${versionId}/restore`, {});
|
|
@@ -188619,6 +189574,7 @@ authCmd.command("use [profile]").description("Switch the active profile (persist
|
|
|
188619
189574
|
});
|
|
188620
189575
|
registerWorkflowCommands(program2);
|
|
188621
189576
|
registerAgentCommands(program2);
|
|
189577
|
+
registerGitCommands(program2);
|
|
188622
189578
|
program2.command("completion <shell>").description("Print a shell completion script to stdout (supported shells: bash, zsh, fish). Pipe into the appropriate completion file for your shell — see the script header for install instructions.").action(async (shell) => {
|
|
188623
189579
|
try {
|
|
188624
189580
|
await completion(shell, program2);
|
|
@@ -188685,13 +189641,17 @@ function isEntryPoint() {
|
|
|
188685
189641
|
if (!argv1)
|
|
188686
189642
|
return false;
|
|
188687
189643
|
try {
|
|
188688
|
-
return
|
|
189644
|
+
return realpathSync3(argv1) === realpathSync3(__filename3);
|
|
188689
189645
|
} catch {
|
|
188690
189646
|
return false;
|
|
188691
189647
|
}
|
|
188692
189648
|
}
|
|
188693
189649
|
if (isEntryPoint()) {
|
|
188694
189650
|
configureGroupedHelp(program2);
|
|
189651
|
+
if (hasGitPassthroughSeparator(process.argv)) {
|
|
189652
|
+
await runGitPassthroughFromArgv(process.argv);
|
|
189653
|
+
process.exit(0);
|
|
189654
|
+
}
|
|
188695
189655
|
program2.parse();
|
|
188696
189656
|
}
|
|
188697
189657
|
export {
|