@ariestools/toolchain 10.1.2 → 10.1.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/dist/actions/skills/defaults.d.ts +4 -3
- package/dist/actions/skills/defaults.d.ts.map +1 -1
- package/dist/actions/skills/detectProfile.d.ts +23 -0
- package/dist/actions/skills/detectProfile.d.ts.map +1 -1
- package/dist/actions/skills/lint.d.ts.map +1 -1
- package/dist/actions/skills/missingSkillReason.d.ts +10 -0
- package/dist/actions/skills/missingSkillReason.d.ts.map +1 -0
- package/dist/actions/skills/skillRules.d.ts +13 -1
- package/dist/actions/skills/skillRules.d.ts.map +1 -1
- package/dist/actions/work/github.d.ts +9 -0
- package/dist/actions/work/github.d.ts.map +1 -1
- package/dist/actions/work/lifecycle.d.ts +3 -0
- package/dist/actions/work/lifecycle.d.ts.map +1 -1
- package/dist/actions/work/lint.d.ts.map +1 -1
- package/dist/actions/work/priority.d.ts +5 -1
- package/dist/actions/work/priority.d.ts.map +1 -1
- package/dist/actions/work/sync.d.ts +5 -1
- package/dist/actions/work/sync.d.ts.map +1 -1
- package/dist/bin/xy.mjs +250 -65
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/bin/xyex.mjs +250 -65
- package/dist/bin/xyex.mjs.map +1 -1
- package/dist/xy/common/skills/index.d.ts.map +1 -1
- package/dist/xy/common/work/updateCommand.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/bin/xy.mjs
CHANGED
|
@@ -7149,7 +7149,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
7149
7149
|
//#region src/lib/toolchainVersion.ts
|
|
7150
7150
|
createRequire(import.meta.url);
|
|
7151
7151
|
function bundledToolchainVersion() {
|
|
7152
|
-
return "10.1.
|
|
7152
|
+
return "10.1.4";
|
|
7153
7153
|
}
|
|
7154
7154
|
function bundledToolchainRange() {
|
|
7155
7155
|
return `^${bundledToolchainVersion()}`;
|
|
@@ -50033,7 +50033,8 @@ const argvAfterCommand = (command) => {
|
|
|
50033
50033
|
//#endregion
|
|
50034
50034
|
//#region src/actions/skills/defaults.ts
|
|
50035
50035
|
/**
|
|
50036
|
-
Source of truth for xy-development, xy-toolchain, xy-agent,
|
|
50036
|
+
Source of truth for xy-development, xy-toolchain, xy-agent, ariestools-sdk,
|
|
50037
|
+
ariestools-sdk-react, and ariestools-actor.
|
|
50037
50038
|
*/
|
|
50038
50039
|
const ARIESTOOLS_SKILLS_SOURCE = "ariestools/ariestools-skills";
|
|
50039
50040
|
/**
|
|
@@ -50041,7 +50042,9 @@ Source of truth for xyo-knowledge and xl1-* skills.
|
|
|
50041
50042
|
*/
|
|
50042
50043
|
const XYO_SKILLS_SOURCE = "XYOracleNetwork/xyo-skills";
|
|
50043
50044
|
const ARIESTOOLS_SKILLS = [
|
|
50045
|
+
"ariestools-actor",
|
|
50044
50046
|
"ariestools-sdk",
|
|
50047
|
+
"ariestools-sdk-react",
|
|
50045
50048
|
"xy-agent",
|
|
50046
50049
|
"xy-development",
|
|
50047
50050
|
"xy-toolchain"
|
|
@@ -50120,6 +50123,8 @@ const SKILL_ORDER = [
|
|
|
50120
50123
|
"xy-toolchain",
|
|
50121
50124
|
"xy-agent",
|
|
50122
50125
|
"ariestools-sdk",
|
|
50126
|
+
"ariestools-sdk-react",
|
|
50127
|
+
"ariestools-actor",
|
|
50123
50128
|
"xyo-knowledge",
|
|
50124
50129
|
"xl1-knowledge",
|
|
50125
50130
|
"xl1-patterns",
|
|
@@ -50210,23 +50215,39 @@ function applySkillPresence(skills, presence) {
|
|
|
50210
50215
|
return sortSkills([...next]);
|
|
50211
50216
|
}
|
|
50212
50217
|
/**
|
|
50218
|
+
* Aries Tools package-family skills for a profile. `ariestools-sdk-react` and
|
|
50219
|
+
* `ariestools-actor` are Layer-3 siblings of `ariestools-sdk` in
|
|
50220
|
+
* ariestools-skills and build on it, so each also requires `ariestools-sdk`.
|
|
50221
|
+
* Their consumers often reach `@ariestools/sdk` only transitively (sdk-react
|
|
50222
|
+
* imports it without declaring it), so the sdk-js signal alone would miss them.
|
|
50223
|
+
*/
|
|
50224
|
+
const ariestoolsFamilySkills = (profile) => {
|
|
50225
|
+
const skills = /* @__PURE__ */ new Set();
|
|
50226
|
+
if (profile.isUsingAriestoolsSdk) skills.add("ariestools-sdk");
|
|
50227
|
+
if (profile.isUsingAriestoolsSdkReact === true) {
|
|
50228
|
+
skills.add("ariestools-sdk");
|
|
50229
|
+
skills.add("ariestools-sdk-react");
|
|
50230
|
+
}
|
|
50231
|
+
if (profile.isUsingAriestoolsActor === true) {
|
|
50232
|
+
skills.add("ariestools-sdk");
|
|
50233
|
+
skills.add("ariestools-actor");
|
|
50234
|
+
}
|
|
50235
|
+
return [...skills];
|
|
50236
|
+
};
|
|
50237
|
+
/**
|
|
50213
50238
|
* Required skills for a detected repo profile.
|
|
50214
50239
|
* Adds `ariestools-sdk` when the repo depends on or produces packages from ariestools/sdk-js,
|
|
50240
|
+
* adds `ariestools-sdk-react` (and `ariestools-sdk`) for `@ariestools/sdk-react*` packages,
|
|
50241
|
+
* adds `ariestools-actor` (and `ariestools-sdk`) for actor-kit, cli-kit and browser-kit packages,
|
|
50215
50242
|
* adds `xl1-dapp-kit` when the repo depends on or produces `@xyo-network/dapp-kit` packages,
|
|
50216
50243
|
* plus any validated `additionalSkills` override from xy config.
|
|
50217
50244
|
*/
|
|
50218
50245
|
const requiredSkillsForProfile = (profile) => {
|
|
50219
50246
|
const base = requiredSkillsForTier(profile.tier);
|
|
50220
|
-
const
|
|
50221
|
-
|
|
50222
|
-
|
|
50223
|
-
|
|
50224
|
-
"xy-toolchain",
|
|
50225
|
-
"ariestools-sdk"
|
|
50226
|
-
]);
|
|
50227
|
-
return withSkill(base, "ariestools-sdk");
|
|
50228
|
-
})();
|
|
50229
|
-
const withDappKit = profile.isUsingDappKit ? withSkill(withSdk, "xl1-dapp-kit") : withSdk;
|
|
50247
|
+
const family = ariestoolsFamilySkills(profile);
|
|
50248
|
+
const familyBase = base.length === 0 ? XY_SKILLS : base;
|
|
50249
|
+
const withFamily = family.length === 0 ? base : sortSkills([.../* @__PURE__ */ new Set([...familyBase, ...family])]);
|
|
50250
|
+
const withDappKit = profile.isUsingDappKit ? withSkill(withFamily, "xl1-dapp-kit") : withFamily;
|
|
50230
50251
|
const additional = profile.additionalSkills ?? [];
|
|
50231
50252
|
return applySkillPresence(additional.length === 0 ? withDappKit : sortSkills([.../* @__PURE__ */ new Set([...withDappKit, ...additional])]), profile.skillPresence);
|
|
50232
50253
|
};
|
|
@@ -56497,6 +56518,7 @@ const ARIESTOOLS_SCOPE = "@ariestools/";
|
|
|
56497
56518
|
const XYO_NETWORK_SCOPE = "@xyo-network/";
|
|
56498
56519
|
const XL1_PACKAGE_PREFIX = "@xyo-network/xl1";
|
|
56499
56520
|
const DAPP_KIT_PACKAGE = "@xyo-network/dapp-kit";
|
|
56521
|
+
const SDK_REACT_PACKAGE = "@ariestools/sdk-react";
|
|
56500
56522
|
const LEGACY_TOOLCHAIN_PACKAGES = /* @__PURE__ */ new Set([
|
|
56501
56523
|
"@xylabs/ts-scripts-yarn3",
|
|
56502
56524
|
"@xylabs/ts-scripts-pnpm",
|
|
@@ -56522,6 +56544,28 @@ const ARIESTOOLS_SDK_JS_PACKAGES = /* @__PURE__ */ new Set([
|
|
|
56522
56544
|
"@ariestools/testing",
|
|
56523
56545
|
"@ariestools/threads"
|
|
56524
56546
|
]);
|
|
56547
|
+
/**
|
|
56548
|
+
* Published packages from the ariestools/actor-kit, ariestools/cli-kit and
|
|
56549
|
+
* ariestools/browser-kit monorepos. Presence (import or produce) requires the
|
|
56550
|
+
* `ariestools-actor` skill. Each monorepo's private `*-kit-build` root is excluded.
|
|
56551
|
+
*/
|
|
56552
|
+
const ARIESTOOLS_ACTOR_PACKAGES = /* @__PURE__ */ new Set([
|
|
56553
|
+
"@ariestools/actor",
|
|
56554
|
+
"@ariestools/actor-engine",
|
|
56555
|
+
"@ariestools/actor-model",
|
|
56556
|
+
"@ariestools/actor-system",
|
|
56557
|
+
"@ariestools/browser-kit",
|
|
56558
|
+
"@ariestools/browser-kit-page",
|
|
56559
|
+
"@ariestools/browser-kit-plugin",
|
|
56560
|
+
"@ariestools/browser-kit-service-worker",
|
|
56561
|
+
"@ariestools/browser-kit-worker",
|
|
56562
|
+
"@ariestools/cli-kit",
|
|
56563
|
+
"@ariestools/cli-kit-daemon",
|
|
56564
|
+
"@ariestools/cli-kit-node",
|
|
56565
|
+
"@ariestools/cli-kit-yargs",
|
|
56566
|
+
"@ariestools/provider",
|
|
56567
|
+
"@ariestools/provider-model"
|
|
56568
|
+
]);
|
|
56525
56569
|
const XY_ECOSYSTEM_SCOPES = [
|
|
56526
56570
|
XYLABS_SCOPE,
|
|
56527
56571
|
ARIESTOOLS_SCOPE,
|
|
@@ -56550,6 +56594,17 @@ const isAriestoolsSdkJsPackage = (name) => {
|
|
|
56550
56594
|
return ARIESTOOLS_SDK_JS_PACKAGES.has(name);
|
|
56551
56595
|
};
|
|
56552
56596
|
/**
|
|
56597
|
+
* `@ariestools/sdk-react` and its focused `@ariestools/sdk-react-*` packages
|
|
56598
|
+
* from the ariestools/sdk-react monorepo.
|
|
56599
|
+
* Presence (import or produce) requires the `ariestools-sdk-react` skill.
|
|
56600
|
+
*/
|
|
56601
|
+
const isAriestoolsSdkReactPackage = (name) => {
|
|
56602
|
+
return name === SDK_REACT_PACKAGE || name.startsWith(`${SDK_REACT_PACKAGE}-`);
|
|
56603
|
+
};
|
|
56604
|
+
const isAriestoolsActorPackage = (name) => {
|
|
56605
|
+
return ARIESTOOLS_ACTOR_PACKAGES.has(name);
|
|
56606
|
+
};
|
|
56607
|
+
/**
|
|
56553
56608
|
* Published and private packages from the dapp-kit monorepo
|
|
56554
56609
|
* (`@xyo-network/dapp-kit` and `@xyo-network/dapp-kit-*`).
|
|
56555
56610
|
* Presence (import or produce) requires the `xl1-dapp-kit` skill.
|
|
@@ -56566,6 +56621,9 @@ const hasXyConfig = (cwd, workspaces) => {
|
|
|
56566
56621
|
return existsSync(configPath);
|
|
56567
56622
|
});
|
|
56568
56623
|
};
|
|
56624
|
+
const packageFamilySignals = (packages, isFamilyPackage, label) => {
|
|
56625
|
+
return packages.filter((name) => isFamilyPackage(name)).toSorted((a, b) => a.localeCompare(b)).map((name) => `${label} ${name}`);
|
|
56626
|
+
};
|
|
56569
56627
|
const resolveTier = (produces, imports, isUsingToolchain) => {
|
|
56570
56628
|
const allPackages = [...produces, ...imports];
|
|
56571
56629
|
if (allPackages.some(isXl1Package)) return "xl1";
|
|
@@ -56633,21 +56691,25 @@ const detectRepoProfile = (cwd) => {
|
|
|
56633
56691
|
const imported = collectImports(declaredDeps);
|
|
56634
56692
|
const toolchain = detectToolchainUsage(cwd, workspaces, declaredDeps);
|
|
56635
56693
|
const allPackages = [...produced.produces, ...imported.imports];
|
|
56636
|
-
const
|
|
56637
|
-
const
|
|
56638
|
-
const
|
|
56639
|
-
const dappKitSignals =
|
|
56694
|
+
const sdkSignals = packageFamilySignals(allPackages, isAriestoolsSdkJsPackage, "sdk-js");
|
|
56695
|
+
const sdkReactSignals = packageFamilySignals(allPackages, isAriestoolsSdkReactPackage, "sdk-react");
|
|
56696
|
+
const actorSignals = packageFamilySignals(allPackages, isAriestoolsActorPackage, "actor");
|
|
56697
|
+
const dappKitSignals = packageFamilySignals(allPackages, isDappKitPackage, "dapp-kit");
|
|
56640
56698
|
const signals = [
|
|
56641
56699
|
...produced.signals,
|
|
56642
56700
|
...imported.signals,
|
|
56643
56701
|
...toolchain.signals,
|
|
56644
56702
|
...sdkSignals,
|
|
56703
|
+
...sdkReactSignals,
|
|
56704
|
+
...actorSignals,
|
|
56645
56705
|
...dappKitSignals
|
|
56646
56706
|
].toSorted((a, b) => a.localeCompare(b));
|
|
56647
56707
|
return {
|
|
56648
56708
|
imports: imported.imports.toSorted((a, b) => a.localeCompare(b)),
|
|
56649
|
-
|
|
56650
|
-
|
|
56709
|
+
isUsingAriestoolsActor: actorSignals.length > 0,
|
|
56710
|
+
isUsingAriestoolsSdk: sdkSignals.length > 0,
|
|
56711
|
+
isUsingAriestoolsSdkReact: sdkReactSignals.length > 0,
|
|
56712
|
+
isUsingDappKit: dappKitSignals.length > 0,
|
|
56651
56713
|
produces: produced.produces.toSorted((a, b) => a.localeCompare(b)),
|
|
56652
56714
|
signals,
|
|
56653
56715
|
tier: resolveTier(produced.produces, imported.imports, toolchain.isUsingToolchain),
|
|
@@ -56912,6 +56974,54 @@ const findUnmigratedSkills = (cwd, installed, latestVersions) => {
|
|
|
56912
56974
|
return mergeUnmigratedSkills(fromLock, fromFiles);
|
|
56913
56975
|
};
|
|
56914
56976
|
//#endregion
|
|
56977
|
+
//#region src/actions/skills/missingSkillReason.ts
|
|
56978
|
+
/**
|
|
56979
|
+
* Why a package-family signal requires a skill. The first match wins, so a
|
|
56980
|
+
* direct sdk-js signal outranks the skills that build on `ariestools-sdk`.
|
|
56981
|
+
*/
|
|
56982
|
+
const PACKAGE_FAMILY_REASONS = [
|
|
56983
|
+
{
|
|
56984
|
+
flag: "isUsingAriestoolsSdk",
|
|
56985
|
+
reason: "repo uses packages from ariestools/sdk-js",
|
|
56986
|
+
skill: "ariestools-sdk"
|
|
56987
|
+
},
|
|
56988
|
+
{
|
|
56989
|
+
flag: "isUsingAriestoolsSdkReact",
|
|
56990
|
+
reason: "repo uses @ariestools/sdk-react packages",
|
|
56991
|
+
skill: "ariestools-sdk-react"
|
|
56992
|
+
},
|
|
56993
|
+
{
|
|
56994
|
+
flag: "isUsingAriestoolsActor",
|
|
56995
|
+
reason: "repo uses actor-kit, cli-kit or browser-kit packages",
|
|
56996
|
+
skill: "ariestools-actor"
|
|
56997
|
+
},
|
|
56998
|
+
{
|
|
56999
|
+
flag: "isUsingAriestoolsSdkReact",
|
|
57000
|
+
reason: "ariestools-sdk-react builds on it",
|
|
57001
|
+
skill: "ariestools-sdk"
|
|
57002
|
+
},
|
|
57003
|
+
{
|
|
57004
|
+
flag: "isUsingAriestoolsActor",
|
|
57005
|
+
reason: "ariestools-actor builds on it",
|
|
57006
|
+
skill: "ariestools-sdk"
|
|
57007
|
+
},
|
|
57008
|
+
{
|
|
57009
|
+
flag: "isUsingDappKit",
|
|
57010
|
+
reason: "repo uses dapp-kit packages",
|
|
57011
|
+
skill: "xl1-dapp-kit"
|
|
57012
|
+
}
|
|
57013
|
+
];
|
|
57014
|
+
/**
|
|
57015
|
+
* Explains why `xy skills lint` requires a missing skill, for its
|
|
57016
|
+
* `skills.required-installed` diagnostic.
|
|
57017
|
+
*/
|
|
57018
|
+
const missingSkillReason = (profile, skillName) => {
|
|
57019
|
+
const familyReason = PACKAGE_FAMILY_REASONS.find((entry) => entry.skill === skillName && profile[entry.flag]);
|
|
57020
|
+
if (familyReason !== void 0) return familyReason.reason;
|
|
57021
|
+
if (skillName === "xy-toolchain" && profile.isUsingToolchain) return "repo uses @ariestools/toolchain";
|
|
57022
|
+
return profile.additionalSkills?.includes(skillName) === true ? "listed in commands.skillsLint.additionalSkills" : "required for repo profile";
|
|
57023
|
+
};
|
|
57024
|
+
//#endregion
|
|
56915
57025
|
//#region src/actions/skills/packageSkills.ts
|
|
56916
57026
|
const SKILL_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
56917
57027
|
const MAX_SKILL_NAME_LENGTH = 64;
|
|
@@ -57169,12 +57279,6 @@ const installSkillOnce = (installSkill) => {
|
|
|
57169
57279
|
return code;
|
|
57170
57280
|
};
|
|
57171
57281
|
};
|
|
57172
|
-
const missingSkillReason = (profile, skillName) => {
|
|
57173
|
-
if (skillName === "ariestools-sdk" && profile.isUsingAriestoolsSdk) return "repo uses packages from ariestools/sdk-js";
|
|
57174
|
-
if (skillName === "xl1-dapp-kit" && profile.isUsingDappKit) return "repo uses dapp-kit packages";
|
|
57175
|
-
if (skillName === "xy-toolchain" && profile.isUsingToolchain) return "repo uses @ariestools/toolchain";
|
|
57176
|
-
return profile.additionalSkills?.includes(skillName) === true ? "listed in commands.skillsLint.additionalSkills" : "required for repo profile";
|
|
57177
|
-
};
|
|
57178
57282
|
const checkRequiredSkills = (required, installed, latestVersions, unmigratedNames = /* @__PURE__ */ new Set()) => {
|
|
57179
57283
|
const current = [];
|
|
57180
57284
|
const missing = [];
|
|
@@ -57827,6 +57931,22 @@ const formatGithubWorkIssueBody = (item) => {
|
|
|
57827
57931
|
].join("\n"));
|
|
57828
57932
|
return sections.join("\n\n");
|
|
57829
57933
|
};
|
|
57934
|
+
const normalizeGithubIssueBody = (body) => body.replaceAll("\r\n", "\n").trim();
|
|
57935
|
+
/**
|
|
57936
|
+
Compare issue bodies, ignoring the CRLF line endings and surrounding whitespace GitHub can add.
|
|
57937
|
+
*/
|
|
57938
|
+
const githubIssueBodiesMatch = (a, b) => {
|
|
57939
|
+
return normalizeGithubIssueBody(a) === normalizeGithubIssueBody(b);
|
|
57940
|
+
};
|
|
57941
|
+
const XY_WORK_GENERATED_SECTION_PATTERN = /(?:^|\n)(?:## xy work metadata\b|(?:---[ \t]*\r?\n)?[ \t]*<!--\s*xy-work:)/i;
|
|
57942
|
+
/**
|
|
57943
|
+
Drop the sections `formatGithubWorkIssueBody` generates (metadata, marker, footer) so an imported
|
|
57944
|
+
xy-work issue body can be rendered again without repeating them.
|
|
57945
|
+
*/
|
|
57946
|
+
const stripXyWorkGeneratedBody = (body) => {
|
|
57947
|
+
const match = XY_WORK_GENERATED_SECTION_PATTERN.exec(body);
|
|
57948
|
+
return (match === null ? body : body.slice(0, match.index)).trim();
|
|
57949
|
+
};
|
|
57830
57950
|
const TYPE_LABEL_MAP = [
|
|
57831
57951
|
["bug", "bug"],
|
|
57832
57952
|
["type:bug", "bug"],
|
|
@@ -58017,6 +58137,20 @@ const isTerminalWorkStatus = (status) => {
|
|
|
58017
58137
|
return status === "done" || status === "wontfix";
|
|
58018
58138
|
};
|
|
58019
58139
|
/**
|
|
58140
|
+
Sync may edit a linked issue only when its body marker names this item and the stored URL matches.
|
|
58141
|
+
*/
|
|
58142
|
+
const githubIssueBelongsToItem = (item, issue) => {
|
|
58143
|
+
const storedUrl = readGithubStoreUrl(item.stores);
|
|
58144
|
+
return parseXyWorkIdFromGithubBody(issue.body) === item.id && (storedUrl === void 0 || storedUrl === issue.url);
|
|
58145
|
+
};
|
|
58146
|
+
/**
|
|
58147
|
+
The body of an issue xy work owns is rendered from the local item and cannot be imported back,
|
|
58148
|
+
so any difference counts as drift and sync pushes the local rendering.
|
|
58149
|
+
*/
|
|
58150
|
+
const githubBodyDrifted = (item, issue) => {
|
|
58151
|
+
return githubIssueBelongsToItem(item, issue) && !githubIssueBodiesMatch(formatGithubWorkIssueBody(item), issue.body);
|
|
58152
|
+
};
|
|
58153
|
+
/**
|
|
58020
58154
|
* Normalize open GitHub issues that were not created by `xy work` into WorkItem shape.
|
|
58021
58155
|
* Issues already linked from local items (or marked with the xy-work label/marker) are skipped.
|
|
58022
58156
|
*/
|
|
@@ -58054,6 +58188,7 @@ const importGithubIssueLocally = (cwd, issue, now, preferredId) => {
|
|
|
58054
58188
|
const item = {
|
|
58055
58189
|
...base,
|
|
58056
58190
|
completedAt: open ? void 0 : base.updatedAt || nowIso(now),
|
|
58191
|
+
description: createdByXyWork ? stripXyWorkGeneratedBody(base.description) : base.description,
|
|
58057
58192
|
id,
|
|
58058
58193
|
status: open ? "open" : "done",
|
|
58059
58194
|
stores: { github: {
|
|
@@ -58130,26 +58265,33 @@ const attachOrImportGithubIssues = (cwd, issuesByNumber, summary, now) => {
|
|
|
58130
58265
|
}
|
|
58131
58266
|
}
|
|
58132
58267
|
};
|
|
58133
|
-
|
|
58134
|
-
|
|
58268
|
+
/**
|
|
58269
|
+
Title: newer side wins. Body: the local rendering always wins on issues the item owns.
|
|
58270
|
+
*/
|
|
58271
|
+
const reconcileContentDrift = (cwd, github, item, issue, number, summary, canMutateGithub = true, now) => {
|
|
58272
|
+
const titleDrifted = item.title !== issue.title;
|
|
58273
|
+
const bodyDrifted = githubBodyDrifted(item, issue);
|
|
58274
|
+
if (!titleDrifted && !bodyDrifted) return {
|
|
58275
|
+
localChanged: false,
|
|
58276
|
+
next: item
|
|
58277
|
+
};
|
|
58278
|
+
const localIsNewer = item.updatedAt.localeCompare(issue.updatedAt) >= 0;
|
|
58279
|
+
const pushTitle = titleDrifted && localIsNewer && canMutateGithub;
|
|
58280
|
+
if (pushTitle || bodyDrifted) {
|
|
58281
|
+
const body = formatGithubWorkIssueBody(item);
|
|
58282
|
+
github.updateIssue(cwd, number, pushTitle ? {
|
|
58283
|
+
body,
|
|
58284
|
+
title: item.title
|
|
58285
|
+
} : { body });
|
|
58286
|
+
summary.updatedGithub.push(`${item.id}→#${String(number)}`);
|
|
58287
|
+
issue.body = body;
|
|
58288
|
+
if (pushTitle) issue.title = item.title;
|
|
58289
|
+
issue.updatedAt = nowIso(now);
|
|
58290
|
+
}
|
|
58291
|
+
if (!titleDrifted || localIsNewer) return {
|
|
58135
58292
|
localChanged: false,
|
|
58136
58293
|
next: item
|
|
58137
58294
|
};
|
|
58138
|
-
if (item.updatedAt.localeCompare(issue.updatedAt) >= 0) {
|
|
58139
|
-
if (canMutateGithub) {
|
|
58140
|
-
github.updateIssue(cwd, number, {
|
|
58141
|
-
body: formatGithubWorkIssueBody(item),
|
|
58142
|
-
title: item.title
|
|
58143
|
-
});
|
|
58144
|
-
summary.updatedGithub.push(`${item.id}→#${String(number)}`);
|
|
58145
|
-
issue.title = item.title;
|
|
58146
|
-
issue.updatedAt = nowIso(now);
|
|
58147
|
-
}
|
|
58148
|
-
return {
|
|
58149
|
-
localChanged: false,
|
|
58150
|
-
next: item
|
|
58151
|
-
};
|
|
58152
|
-
}
|
|
58153
58295
|
return {
|
|
58154
58296
|
localChanged: true,
|
|
58155
58297
|
next: {
|
|
@@ -58177,15 +58319,16 @@ const reconcileLinkedItem = (cwd, github, item, issue, number, summary, now) =>
|
|
|
58177
58319
|
let localChanged = false;
|
|
58178
58320
|
const issueOpen = githubIssueIsOpen(issue);
|
|
58179
58321
|
const localTerminal = isTerminalWorkStatus(item.status);
|
|
58180
|
-
const
|
|
58181
|
-
const storedUrl = readGithubStoreUrl(item.stores);
|
|
58182
|
-
const canMutateGithub = markerId === item.id && (storedUrl === void 0 || storedUrl === issue.url);
|
|
58322
|
+
const canMutateGithub = githubIssueBelongsToItem(item, issue);
|
|
58183
58323
|
if (localTerminal && issueOpen) {
|
|
58184
58324
|
if (canMutateGithub) {
|
|
58185
58325
|
github.updateIssue(cwd, number, { state: "closed" });
|
|
58186
58326
|
summary.closedGithub.push(`${item.id}→#${String(number)}`);
|
|
58187
58327
|
issue.state = "CLOSED";
|
|
58188
|
-
} else
|
|
58328
|
+
} else {
|
|
58329
|
+
const markerId = parseXyWorkIdFromGithubBody(issue.body);
|
|
58330
|
+
xyLog(`Sync reconcile skipped closing GitHub #${String(number)}: body marker (${markerId ?? "none"}) does not match ${item.id} or URL mismatch`);
|
|
58331
|
+
}
|
|
58189
58332
|
} else if (!localTerminal && !issueOpen) {
|
|
58190
58333
|
next = {
|
|
58191
58334
|
...next,
|
|
@@ -58196,9 +58339,9 @@ const reconcileLinkedItem = (cwd, github, item, issue, number, summary, now) =>
|
|
|
58196
58339
|
};
|
|
58197
58340
|
localChanged = true;
|
|
58198
58341
|
} else if (!localTerminal && issueOpen) {
|
|
58199
|
-
const
|
|
58200
|
-
next =
|
|
58201
|
-
localChanged ||=
|
|
58342
|
+
const contentResult = reconcileContentDrift(cwd, github, next, issue, number, summary, canMutateGithub, now);
|
|
58343
|
+
next = contentResult.next;
|
|
58344
|
+
localChanged ||= contentResult.localChanged;
|
|
58202
58345
|
}
|
|
58203
58346
|
const urlResult = ensureGithubStoreUrl(next, issue, number);
|
|
58204
58347
|
next = urlResult.next;
|
|
@@ -58236,13 +58379,14 @@ const logSyncSummary = (summary) => {
|
|
|
58236
58379
|
].join("\n"));
|
|
58237
58380
|
};
|
|
58238
58381
|
const emptyWorkSyncDrift = () => ({
|
|
58382
|
+
bodyMismatch: [],
|
|
58239
58383
|
githubMissingLocal: [],
|
|
58240
58384
|
localMissingGithub: [],
|
|
58241
58385
|
statusMismatch: [],
|
|
58242
58386
|
titleMismatch: []
|
|
58243
58387
|
});
|
|
58244
58388
|
const workSyncDriftIsClean = (drift) => {
|
|
58245
|
-
return drift.githubMissingLocal.length === 0 && drift.localMissingGithub.length === 0 && drift.statusMismatch.length === 0 && drift.titleMismatch.length === 0;
|
|
58389
|
+
return drift.bodyMismatch.length === 0 && drift.githubMissingLocal.length === 0 && drift.localMissingGithub.length === 0 && drift.statusMismatch.length === 0 && drift.titleMismatch.length === 0;
|
|
58246
58390
|
};
|
|
58247
58391
|
const recordLocalMissingGithub = (localItems, drift) => {
|
|
58248
58392
|
for (const item of localItems) {
|
|
@@ -58258,7 +58402,11 @@ const recordLinkedPairDrift = (issue, linked, drift) => {
|
|
|
58258
58402
|
drift.statusMismatch.push(`${linked.id} done/wontfix but GitHub #${String(issue.number)} open`);
|
|
58259
58403
|
return;
|
|
58260
58404
|
}
|
|
58261
|
-
if (!localTerminal && !issueOpen)
|
|
58405
|
+
if (!localTerminal && !issueOpen) {
|
|
58406
|
+
drift.statusMismatch.push(`${linked.id} open locally but GitHub #${String(issue.number)} closed`);
|
|
58407
|
+
return;
|
|
58408
|
+
}
|
|
58409
|
+
if (!localTerminal && githubBodyDrifted(linked, issue)) drift.bodyMismatch.push(`${linked.id}/#${String(issue.number)}`);
|
|
58262
58410
|
};
|
|
58263
58411
|
const recordUnlinkedXyWorkDrift = (issue, localById, drift) => {
|
|
58264
58412
|
if (!isXyWorkGithubIssue(issue)) return;
|
|
@@ -58303,7 +58451,7 @@ const computeWorkSyncDrift = (cwd, options = {}) => {
|
|
|
58303
58451
|
*
|
|
58304
58452
|
* - Local active items without a GitHub link → create a marked GitHub issue
|
|
58305
58453
|
* - Open/closed GitHub issues not present locally → import as local items
|
|
58306
|
-
* - Linked pairs: reconcile title (newer wins) and status (done/wontfix ↔ closed)
|
|
58454
|
+
* - Linked pairs: reconcile title (newer wins), body of xy-work issues (local wins), and status (done/wontfix ↔ closed)
|
|
58307
58455
|
*/
|
|
58308
58456
|
const workSync = (options = {}) => {
|
|
58309
58457
|
const cwd = options.cwd ?? process.cwd();
|
|
@@ -58350,14 +58498,18 @@ const compareWorkItemsByPriority = (a, b, formula = DEFAULT_PRIORITY_FORMULA) =>
|
|
|
58350
58498
|
if (aScore !== void 0 && bScore === void 0) return -1;
|
|
58351
58499
|
return aScore === void 0 && bScore !== void 0 ? 1 : a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);
|
|
58352
58500
|
};
|
|
58353
|
-
|
|
58501
|
+
/**
|
|
58502
|
+
Build a priority from the fields given. Fields left out keep their value from `base` (the stored
|
|
58503
|
+
priority on update), or default to 3 when there is no base.
|
|
58504
|
+
*/
|
|
58505
|
+
const priorityFromPartial = (partial, base) => {
|
|
58354
58506
|
if (Object.values(partial).every((value) => value === void 0)) return void 0;
|
|
58355
58507
|
return {
|
|
58356
|
-
confidence: partial.confidence ?? 3,
|
|
58357
|
-
effort: partial.effort ?? 3,
|
|
58358
|
-
impact: partial.impact ?? 3,
|
|
58359
|
-
risk: partial.risk ?? 3,
|
|
58360
|
-
urgency: partial.urgency ?? 3
|
|
58508
|
+
confidence: partial.confidence ?? base?.confidence ?? 3,
|
|
58509
|
+
effort: partial.effort ?? base?.effort ?? 3,
|
|
58510
|
+
impact: partial.impact ?? base?.impact ?? 3,
|
|
58511
|
+
risk: partial.risk ?? base?.risk ?? 3,
|
|
58512
|
+
urgency: partial.urgency ?? base?.urgency ?? 3
|
|
58361
58513
|
};
|
|
58362
58514
|
};
|
|
58363
58515
|
//#endregion
|
|
@@ -58574,6 +58726,7 @@ const buildRepoContext = (repo, github) => {
|
|
|
58574
58726
|
for (const id of drift.localMissingGithub) driftMessages.push(`${id} — active local item missing GitHub link`);
|
|
58575
58727
|
for (const entry of drift.githubMissingLocal) driftMessages.push(`${entry} — GitHub issue missing local item`);
|
|
58576
58728
|
for (const entry of drift.titleMismatch) driftMessages.push(`${entry} — title mismatch`);
|
|
58729
|
+
for (const entry of drift.bodyMismatch) driftMessages.push(`${entry} — body mismatch`);
|
|
58577
58730
|
for (const entry of drift.statusMismatch) driftMessages.push(entry);
|
|
58578
58731
|
}
|
|
58579
58732
|
} catch (error) {
|
|
@@ -59580,6 +59733,10 @@ const workDone = (options) => {
|
|
|
59580
59733
|
repo: scoped.repo
|
|
59581
59734
|
});
|
|
59582
59735
|
};
|
|
59736
|
+
const updatedBlockedReason = (next, current) => {
|
|
59737
|
+
if (next === void 0) return current;
|
|
59738
|
+
return next.trim().length === 0 ? void 0 : next;
|
|
59739
|
+
};
|
|
59583
59740
|
const workUpdate = (options) => {
|
|
59584
59741
|
const scoped = resolveScopedWorkItem(options.id, scopeFrom(options));
|
|
59585
59742
|
const item = stripScope(scoped);
|
|
@@ -59589,13 +59746,13 @@ const workUpdate = (options) => {
|
|
|
59589
59746
|
impact: options.impact,
|
|
59590
59747
|
risk: options.risk,
|
|
59591
59748
|
urgency: options.urgency
|
|
59592
|
-
});
|
|
59749
|
+
}, item.priority);
|
|
59593
59750
|
const updatedAt = nowIso(options.now);
|
|
59594
59751
|
const updated = {
|
|
59595
59752
|
...item,
|
|
59596
59753
|
acceptanceCriteria: options.acceptanceCriteria === void 0 ? item.acceptanceCriteria : normalizeTextList(options.acceptanceCriteria),
|
|
59597
59754
|
area: options.area ?? item.area,
|
|
59598
|
-
blockedReason: options.blockedReason
|
|
59755
|
+
blockedReason: updatedBlockedReason(options.blockedReason, item.blockedReason),
|
|
59599
59756
|
description: options.description ?? item.description,
|
|
59600
59757
|
priority: priority === void 0 ? item.priority : validateWorkPriority(priority),
|
|
59601
59758
|
status: options.status ?? item.status,
|
|
@@ -61264,6 +61421,12 @@ Pick is catalog-only. A TTY is required when --skill is omitted.
|
|
|
61264
61421
|
It writes commands.skillsLint.skills.<name>.presence: 'required'
|
|
61265
61422
|
and keeps other presence entries.
|
|
61266
61423
|
|
|
61424
|
+
Catalog:
|
|
61425
|
+
- ariestools/ariestools-skills xy-development, xy-toolchain, xy-agent,
|
|
61426
|
+
ariestools-sdk, ariestools-sdk-react,
|
|
61427
|
+
ariestools-actor
|
|
61428
|
+
- XYOracleNetwork/xyo-skills xyo-knowledge, xl1-*
|
|
61429
|
+
|
|
61267
61430
|
Options:
|
|
61268
61431
|
--skill <name> Skill to require. Repeat for more than one.
|
|
61269
61432
|
-h, --help Show this help
|
|
@@ -61273,7 +61436,9 @@ const printDefaultsHelp = () => {
|
|
|
61273
61436
|
console.log(`xy skills defaults
|
|
61274
61437
|
|
|
61275
61438
|
Install the default skill stacks:
|
|
61276
|
-
- ariestools/ariestools-skills (xy-development, xy-toolchain, xy-agent,
|
|
61439
|
+
- ariestools/ariestools-skills (xy-development, xy-toolchain, xy-agent,
|
|
61440
|
+
ariestools-sdk, ariestools-sdk-react,
|
|
61441
|
+
ariestools-actor)
|
|
61277
61442
|
- XYOracleNetwork/xyo-skills (xyo-knowledge, xl1-*)
|
|
61278
61443
|
|
|
61279
61444
|
Usage:
|
|
@@ -61311,12 +61476,15 @@ Usage:
|
|
|
61311
61476
|
Checks:
|
|
61312
61477
|
- Detect repo tier (xy, xyo, xl1) from package.json and toolchain signals
|
|
61313
61478
|
- Require ariestools-sdk when packages from ariestools/sdk-js are used
|
|
61479
|
+
- Require ariestools-sdk-react when @ariestools/sdk-react packages are used
|
|
61480
|
+
- Require ariestools-actor when actor-kit, cli-kit or browser-kit packages
|
|
61481
|
+
are used (both also require ariestools-sdk, which they build on)
|
|
61314
61482
|
- Require xl1-dapp-kit when the repo produces or depends on @xyo-network/dapp-kit packages
|
|
61315
61483
|
- Require skills listed in package.json xy.skills on workspace packages and direct dependencies
|
|
61316
61484
|
- Required skills installed in .claude/skills and/or .agents/skills
|
|
61317
61485
|
- xy-development and xy-toolchain are locked to ariestools-skills, not xyo-skills
|
|
61318
61486
|
- Installed skill versions vs upstream main
|
|
61319
|
-
(ariestools/ariestools-skills for xy
|
|
61487
|
+
(ariestools/ariestools-skills for xy-* and ariestools-* skills;
|
|
61320
61488
|
XYOracleNetwork/xyo-skills for xyo/xl1 skills)
|
|
61321
61489
|
- Project/global duplicate installs
|
|
61322
61490
|
|
|
@@ -61328,6 +61496,8 @@ Config (xy.config.ts):
|
|
|
61328
61496
|
required | allowed | off. required forces a skill on,
|
|
61329
61497
|
off forces it off, allowed keeps an install from
|
|
61330
61498
|
counting as unnecessary
|
|
61499
|
+
Both keys take catalog names: xy-development, xy-toolchain, xy-agent,
|
|
61500
|
+
ariestools-sdk, ariestools-sdk-react, ariestools-actor, xyo-knowledge, xl1-*.
|
|
61331
61501
|
|
|
61332
61502
|
Options:
|
|
61333
61503
|
--fix Install missing and update outdated required and package-declared skills; migrate relocated ones (project scope)
|
|
@@ -61787,7 +61957,7 @@ const updateCommand = {
|
|
|
61787
61957
|
describe: "Replace status",
|
|
61788
61958
|
type: "string"
|
|
61789
61959
|
}).option("blocked-reason", {
|
|
61790
|
-
describe: "Blocked status explanation",
|
|
61960
|
+
describe: "Blocked status explanation; pass an empty value (--blocked-reason \"\") to remove it",
|
|
61791
61961
|
type: "string"
|
|
61792
61962
|
}).option("tag", {
|
|
61793
61963
|
array: true,
|
|
@@ -61801,17 +61971,32 @@ const updateCommand = {
|
|
|
61801
61971
|
array: true,
|
|
61802
61972
|
describe: "Replace verification entries; repeatable",
|
|
61803
61973
|
type: "string"
|
|
61804
|
-
}).option("impact", {
|
|
61974
|
+
}).option("impact", {
|
|
61975
|
+
describe: "Set priority impact (1-5)",
|
|
61976
|
+
type: "number"
|
|
61977
|
+
}).option("urgency", {
|
|
61978
|
+
describe: "Set priority urgency (1-5)",
|
|
61979
|
+
type: "number"
|
|
61980
|
+
}).option("effort", {
|
|
61981
|
+
describe: "Set priority effort (1-5)",
|
|
61982
|
+
type: "number"
|
|
61983
|
+
}).option("risk", {
|
|
61984
|
+
describe: "Set priority risk (1-5)",
|
|
61985
|
+
type: "number"
|
|
61986
|
+
}).option("confidence", {
|
|
61987
|
+
describe: "Set priority confidence (1-5)",
|
|
61988
|
+
type: "number"
|
|
61989
|
+
}).epilogue(["Only the fields you pass change. Priority fields you leave out keep their stored values (or default to 3 when the item has no priority yet).", "Updates are written to the local store only. Run `xy work sync` afterwards to push the title and issue body to a linked GitHub issue; `xy work lint` reports linked issues whose body has drifted (work.github-synced)."].join("\n\n")));
|
|
61805
61990
|
},
|
|
61806
61991
|
command: "update <id>",
|
|
61807
|
-
describe: "Update
|
|
61992
|
+
describe: "Update fields on a work item (local only; run `xy work sync` to push to GitHub)",
|
|
61808
61993
|
handler: async (argv) => {
|
|
61809
61994
|
const scope = scopeFromArgv(argv);
|
|
61810
61995
|
await withEnvelope("work update", () => workUpdate({
|
|
61811
61996
|
...scope,
|
|
61812
61997
|
acceptanceCriteria: optionalStringArray(argv.acceptance),
|
|
61813
61998
|
area: optionalString(argv.area),
|
|
61814
|
-
blockedReason:
|
|
61999
|
+
blockedReason: typeof argv["blocked-reason"] === "string" ? argv["blocked-reason"] : void 0,
|
|
61815
62000
|
confidence: optionalNumber(argv.confidence),
|
|
61816
62001
|
description: optionalString(argv.description),
|
|
61817
62002
|
effort: optionalNumber(argv.effort),
|