camstack 1.0.4 → 1.0.5

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.
@@ -26571,6 +26571,69 @@ var integrationsCapability = {
26571
26571
  })
26572
26572
  }
26573
26573
  };
26574
+ var jobKindSchema = external_exports.enum([
26575
+ "install",
26576
+ "update",
26577
+ "uninstall",
26578
+ "restart"
26579
+ ]);
26580
+ var taskPhaseSchema = external_exports.enum([
26581
+ "queued",
26582
+ "fetching",
26583
+ "staged",
26584
+ "validating",
26585
+ "applying",
26586
+ "restarting",
26587
+ "applied",
26588
+ "done",
26589
+ "failed",
26590
+ "skipped"
26591
+ ]);
26592
+ var taskTargetSchema = external_exports.enum(["framework", "addon"]);
26593
+ var taskLogEntrySchema = external_exports.object({
26594
+ tsMs: external_exports.number(),
26595
+ nodeId: external_exports.string(),
26596
+ packageName: external_exports.string(),
26597
+ phase: taskPhaseSchema,
26598
+ message: external_exports.string()
26599
+ });
26600
+ var lifecycleTaskSchema = external_exports.object({
26601
+ taskId: external_exports.string(),
26602
+ nodeId: external_exports.string(),
26603
+ packageName: external_exports.string(),
26604
+ fromVersion: external_exports.string().nullable(),
26605
+ toVersion: external_exports.string(),
26606
+ target: taskTargetSchema,
26607
+ phase: taskPhaseSchema,
26608
+ stagedPath: external_exports.string().nullable(),
26609
+ attempts: external_exports.number(),
26610
+ steps: external_exports.array(taskLogEntrySchema),
26611
+ error: external_exports.string().nullable(),
26612
+ startedAtMs: external_exports.number().nullable(),
26613
+ finishedAtMs: external_exports.number().nullable()
26614
+ });
26615
+ var lifecycleJobStateSchema = external_exports.enum([
26616
+ "running",
26617
+ "completed",
26618
+ "failed",
26619
+ "partially-failed",
26620
+ "cancelled"
26621
+ ]);
26622
+ var lifecycleJobScopeSchema = external_exports.enum([
26623
+ "single",
26624
+ "bulk",
26625
+ "cluster"
26626
+ ]);
26627
+ var lifecycleJobSchema = external_exports.object({
26628
+ jobId: external_exports.string(),
26629
+ kind: jobKindSchema,
26630
+ createdAtMs: external_exports.number(),
26631
+ createdBy: external_exports.string(),
26632
+ scope: lifecycleJobScopeSchema,
26633
+ tasks: external_exports.array(lifecycleTaskSchema),
26634
+ state: lifecycleJobStateSchema,
26635
+ schemaVersion: external_exports.literal(1)
26636
+ });
26574
26637
  var LogLevelSchema$1 = external_exports.enum([
26575
26638
  "debug",
26576
26639
  "info",
@@ -26720,7 +26783,7 @@ var BulkUpdatePhaseSchema = external_exports.enum([
26720
26783
  "restarting",
26721
26784
  "finalizing"
26722
26785
  ]);
26723
- var BulkUpdateStateSchema = external_exports.object({
26786
+ external_exports.object({
26724
26787
  id: external_exports.string(),
26725
26788
  nodeId: external_exports.string(),
26726
26789
  startedAtMs: external_exports.number(),
@@ -26938,54 +27001,6 @@ var addonsCapability = {
26938
27001
  kind: "mutation",
26939
27002
  auth: "admin"
26940
27003
  }),
26941
- /**
26942
- * Kicks off a server-side bulk update operation and returns the bulk
26943
- * id immediately. The operation runs asynchronously; observe progress
26944
- * via the `AddonsBulkUpdateProgress` event or `getBulkUpdateState`.
26945
- * Items with `isSystem: true` use `deferRestart` — the hub restarts
26946
- * ONCE at the end of the system phase, after all system packages are
26947
- * installed.
26948
- *
26949
- * `items[].version` is REQUIRED — callers must pass the resolved
26950
- * version from `listUpdates`. There is no `'latest'` default here
26951
- * (unlike `updatePackage`) to guarantee deterministic bulk rolls.
26952
- */
26953
- startBulkUpdate: method(external_exports.object({
26954
- nodeId: external_exports.string(),
26955
- items: external_exports.array(external_exports.object({
26956
- name: external_exports.string(),
26957
- version: external_exports.string(),
26958
- isSystem: external_exports.boolean()
26959
- })).readonly()
26960
- }), external_exports.object({ id: external_exports.string() }), {
26961
- kind: "mutation",
26962
- auth: "admin"
26963
- }),
26964
- /**
26965
- * Returns the current state of a bulk update by id.
26966
- * Returns `null` if the id is unknown or has been auto-cleaned
26967
- * (5 minutes after `completedAt` the record is evicted from memory).
26968
- */
26969
- getBulkUpdateState: method(external_exports.object({ id: external_exports.string() }), BulkUpdateStateSchema.nullable(), { auth: "admin" }),
26970
- /**
26971
- * Cancels an in-flight bulk update. The update loop exits after the
26972
- * currently-processing item completes — cancellation is not
26973
- * instantaneous. Has no effect once the `restarting` phase has been
26974
- * entered (the hub is already shutting down at that point).
26975
- * Returns `{ cancelled: false }` if the id is unknown, the operation
26976
- * has already completed, or the `restarting` phase is active.
26977
- */
26978
- cancelBulkUpdate: method(external_exports.object({ id: external_exports.string() }), external_exports.object({ cancelled: external_exports.boolean() }), {
26979
- kind: "mutation",
26980
- auth: "admin"
26981
- }),
26982
- /**
26983
- * Lists all currently active (non-completed) bulk updates.
26984
- * If `nodeId` is provided, filters to only bulk updates targeting
26985
- * that node. Useful for restoring an in-progress banner on a fresh
26986
- * page load when the UI reconnects mid-operation.
26987
- */
26988
- listActiveBulkUpdates: method(external_exports.object({ nodeId: external_exports.string().optional() }), external_exports.array(BulkUpdateStateSchema).readonly(), { auth: "admin" }),
26989
27004
  getVersions: method(external_exports.object({ name: external_exports.string() }), external_exports.array(PackageVersionInfoSchema).readonly()),
26990
27005
  restartAddon: method(external_exports.object({ addonId: external_exports.string() }), RestartAddonResultSchema, {
26991
27006
  kind: "mutation",
@@ -27022,6 +27037,51 @@ var addonsCapability = {
27022
27037
  auth: "admin"
27023
27038
  }),
27024
27039
  custom: method(CustomActionInputSchema, external_exports.unknown(), { kind: "mutation" }),
27040
+ /**
27041
+ * Start a lifecycle job (install / update / uninstall / restart) for one
27042
+ * or more addon packages. Returns the `jobId` immediately — the job runs
27043
+ * asynchronously. Observe progress via `EventCategory.AddonsJobProgress` /
27044
+ * `AddonsJobLog` events or poll `getJob`.
27045
+ *
27046
+ * For a single-addon update on the hub the provider also routes
27047
+ * `updatePackage` through this path so the fast swap + atomic-restart
27048
+ * path (`applyStagedAddonUpdate`) is always used.
27049
+ */
27050
+ startJob: method(external_exports.object({
27051
+ kind: external_exports.enum([
27052
+ "install",
27053
+ "update",
27054
+ "uninstall",
27055
+ "restart"
27056
+ ]),
27057
+ targets: external_exports.array(external_exports.object({
27058
+ name: external_exports.string().min(1),
27059
+ version: external_exports.string().min(1)
27060
+ })).min(1),
27061
+ nodeIds: external_exports.array(external_exports.string()).optional()
27062
+ }), external_exports.object({ jobId: external_exports.string() }), {
27063
+ kind: "mutation",
27064
+ auth: "admin"
27065
+ }),
27066
+ /**
27067
+ * Retrieve a lifecycle job by id. Returns `null` when the id is unknown
27068
+ * (e.g. evicted after the retention window).
27069
+ */
27070
+ getJob: method(external_exports.object({ jobId: external_exports.string() }), lifecycleJobSchema.nullable(), { auth: "admin" }),
27071
+ /**
27072
+ * List lifecycle jobs. When `activeOnly` is true, only jobs still in
27073
+ * `running` state are returned.
27074
+ */
27075
+ listJobs: method(external_exports.object({ activeOnly: external_exports.boolean().optional() }), external_exports.array(lifecycleJobSchema), { auth: "admin" }),
27076
+ /**
27077
+ * Cancel a lifecycle job that is queued but not yet actively running.
27078
+ * Returns `{ cancelled: false }` if the job is unknown, already in a
27079
+ * terminal state, or actively executing (cannot abort mid-flight).
27080
+ */
27081
+ cancelJob: method(external_exports.object({ jobId: external_exports.string() }), external_exports.object({ cancelled: external_exports.boolean() }), {
27082
+ kind: "mutation",
27083
+ auth: "admin"
27084
+ }),
27025
27085
  onAddonLogs: method(external_exports.object({
27026
27086
  addonId: external_exports.string(),
27027
27087
  level: LogLevelSchema$1.optional()
@@ -27078,7 +27138,7 @@ var METHOD_ACCESS_MAP = Object.freeze({
27078
27138
  addonId: null,
27079
27139
  access: "create"
27080
27140
  },
27081
- "addons.cancelBulkUpdate": {
27141
+ "addons.cancelJob": {
27082
27142
  capName: "addons",
27083
27143
  capScope: "system",
27084
27144
  addonId: null,
@@ -27108,7 +27168,7 @@ var METHOD_ACCESS_MAP = Object.freeze({
27108
27168
  addonId: null,
27109
27169
  access: "view"
27110
27170
  },
27111
- "addons.getBulkUpdateState": {
27171
+ "addons.getJob": {
27112
27172
  capName: "addons",
27113
27173
  capScope: "system",
27114
27174
  addonId: null,
@@ -27156,19 +27216,19 @@ var METHOD_ACCESS_MAP = Object.freeze({
27156
27216
  addonId: null,
27157
27217
  access: "view"
27158
27218
  },
27159
- "addons.listActiveBulkUpdates": {
27219
+ "addons.listCapabilityProviders": {
27160
27220
  capName: "addons",
27161
27221
  capScope: "system",
27162
27222
  addonId: null,
27163
27223
  access: "view"
27164
27224
  },
27165
- "addons.listCapabilityProviders": {
27225
+ "addons.listFrameworkPackages": {
27166
27226
  capName: "addons",
27167
27227
  capScope: "system",
27168
27228
  addonId: null,
27169
27229
  access: "view"
27170
27230
  },
27171
- "addons.listFrameworkPackages": {
27231
+ "addons.listJobs": {
27172
27232
  capName: "addons",
27173
27233
  capScope: "system",
27174
27234
  addonId: null,
@@ -27252,7 +27312,7 @@ var METHOD_ACCESS_MAP = Object.freeze({
27252
27312
  addonId: null,
27253
27313
  access: "create"
27254
27314
  },
27255
- "addons.startBulkUpdate": {
27315
+ "addons.startJob": {
27256
27316
  capName: "addons",
27257
27317
  capScope: "system",
27258
27318
  addonId: null,
@@ -31239,6 +31299,32 @@ var CAP_PROVIDER_KIND_MAP = Object.freeze({
31239
31299
  "network-access": "ingress",
31240
31300
  "smtp-provider": "email"
31241
31301
  });
31302
+ var frameworkSwapPackageSchema = external_exports.object({
31303
+ name: external_exports.string(),
31304
+ stagedPath: external_exports.string(),
31305
+ backupPath: external_exports.string(),
31306
+ toVersion: external_exports.string(),
31307
+ fromVersion: external_exports.string().nullable()
31308
+ });
31309
+ var pendingFrameworkSwapSchema = external_exports.object({
31310
+ jobId: external_exports.string(),
31311
+ taskId: external_exports.string(),
31312
+ packages: external_exports.array(frameworkSwapPackageSchema),
31313
+ requestedAtMs: external_exports.number(),
31314
+ schemaVersion: external_exports.literal(1)
31315
+ });
31316
+ var frameworkSwapConfirmSchema = external_exports.object({
31317
+ jobId: external_exports.string(),
31318
+ taskId: external_exports.string(),
31319
+ backups: external_exports.array(external_exports.object({
31320
+ name: external_exports.string(),
31321
+ backupPath: external_exports.string(),
31322
+ livePath: external_exports.string()
31323
+ })),
31324
+ appliedAtMs: external_exports.number(),
31325
+ bootAttempts: external_exports.number(),
31326
+ schemaVersion: external_exports.literal(1)
31327
+ });
31242
31328
  function sleep(ms) {
31243
31329
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
31244
31330
  }
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runDiscover
4
- } from "./chunk-ACMTCEYY.js";
4
+ } from "./chunk-JJEKVTZK.js";
5
5
  import "./chunk-K3NQKI34.js";
6
6
 
7
7
  // src/cli.ts
@@ -608,7 +608,7 @@ function isUnknown(_value) {
608
608
  return true;
609
609
  }
610
610
  async function resolveServerInteractive(presetNamespace) {
611
- const { discoverNodes, resolveHubFromDiscovered } = await import("./discover-WN3J572U.js");
611
+ const { discoverNodes, resolveHubFromDiscovered } = await import("./discover-2Y5KB2PB.js");
612
612
  if (presetNamespace) {
613
613
  const spinner4 = clack.spinner();
614
614
  spinner4.start(`Discovering hub on LAN (namespace "${presetNamespace}")`);
@@ -3,7 +3,7 @@ import {
3
3
  discoverNodes,
4
4
  resolveHubFromDiscovered,
5
5
  runDiscover
6
- } from "./chunk-ACMTCEYY.js";
6
+ } from "./chunk-JJEKVTZK.js";
7
7
  import "./chunk-K3NQKI34.js";
8
8
  export {
9
9
  discoverNodes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstack",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "CLI tool for managing and running CamStack server",
5
5
  "keywords": [
6
6
  "camstack",