@camstack/core 0.1.36 → 0.1.38

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 (41) hide show
  1. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts +7 -1
  2. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts.map +1 -1
  3. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +46 -56
  4. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js.map +1 -1
  5. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +47 -57
  6. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs.map +1 -1
  7. package/dist/index.js +89 -143
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +89 -143
  10. package/dist/index.mjs.map +1 -1
  11. package/package.json +2 -37
  12. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.d.ts +0 -8
  13. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.d.ts.map +0 -1
  14. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.js +0 -75
  15. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.js.map +0 -1
  16. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.mjs +0 -69
  17. package/dist/builtins/auth-orchestrator/auth-orchestrator.addon.mjs.map +0 -1
  18. package/dist/builtins/auth-orchestrator/index.d.ts +0 -2
  19. package/dist/builtins/auth-orchestrator/index.d.ts.map +0 -1
  20. package/dist/builtins/auth-orchestrator/index.js +0 -7
  21. package/dist/builtins/auth-orchestrator/index.mjs +0 -2
  22. package/dist/builtins/mesh-orchestrator/index.d.ts +0 -2
  23. package/dist/builtins/mesh-orchestrator/index.d.ts.map +0 -1
  24. package/dist/builtins/mesh-orchestrator/index.js +0 -7
  25. package/dist/builtins/mesh-orchestrator/index.mjs +0 -2
  26. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts +0 -9
  27. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts.map +0 -1
  28. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js +0 -113
  29. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js.map +0 -1
  30. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs +0 -107
  31. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs.map +0 -1
  32. package/dist/builtins/turn-orchestrator/index.d.ts +0 -2
  33. package/dist/builtins/turn-orchestrator/index.d.ts.map +0 -1
  34. package/dist/builtins/turn-orchestrator/index.js +0 -7
  35. package/dist/builtins/turn-orchestrator/index.mjs +0 -2
  36. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.d.ts +0 -34
  37. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.d.ts.map +0 -1
  38. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.js +0 -126
  39. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.js.map +0 -1
  40. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.mjs +0 -120
  41. package/dist/builtins/turn-orchestrator/turn-orchestrator.addon.mjs.map +0 -1
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-YnRVILXN.mjs
34
+ //#region ../types/dist/index-CWhQOnm9.mjs
35
35
  var MODEL_FORMATS = [
36
36
  "onnx",
37
37
  "coreml",
@@ -2648,10 +2648,30 @@ var LinkStateSchema = z.enum([
2648
2648
  "linked",
2649
2649
  "error"
2650
2650
  ]);
2651
+ var ExportSetupFieldSchema = z.object({
2652
+ label: z.string(),
2653
+ value: z.string(),
2654
+ /** Mask the value by default + render a reveal toggle (client id, secrets). */
2655
+ secret: z.boolean().optional()
2656
+ });
2657
+ var ExportSetupSchema = z.object({
2658
+ /** A string to render as a scannable QR — HAP `X-HM://…` URI, a pairing URL, etc. Omitted when there's nothing to scan. */
2659
+ qr: z.string().optional(),
2660
+ /** Label/value rows shown with a copy button (HAP setup code, OAuth URLs, client id, linked-account count, …). */
2661
+ fields: z.array(ExportSetupFieldSchema).readonly().optional(),
2662
+ /** Free-form operator instructions rendered above the fields. */
2663
+ note: z.string().optional()
2664
+ });
2651
2665
  var DeviceExportStatusSchema = z.object({
2652
2666
  linkState: LinkStateSchema,
2653
2667
  exposedDeviceCount: z.number(),
2654
- error: z.string().optional()
2668
+ error: z.string().optional(),
2669
+ /**
2670
+ * Optional pairing/account info the panel renders in a generic
2671
+ * "Setup" section. Addon-agnostic — the addon id identifies the
2672
+ * export target, never an `ecosystem` key here.
2673
+ */
2674
+ setup: ExportSetupSchema.optional()
2655
2675
  });
2656
2676
  var DeviceKindSchema = z.string();
2657
2677
  var ExposedDeviceSchema = z.object({
@@ -3565,42 +3585,6 @@ method(z.object({
3565
3585
  username: z.string(),
3566
3586
  password: z.string()
3567
3587
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(z.object({ state: z.string() }), z.string()), method(z.record(z.string(), z.string()), AuthResultSchema, { kind: "mutation" }), method(z.object({ token: z.string() }), AuthResultSchema.nullable());
3568
- var AuthProviderInfoSchema = z.object({
3569
- /** Stable id matching the addon id (used for `getLoginUrl({addonId,…})`). */
3570
- addonId: z.string(),
3571
- /**
3572
- * Per-instance id when one addon registers multiple "logical"
3573
- * providers (e.g. OIDC with Google + Microsoft + custom). The login
3574
- * URL becomes `/addon/${addonId}/${instanceId}/start` — handler reads
3575
- * `:instanceId` from the route. Empty/unset means the addon is a
3576
- * single-instance provider; the URL is `/addon/${addonId}/start`.
3577
- */
3578
- instanceId: z.string().optional(),
3579
- /** Display label shown on the login button + admin row. */
3580
- displayName: z.string(),
3581
- /** Optional iconography hint (lucide-react icon name OR emoji). */
3582
- icon: z.string().optional(),
3583
- /** When true, the provider exposes a redirect-based login flow
3584
- * (`getLoginUrl` returns a URL the browser navigates to). */
3585
- hasRedirectFlow: z.boolean(),
3586
- /** When true, the provider exposes a credential-form login flow
3587
- * (`validateCredentials` accepts username + password). */
3588
- hasCredentialFlow: z.boolean(),
3589
- /** Provider kind, drives admin-UI hint dispatch (oidc / saml / totp / …). */
3590
- kind: z.string().optional(),
3591
- /** Operator-facing status string (e.g. "Connected to https://login.acme.com"). */
3592
- status: z.string().optional(),
3593
- /** When false, the provider is registered but disabled by config; the
3594
- * UI surfaces it as inactive without enumerating it for login. */
3595
- enabled: z.boolean()
3596
- });
3597
- method(z.void(), z.array(AuthProviderInfoSchema).readonly()), method(z.object({
3598
- addonId: z.string(),
3599
- enabled: z.boolean()
3600
- }), z.object({ success: z.literal(true) }), {
3601
- kind: "mutation",
3602
- auth: "admin"
3603
- });
3604
3588
  var NetworkEndpointSchema = z.object({
3605
3589
  url: z.string(),
3606
3590
  hostname: z.string(),
@@ -3626,33 +3610,6 @@ var NetworkEndpointEntrySchema = NetworkEndpointSchema.extend({
3626
3610
  sourcePort: z.number().optional()
3627
3611
  });
3628
3612
  method(z.void(), NetworkEndpointSchema, { kind: "mutation" }), method(z.void(), z.void(), { kind: "mutation" }), method(z.void(), NetworkEndpointSchema.nullable()), method(z.void(), NetworkAccessStatusSchema), method(z.void(), z.array(NetworkEndpointEntrySchema).readonly());
3629
- var RemoteAccessEndpointSchema = z.object({
3630
- url: z.string(),
3631
- hostname: z.string(),
3632
- port: z.number(),
3633
- protocol: z.enum(["http", "https"])
3634
- });
3635
- var RemoteAccessProviderInfoSchema = z.object({
3636
- /** Stable id matching the addon id. */
3637
- addonId: z.string(),
3638
- /** Display label shown on the admin row — sourced from the addon manifest. */
3639
- displayName: z.string(),
3640
- /** When false, the provider is registered but disabled. */
3641
- enabled: z.boolean(),
3642
- /** True when the underlying tunnel/connection is up. */
3643
- connected: z.boolean(),
3644
- /** Public-facing endpoint, when connected. Null otherwise. */
3645
- endpoint: RemoteAccessEndpointSchema.nullable(),
3646
- /** Last error message (when connected=false), if available. */
3647
- error: z.string().optional()
3648
- });
3649
- method(z.void(), z.array(RemoteAccessProviderInfoSchema).readonly()), method(z.object({ addonId: z.string() }), RemoteAccessEndpointSchema, {
3650
- kind: "mutation",
3651
- auth: "admin"
3652
- }), method(z.object({ addonId: z.string() }), z.object({ success: z.literal(true) }), {
3653
- kind: "mutation",
3654
- auth: "admin"
3655
- });
3656
3613
  var TurnServerSchema = z.object({
3657
3614
  /** Single URL or list of URLs (e.g. "turn:turn.example.com:3478?transport=udp"). */
3658
3615
  urls: z.union([z.string(), z.array(z.string())]),
@@ -3660,33 +3617,6 @@ var TurnServerSchema = z.object({
3660
3617
  credential: z.string().optional()
3661
3618
  });
3662
3619
  method(z.void(), z.array(TurnServerSchema).readonly());
3663
- var TurnProviderInfoSchema = z.object({
3664
- /** Stable id matching the addon id. */
3665
- addonId: z.string(),
3666
- /** Display label shown on the admin row — sourced from the addon manifest. */
3667
- displayName: z.string(),
3668
- /** When false, the provider is registered but disabled. */
3669
- enabled: z.boolean(),
3670
- /** Number of servers this provider is currently exposing. */
3671
- serverCount: z.number(),
3672
- /**
3673
- * Flat list of every TURN/STUN URL this provider currently exposes.
3674
- * One row per URL (multi-URL ICE server entries are flattened). The
3675
- * admin UI shows this in a compact per-provider list so operators
3676
- * can verify what's actually being negotiated without having to dig
3677
- * into the combined `getAllServers` output.
3678
- */
3679
- urls: z.array(z.string()).readonly(),
3680
- /** Last fetch error (when serverCount=0 due to API failure), if any. */
3681
- error: z.string().optional()
3682
- });
3683
- method(z.void(), z.array(TurnProviderInfoSchema).readonly()), method(z.void(), z.array(TurnServerSchema).readonly()), method(z.object({
3684
- addonId: z.string(),
3685
- enabled: z.boolean()
3686
- }), z.object({ success: z.literal(true) }), {
3687
- kind: "mutation",
3688
- auth: "admin"
3689
- });
3690
3620
  var SnapshotImageSchema = z.object({
3691
3621
  base64: z.string(),
3692
3622
  contentType: z.string()
@@ -4783,7 +4713,7 @@ method(z.void(), ListResultSchema), method(z.void(), PreferredSchema), method(z.
4783
4713
  * tunnel always emits `https://` regardless. */
4784
4714
  scheme: z.enum(["http", "https"]).optional()
4785
4715
  }), GetConnectionEndpointsResultSchema), method(z.void(), AllowedAddressesSchema), method(AllowedAddressesSchema, z.object({ success: z.literal(true) }), { kind: "mutation" }), method(z.void(), AllowedAddressesSchema, { kind: "mutation" });
4786
- var MeshEndpointSchema$1 = z.object({
4716
+ var MeshEndpointSchema = z.object({
4787
4717
  /** Stable identifier within the provider (e.g. `mesh-ipv4`, `magicdns`, `funnel`). */
4788
4718
  id: z.string(),
4789
4719
  /** Operator-facing label (e.g. "Mesh IPv4", "MagicDNS"). */
@@ -4860,7 +4790,7 @@ var MeshStatusSchema = z.object({
4860
4790
  /** Number of peers visible to this host (excluding self). */
4861
4791
  peerCount: z.number(),
4862
4792
  /** Every endpoint this provider exposes for the current host. */
4863
- endpoints: z.array(MeshEndpointSchema$1).readonly(),
4793
+ endpoints: z.array(MeshEndpointSchema).readonly(),
4864
4794
  /** Last error from the daemon, when not joined. */
4865
4795
  error: z.string().optional(),
4866
4796
  /**
@@ -4892,7 +4822,24 @@ var MeshStatusSchema = z.object({
4892
4822
  * doesn't rotate keys for the bound host. Operator-facing surface
4893
4823
  * for "your access expires on …" banners.
4894
4824
  */
4895
- keyExpiry: z.number().nullable()
4825
+ keyExpiry: z.number().nullable(),
4826
+ /**
4827
+ * When the provider runs its OWN mesh daemon (e.g. the Tailscale
4828
+ * client addon in `onboard` mode spawns a private `tailscaled`),
4829
+ * this carries the local control-socket path. Companion addons that
4830
+ * must drive the SAME daemon — chiefly `tailscale-ingress` for
4831
+ * Serve/Funnel — read it to point their CLI at the right socket
4832
+ * instead of the system default. Empty when the provider uses the
4833
+ * host's system daemon (or doesn't have the concept).
4834
+ */
4835
+ daemonSocket: z.string().optional(),
4836
+ /**
4837
+ * Path to the mesh CLI binary the provider downloaded for onboard
4838
+ * mode. Companion addons reuse it so they don't need a system
4839
+ * install when the operator chose a fully self-contained mesh.
4840
+ * Empty in host mode.
4841
+ */
4842
+ daemonCliPath: z.string().optional()
4896
4843
  });
4897
4844
  method(z.void(), MeshStatusSchema), method(z.object({
4898
4845
  /** Provider-specific auth key. For Tailscale this is the
@@ -4918,51 +4865,6 @@ authKey: z.string().optional() }), z.object({
4918
4865
  /** Human-readable error when `ok: false`. */
4919
4866
  error: z.string().optional()
4920
4867
  }), { kind: "mutation" });
4921
- var MeshEndpointSchema = z.object({
4922
- id: z.string(),
4923
- label: z.string(),
4924
- scope: z.enum(["mesh", "public"]),
4925
- url: z.string(),
4926
- hostname: z.string(),
4927
- port: z.number(),
4928
- protocol: z.enum(["http", "https"])
4929
- });
4930
- var MeshProviderInfoSchema = z.object({
4931
- /** Stable id matching the addon id. */
4932
- addonId: z.string(),
4933
- /** Display label shown on the admin row — sourced from the addon manifest. */
4934
- displayName: z.string(),
4935
- /** True when the host is joined to this provider's mesh. */
4936
- joined: z.boolean(),
4937
- /** Local mesh IP (empty when not joined). */
4938
- meshIp: z.string(),
4939
- /** MagicDNS / mesh hostname (empty when not configured). */
4940
- magicDnsHostname: z.string(),
4941
- /** Peer count (excluding self). */
4942
- peerCount: z.number(),
4943
- /** Active endpoints (mesh IP + MagicDNS + optional public Funnel). */
4944
- endpoints: z.array(MeshEndpointSchema).readonly(),
4945
- /** Last error reported by the provider. */
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()
4957
- });
4958
- method(z.void(), z.array(MeshProviderInfoSchema).readonly()), method(z.object({
4959
- addonId: z.string(),
4960
- authKey: z.string().min(8),
4961
- hostname: z.string().optional()
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() }));
4966
4868
  var MethodAccessSchema = z.enum([
4967
4869
  "view",
4968
4870
  "create",
@@ -5574,6 +5476,21 @@ var AddonAutoUpdateSchema = ChannelWithInheritSchema;
5574
5476
  var RestartAddonResultSchema = z.unknown();
5575
5477
  var InstallPackageResultSchema = z.unknown();
5576
5478
  var ReloadPackagesResultSchema = z.unknown();
5479
+ var UpdateFrameworkPackageResultSchema = z.object({
5480
+ packageName: z.string(),
5481
+ fromVersion: z.string(),
5482
+ toVersion: z.string(),
5483
+ /** Ms-epoch the server scheduled its self-restart. */
5484
+ restartingAt: z.number()
5485
+ });
5486
+ var FrameworkPackageStatusSchema = z.object({
5487
+ packageName: z.string(),
5488
+ currentVersion: z.string(),
5489
+ latestVersion: z.string().nullable(),
5490
+ hasUpdate: z.boolean(),
5491
+ /** Optional manifest description for the row tooltip. */
5492
+ description: z.string().optional()
5493
+ });
5577
5494
  var LogStreamEntrySchema = z.object({
5578
5495
  timestamp: z.string(),
5579
5496
  level: z.string(),
@@ -5605,21 +5522,50 @@ method(z.void(), z.array(AddonListItemSchema).readonly()), method(z.object({
5605
5522
  }), method(z.void(), ReloadPackagesResultSchema, {
5606
5523
  kind: "mutation",
5607
5524
  auth: "admin"
5608
- }), method(z.object({ query: z.string().optional() }), z.array(SearchResultSchema)), method(z.void(), z.array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(z.object({
5525
+ }), method(z.object({ query: z.string().optional() }), z.array(SearchResultSchema)), method(z.object({ nodeId: z.string().optional() }), z.array(PackageUpdateSchema).readonly(), { auth: "admin" }), method(z.object({
5609
5526
  name: z.string().min(1),
5610
- version: z.string().optional()
5527
+ version: z.string().optional(),
5528
+ nodeId: z.string().optional()
5611
5529
  }), z.unknown(), {
5612
5530
  kind: "mutation",
5613
5531
  auth: "admin"
5614
5532
  }), method(z.object({ name: z.string().min(1) }), z.object({ rolledBackTo: z.string().nullable() }), {
5615
5533
  kind: "mutation",
5616
5534
  auth: "admin"
5617
- }), method(z.void(), z.unknown(), {
5535
+ }), method(z.object({ nodeId: z.string().optional() }), z.unknown(), {
5618
5536
  kind: "mutation",
5619
5537
  auth: "admin"
5620
5538
  }), method(z.object({ confirm: z.literal(true) }), z.unknown(), {
5621
5539
  kind: "mutation",
5622
5540
  auth: "admin"
5541
+ }), method(z.void(), z.object({
5542
+ kind: z.enum([
5543
+ "framework-update",
5544
+ "manual",
5545
+ "system"
5546
+ ]),
5547
+ packageName: z.string().optional(),
5548
+ fromVersion: z.string().optional(),
5549
+ toVersion: z.string().optional(),
5550
+ requestedBy: z.string().optional(),
5551
+ requestedAt: z.number()
5552
+ }).nullable(), { auth: "admin" }), method(z.void(), z.array(FrameworkPackageStatusSchema).readonly(), { auth: "admin" }), method(z.object({ capName: z.string().min(1) }), z.array(z.object({
5553
+ addonId: z.string(),
5554
+ mode: z.enum(["singleton", "collection"]),
5555
+ isActive: z.boolean()
5556
+ })).readonly()), method(z.object({
5557
+ capName: z.string().min(1),
5558
+ addonId: z.string().min(1),
5559
+ enabled: z.boolean()
5560
+ }), z.object({ success: z.literal(true) }), {
5561
+ kind: "mutation",
5562
+ auth: "admin"
5563
+ }), method(z.object({
5564
+ packageName: z.string().min(1),
5565
+ version: z.string().optional()
5566
+ }), UpdateFrameworkPackageResultSchema, {
5567
+ kind: "mutation",
5568
+ auth: "admin"
5623
5569
  }), method(z.object({ name: z.string() }), z.array(PackageVersionInfoSchema).readonly()), method(z.object({ addonId: z.string() }), RestartAddonResultSchema, {
5624
5570
  kind: "mutation",
5625
5571
  auth: "admin"