@oxagen/cli 5.5.1-235 → 5.5.1-243
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/oxagen.mjs +59 -11
- package/package.json +1 -1
package/oxagen.mjs
CHANGED
|
@@ -33126,7 +33126,7 @@ import { readFileSync as readFileSync12 } from "node:fs";
|
|
|
33126
33126
|
import { dirname as dirname14, resolve as resolve3 } from "node:path";
|
|
33127
33127
|
import { fileURLToPath } from "node:url";
|
|
33128
33128
|
function readVersion() {
|
|
33129
|
-
if (true) return "5.5.1-
|
|
33129
|
+
if (true) return "5.5.1-243";
|
|
33130
33130
|
try {
|
|
33131
33131
|
const here = dirname14(fileURLToPath(import.meta.url));
|
|
33132
33132
|
const pkg = JSON.parse(
|
|
@@ -80552,7 +80552,7 @@ var init_package = __esm({
|
|
|
80552
80552
|
"package.json"() {
|
|
80553
80553
|
package_default = {
|
|
80554
80554
|
name: "@oxagen/cli",
|
|
80555
|
-
version: "5.5.1-
|
|
80555
|
+
version: "5.5.1-243",
|
|
80556
80556
|
description: "Oxagen governance CLI: spend, source tracking, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
|
|
80557
80557
|
type: "module",
|
|
80558
80558
|
main: "./dist/index.js",
|
|
@@ -96656,7 +96656,7 @@ function removalResultSchema(type) {
|
|
|
96656
96656
|
refusal: removalRefusalSchema.nullable()
|
|
96657
96657
|
}).strict();
|
|
96658
96658
|
}
|
|
96659
|
-
var REMOVAL_BULK_MAX, REMOVAL_OUTCOMES, removalOutcomeSchema, removalRefusalSchema, removalPullRequestSchema, removalIdSchema;
|
|
96659
|
+
var REMOVAL_BULK_MAX, REMOVAL_OUTCOMES, removalOutcomeSchema, removalRefusalSchema, removalPullRequestSchema, REMOVAL_MERGES, removalMergeSchema, removalIdSchema;
|
|
96660
96660
|
var init_removal_shared = __esm({
|
|
96661
96661
|
"../../packages/oxagen/src/contracts/removal.shared.ts"() {
|
|
96662
96662
|
"use strict";
|
|
@@ -96684,6 +96684,8 @@ var init_removal_shared = __esm({
|
|
|
96684
96684
|
/** True when Oxagen merged it in solo mode. */
|
|
96685
96685
|
merged: external_exports.boolean()
|
|
96686
96686
|
}).strict();
|
|
96687
|
+
REMOVAL_MERGES = ["now", "review"];
|
|
96688
|
+
removalMergeSchema = external_exports.enum(REMOVAL_MERGES);
|
|
96687
96689
|
removalIdSchema = external_exports.string().trim().min(1).max(256);
|
|
96688
96690
|
}
|
|
96689
96691
|
});
|
|
@@ -96739,7 +96741,17 @@ var init_equipment_delete = __esm({
|
|
|
96739
96741
|
}).strict()
|
|
96740
96742
|
).min(1).max(REMOVAL_BULK_MAX).refine(uniqueRemovalItems, { message: "Name each record once." }),
|
|
96741
96743
|
/** Why, recorded on the retirements and the pull request. */
|
|
96742
|
-
reason: external_exports.string().trim().min(1).max(512).optional()
|
|
96744
|
+
reason: external_exports.string().trim().min(1).max(512).optional(),
|
|
96745
|
+
/**
|
|
96746
|
+
* How the steering pull request lands, for the items the steering repo
|
|
96747
|
+
* holds (#9256). `review` leaves it open for a reviewer in every mode.
|
|
96748
|
+
* `now` merges it at once: in solo mode for anyone, and in team mode
|
|
96749
|
+
* only for an organization Owner or a workspace Admin who signed in, so
|
|
96750
|
+
* the ledger records that nobody reviewed it. Any other caller in team
|
|
96751
|
+
* mode, and a key a person delegated, gets the pull request left open.
|
|
96752
|
+
* Omitted, solo mode merges at once and team mode waits for review.
|
|
96753
|
+
*/
|
|
96754
|
+
merge: removalMergeSchema.optional()
|
|
96743
96755
|
}).strict(),
|
|
96744
96756
|
output: external_exports.object({
|
|
96745
96757
|
items: external_exports.array(removalResultSchema(equipmentRemovalTypeSchema)),
|
|
@@ -96813,8 +96825,21 @@ __export(removal_exports, {
|
|
|
96813
96825
|
describeRemoval: () => describeRemoval,
|
|
96814
96826
|
equipmentRemove: () => equipmentRemove,
|
|
96815
96827
|
guardrailsRemove: () => guardrailsRemove,
|
|
96816
|
-
parseRemovalItems: () => parseRemovalItems
|
|
96828
|
+
parseRemovalItems: () => parseRemovalItems,
|
|
96829
|
+
parseRemovalMerge: () => parseRemovalMerge
|
|
96817
96830
|
});
|
|
96831
|
+
function parseRemovalMerge(value, out) {
|
|
96832
|
+
if (value === void 0) return void 0;
|
|
96833
|
+
const merge2 = REMOVAL_MERGES.find((choice) => choice === value);
|
|
96834
|
+
if (merge2 === void 0) {
|
|
96835
|
+
out.error(
|
|
96836
|
+
`--merge takes ${REMOVAL_MERGES.join(" or ")}. "${value}" is not one.`,
|
|
96837
|
+
"usage"
|
|
96838
|
+
);
|
|
96839
|
+
return null;
|
|
96840
|
+
}
|
|
96841
|
+
return merge2;
|
|
96842
|
+
}
|
|
96818
96843
|
function parseRemovalItems(args, types, out) {
|
|
96819
96844
|
if (args.length === 0) {
|
|
96820
96845
|
out.error("Name at least one record as <type>:<id>.", "usage");
|
|
@@ -96875,9 +96900,15 @@ async function runRemoval(path2, args, types, opts, writer) {
|
|
|
96875
96900
|
const out = createOutput({ json: opts.json }, writer);
|
|
96876
96901
|
const items = parseRemovalItems(args, types, out);
|
|
96877
96902
|
if (!items) return;
|
|
96903
|
+
const merge2 = parseRemovalMerge(opts.merge, out);
|
|
96904
|
+
if (merge2 === null) return;
|
|
96878
96905
|
const scope = scopeOrRefuse(opts.workspaceSlug, out);
|
|
96879
96906
|
if (!scope) return;
|
|
96880
|
-
const body2 =
|
|
96907
|
+
const body2 = {
|
|
96908
|
+
items,
|
|
96909
|
+
...opts.reason ? { reason: opts.reason } : {},
|
|
96910
|
+
...merge2 === void 0 ? {} : { merge: merge2 }
|
|
96911
|
+
};
|
|
96881
96912
|
let answer;
|
|
96882
96913
|
try {
|
|
96883
96914
|
answer = await apiPostOrThrow(path2, body2, scope);
|
|
@@ -111118,7 +111149,7 @@ function checkRecordClassification(record2, ctx2, paths = {
|
|
|
111118
111149
|
});
|
|
111119
111150
|
}
|
|
111120
111151
|
}
|
|
111121
|
-
var recordKindSchema3, steeringPrKindSchema, proposalKindSchema, RECORD_KINDS2, STEERING_PR_KINDS, GOVERNANCE_LINEAGE, recordForceSchema2, constraintEffectSchema, publishedSharingScopeSchema, appendKindSchema, proposalStatusSchema, proposalStateSchema, repositoryProviderSchema, governanceModeSchema, GOVERNANCE_MODES2, checkNameSchema, CHECK_NAMES, steeringCheckNameSchema, STEERING_CHECK_NAMES, instant4, checkResultSchema, checkFindingSchema, RECORD_LINEAGE_ID, lineageIdSchema, proposedRecordSchema, proposalSupportSchema, proposalIdSchema, proposalViewSchema, publishedRecordSchema;
|
|
111152
|
+
var recordKindSchema3, steeringPrKindSchema, proposalKindSchema, RECORD_KINDS2, STEERING_PR_KINDS, GOVERNANCE_LINEAGE, recordForceSchema2, constraintEffectSchema, publishedSharingScopeSchema, appendKindSchema, proposalStatusSchema, proposalStateSchema, repositoryProviderSchema, governanceModeSchema, GOVERNANCE_MODES2, checkNameSchema, CHECK_NAMES, steeringCheckNameSchema, STEERING_CHECK_NAMES, instant4, checkResultSchema, checkFindingSchema, RECORD_LINEAGE_ID, lineageIdSchema, proposedRecordSchema, proposalSupportSchema, proposalIdSchema, proposalViewSchema, pendingRemovalSchema, publishedRecordSchema;
|
|
111122
111153
|
var init_context_steering_shared = __esm({
|
|
111123
111154
|
"../../packages/oxagen/src/contracts/context.steering.shared.ts"() {
|
|
111124
111155
|
"use strict";
|
|
@@ -111319,6 +111350,12 @@ var init_context_steering_shared = __esm({
|
|
|
111319
111350
|
createdAt: instant4,
|
|
111320
111351
|
updatedAt: instant4
|
|
111321
111352
|
}).strict();
|
|
111353
|
+
pendingRemovalSchema = external_exports.object({
|
|
111354
|
+
/** The pull request's row, which `merge_steering_pr` takes. */
|
|
111355
|
+
proposalId: external_exports.string().min(1),
|
|
111356
|
+
number: external_exports.number().int().positive(),
|
|
111357
|
+
url: external_exports.string().url()
|
|
111358
|
+
}).strict();
|
|
111322
111359
|
publishedRecordSchema = external_exports.object({
|
|
111323
111360
|
id: external_exports.string().regex(/^ctr_[0-9A-Za-z]+$/),
|
|
111324
111361
|
lineageId: external_exports.string(),
|
|
@@ -200938,27 +200975,38 @@ function addRemovalCommands(program2) {
|
|
|
200938
200975
|
description: "Agents, runtimes, MCP servers, toolbelts, skills and steering records",
|
|
200939
200976
|
deleteDescription: "Delete agents, runtimes, MCP servers, toolbelts, skills or steering records. A record a run names is kept and hidden. Records in the steering repo leave through one steering pull request, merged at once in solo mode",
|
|
200940
200977
|
types: "agent, runtime, mcp, toolbelt, skill or steering",
|
|
200941
|
-
run: "equipmentRemove"
|
|
200978
|
+
run: "equipmentRemove",
|
|
200979
|
+
// Only Equipment's records leave through a steering pull request.
|
|
200980
|
+
merges: true
|
|
200942
200981
|
},
|
|
200943
200982
|
{
|
|
200944
200983
|
noun: "guardrails",
|
|
200945
200984
|
description: "Auto-approval rules, off switches, mandates and spend budgets",
|
|
200946
200985
|
deleteDescription: "Delete auto-approval rules, off switches, mandates or spend budgets. Each stops applying at once and is kept for the runs that name it",
|
|
200947
200986
|
types: "approval_rule, kill_switch, mandate or spend_budget",
|
|
200948
|
-
run: "guardrailsRemove"
|
|
200987
|
+
run: "guardrailsRemove",
|
|
200988
|
+
merges: false
|
|
200949
200989
|
}
|
|
200950
200990
|
];
|
|
200951
200991
|
for (const group of groups) {
|
|
200952
|
-
program2.command(group.noun).description(group.description).command("delete").alias("rm").description(group.deleteDescription).argument(
|
|
200992
|
+
const command2 = program2.command(group.noun).description(group.description).command("delete").alias("rm").description(group.deleteDescription).argument(
|
|
200953
200993
|
"<records...>",
|
|
200954
200994
|
`Each record as <type>:<id>, where the type is ${group.types}. Up to 100`
|
|
200955
|
-
).option("--reason <text>", "Why, recorded with each deletion")
|
|
200995
|
+
).option("--reason <text>", "Why, recorded with each deletion");
|
|
200996
|
+
if (group.merges) {
|
|
200997
|
+
command2.option(
|
|
200998
|
+
"--merge <how>",
|
|
200999
|
+
"now or review. review leaves the steering pull request open for a reviewer. now merges it at once in solo mode, as the default does"
|
|
201000
|
+
);
|
|
201001
|
+
}
|
|
201002
|
+
command2.option("--yes", "Delete without asking").option("--workspace-slug <slug>", WORKSPACE_SLUG_HELP).option("--json", "Output the answer as JSON").action(
|
|
200956
201003
|
async (records, opts) => {
|
|
200957
201004
|
const what = records.length === 1 ? `Deleting ${records[0]}` : `Deleting ${records.length} records`;
|
|
200958
201005
|
if (!await confirmsIrreversible(what, opts.yes)) return;
|
|
200959
201006
|
const removal = await Promise.resolve().then(() => (init_removal(), removal_exports));
|
|
200960
201007
|
await removal[group.run](records, {
|
|
200961
201008
|
reason: opts.reason,
|
|
201009
|
+
...opts.merge === void 0 ? {} : { merge: opts.merge },
|
|
200962
201010
|
workspaceSlug: opts.workspaceSlug,
|
|
200963
201011
|
json: opts.json
|
|
200964
201012
|
});
|
package/package.json
CHANGED