@camstack/core 0.1.35 → 0.1.36

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.mjs CHANGED
@@ -31,7 +31,7 @@ import { promisify } from "node:util";
31
31
  import { errMsg, parseJsonObject } from "@camstack/types";
32
32
  import * as vm from "node:vm";
33
33
  import * as os from "node:os";
34
- //#region ../types/dist/index-BBVUwOlZ.mjs
34
+ //#region ../types/dist/index-YnRVILXN.mjs
35
35
  var MODEL_FORMATS = [
36
36
  "onnx",
37
37
  "coreml",
@@ -4808,7 +4808,9 @@ var MeshPeerSchema = z.object({
4808
4808
  id: z.string(),
4809
4809
  /** Hostname / device name as shown in the mesh dashboard. */
4810
4810
  hostname: z.string(),
4811
- /** Mesh IP(s). Multiple when the peer is dual-stacked. */
4811
+ /** MagicDNS / mesh DNS name (e.g. `peer-foo.tail-abc.ts.net`). Empty when the provider doesn't support DNS or peer-side resolution is disabled. */
4812
+ magicDns: z.string(),
4813
+ /** Mesh IPv4 / IPv6 addresses combined. Multiple when dual-stacked. */
4812
4814
  addresses: z.array(z.string()).readonly(),
4813
4815
  /** Operating system reported by the peer (informational). */
4814
4816
  os: z.string().optional(),
@@ -4817,7 +4819,36 @@ var MeshPeerSchema = z.object({
4817
4819
  /** Last-seen timestamp (epoch ms). 0 when never seen. */
4818
4820
  lastSeenMs: z.number(),
4819
4821
  /** True for the row representing the current host. */
4820
- isSelf: z.boolean()
4822
+ isSelf: z.boolean(),
4823
+ /**
4824
+ * Connection mode to this peer:
4825
+ * - `direct`: NAT-traversed P2P (UDP punched)
4826
+ * - `relay`: traffic relayed through provider edge (Tailscale DERP)
4827
+ * - `idle`: peer reachable but no recent traffic / handshake
4828
+ */
4829
+ connection: z.enum([
4830
+ "direct",
4831
+ "relay",
4832
+ "idle"
4833
+ ]),
4834
+ /** DERP region / relay node identifier when `connection: relay`. Null otherwise. */
4835
+ relay: z.string().nullable(),
4836
+ /** Last successful handshake timestamp (epoch ms). 0 when never. */
4837
+ lastHandshakeMs: z.number(),
4838
+ /** Bytes received from this peer since the daemon started. */
4839
+ rxBytes: z.number(),
4840
+ /** Bytes transmitted to this peer since the daemon started. */
4841
+ txBytes: z.number(),
4842
+ /** ACL tags this peer carries (e.g. `["tag:server"]`). Empty when human-owned. */
4843
+ tags: z.array(z.string()).readonly(),
4844
+ /** True when the peer advertises itself as an exit-node candidate. */
4845
+ exitNodeOption: z.boolean(),
4846
+ /** Subnet routes the peer advertises (e.g. `["192.168.1.0/24"]`). */
4847
+ advertisedRoutes: z.array(z.string()).readonly(),
4848
+ /** Owner account login (e.g. `foo@example.com`). Null for tagged peers. */
4849
+ userLogin: z.string().nullable(),
4850
+ /** Pre-auth key / machine-key expiry (epoch ms). Null when keys don't expire. */
4851
+ keyExpiry: z.number().nullable()
4821
4852
  });
4822
4853
  var MeshStatusSchema = z.object({
4823
4854
  /** True when the host is joined and the daemon reports healthy. */
@@ -4831,7 +4862,37 @@ var MeshStatusSchema = z.object({
4831
4862
  /** Every endpoint this provider exposes for the current host. */
4832
4863
  endpoints: z.array(MeshEndpointSchema$1).readonly(),
4833
4864
  /** Last error from the daemon, when not joined. */
4834
- error: z.string().optional()
4865
+ error: z.string().optional(),
4866
+ /**
4867
+ * Tenant / tailnet / network display name (Tailscale = tailnet
4868
+ * domain, Headscale = namespace, ZeroTier = network name). Empty
4869
+ * pre-join. Per-provider semantics, common slot.
4870
+ */
4871
+ tenantName: z.string(),
4872
+ /**
4873
+ * Mesh DNS suffix when the provider exposes peer-resolvable DNS
4874
+ * (Tailscale MagicDNS, Headscale MagicDNS, …). Empty when the
4875
+ * provider doesn't ship DNS (e.g. ZeroTier).
4876
+ */
4877
+ magicDnsSuffix: z.string(),
4878
+ /**
4879
+ * Authenticated user / account login bound to this host. Null when
4880
+ * the provider authenticates with a long-lived network token rather
4881
+ * than a user account (e.g. ZeroTier API token).
4882
+ */
4883
+ userLogin: z.string().nullable(),
4884
+ /**
4885
+ * Provider control-plane URL (Tailscale SaaS `https://login.tailscale.com`,
4886
+ * self-hosted Headscale, ZeroTier Central, …). Empty when not
4887
+ * applicable (rare).
4888
+ */
4889
+ controlPlaneUrl: z.string(),
4890
+ /**
4891
+ * Machine-key / node-key expiry (epoch ms). Null when the provider
4892
+ * doesn't rotate keys for the bound host. Operator-facing surface
4893
+ * for "your access expires on …" banners.
4894
+ */
4895
+ keyExpiry: z.number().nullable()
4835
4896
  });
4836
4897
  method(z.void(), MeshStatusSchema), method(z.object({
4837
4898
  /** Provider-specific auth key. For Tailscale this is the
@@ -4843,7 +4904,7 @@ method(z.void(), MeshStatusSchema), method(z.object({
4843
4904
  /** Optional hostname override the host should advertise once joined. */
4844
4905
  hostname: z.string().optional() }), z.object({
4845
4906
  /** Authentication URL the operator should open in a browser. */
4846
- loginUrl: z.string() }), { kind: "mutation" }), method(z.void(), z.object({ left: z.literal(true) }), { kind: "mutation" }), method(z.void(), z.object({ peers: z.array(MeshPeerSchema).readonly() })), method(z.object({
4907
+ loginUrl: z.string() }), { kind: "mutation" }), method(z.void(), z.object({ left: z.literal(true) }), { kind: "mutation" }), method(z.void(), z.object({ loggedOut: z.literal(true) }), { kind: "mutation" }), method(z.void(), z.object({ peers: z.array(MeshPeerSchema).readonly() })), method(z.object({
4847
4908
  /** Optional auth key — when provided, probes the key validity
4848
4909
  * against the provider's API. Omit when already joined to
4849
4910
  * just ping the daemon. */
@@ -4882,13 +4943,26 @@ var MeshProviderInfoSchema = z.object({
4882
4943
  /** Active endpoints (mesh IP + MagicDNS + optional public Funnel). */
4883
4944
  endpoints: z.array(MeshEndpointSchema).readonly(),
4884
4945
  /** Last error reported by the provider. */
4885
- error: z.string().optional()
4946
+ error: z.string().optional(),
4947
+ /** Tenant / tailnet / network display name. Empty pre-join. */
4948
+ tenantName: z.string(),
4949
+ /** Mesh DNS suffix (e.g. tailXXXX.ts.net). Empty when not configured. */
4950
+ magicDnsSuffix: z.string(),
4951
+ /** Authenticated user / account login. Null for token-only providers. */
4952
+ userLogin: z.string().nullable(),
4953
+ /** Provider control-plane URL. */
4954
+ controlPlaneUrl: z.string(),
4955
+ /** Machine-key expiry (epoch ms). Null when keys don't rotate. */
4956
+ keyExpiry: z.number().nullable()
4886
4957
  });
4887
4958
  method(z.void(), z.array(MeshProviderInfoSchema).readonly()), method(z.object({
4888
4959
  addonId: z.string(),
4889
4960
  authKey: z.string().min(8),
4890
4961
  hostname: z.string().optional()
4891
- }), z.object({ joined: z.literal(true) }), { kind: "mutation" }), method(z.object({ addonId: z.string() }), z.object({ success: z.literal(true) }), { kind: "mutation" });
4962
+ }), z.object({ joined: z.literal(true) }), { kind: "mutation" }), method(z.object({ addonId: z.string() }), z.object({ success: z.literal(true) }), { kind: "mutation" }), method(z.object({
4963
+ addonId: z.string(),
4964
+ hostname: z.string().optional()
4965
+ }), z.object({ loginUrl: z.string() }), { kind: "mutation" }), method(z.object({ addonId: z.string() }), z.object({ loggedOut: z.literal(true) }), { kind: "mutation" }), method(z.object({ addonId: z.string() }), z.object({ peers: z.array(MeshPeerSchema).readonly() }));
4892
4966
  var MethodAccessSchema = z.enum([
4893
4967
  "view",
4894
4968
  "create",
@@ -4975,6 +5049,13 @@ var UserSummarySchema = z.object({
4975
5049
  allowedProviders: z.union([z.array(z.string()), z.literal("*")]),
4976
5050
  allowedDevices: z.record(z.string(), z.union([z.array(z.string()), z.literal("*")])),
4977
5051
  scopes: z.array(TokenScopeSchema).default([]),
5052
+ /**
5053
+ * True iff this user has a CONFIRMED TOTP enrollment. Surfaced on
5054
+ * `listUsers` so the admin Users page can render the "Remove 2FA"
5055
+ * action conditionally without firing one `getTotpStatus` query per
5056
+ * row. Self-service enrollment lives on the user's profile page.
5057
+ */
5058
+ totpEnabled: z.boolean().default(false),
4978
5059
  createdAt: z.number(),
4979
5060
  updatedAt: z.number()
4980
5061
  });
@@ -5237,6 +5318,12 @@ var NodeAddonInputSchema = z.object({
5237
5318
  nodeId: z.string(),
5238
5319
  addonId: z.string()
5239
5320
  });
5321
+ var NodeAddonEntrySchema = z.object({
5322
+ id: z.string(),
5323
+ status: z.string(),
5324
+ version: z.string().optional(),
5325
+ packageName: z.string().optional()
5326
+ });
5240
5327
  var SuccessSchema = z.object({ success: z.boolean() });
5241
5328
  var RestartProcessResultSchema = z.object({
5242
5329
  success: z.boolean(),
@@ -5277,7 +5364,7 @@ method(z.void(), z.array(TopologyNodeSchema).readonly(), { auth: "admin" }), met
5277
5364
  }), RenameNodeResultSchema, {
5278
5365
  kind: "mutation",
5279
5366
  auth: "admin"
5280
- }), method(z.void(), z.record(z.string(), ClusterAddonStatusEntrySchema), { auth: "admin" }), method(z.object({
5367
+ }), method(z.void(), z.record(z.string(), ClusterAddonStatusEntrySchema), { auth: "admin" }), method(z.object({ nodeId: z.string() }), z.array(NodeAddonEntrySchema).readonly(), { auth: "admin" }), method(z.object({
5281
5368
  nodeId: z.string(),
5282
5369
  level: z.string()
5283
5370
  }), SuccessSchema, {