@senticor/hive 1.106.0 → 1.108.0

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.
Files changed (2) hide show
  1. package/hive.cjs +86 -7
  2. package/package.json +1 -1
package/hive.cjs CHANGED
@@ -8112,12 +8112,12 @@ var require_dist = __commonJS({
8112
8112
  throw new Error(`Unknown format "${name}"`);
8113
8113
  return f;
8114
8114
  };
8115
- function addFormats3(ajv, list, fs8, exportName) {
8115
+ function addFormats3(ajv, list, fs9, exportName) {
8116
8116
  var _a3;
8117
8117
  var _b;
8118
8118
  (_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
8119
8119
  for (const f of list)
8120
- ajv.addFormat(f, fs8[f]);
8120
+ ajv.addFormat(f, fs9[f]);
8121
8121
  }
8122
8122
  module2.exports = exports2 = formatsPlugin;
8123
8123
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -10429,22 +10429,22 @@ var artifactName = injectedString(
10429
10429
  true ? "hive-cli" : void 0
10430
10430
  ) || String(process.env.HIVE_CLI_ARTIFACT_NAME || "hive-cli").trim() || "hive-cli";
10431
10431
  var packageVersion = injectedString(
10432
- true ? "1.106.0" : void 0
10432
+ true ? "1.108.0" : void 0
10433
10433
  ) || String(process.env.HIVE_CLI_PACKAGE_VERSION || "").trim() || readPackageVersion();
10434
10434
  var releaseVersion = injectedString(
10435
- true ? "1.106.0" : void 0
10435
+ true ? "1.108.0" : void 0
10436
10436
  ) || String(process.env.HIVE_CLI_RELEASE_VERSION || "").trim() || packageVersion || "dev";
10437
10437
  var releaseChannel = injectedString(
10438
10438
  true ? "final" : void 0
10439
10439
  ) || String(process.env.HIVE_CLI_RELEASE_CHANNEL || "").trim() || (releaseVersion.includes("-rc.") ? "rc" : releaseVersion === "dev" ? "dev" : "final");
10440
10440
  var buildCommit = injectedString(
10441
- true ? "48aa1fc7531184a00a024672d64c5f7e98fe7c30" : void 0
10441
+ true ? "464ec65468d353c4b0bf77826b36a99463c87578" : void 0
10442
10442
  ) || String(process.env.HIVE_CLI_BUILD_COMMIT || "").trim() || "unknown";
10443
10443
  var buildTimestamp = injectedString(
10444
- true ? "2026-11-04T16:55:28Z" : void 0
10444
+ true ? "2026-11-04T20:13:38Z" : void 0
10445
10445
  ) || String(process.env.HIVE_CLI_BUILD_TIMESTAMP || "").trim() || "unknown";
10446
10446
  var ociRef = injectedString(
10447
- true ? "registry.onstackit.cloud/senticor/hive-cli:1.106.0" : void 0
10447
+ true ? "registry.onstackit.cloud/senticor/hive-cli:1.108.0" : void 0
10448
10448
  ) || String(process.env.HIVE_CLI_OCI_REF || "").trim() || `registry.onstackit.cloud/senticor/${artifactName}:${releaseVersion}`;
10449
10449
  var RELEASE_INFO = Object.freeze({
10450
10450
  packageVersion,
@@ -37045,6 +37045,84 @@ var privacy = defineCommand({
37045
37045
  }
37046
37046
  });
37047
37047
 
37048
+ // src/commands/masking.ts
37049
+ init_cjs_shims();
37050
+ var import_node_fs15 = __toESM(require("fs"), 1);
37051
+ var DEFAULT_TIMEOUT_S = 1800;
37052
+ var DEFAULT_POLL_MS = 2e3;
37053
+ var SUCCESS_STATES = /* @__PURE__ */ new Set(["awaiting_review", "exported"]);
37054
+ var FAILURE_STATES = /* @__PURE__ */ new Set(["failed", "cancelled", "completed"]);
37055
+ var submitArgs = withArgs({
37056
+ file: { type: "positional", required: true, description: "PDF to mask" },
37057
+ wait: { type: "boolean", description: "Wait until the run is awaiting review or exported (auto mode); exit 1 on failed or cancelled" },
37058
+ timeout: { type: "string", description: `With --wait: give up after this many seconds (default ${DEFAULT_TIMEOUT_S})` },
37059
+ pollMs: { type: "string", description: `With --wait: milliseconds between status checks (default ${DEFAULT_POLL_MS})` }
37060
+ });
37061
+ function positiveInt(args, flag, fallback) {
37062
+ const raw = args[flag];
37063
+ if (raw === void 0 || raw === null || raw === "") return fallback;
37064
+ const n = Number(raw);
37065
+ if (!Number.isInteger(n) || n <= 0) throw commandError("INVALID_ARGUMENT", 2, `--${flag === "pollMs" ? "poll-ms" : flag} must be a positive integer`);
37066
+ return n;
37067
+ }
37068
+ var masking = defineCommand({
37069
+ meta: { name: "masking", description: "Masking runs: submit a PDF" },
37070
+ subCommands: {
37071
+ submit: defineCommand({
37072
+ meta: { name: "submit", description: "Submit a PDF to a mission's masking route (--mission, optional --wait)" },
37073
+ args: submitArgs,
37074
+ async run({ args }) {
37075
+ const missionId = requireMissionContext(args, "masking submit");
37076
+ const timeoutS = positiveInt(args, "timeout", DEFAULT_TIMEOUT_S);
37077
+ const pollMs = positiveInt(args, "pollMs", DEFAULT_POLL_MS);
37078
+ const bytes = import_node_fs15.default.readFileSync(String(args.file));
37079
+ const { client, fmt } = ctx(args);
37080
+ printContextNotice(args, { mission: true });
37081
+ const submitted = await client.post(`/api/missions/${enc(missionId)}/masking/submit`, { bytesBase64: bytes.toString("base64") });
37082
+ const body = submitted.data ?? {};
37083
+ if (!isHttpOk(submitted.status) || body.ok !== true || !body.sha256) {
37084
+ output(submitted.data, fmt);
37085
+ process.exitCode ||= 1;
37086
+ return;
37087
+ }
37088
+ const statusPath = `/api/missions/${enc(missionId)}/masking/runs/${enc(body.sha256)}`;
37089
+ const readState2 = async () => {
37090
+ const res = await client.get(statusPath);
37091
+ if (!isHttpOk(res.status)) {
37092
+ remoteFailureHandled();
37093
+ return "unknown";
37094
+ }
37095
+ return String(res.data?.run?.state ?? "unknown");
37096
+ };
37097
+ const result = (state2, extra = {}) => ({
37098
+ ok: !FAILURE_STATES.has(state2) && !("error" in extra),
37099
+ runId: body.runId,
37100
+ sha256: body.sha256,
37101
+ started: body.started === true,
37102
+ state: state2,
37103
+ ...extra
37104
+ });
37105
+ let state = await readState2();
37106
+ if (args.wait) {
37107
+ const deadline = Date.now() + timeoutS * 1e3;
37108
+ while (!SUCCESS_STATES.has(state) && !FAILURE_STATES.has(state) && Date.now() < deadline) {
37109
+ await sleep(pollMs);
37110
+ state = await readState2();
37111
+ }
37112
+ if (!SUCCESS_STATES.has(state) && !FAILURE_STATES.has(state)) {
37113
+ output(result(state, { error: "MASKING_WAIT_TIMEOUT", message: `run not finished after ${timeoutS}s; check again with the run id` }), fmt);
37114
+ process.exitCode = 1;
37115
+ return;
37116
+ }
37117
+ }
37118
+ const final = result(state);
37119
+ output(final, fmt);
37120
+ if (!final.ok) process.exitCode = 1;
37121
+ }
37122
+ })
37123
+ }
37124
+ });
37125
+
37048
37126
  // src/commands/intelligence.ts
37049
37127
  init_cjs_shims();
37050
37128
  var cortexArgs = withArgs({
@@ -37981,6 +38059,7 @@ var main = defineCommand({
37981
38059
  ops,
37982
38060
  // Domain — Privacy
37983
38061
  privacy,
38062
+ masking,
37984
38063
  // Domain — Intelligence
37985
38064
  cortex,
37986
38065
  firewall,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senticor/hive",
3
- "version": "1.106.0",
3
+ "version": "1.108.0",
4
4
  "description": "Cognitive Hive OS — unified CLI",
5
5
  "type": "commonjs",
6
6
  "bin": {