@ours.network/fleet 1.2.0-nightly.5 → 1.2.0-nightly.50
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/README.md +263 -53
- package/dist/account-origin.d.ts +2 -0
- package/dist/account-origin.js +6 -0
- package/dist/agent-ours/bridge.js +9 -0
- package/dist/agent-ours/correspondence.d.ts +10 -0
- package/dist/agent-ours/correspondence.js +1 -0
- package/dist/agent-ours/harness.js +8 -0
- package/dist/agent-ours/runtime.d.ts +6 -0
- package/dist/agent-ours/runtime.js +36 -0
- package/dist/agent-ours/service.js +33 -13
- package/dist/application/codex-models.d.ts +15 -0
- package/dist/application/codex-models.js +56 -0
- package/dist/application/conversation-history.d.ts +25 -0
- package/dist/application/conversation-history.js +189 -0
- package/dist/application/fleet-query-service.d.ts +1 -1
- package/dist/application/fleet-query-service.js +2 -2
- package/dist/application/legacy-supervisor-identity.d.ts +7 -0
- package/dist/application/legacy-supervisor-identity.js +43 -0
- package/dist/application/model-catalog.d.ts +1 -1
- package/dist/application/model-catalog.js +5 -2
- package/dist/application/preset-provenance.d.ts +19 -0
- package/dist/application/preset-provenance.js +59 -0
- package/dist/application/role-creation-service.js +1 -1
- package/dist/application/role-removal-service.js +2 -0
- package/dist/application/role-repository.js +2 -2
- package/dist/application/room-layout-definitions.d.ts +45 -0
- package/dist/application/room-layout-definitions.js +130 -0
- package/dist/application/session-control.d.ts +30 -0
- package/dist/application/session-control.js +72 -3
- package/dist/application/supervisor-ours-tools.d.ts +159 -0
- package/dist/application/supervisor-ours-tools.js +113 -0
- package/dist/application/task-layouts.d.ts +91 -0
- package/dist/application/task-layouts.js +249 -0
- package/dist/application/task-room-service.d.ts +99 -3
- package/dist/application/task-room-service.js +296 -31
- package/dist/atomic-file.d.ts +5 -0
- package/dist/atomic-file.js +62 -1
- package/dist/briefing.d.ts +2 -0
- package/dist/briefing.js +8 -1
- package/dist/build-info.json +7 -4
- package/dist/capabilities.d.ts +6 -1
- package/dist/capabilities.js +8 -0
- package/dist/cli.js +376 -34
- package/dist/client-profile.d.ts +5 -17
- package/dist/client-profile.js +4 -127
- package/dist/config.d.ts +28 -0
- package/dist/config.js +41 -6
- package/dist/creation.js +2 -2
- package/dist/daemon-recovery.d.ts +1 -8
- package/dist/daemon-recovery.js +8 -113
- package/dist/docs.d.ts +3 -3
- package/dist/docs.js +126 -22
- package/dist/doctor.d.ts +1 -1
- package/dist/doctor.js +55 -60
- package/dist/erased-resources.d.ts +9 -0
- package/dist/erased-resources.js +87 -0
- package/dist/fleet-command-audit.d.ts +7 -0
- package/dist/fleet-command-audit.js +26 -9
- package/dist/harness/claude-code.js +9 -1
- package/dist/harness/claude-runtime.d.ts +12 -0
- package/dist/harness/claude-runtime.js +43 -0
- package/dist/harness/codex-app-server-proxy.d.ts +4 -1
- package/dist/harness/codex-app-server-proxy.js +41 -5
- package/dist/harness/codex-reasoning.d.ts +5 -0
- package/dist/harness/codex-reasoning.js +12 -0
- package/dist/harness/codex-runtime.d.ts +11 -1
- package/dist/harness/codex-runtime.js +31 -4
- package/dist/harness/codex.d.ts +3 -2
- package/dist/harness/codex.js +20 -11
- package/dist/init-wizard.d.ts +2 -0
- package/dist/init-wizard.js +38 -19
- package/dist/isolation/policy.js +2 -0
- package/dist/isolation/types.d.ts +5 -0
- package/dist/managed-cli.d.ts +253 -0
- package/dist/managed-cli.js +923 -0
- package/dist/minimal-setup.d.ts +2 -0
- package/dist/minimal-setup.js +44 -0
- package/dist/monitor.d.ts +1 -34
- package/dist/monitor.js +24 -151
- package/dist/notifications/fleet-producer.d.ts +19 -0
- package/dist/notifications/fleet-producer.js +208 -0
- package/dist/notifications/outbox.d.ts +46 -0
- package/dist/notifications/outbox.js +158 -0
- package/dist/notifications/target-cleanup.d.ts +8 -0
- package/dist/notifications/target-cleanup.js +41 -0
- package/dist/ops.js +5 -1
- package/dist/owner-channel/channel.d.ts +3 -0
- package/dist/owner-channel/channel.js +34 -6
- package/dist/owner-channel/commands.d.ts +4 -0
- package/dist/owner-channel/commands.js +8 -0
- package/dist/owner-channel/lifecycle-outbox.js +4 -3
- package/dist/owner-channel/ours-client.js +2 -17
- package/dist/paths.d.ts +2 -0
- package/dist/paths.js +2 -0
- package/dist/preset-migration.js +25 -0
- package/dist/resolved-plan.js +1 -0
- package/dist/rooms-tasks/add-member.d.ts +48 -0
- package/dist/rooms-tasks/add-member.js +83 -0
- package/dist/rooms-tasks/archived-absence.d.ts +8 -0
- package/dist/rooms-tasks/archived-absence.js +48 -0
- package/dist/rooms-tasks/cli.js +34 -5
- package/dist/rooms-tasks/close.d.ts +5 -2
- package/dist/rooms-tasks/close.js +208 -28
- package/dist/rooms-tasks/config.d.ts +1 -1
- package/dist/rooms-tasks/config.js +11 -4
- package/dist/rooms-tasks/cowork-adapter.d.ts +6 -4
- package/dist/rooms-tasks/cowork-adapter.js +8 -121
- package/dist/rooms-tasks/deletion.d.ts +1 -1
- package/dist/rooms-tasks/deletion.js +74 -5
- package/dist/rooms-tasks/erasure.d.ts +6 -0
- package/dist/rooms-tasks/erasure.js +169 -0
- package/dist/rooms-tasks/external-worker.d.ts +1 -1
- package/dist/rooms-tasks/external-worker.js +3 -4
- package/dist/rooms-tasks/layout-binding-client.d.ts +11 -0
- package/dist/rooms-tasks/layout-binding-client.js +56 -0
- package/dist/rooms-tasks/layout-binding-grants.d.ts +21 -0
- package/dist/rooms-tasks/layout-binding-grants.js +128 -0
- package/dist/rooms-tasks/layout-cli.d.ts +4 -0
- package/dist/rooms-tasks/layout-cli.js +107 -0
- package/dist/rooms-tasks/layout-config.d.ts +11 -0
- package/dist/rooms-tasks/layout-config.js +89 -0
- package/dist/rooms-tasks/layout-control.d.ts +21 -0
- package/dist/rooms-tasks/layout-control.js +52 -0
- package/dist/rooms-tasks/layout-service.d.ts +42 -0
- package/dist/rooms-tasks/layout-service.js +185 -0
- package/dist/rooms-tasks/layout.d.ts +114 -0
- package/dist/rooms-tasks/layout.js +250 -0
- package/dist/rooms-tasks/live-readiness.d.ts +18 -0
- package/dist/rooms-tasks/live-readiness.js +85 -0
- package/dist/rooms-tasks/member-startup.d.ts +1 -0
- package/dist/rooms-tasks/member-startup.js +2 -0
- package/dist/rooms-tasks/provision.d.ts +14 -0
- package/dist/rooms-tasks/provision.js +173 -46
- package/dist/rooms-tasks/room-state.d.ts +4 -2
- package/dist/rooms-tasks/room-state.js +53 -8
- package/dist/rooms-tasks/task-state.d.ts +42 -7
- package/dist/rooms-tasks/task-state.js +153 -23
- package/dist/rooms-tasks/types.d.ts +28 -0
- package/dist/rooms-tasks/workspace-artifacts.d.ts +6 -0
- package/dist/rooms-tasks/workspace-artifacts.js +93 -0
- package/dist/rooms-tasks/workspace.d.ts +26 -0
- package/dist/rooms-tasks/workspace.js +195 -0
- package/dist/runner.d.ts +19 -3
- package/dist/runner.js +128 -45
- package/dist/session/acp.d.ts +9 -1
- package/dist/session/acp.js +31 -6
- package/dist/session/arbiter.d.ts +5 -0
- package/dist/session/arbiter.js +28 -2
- package/dist/session/codex-app-server.d.ts +5 -0
- package/dist/session/codex-app-server.js +36 -3
- package/dist/session/control.d.ts +12 -1
- package/dist/session/control.js +68 -3
- package/dist/session/conversation-normalizer.d.ts +2 -1
- package/dist/session/conversation-normalizer.js +1 -1
- package/dist/session/conversation-store.d.ts +1 -1
- package/dist/session/conversation-store.js +7 -11
- package/dist/session/conversation-types.d.ts +7 -3
- package/dist/session/task-notice.d.ts +14 -0
- package/dist/session/task-notice.js +13 -0
- package/dist/session/types.d.ts +6 -0
- package/dist/setup-tunnel-preflight.d.ts +34 -0
- package/dist/setup-tunnel-preflight.js +62 -0
- package/dist/socket-path.d.ts +2 -0
- package/dist/socket-path.js +22 -0
- package/dist/spawn.js +8 -1
- package/dist/startup-readiness.d.ts +13 -0
- package/dist/startup-readiness.js +38 -0
- package/dist/subscriptions/cli.d.ts +91 -0
- package/dist/subscriptions/cli.js +223 -0
- package/dist/subscriptions/launch.d.ts +37 -0
- package/dist/subscriptions/launch.js +93 -0
- package/dist/subscriptions/login.d.ts +75 -0
- package/dist/subscriptions/login.js +182 -0
- package/dist/subscriptions/observed.d.ts +7 -0
- package/dist/subscriptions/observed.js +44 -0
- package/dist/subscriptions/probe.d.ts +10 -0
- package/dist/subscriptions/probe.js +73 -0
- package/dist/subscriptions/service.d.ts +102 -0
- package/dist/subscriptions/service.js +364 -0
- package/dist/subscriptions/store.d.ts +71 -0
- package/dist/subscriptions/store.js +140 -0
- package/dist/supervisor/launchd.js +2 -1
- package/dist/supervisor/systemd.js +9 -23
- package/dist/temp-idle.d.ts +17 -0
- package/dist/temp-idle.js +42 -0
- package/dist/temp-lifecycle.d.ts +6 -1
- package/dist/temp-lifecycle.js +29 -13
- package/dist/tunnel-setup-completion.d.ts +7 -0
- package/dist/tunnel-setup-completion.js +13 -0
- package/dist/tunnel-setup-input.d.ts +19 -0
- package/dist/tunnel-setup-input.js +124 -0
- package/dist/web/agent-attachments.d.ts +29 -0
- package/dist/web/agent-attachments.js +162 -0
- package/dist/web/auth.d.ts +29 -1
- package/dist/web/auth.js +82 -7
- package/dist/web/available-port.d.ts +2 -0
- package/dist/web/available-port.js +23 -0
- package/dist/web/control.d.ts +3 -3
- package/dist/web/control.js +10 -8
- package/dist/web/fleet-config-service.d.ts +4 -1
- package/dist/web/fleet-config-service.js +46 -15
- package/dist/web/prefix-gateway.d.ts +32 -0
- package/dist/web/prefix-gateway.js +234 -0
- package/dist/web/runtime.d.ts +3 -1
- package/dist/web/runtime.js +116 -31
- package/dist/web/server.d.ts +16 -0
- package/dist/web/server.js +588 -53
- package/dist/web/service.d.ts +11 -2
- package/dist/web/service.js +30 -4
- package/dist/web/workspace-devices.d.ts +36 -0
- package/dist/web/workspace-devices.js +101 -0
- package/dist/web/workspace-tunnel.d.ts +1 -0
- package/dist/web/workspace-tunnel.js +34 -0
- package/dist/workspace-enrollment.d.ts +82 -0
- package/dist/workspace-enrollment.js +566 -0
- package/dist/workspace-replacement.d.ts +66 -0
- package/dist/workspace-replacement.js +220 -0
- package/docs/live-voice.md +13 -0
- package/docs/room-layouts.md +227 -0
- package/docs/task-workspaces.md +130 -0
- package/docs/validation/managed-cli-permissions.md +421 -0
- package/examples/room-layouts/fresh.yaml +27 -0
- package/examples/room-layouts/scoped.yaml +21 -0
- package/examples/room-layouts/shared.yaml +19 -0
- package/package.json +15 -18
- package/presets/README.md +78 -0
- package/presets/brain-catalog.json +8 -2
- package/presets/fleet/agent_templates/Critic.yaml +1 -1
- package/presets/fleet/agent_templates/Developer.yaml +1 -1
- package/presets/fleet/agent_templates/Engineer.yaml +5 -0
- package/presets/fleet/agent_templates/LocalCoordinator.yaml +1 -1
- package/presets/fleet/agents/FleetCoordinator.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-1-high.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-1-low.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-1-max.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-1-medium.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-1-xhigh.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-high.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-low.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-max.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-medium.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-xhigh.yaml +1 -1
- package/presets/fleet/brains/claude-haiku-4-5-20251001-default.yaml +4 -0
- package/presets/fleet/brains/claude-opus-5-5-high.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-5-low.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-5-max.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-5-medium.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-5-xhigh.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-high.yaml +1 -1
- package/presets/fleet/brains/claude-opus-5-low.yaml +1 -1
- package/presets/fleet/brains/claude-opus-5-max.yaml +1 -1
- package/presets/fleet/brains/claude-opus-5-medium.yaml +1 -1
- package/presets/fleet/brains/claude-opus-5-xhigh.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-high.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-low.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-max.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-medium.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-mini-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-mini-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-mini-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-mini-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-5-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-5-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-5-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-5-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-max.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-max.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-ultra.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-max.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-ultra.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-1-sol-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-ultra.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-astra-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-max.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-ultra.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-luna-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-luna-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-luna-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-luna-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-luna-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-ultra.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-xhigh.yaml +5 -0
- package/presets/fleet/roles/Coordinator.yaml +34 -11
- package/presets/fleet/roles/Engineer.yaml +40 -0
- package/presets/fleet/room_layouts/engineering.yaml +25 -0
- package/presets/fleet/room_layouts/pair.yaml +24 -0
- package/presets/fleet/room_layouts/single.yaml +17 -0
- package/presets/fleet/room_layouts/team.yaml +30 -0
- package/presets/fleet/room_templates/engineering.yaml +19 -0
- package/presets/manifest.json +2 -2
- package/dist/web-app/assets/index-59GF-gsZ.css +0 -1
- package/dist/web-app/assets/index-C0h3ALvs.js +0 -10
- package/dist/web-app/icons/ours-fleet-maskable.svg +0 -4
- package/dist/web-app/icons/ours-fleet.svg +0 -4
- package/dist/web-app/index.html +0 -17
- package/dist/web-app/manifest.webmanifest +0 -15
- package/dist/web-app/offline.html +0 -18
- package/dist/web-app/sw.js +0 -51
package/dist/web/service.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Exec } from '../exec.js';
|
|
2
2
|
export declare const WEB_SYSTEMD_UNIT = "ours-fleet-web.service";
|
|
3
3
|
export declare const WEB_LAUNCHD_LABEL = "network.ours.fleet.web";
|
|
4
|
+
type ServiceEnvironment = Partial<Record<'OURS_CONFIG' | 'OURS_FLEET_HOME' | 'PATH', string>>;
|
|
4
5
|
interface ServiceMetadata {
|
|
5
6
|
version: 3;
|
|
6
7
|
platform: 'linux' | 'darwin';
|
|
@@ -10,6 +11,7 @@ interface ServiceMetadata {
|
|
|
10
11
|
configuration?: string;
|
|
11
12
|
bind?: string;
|
|
12
13
|
publicOrigin?: string;
|
|
14
|
+
environment?: ServiceEnvironment;
|
|
13
15
|
}
|
|
14
16
|
export interface WebServiceOptions {
|
|
15
17
|
platform?: NodeJS.Platform;
|
|
@@ -18,6 +20,7 @@ export interface WebServiceOptions {
|
|
|
18
20
|
stateDir?: string;
|
|
19
21
|
uid?: number;
|
|
20
22
|
runtimeExecutable?: string;
|
|
23
|
+
environment?: NodeJS.ProcessEnv;
|
|
21
24
|
}
|
|
22
25
|
export declare class WebServiceManager {
|
|
23
26
|
private readonly platform;
|
|
@@ -26,6 +29,7 @@ export declare class WebServiceManager {
|
|
|
26
29
|
private readonly stateDir;
|
|
27
30
|
private readonly uid;
|
|
28
31
|
private readonly runtimeExecutable;
|
|
32
|
+
private readonly environment;
|
|
29
33
|
constructor(options?: WebServiceOptions);
|
|
30
34
|
get metadataPath(): string;
|
|
31
35
|
get definitionPath(): string;
|
|
@@ -33,6 +37,11 @@ export declare class WebServiceManager {
|
|
|
33
37
|
bind?: string;
|
|
34
38
|
publicOrigin?: string;
|
|
35
39
|
}): Promise<string[]>;
|
|
40
|
+
/** Persist an enrollment bind fallback, reloading launchd's cached definition. */
|
|
41
|
+
retainBoundPort(script: string, port: number, configuration?: string, web?: {
|
|
42
|
+
bind?: string;
|
|
43
|
+
publicOrigin?: string;
|
|
44
|
+
}): Promise<void>;
|
|
36
45
|
start(): Promise<void>;
|
|
37
46
|
stop(): Promise<void>;
|
|
38
47
|
restart(): Promise<void>;
|
|
@@ -45,9 +54,9 @@ export declare class WebServiceManager {
|
|
|
45
54
|
export declare function systemdUnit(runtime: string, script: string, port: number, configuration?: string, web?: {
|
|
46
55
|
bind?: string;
|
|
47
56
|
publicOrigin?: string;
|
|
48
|
-
}): string;
|
|
57
|
+
}, environment?: ServiceEnvironment): string;
|
|
49
58
|
export declare function launchdPlist(runtime: string, script: string, port: number, configuration?: string, web?: {
|
|
50
59
|
bind?: string;
|
|
51
60
|
publicOrigin?: string;
|
|
52
|
-
}): string;
|
|
61
|
+
}, environment?: ServiceEnvironment): string;
|
|
53
62
|
export {};
|
package/dist/web/service.js
CHANGED
|
@@ -15,6 +15,7 @@ export class WebServiceManager {
|
|
|
15
15
|
stateDir;
|
|
16
16
|
uid;
|
|
17
17
|
runtimeExecutable;
|
|
18
|
+
environment;
|
|
18
19
|
constructor(options = {}) {
|
|
19
20
|
const platform = options.platform ?? process.platform;
|
|
20
21
|
if (platform !== 'linux' && platform !== 'darwin')
|
|
@@ -25,6 +26,7 @@ export class WebServiceManager {
|
|
|
25
26
|
this.stateDir = options.stateDir ?? join(stateRoot(), 'web');
|
|
26
27
|
this.uid = options.uid ?? process.getuid?.() ?? 501;
|
|
27
28
|
this.runtimeExecutable = options.runtimeExecutable ?? process.execPath;
|
|
29
|
+
this.environment = serviceEnvironment(options.environment ?? process.env);
|
|
28
30
|
}
|
|
29
31
|
get metadataPath() { return join(this.stateDir, 'service.json'); }
|
|
30
32
|
get definitionPath() {
|
|
@@ -42,13 +44,14 @@ export class WebServiceManager {
|
|
|
42
44
|
const config = configuration ? resolve(configuration) : undefined;
|
|
43
45
|
const metadata = {
|
|
44
46
|
version: VERSION, platform: this.platform, runtime, script: resolvedScript, port,
|
|
47
|
+
environment: this.environment,
|
|
45
48
|
...(config ? { configuration: config } : {}),
|
|
46
49
|
...(web.bind ? { bind: web.bind } : {}),
|
|
47
50
|
...(web.publicOrigin ? { publicOrigin: web.publicOrigin } : {}),
|
|
48
51
|
};
|
|
49
52
|
replaceFileAtomically(this.definitionPath, this.platform === 'linux'
|
|
50
|
-
? systemdUnit(runtime, resolvedScript, port, config, web)
|
|
51
|
-
: launchdPlist(runtime, resolvedScript, port, config, web), 0o600);
|
|
53
|
+
? systemdUnit(runtime, resolvedScript, port, config, web, this.environment)
|
|
54
|
+
: launchdPlist(runtime, resolvedScript, port, config, web, this.environment), 0o600);
|
|
52
55
|
replaceFileAtomically(this.metadataPath, JSON.stringify(metadata, null, 2) + '\n', 0o600);
|
|
53
56
|
if (this.platform === 'linux') {
|
|
54
57
|
await this.must('systemctl', ['--user', 'daemon-reload']);
|
|
@@ -63,6 +66,14 @@ export class WebServiceManager {
|
|
|
63
66
|
}
|
|
64
67
|
return [`installed ${this.definitionPath}`, 'launchd service starts at login'];
|
|
65
68
|
}
|
|
69
|
+
/** Persist an enrollment bind fallback, reloading launchd's cached definition. */
|
|
70
|
+
async retainBoundPort(script, port, configuration, web = {}) {
|
|
71
|
+
await this.install(script, port, configuration, web);
|
|
72
|
+
if (this.platform === 'darwin') {
|
|
73
|
+
await this.stop();
|
|
74
|
+
await this.start();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
66
77
|
async start() {
|
|
67
78
|
this.requireInstalled();
|
|
68
79
|
if (this.platform === 'linux') {
|
|
@@ -159,19 +170,20 @@ function validatePort(port) {
|
|
|
159
170
|
function systemdQuote(value) {
|
|
160
171
|
return `"${value.replace(/[%\\"]/g, char => char === '%' ? '%%' : `\\${char}`)}"`;
|
|
161
172
|
}
|
|
162
|
-
export function systemdUnit(runtime, script, port, configuration, web = {}) {
|
|
173
|
+
export function systemdUnit(runtime, script, port, configuration, web = {}, environment = {}) {
|
|
163
174
|
const config = configuration ? ` --configuration ${systemdQuote(configuration)}` : '';
|
|
164
175
|
const access = `${web.bind ? ` --bind ${systemdQuote(web.bind)}` : ''}`
|
|
165
176
|
+ `${web.publicOrigin ? ` --public-origin ${systemdQuote(web.publicOrigin)}` : ''}`;
|
|
166
177
|
return `[Unit]\nDescription=ours-fleet localhost web console\nAfter=default.target\n\n`
|
|
167
178
|
+ `[Service]\nType=simple\nExecStart=${systemdQuote(runtime)} ${systemdQuote(script)} web serve --port ${port} --no-open${config}${access}\n`
|
|
179
|
+
+ Object.entries(serviceEnvironment(environment)).map(([key, value]) => `Environment=${systemdQuote(`${key}=${value}`)}\n`).join('')
|
|
168
180
|
+ `Restart=on-failure\nRestartSec=5\nTimeoutStopSec=15\n\n`
|
|
169
181
|
+ `[Install]\nWantedBy=default.target\n`;
|
|
170
182
|
}
|
|
171
183
|
const xml = (value) => value.replace(/[&<>"']/g, char => ({
|
|
172
184
|
'&': '&', '<': '<', '>': '>', '"': '"', "'": ''',
|
|
173
185
|
}[char]));
|
|
174
|
-
export function launchdPlist(runtime, script, port, configuration, web = {}) {
|
|
186
|
+
export function launchdPlist(runtime, script, port, configuration, web = {}, environment = {}) {
|
|
175
187
|
const config = configuration
|
|
176
188
|
? `<string>--configuration</string><string>${xml(configuration)}</string>` : '';
|
|
177
189
|
const access = `${web.bind ? `<string>--bind</string><string>${xml(web.bind)}</string>` : ''}`
|
|
@@ -181,6 +193,20 @@ export function launchdPlist(runtime, script, port, configuration, web = {}) {
|
|
|
181
193
|
+ `<plist version="1.0"><dict>\n<key>Label</key><string>${WEB_LAUNCHD_LABEL}</string>\n`
|
|
182
194
|
+ `<key>ProgramArguments</key><array><string>${xml(runtime)}</string><string>${xml(script)}</string><string>web</string>`
|
|
183
195
|
+ `<string>serve</string><string>--port</string><string>${port}</string><string>--no-open</string>${config}${access}</array>\n`
|
|
196
|
+
+ `<key>EnvironmentVariables</key><dict>${Object.entries(serviceEnvironment(environment)).map(([key, value]) => `<key>${key}</key><string>${xml(value)}</string>`).join('')}</dict>\n`
|
|
184
197
|
+ `<key>RunAtLoad</key><true/><key>KeepAlive</key><dict><key>SuccessfulExit</key><false/></dict>\n`
|
|
185
198
|
+ `<key>ProcessType</key><string>Background</string>\n</dict></plist>\n`;
|
|
186
199
|
}
|
|
200
|
+
// Retain only profile/tool paths, never inherited credentials or arbitrary environment.
|
|
201
|
+
function serviceEnvironment(source) {
|
|
202
|
+
const result = {};
|
|
203
|
+
for (const key of ['OURS_CONFIG', 'OURS_FLEET_HOME', 'PATH']) {
|
|
204
|
+
const value = source[key];
|
|
205
|
+
if (!value)
|
|
206
|
+
continue;
|
|
207
|
+
if (/[\r\n\0]/.test(value))
|
|
208
|
+
throw new FleetError('invalid_request', `invalid service path setting: ${key}`);
|
|
209
|
+
result[key] = key === 'PATH' ? value : resolve(value);
|
|
210
|
+
}
|
|
211
|
+
return result;
|
|
212
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FleetError } from '../application/errors.js';
|
|
2
|
+
/** Only failure of the enrolled device check may invalidate the App's saved credential. */
|
|
3
|
+
export declare class WorkspaceDeviceAuthError extends FleetError {
|
|
4
|
+
constructor(message?: string);
|
|
5
|
+
}
|
|
6
|
+
export interface WorkspaceDevice {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
lastUsedAt: number;
|
|
11
|
+
expiresAt: number;
|
|
12
|
+
revokedAt: number | null;
|
|
13
|
+
}
|
|
14
|
+
export declare class WorkspaceDeviceStore {
|
|
15
|
+
private readonly now;
|
|
16
|
+
private readonly db;
|
|
17
|
+
readonly workspaceId: string;
|
|
18
|
+
constructor(dir?: string, now?: () => number);
|
|
19
|
+
mint(issuer?: string | null): {
|
|
20
|
+
enrollment: string;
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
expiresAt: number;
|
|
23
|
+
};
|
|
24
|
+
enroll(enrollment: string, workspaceId: string, label: string): {
|
|
25
|
+
token: string;
|
|
26
|
+
device: WorkspaceDevice;
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
};
|
|
29
|
+
authenticate(token: string): WorkspaceDevice;
|
|
30
|
+
valid(id: string): boolean;
|
|
31
|
+
list(): WorkspaceDevice[];
|
|
32
|
+
revoke(id: string): void;
|
|
33
|
+
/** Retire account links without changing the installation's stable host ID or other data. */
|
|
34
|
+
revokeAll(): void;
|
|
35
|
+
close(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { createHash, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
3
|
+
import { mkdirSync, chmodSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { stateRoot } from '../paths.js';
|
|
6
|
+
import { FleetError } from '../application/errors.js';
|
|
7
|
+
const opaque = () => randomBytes(32).toString('base64url');
|
|
8
|
+
const hash = (value) => createHash('sha256').update(value).digest('hex');
|
|
9
|
+
/** Only failure of the enrolled device check may invalidate the App's saved credential. */
|
|
10
|
+
export class WorkspaceDeviceAuthError extends FleetError {
|
|
11
|
+
constructor(message = 'workspace device is missing, expired, or revoked') { super('unauthorized', message); }
|
|
12
|
+
}
|
|
13
|
+
export class WorkspaceDeviceStore {
|
|
14
|
+
now;
|
|
15
|
+
db;
|
|
16
|
+
workspaceId;
|
|
17
|
+
constructor(dir = join(stateRoot(), 'web'), now = Date.now) {
|
|
18
|
+
this.now = now;
|
|
19
|
+
const { DatabaseSync } = createRequire(import.meta.url)('node:sqlite');
|
|
20
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
21
|
+
chmodSync(dir, 0o700);
|
|
22
|
+
const path = join(dir, 'workspace-devices.db');
|
|
23
|
+
this.db = new DatabaseSync(path);
|
|
24
|
+
chmodSync(path, 0o600);
|
|
25
|
+
this.db.exec(`PRAGMA journal_mode=WAL; PRAGMA busy_timeout=5000;
|
|
26
|
+
CREATE TABLE IF NOT EXISTS metadata(key TEXT PRIMARY KEY,value TEXT NOT NULL);
|
|
27
|
+
CREATE TABLE IF NOT EXISTS devices(id TEXT PRIMARY KEY,hash TEXT NOT NULL,label TEXT NOT NULL,createdAt INTEGER NOT NULL,lastUsedAt INTEGER NOT NULL,expiresAt INTEGER NOT NULL,revokedAt INTEGER);
|
|
28
|
+
CREATE TABLE IF NOT EXISTS enrollments(hash TEXT PRIMARY KEY,expiresAt INTEGER NOT NULL,issuer TEXT);`);
|
|
29
|
+
this.db.prepare('INSERT OR IGNORE INTO metadata VALUES(?,?)').run('workspaceId', opaque());
|
|
30
|
+
this.workspaceId = String(this.db.prepare('SELECT value FROM metadata WHERE key=?').get('workspaceId').value);
|
|
31
|
+
}
|
|
32
|
+
mint(issuer = null) {
|
|
33
|
+
const now = this.now(), enrollment = opaque(), expiresAt = now + 5 * 60000;
|
|
34
|
+
this.db.exec('BEGIN IMMEDIATE');
|
|
35
|
+
try {
|
|
36
|
+
this.db.prepare('DELETE FROM enrollments WHERE expiresAt<=?').run(now);
|
|
37
|
+
const count = Number(this.db.prepare('SELECT count(*) AS n FROM enrollments').get().n);
|
|
38
|
+
if (count >= 32)
|
|
39
|
+
throw new FleetError('rate_limited', 'too many pending device links');
|
|
40
|
+
this.db.prepare('INSERT INTO enrollments VALUES(?,?,?)').run(hash(enrollment), expiresAt, issuer);
|
|
41
|
+
this.db.exec('COMMIT');
|
|
42
|
+
return { enrollment, workspaceId: this.workspaceId, expiresAt };
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
this.db.exec('ROLLBACK');
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
enroll(enrollment, workspaceId, label) {
|
|
50
|
+
if (workspaceId !== this.workspaceId || typeof enrollment !== 'string' || !/^[\w-]{43}$/.test(enrollment))
|
|
51
|
+
throw new FleetError('unauthorized', 'invalid device enrollment');
|
|
52
|
+
if (typeof label !== 'string' || !label.trim() || label.length > 100 || /[\x00-\x1f\x7f]/.test(label))
|
|
53
|
+
throw new FleetError('invalid_request', 'device name must contain 1–100 printable characters');
|
|
54
|
+
const now = this.now(), id = opaque(), token = `${id}.${opaque()}`;
|
|
55
|
+
this.db.exec('BEGIN IMMEDIATE');
|
|
56
|
+
try {
|
|
57
|
+
const code = this.db.prepare('DELETE FROM enrollments WHERE hash=? AND expiresAt>? RETURNING issuer').get(hash(enrollment), now);
|
|
58
|
+
if (!code)
|
|
59
|
+
throw new FleetError('unauthorized', 'device enrollment is expired or already used');
|
|
60
|
+
if (code.issuer && !this.db.prepare('SELECT id FROM devices WHERE id=? AND revokedAt IS NULL AND expiresAt>?').get(code.issuer, now))
|
|
61
|
+
throw new FleetError('unauthorized', 'issuing device has been revoked');
|
|
62
|
+
const count = Number(this.db.prepare('SELECT count(*) AS n FROM devices WHERE revokedAt IS NULL AND expiresAt>?').get(now).n);
|
|
63
|
+
if (count >= 128)
|
|
64
|
+
throw new FleetError('rate_limited', 'authorized device limit reached');
|
|
65
|
+
const device = { id, label: label.trim(), createdAt: now, lastUsedAt: now, expiresAt: now + 90 * 86400000, revokedAt: null };
|
|
66
|
+
this.db.prepare('INSERT INTO devices VALUES(?,?,?,?,?,?,NULL)').run(id, hash(token), device.label, now, now, device.expiresAt);
|
|
67
|
+
this.db.exec('COMMIT');
|
|
68
|
+
return { token, device, workspaceId };
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
this.db.exec('ROLLBACK');
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
authenticate(token) {
|
|
76
|
+
const id = typeof token === 'string' ? token.split('.')[0] : '', now = this.now();
|
|
77
|
+
const row = this.db.prepare('SELECT * FROM devices WHERE id=? AND revokedAt IS NULL AND expiresAt>?').get(id, now);
|
|
78
|
+
const supplied = Buffer.from(hash(token || '')), expected = Buffer.from(String(row?.hash || '0'.repeat(64)));
|
|
79
|
+
if (!row || !timingSafeEqual(supplied, expected))
|
|
80
|
+
throw new WorkspaceDeviceAuthError();
|
|
81
|
+
this.db.prepare('UPDATE devices SET lastUsedAt=? WHERE id=?').run(now, id);
|
|
82
|
+
return { id, label: String(row.label), createdAt: Number(row.createdAt), lastUsedAt: now, expiresAt: Number(row.expiresAt), revokedAt: null };
|
|
83
|
+
}
|
|
84
|
+
valid(id) { return Boolean(this.db.prepare('SELECT id FROM devices WHERE id=? AND revokedAt IS NULL AND expiresAt>?').get(id, this.now())); }
|
|
85
|
+
list() { return this.db.prepare('SELECT id,label,createdAt,lastUsedAt,expiresAt,revokedAt FROM devices ORDER BY createdAt DESC LIMIT 256').all().map(row => ({ id: String(row.id), label: String(row.label), createdAt: Number(row.createdAt), lastUsedAt: Number(row.lastUsedAt), expiresAt: Number(row.expiresAt), revokedAt: row.revokedAt === null ? null : Number(row.revokedAt) })); }
|
|
86
|
+
revoke(id) { this.db.prepare('UPDATE devices SET revokedAt=? WHERE id=? AND revokedAt IS NULL').run(this.now(), id); this.db.prepare('DELETE FROM enrollments WHERE issuer=?').run(id); }
|
|
87
|
+
/** Retire account links without changing the installation's stable host ID or other data. */
|
|
88
|
+
revokeAll() {
|
|
89
|
+
this.db.exec('BEGIN IMMEDIATE');
|
|
90
|
+
try {
|
|
91
|
+
this.db.prepare('UPDATE devices SET revokedAt=? WHERE revokedAt IS NULL').run(this.now());
|
|
92
|
+
this.db.exec('DELETE FROM enrollments');
|
|
93
|
+
this.db.exec('COMMIT');
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
this.db.exec('ROLLBACK');
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
close() { this.db.close(); }
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function startWorkspaceTunnel(origin: string): () => Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync, lstatSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { stateRoot } from '../paths.js';
|
|
5
|
+
export function startWorkspaceTunnel(origin) {
|
|
6
|
+
const dir = join(stateRoot(), 'workspace'), file = join(dir, 'tunnel.json');
|
|
7
|
+
if (!existsSync(file))
|
|
8
|
+
return async () => { };
|
|
9
|
+
const config = JSON.parse(readFileSync(file, 'utf8'));
|
|
10
|
+
if (config.origin !== origin)
|
|
11
|
+
throw Error('Workspace tunnel requires its configured public origin');
|
|
12
|
+
const tokenFile = join(dir, 'connector');
|
|
13
|
+
if (config.tokenFile !== tokenFile)
|
|
14
|
+
throw Error('Unexpected connector credential path');
|
|
15
|
+
const stat = lstatSync(tokenFile);
|
|
16
|
+
if (!stat.isFile() || stat.isSymbolicLink() || (stat.mode & 0o077) !== 0 || stat.uid !== process.getuid?.())
|
|
17
|
+
throw Error('Connector credential must be an owned private file');
|
|
18
|
+
let stopped = false, child, timer, backoff = 1000;
|
|
19
|
+
const launch = () => {
|
|
20
|
+
if (stopped)
|
|
21
|
+
return;
|
|
22
|
+
child = spawn('cloudflared', ['tunnel', '--no-autoupdate', 'run', '--token-file', tokenFile], { stdio: 'ignore' });
|
|
23
|
+
let scheduled = false;
|
|
24
|
+
// Keep an error listener for the child's whole lifetime, including shutdown.
|
|
25
|
+
const retry = () => { if (scheduled || stopped)
|
|
26
|
+
return; scheduled = true; timer = setTimeout(launch, backoff); backoff = Math.min(30000, backoff * 2); };
|
|
27
|
+
child.on('error', retry);
|
|
28
|
+
child.once('exit', retry);
|
|
29
|
+
};
|
|
30
|
+
launch();
|
|
31
|
+
// A failed spawn has no pid and reports error/close rather than exit.
|
|
32
|
+
return async () => { stopped = true; clearTimeout(timer); const current = child; if (!current?.pid || current.exitCode !== null || current.signalCode !== null)
|
|
33
|
+
return; await new Promise(resolve => { const timeout = setTimeout(() => { current.kill('SIGKILL'); resolve(); }, 5000); current.once('close', () => { clearTimeout(timeout); resolve(); }); current.kill('SIGTERM'); }); };
|
|
34
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type AttachOursClientOptions, type OursClient } from '@ours.network/sdk/client';
|
|
2
|
+
export interface WorkspacePayload {
|
|
3
|
+
version: 1;
|
|
4
|
+
appOrigin: string;
|
|
5
|
+
hostname: string;
|
|
6
|
+
rootName: string;
|
|
7
|
+
name: string;
|
|
8
|
+
surname: string;
|
|
9
|
+
connectorToken?: string;
|
|
10
|
+
invitation: string;
|
|
11
|
+
serverCid: string;
|
|
12
|
+
challenge: {
|
|
13
|
+
nonce: string;
|
|
14
|
+
workspaceId: string;
|
|
15
|
+
accountId: string;
|
|
16
|
+
expiresAt: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare function readWorkspacePayload(file: string): WorkspacePayload;
|
|
20
|
+
export declare function decodeWorkspacePayload(input: string, options?: {
|
|
21
|
+
allowExpired?: boolean;
|
|
22
|
+
}): WorkspacePayload;
|
|
23
|
+
/** Credential-free renewal is allowed only on the host already holding this private connector. */
|
|
24
|
+
export declare function checkWorkspaceConnector(payload: WorkspacePayload): void;
|
|
25
|
+
type DaemonClient = Pick<OursClient, 'listIdentities' | 'chooseIdentity' | 'addContact' | 'listContacts' | 'sendCommand' | 'removeContact' | 'releaseLease' | 'close'>;
|
|
26
|
+
/** How tunnel setup reaches this host's daemon; replaced only by tests. */
|
|
27
|
+
export type AttachDaemonClient = (options: AttachOursClientOptions) => Promise<DaemonClient>;
|
|
28
|
+
/**
|
|
29
|
+
* Check the Fleet configuration tunnel setup will use, before the one-time command is used.
|
|
30
|
+
* Reads only; an existing Owner is compared with this host's own Messenger identity.
|
|
31
|
+
*/
|
|
32
|
+
export declare function checkWorkspaceConfiguration(configuration?: string, attach?: AttachDaemonClient): Promise<void>;
|
|
33
|
+
export declare function enrollWorkspace(payload: WorkspacePayload, configuration?: string, options?: {
|
|
34
|
+
migrateAppOrigin?: boolean;
|
|
35
|
+
preserveProfile?: boolean;
|
|
36
|
+
replacingWorkspace?: string;
|
|
37
|
+
attach?: AttachDaemonClient;
|
|
38
|
+
contactWaitMs?: number;
|
|
39
|
+
afterInvitation?: () => void;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
origin: string;
|
|
42
|
+
hostWorkspaceId: string;
|
|
43
|
+
rootCid: string;
|
|
44
|
+
}>;
|
|
45
|
+
/** Only the existing signed-root receipt authorizes the scoped tunnel target. */
|
|
46
|
+
/**
|
|
47
|
+
* The enrollment server contact exists only to carry the signed binding. Once the account has confirmed
|
|
48
|
+
* that binding, remove exactly that contact from this host's Messenger, so it does not stay in the
|
|
49
|
+
* person's chats. The server identity is the one recorded with the binding; nothing else is touched.
|
|
50
|
+
*/
|
|
51
|
+
export declare function removeEnrollmentContact(attach?: AttachDaemonClient): Promise<boolean>;
|
|
52
|
+
export declare function configureWorkspacePort(payload: Pick<WorkspacePayload, 'appOrigin' | 'challenge'>, hostWorkspaceId: string, rootCid: string, port: number): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Point the tunnel at this host's port. The account answers only for a confirmed signed binding, and
|
|
55
|
+
* only after that answer is the enrollment contact removed; a refused or unconfirmed target leaves it,
|
|
56
|
+
* so the setup can be finished later. A removal that fails is reported and does not undo the setup.
|
|
57
|
+
*/
|
|
58
|
+
export declare function confirmWorkspaceTarget(payload: Pick<WorkspacePayload, 'appOrigin' | 'challenge'>, hostWorkspaceId: string, rootCid: string, port: number, cleanupFailed?: (error: unknown) => void): Promise<void>;
|
|
59
|
+
/** Retire exactly the original registration using the same signed Human root that bound it. */
|
|
60
|
+
export declare function unregisterWorkspace(previous: {
|
|
61
|
+
workspaceId: string;
|
|
62
|
+
hostWorkspaceId: string;
|
|
63
|
+
appOrigin: string;
|
|
64
|
+
serverCid: string;
|
|
65
|
+
proofRootCid?: string;
|
|
66
|
+
}, payload: WorkspacePayload, operationNonce: string, attach?: AttachDaemonClient, options?: {
|
|
67
|
+
request?: typeof fetch;
|
|
68
|
+
waitMs?: number;
|
|
69
|
+
checkOnly?: boolean;
|
|
70
|
+
beforeSend?: () => void;
|
|
71
|
+
operationExpiresAt?: number;
|
|
72
|
+
onReceipt?: (status: {
|
|
73
|
+
deleted?: boolean;
|
|
74
|
+
retired?: boolean;
|
|
75
|
+
absent?: boolean;
|
|
76
|
+
rejected?: boolean;
|
|
77
|
+
expired?: boolean;
|
|
78
|
+
deadlineEnforced?: boolean;
|
|
79
|
+
oldBindingPresent?: boolean;
|
|
80
|
+
}) => void;
|
|
81
|
+
}): Promise<string>;
|
|
82
|
+
export {};
|