@packmind/cli 0.34.1 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.cjs +539 -391
- package/package.json +3 -1
package/main.cjs
CHANGED
|
@@ -2243,7 +2243,7 @@ var require_common = __commonJS({
|
|
|
2243
2243
|
createDebug.coerce = coerce;
|
|
2244
2244
|
createDebug.disable = disable;
|
|
2245
2245
|
createDebug.enable = enable;
|
|
2246
|
-
createDebug.enabled =
|
|
2246
|
+
createDebug.enabled = enabled2;
|
|
2247
2247
|
createDebug.humanize = require_ms();
|
|
2248
2248
|
createDebug.destroy = destroy;
|
|
2249
2249
|
Object.keys(env2).forEach((key) => {
|
|
@@ -2382,7 +2382,7 @@ var require_common = __commonJS({
|
|
|
2382
2382
|
createDebug.enable("");
|
|
2383
2383
|
return namespaces;
|
|
2384
2384
|
}
|
|
2385
|
-
function
|
|
2385
|
+
function enabled2(name) {
|
|
2386
2386
|
for (const skip of createDebug.skips) {
|
|
2387
2387
|
if (matchesTemplate(name, skip)) {
|
|
2388
2388
|
return false;
|
|
@@ -3858,7 +3858,7 @@ var require_package = __commonJS({
|
|
|
3858
3858
|
"apps/cli/package.json"(exports2, module2) {
|
|
3859
3859
|
module2.exports = {
|
|
3860
3860
|
name: "@packmind/cli",
|
|
3861
|
-
version: "0.
|
|
3861
|
+
version: "0.35.1",
|
|
3862
3862
|
description: "A command-line interface for Packmind linting and code quality checks",
|
|
3863
3863
|
private: false,
|
|
3864
3864
|
bin: {
|
|
@@ -3933,6 +3933,24 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
|
3933
3933
|
LogLevel2["SILLY"] = "silly";
|
|
3934
3934
|
return LogLevel2;
|
|
3935
3935
|
})(LogLevel || {});
|
|
3936
|
+
function formatConsoleLine(info) {
|
|
3937
|
+
const { timestamp, level, message, label, trace_id: traceId } = info;
|
|
3938
|
+
const meta = Object.fromEntries(
|
|
3939
|
+
Object.entries(info).filter(([key]) => !RENDERED_FIELDS.includes(key))
|
|
3940
|
+
);
|
|
3941
|
+
const metaStr = Object.keys(meta).length ? ` ${JSON.stringify(meta)}` : "";
|
|
3942
|
+
const traceStr = traceId ? ` [trace=${String(traceId).slice(0, 8)}]` : "";
|
|
3943
|
+
return `${timestamp} [${label}]${traceStr} ${level}: ${message}${metaStr}`;
|
|
3944
|
+
}
|
|
3945
|
+
var RENDERED_FIELDS = [
|
|
3946
|
+
"timestamp",
|
|
3947
|
+
"level",
|
|
3948
|
+
"message",
|
|
3949
|
+
"label",
|
|
3950
|
+
"trace_id",
|
|
3951
|
+
"span_id",
|
|
3952
|
+
"trace_flags"
|
|
3953
|
+
];
|
|
3936
3954
|
var PackmindLogger = class {
|
|
3937
3955
|
constructor(name, level = "info" /* INFO */) {
|
|
3938
3956
|
this.name = name;
|
|
@@ -3955,12 +3973,7 @@ var PackmindLogger = class {
|
|
|
3955
3973
|
new import_winston.default.transports.Console({
|
|
3956
3974
|
format: import_winston.default.format.combine(
|
|
3957
3975
|
import_winston.default.format.colorize(),
|
|
3958
|
-
import_winston.default.format.printf(
|
|
3959
|
-
({ timestamp, level: level2, message, label, ...meta }) => {
|
|
3960
|
-
const metaStr = Object.keys(meta).length ? ` ${JSON.stringify(meta)}` : "";
|
|
3961
|
-
return `${timestamp} [${label}] ${level2}: ${message}${metaStr}`;
|
|
3962
|
-
}
|
|
3963
|
-
)
|
|
3976
|
+
import_winston.default.format.printf(formatConsoleLine)
|
|
3964
3977
|
)
|
|
3965
3978
|
})
|
|
3966
3979
|
]
|
|
@@ -3981,32 +3994,10 @@ var PackmindLogger = class {
|
|
|
3981
3994
|
if (this.currentLevel === "silent" /* SILENT */ || !this.logger) return;
|
|
3982
3995
|
this.logger.info(message, meta);
|
|
3983
3996
|
}
|
|
3984
|
-
http(message, meta) {
|
|
3985
|
-
if (this.currentLevel === "silent" /* SILENT */ || !this.logger) return;
|
|
3986
|
-
this.logger.http(message, meta);
|
|
3987
|
-
}
|
|
3988
|
-
verbose(message, meta) {
|
|
3989
|
-
if (this.currentLevel === "silent" /* SILENT */ || !this.logger) return;
|
|
3990
|
-
this.logger.verbose(message, meta);
|
|
3991
|
-
}
|
|
3992
3997
|
debug(message, meta) {
|
|
3993
3998
|
if (this.currentLevel === "silent" /* SILENT */ || !this.logger) return;
|
|
3994
3999
|
this.logger.debug(message, meta);
|
|
3995
4000
|
}
|
|
3996
|
-
silly(message, meta) {
|
|
3997
|
-
if (this.currentLevel === "silent" /* SILENT */ || !this.logger) return;
|
|
3998
|
-
this.logger.silly(message, meta);
|
|
3999
|
-
}
|
|
4000
|
-
log(level, message, meta) {
|
|
4001
|
-
if (this.currentLevel === "silent" /* SILENT */ || !this.logger) return;
|
|
4002
|
-
this.logger.log(level, message, meta);
|
|
4003
|
-
}
|
|
4004
|
-
setLevel(level) {
|
|
4005
|
-
this.currentLevel = level;
|
|
4006
|
-
if (level !== "silent" /* SILENT */ && this.logger) {
|
|
4007
|
-
this.logger.level = level;
|
|
4008
|
-
}
|
|
4009
|
-
}
|
|
4010
4001
|
getName() {
|
|
4011
4002
|
return this.name;
|
|
4012
4003
|
}
|
|
@@ -4088,7 +4079,8 @@ var VALID_CODING_AGENTS = [
|
|
|
4088
4079
|
"gitlab_duo",
|
|
4089
4080
|
"continue",
|
|
4090
4081
|
"opencode",
|
|
4091
|
-
"codex"
|
|
4082
|
+
"codex",
|
|
4083
|
+
"kiro"
|
|
4092
4084
|
];
|
|
4093
4085
|
function isValidCodingAgent(value) {
|
|
4094
4086
|
return VALID_CODING_AGENTS.includes(value);
|
|
@@ -4141,7 +4133,8 @@ var AGENT_CAPABILITIES = {
|
|
|
4141
4133
|
copilot: { skills: true, standards: true, commands: true, recipes: true },
|
|
4142
4134
|
continue: { skills: false, standards: true, commands: true, recipes: true },
|
|
4143
4135
|
junie: { skills: false, standards: true, commands: true, recipes: true },
|
|
4144
|
-
opencode: { skills: true, standards: true, commands: true, recipes: true }
|
|
4136
|
+
opencode: { skills: true, standards: true, commands: true, recipes: true },
|
|
4137
|
+
kiro: { skills: true, standards: true, commands: false, recipes: false }
|
|
4145
4138
|
};
|
|
4146
4139
|
function hasCapableAgent(agents, capability) {
|
|
4147
4140
|
return agents.some((agent) => AGENT_CAPABILITIES[agent][capability]);
|
|
@@ -4164,7 +4157,8 @@ var CodingAgents = {
|
|
|
4164
4157
|
gitlab_duo: "gitlab_duo",
|
|
4165
4158
|
continue: "continue",
|
|
4166
4159
|
opencode: "opencode",
|
|
4167
|
-
codex: "codex"
|
|
4160
|
+
codex: "codex",
|
|
4161
|
+
kiro: "kiro"
|
|
4168
4162
|
};
|
|
4169
4163
|
|
|
4170
4164
|
// packages/types/src/coding-agent/CodingAgentArtefactPaths.ts
|
|
@@ -4213,6 +4207,11 @@ var CODING_AGENT_ARTEFACT_PATHS = {
|
|
|
4213
4207
|
command: "",
|
|
4214
4208
|
standard: "",
|
|
4215
4209
|
skill: ".agents/skills/"
|
|
4210
|
+
},
|
|
4211
|
+
kiro: {
|
|
4212
|
+
command: "",
|
|
4213
|
+
standard: ".kiro/steering/",
|
|
4214
|
+
skill: ".kiro/skills/"
|
|
4216
4215
|
}
|
|
4217
4216
|
};
|
|
4218
4217
|
|
|
@@ -4393,7 +4392,8 @@ var RENDER_MODE_ORDER = [
|
|
|
4393
4392
|
"COPILOT_PLUGIN" /* COPILOT_PLUGIN */,
|
|
4394
4393
|
"CURSOR" /* CURSOR */,
|
|
4395
4394
|
"GITLAB_DUO" /* GITLAB_DUO */,
|
|
4396
|
-
"CONTINUE" /* CONTINUE
|
|
4395
|
+
"CONTINUE" /* CONTINUE */,
|
|
4396
|
+
"KIRO" /* KIRO */
|
|
4397
4397
|
];
|
|
4398
4398
|
var normalizeRenderModes = (modes) => {
|
|
4399
4399
|
const uniqueModes = new Set(modes);
|
|
@@ -4424,7 +4424,8 @@ var RENDER_MODE_TO_CODING_AGENT = {
|
|
|
4424
4424
|
["CURSOR" /* CURSOR */]: CodingAgents.cursor,
|
|
4425
4425
|
["GITLAB_DUO" /* GITLAB_DUO */]: CodingAgents.gitlab_duo,
|
|
4426
4426
|
["CONTINUE" /* CONTINUE */]: CodingAgents.continue,
|
|
4427
|
-
["CODEX" /* CODEX */]: CodingAgents.codex
|
|
4427
|
+
["CODEX" /* CODEX */]: CodingAgents.codex,
|
|
4428
|
+
["KIRO" /* KIRO */]: CodingAgents.kiro
|
|
4428
4429
|
};
|
|
4429
4430
|
var CODING_AGENT_TO_RENDER_MODE = Object.entries(RENDER_MODE_TO_CODING_AGENT).reduce(
|
|
4430
4431
|
(acc, [renderMode, codingAgent]) => {
|
|
@@ -4498,6 +4499,9 @@ var PluginRenderedEvent = class extends UserEvent {
|
|
|
4498
4499
|
}
|
|
4499
4500
|
};
|
|
4500
4501
|
|
|
4502
|
+
// packages/types/src/edition/PackmindEdition.ts
|
|
4503
|
+
var PACKMIND_EDITION_HEADER = "Packmind-Edition";
|
|
4504
|
+
|
|
4501
4505
|
// packages/types/src/git/GitRepoId.ts
|
|
4502
4506
|
var createGitRepoId = brandedIdFactory();
|
|
4503
4507
|
|
|
@@ -5966,7 +5970,45 @@ var path3 = __toESM(require("path"));
|
|
|
5966
5970
|
|
|
5967
5971
|
// apps/cli/src/infra/utils/consoleLogger.ts
|
|
5968
5972
|
init_source();
|
|
5969
|
-
|
|
5973
|
+
|
|
5974
|
+
// apps/cli/src/infra/utils/execName.ts
|
|
5975
|
+
var CANONICAL_EXEC_NAME = "packmind";
|
|
5976
|
+
var LEGACY_EXEC_NAME = "packmind-cli";
|
|
5977
|
+
var KNOWN_EXEC_NAMES = [
|
|
5978
|
+
LEGACY_EXEC_NAME,
|
|
5979
|
+
CANONICAL_EXEC_NAME
|
|
5980
|
+
];
|
|
5981
|
+
var BUNFS_PREFIX = "/$bunfs/";
|
|
5982
|
+
function basenameWithoutExeExtension(candidate) {
|
|
5983
|
+
const basename4 = candidate.split(/[/\\]/).pop() ?? "";
|
|
5984
|
+
return basename4.replace(/\.exe$/i, "");
|
|
5985
|
+
}
|
|
5986
|
+
function matchKnownExecName(candidate) {
|
|
5987
|
+
if (candidate.includes(BUNFS_PREFIX)) {
|
|
5988
|
+
return void 0;
|
|
5989
|
+
}
|
|
5990
|
+
const name = basenameWithoutExeExtension(candidate).toLowerCase();
|
|
5991
|
+
return KNOWN_EXEC_NAMES.find((known) => known === name);
|
|
5992
|
+
}
|
|
5993
|
+
function resolveExecName(argv = process.argv, argv0 = process.argv0) {
|
|
5994
|
+
for (const candidate of [argv0, argv[0], argv[1]]) {
|
|
5995
|
+
if (!candidate) {
|
|
5996
|
+
continue;
|
|
5997
|
+
}
|
|
5998
|
+
const name = matchKnownExecName(candidate);
|
|
5999
|
+
if (name) {
|
|
6000
|
+
return name;
|
|
6001
|
+
}
|
|
6002
|
+
}
|
|
6003
|
+
return CANONICAL_EXEC_NAME;
|
|
6004
|
+
}
|
|
6005
|
+
function isLegacyExecName(argv = process.argv, argv0 = process.argv0) {
|
|
6006
|
+
return resolveExecName(argv, argv0) === LEGACY_EXEC_NAME;
|
|
6007
|
+
}
|
|
6008
|
+
var EXEC_NAME = resolveExecName();
|
|
6009
|
+
|
|
6010
|
+
// apps/cli/src/infra/utils/consoleLogger.ts
|
|
6011
|
+
var CLI_PREFIX = EXEC_NAME;
|
|
5970
6012
|
function logConsole(message, logger2 = console) {
|
|
5971
6013
|
logger2.log(message);
|
|
5972
6014
|
}
|
|
@@ -6870,8 +6912,48 @@ var CommunityEditionError = class extends Error {
|
|
|
6870
6912
|
}
|
|
6871
6913
|
};
|
|
6872
6914
|
function isCommunityEditionError(tbd) {
|
|
6873
|
-
return tbd.isCommunityEditionError;
|
|
6915
|
+
return typeof tbd === "object" && tbd !== null && tbd.isCommunityEditionError === true;
|
|
6916
|
+
}
|
|
6917
|
+
|
|
6918
|
+
// apps/cli/src/infra/http/packmindEdition.ts
|
|
6919
|
+
var KNOWN_EDITIONS = {
|
|
6920
|
+
enterprise: true,
|
|
6921
|
+
community: true
|
|
6922
|
+
};
|
|
6923
|
+
var LEGACY_EDITIONS = {
|
|
6924
|
+
cloud: "enterprise",
|
|
6925
|
+
oss: "community"
|
|
6926
|
+
};
|
|
6927
|
+
function parsePackmindEdition(value) {
|
|
6928
|
+
if (typeof value !== "string") {
|
|
6929
|
+
return null;
|
|
6930
|
+
}
|
|
6931
|
+
if (Object.prototype.hasOwnProperty.call(KNOWN_EDITIONS, value)) {
|
|
6932
|
+
return value;
|
|
6933
|
+
}
|
|
6934
|
+
return Object.prototype.hasOwnProperty.call(LEGACY_EDITIONS, value) ? LEGACY_EDITIONS[value] : null;
|
|
6935
|
+
}
|
|
6936
|
+
function readPackmindEdition(response) {
|
|
6937
|
+
return parsePackmindEdition(response.headers.get(PACKMIND_EDITION_HEADER));
|
|
6938
|
+
}
|
|
6939
|
+
function throwIfFeatureAbsent(response, edition, feature) {
|
|
6940
|
+
if (response.status !== 404) {
|
|
6941
|
+
return;
|
|
6942
|
+
}
|
|
6943
|
+
if (edition === "community") {
|
|
6944
|
+
throw new CommunityEditionError(feature);
|
|
6945
|
+
}
|
|
6946
|
+
if (edition === null) {
|
|
6947
|
+
throw unstatedEditionError(feature);
|
|
6948
|
+
}
|
|
6874
6949
|
}
|
|
6950
|
+
var unstatedEditionError = (feature) => {
|
|
6951
|
+
const error = new Error(
|
|
6952
|
+
`The "${feature}" feature answered 404 and this Packmind server does not state which edition it runs. The feature is not part of Packmind Community Edition; on an Enterprise deployment, check that the space and organization still exist.`
|
|
6953
|
+
);
|
|
6954
|
+
error.statusCode = 404;
|
|
6955
|
+
return error;
|
|
6956
|
+
};
|
|
6875
6957
|
|
|
6876
6958
|
// apps/cli/src/infra/http/PackmindHttpClient.ts
|
|
6877
6959
|
var import_undici = require("undici");
|
|
@@ -6972,7 +7054,7 @@ var PackmindHttpClient = class {
|
|
|
6972
7054
|
});
|
|
6973
7055
|
if (!response.ok) {
|
|
6974
7056
|
if (options.onError) {
|
|
6975
|
-
options.onError(response);
|
|
7057
|
+
options.onError(response, await this.resolveEdition(response));
|
|
6976
7058
|
}
|
|
6977
7059
|
let errorMsg = `API request failed: ${response.status} ${response.statusText}`;
|
|
6978
7060
|
try {
|
|
@@ -7004,6 +7086,43 @@ var PackmindHttpClient = class {
|
|
|
7004
7086
|
);
|
|
7005
7087
|
}
|
|
7006
7088
|
}
|
|
7089
|
+
/**
|
|
7090
|
+
* The edition behind a failed response, for callers whose route means
|
|
7091
|
+
* different things per edition.
|
|
7092
|
+
*
|
|
7093
|
+
* Falls back to /auth/me, which has carried `edition` since well before the
|
|
7094
|
+
* header and answers it even unauthenticated, so a server too old to set the
|
|
7095
|
+
* header can still be identified rather than guessed at. Asked once per
|
|
7096
|
+
* client, and only for a 404 — the one status whose meaning depends on the
|
|
7097
|
+
* edition, and the only reason to spend a request here.
|
|
7098
|
+
*/
|
|
7099
|
+
async resolveEdition(response) {
|
|
7100
|
+
const fromHeader = readPackmindEdition(response);
|
|
7101
|
+
if (fromHeader !== null || response.status !== 404) {
|
|
7102
|
+
return fromHeader;
|
|
7103
|
+
}
|
|
7104
|
+
if (this.editionFromAuthMe === void 0) {
|
|
7105
|
+
this.editionFromAuthMe = await this.fetchEditionFromAuthMe();
|
|
7106
|
+
}
|
|
7107
|
+
return this.editionFromAuthMe;
|
|
7108
|
+
}
|
|
7109
|
+
async fetchEditionFromAuthMe() {
|
|
7110
|
+
try {
|
|
7111
|
+
const { host } = this.getAuthContext();
|
|
7112
|
+
const response = await fetch(`${host}/api/v0/auth/me`, {
|
|
7113
|
+
headers: {
|
|
7114
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
7115
|
+
"User-Agent": `packmind-cli:${import_package.version}`
|
|
7116
|
+
},
|
|
7117
|
+
// @ts-expect-error — Node.js fetch (undici) accepts a dispatcher option not present in the DOM types
|
|
7118
|
+
dispatcher
|
|
7119
|
+
});
|
|
7120
|
+
const body = await response.json();
|
|
7121
|
+
return parsePackmindEdition(body?.edition);
|
|
7122
|
+
} catch {
|
|
7123
|
+
return null;
|
|
7124
|
+
}
|
|
7125
|
+
}
|
|
7007
7126
|
};
|
|
7008
7127
|
|
|
7009
7128
|
// apps/cli/src/infra/repositories/ChangeProposalGateway.ts
|
|
@@ -7017,10 +7136,8 @@ var ChangeProposalGateway = class {
|
|
|
7017
7136
|
{
|
|
7018
7137
|
method: "POST",
|
|
7019
7138
|
body: { proposals: command35.proposals },
|
|
7020
|
-
onError: (response) => {
|
|
7021
|
-
|
|
7022
|
-
throw new CommunityEditionError("change proposals");
|
|
7023
|
-
}
|
|
7139
|
+
onError: (response, edition) => {
|
|
7140
|
+
throwIfFeatureAbsent(response, edition, "change proposals");
|
|
7024
7141
|
}
|
|
7025
7142
|
}
|
|
7026
7143
|
);
|
|
@@ -7048,10 +7165,8 @@ var ChangeProposalGateway = class {
|
|
|
7048
7165
|
{
|
|
7049
7166
|
method: "POST",
|
|
7050
7167
|
body: { proposals: command35.proposals },
|
|
7051
|
-
onError: (response) => {
|
|
7052
|
-
|
|
7053
|
-
throw new CommunityEditionError("change proposals");
|
|
7054
|
-
}
|
|
7168
|
+
onError: (response, edition) => {
|
|
7169
|
+
throwIfFeatureAbsent(response, edition, "change proposals");
|
|
7055
7170
|
}
|
|
7056
7171
|
}
|
|
7057
7172
|
);
|
|
@@ -7074,10 +7189,12 @@ var LinterGateway = class {
|
|
|
7074
7189
|
return this.httpClient.request("/api/v0/list-draft-detection-program", {
|
|
7075
7190
|
method: "POST",
|
|
7076
7191
|
body: payload,
|
|
7077
|
-
onError: (response) => {
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7192
|
+
onError: (response, edition) => {
|
|
7193
|
+
throwIfFeatureAbsent(
|
|
7194
|
+
response,
|
|
7195
|
+
edition,
|
|
7196
|
+
"local linting with packages"
|
|
7197
|
+
);
|
|
7081
7198
|
}
|
|
7082
7199
|
});
|
|
7083
7200
|
};
|
|
@@ -7092,10 +7209,12 @@ var LinterGateway = class {
|
|
|
7092
7209
|
return this.httpClient.request("/api/v0/list-active-detection-program", {
|
|
7093
7210
|
method: "POST",
|
|
7094
7211
|
body: payload,
|
|
7095
|
-
onError: (response) => {
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7212
|
+
onError: (response, edition) => {
|
|
7213
|
+
throwIfFeatureAbsent(
|
|
7214
|
+
response,
|
|
7215
|
+
edition,
|
|
7216
|
+
"local linting with packages"
|
|
7217
|
+
);
|
|
7099
7218
|
}
|
|
7100
7219
|
});
|
|
7101
7220
|
};
|
|
@@ -7107,19 +7226,27 @@ var LinterGateway = class {
|
|
|
7107
7226
|
body: {
|
|
7108
7227
|
packagesSlugs: command35.packagesSlugs
|
|
7109
7228
|
},
|
|
7110
|
-
onError: (response2) => {
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7229
|
+
onError: (response2, edition) => {
|
|
7230
|
+
throwIfFeatureAbsent(
|
|
7231
|
+
response2,
|
|
7232
|
+
edition,
|
|
7233
|
+
"local linting with packages"
|
|
7234
|
+
);
|
|
7114
7235
|
}
|
|
7115
7236
|
}
|
|
7116
7237
|
);
|
|
7117
7238
|
return handleScopeInTargetsResponse(response);
|
|
7118
7239
|
};
|
|
7240
|
+
// The last route on the stubbed linter controller. Both callers discard
|
|
7241
|
+
// whatever this rejects with, so the error only ever has to be the honest
|
|
7242
|
+
// one rather than a 404 dressed up as something else.
|
|
7119
7243
|
this.trackLinterExecution = async (command35) => {
|
|
7120
7244
|
return this.httpClient.request(`/api/v0/track-execution`, {
|
|
7121
7245
|
method: "POST",
|
|
7122
|
-
body: command35
|
|
7246
|
+
body: command35,
|
|
7247
|
+
onError: (response, edition) => {
|
|
7248
|
+
throwIfFeatureAbsent(response, edition, "linter execution tracking");
|
|
7249
|
+
}
|
|
7123
7250
|
});
|
|
7124
7251
|
};
|
|
7125
7252
|
}
|
|
@@ -7152,11 +7279,11 @@ var SpacesGateway = class {
|
|
|
7152
7279
|
);
|
|
7153
7280
|
};
|
|
7154
7281
|
}
|
|
7155
|
-
async getSpaceBySlug(
|
|
7282
|
+
async getSpaceBySlug(slug5) {
|
|
7156
7283
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7157
7284
|
try {
|
|
7158
7285
|
return await this.httpClient.request(
|
|
7159
|
-
`/api/v0/organizations/${organizationId}/spaces/${
|
|
7286
|
+
`/api/v0/organizations/${organizationId}/spaces/${slug5}`
|
|
7160
7287
|
);
|
|
7161
7288
|
} catch (error) {
|
|
7162
7289
|
if (error.statusCode === 404) return null;
|
|
@@ -7289,12 +7416,12 @@ var PackagesGateway = class {
|
|
|
7289
7416
|
);
|
|
7290
7417
|
};
|
|
7291
7418
|
this.getSummary = async ({
|
|
7292
|
-
slug:
|
|
7419
|
+
slug: slug5,
|
|
7293
7420
|
spaceId
|
|
7294
7421
|
}) => {
|
|
7295
7422
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7296
7423
|
return this.httpClient.request(
|
|
7297
|
-
`/api/v0/organizations/${organizationId}/spaces/${spaceId}/packages/summary/${encodeURIComponent(
|
|
7424
|
+
`/api/v0/organizations/${organizationId}/spaces/${spaceId}/packages/summary/${encodeURIComponent(slug5)}`
|
|
7298
7425
|
);
|
|
7299
7426
|
};
|
|
7300
7427
|
this.create = async (command35) => {
|
|
@@ -7330,13 +7457,13 @@ var DeploymentGateway = class {
|
|
|
7330
7457
|
const { organizationId } = this.httpClient.getAuthContext();
|
|
7331
7458
|
const queryParams = new URLSearchParams();
|
|
7332
7459
|
if (command35.packagesSlugs && command35.packagesSlugs.length > 0) {
|
|
7333
|
-
command35.packagesSlugs.forEach((
|
|
7334
|
-
queryParams.append("packageSlug",
|
|
7460
|
+
command35.packagesSlugs.forEach((slug5) => {
|
|
7461
|
+
queryParams.append("packageSlug", slug5);
|
|
7335
7462
|
});
|
|
7336
7463
|
}
|
|
7337
7464
|
if (command35.previousPackagesSlugs && command35.previousPackagesSlugs.length > 0) {
|
|
7338
|
-
command35.previousPackagesSlugs.forEach((
|
|
7339
|
-
queryParams.append("previousPackageSlug",
|
|
7465
|
+
command35.previousPackagesSlugs.forEach((slug5) => {
|
|
7466
|
+
queryParams.append("previousPackageSlug", slug5);
|
|
7340
7467
|
});
|
|
7341
7468
|
}
|
|
7342
7469
|
if (command35.gitRemoteUrl) {
|
|
@@ -7439,7 +7566,8 @@ var DeploymentGateway = class {
|
|
|
7439
7566
|
pluginRoot: command35.pluginRoot,
|
|
7440
7567
|
pluginName: command35.pluginName,
|
|
7441
7568
|
gitRemoteUrl: command35.gitRemoteUrl,
|
|
7442
|
-
gitBranch: command35.gitBranch
|
|
7569
|
+
gitBranch: command35.gitBranch,
|
|
7570
|
+
targetVendor: command35.targetVendor
|
|
7443
7571
|
}
|
|
7444
7572
|
}
|
|
7445
7573
|
);
|
|
@@ -9157,12 +9285,6 @@ var ParserRegistry = class {
|
|
|
9157
9285
|
this.parsers.set(language, parser);
|
|
9158
9286
|
return parser;
|
|
9159
9287
|
}
|
|
9160
|
-
getAvailableParsers() {
|
|
9161
|
-
return Object.keys(this.parserClasses);
|
|
9162
|
-
}
|
|
9163
|
-
clearCache() {
|
|
9164
|
-
this.parsers.clear();
|
|
9165
|
-
}
|
|
9166
9288
|
};
|
|
9167
9289
|
|
|
9168
9290
|
// packages/linter-ast/src/application/ConsoleLogRemovalService.ts
|
|
@@ -9180,7 +9302,7 @@ var ConsoleLogRemovalService = class {
|
|
|
9180
9302
|
async removeConsoleLogStatements(sourceCode, language) {
|
|
9181
9303
|
if (language !== "JAVASCRIPT" /* JAVASCRIPT */) {
|
|
9182
9304
|
throw new Error(
|
|
9183
|
-
`
|
|
9305
|
+
`ConsoleLogRemovalService only supports JAVASCRIPT, received: ${language}`
|
|
9184
9306
|
);
|
|
9185
9307
|
}
|
|
9186
9308
|
try {
|
|
@@ -9300,9 +9422,6 @@ var LinterAstAdapter = class {
|
|
|
9300
9422
|
}
|
|
9301
9423
|
};
|
|
9302
9424
|
|
|
9303
|
-
// packages/linter-ast/src/parsers/TypeScriptTSXParser.ts
|
|
9304
|
-
var TreeSitter17 = __toESM(require("web-tree-sitter"));
|
|
9305
|
-
|
|
9306
9425
|
// packages/linter-execution/src/application/useCases/ExecuteLinterProgramsUseCase.ts
|
|
9307
9426
|
var origin4 = "ExecuteLinterProgramsUseCase";
|
|
9308
9427
|
var ExecuteLinterProgramsUseCase = class {
|
|
@@ -9685,10 +9804,6 @@ var Configuration = class _Configuration {
|
|
|
9685
9804
|
this.initialized = true;
|
|
9686
9805
|
this.logger.info("Configuration initialization completed");
|
|
9687
9806
|
}
|
|
9688
|
-
static async getConfigWithDefault(key, defaultValue) {
|
|
9689
|
-
const value = await _Configuration.getConfig(key);
|
|
9690
|
-
return value ?? defaultValue;
|
|
9691
|
-
}
|
|
9692
9807
|
static async getConfig(key, env2 = process.env, logger2) {
|
|
9693
9808
|
const instance = _Configuration.getInstance(logger2);
|
|
9694
9809
|
instance.logger.info("Getting configuration value", { key });
|
|
@@ -9745,11 +9860,6 @@ var Cache = class _Cache {
|
|
|
9745
9860
|
)) {
|
|
9746
9861
|
this.logger = logger2;
|
|
9747
9862
|
this.initialized = false;
|
|
9748
|
-
this.connectionConfig = {
|
|
9749
|
-
host: "redis",
|
|
9750
|
-
port: 6379,
|
|
9751
|
-
maxRetriesPerRequest: 3
|
|
9752
|
-
};
|
|
9753
9863
|
}
|
|
9754
9864
|
static {
|
|
9755
9865
|
// Default cache expiration time in seconds (5 minutes)
|
|
@@ -9896,15 +10006,6 @@ var Cache = class _Cache {
|
|
|
9896
10006
|
}
|
|
9897
10007
|
this.initialized = false;
|
|
9898
10008
|
}
|
|
9899
|
-
/**
|
|
9900
|
-
* Get cache statistics (for monitoring/debugging)
|
|
9901
|
-
*/
|
|
9902
|
-
async getStats() {
|
|
9903
|
-
return {
|
|
9904
|
-
connected: this.client?.status === "ready",
|
|
9905
|
-
initialized: this.initialized
|
|
9906
|
-
};
|
|
9907
|
-
}
|
|
9908
10009
|
};
|
|
9909
10010
|
|
|
9910
10011
|
// packages/feature-flags/src/registry.ts
|
|
@@ -9962,6 +10063,15 @@ var import_bullmq = require("bullmq");
|
|
|
9962
10063
|
// packages/node-utils/src/jobs/infra/DelayedJobsFactory.ts
|
|
9963
10064
|
var logger = new PackmindLogger("DelayedJobsFactory");
|
|
9964
10065
|
|
|
10066
|
+
// packages/node-utils/src/observability/withSpan.ts
|
|
10067
|
+
var import_api = require("@opentelemetry/api");
|
|
10068
|
+
var tracer = import_api.trace.getTracer("packmind");
|
|
10069
|
+
|
|
10070
|
+
// packages/node-utils/src/observability/instrumentMethods.ts
|
|
10071
|
+
var AsyncFunction = (async () => {
|
|
10072
|
+
}).constructor;
|
|
10073
|
+
var enabled = process.env["PACKMIND_OTEL_INSTRUMENT_METHODS"] !== "false";
|
|
10074
|
+
|
|
9965
10075
|
// packages/node-utils/src/mail/SmtpMailService.ts
|
|
9966
10076
|
var import_nodemailer = __toESM(require("nodemailer"));
|
|
9967
10077
|
|
|
@@ -9969,6 +10079,7 @@ var import_nodemailer = __toESM(require("nodemailer"));
|
|
|
9969
10079
|
var import_common = require("@nestjs/common");
|
|
9970
10080
|
|
|
9971
10081
|
// packages/node-utils/src/repositories/AbstractRepository.ts
|
|
10082
|
+
var import_typeorm2 = require("typeorm");
|
|
9972
10083
|
var import_common2 = require("@nestjs/common");
|
|
9973
10084
|
|
|
9974
10085
|
// packages/node-utils/src/sse/RedisSSEClient.ts
|
|
@@ -10461,7 +10572,7 @@ async function normalizePackageSlugs(slugs, spaceService) {
|
|
|
10461
10572
|
}
|
|
10462
10573
|
const defaultSpace = await spaceService.getDefaultSpace();
|
|
10463
10574
|
return slugs.map(
|
|
10464
|
-
(
|
|
10575
|
+
(slug5) => slug5.startsWith("@") ? slug5 : `@${defaultSpace.slug}/${slug5}`
|
|
10465
10576
|
);
|
|
10466
10577
|
}
|
|
10467
10578
|
|
|
@@ -10512,8 +10623,8 @@ function isFullParsedPackageSlug(tbd) {
|
|
|
10512
10623
|
const asFullParsedPackageSlug = tbd;
|
|
10513
10624
|
return asFullParsedPackageSlug.spaceSlug !== void 0 && asFullParsedPackageSlug.packageSlug !== void 0;
|
|
10514
10625
|
}
|
|
10515
|
-
function parsePackageSlug(
|
|
10516
|
-
const slugs =
|
|
10626
|
+
function parsePackageSlug(slug5) {
|
|
10627
|
+
const slugs = slug5.split("/");
|
|
10517
10628
|
if (slugs.length === 1) {
|
|
10518
10629
|
return { packageSlug: slugs[0] };
|
|
10519
10630
|
}
|
|
@@ -10585,7 +10696,7 @@ var InstallUseCase = class {
|
|
|
10585
10696
|
);
|
|
10586
10697
|
}
|
|
10587
10698
|
throw new Error(
|
|
10588
|
-
|
|
10699
|
+
`No packmind.json found in this directory. Run \`${EXEC_NAME} install <@space/package>\` first to install your packages.`
|
|
10589
10700
|
);
|
|
10590
10701
|
}
|
|
10591
10702
|
const effectiveLockFile = lockFile ?? {
|
|
@@ -10789,7 +10900,7 @@ var InstallUseCase = class {
|
|
|
10789
10900
|
const configAfter = await this.configFileRepository.readConfig(baseDirectory);
|
|
10790
10901
|
const slugsAfter = new Set(Object.keys(configAfter?.packages ?? {}));
|
|
10791
10902
|
result.packagesAdded = [...slugsAfter].filter(
|
|
10792
|
-
(
|
|
10903
|
+
(slug5) => !slugsBefore.has(slug5)
|
|
10793
10904
|
);
|
|
10794
10905
|
result.configCreated = !configExistedBefore && slugsAfter.size > 0;
|
|
10795
10906
|
}
|
|
@@ -10829,7 +10940,7 @@ var InstallUseCase = class {
|
|
|
10829
10940
|
if (originalSlugs.length === 0) return [];
|
|
10830
10941
|
const normalizedSlugs = await this.normalizePackageSlugs(originalSlugs);
|
|
10831
10942
|
const hasChanges = normalizedSlugs.some(
|
|
10832
|
-
(
|
|
10943
|
+
(slug5, i) => slug5 !== originalSlugs[i]
|
|
10833
10944
|
);
|
|
10834
10945
|
if (hasChanges) {
|
|
10835
10946
|
const normalizedPackagesMap = {};
|
|
@@ -10869,9 +10980,9 @@ var InstallUseCase = class {
|
|
|
10869
10980
|
}
|
|
10870
10981
|
async computeJoinSpaceUrl(missingAccessSlugs) {
|
|
10871
10982
|
const spaceSlugs = /* @__PURE__ */ new Set();
|
|
10872
|
-
for (const
|
|
10873
|
-
if (
|
|
10874
|
-
const spaceSlug2 =
|
|
10983
|
+
for (const slug5 of missingAccessSlugs) {
|
|
10984
|
+
if (slug5.startsWith("@")) {
|
|
10985
|
+
const spaceSlug2 = slug5.slice(1).split("/")[0];
|
|
10875
10986
|
spaceSlugs.add(spaceSlug2);
|
|
10876
10987
|
}
|
|
10877
10988
|
}
|
|
@@ -11125,7 +11236,7 @@ var UninstallUseCase = class {
|
|
|
11125
11236
|
);
|
|
11126
11237
|
}
|
|
11127
11238
|
throw new Error(
|
|
11128
|
-
|
|
11239
|
+
`No packmind.json found in this directory. Run \`${EXEC_NAME} install <@space/package>\` first to install your packages.`
|
|
11129
11240
|
);
|
|
11130
11241
|
}
|
|
11131
11242
|
const normalized = await normalizePackageSlugs(
|
|
@@ -11179,7 +11290,7 @@ function stripPrerelease(version2) {
|
|
|
11179
11290
|
var SkillsInitBootstrapError = class extends Error {
|
|
11180
11291
|
constructor() {
|
|
11181
11292
|
super(
|
|
11182
|
-
|
|
11293
|
+
`Couldn't determine your organization's coding agents. Run \`${EXEC_NAME} init\` to configure them interactively.`
|
|
11183
11294
|
);
|
|
11184
11295
|
this.isSkillsInitBootstrapError = true;
|
|
11185
11296
|
this.name = "SkillsInitBootstrapError";
|
|
@@ -11666,12 +11777,6 @@ var CredentialsService = class {
|
|
|
11666
11777
|
const credentials = this.loadCredentials();
|
|
11667
11778
|
return credentials?.apiKey ?? "";
|
|
11668
11779
|
}
|
|
11669
|
-
/**
|
|
11670
|
-
* Checks if any provider has credentials available
|
|
11671
|
-
*/
|
|
11672
|
-
hasCredentials() {
|
|
11673
|
-
return this.providers.some((provider) => provider.hasCredentials());
|
|
11674
|
-
}
|
|
11675
11780
|
};
|
|
11676
11781
|
var defaultCredentialsService = new CredentialsService();
|
|
11677
11782
|
function loadApiKey() {
|
|
@@ -11887,6 +11992,7 @@ var import_stream = require("stream");
|
|
|
11887
11992
|
var import_semver3 = __toESM(require("semver"));
|
|
11888
11993
|
var GITHUB_REPO = "PackmindHub/packmind";
|
|
11889
11994
|
var NPM_PACKAGE = "@packmind/cli";
|
|
11995
|
+
var RELEASE_ASSET_BASENAME = "packmind-cli";
|
|
11890
11996
|
function getPlatformAssetSuffix(platform, arch) {
|
|
11891
11997
|
const osMap = {
|
|
11892
11998
|
linux: "linux",
|
|
@@ -11898,8 +12004,12 @@ function getPlatformAssetSuffix(platform, arch) {
|
|
|
11898
12004
|
throw new Error(`Unsupported platform: ${platform}`);
|
|
11899
12005
|
}
|
|
11900
12006
|
const archName = platform === "darwin" && arch === "x64" ? "x64-baseline" : arch;
|
|
12007
|
+
return `${osName}-${archName}`;
|
|
12008
|
+
}
|
|
12009
|
+
function getReleaseAssetName(platform, arch, version2) {
|
|
12010
|
+
const platformSuffix = getPlatformAssetSuffix(platform, arch);
|
|
11901
12011
|
const ext = platform === "win32" ? ".exe" : "";
|
|
11902
|
-
return `${
|
|
12012
|
+
return `${RELEASE_ASSET_BASENAME}-${platformSuffix}-${version2}${ext}`;
|
|
11903
12013
|
}
|
|
11904
12014
|
async function fetchLatestVersionFromNpm(fetchFn) {
|
|
11905
12015
|
const res = await fetchFn(`https://registry.npmjs.org/${NPM_PACKAGE}/latest`);
|
|
@@ -11933,8 +12043,7 @@ async function fetchLatestVersionFromGitHub(fetchFn) {
|
|
|
11933
12043
|
}
|
|
11934
12044
|
return cliReleases[0].version;
|
|
11935
12045
|
}
|
|
11936
|
-
async function downloadExecutable(fetchFn, version2,
|
|
11937
|
-
const assetName = `packmind-cli-${platformSuffix}-${version2}`;
|
|
12046
|
+
async function downloadExecutable(fetchFn, version2, assetName, targetPath) {
|
|
11938
12047
|
const url = `https://github.com/${GITHUB_REPO}/releases/download/release-cli/${version2}/${assetName}`;
|
|
11939
12048
|
logInfoConsole(`Downloading ${assetName}...`);
|
|
11940
12049
|
const res = await fetchFn(url, { redirect: "follow" });
|
|
@@ -11961,27 +12070,62 @@ URL: ${url}`
|
|
|
11961
12070
|
`Downloaded successfully (${(stats.size / 1048576).toFixed(1)} MB)`
|
|
11962
12071
|
);
|
|
11963
12072
|
}
|
|
11964
|
-
function
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
const
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
12073
|
+
function basenameOf(candidate) {
|
|
12074
|
+
return candidate.split(/[/\\]/).pop() ?? "";
|
|
12075
|
+
}
|
|
12076
|
+
function isManagedExecFileName(executablePath) {
|
|
12077
|
+
const basename4 = basenameOf(executablePath).replace(/\.exe$/i, "");
|
|
12078
|
+
return basename4 === CANONICAL_EXEC_NAME || basename4 === LEGACY_EXEC_NAME;
|
|
12079
|
+
}
|
|
12080
|
+
function resolveUpdateTargetPath(executablePath, platform) {
|
|
12081
|
+
if (!isManagedExecFileName(executablePath)) {
|
|
12082
|
+
return executablePath;
|
|
11972
12083
|
}
|
|
11973
|
-
const
|
|
11974
|
-
|
|
11975
|
-
|
|
12084
|
+
const ext = platform === "win32" ? ".exe" : "";
|
|
12085
|
+
return import_path2.default.join(
|
|
12086
|
+
import_path2.default.dirname(executablePath),
|
|
12087
|
+
`${CANONICAL_EXEC_NAME}${ext}`
|
|
12088
|
+
);
|
|
12089
|
+
}
|
|
12090
|
+
function unlinkIfSymlink(targetPath) {
|
|
11976
12091
|
try {
|
|
11977
|
-
(0, import_fs19.
|
|
12092
|
+
if ((0, import_fs19.lstatSync)(targetPath).isSymbolicLink()) {
|
|
12093
|
+
(0, import_fs19.unlinkSync)(targetPath);
|
|
12094
|
+
}
|
|
11978
12095
|
} catch {
|
|
11979
12096
|
}
|
|
11980
|
-
|
|
11981
|
-
|
|
12097
|
+
}
|
|
12098
|
+
function createLegacyExecAlias(canonicalPath, platform, runningExecutablePath) {
|
|
12099
|
+
const dir = import_path2.default.dirname(canonicalPath);
|
|
12100
|
+
const ext = platform === "win32" ? ".exe" : "";
|
|
12101
|
+
const canonicalName = `${CANONICAL_EXEC_NAME}${ext}`;
|
|
12102
|
+
const legacyName = `${LEGACY_EXEC_NAME}${ext}`;
|
|
12103
|
+
const legacyPath = import_path2.default.join(dir, legacyName);
|
|
12104
|
+
if (platform === "win32" && runningExecutablePath && basenameOf(runningExecutablePath).toLowerCase() === legacyName.toLowerCase()) {
|
|
11982
12105
|
logInfoConsole(
|
|
11983
|
-
`
|
|
12106
|
+
`Kept ${legacyPath} as-is: Windows cannot replace a running executable.
|
|
12107
|
+
Re-run the installer, or delete ${legacyName} manually, to finish switching to ${canonicalName}.`
|
|
11984
12108
|
);
|
|
12109
|
+
return false;
|
|
12110
|
+
}
|
|
12111
|
+
const stagedPath = `${legacyPath}.new-alias`;
|
|
12112
|
+
try {
|
|
12113
|
+
removeIfPresent(stagedPath);
|
|
12114
|
+
(0, import_fs19.symlinkSync)(canonicalName, stagedPath);
|
|
12115
|
+
(0, import_fs19.renameSync)(stagedPath, legacyPath);
|
|
12116
|
+
logInfoConsole(`Created legacy alias: ${legacyPath} -> ${canonicalName}`);
|
|
12117
|
+
return true;
|
|
12118
|
+
} catch {
|
|
12119
|
+
removeIfPresent(stagedPath);
|
|
12120
|
+
logWarningConsole(
|
|
12121
|
+
`Could not create legacy alias: ${legacyPath} -> ${canonicalName} (non-critical)`
|
|
12122
|
+
);
|
|
12123
|
+
return false;
|
|
12124
|
+
}
|
|
12125
|
+
}
|
|
12126
|
+
function removeIfPresent(targetPath) {
|
|
12127
|
+
try {
|
|
12128
|
+
(0, import_fs19.unlinkSync)(targetPath);
|
|
11985
12129
|
} catch {
|
|
11986
12130
|
}
|
|
11987
12131
|
}
|
|
@@ -11991,17 +12135,48 @@ function updateViaNpm(version2) {
|
|
|
11991
12135
|
stdio: "inherit"
|
|
11992
12136
|
});
|
|
11993
12137
|
}
|
|
12138
|
+
function checkTargetBeforeReplacing(targetPath, executablePath) {
|
|
12139
|
+
if (targetPath === executablePath) {
|
|
12140
|
+
return;
|
|
12141
|
+
}
|
|
12142
|
+
let entry;
|
|
12143
|
+
try {
|
|
12144
|
+
entry = (0, import_fs19.lstatSync)(targetPath);
|
|
12145
|
+
} catch {
|
|
12146
|
+
return;
|
|
12147
|
+
}
|
|
12148
|
+
if (entry.isSymbolicLink()) {
|
|
12149
|
+
return;
|
|
12150
|
+
}
|
|
12151
|
+
if (!entry.isFile()) {
|
|
12152
|
+
throw new Error(
|
|
12153
|
+
`Cannot install at ${targetPath}: it already exists and is not a file.`
|
|
12154
|
+
);
|
|
12155
|
+
}
|
|
12156
|
+
logWarningConsole(`Replacing the existing file at ${targetPath}`);
|
|
12157
|
+
}
|
|
11994
12158
|
async function updateViaExecutableReplace(deps, version2) {
|
|
11995
|
-
const
|
|
11996
|
-
const
|
|
11997
|
-
|
|
12159
|
+
const assetName = getReleaseAssetName(deps.platform, deps.arch, version2);
|
|
12160
|
+
const targetPath = resolveUpdateTargetPath(
|
|
12161
|
+
deps.executablePath,
|
|
12162
|
+
deps.platform
|
|
12163
|
+
);
|
|
12164
|
+
const tempPath = targetPath + ".update-tmp";
|
|
11998
12165
|
try {
|
|
11999
|
-
|
|
12000
|
-
(
|
|
12166
|
+
checkTargetBeforeReplacing(targetPath, deps.executablePath);
|
|
12167
|
+
await downloadExecutable(deps.fetchFn, version2, assetName, tempPath);
|
|
12168
|
+
unlinkIfSymlink(targetPath);
|
|
12169
|
+
(0, import_fs19.renameSync)(tempPath, targetPath);
|
|
12001
12170
|
if (deps.platform !== "win32") {
|
|
12002
|
-
(0, import_fs19.chmodSync)(
|
|
12171
|
+
(0, import_fs19.chmodSync)(targetPath, 493);
|
|
12003
12172
|
}
|
|
12004
|
-
|
|
12173
|
+
const aliasCreated = isManagedExecFileName(deps.executablePath) && createLegacyExecAlias(targetPath, deps.platform, deps.executablePath);
|
|
12174
|
+
const legacyName = `${LEGACY_EXEC_NAME}${deps.platform === "win32" ? ".exe" : ""}`;
|
|
12175
|
+
const invokedIsLegacyName = basenameOf(deps.executablePath).toLowerCase() === legacyName.toLowerCase();
|
|
12176
|
+
return {
|
|
12177
|
+
targetPath,
|
|
12178
|
+
invokedExecutableUpdated: targetPath === deps.executablePath || aliasCreated && invokedIsLegacyName
|
|
12179
|
+
};
|
|
12005
12180
|
} catch (error) {
|
|
12006
12181
|
try {
|
|
12007
12182
|
(0, import_fs19.unlinkSync)(tempPath);
|
|
@@ -12022,6 +12197,21 @@ function isHomebrewInstall(executablePath) {
|
|
|
12022
12197
|
return false;
|
|
12023
12198
|
}
|
|
12024
12199
|
}
|
|
12200
|
+
function resolveUpdateFailureMessage(message, platform) {
|
|
12201
|
+
if (platform === "win32") {
|
|
12202
|
+
const isReplaceBlocked = message.includes("EPERM") || message.includes("EBUSY") || message.includes("EACCES") || message.includes("permission denied");
|
|
12203
|
+
if (!isReplaceBlocked) {
|
|
12204
|
+
return `Update failed: ${message}`;
|
|
12205
|
+
}
|
|
12206
|
+
return `Update failed: ${message}
|
|
12207
|
+
Could not replace the executable. Close any other running ${CANONICAL_EXEC_NAME} process, then re-run '${EXEC_NAME} update' from an Administrator terminal.`;
|
|
12208
|
+
}
|
|
12209
|
+
if (message.includes("EACCES") || message.includes("permission denied")) {
|
|
12210
|
+
return `Permission denied. Try running with sudo:
|
|
12211
|
+
sudo ${EXEC_NAME} update`;
|
|
12212
|
+
}
|
|
12213
|
+
return `Update failed: ${message}`;
|
|
12214
|
+
}
|
|
12025
12215
|
async function updateHandler(deps) {
|
|
12026
12216
|
const execBasename = import_path2.default.basename(deps.executablePath).replace(/\.exe$/, "");
|
|
12027
12217
|
const jsRuntimes = ["node", "bun", "deno"];
|
|
@@ -12048,6 +12238,11 @@ async function updateHandler(deps) {
|
|
|
12048
12238
|
logInfoConsole(
|
|
12049
12239
|
`Current version: ${deps.currentVersion} (${deps.isExecutableMode ? "standalone executable" : "npm package"})`
|
|
12050
12240
|
);
|
|
12241
|
+
if (isLegacyExecName()) {
|
|
12242
|
+
logInfoConsole(
|
|
12243
|
+
`The '${CANONICAL_EXEC_NAME}' executable is the one being updated; '${LEGACY_EXEC_NAME}' points to it.`
|
|
12244
|
+
);
|
|
12245
|
+
}
|
|
12051
12246
|
let latestVersion;
|
|
12052
12247
|
try {
|
|
12053
12248
|
latestVersion = deps.isExecutableMode ? await fetchLatestVersionFromGitHub(deps.fetchFn) : await fetchLatestVersionFromNpm(deps.fetchFn);
|
|
@@ -12071,26 +12266,29 @@ async function updateHandler(deps) {
|
|
|
12071
12266
|
return;
|
|
12072
12267
|
}
|
|
12073
12268
|
try {
|
|
12074
|
-
if (deps.isExecutableMode) {
|
|
12075
|
-
await updateViaExecutableReplace(deps, latestVersion);
|
|
12076
|
-
} else {
|
|
12269
|
+
if (!deps.isExecutableMode) {
|
|
12077
12270
|
updateViaNpm(latestVersion);
|
|
12271
|
+
logConsole("");
|
|
12272
|
+
logSuccessConsole(`Updated to v${latestVersion}`);
|
|
12273
|
+
return;
|
|
12078
12274
|
}
|
|
12275
|
+
const outcome = await updateViaExecutableReplace(deps, latestVersion);
|
|
12079
12276
|
logConsole("");
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
|
|
12277
|
+
if (outcome.invokedExecutableUpdated) {
|
|
12278
|
+
logSuccessConsole(`Updated to v${latestVersion}`);
|
|
12279
|
+
} else {
|
|
12280
|
+
const invokedName = basenameOf(deps.executablePath);
|
|
12281
|
+
const targetName = basenameOf(outcome.targetPath);
|
|
12282
|
+
logSuccessConsole(`Updated ${targetName} to v${latestVersion}`);
|
|
12283
|
+
logWarningConsole(
|
|
12284
|
+
`${invokedName} was NOT updated and still runs v${deps.currentVersion}.
|
|
12285
|
+
Run '${CANONICAL_EXEC_NAME}' from now on, or re-run the installer to replace ${invokedName}.`
|
|
12286
|
+
);
|
|
12083
12287
|
}
|
|
12288
|
+
logInfoConsole(`Binary location: ${outcome.targetPath}`);
|
|
12084
12289
|
} catch (error) {
|
|
12085
12290
|
const message = error instanceof Error ? error.message : String(error);
|
|
12086
|
-
|
|
12087
|
-
logErrorConsole(
|
|
12088
|
-
`Permission denied. Try running with sudo:
|
|
12089
|
-
sudo packmind-cli update`
|
|
12090
|
-
);
|
|
12091
|
-
} else {
|
|
12092
|
-
logErrorConsole(`Update failed: ${message}`);
|
|
12093
|
-
}
|
|
12291
|
+
logErrorConsole(resolveUpdateFailureMessage(message, deps.platform));
|
|
12094
12292
|
process.exit(1);
|
|
12095
12293
|
}
|
|
12096
12294
|
}
|
|
@@ -12260,7 +12458,7 @@ var ConfigFileRepository = class {
|
|
|
12260
12458
|
);
|
|
12261
12459
|
if (invalidAgents.length > 0) {
|
|
12262
12460
|
logWarningConsole(
|
|
12263
|
-
`Invalid agent(s) in ${configPath}: ${invalidAgents.join(", ")}. Valid agents are:
|
|
12461
|
+
`Invalid agent(s) in ${configPath}: ${invalidAgents.join(", ")}. Valid agents are: ${VALID_CODING_AGENTS.join(", ")}`
|
|
12264
12462
|
);
|
|
12265
12463
|
}
|
|
12266
12464
|
const config = {
|
|
@@ -12359,9 +12557,9 @@ var ConfigFileRepository = class {
|
|
|
12359
12557
|
}
|
|
12360
12558
|
const mergedPackages = {};
|
|
12361
12559
|
for (const config of configs) {
|
|
12362
|
-
for (const [
|
|
12363
|
-
if (!(
|
|
12364
|
-
mergedPackages[
|
|
12560
|
+
for (const [slug5, version2] of Object.entries(config.packages)) {
|
|
12561
|
+
if (!(slug5 in mergedPackages)) {
|
|
12562
|
+
mergedPackages[slug5] = version2;
|
|
12365
12563
|
}
|
|
12366
12564
|
}
|
|
12367
12565
|
}
|
|
@@ -12475,9 +12673,9 @@ var ConfigFileRepository = class {
|
|
|
12475
12673
|
parsed.packages = {};
|
|
12476
12674
|
}
|
|
12477
12675
|
const packages = parsed.packages;
|
|
12478
|
-
for (const
|
|
12479
|
-
if (!(
|
|
12480
|
-
packages[
|
|
12676
|
+
for (const slug5 of newPackageSlugs) {
|
|
12677
|
+
if (!(slug5 in packages)) {
|
|
12678
|
+
packages[slug5] = "*";
|
|
12481
12679
|
}
|
|
12482
12680
|
}
|
|
12483
12681
|
await this.writeConfigToPath(configPath, parsed);
|
|
@@ -12544,8 +12742,8 @@ var ConfigFileRepository = class {
|
|
|
12544
12742
|
}
|
|
12545
12743
|
createConfigWithPackages(slugs) {
|
|
12546
12744
|
const packages = {};
|
|
12547
|
-
for (const
|
|
12548
|
-
packages[
|
|
12745
|
+
for (const slug5 of slugs) {
|
|
12746
|
+
packages[slug5] = "*";
|
|
12549
12747
|
}
|
|
12550
12748
|
return { packages };
|
|
12551
12749
|
}
|
|
@@ -13443,6 +13641,10 @@ var DEPLOYER_PARSERS = [
|
|
|
13443
13641
|
parse: parseContinueStandard
|
|
13444
13642
|
},
|
|
13445
13643
|
{ pattern: ".github/instructions/packmind-", parse: parseCopilotStandard },
|
|
13644
|
+
{
|
|
13645
|
+
pattern: ".kiro/steering/packmind-standard-",
|
|
13646
|
+
parse: parseKiroStandard
|
|
13647
|
+
},
|
|
13446
13648
|
// Home-install variant (e.g. `~/.claude`): the agent directory prefix is
|
|
13447
13649
|
// stripped from on-disk and lockfile paths. Only Claude supports home-install
|
|
13448
13650
|
// today, so an unprefixed `rules/packmind/standard-…` path is Claude-rendered.
|
|
@@ -13469,8 +13671,9 @@ var AGENT_PARSERS = {
|
|
|
13469
13671
|
// single-file agent: standards can't be parsed individually
|
|
13470
13672
|
opencode: () => null,
|
|
13471
13673
|
// single-file agent: standards are embedded in AGENTS.md
|
|
13472
|
-
codex: () => null
|
|
13674
|
+
codex: () => null,
|
|
13473
13675
|
// single-file agent: standards are embedded in AGENTS.md
|
|
13676
|
+
kiro: parseKiroStandard
|
|
13474
13677
|
};
|
|
13475
13678
|
function parseStandardMdForAgent(content, agent) {
|
|
13476
13679
|
return AGENT_PARSERS[agent](content);
|
|
@@ -13552,6 +13755,11 @@ function parseContinueStandard(content) {
|
|
|
13552
13755
|
if (!parsed) return null;
|
|
13553
13756
|
return addFrontmatterFields(parsed, frontmatter);
|
|
13554
13757
|
}
|
|
13758
|
+
function parseKiroStandard(content) {
|
|
13759
|
+
const { frontmatter, body } = extractFrontmatter(content);
|
|
13760
|
+
const scope = extractScopeFromKey(frontmatter, "fileMatchPattern");
|
|
13761
|
+
return parseIdeStandardBody(body, scope);
|
|
13762
|
+
}
|
|
13555
13763
|
function parseCopilotStandard(content) {
|
|
13556
13764
|
const { frontmatter, body } = extractFrontmatter(content);
|
|
13557
13765
|
const rawScope = extractFrontmatterValue(frontmatter, "applyTo");
|
|
@@ -13698,11 +13906,36 @@ function normalizeScopeValue(rawValue) {
|
|
|
13698
13906
|
if (!rawValue) return "";
|
|
13699
13907
|
if (rawValue.startsWith("[")) {
|
|
13700
13908
|
const inner = rawValue.slice(1, -1);
|
|
13701
|
-
const items = inner
|
|
13909
|
+
const items = splitOutsideBraces(inner).map(
|
|
13910
|
+
(item) => item.replace(/(?:^["'])|(?:["']$)/g, "")
|
|
13911
|
+
);
|
|
13702
13912
|
return items.join(", ");
|
|
13703
13913
|
}
|
|
13704
13914
|
return rawValue.replace(/(?:^["'])|(?:["']$)/g, "");
|
|
13705
13915
|
}
|
|
13916
|
+
function splitOutsideBraces(value) {
|
|
13917
|
+
const items = [];
|
|
13918
|
+
let current = "";
|
|
13919
|
+
let braceDepth = 0;
|
|
13920
|
+
for (const char of value) {
|
|
13921
|
+
if (char === "{") {
|
|
13922
|
+
braceDepth++;
|
|
13923
|
+
current += char;
|
|
13924
|
+
} else if (char === "}") {
|
|
13925
|
+
braceDepth--;
|
|
13926
|
+
current += char;
|
|
13927
|
+
} else if (char === "," && braceDepth === 0) {
|
|
13928
|
+
const trimmed2 = current.trim();
|
|
13929
|
+
if (trimmed2) items.push(trimmed2);
|
|
13930
|
+
current = "";
|
|
13931
|
+
} else {
|
|
13932
|
+
current += char;
|
|
13933
|
+
}
|
|
13934
|
+
}
|
|
13935
|
+
const trimmed = current.trim();
|
|
13936
|
+
if (trimmed) items.push(trimmed);
|
|
13937
|
+
return items;
|
|
13938
|
+
}
|
|
13706
13939
|
|
|
13707
13940
|
// apps/cli/src/application/utils/ruleSimilarity.ts
|
|
13708
13941
|
var DEFAULT_SIMILARITY_THRESHOLD = 0.5;
|
|
@@ -14141,8 +14374,8 @@ var SpaceService = class {
|
|
|
14141
14374
|
}
|
|
14142
14375
|
return defaultSpace;
|
|
14143
14376
|
}
|
|
14144
|
-
async getSpaceBySlug(
|
|
14145
|
-
return this.spaceGateway.getSpaceBySlug(
|
|
14377
|
+
async getSpaceBySlug(slug5) {
|
|
14378
|
+
return this.spaceGateway.getSpaceBySlug(slug5);
|
|
14146
14379
|
}
|
|
14147
14380
|
getApiContext() {
|
|
14148
14381
|
return this.spaceGateway.getApiContext();
|
|
@@ -14152,7 +14385,7 @@ var SpaceService = class {
|
|
|
14152
14385
|
// apps/cli/src/infra/repositories/CliOutput.ts
|
|
14153
14386
|
init_source();
|
|
14154
14387
|
var import_log_update = __toESM(require("log-update"));
|
|
14155
|
-
var CLI_PREFIX2 =
|
|
14388
|
+
var CLI_PREFIX2 = EXEC_NAME;
|
|
14156
14389
|
var CliFormatter = class {
|
|
14157
14390
|
static success(message) {
|
|
14158
14391
|
return `${source_default.bgGreen.bold(CLI_PREFIX2)} ${source_default.green.bold(message)}`;
|
|
@@ -14178,9 +14411,6 @@ var CliFormatter = class {
|
|
|
14178
14411
|
static subHeader(title) {
|
|
14179
14412
|
return source_default.bold(title);
|
|
14180
14413
|
}
|
|
14181
|
-
static slug(slug6) {
|
|
14182
|
-
return source_default.blue.bold(slug6);
|
|
14183
|
-
}
|
|
14184
14414
|
static label(label) {
|
|
14185
14415
|
return source_default.dim(label);
|
|
14186
14416
|
}
|
|
@@ -14602,31 +14832,15 @@ var PackmindCliHexa = class {
|
|
|
14602
14832
|
throw error;
|
|
14603
14833
|
}
|
|
14604
14834
|
}
|
|
14605
|
-
/**
|
|
14606
|
-
* Destroys the DeploymentsHexa and cleans up resources
|
|
14607
|
-
*/
|
|
14608
|
-
destroy() {
|
|
14609
|
-
this.logger.info("Destroying PackmindCliHexa");
|
|
14610
|
-
this.logger.info("PackmindCliHexa destroyed");
|
|
14611
|
-
}
|
|
14612
14835
|
get output() {
|
|
14613
14836
|
return this.hexa.repositories.output;
|
|
14614
14837
|
}
|
|
14615
|
-
async getGitRemoteUrl(command35) {
|
|
14616
|
-
return this.hexa.useCases.getGitRemoteUrl.execute(command35);
|
|
14617
|
-
}
|
|
14618
|
-
async listFilesInDirectory(command35) {
|
|
14619
|
-
return this.hexa.useCases.listFilesInDirectoryUseCase.execute(command35);
|
|
14620
|
-
}
|
|
14621
14838
|
async lintFilesAgainstRule(command35) {
|
|
14622
14839
|
return this.hexa.useCases.lintFilesAgainstRule.execute(command35);
|
|
14623
14840
|
}
|
|
14624
14841
|
async lintFilesFromConfig(command35) {
|
|
14625
14842
|
return this.hexa.useCases.lintFilesFromConfig.execute(command35);
|
|
14626
14843
|
}
|
|
14627
|
-
async installPackages(command35) {
|
|
14628
|
-
return this.hexa.useCases.installPackages.execute(command35);
|
|
14629
|
-
}
|
|
14630
14844
|
async install(command35) {
|
|
14631
14845
|
return this.hexa.useCases.install.execute(command35);
|
|
14632
14846
|
}
|
|
@@ -14636,9 +14850,6 @@ var PackmindCliHexa = class {
|
|
|
14636
14850
|
async diffArtefacts(command35) {
|
|
14637
14851
|
return this.hexa.useCases.diffArtefacts.execute(command35);
|
|
14638
14852
|
}
|
|
14639
|
-
async submitDiffs(groupedDiffs, message) {
|
|
14640
|
-
return this.hexa.useCases.submitDiffs.execute({ groupedDiffs, message });
|
|
14641
|
-
}
|
|
14642
14853
|
async checkDiffs(groupedDiffs) {
|
|
14643
14854
|
return this.hexa.useCases.checkDiffs.execute({ groupedDiffs });
|
|
14644
14855
|
}
|
|
@@ -14662,21 +14873,6 @@ var PackmindCliHexa = class {
|
|
|
14662
14873
|
baseDirectory
|
|
14663
14874
|
);
|
|
14664
14875
|
}
|
|
14665
|
-
async readConfig(baseDirectory) {
|
|
14666
|
-
const config = await this.hexa.repositories.configFileRepository.readConfig(
|
|
14667
|
-
baseDirectory
|
|
14668
|
-
);
|
|
14669
|
-
if (!config) return { packages: {} };
|
|
14670
|
-
const hasNonWildcardVersions = Object.values(config.packages).some(
|
|
14671
|
-
(version2) => version2 !== "*"
|
|
14672
|
-
);
|
|
14673
|
-
if (hasNonWildcardVersions) {
|
|
14674
|
-
logWarningConsole(
|
|
14675
|
-
"Package versions are not supported yet, getting the latest version"
|
|
14676
|
-
);
|
|
14677
|
-
}
|
|
14678
|
-
return config;
|
|
14679
|
-
}
|
|
14680
14876
|
/**
|
|
14681
14877
|
* Reads the full packmind.json configuration including agents.
|
|
14682
14878
|
* Returns null if no config file exists.
|
|
@@ -14686,35 +14882,6 @@ var PackmindCliHexa = class {
|
|
|
14686
14882
|
baseDirectory
|
|
14687
14883
|
);
|
|
14688
14884
|
}
|
|
14689
|
-
async writeConfig(baseDirectory, packagesSlugs) {
|
|
14690
|
-
const packages = {};
|
|
14691
|
-
packagesSlugs.forEach((slug6) => {
|
|
14692
|
-
packages[slug6] = "*";
|
|
14693
|
-
});
|
|
14694
|
-
const existingConfig = await this.hexa.repositories.configFileRepository.readConfig(
|
|
14695
|
-
baseDirectory
|
|
14696
|
-
);
|
|
14697
|
-
await this.hexa.repositories.configFileRepository.writeConfig(
|
|
14698
|
-
baseDirectory,
|
|
14699
|
-
{
|
|
14700
|
-
...existingConfig,
|
|
14701
|
-
packages
|
|
14702
|
-
}
|
|
14703
|
-
);
|
|
14704
|
-
}
|
|
14705
|
-
/**
|
|
14706
|
-
* Adds new packages to an existing packmind.json while preserving property order.
|
|
14707
|
-
* If the file doesn't exist, creates a new one with default order (packages first).
|
|
14708
|
-
*
|
|
14709
|
-
* @param baseDirectory - The directory containing packmind.json
|
|
14710
|
-
* @param newPackageSlugs - Array of package slugs to add
|
|
14711
|
-
*/
|
|
14712
|
-
async addPackagesToConfig(baseDirectory, newPackageSlugs) {
|
|
14713
|
-
return this.hexa.repositories.configFileRepository.addPackagesToConfig(
|
|
14714
|
-
baseDirectory,
|
|
14715
|
-
newPackageSlugs
|
|
14716
|
-
);
|
|
14717
|
-
}
|
|
14718
14885
|
async readHierarchicalConfig(startDirectory, stopDirectory) {
|
|
14719
14886
|
return this.hexa.repositories.configFileRepository.readHierarchicalConfig(
|
|
14720
14887
|
startDirectory,
|
|
@@ -14732,11 +14899,6 @@ var PackmindCliHexa = class {
|
|
|
14732
14899
|
stopDirectory
|
|
14733
14900
|
);
|
|
14734
14901
|
}
|
|
14735
|
-
async getGitRepositoryRoot(directory) {
|
|
14736
|
-
return this.hexa.services.gitRemoteUrlService.getGitRepositoryRoot(
|
|
14737
|
-
directory
|
|
14738
|
-
);
|
|
14739
|
-
}
|
|
14740
14902
|
async tryGetGitRepositoryRoot(directory) {
|
|
14741
14903
|
return this.hexa.services.gitRemoteUrlService.tryGetGitRepositoryRoot(
|
|
14742
14904
|
directory
|
|
@@ -14769,9 +14931,6 @@ var PackmindCliHexa = class {
|
|
|
14769
14931
|
getGitRemoteUrlFromPath(repoPath) {
|
|
14770
14932
|
return this.hexa.services.gitRemoteUrlService.getGitRemoteUrl(repoPath).gitRemoteUrl;
|
|
14771
14933
|
}
|
|
14772
|
-
async uploadSkill(command35) {
|
|
14773
|
-
return this.hexa.useCases.uploadSkill.execute(command35);
|
|
14774
|
-
}
|
|
14775
14934
|
async installDefaultSkills(command35) {
|
|
14776
14935
|
return this.hexa.useCases.installDefaultSkills.execute(command35);
|
|
14777
14936
|
}
|
|
@@ -14798,35 +14957,6 @@ var PackmindCliHexa = class {
|
|
|
14798
14957
|
async getSpaces() {
|
|
14799
14958
|
return this.hexa.services.spaceService.getSpaces();
|
|
14800
14959
|
}
|
|
14801
|
-
/**
|
|
14802
|
-
* Normalizes package slugs to the `@space-slug/package-slug` format.
|
|
14803
|
-
* Unprefixed slugs are resolved against the organization's default space.
|
|
14804
|
-
* Already-prefixed slugs (`@space/pkg`) are returned as-is.
|
|
14805
|
-
* Throws if there are multiple spaces and any slug is unprefixed.
|
|
14806
|
-
*/
|
|
14807
|
-
async normalizePackageSlugs(slugs) {
|
|
14808
|
-
if (slugs.length === 0) return [];
|
|
14809
|
-
const hasUnprefixed = slugs.some((s) => !s.startsWith("@"));
|
|
14810
|
-
if (!hasUnprefixed) return slugs;
|
|
14811
|
-
let spaces;
|
|
14812
|
-
try {
|
|
14813
|
-
spaces = await this.getSpaces();
|
|
14814
|
-
} catch {
|
|
14815
|
-
logWarningConsole(
|
|
14816
|
-
"Your Packmind instance is outdated and needs to be updated. It will not be supported in the v1 release of packmind-cli."
|
|
14817
|
-
);
|
|
14818
|
-
return slugs;
|
|
14819
|
-
}
|
|
14820
|
-
if (spaces.length > 1) {
|
|
14821
|
-
throw new Error(
|
|
14822
|
-
`Your organization has multiple spaces. Please specify the space for each package using the @space/package format (e.g. @${spaces[0].slug}/my-package).`
|
|
14823
|
-
);
|
|
14824
|
-
}
|
|
14825
|
-
const defaultSpace = await this.getDefaultSpace();
|
|
14826
|
-
return slugs.map(
|
|
14827
|
-
(slug6) => slug6.startsWith("@") ? slug6 : `@${defaultSpace.slug}/${slug6}`
|
|
14828
|
-
);
|
|
14829
|
-
}
|
|
14830
14960
|
getSpaceService() {
|
|
14831
14961
|
return this.hexa.services.spaceService;
|
|
14832
14962
|
}
|
|
@@ -15050,7 +15180,7 @@ async function lintHandler(args2, deps) {
|
|
|
15050
15180
|
);
|
|
15051
15181
|
if (!hierarchicalConfig.hasConfigs) {
|
|
15052
15182
|
throw new Error(
|
|
15053
|
-
|
|
15183
|
+
`No packmind.json config found. Run \`${EXEC_NAME} install <some-package>\` first to set up linting.`
|
|
15054
15184
|
);
|
|
15055
15185
|
}
|
|
15056
15186
|
const result = await packmindCliHexa.lintFilesFromConfig({
|
|
@@ -15063,13 +15193,13 @@ async function lintHandler(args2, deps) {
|
|
|
15063
15193
|
} catch (error) {
|
|
15064
15194
|
if (isNotLoggedInError(error) && continueOnMissingKey) {
|
|
15065
15195
|
logWarningConsole(
|
|
15066
|
-
|
|
15196
|
+
`Warning: Not logged in to Packmind, linting is skipped. Run \`${EXEC_NAME} login\` to authenticate.`
|
|
15067
15197
|
);
|
|
15068
15198
|
exit(0);
|
|
15069
15199
|
return;
|
|
15070
15200
|
}
|
|
15071
15201
|
if (error instanceof CommunityEditionError) {
|
|
15072
|
-
logInfoConsole(
|
|
15202
|
+
logInfoConsole(error.message);
|
|
15073
15203
|
logInfoConsole("Linting skipped.");
|
|
15074
15204
|
exit(0);
|
|
15075
15205
|
return;
|
|
@@ -15454,7 +15584,7 @@ function buildIncapableArtifactsWarning(result) {
|
|
|
15454
15584
|
...mismatches.map(
|
|
15455
15585
|
({ noun, count, capable }) => ` - ${count} ${pluralize(noun, count)}: try ${formatCapableList(capable)}`
|
|
15456
15586
|
),
|
|
15457
|
-
` Run ${formatCommand(
|
|
15587
|
+
` Run ${formatCommand(`${EXEC_NAME} config agents`)} to add a capable agent.`
|
|
15458
15588
|
];
|
|
15459
15589
|
return lines.join("\n");
|
|
15460
15590
|
}
|
|
@@ -15479,7 +15609,8 @@ var AGENT_ARTIFACT_CHECKS = [
|
|
|
15479
15609
|
{ agent: "agents_md", paths: ["AGENTS.md"] },
|
|
15480
15610
|
{ agent: "gitlab_duo", paths: [".gitlab/duo"] },
|
|
15481
15611
|
{ agent: "opencode", paths: [".opencode"] },
|
|
15482
|
-
{ agent: "codex", paths: [".agents/skills"], recursive: true }
|
|
15612
|
+
{ agent: "codex", paths: [".agents/skills"], recursive: true },
|
|
15613
|
+
{ agent: "kiro", paths: [".kiro"] }
|
|
15483
15614
|
];
|
|
15484
15615
|
var AgentArtifactDetectionService = class {
|
|
15485
15616
|
async detectAgentArtifacts(baseDirectory) {
|
|
@@ -15597,6 +15728,7 @@ var SELECTABLE_AGENTS = [
|
|
|
15597
15728
|
"cursor",
|
|
15598
15729
|
"gitlab_duo",
|
|
15599
15730
|
"junie",
|
|
15731
|
+
"kiro",
|
|
15600
15732
|
"opencode"
|
|
15601
15733
|
];
|
|
15602
15734
|
var AGENT_DISPLAY_NAMES = {
|
|
@@ -15610,7 +15742,8 @@ var AGENT_DISPLAY_NAMES = {
|
|
|
15610
15742
|
agents_md: "AGENTS.md",
|
|
15611
15743
|
gitlab_duo: "GitLab Duo",
|
|
15612
15744
|
opencode: "OpenCode",
|
|
15613
|
-
codex: "Codex"
|
|
15745
|
+
codex: "Codex",
|
|
15746
|
+
kiro: "Kiro"
|
|
15614
15747
|
};
|
|
15615
15748
|
async function configAgentsHandler(deps) {
|
|
15616
15749
|
const { configRepository, baseDirectory } = deps;
|
|
@@ -15747,7 +15880,7 @@ async function handleIncompatibleInstalledSkillsSilently(skills, baseDirectory)
|
|
|
15747
15880
|
async function handleIncompatibleInstalledSkills(skills, baseDirectory, confirm) {
|
|
15748
15881
|
const skillNames = skills.map((s) => s.skillName).join(", ");
|
|
15749
15882
|
logWarningConsole(
|
|
15750
|
-
`The following skill(s) are installed but are not compatible with this version of
|
|
15883
|
+
`The following skill(s) are installed but are not compatible with this version of ${EXEC_NAME}: ${skillNames}`
|
|
15751
15884
|
);
|
|
15752
15885
|
logInfoConsole("These skills will be deleted.");
|
|
15753
15886
|
const confirmed = await confirm();
|
|
@@ -15789,13 +15922,11 @@ function reportEnsureCliVersionOutcome(outcome, currentCliVersion) {
|
|
|
15789
15922
|
switch (outcome.kind) {
|
|
15790
15923
|
case "older":
|
|
15791
15924
|
logWarningConsole(
|
|
15792
|
-
`
|
|
15925
|
+
`Your CLI version ${currentCliVersion} is older than the version recorded in packmind-lock.json (${outcome.lockVersion}). Please update your CLI.`
|
|
15793
15926
|
);
|
|
15794
15927
|
break;
|
|
15795
15928
|
case "newer":
|
|
15796
|
-
logInfoConsole(
|
|
15797
|
-
"[packmind-cli] CLI upgrade detected \u2014 refreshing default skills."
|
|
15798
|
-
);
|
|
15929
|
+
logInfoConsole("CLI upgrade detected \u2014 refreshing default skills.");
|
|
15799
15930
|
break;
|
|
15800
15931
|
case "match":
|
|
15801
15932
|
case "no-lockfile":
|
|
@@ -15809,7 +15940,7 @@ function configuredAgentsSupportSkills(configuredAgents) {
|
|
|
15809
15940
|
return hasCapableAgent(configuredAgents, "skills");
|
|
15810
15941
|
}
|
|
15811
15942
|
function buildSkillsSkippedWarning(configuredAgents) {
|
|
15812
|
-
const configHint = formatCommand(
|
|
15943
|
+
const configHint = formatCommand(`${EXEC_NAME} config agents`);
|
|
15813
15944
|
if (configuredAgents.length === 0) {
|
|
15814
15945
|
return `Skipping default skills \u2014 no coding agents are configured. Run ${configHint} to add one (e.g. claude).`;
|
|
15815
15946
|
}
|
|
@@ -15908,7 +16039,7 @@ async function initHandler(deps) {
|
|
|
15908
16039
|
const totalFiles = result.filesCreated + result.filesUpdated;
|
|
15909
16040
|
if (result.skippedSkillsCount > 0) {
|
|
15910
16041
|
logWarningConsole(
|
|
15911
|
-
`${result.skippedSkillsCount} skill(s) were skipped because they require a newer version of
|
|
16042
|
+
`${result.skippedSkillsCount} skill(s) were skipped because they require a newer version of ${EXEC_NAME}. Run "${formatCommand(`${EXEC_NAME} update`)}" to get the latest version.`
|
|
15912
16043
|
);
|
|
15913
16044
|
}
|
|
15914
16045
|
if (totalFiles === 0) {
|
|
@@ -16051,7 +16182,7 @@ async function bootstrapInstallContext(deps) {
|
|
|
16051
16182
|
}
|
|
16052
16183
|
if (!isTTY) {
|
|
16053
16184
|
logWarningConsole(
|
|
16054
|
-
|
|
16185
|
+
`No packmind.json and no agent context detected \u2014 run \`${EXEC_NAME} init\` to configure.`
|
|
16055
16186
|
);
|
|
16056
16187
|
return {
|
|
16057
16188
|
configReady: false,
|
|
@@ -16275,7 +16406,7 @@ function mergeInstallResults(results) {
|
|
|
16275
16406
|
function decideDistributionTracking(params) {
|
|
16276
16407
|
const { lookup, currentBranch, branchExists, detached } = params;
|
|
16277
16408
|
switch (lookup.status) {
|
|
16278
|
-
case "
|
|
16409
|
+
case "tracking-unsupported":
|
|
16279
16410
|
return { action: "record-legacy" };
|
|
16280
16411
|
case "unavailable":
|
|
16281
16412
|
return { action: "inform" };
|
|
@@ -16319,7 +16450,7 @@ function reportDistributionTrackingDecision(decision, context) {
|
|
|
16319
16450
|
if (decision.reason === "repo_not_tracked") {
|
|
16320
16451
|
logWarningConsole(
|
|
16321
16452
|
`Distribution not recorded \u2014 ${context.owner}/${context.repo} is not tracked in Packmind. Ask an admin to run ${formatCommand(
|
|
16322
|
-
|
|
16453
|
+
`${EXEC_NAME} git track`
|
|
16323
16454
|
)} to start tracking it.`
|
|
16324
16455
|
);
|
|
16325
16456
|
} else if (decision.reason === "detached_head") {
|
|
@@ -16329,7 +16460,7 @@ function reportDistributionTrackingDecision(decision, context) {
|
|
|
16329
16460
|
} else if (decision.reason === "tracked_branch_gone") {
|
|
16330
16461
|
logWarningConsole(
|
|
16331
16462
|
`Distribution not recorded \u2014 the tracked branch '${decision.trackedBranch}' is not in this repository, so nothing is recorded anywhere. Ask an admin to run ${formatCommand(
|
|
16332
|
-
|
|
16463
|
+
`${EXEC_NAME} git track --update`
|
|
16333
16464
|
)} to move tracking to '${context.currentBranch}'.`
|
|
16334
16465
|
);
|
|
16335
16466
|
} else {
|
|
@@ -16355,7 +16486,7 @@ async function resolveTrackingLookup(packmindCliHexa, owner, repo) {
|
|
|
16355
16486
|
} catch (error) {
|
|
16356
16487
|
const statusCode = error?.statusCode;
|
|
16357
16488
|
if (statusCode === 404) {
|
|
16358
|
-
return { status: "
|
|
16489
|
+
return { status: "tracking-unsupported" };
|
|
16359
16490
|
}
|
|
16360
16491
|
return { status: "unavailable" };
|
|
16361
16492
|
}
|
|
@@ -16762,7 +16893,8 @@ If the browser doesn't open, visit: ${normalizedHost}/cli-login?callback_url=${e
|
|
|
16762
16893
|
logConsole(`
|
|
16763
16894
|
Credentials saved to: ${result.credentialsPath}`);
|
|
16764
16895
|
logConsole(
|
|
16765
|
-
|
|
16896
|
+
`
|
|
16897
|
+
You can now use ${EXEC_NAME} commands with your authenticated account.`
|
|
16766
16898
|
);
|
|
16767
16899
|
} catch (error) {
|
|
16768
16900
|
if (error instanceof Error) {
|
|
@@ -16823,7 +16955,7 @@ function displayVersionNotice(result) {
|
|
|
16823
16955
|
}
|
|
16824
16956
|
logConsole("");
|
|
16825
16957
|
logWarningConsole(
|
|
16826
|
-
`Update available: ${result.currentVersion} \u2192 ${result.latestVersion} \u2014 run
|
|
16958
|
+
`Update available: ${result.currentVersion} \u2192 ${result.latestVersion} \u2014 run \`${EXEC_NAME} update\` to upgrade`
|
|
16827
16959
|
);
|
|
16828
16960
|
}
|
|
16829
16961
|
|
|
@@ -16861,7 +16993,8 @@ Host: ${result.host}`);
|
|
|
16861
16993
|
}
|
|
16862
16994
|
logInfoConsole(`Source: ${result.source}`);
|
|
16863
16995
|
if (result.isExpired) {
|
|
16864
|
-
logConsole(
|
|
16996
|
+
logConsole(`
|
|
16997
|
+
Run \`${EXEC_NAME} login\` to re-authenticate.`);
|
|
16865
16998
|
}
|
|
16866
16999
|
}
|
|
16867
17000
|
var whoamiCommand = (0, import_cmd_ts6.command)({
|
|
@@ -16879,7 +17012,7 @@ var whoamiCommand = (0, import_cmd_ts6.command)({
|
|
|
16879
17012
|
logErrorConsole("Not authenticated");
|
|
16880
17013
|
logConsole(
|
|
16881
17014
|
`
|
|
16882
|
-
No credentials found. Run
|
|
17015
|
+
No credentials found. Run \`${EXEC_NAME} login\` to authenticate.`
|
|
16883
17016
|
);
|
|
16884
17017
|
logConsole(`
|
|
16885
17018
|
Credentials are loaded from (in order of priority):`);
|
|
@@ -16939,12 +17072,15 @@ var installDefaultSkillsCommand = (0, import_cmd_ts7.command)({
|
|
|
16939
17072
|
logInfoConsole("Installing default skills...");
|
|
16940
17073
|
const result = await packmindCliHexa.installDefaultSkills({
|
|
16941
17074
|
includeBeta,
|
|
16942
|
-
|
|
17075
|
+
// Always report the real version: `includeBeta` already bypasses the
|
|
17076
|
+
// version filter on its own, and the version is what picks the
|
|
17077
|
+
// executable name the deployed skills tell the agent to run.
|
|
17078
|
+
cliVersion: CLI_VERSION4,
|
|
16943
17079
|
baseDirectory
|
|
16944
17080
|
});
|
|
16945
17081
|
if (result.skippedSkillsCount > 0) {
|
|
16946
17082
|
logWarningConsole(
|
|
16947
|
-
`${result.skippedSkillsCount} skill(s) were skipped because they require a newer version of
|
|
17083
|
+
`${result.skippedSkillsCount} skill(s) were skipped because they require a newer version of ${EXEC_NAME}. Run "${formatCommand(`${EXEC_NAME} update`)}" to get the latest version.`
|
|
16948
17084
|
);
|
|
16949
17085
|
}
|
|
16950
17086
|
if (result.incompatibleInstalledSkills.length > 0) {
|
|
@@ -16992,8 +17128,8 @@ var import_cmd_ts8 = __toESM(require_cjs());
|
|
|
16992
17128
|
// apps/cli/src/infra/utils/spaceFilterUtils.ts
|
|
16993
17129
|
function resolveSpaceFromArgs(spaceArg, spaces) {
|
|
16994
17130
|
if (!spaceArg) return null;
|
|
16995
|
-
const
|
|
16996
|
-
return spaces.find((s) => s.slug ===
|
|
17131
|
+
const slug5 = spaceArg.startsWith("@") ? spaceArg.slice(1) : spaceArg;
|
|
17132
|
+
return spaces.find((s) => s.slug === slug5) ?? null;
|
|
16997
17133
|
}
|
|
16998
17134
|
|
|
16999
17135
|
// apps/cli/src/infra/utils/urlBuilderUtils.ts
|
|
@@ -17059,7 +17195,7 @@ ${availableSpaces}`
|
|
|
17059
17195
|
exit(0);
|
|
17060
17196
|
return;
|
|
17061
17197
|
}
|
|
17062
|
-
const buildUrl = resolveUrlBuilder((
|
|
17198
|
+
const buildUrl = resolveUrlBuilder((slug5) => `skills/${slug5}/files`);
|
|
17063
17199
|
const groups = groupArtefactBySpaces(skills, spaces);
|
|
17064
17200
|
packmindCliHexa.output.listScopedArtefacts(
|
|
17065
17201
|
`\u{1F4CB} Skills (${skills.length})`,
|
|
@@ -17464,7 +17600,7 @@ var createPackageCommand = (0, import_cmd_ts15.command)({
|
|
|
17464
17600
|
logConsole(` ${formatLabel("Link:")} ${result.webappUrl}`);
|
|
17465
17601
|
}
|
|
17466
17602
|
logConsole(
|
|
17467
|
-
` ${formatLabel("Install:")} ${formatCommand(
|
|
17603
|
+
` ${formatLabel("Install:")} ${formatCommand(`${EXEC_NAME} install ${result.slug}`)}`
|
|
17468
17604
|
);
|
|
17469
17605
|
if (result.deduplicated) {
|
|
17470
17606
|
logWarningConsole(
|
|
@@ -17491,11 +17627,11 @@ var import_cmd_ts16 = __toESM(require_cjs());
|
|
|
17491
17627
|
|
|
17492
17628
|
// apps/cli/src/domain/errors/ItemNotFoundError.ts
|
|
17493
17629
|
var ItemNotFoundError = class extends Error {
|
|
17494
|
-
constructor(itemType,
|
|
17495
|
-
const message = spaceSlug ? `${itemType} '${
|
|
17630
|
+
constructor(itemType, slug5, spaceSlug) {
|
|
17631
|
+
const message = spaceSlug ? `${itemType} '${slug5}' not found in space '@${spaceSlug}'` : `${itemType} '${slug5}' not found`;
|
|
17496
17632
|
super(message);
|
|
17497
17633
|
this.itemType = itemType;
|
|
17498
|
-
this.slug =
|
|
17634
|
+
this.slug = slug5;
|
|
17499
17635
|
this.spaceSlug = spaceSlug;
|
|
17500
17636
|
this.name = "ItemNotFoundError";
|
|
17501
17637
|
}
|
|
@@ -17558,34 +17694,34 @@ var AddToPackageUseCase = class {
|
|
|
17558
17694
|
async resolveSlugsToIds(itemType, slugs, spaceId, spaceSlug) {
|
|
17559
17695
|
const ids = [];
|
|
17560
17696
|
const idToSlugMap = /* @__PURE__ */ new Map();
|
|
17561
|
-
for (const
|
|
17697
|
+
for (const slug5 of slugs) {
|
|
17562
17698
|
let item = null;
|
|
17563
17699
|
if (itemType === "standard") {
|
|
17564
|
-
item = await this.findStandardBySlug(
|
|
17700
|
+
item = await this.findStandardBySlug(slug5, spaceId);
|
|
17565
17701
|
} else if (itemType === "command") {
|
|
17566
|
-
item = await this.findCommandBySlug(
|
|
17702
|
+
item = await this.findCommandBySlug(slug5, spaceId);
|
|
17567
17703
|
} else if (itemType === "skill") {
|
|
17568
|
-
item = await this.findSkillBySlug(
|
|
17704
|
+
item = await this.findSkillBySlug(slug5, spaceId);
|
|
17569
17705
|
}
|
|
17570
17706
|
if (!item) {
|
|
17571
|
-
throw new ItemNotFoundError(itemType,
|
|
17707
|
+
throw new ItemNotFoundError(itemType, slug5, spaceSlug);
|
|
17572
17708
|
}
|
|
17573
17709
|
ids.push(item.id);
|
|
17574
|
-
idToSlugMap.set(item.id,
|
|
17710
|
+
idToSlugMap.set(item.id, slug5);
|
|
17575
17711
|
}
|
|
17576
17712
|
return { ids, idToSlugMap };
|
|
17577
17713
|
}
|
|
17578
|
-
async findStandardBySlug(
|
|
17714
|
+
async findStandardBySlug(slug5, spaceId) {
|
|
17579
17715
|
const standards = await this.gateway.standards.list({ spaceId });
|
|
17580
|
-
return standards.standards.find((standard) => standard.slug ===
|
|
17716
|
+
return standards.standards.find((standard) => standard.slug === slug5) ?? null;
|
|
17581
17717
|
}
|
|
17582
|
-
async findCommandBySlug(
|
|
17718
|
+
async findCommandBySlug(slug5, spaceId) {
|
|
17583
17719
|
const commands = await this.gateway.commands.list({ spaceId });
|
|
17584
|
-
return commands.recipes.find((command35) => command35.slug ===
|
|
17720
|
+
return commands.recipes.find((command35) => command35.slug === slug5) ?? null;
|
|
17585
17721
|
}
|
|
17586
|
-
async findSkillBySlug(
|
|
17722
|
+
async findSkillBySlug(slug5, spaceId) {
|
|
17587
17723
|
const skills = await this.gateway.skills.list({ spaceId });
|
|
17588
|
-
return skills.find((skill) => skill.slug ===
|
|
17724
|
+
return skills.find((skill) => skill.slug === slug5) ?? null;
|
|
17589
17725
|
}
|
|
17590
17726
|
};
|
|
17591
17727
|
|
|
@@ -17619,7 +17755,7 @@ function resolvePackageRef(to, allSpaces, exit) {
|
|
|
17619
17755
|
logInfoConsole(` --to @${s.slug}/${to.packageSlug}`);
|
|
17620
17756
|
});
|
|
17621
17757
|
logInfoConsole(
|
|
17622
|
-
`Run
|
|
17758
|
+
`Run \`${EXEC_NAME} packages list\` to see available packages per space.`
|
|
17623
17759
|
);
|
|
17624
17760
|
exit(1);
|
|
17625
17761
|
}
|
|
@@ -17643,7 +17779,7 @@ async function executeAddToPackage(pkgSlug, spaceSlug, itemType, itemSlugs, useC
|
|
|
17643
17779
|
`${formatItemType(itemType, result.added.length)} ${formatItemList(result.added)} added to "${fullPackageSlug}"`
|
|
17644
17780
|
);
|
|
17645
17781
|
logSuccessConsole(
|
|
17646
|
-
`Run ${formatCommand(
|
|
17782
|
+
`Run ${formatCommand(`${EXEC_NAME} install ${fullPackageSlug}`)} to install the ${pluralize2(itemType, result.added.length)}`
|
|
17647
17783
|
);
|
|
17648
17784
|
}
|
|
17649
17785
|
if (result.skipped.length) {
|
|
@@ -17658,7 +17794,7 @@ async function executeAddToPackage(pkgSlug, spaceSlug, itemType, itemSlugs, useC
|
|
|
17658
17794
|
if (error instanceof ItemNotFoundError) {
|
|
17659
17795
|
const spaceFlag = error.spaceSlug ? ` --space ${error.spaceSlug}` : "";
|
|
17660
17796
|
const command35 = formatCommand(
|
|
17661
|
-
|
|
17797
|
+
`${EXEC_NAME} ${error.itemType}s list${spaceFlag}`
|
|
17662
17798
|
);
|
|
17663
17799
|
logInfoConsole(
|
|
17664
17800
|
`Run \`${command35}\` to display available ${error.itemType}s`
|
|
@@ -17803,7 +17939,7 @@ ${availableSpaces}`
|
|
|
17803
17939
|
scopedArtefacts,
|
|
17804
17940
|
{
|
|
17805
17941
|
content: "How to install a package:",
|
|
17806
|
-
exampleCommand:
|
|
17942
|
+
exampleCommand: `${EXEC_NAME} install ${firstSlug}`
|
|
17807
17943
|
}
|
|
17808
17944
|
);
|
|
17809
17945
|
exit(0);
|
|
@@ -17844,10 +17980,10 @@ var import_cmd_ts18 = __toESM(require_cjs());
|
|
|
17844
17980
|
function isNotFoundError(err) {
|
|
17845
17981
|
return err instanceof Error && err.message.includes("does not exist");
|
|
17846
17982
|
}
|
|
17847
|
-
async function resolvePackage(
|
|
17983
|
+
async function resolvePackage(slug5, packmindCliHexa) {
|
|
17848
17984
|
const allSpaces = await packmindCliHexa.getSpaces();
|
|
17849
|
-
if (isFullParsedPackageSlug(
|
|
17850
|
-
const { spaceSlug, packageSlug } =
|
|
17985
|
+
if (isFullParsedPackageSlug(slug5)) {
|
|
17986
|
+
const { spaceSlug, packageSlug } = slug5;
|
|
17851
17987
|
const matchedSpace = allSpaces.find((s) => s.slug === spaceSlug);
|
|
17852
17988
|
if (!matchedSpace) {
|
|
17853
17989
|
throw new Error(`Space '@${spaceSlug}' not found.`);
|
|
@@ -17871,7 +18007,7 @@ async function resolvePackage(slug6, packmindCliHexa) {
|
|
|
17871
18007
|
const results = await Promise.allSettled(
|
|
17872
18008
|
allSpaces.map(async (space) => ({
|
|
17873
18009
|
pkg: await packmindCliHexa.getPackageBySlug({
|
|
17874
|
-
slug:
|
|
18010
|
+
slug: slug5.packageSlug,
|
|
17875
18011
|
spaceId: space.id
|
|
17876
18012
|
}),
|
|
17877
18013
|
spaceSlug: space.slug
|
|
@@ -17885,17 +18021,17 @@ async function resolvePackage(slug6, packmindCliHexa) {
|
|
|
17885
18021
|
if (realError) {
|
|
17886
18022
|
throw realError.reason;
|
|
17887
18023
|
}
|
|
17888
|
-
throw new Error(`Package '${
|
|
18024
|
+
throw new Error(`Package '${slug5.packageSlug}' not found in any space.`);
|
|
17889
18025
|
}
|
|
17890
18026
|
if (matches.length > 1) {
|
|
17891
|
-
const example = `@${matches[0].spaceSlug}/${
|
|
18027
|
+
const example = `@${matches[0].spaceSlug}/${slug5.packageSlug}`;
|
|
17892
18028
|
throw new Error(
|
|
17893
|
-
`Package '${
|
|
18029
|
+
`Package '${slug5.packageSlug}' exists in multiple spaces (${matches.map((m) => `@${m.spaceSlug}`).join(", ")}). Please specify the space using the @space/package format (e.g. ${example}).`
|
|
17894
18030
|
);
|
|
17895
18031
|
}
|
|
17896
18032
|
return {
|
|
17897
18033
|
pkg: matches[0].pkg,
|
|
17898
|
-
fullSlug: `@${matches[0].spaceSlug}/${
|
|
18034
|
+
fullSlug: `@${matches[0].spaceSlug}/${slug5.packageSlug}`
|
|
17899
18035
|
};
|
|
17900
18036
|
}
|
|
17901
18037
|
async function showPackageHandler(args2, deps) {
|
|
@@ -17960,10 +18096,10 @@ var showPackageCommand = (0, import_cmd_ts18.command)({
|
|
|
17960
18096
|
description: "Package slug (e.g. backend or @my-space/backend)"
|
|
17961
18097
|
})
|
|
17962
18098
|
},
|
|
17963
|
-
handler: async ({ slug:
|
|
18099
|
+
handler: async ({ slug: slug5 }) => {
|
|
17964
18100
|
const packmindLogger = new PackmindLogger("PackmindCLI", "info" /* INFO */);
|
|
17965
18101
|
const packmindCliHexa = new PackmindCliHexa(packmindLogger);
|
|
17966
|
-
await showPackageHandler({ slug:
|
|
18102
|
+
await showPackageHandler({ slug: slug5 }, { packmindCliHexa, exit: process.exit });
|
|
17967
18103
|
}
|
|
17968
18104
|
});
|
|
17969
18105
|
|
|
@@ -18079,6 +18215,7 @@ async function renderPluginHandler(args2, deps) {
|
|
|
18079
18215
|
deps.exit(1);
|
|
18080
18216
|
return;
|
|
18081
18217
|
}
|
|
18218
|
+
const targetVendor = ctx.vendor === "copilot" ? "github" : "anthropic";
|
|
18082
18219
|
const pluginName = args2.packageSlug.packageSlug;
|
|
18083
18220
|
const packageSlug = displayableParsedPackageSlug(args2.packageSlug);
|
|
18084
18221
|
const { gitRemoteUrl, gitBranch } = await resolveGitContext(
|
|
@@ -18087,7 +18224,6 @@ async function renderPluginHandler(args2, deps) {
|
|
|
18087
18224
|
);
|
|
18088
18225
|
if (ctx.mode === "marketplace") {
|
|
18089
18226
|
const manifestPath = ctx.manifestPath;
|
|
18090
|
-
const targetVendor = ctx.vendor === "copilot" ? "github" : "anthropic";
|
|
18091
18227
|
let marketplace;
|
|
18092
18228
|
try {
|
|
18093
18229
|
marketplace = readMarketplace(manifestPath);
|
|
@@ -18159,7 +18295,7 @@ async function renderPluginHandler(args2, deps) {
|
|
|
18159
18295
|
writeMarketplace(manifestPath, updated);
|
|
18160
18296
|
deps.log(`Rendered ${response.files.length} files into ./${pluginRoot}`);
|
|
18161
18297
|
reportSkippedStandards(deps, response.skippedStandardsCount);
|
|
18162
|
-
deps.log(
|
|
18298
|
+
deps.log(`Updated ${(0, import_path6.relative)(cwd, manifestPath)}`);
|
|
18163
18299
|
deps.exit(0);
|
|
18164
18300
|
return;
|
|
18165
18301
|
}
|
|
@@ -18187,7 +18323,8 @@ async function renderPluginHandler(args2, deps) {
|
|
|
18187
18323
|
pluginRoot: "/",
|
|
18188
18324
|
pluginName,
|
|
18189
18325
|
gitRemoteUrl,
|
|
18190
|
-
gitBranch
|
|
18326
|
+
gitBranch,
|
|
18327
|
+
targetVendor
|
|
18191
18328
|
});
|
|
18192
18329
|
writeFiles(cwd, response.files);
|
|
18193
18330
|
deps.log(`Re-rendered ${response.files.length} files into ./`);
|
|
@@ -18199,7 +18336,7 @@ async function renderPluginHandler(args2, deps) {
|
|
|
18199
18336
|
function reportSkippedStandards(deps, skippedStandardsCount) {
|
|
18200
18337
|
if (skippedStandardsCount > 0) {
|
|
18201
18338
|
deps.log(
|
|
18202
|
-
`Skipped ${skippedStandardsCount} standards (not supported in
|
|
18339
|
+
`Skipped ${skippedStandardsCount} standards (not supported in plugins).`
|
|
18203
18340
|
);
|
|
18204
18341
|
}
|
|
18205
18342
|
}
|
|
@@ -18230,7 +18367,7 @@ async function confirmOverwrite(message) {
|
|
|
18230
18367
|
// apps/cli/src/infra/commands/plugins/RenderPluginCommand.ts
|
|
18231
18368
|
var renderPluginCommand = (0, import_cmd_ts20.command)({
|
|
18232
18369
|
name: "render",
|
|
18233
|
-
description: "Render a Packmind package as a Claude plugin",
|
|
18370
|
+
description: "Render a Packmind package as a Claude Code or GitHub Copilot plugin",
|
|
18234
18371
|
args: {
|
|
18235
18372
|
packageSlug: (0, import_cmd_ts20.positional)({
|
|
18236
18373
|
type: PackageSlugArgType,
|
|
@@ -18376,7 +18513,7 @@ var deletePluginCommand = (0, import_cmd_ts21.command)({
|
|
|
18376
18513
|
// apps/cli/src/infra/commands/PluginsCommand.ts
|
|
18377
18514
|
var pluginsCommand = (0, import_cmd_ts22.subcommands)({
|
|
18378
18515
|
name: "plugins",
|
|
18379
|
-
description: "Render Packmind packages as Claude plugins",
|
|
18516
|
+
description: "Render Packmind packages as Claude Code or GitHub Copilot plugins",
|
|
18380
18517
|
cmds: {
|
|
18381
18518
|
render: renderPluginCommand,
|
|
18382
18519
|
delete: deletePluginCommand
|
|
@@ -18542,8 +18679,8 @@ function extractFilenameSlug(filePath) {
|
|
|
18542
18679
|
}
|
|
18543
18680
|
return basename4;
|
|
18544
18681
|
}
|
|
18545
|
-
function humanizeSlug(
|
|
18546
|
-
const words =
|
|
18682
|
+
function humanizeSlug(slug5) {
|
|
18683
|
+
const words = slug5.replace(/[-_]/g, " ");
|
|
18547
18684
|
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
18548
18685
|
}
|
|
18549
18686
|
|
|
@@ -18653,8 +18790,8 @@ function validateSkillFileContent(content) {
|
|
|
18653
18790
|
}
|
|
18654
18791
|
|
|
18655
18792
|
// packages/skills/src/infra/schemas/SkillSchema.ts
|
|
18656
|
-
var
|
|
18657
|
-
var SkillSchema = new
|
|
18793
|
+
var import_typeorm3 = require("typeorm");
|
|
18794
|
+
var SkillSchema = new import_typeorm3.EntitySchema({
|
|
18658
18795
|
name: "Skill",
|
|
18659
18796
|
tableName: "skills",
|
|
18660
18797
|
columns: {
|
|
@@ -18742,8 +18879,8 @@ var SkillSchema = new import_typeorm2.EntitySchema({
|
|
|
18742
18879
|
});
|
|
18743
18880
|
|
|
18744
18881
|
// packages/skills/src/infra/schemas/SkillVersionSchema.ts
|
|
18745
|
-
var
|
|
18746
|
-
var SkillVersionSchema = new
|
|
18882
|
+
var import_typeorm4 = require("typeorm");
|
|
18883
|
+
var SkillVersionSchema = new import_typeorm4.EntitySchema({
|
|
18747
18884
|
name: "SkillVersion",
|
|
18748
18885
|
tableName: "skill_versions",
|
|
18749
18886
|
columns: {
|
|
@@ -18824,8 +18961,8 @@ var SkillVersionSchema = new import_typeorm3.EntitySchema({
|
|
|
18824
18961
|
});
|
|
18825
18962
|
|
|
18826
18963
|
// packages/skills/src/infra/schemas/SkillFileSchema.ts
|
|
18827
|
-
var
|
|
18828
|
-
var SkillFileSchema = new
|
|
18964
|
+
var import_typeorm5 = require("typeorm");
|
|
18965
|
+
var SkillFileSchema = new import_typeorm5.EntitySchema({
|
|
18829
18966
|
name: "SkillFile",
|
|
18830
18967
|
tableName: "skill_files",
|
|
18831
18968
|
columns: {
|
|
@@ -18876,14 +19013,11 @@ var import_slug = __toESM(require("slug"));
|
|
|
18876
19013
|
// packages/skills/src/application/useCases/saveSkillVersion/SaveSkillVersionUseCase.ts
|
|
18877
19014
|
var import_uuid = require("uuid");
|
|
18878
19015
|
|
|
18879
|
-
// packages/skills/src/application/useCases/updateSkill/UpdateSkillUseCase.ts
|
|
18880
|
-
var import_slug2 = __toESM(require("slug"));
|
|
18881
|
-
|
|
18882
19016
|
// packages/skills/src/application/useCases/updateSkillFileFromUI/UpdateSkillFileFromUIUseCase.ts
|
|
18883
19017
|
var import_uuid2 = require("uuid");
|
|
18884
19018
|
|
|
18885
19019
|
// packages/skills/src/application/useCases/uploadSkill/UploadSkillUseCase.ts
|
|
18886
|
-
var
|
|
19020
|
+
var import_slug2 = __toESM(require("slug"));
|
|
18887
19021
|
var import_uuid3 = require("uuid");
|
|
18888
19022
|
|
|
18889
19023
|
// packages/skills/src/application/services/SkillService.ts
|
|
@@ -19069,14 +19203,14 @@ function findLockFileEntryAndFileForPath(normalizedFilePath, artifacts) {
|
|
|
19069
19203
|
}
|
|
19070
19204
|
|
|
19071
19205
|
// apps/cli/src/infra/commands/playbook/add/linkExistingArtifact.ts
|
|
19072
|
-
var
|
|
19206
|
+
var import_slug3 = __toESM(require("slug"));
|
|
19073
19207
|
async function resolveExistingArtifact(packmindCliHexa, artifactType, spaceId, artifactName) {
|
|
19074
19208
|
const artifacts = await listArtifactsForSpace(
|
|
19075
19209
|
packmindCliHexa,
|
|
19076
19210
|
artifactType,
|
|
19077
19211
|
spaceId
|
|
19078
19212
|
);
|
|
19079
|
-
const match = artifacts.find((a) => (0,
|
|
19213
|
+
const match = artifacts.find((a) => (0, import_slug3.default)(a.name) === (0, import_slug3.default)(artifactName));
|
|
19080
19214
|
return match ? { id: match.id, name: match.name } : null;
|
|
19081
19215
|
}
|
|
19082
19216
|
async function listArtifactsForSpace(packmindCliHexa, artifactType, spaceId) {
|
|
@@ -19113,7 +19247,7 @@ function adoptArtifactIntoLockFile({
|
|
|
19113
19247
|
agents: [],
|
|
19114
19248
|
artifacts: {}
|
|
19115
19249
|
};
|
|
19116
|
-
const key = `user:${artifact.type}:${(0,
|
|
19250
|
+
const key = `user:${artifact.type}:${(0, import_slug3.default)(artifact.name)}`;
|
|
19117
19251
|
const existing = base.artifacts[key];
|
|
19118
19252
|
const normalized = normalizePath2(relativeFilePath);
|
|
19119
19253
|
const files = existing ? [...existing.files] : [];
|
|
@@ -19402,7 +19536,7 @@ ${formatSpaceList(allSpaces)}`
|
|
|
19402
19536
|
message: `Multiple spaces found. Use --space to specify the target space:
|
|
19403
19537
|
${formatSpaceList(allSpaces)}
|
|
19404
19538
|
|
|
19405
|
-
Example:
|
|
19539
|
+
Example: ${EXEC_NAME} playbook add --space ${allSpaces[0].slug} <path>`
|
|
19406
19540
|
};
|
|
19407
19541
|
}
|
|
19408
19542
|
}
|
|
@@ -19421,7 +19555,7 @@ Example: packmind-cli playbook add --space ${allSpaces[0].slug} <path>`
|
|
|
19421
19555
|
status: "failed",
|
|
19422
19556
|
filePath,
|
|
19423
19557
|
message: `Cannot add this ${artifactType}: it is rendered for the "${codingAgent}" agent, which is not in your configured agents (${earlyLockFile.agents.join(", ")}).
|
|
19424
|
-
This file is no longer managed by Packmind. Re-add "${codingAgent}" to your agents and run ${formatLabel(
|
|
19558
|
+
This file is no longer managed by Packmind. Re-add "${codingAgent}" to your agents and run ${formatLabel(`${EXEC_NAME} install`)} to manage it again, or delete the file if it is no longer needed.`
|
|
19425
19559
|
};
|
|
19426
19560
|
}
|
|
19427
19561
|
if (changeType === "updated" && existingLockEntry) {
|
|
@@ -19437,7 +19571,7 @@ This file is no longer managed by Packmind. Re-add "${codingAgent}" to your agen
|
|
|
19437
19571
|
status: "failed",
|
|
19438
19572
|
filePath,
|
|
19439
19573
|
message: `"${artifactName}" is outdated (local: v${existingLockEntry.version}, remote: v${remoteVersion}).
|
|
19440
|
-
Run ${formatLabel(
|
|
19574
|
+
Run ${formatLabel(`${EXEC_NAME} install`)} to update before making changes.`
|
|
19441
19575
|
};
|
|
19442
19576
|
}
|
|
19443
19577
|
} catch (err) {
|
|
@@ -19562,7 +19696,7 @@ async function playbookAddHandler(deps) {
|
|
|
19562
19696
|
const { filePaths, exit, ...rest } = deps;
|
|
19563
19697
|
if (filePaths.length === 0) {
|
|
19564
19698
|
logErrorConsole(
|
|
19565
|
-
|
|
19699
|
+
`No path provided. Usage: ${EXEC_NAME} playbook add <paths...>`
|
|
19566
19700
|
);
|
|
19567
19701
|
exit(1);
|
|
19568
19702
|
return;
|
|
@@ -19584,7 +19718,7 @@ async function playbookAddHandler(deps) {
|
|
|
19584
19718
|
}
|
|
19585
19719
|
if (stagedCount > 0) {
|
|
19586
19720
|
logInfoConsole(
|
|
19587
|
-
`Run ${formatLabel(
|
|
19721
|
+
`Run ${formatLabel(`${EXEC_NAME} playbook submit`)} when you're ready to publish your changes.`
|
|
19588
19722
|
);
|
|
19589
19723
|
}
|
|
19590
19724
|
exit(failedCount > 0 ? 1 : 0);
|
|
@@ -19656,7 +19790,7 @@ async function playbookRmHandler(deps) {
|
|
|
19656
19790
|
} = deps;
|
|
19657
19791
|
if (!filePath) {
|
|
19658
19792
|
logErrorConsole(
|
|
19659
|
-
|
|
19793
|
+
`Missing file path. Usage: ${EXEC_NAME} playbook rm <path>`
|
|
19660
19794
|
);
|
|
19661
19795
|
exit(1);
|
|
19662
19796
|
return;
|
|
@@ -19700,7 +19834,7 @@ async function playbookRmHandler(deps) {
|
|
|
19700
19834
|
const codingAgent = lockResult.file.agent;
|
|
19701
19835
|
if (artifactType === "skill" && isSkillSupportFile(absolutePath)) {
|
|
19702
19836
|
logErrorConsole(
|
|
19703
|
-
|
|
19837
|
+
`Cannot remove an individual skill file. Point to the skill folder to remove the full skill, or manually delete the file and run \`${EXEC_NAME} playbook add <skill-folder>/\` to stage the change.`
|
|
19704
19838
|
);
|
|
19705
19839
|
exit(1);
|
|
19706
19840
|
return;
|
|
@@ -19808,7 +19942,7 @@ async function playbookUnstageHandler(deps) {
|
|
|
19808
19942
|
} = deps;
|
|
19809
19943
|
if (!filePath) {
|
|
19810
19944
|
logErrorConsole(
|
|
19811
|
-
|
|
19945
|
+
`Missing file path. Usage: ${EXEC_NAME} playbook unstage <path>`
|
|
19812
19946
|
);
|
|
19813
19947
|
exit(1);
|
|
19814
19948
|
return;
|
|
@@ -20172,7 +20306,7 @@ async function playbookStatusHandler(deps) {
|
|
|
20172
20306
|
);
|
|
20173
20307
|
}
|
|
20174
20308
|
logConsole("");
|
|
20175
|
-
logConsole(
|
|
20309
|
+
logConsole(`Use \`${EXEC_NAME} playbook submit\` to send them`);
|
|
20176
20310
|
}
|
|
20177
20311
|
if (groupedUntracked.length > 0) {
|
|
20178
20312
|
if (groupedStaged.length > 0) {
|
|
@@ -20187,7 +20321,7 @@ async function playbookStatusHandler(deps) {
|
|
|
20187
20321
|
);
|
|
20188
20322
|
}
|
|
20189
20323
|
logConsole("");
|
|
20190
|
-
logConsole(
|
|
20324
|
+
logConsole(`Use \`${EXEC_NAME} playbook add <path>\` to track them`);
|
|
20191
20325
|
}
|
|
20192
20326
|
if (groupedStaged.length === 0 && groupedUntracked.length === 0) {
|
|
20193
20327
|
logConsole("No changes detected.");
|
|
@@ -20236,9 +20370,9 @@ var import_cmd_ts27 = __toESM(require_cjs());
|
|
|
20236
20370
|
var path35 = __toESM(require("path"));
|
|
20237
20371
|
|
|
20238
20372
|
// apps/cli/src/infra/commands/playbook/submit/duplicateNameChecker.ts
|
|
20239
|
-
var
|
|
20373
|
+
var import_slug4 = __toESM(require("slug"));
|
|
20240
20374
|
function duplicateNameKey(entry) {
|
|
20241
|
-
return `${entry.spaceId}:${entry.artifactType}:${(0,
|
|
20375
|
+
return `${entry.spaceId}:${entry.artifactType}:${(0, import_slug4.default)(entry.artifactName)}`;
|
|
20242
20376
|
}
|
|
20243
20377
|
async function checkForDuplicateNames(createdEntries, packmindGateway) {
|
|
20244
20378
|
const errors = [];
|
|
@@ -20252,7 +20386,7 @@ async function checkForDuplicateNames(createdEntries, packmindGateway) {
|
|
|
20252
20386
|
for (const [, entries] of groups) {
|
|
20253
20387
|
const seen = /* @__PURE__ */ new Map();
|
|
20254
20388
|
for (const entry of entries) {
|
|
20255
|
-
const sluggedName = (0,
|
|
20389
|
+
const sluggedName = (0, import_slug4.default)(entry.artifactName);
|
|
20256
20390
|
if (seen.has(sluggedName)) {
|
|
20257
20391
|
errors.push({
|
|
20258
20392
|
spaceId: entry.spaceId,
|
|
@@ -20286,9 +20420,9 @@ async function checkForDuplicateNames(createdEntries, packmindGateway) {
|
|
|
20286
20420
|
});
|
|
20287
20421
|
existingNames = response.map((s) => s.name);
|
|
20288
20422
|
}
|
|
20289
|
-
const existingNamesSlugged = new Set(existingNames.map((n) => (0,
|
|
20423
|
+
const existingNamesSlugged = new Set(existingNames.map((n) => (0, import_slug4.default)(n)));
|
|
20290
20424
|
for (const entry of entries) {
|
|
20291
|
-
if (existingNamesSlugged.has((0,
|
|
20425
|
+
if (existingNamesSlugged.has((0, import_slug4.default)(entry.artifactName))) {
|
|
20292
20426
|
errors.push({
|
|
20293
20427
|
spaceId: entry.spaceId,
|
|
20294
20428
|
artifactType: entry.artifactType,
|
|
@@ -20898,7 +21032,7 @@ async function buildProposals(changes, getTargetContext) {
|
|
|
20898
21032
|
);
|
|
20899
21033
|
if (!deployedContent && (entry.artifactType === "standard" || entry.artifactType === "command")) {
|
|
20900
21034
|
logWarningConsole(
|
|
20901
|
-
`Skipping "${entry.artifactName}" \u2014 deployed content unavailable. Run
|
|
21035
|
+
`Skipping "${entry.artifactName}" \u2014 deployed content unavailable. Run \`${EXEC_NAME} pull\` to sync before submitting updates.`
|
|
20902
21036
|
);
|
|
20903
21037
|
skipped.push(toSkippedEntry(entry, "deployed content unavailable"));
|
|
20904
21038
|
continue;
|
|
@@ -21002,20 +21136,20 @@ function logPackageAddGuidance(created, packageSlugs) {
|
|
|
21002
21136
|
logInfoConsole("To add the created artifact to a package, run:");
|
|
21003
21137
|
if (standards.length === 1) {
|
|
21004
21138
|
logInfoConsole(
|
|
21005
|
-
` ${formatCommand(
|
|
21139
|
+
` ${formatCommand(`\`${EXEC_NAME} packages add --to ${pkgPlaceholder} --standard ${standards[0].slug}\``)}`
|
|
21006
21140
|
);
|
|
21007
21141
|
} else if (commands.length === 1) {
|
|
21008
21142
|
logInfoConsole(
|
|
21009
|
-
` ${formatCommand(
|
|
21143
|
+
` ${formatCommand(`\`${EXEC_NAME} packages add --to ${pkgPlaceholder} --command ${commands[0].slug}\``)}`
|
|
21010
21144
|
);
|
|
21011
21145
|
} else if (skills.length === 1) {
|
|
21012
21146
|
logInfoConsole(
|
|
21013
|
-
` ${formatCommand(
|
|
21147
|
+
` ${formatCommand(`\`${EXEC_NAME} packages add --to ${pkgPlaceholder} --skill ${skills[0].slug}\``)}`
|
|
21014
21148
|
);
|
|
21015
21149
|
}
|
|
21016
21150
|
} else {
|
|
21017
21151
|
logInfoConsole(
|
|
21018
|
-
`To add the created artifacts to a package, use ${formatCommand(
|
|
21152
|
+
`To add the created artifacts to a package, use ${formatCommand(`\`${EXEC_NAME} packages add --to ${pkgPlaceholder} --standard <artifact-slug>\``)} for each artifact.`
|
|
21019
21153
|
);
|
|
21020
21154
|
}
|
|
21021
21155
|
if (packageSlugs.length > 1) {
|
|
@@ -21133,7 +21267,7 @@ async function playbookSubmitHandler(deps) {
|
|
|
21133
21267
|
const reportSkippedConflicts = () => {
|
|
21134
21268
|
if (conflictCount === 0) return;
|
|
21135
21269
|
logInfoConsole(
|
|
21136
|
-
`${conflictCount} change${conflictCount !== 1 ? "s were" : " was"} skipped and remain${conflictCount !== 1 ? "" : "s"} staged. Rename them and run
|
|
21270
|
+
`${conflictCount} change${conflictCount !== 1 ? "s were" : " was"} skipped and remain${conflictCount !== 1 ? "" : "s"} staged. Rename them and run \`${EXEC_NAME} playbook submit\` again.`
|
|
21137
21271
|
);
|
|
21138
21272
|
};
|
|
21139
21273
|
if (submittableChanges.length === 0) {
|
|
@@ -21208,7 +21342,7 @@ Only one agent version can be submitted at a time. Use "playbook unstage" to rem
|
|
|
21208
21342
|
);
|
|
21209
21343
|
}
|
|
21210
21344
|
logInfoConsole(
|
|
21211
|
-
|
|
21345
|
+
`Your staged changes were kept. Fix the issue above (for stale deployed content, run \`${EXEC_NAME} pull\` to sync), or drop the affected change with \`${EXEC_NAME} playbook unstage <path>\`, then retry.`
|
|
21212
21346
|
);
|
|
21213
21347
|
exit(1);
|
|
21214
21348
|
return;
|
|
@@ -21274,7 +21408,8 @@ Only one agent version can be submitted at a time. Use "playbook unstage" to rem
|
|
|
21274
21408
|
if (err.statusCode === 422) {
|
|
21275
21409
|
logErrorConsole("Failed to apply changes: a conflict was detected.");
|
|
21276
21410
|
logInfoConsole(
|
|
21277
|
-
|
|
21411
|
+
`This usually means the artifact was modified since your last pull.
|
|
21412
|
+
Run \`${EXEC_NAME} pull\` to sync your local state, then retry.`
|
|
21278
21413
|
);
|
|
21279
21414
|
} else {
|
|
21280
21415
|
logErrorConsole(`Failed to apply changes: ${err.message}`);
|
|
@@ -21356,7 +21491,7 @@ Only one agent version can be submitted at a time. Use "playbook unstage" to rem
|
|
|
21356
21491
|
if (isCommunityEditionError(error)) {
|
|
21357
21492
|
logErrorConsole(error.message);
|
|
21358
21493
|
logInfoConsole(
|
|
21359
|
-
`Run ${formatCommand(
|
|
21494
|
+
`Run ${formatCommand(`\`${EXEC_NAME} playbook submit --no-review\``)} to apply changes directly.`
|
|
21360
21495
|
);
|
|
21361
21496
|
exit(1);
|
|
21362
21497
|
return;
|
|
@@ -21435,7 +21570,7 @@ Only one agent version can be submitted at a time. Use "playbook unstage" to rem
|
|
|
21435
21570
|
}
|
|
21436
21571
|
if (succeededSpaces.length > 0) {
|
|
21437
21572
|
logWarningConsole(
|
|
21438
|
-
`Submitted to: ${succeededSpaces.map(displaySpace2).join(", ")}. Run '
|
|
21573
|
+
`Submitted to: ${succeededSpaces.map(displaySpace2).join(", ")}. Run '${EXEC_NAME} playbook submit' again to retry failed spaces.`
|
|
21439
21574
|
);
|
|
21440
21575
|
}
|
|
21441
21576
|
exit(1);
|
|
@@ -21738,7 +21873,7 @@ function formatSubmittedDate(isoDate) {
|
|
|
21738
21873
|
function buildSubmittedFooter(submittedDiffs) {
|
|
21739
21874
|
const proposalCount = submittedDiffs.length;
|
|
21740
21875
|
const proposalWord = proposalCount === 1 ? "change proposal" : "change proposals";
|
|
21741
|
-
return `${proposalCount} ${proposalWord} ignored, run
|
|
21876
|
+
return `${proposalCount} ${proposalWord} ignored, run \`${EXEC_NAME} playbook diff --include-submitted\` to see what's waiting for validation`;
|
|
21742
21877
|
}
|
|
21743
21878
|
async function findTargetDirectories(searchPath, packmindCliHexa) {
|
|
21744
21879
|
const targets = [];
|
|
@@ -22208,7 +22343,7 @@ for these file(s). After this change:
|
|
|
22208
22343
|
- Organization-level settings will NO LONGER apply to these file(s).
|
|
22209
22344
|
- Any future changes to organization agents will NOT affect these file(s).
|
|
22210
22345
|
|
|
22211
|
-
To restore organization settings later, remove all local agents with:
|
|
22346
|
+
To restore organization settings later, remove all local agents with: ${EXEC_NAME} config agents rm <agent1> <agent2> ...`;
|
|
22212
22347
|
logWarningConsole(message);
|
|
22213
22348
|
const confirmed = await deps.promptConfirm("Do you want to proceed?");
|
|
22214
22349
|
if (!confirmed) {
|
|
@@ -22238,7 +22373,7 @@ To restore organization settings later, remove all local agents with: packmind-c
|
|
|
22238
22373
|
}
|
|
22239
22374
|
if (anyUpdated) {
|
|
22240
22375
|
logInfoConsole(
|
|
22241
|
-
`Run "${formatCommand(
|
|
22376
|
+
`Run "${formatCommand(`${EXEC_NAME} install`)}" to apply changes and deploy agent artifacts.`
|
|
22242
22377
|
);
|
|
22243
22378
|
}
|
|
22244
22379
|
exit(0);
|
|
@@ -22464,7 +22599,7 @@ async function removeAgentsHandler(args2, deps) {
|
|
|
22464
22599
|
}
|
|
22465
22600
|
if (anyUpdated) {
|
|
22466
22601
|
logInfoConsole(
|
|
22467
|
-
`Run "${formatCommand(
|
|
22602
|
+
`Run "${formatCommand(`${EXEC_NAME} install`)}" to apply changes and remove agent artifacts.`
|
|
22468
22603
|
);
|
|
22469
22604
|
}
|
|
22470
22605
|
exit(0);
|
|
@@ -22584,11 +22719,12 @@ var import_cmd_ts39 = __toESM(require_cjs());
|
|
|
22584
22719
|
|
|
22585
22720
|
// apps/cli/src/infra/commands/removedCommandHandler.ts
|
|
22586
22721
|
function reportRemovedCommand(notifyError, removedCommand, replacementCommand, carriedFlags = []) {
|
|
22587
|
-
notifyError(`Command "
|
|
22722
|
+
notifyError(`Command "${EXEC_NAME} ${removedCommand}" has been removed.`, {
|
|
22588
22723
|
content: `Use the "${replacementCommand}" command instead:`,
|
|
22589
|
-
exampleCommand: [
|
|
22590
|
-
|
|
22591
|
-
|
|
22724
|
+
exampleCommand: [
|
|
22725
|
+
`${EXEC_NAME} ${replacementCommand}`,
|
|
22726
|
+
...carriedFlags
|
|
22727
|
+
].join(" ")
|
|
22592
22728
|
});
|
|
22593
22729
|
}
|
|
22594
22730
|
function removedTrackHandler(deps) {
|
|
@@ -22671,7 +22807,7 @@ var import_cmd_ts41 = __toESM(require_cjs());
|
|
|
22671
22807
|
var { version: CLI_VERSION6 } = require_package();
|
|
22672
22808
|
var updateCommand = (0, import_cmd_ts41.command)({
|
|
22673
22809
|
name: "update",
|
|
22674
|
-
description:
|
|
22810
|
+
description: `Update ${CANONICAL_EXEC_NAME} to the latest version`,
|
|
22675
22811
|
args: {
|
|
22676
22812
|
check: (0, import_cmd_ts41.flag)({
|
|
22677
22813
|
long: "check",
|
|
@@ -22707,7 +22843,9 @@ function handleTrackingError(error) {
|
|
|
22707
22843
|
}
|
|
22708
22844
|
const statusCode = error?.statusCode;
|
|
22709
22845
|
if (statusCode === 404) {
|
|
22710
|
-
logErrorConsole(
|
|
22846
|
+
logErrorConsole(
|
|
22847
|
+
"Repository tracking is not available on this Packmind server. Ask your administrator to update it."
|
|
22848
|
+
);
|
|
22711
22849
|
process.exit(1);
|
|
22712
22850
|
return;
|
|
22713
22851
|
}
|
|
@@ -22735,9 +22873,9 @@ async function trackingInfoHandler(deps) {
|
|
|
22735
22873
|
if (result.status === "not-tracked") {
|
|
22736
22874
|
logInfoConsole(
|
|
22737
22875
|
result.currentBranchDetached ? `${result.owner}/${result.repo} is not tracked in Packmind. No branch is checked out here \u2014 run ${formatCommand(
|
|
22738
|
-
|
|
22876
|
+
`${EXEC_NAME} git track --branch <name>`
|
|
22739
22877
|
)} to track one.` : `${result.owner}/${result.repo} is not tracked in Packmind. Run ${formatCommand(
|
|
22740
|
-
|
|
22878
|
+
`${EXEC_NAME} git track`
|
|
22741
22879
|
)} to track branch '${result.currentBranch}'.`
|
|
22742
22880
|
);
|
|
22743
22881
|
process.exit(0);
|
|
@@ -22752,7 +22890,7 @@ async function trackingInfoHandler(deps) {
|
|
|
22752
22890
|
process.exit(0);
|
|
22753
22891
|
}
|
|
22754
22892
|
function mismatchWarning(result) {
|
|
22755
|
-
const moveTracking = result.currentBranchDetached ? `${formatCommand(
|
|
22893
|
+
const moveTracking = result.currentBranchDetached ? `${formatCommand(`${EXEC_NAME} git track --update --branch <name>`)} to move tracking to a branch that exists` : `${formatCommand(`${EXEC_NAME} git track --update`)} to move tracking to '${result.currentBranch}'`;
|
|
22756
22894
|
if (!result.trackedBranchExists) {
|
|
22757
22895
|
return `Branch '${result.trackedBranch}' is not in this repository \u2014 deleted after a merge, or never fetched here \u2014 so no distribution is recorded anywhere. Run ${moveTracking}, or ${formatCommand(
|
|
22758
22896
|
"git fetch"
|
|
@@ -22834,14 +22972,14 @@ async function trackHandler(deps) {
|
|
|
22834
22972
|
`Repository ${result.owner}/${result.repo} is already tracked on branch ${result.trackedBranch}. Run ${formatCommand(
|
|
22835
22973
|
// `--update` alone moves tracking to the checked-out branch, which is
|
|
22836
22974
|
// not the target when a branch was named explicitly.
|
|
22837
|
-
deps.branch ?
|
|
22975
|
+
deps.branch ? `${EXEC_NAME} git track --update --branch ${result.branch}` : `${EXEC_NAME} git track --update`
|
|
22838
22976
|
)} to move it to ${result.branch}.`
|
|
22839
22977
|
);
|
|
22840
22978
|
process.exit(1);
|
|
22841
22979
|
return;
|
|
22842
22980
|
case "detached-head":
|
|
22843
22981
|
logErrorConsole(
|
|
22844
|
-
`No branch is checked out for ${result.owner}/${result.repo} \u2014 HEAD is detached. Check a branch out, or name one with ${formatCommand(
|
|
22982
|
+
`No branch is checked out for ${result.owner}/${result.repo} \u2014 HEAD is detached. Check a branch out, or name one with ${formatCommand(`${EXEC_NAME} git track --branch <name>`)}.`
|
|
22845
22983
|
);
|
|
22846
22984
|
process.exit(1);
|
|
22847
22985
|
return;
|
|
@@ -22853,7 +22991,7 @@ async function trackHandler(deps) {
|
|
|
22853
22991
|
return;
|
|
22854
22992
|
case "nothing-tracked":
|
|
22855
22993
|
logErrorConsole(
|
|
22856
|
-
`Nothing is tracked yet \u2014 run ${formatCommand(
|
|
22994
|
+
`Nothing is tracked yet \u2014 run ${formatCommand(`${EXEC_NAME} init`)} or ${formatCommand(`${EXEC_NAME} git track`)} to start tracking.`
|
|
22857
22995
|
);
|
|
22858
22996
|
process.exit(1);
|
|
22859
22997
|
return;
|
|
@@ -22958,7 +23096,17 @@ var gitCommand = (0, import_cmd_ts45.subcommands)({
|
|
|
22958
23096
|
}
|
|
22959
23097
|
});
|
|
22960
23098
|
|
|
23099
|
+
// apps/cli/src/infra/commands/legacyExecNameWarning.ts
|
|
23100
|
+
var LEGACY_EXEC_NAME_WARNING = `\`${LEGACY_EXEC_NAME}\` is deprecated and will stop receiving updates. Use \`${CANONICAL_EXEC_NAME}\` instead.`;
|
|
23101
|
+
function warnOnLegacyExecName(argv = process.argv, logWarning = logWarningConsole) {
|
|
23102
|
+
if (!isLegacyExecName(argv)) {
|
|
23103
|
+
return;
|
|
23104
|
+
}
|
|
23105
|
+
logWarning(LEGACY_EXEC_NAME_WARNING);
|
|
23106
|
+
}
|
|
23107
|
+
|
|
22961
23108
|
// apps/cli/src/main.ts
|
|
23109
|
+
warnOnLegacyExecName();
|
|
22962
23110
|
var { version: CLI_VERSION7 } = require_package();
|
|
22963
23111
|
function findEnvFile() {
|
|
22964
23112
|
const currentDir = process.cwd();
|
|
@@ -22994,11 +23142,11 @@ if (hasEmbeddedWasmFiles()) {
|
|
|
22994
23142
|
}
|
|
22995
23143
|
var args = process.argv.slice(2);
|
|
22996
23144
|
if (args.includes("--version") || args.includes("-v")) {
|
|
22997
|
-
logConsole(
|
|
23145
|
+
logConsole(`${EXEC_NAME} version ${CLI_VERSION7}`);
|
|
22998
23146
|
process.exit(0);
|
|
22999
23147
|
}
|
|
23000
23148
|
var app = (0, import_cmd_ts46.subcommands)({
|
|
23001
|
-
name:
|
|
23149
|
+
name: EXEC_NAME,
|
|
23002
23150
|
description: "Packmind CLI tool",
|
|
23003
23151
|
cmds: {
|
|
23004
23152
|
commands: commandsCommand,
|