@oxagen/cli 3.0.1-712 → 3.0.1-715
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 +71 -13
- package/package.json +1 -1
package/oxagen.mjs
CHANGED
|
@@ -29810,7 +29810,7 @@ import { readFileSync as readFileSync10 } from "node:fs";
|
|
|
29810
29810
|
import { dirname as dirname9, resolve as resolve3 } from "node:path";
|
|
29811
29811
|
import { fileURLToPath } from "node:url";
|
|
29812
29812
|
function readVersion() {
|
|
29813
|
-
if (true) return "3.0.1-
|
|
29813
|
+
if (true) return "3.0.1-715";
|
|
29814
29814
|
try {
|
|
29815
29815
|
const here = dirname9(fileURLToPath(import.meta.url));
|
|
29816
29816
|
const pkg = JSON.parse(
|
|
@@ -72708,7 +72708,7 @@ var init_package = __esm({
|
|
|
72708
72708
|
"package.json"() {
|
|
72709
72709
|
package_default = {
|
|
72710
72710
|
name: "@oxagen/cli",
|
|
72711
|
-
version: "3.0.1-
|
|
72711
|
+
version: "3.0.1-715",
|
|
72712
72712
|
description: "Oxagen governance CLI: spend, source tracking, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
|
|
72713
72713
|
type: "module",
|
|
72714
72714
|
main: "./dist/index.js",
|
|
@@ -93033,7 +93033,9 @@ __export(src_exports, {
|
|
|
93033
93033
|
HARNESS_RENDERERS: () => HARNESS_RENDERERS,
|
|
93034
93034
|
HOOK_TIMEOUT_SECONDS: () => HOOK_TIMEOUT_SECONDS,
|
|
93035
93035
|
INSTALLABLE: () => INSTALLABLE,
|
|
93036
|
+
LOCAL_SETTINGS_FILE: () => LOCAL_SETTINGS_FILE,
|
|
93036
93037
|
PROJECT_DIR_NAME: () => PROJECT_DIR_NAME,
|
|
93038
|
+
PROJECT_SETTINGS_FILE: () => PROJECT_SETTINGS_FILE,
|
|
93037
93039
|
checkSteeringFreshness: () => checkSteeringFreshness,
|
|
93038
93040
|
evaluateGate: () => evaluateGate,
|
|
93039
93041
|
execGit: () => execGit,
|
|
@@ -94165,6 +94167,7 @@ __export(steering_exports, {
|
|
|
94165
94167
|
});
|
|
94166
94168
|
import { execFileSync } from "node:child_process";
|
|
94167
94169
|
import { existsSync as existsSync32, realpathSync as realpathSync12 } from "node:fs";
|
|
94170
|
+
import { homedir as homedir14 } from "node:os";
|
|
94168
94171
|
import {
|
|
94169
94172
|
dirname as dirname40,
|
|
94170
94173
|
join as join73,
|
|
@@ -94181,16 +94184,25 @@ function locateProject(start, timeoutMs = 5e3) {
|
|
|
94181
94184
|
const gitRoot = rawGitRoot === null ? null : realpathOr2(rawGitRoot);
|
|
94182
94185
|
const from = realpathOr2(start);
|
|
94183
94186
|
if (gitRoot !== null) return { root: gitRoot, insideGit: true };
|
|
94187
|
+
const home = realpathOr2(homedir14());
|
|
94184
94188
|
let dir = from;
|
|
94185
94189
|
for (; ; ) {
|
|
94186
|
-
if (
|
|
94187
|
-
|
|
94188
|
-
if (dir === root) return { root: from, insideGit: false };
|
|
94190
|
+
if (hasProjectSteering(dir, home)) return { root: dir, insideGit: false };
|
|
94191
|
+
if (dir === home || dir === root) return { root: from, insideGit: false };
|
|
94189
94192
|
const parent = dirname40(dir);
|
|
94190
94193
|
if (parent === dir) return { root: from, insideGit: false };
|
|
94191
94194
|
dir = parent;
|
|
94192
94195
|
}
|
|
94193
94196
|
}
|
|
94197
|
+
function hasProjectSteering(root, home = realpathOr2(homedir14())) {
|
|
94198
|
+
if (!existsSync32(join73(root, PROJECT_DIR_NAME))) return false;
|
|
94199
|
+
if (root !== home) return true;
|
|
94200
|
+
return [
|
|
94201
|
+
workspaceLinkPath(root),
|
|
94202
|
+
join73(root, PROJECT_DIR_NAME, PROJECT_SETTINGS_FILE),
|
|
94203
|
+
join73(root, PROJECT_DIR_NAME, LOCAL_SETTINGS_FILE)
|
|
94204
|
+
].some((path2) => existsSync32(path2));
|
|
94205
|
+
}
|
|
94194
94206
|
function realpathOr2(path2) {
|
|
94195
94207
|
try {
|
|
94196
94208
|
return realpathSync12(path2);
|
|
@@ -94710,7 +94722,7 @@ async function steeringGate(opts = {}, writer = stdoutWriter, cwd = process.cwd(
|
|
|
94710
94722
|
const allowNetwork = opts.network !== false;
|
|
94711
94723
|
const budget = budgetFrom(HOOK_PATH_BUDGET_MS);
|
|
94712
94724
|
const location = locateProject(cwd, Math.min(5e3, budget.remaining()));
|
|
94713
|
-
if (!
|
|
94725
|
+
if (!hasProjectSteering(location.root) && !location.insideGit && !budget.expired()) {
|
|
94714
94726
|
process.exitCode = 0;
|
|
94715
94727
|
return;
|
|
94716
94728
|
}
|
|
@@ -94845,7 +94857,7 @@ var init_steering_record_label = __esm({
|
|
|
94845
94857
|
});
|
|
94846
94858
|
|
|
94847
94859
|
// ../../packages/oxagen/src/contracts/run.shared.ts
|
|
94848
|
-
var IN_APP_AGENT_SURFACES, RUN_PUBLIC_ID_BODY, RUN_PUBLIC_ID_REGEX, MODEL_CLASS_REPLAY_SURFACE, RUN_STATUSES, TACHO_SESSION_SURFACES, LATEST_ACTIVITY_MESSAGES, LATEST_ACTIVITY_TEXT_MAX;
|
|
94860
|
+
var IN_APP_AGENT_SURFACES, RUN_PUBLIC_ID_BODY, RUN_PUBLIC_ID_REGEX, MODEL_CLASS_REPLAY_SURFACE, RUN_STATUSES, RUN_STATES, TACHO_SESSION_SURFACES, LATEST_ACTIVITY_MESSAGES, LATEST_ACTIVITY_TEXT_MAX;
|
|
94849
94861
|
var init_run_shared = __esm({
|
|
94850
94862
|
"../../packages/oxagen/src/contracts/run.shared.ts"() {
|
|
94851
94863
|
"use strict";
|
|
@@ -94854,6 +94866,14 @@ var init_run_shared = __esm({
|
|
|
94854
94866
|
RUN_PUBLIC_ID_REGEX = new RegExp(`^${RUN_PUBLIC_ID_BODY}$`);
|
|
94855
94867
|
MODEL_CLASS_REPLAY_SURFACE = "model_class_replay";
|
|
94856
94868
|
RUN_STATUSES = ["live", "sealed", "halted"];
|
|
94869
|
+
RUN_STATES = [
|
|
94870
|
+
"live",
|
|
94871
|
+
"parked",
|
|
94872
|
+
"paused",
|
|
94873
|
+
"ended",
|
|
94874
|
+
"failed",
|
|
94875
|
+
"halted"
|
|
94876
|
+
];
|
|
94857
94877
|
TACHO_SESSION_SURFACES = [
|
|
94858
94878
|
...IN_APP_AGENT_SURFACES,
|
|
94859
94879
|
MODEL_CLASS_REPLAY_SURFACE
|
|
@@ -104076,7 +104096,7 @@ var init_kinds_shared = __esm({
|
|
|
104076
104096
|
});
|
|
104077
104097
|
|
|
104078
104098
|
// ../../packages/oxagen/src/contracts/run.list.ts
|
|
104079
|
-
var runPublicIdSchema, frameSeqSchema, runStatusSchema, runOutcomeSchema, runCostSchema, replayGradeSchema, generatedRunSummarySchema, editedRunSummarySchema, runSummarySchema, latestActivitySchema, operatorKindSchema, RUN_OPERATOR_ROLES, runOperatorRoleSchema, runModelSchema, runMachineSnapshotSchema, runMachineSchema, runSandboxSchema, COMMAND_BLOCKS, HOST_POLL_WINDOW_MS, RUN_PULL_REQUEST_MAX, runPullRequestSchema, runDiffSchema, runAttributionSchema, RUN_PULL_REQUEST_FILTERS, RUN_PAUSE_STATES, runPauseSchema, RUN_REPLAY_FILTERS, RUN_SORT_KEYS, RUN_LIST_TOTAL_BOUND, RUN_LABEL_MAX, runWorkOrderRefSchema, runKindSchema, runItemSchema, runList;
|
|
104099
|
+
var runPublicIdSchema, frameSeqSchema, runStatusSchema, runStateSchema, RUN_LIST_KINDS_MAX, runOutcomeSchema, runCostSchema, replayGradeSchema, generatedRunSummarySchema, editedRunSummarySchema, runSummarySchema, latestActivitySchema, operatorKindSchema, RUN_OPERATOR_ROLES, runOperatorRoleSchema, runModelSchema, runMachineSnapshotSchema, runMachineSchema, runSandboxSchema, COMMAND_BLOCKS, HOST_POLL_WINDOW_MS, RUN_PULL_REQUEST_MAX, runPullRequestSchema, runDiffSchema, runAttributionSchema, RUN_PULL_REQUEST_FILTERS, RUN_PAUSE_STATES, runPauseSchema, RUN_REPLAY_FILTERS, RUN_SORT_KEYS, RUN_LIST_TOTAL_BOUND, RUN_LABEL_MAX, runWorkOrderRefSchema, runKindSchema, runItemSchema, runList;
|
|
104080
104100
|
var init_run_list = __esm({
|
|
104081
104101
|
"../../packages/oxagen/src/contracts/run.list.ts"() {
|
|
104082
104102
|
"use strict";
|
|
@@ -104093,6 +104113,8 @@ var init_run_list = __esm({
|
|
|
104093
104113
|
runPublicIdSchema = external_exports.string().regex(RUN_PUBLIC_ID_REGEX, "a run public id (arun_\u2026 or tse_\u2026)");
|
|
104094
104114
|
frameSeqSchema = external_exports.string().regex(/^\d{1,19}$/, "a frame sequence (up to 19 decimal digits)");
|
|
104095
104115
|
runStatusSchema = external_exports.enum(RUN_STATUSES);
|
|
104116
|
+
runStateSchema = external_exports.enum(RUN_STATES);
|
|
104117
|
+
RUN_LIST_KINDS_MAX = 50;
|
|
104096
104118
|
runOutcomeSchema = external_exports.enum([
|
|
104097
104119
|
"running",
|
|
104098
104120
|
"completed",
|
|
@@ -104362,6 +104384,12 @@ var init_run_list = __esm({
|
|
|
104362
104384
|
*/
|
|
104363
104385
|
operatorRole: runOperatorRoleSchema.nullable(),
|
|
104364
104386
|
status: runStatusSchema,
|
|
104387
|
+
/**
|
|
104388
|
+
* The run's state in `RUN_STATES`: the lifecycle split by the pause in
|
|
104389
|
+
* force and a pending approval, the rule the `state` filter lists by.
|
|
104390
|
+
* Absent where the reader did not read both.
|
|
104391
|
+
*/
|
|
104392
|
+
state: runStateSchema.optional(),
|
|
104365
104393
|
outcome: runOutcomeSchema,
|
|
104366
104394
|
/** Distinct turns; null when the store could not count them. */
|
|
104367
104395
|
turns: external_exports.number().int().nonnegative().nullable(),
|
|
@@ -104406,6 +104434,17 @@ var init_run_list = __esm({
|
|
|
104406
104434
|
* could not read the workspace's run kinds.
|
|
104407
104435
|
*/
|
|
104408
104436
|
kind: runKindSchema.optional(),
|
|
104437
|
+
/**
|
|
104438
|
+
* How much work the run links, for a list that shows the counts before
|
|
104439
|
+
* a person opens the run: the pull requests the run's change set links
|
|
104440
|
+
* (`forge.pull_request_runs`, #5949), and the work items `get_run_work`
|
|
104441
|
+
* lists for it. `list_runs` answers it when the input sets `linkedWork`,
|
|
104442
|
+
* and leaves it out when the counts could not be read.
|
|
104443
|
+
*/
|
|
104444
|
+
linkedWork: external_exports.object({
|
|
104445
|
+
pullRequests: external_exports.number().int().nonnegative(),
|
|
104446
|
+
workItems: external_exports.number().int().nonnegative()
|
|
104447
|
+
}).strict().optional(),
|
|
104409
104448
|
/** RFC 3339. */
|
|
104410
104449
|
startedAt: external_exports.string().datetime(),
|
|
104411
104450
|
/**
|
|
@@ -104646,7 +104685,7 @@ var init_run_list = __esm({
|
|
|
104646
104685
|
runList = registerCapability({
|
|
104647
104686
|
name: "list_runs",
|
|
104648
104687
|
domain: "run",
|
|
104649
|
-
description: "List the runs recorded in this workspace, newest first: root sessions in one cursor-paged list, with the operator, the model, the machine, status, counts and metered cost each row recorded. The in-app assistant's turns are listed too, marked inApp; they take no run commands. Given own, it lists only the runs the caller operated.",
|
|
104688
|
+
description: "List the runs recorded in this workspace, newest first: root sessions in one cursor-paged list, with the operator, the model, the machine, status, counts and metered cost each row recorded. The in-app assistant's turns are listed too, marked inApp; they take no run commands. Given own, it lists only the runs the caller operated. Given state or kind, it lists only the runs in those states or of those kinds, and given linkedWork, each row counts the pull requests and work items it links.",
|
|
104650
104689
|
mode: "sync",
|
|
104651
104690
|
surfaces: ["api", "mcp", "agent", "cli"],
|
|
104652
104691
|
layers: ["schema", "api", "mcp", "cli", "unit", "docs", "app"],
|
|
@@ -104679,6 +104718,19 @@ var init_run_list = __esm({
|
|
|
104679
104718
|
*/
|
|
104680
104719
|
/** Only runs in these statuses. Absent lists every status. */
|
|
104681
104720
|
status: external_exports.array(runStatusSchema).min(1).max(3).optional(),
|
|
104721
|
+
/**
|
|
104722
|
+
* Only runs in these states (`RUN_STATES`): the lifecycle split into
|
|
104723
|
+
* live, parked, paused, ended, failed and halted. Sent with `status`, a
|
|
104724
|
+
* run must match both. Absent lists every state.
|
|
104725
|
+
*/
|
|
104726
|
+
state: external_exports.array(runStateSchema).min(1).max(RUN_STATES.length).optional(),
|
|
104727
|
+
/**
|
|
104728
|
+
* Only runs whose kind in force is one of these, by the kind's id in
|
|
104729
|
+
* the workspace's run kinds (`list_kinds`). The kind in force is a
|
|
104730
|
+
* person's pick, else the classifier's, else Unknown, so Unknown's id
|
|
104731
|
+
* also lists every run no one classified. Absent lists every kind.
|
|
104732
|
+
*/
|
|
104733
|
+
kind: external_exports.array(kindIdSchema).min(1).max(RUN_LIST_KINDS_MAX).optional(),
|
|
104682
104734
|
/** Only runs published at these tiers. */
|
|
104683
104735
|
tier: external_exports.array(external_exports.enum(GRADE_ENFORCEMENT_TIERS)).min(1).max(4).optional(),
|
|
104684
104736
|
/** Only runs with these grades; `not_recorded` matches a null grade. */
|
|
@@ -104729,7 +104781,13 @@ var init_run_list = __esm({
|
|
|
104729
104781
|
* every root session the workspace holds, so a read that does not show
|
|
104730
104782
|
* it leaves this out and pays nothing for it. Runs sets it.
|
|
104731
104783
|
*/
|
|
104732
|
-
countLive: external_exports.boolean().optional()
|
|
104784
|
+
countLive: external_exports.boolean().optional(),
|
|
104785
|
+
/**
|
|
104786
|
+
* `true` answers each row's `linkedWork`: how many pull requests and
|
|
104787
|
+
* work items the run links. Two indexed reads a page, so a caller that
|
|
104788
|
+
* shows no counts leaves it off.
|
|
104789
|
+
*/
|
|
104790
|
+
linkedWork: external_exports.boolean().optional()
|
|
104733
104791
|
}).strict(),
|
|
104734
104792
|
output: external_exports.object({
|
|
104735
104793
|
runs: external_exports.array(runItemSchema).max(100),
|
|
@@ -108721,13 +108779,13 @@ __export(steering_import_exports, {
|
|
|
108721
108779
|
harnessHome: () => harnessHome
|
|
108722
108780
|
});
|
|
108723
108781
|
import { readdir as readdir5, realpath as realpath3, stat as stat5 } from "node:fs/promises";
|
|
108724
|
-
import { homedir as
|
|
108782
|
+
import { homedir as homedir15 } from "node:os";
|
|
108725
108783
|
import { basename as basename11, extname, join as join75, relative as relative10, sep as sep13 } from "node:path";
|
|
108726
108784
|
function envDir2(env, key) {
|
|
108727
108785
|
const value = env[key];
|
|
108728
108786
|
return value === void 0 || value.trim() === "" ? null : value;
|
|
108729
108787
|
}
|
|
108730
|
-
function harnessHome(harness, env = process.env, home =
|
|
108788
|
+
function harnessHome(harness, env = process.env, home = homedir15()) {
|
|
108731
108789
|
switch (harness) {
|
|
108732
108790
|
case "claude-code": {
|
|
108733
108791
|
const config2 = envDir2(env, "CLAUDE_CONFIG_DIR") ?? join75(home, ".claude");
|
|
@@ -108955,7 +109013,7 @@ function parseTarget(value, writer) {
|
|
|
108955
109013
|
writer
|
|
108956
109014
|
);
|
|
108957
109015
|
}
|
|
108958
|
-
async function handleSteeringImport(paths, opts, writer = stdoutWriter, env = process.env, home =
|
|
109016
|
+
async function handleSteeringImport(paths, opts, writer = stdoutWriter, env = process.env, home = homedir15()) {
|
|
108959
109017
|
const harness = parseHarness(opts.harness, writer);
|
|
108960
109018
|
if (paths.length === 0 && harness === void 0) {
|
|
108961
109019
|
failCommand(
|
package/package.json
CHANGED