@scheduler-systems/gal-run 0.0.319 → 0.0.321
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +191 -23
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3970,7 +3970,7 @@ var cliVersion, defaultApiUrl, BUILD_CONSTANTS, constants_default;
|
|
|
3970
3970
|
var init_constants = __esm({
|
|
3971
3971
|
"src/constants.ts"() {
|
|
3972
3972
|
"use strict";
|
|
3973
|
-
cliVersion = true ? "0.0.
|
|
3973
|
+
cliVersion = true ? "0.0.321" : "0.0.0-dev";
|
|
3974
3974
|
defaultApiUrl = true ? "https://api.gal.run" : "http://localhost:3000";
|
|
3975
3975
|
BUILD_CONSTANTS = Object.freeze([cliVersion, defaultApiUrl]);
|
|
3976
3976
|
constants_default = BUILD_CONSTANTS;
|
|
@@ -4880,7 +4880,7 @@ function detectEnvironment() {
|
|
|
4880
4880
|
return "dev";
|
|
4881
4881
|
}
|
|
4882
4882
|
try {
|
|
4883
|
-
const version = true ? "0.0.
|
|
4883
|
+
const version = true ? "0.0.321" : void 0;
|
|
4884
4884
|
if (version && version.includes("-local")) {
|
|
4885
4885
|
return "dev";
|
|
4886
4886
|
}
|
|
@@ -5249,7 +5249,7 @@ function getId() {
|
|
|
5249
5249
|
}
|
|
5250
5250
|
function getCliVersion() {
|
|
5251
5251
|
try {
|
|
5252
|
-
return true ? "0.0.
|
|
5252
|
+
return true ? "0.0.321" : "0.0.0-dev";
|
|
5253
5253
|
} catch {
|
|
5254
5254
|
return "0.0.0-dev";
|
|
5255
5255
|
}
|
|
@@ -6047,6 +6047,20 @@ var init_sso = __esm({
|
|
|
6047
6047
|
}
|
|
6048
6048
|
});
|
|
6049
6049
|
|
|
6050
|
+
// ../../packages/types/dist/memory.js
|
|
6051
|
+
var init_memory = __esm({
|
|
6052
|
+
"../../packages/types/dist/memory.js"() {
|
|
6053
|
+
"use strict";
|
|
6054
|
+
}
|
|
6055
|
+
});
|
|
6056
|
+
|
|
6057
|
+
// ../../packages/types/dist/secrets.js
|
|
6058
|
+
var init_secrets = __esm({
|
|
6059
|
+
"../../packages/types/dist/secrets.js"() {
|
|
6060
|
+
"use strict";
|
|
6061
|
+
}
|
|
6062
|
+
});
|
|
6063
|
+
|
|
6050
6064
|
// ../../packages/types/dist/index.js
|
|
6051
6065
|
var GAL_TERMS_URL, GAL_PRIVACY_URL, PLATFORM_PATTERNS;
|
|
6052
6066
|
var init_dist2 = __esm({
|
|
@@ -6101,6 +6115,8 @@ var init_dist2 = __esm({
|
|
|
6101
6115
|
init_mal_cross_project();
|
|
6102
6116
|
init_design_project();
|
|
6103
6117
|
init_sso();
|
|
6118
|
+
init_memory();
|
|
6119
|
+
init_secrets();
|
|
6104
6120
|
GAL_TERMS_URL = "https://scheduler-systems.com/legal/en/gal-terms.pdf";
|
|
6105
6121
|
GAL_PRIVACY_URL = "https://scheduler-systems.com/legal/en/gal-privacy.pdf";
|
|
6106
6122
|
PLATFORM_PATTERNS = {
|
|
@@ -6482,7 +6498,7 @@ var init_organization = __esm({
|
|
|
6482
6498
|
"../../packages/core/src/domain/organization.ts"() {
|
|
6483
6499
|
"use strict";
|
|
6484
6500
|
Organization = class {
|
|
6485
|
-
constructor(id, name, installationId2, accountType, totalRepos, totalConfigs, totalCommands, totalHooks, settings, commands, hooks, platforms, hookSettings, planTier, seatLimit, stripeCustomerId, stripeSubscriptionId, manualGrant, configRepoEnabled, configRepoUrl, configRepoCreatedAt, lastConfigSyncAt, lastScanAt,
|
|
6501
|
+
constructor(id, name, installationId2, accountType, totalRepos, totalConfigs, totalCommands, totalHooks, settings, commands, hooks, platforms, hookSettings, planTier, seatLimit, stripeCustomerId, stripeSubscriptionId, manualGrant, configRepoEnabled, configRepoUrl, configRepoCreatedAt, lastConfigSyncAt, lastScanAt, audienceTierRef, audienceTierSource, entitledFeatures, installedByGithubId, installedByLogin, createdAt = /* @__PURE__ */ new Date(), updatedAt = /* @__PURE__ */ new Date()) {
|
|
6486
6502
|
this.id = id;
|
|
6487
6503
|
this.name = name;
|
|
6488
6504
|
this.installationId = installationId2;
|
|
@@ -6506,7 +6522,9 @@ var init_organization = __esm({
|
|
|
6506
6522
|
this.configRepoCreatedAt = configRepoCreatedAt;
|
|
6507
6523
|
this.lastConfigSyncAt = lastConfigSyncAt;
|
|
6508
6524
|
this.lastScanAt = lastScanAt;
|
|
6509
|
-
this.
|
|
6525
|
+
this.audienceTierRef = audienceTierRef;
|
|
6526
|
+
this.audienceTierSource = audienceTierSource;
|
|
6527
|
+
this.entitledFeatures = entitledFeatures;
|
|
6510
6528
|
this.installedByGithubId = installedByGithubId;
|
|
6511
6529
|
this.installedByLogin = installedByLogin;
|
|
6512
6530
|
this.createdAt = createdAt;
|
|
@@ -6621,6 +6639,13 @@ var init_team_member = __esm({
|
|
|
6621
6639
|
isAdmin() {
|
|
6622
6640
|
return this.galRole === "owner" || this.galRole === "admin";
|
|
6623
6641
|
}
|
|
6642
|
+
/**
|
|
6643
|
+
* Check if member has security permissions (owner, admin, or security role).
|
|
6644
|
+
* Admin automatically inherits security permissions per #4245.
|
|
6645
|
+
*/
|
|
6646
|
+
isSecurity() {
|
|
6647
|
+
return this.galRole === "owner" || this.galRole === "admin" || this.galRole === "security";
|
|
6648
|
+
}
|
|
6624
6649
|
/**
|
|
6625
6650
|
* Check if member is a developer
|
|
6626
6651
|
*/
|
|
@@ -7596,6 +7621,13 @@ var init_MigrationRegistry = __esm({
|
|
|
7596
7621
|
}
|
|
7597
7622
|
});
|
|
7598
7623
|
|
|
7624
|
+
// ../../packages/core/src/migrations/register-all-migrations.ts
|
|
7625
|
+
var init_register_all_migrations = __esm({
|
|
7626
|
+
"../../packages/core/src/migrations/register-all-migrations.ts"() {
|
|
7627
|
+
"use strict";
|
|
7628
|
+
}
|
|
7629
|
+
});
|
|
7630
|
+
|
|
7599
7631
|
// ../../packages/core/src/index.ts
|
|
7600
7632
|
var init_src = __esm({
|
|
7601
7633
|
"../../packages/core/src/index.ts"() {
|
|
@@ -7639,6 +7671,7 @@ var init_src = __esm({
|
|
|
7639
7671
|
init_convenience_model_telemetry();
|
|
7640
7672
|
init_DiscoveryInsightValidator();
|
|
7641
7673
|
init_MigrationRegistry();
|
|
7674
|
+
init_register_all_migrations();
|
|
7642
7675
|
}
|
|
7643
7676
|
});
|
|
7644
7677
|
|
|
@@ -7736,7 +7769,7 @@ function getHiddenCommandError(commandName, context) {
|
|
|
7736
7769
|
const requiredAudience = flag.audience ?? "public";
|
|
7737
7770
|
if (!meetsAudience(resolvedContext.audience, requiredAudience)) {
|
|
7738
7771
|
if (requiredAudience === "internal") {
|
|
7739
|
-
reasons.push("Requires
|
|
7772
|
+
reasons.push("Requires an org with internal audienceTier");
|
|
7740
7773
|
} else if (requiredAudience === "partners") {
|
|
7741
7774
|
reasons.push("Requires partner access");
|
|
7742
7775
|
}
|
|
@@ -7761,7 +7794,7 @@ function getHiddenCommandError(commandName, context) {
|
|
|
7761
7794
|
" gal mcp doctor Verify MCP connectivity and tools",
|
|
7762
7795
|
" gal --help Show all available commands",
|
|
7763
7796
|
"",
|
|
7764
|
-
"Requires
|
|
7797
|
+
"Requires an org with internal audienceTier. Run: gal auth login"
|
|
7765
7798
|
);
|
|
7766
7799
|
if (flag?.environments && !flag.environments.includes(resolvedContext.environment)) {
|
|
7767
7800
|
lines.push("For environment override, set: GAL_ENVIRONMENT=dev");
|
|
@@ -7856,7 +7889,7 @@ var init_feature_flags2 = __esm({
|
|
|
7856
7889
|
COMMAND_CATEGORIES = {
|
|
7857
7890
|
// Core convenience package (always visible)
|
|
7858
7891
|
core: ["auth", "sync", "mcp", "feedback", "update", "hooks", "status", "discover", "approve", "approved-config", "propose", "workspace", "fetch", "join", "scan", "memory", "policy"],
|
|
7859
|
-
// Internal development commands (requires
|
|
7892
|
+
// Internal development commands (requires org with internal audienceTier; GAL_INTERNAL=true is dev/test override only)
|
|
7860
7893
|
internal: [
|
|
7861
7894
|
"admin",
|
|
7862
7895
|
"agent",
|
|
@@ -11796,7 +11829,7 @@ var init_organization2 = __esm({
|
|
|
11796
11829
|
"../../packages/core/dist/domain/organization.js"() {
|
|
11797
11830
|
"use strict";
|
|
11798
11831
|
Organization2 = class {
|
|
11799
|
-
constructor(id, name, installationId2, accountType, totalRepos, totalConfigs, totalCommands, totalHooks, settings, commands, hooks, platforms, hookSettings, planTier, seatLimit, stripeCustomerId, stripeSubscriptionId, manualGrant, configRepoEnabled, configRepoUrl, configRepoCreatedAt, lastConfigSyncAt, lastScanAt,
|
|
11832
|
+
constructor(id, name, installationId2, accountType, totalRepos, totalConfigs, totalCommands, totalHooks, settings, commands, hooks, platforms, hookSettings, planTier, seatLimit, stripeCustomerId, stripeSubscriptionId, manualGrant, configRepoEnabled, configRepoUrl, configRepoCreatedAt, lastConfigSyncAt, lastScanAt, audienceTierRef, audienceTierSource, entitledFeatures, installedByGithubId, installedByLogin, createdAt = /* @__PURE__ */ new Date(), updatedAt = /* @__PURE__ */ new Date()) {
|
|
11800
11833
|
this.id = id;
|
|
11801
11834
|
this.name = name;
|
|
11802
11835
|
this.installationId = installationId2;
|
|
@@ -11820,7 +11853,9 @@ var init_organization2 = __esm({
|
|
|
11820
11853
|
this.configRepoCreatedAt = configRepoCreatedAt;
|
|
11821
11854
|
this.lastConfigSyncAt = lastConfigSyncAt;
|
|
11822
11855
|
this.lastScanAt = lastScanAt;
|
|
11823
|
-
this.
|
|
11856
|
+
this.audienceTierRef = audienceTierRef;
|
|
11857
|
+
this.audienceTierSource = audienceTierSource;
|
|
11858
|
+
this.entitledFeatures = entitledFeatures;
|
|
11824
11859
|
this.installedByGithubId = installedByGithubId;
|
|
11825
11860
|
this.installedByLogin = installedByLogin;
|
|
11826
11861
|
this.createdAt = createdAt;
|
|
@@ -12178,6 +12213,13 @@ var init_team_member2 = __esm({
|
|
|
12178
12213
|
isAdmin() {
|
|
12179
12214
|
return this.galRole === "owner" || this.galRole === "admin";
|
|
12180
12215
|
}
|
|
12216
|
+
/**
|
|
12217
|
+
* Check if member has security permissions (owner, admin, or security role).
|
|
12218
|
+
* Admin automatically inherits security permissions per #4245.
|
|
12219
|
+
*/
|
|
12220
|
+
isSecurity() {
|
|
12221
|
+
return this.galRole === "owner" || this.galRole === "admin" || this.galRole === "security";
|
|
12222
|
+
}
|
|
12181
12223
|
/**
|
|
12182
12224
|
* Check if member is a developer
|
|
12183
12225
|
*/
|
|
@@ -12865,6 +12907,13 @@ var init_MigrationRegistry2 = __esm({
|
|
|
12865
12907
|
}
|
|
12866
12908
|
});
|
|
12867
12909
|
|
|
12910
|
+
// ../../packages/core/dist/migrations/register-all-migrations.js
|
|
12911
|
+
var init_register_all_migrations2 = __esm({
|
|
12912
|
+
"../../packages/core/dist/migrations/register-all-migrations.js"() {
|
|
12913
|
+
"use strict";
|
|
12914
|
+
}
|
|
12915
|
+
});
|
|
12916
|
+
|
|
12868
12917
|
// ../../packages/core/dist/index.js
|
|
12869
12918
|
var init_dist3 = __esm({
|
|
12870
12919
|
"../../packages/core/dist/index.js"() {
|
|
@@ -12908,6 +12957,7 @@ var init_dist3 = __esm({
|
|
|
12908
12957
|
init_convenience_model_telemetry2();
|
|
12909
12958
|
init_DiscoveryInsightValidator2();
|
|
12910
12959
|
init_MigrationRegistry2();
|
|
12960
|
+
init_register_all_migrations2();
|
|
12911
12961
|
}
|
|
12912
12962
|
});
|
|
12913
12963
|
|
|
@@ -13142,7 +13192,12 @@ var init_HttpOrganizationRepository = __esm({
|
|
|
13142
13192
|
data.configRepoCreatedAt,
|
|
13143
13193
|
data.lastConfigSyncAt,
|
|
13144
13194
|
data.lastScanAt ? new Date(data.lastScanAt) : void 0,
|
|
13145
|
-
data.
|
|
13195
|
+
data.audienceTierRef ?? null,
|
|
13196
|
+
// #4220: reads only audienceTierRef (migration removes old audienceTier string)
|
|
13197
|
+
data.audienceTierSource ?? null,
|
|
13198
|
+
// #4089: 'stripe' | 'admin' | null
|
|
13199
|
+
data.entitledFeatures ?? null,
|
|
13200
|
+
// #4201: entitled features from Stripe sync
|
|
13146
13201
|
data.installedByGithubId,
|
|
13147
13202
|
data.installedByLogin,
|
|
13148
13203
|
data.createdAt ? new Date(data.createdAt) : /* @__PURE__ */ new Date(),
|
|
@@ -33692,7 +33747,7 @@ function writeCursorConfig(directory, configData, syncedFiles, syncedItems) {
|
|
|
33692
33747
|
});
|
|
33693
33748
|
}
|
|
33694
33749
|
}
|
|
33695
|
-
function writeClaudeConfig(directory, configData, syncedFiles, syncedItems) {
|
|
33750
|
+
function writeClaudeConfig(directory, configData, syncedFiles, syncedItems, orgName) {
|
|
33696
33751
|
const claudeDir = (0, import_path18.join)(directory, ".claude");
|
|
33697
33752
|
if (configData.instructions?.content) {
|
|
33698
33753
|
const claudeMdPath = (0, import_path18.join)(directory, "CLAUDE.md");
|
|
@@ -33873,9 +33928,9 @@ function writeClaudeConfig(directory, configData, syncedFiles, syncedItems) {
|
|
|
33873
33928
|
});
|
|
33874
33929
|
}
|
|
33875
33930
|
}
|
|
33876
|
-
writeMcpConfig(directory, configData.mcp?.content || "{}", syncedFiles, syncedItems);
|
|
33931
|
+
writeMcpConfig(directory, configData.mcp?.content || "{}", syncedFiles, syncedItems, orgName);
|
|
33877
33932
|
}
|
|
33878
|
-
function writeMcpConfig(directory, mcpContent, syncedFiles, syncedItems) {
|
|
33933
|
+
function writeMcpConfig(directory, mcpContent, syncedFiles, syncedItems, orgName) {
|
|
33879
33934
|
const mcpPath = (0, import_path18.join)(directory, ".mcp.json");
|
|
33880
33935
|
let merged = { mcpServers: {} };
|
|
33881
33936
|
try {
|
|
@@ -33897,7 +33952,8 @@ function writeMcpConfig(directory, mcpContent, syncedFiles, syncedItems) {
|
|
|
33897
33952
|
merged.mcpServers["gal"] = {
|
|
33898
33953
|
type: "http",
|
|
33899
33954
|
transport: "http",
|
|
33900
|
-
url: "https://api.gal.run/mcp"
|
|
33955
|
+
url: "https://api.gal.run/mcp",
|
|
33956
|
+
...orgName ? { headers: { "X-Gal-Organization": orgName } } : {}
|
|
33901
33957
|
};
|
|
33902
33958
|
(0, import_fs19.writeFileSync)(mcpPath, JSON.stringify(merged, null, 2) + "\n", "utf-8");
|
|
33903
33959
|
syncedFiles.push(".mcp.json");
|
|
@@ -34302,7 +34358,7 @@ async function pullApprovedConfig(configRepo, authRepo, orgName, directory, plat
|
|
|
34302
34358
|
if (platform5 === "cursor") {
|
|
34303
34359
|
writeCursorConfig(directory, configData, platformFiles, platformItems);
|
|
34304
34360
|
} else if (platform5 === "claude") {
|
|
34305
|
-
writeClaudeConfig(directory, configData, platformFiles, platformItems);
|
|
34361
|
+
writeClaudeConfig(directory, configData, platformFiles, platformItems, orgName);
|
|
34306
34362
|
writeApprovedClaudeConfig(directory, configData);
|
|
34307
34363
|
} else if (platform5 === "codex") {
|
|
34308
34364
|
writeCodexConfig(directory, configData, platformFiles, platformItems);
|
|
@@ -34973,6 +35029,10 @@ async function refreshInternalStatus(apiUrl, authToken) {
|
|
|
34973
35029
|
const config = ConfigManager.load();
|
|
34974
35030
|
config.internalOrgs = isInternal ? userOrgs : [];
|
|
34975
35031
|
config.internalOrgsCheckedAt = Date.now();
|
|
35032
|
+
if (data.user?.capabilities) {
|
|
35033
|
+
config.capabilities = data.user.capabilities;
|
|
35034
|
+
config.capabilitiesCachedAt = Date.now();
|
|
35035
|
+
}
|
|
34976
35036
|
ConfigManager.save(config);
|
|
34977
35037
|
} catch {
|
|
34978
35038
|
}
|
|
@@ -42357,7 +42417,7 @@ function getCommandDisableReason(commandName, context) {
|
|
|
42357
42417
|
if (flag.environments && !flag.environments.includes(context.environment)) {
|
|
42358
42418
|
return `Available in ${flag.environments.join(", ")}`;
|
|
42359
42419
|
}
|
|
42360
|
-
if (flag.audience === "internal" && !context.isInternal) return "Requires
|
|
42420
|
+
if (flag.audience === "internal" && !context.isInternal) return "Requires org with internal audienceTier";
|
|
42361
42421
|
if (flag.audience === "partners" && !context.isInternal) return "Requires partner access";
|
|
42362
42422
|
return void 0;
|
|
42363
42423
|
}
|
|
@@ -42395,7 +42455,7 @@ function formatCommandDisplay(commands, context) {
|
|
|
42395
42455
|
lines.push(`Environment: ${envLabel}`);
|
|
42396
42456
|
if (context.isInternal) {
|
|
42397
42457
|
if (process.env.GAL_INTERNAL === "true") {
|
|
42398
|
-
lines.push(source_default.dim(` Source: GAL_INTERNAL=true (
|
|
42458
|
+
lines.push(source_default.dim(` Source: GAL_INTERNAL=true (dev/test override)`));
|
|
42399
42459
|
} else {
|
|
42400
42460
|
lines.push(source_default.dim(` Source: org audienceTier='internal' in Firestore (#3323)`));
|
|
42401
42461
|
}
|
|
@@ -42410,7 +42470,7 @@ function formatCommandDisplay(commands, context) {
|
|
|
42410
42470
|
lines.push("");
|
|
42411
42471
|
lines.push(source_default.bold.yellow("Internal Commands"));
|
|
42412
42472
|
if (!context.isInternal) {
|
|
42413
|
-
lines.push(source_default.dim(" Log in with an internal org
|
|
42473
|
+
lines.push(source_default.dim(" Log in with an internal org: gal auth login"));
|
|
42414
42474
|
}
|
|
42415
42475
|
const internalCommands = commands.filter((c) => c.category === "internal");
|
|
42416
42476
|
for (const cmd of internalCommands) {
|
|
@@ -42471,6 +42531,108 @@ var init_flags = __esm({
|
|
|
42471
42531
|
}
|
|
42472
42532
|
});
|
|
42473
42533
|
|
|
42534
|
+
// src/commands/governance.ts
|
|
42535
|
+
async function recordOverride(apiUrl, authToken, payload) {
|
|
42536
|
+
const headers = {
|
|
42537
|
+
"Content-Type": "application/json"
|
|
42538
|
+
};
|
|
42539
|
+
if (authToken) {
|
|
42540
|
+
headers["Authorization"] = `Bearer ${authToken}`;
|
|
42541
|
+
}
|
|
42542
|
+
const response = await fetch(`${apiUrl}/api/governance/overrides`, {
|
|
42543
|
+
method: "POST",
|
|
42544
|
+
headers,
|
|
42545
|
+
body: JSON.stringify(payload)
|
|
42546
|
+
});
|
|
42547
|
+
if (!response.ok) {
|
|
42548
|
+
const body = await response.text().catch(() => "");
|
|
42549
|
+
throw new Error(`API error ${response.status}: ${body.slice(0, 200)}`);
|
|
42550
|
+
}
|
|
42551
|
+
return response.json();
|
|
42552
|
+
}
|
|
42553
|
+
function createGovernanceCommand() {
|
|
42554
|
+
const command = new Command("governance");
|
|
42555
|
+
command.description("Manage and report AI governance decisions");
|
|
42556
|
+
const reportCommand = new Command("report");
|
|
42557
|
+
reportCommand.description("Report an incorrect AI governance decision").requiredOption("--decision <id>", "Decision ID to flag as incorrect").requiredOption("--correct <value>", "The correct value/decision (plain string or JSON)").option("--process-type <type>", `Governance process type: ${VALID_PROCESS_TYPES.join(", ")}`, "auto-approval").option("--org <orgName>", "Organization name").option("--reason <text>", "Optional reason for the correction").option("--json", "Output as JSON").action(async (options) => {
|
|
42558
|
+
const config = ConfigManager.load();
|
|
42559
|
+
const apiUrl = config.apiUrl || process.env.GAL_API_URL || "https://api.gal.run";
|
|
42560
|
+
const authToken = config.authToken;
|
|
42561
|
+
const org = options.org || config.defaultOrg;
|
|
42562
|
+
if (!org) {
|
|
42563
|
+
const msg = "No organization specified. Use --org <orgName> or set a default org.";
|
|
42564
|
+
if (options.json) {
|
|
42565
|
+
console.log(JSON.stringify({ error: msg }));
|
|
42566
|
+
} else {
|
|
42567
|
+
console.error(source_default.red(msg));
|
|
42568
|
+
}
|
|
42569
|
+
process.exit(1);
|
|
42570
|
+
}
|
|
42571
|
+
if (!VALID_PROCESS_TYPES.includes(options.processType)) {
|
|
42572
|
+
const msg = `Invalid process type "${options.processType}". Valid: ${VALID_PROCESS_TYPES.join(", ")}`;
|
|
42573
|
+
if (options.json) {
|
|
42574
|
+
console.log(JSON.stringify({ error: msg }));
|
|
42575
|
+
} else {
|
|
42576
|
+
console.error(source_default.red(msg));
|
|
42577
|
+
}
|
|
42578
|
+
process.exit(1);
|
|
42579
|
+
}
|
|
42580
|
+
let correctedValue;
|
|
42581
|
+
try {
|
|
42582
|
+
correctedValue = JSON.parse(options.correct);
|
|
42583
|
+
} catch {
|
|
42584
|
+
correctedValue = options.correct;
|
|
42585
|
+
}
|
|
42586
|
+
const userId = config.userId ?? config.userEmail ?? "cli-user";
|
|
42587
|
+
try {
|
|
42588
|
+
const result = await recordOverride(apiUrl, authToken, {
|
|
42589
|
+
processType: options.processType,
|
|
42590
|
+
organizationId: org,
|
|
42591
|
+
userId,
|
|
42592
|
+
originalInput: { decisionId: options.decision },
|
|
42593
|
+
originalOutput: { decisionId: options.decision },
|
|
42594
|
+
correctedOutput: { decision: correctedValue, decisionId: options.decision },
|
|
42595
|
+
overrideReason: options.reason
|
|
42596
|
+
});
|
|
42597
|
+
if (options.json) {
|
|
42598
|
+
console.log(JSON.stringify({ success: true, id: result.id, timestamp: result.timestamp }));
|
|
42599
|
+
} else {
|
|
42600
|
+
console.log(source_default.green(`Override recorded \u2014 ID: ${result.id}`));
|
|
42601
|
+
console.log(source_default.dim(`Process: ${options.processType} \xB7 Decision: ${options.decision}`));
|
|
42602
|
+
console.log(source_default.dim("Correction queued for the next model training cycle."));
|
|
42603
|
+
}
|
|
42604
|
+
} catch (err) {
|
|
42605
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
42606
|
+
if (options.json) {
|
|
42607
|
+
console.log(JSON.stringify({ error: message }));
|
|
42608
|
+
} else {
|
|
42609
|
+
console.error(source_default.red(`Failed to record override: ${message}`));
|
|
42610
|
+
}
|
|
42611
|
+
process.exit(1);
|
|
42612
|
+
}
|
|
42613
|
+
});
|
|
42614
|
+
command.addCommand(reportCommand);
|
|
42615
|
+
return command;
|
|
42616
|
+
}
|
|
42617
|
+
var VALID_PROCESS_TYPES;
|
|
42618
|
+
var init_governance = __esm({
|
|
42619
|
+
"src/commands/governance.ts"() {
|
|
42620
|
+
"use strict";
|
|
42621
|
+
init_esm();
|
|
42622
|
+
init_source();
|
|
42623
|
+
init_config_manager();
|
|
42624
|
+
VALID_PROCESS_TYPES = [
|
|
42625
|
+
"auto-approval",
|
|
42626
|
+
"config-copilot",
|
|
42627
|
+
"orchestrator",
|
|
42628
|
+
"discovery",
|
|
42629
|
+
"llm-analysis",
|
|
42630
|
+
"pick-by-ai",
|
|
42631
|
+
"sync-copilot"
|
|
42632
|
+
];
|
|
42633
|
+
}
|
|
42634
|
+
});
|
|
42635
|
+
|
|
42474
42636
|
// src/commands/fleet.ts
|
|
42475
42637
|
function getMachineId() {
|
|
42476
42638
|
const info2 = [
|
|
@@ -44606,7 +44768,7 @@ Examples:
|
|
|
44606
44768
|
return command;
|
|
44607
44769
|
}
|
|
44608
44770
|
var import_fs25, import_path24, import_os18;
|
|
44609
|
-
var
|
|
44771
|
+
var init_memory2 = __esm({
|
|
44610
44772
|
"src/commands/memory.ts"() {
|
|
44611
44773
|
"use strict";
|
|
44612
44774
|
init_esm();
|
|
@@ -54267,6 +54429,7 @@ var init_command_registry = __esm({
|
|
|
54267
54429
|
init_feedback2();
|
|
54268
54430
|
init_fetch();
|
|
54269
54431
|
init_flags();
|
|
54432
|
+
init_governance();
|
|
54270
54433
|
init_fleet();
|
|
54271
54434
|
init_headless();
|
|
54272
54435
|
init_hooks();
|
|
@@ -54274,7 +54437,7 @@ var init_command_registry = __esm({
|
|
|
54274
54437
|
init_join();
|
|
54275
54438
|
init_maintain();
|
|
54276
54439
|
init_mcp();
|
|
54277
|
-
|
|
54440
|
+
init_memory2();
|
|
54278
54441
|
init_policy();
|
|
54279
54442
|
init_propose();
|
|
54280
54443
|
init_protect();
|
|
@@ -54316,6 +54479,7 @@ var init_command_registry = __esm({
|
|
|
54316
54479
|
{ name: "feedback", create: createFeedbackCommand },
|
|
54317
54480
|
{ name: "fetch", create: createFetchCommand },
|
|
54318
54481
|
{ name: "flags", create: createFlagsCommand },
|
|
54482
|
+
{ name: "governance", create: createGovernanceCommand },
|
|
54319
54483
|
{ name: "fleet", create: createFleetCommand },
|
|
54320
54484
|
{ name: "headless", create: createHeadlessCommand },
|
|
54321
54485
|
{ name: "hooks", create: createHooksCommand },
|
|
@@ -54668,6 +54832,10 @@ function refreshOrgMemberships() {
|
|
|
54668
54832
|
const isInternal = user.isInternal === true;
|
|
54669
54833
|
config.internalOrgs = isInternal ? user.organizations : [];
|
|
54670
54834
|
config.internalOrgsCheckedAt = Date.now();
|
|
54835
|
+
if (user.capabilities) {
|
|
54836
|
+
config.capabilities = user.capabilities;
|
|
54837
|
+
config.capabilitiesCachedAt = Date.now();
|
|
54838
|
+
}
|
|
54671
54839
|
if (!(0, import_fs40.existsSync)(UPDATE_CACHE_DIR)) {
|
|
54672
54840
|
(0, import_fs40.mkdirSync)(UPDATE_CACHE_DIR, { recursive: true });
|
|
54673
54841
|
}
|
|
@@ -54689,7 +54857,7 @@ function refreshOrgMemberships() {
|
|
|
54689
54857
|
}
|
|
54690
54858
|
const flagsReq = import_https2.default.get(
|
|
54691
54859
|
`${apiUrl}/feature-flags`,
|
|
54692
|
-
{ timeout: 5e3 },
|
|
54860
|
+
{ timeout: 5e3, headers: { authorization: `Bearer ${config.authToken}` } },
|
|
54693
54861
|
(res) => {
|
|
54694
54862
|
let data = "";
|
|
54695
54863
|
res.on("data", (chunk) => data += chunk);
|
|
@@ -54910,7 +55078,7 @@ var init_index = __esm({
|
|
|
54910
55078
|
});
|
|
54911
55079
|
|
|
54912
55080
|
// src/bootstrap.ts
|
|
54913
|
-
var cliVersion10 = true ? "0.0.
|
|
55081
|
+
var cliVersion10 = true ? "0.0.321" : "0.0.0-dev";
|
|
54914
55082
|
var args = process.argv.slice(2);
|
|
54915
55083
|
var requestedGlobalHelp = args.length === 1 && (args[0] === "--help" || args[0] === "-h");
|
|
54916
55084
|
var requestedVersion = args.length === 1 && (args[0] === "--version" || args[0] === "-V");
|
package/package.json
CHANGED