@songsid/agend 2.3.5-alpha.7 → 2.3.5-alpha.9
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/accounts-profiles.d.ts +6 -0
- package/dist/accounts-profiles.js +16 -0
- package/dist/accounts-profiles.js.map +1 -1
- package/dist/accounts-view.d.ts +17 -0
- package/dist/accounts-view.js +33 -6
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-cli-instructions.md +1 -1
- package/dist/agent-cli.js +5 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-whats-new.js +5 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/apply-job.d.ts +5 -0
- package/dist/apply-job.js +10 -3
- package/dist/apply-job.js.map +1 -1
- package/dist/auth-api.d.ts +1 -1
- package/dist/auth-api.js +4 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/company-join.d.ts +16 -0
- package/dist/authority/company-join.js +37 -0
- package/dist/authority/company-join.js.map +1 -0
- package/dist/authority/hub-initialization.d.ts +13 -0
- package/dist/authority/hub-initialization.js +30 -0
- package/dist/authority/hub-initialization.js.map +1 -0
- package/dist/backend/claude-code.d.ts +1 -0
- package/dist/backend/claude-code.js +13 -0
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/types.d.ts +4 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +2 -2
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/claude-model-minimum.d.ts +7 -0
- package/dist/claude-model-minimum.js +16 -0
- package/dist/claude-model-minimum.js.map +1 -0
- package/dist/config-validator.js +2 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/daemon.d.ts +43 -1
- package/dist/daemon.js +176 -27
- package/dist/daemon.js.map +1 -1
- package/dist/decision-list.d.ts +2 -0
- package/dist/decision-list.js +1 -1
- package/dist/decision-list.js.map +1 -1
- package/dist/fleet-manager.d.ts +75 -3
- package/dist/fleet-manager.js +462 -53
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +14 -3
- package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +4 -1
- package/dist/general-knowledge/steering/core-rules.md +1 -1
- package/dist/hub/catalog.d.ts +1 -1
- package/dist/hub/catalog.js +151 -33
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.js +4 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +6 -0
- package/dist/hub/compose/member.js +9 -1
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +55 -1
- package/dist/hub/compose/server.js +76 -10
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/directory.d.ts +2 -0
- package/dist/hub/directory/directory.js +49 -4
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/types.d.ts +2 -0
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/enrollment-budget.d.ts +6 -0
- package/dist/hub/enrollment-budget.js +24 -0
- package/dist/hub/enrollment-budget.js.map +1 -0
- package/dist/hub/group-policy/admin-api.d.ts +30 -0
- package/dist/hub/group-policy/admin-api.js +83 -0
- package/dist/hub/group-policy/admin-api.js.map +1 -0
- package/dist/hub/group-policy/admin-control.d.ts +34 -0
- package/dist/hub/group-policy/admin-control.js +258 -0
- package/dist/hub/group-policy/admin-control.js.map +1 -0
- package/dist/hub/group-policy/admin-dto.d.ts +9 -1
- package/dist/hub/group-policy/admin-dto.js.map +1 -1
- package/dist/hub/group-policy/admin-facts.d.ts +17 -0
- package/dist/hub/group-policy/admin-facts.js +33 -0
- package/dist/hub/group-policy/admin-facts.js.map +1 -0
- package/dist/hub/group-policy/admin-impact.d.ts +51 -0
- package/dist/hub/group-policy/admin-impact.js +88 -0
- package/dist/hub/group-policy/admin-impact.js.map +1 -0
- package/dist/hub/group-policy/authorization.d.ts +22 -0
- package/dist/hub/group-policy/authorization.js +147 -2
- package/dist/hub/group-policy/authorization.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.d.ts +21 -0
- package/dist/hub/group-policy/impact-inventory.js +75 -0
- package/dist/hub/group-policy/impact-inventory.js.map +1 -0
- package/dist/hub/group-policy/resources.d.ts +13 -1
- package/dist/hub/group-policy/resources.js +92 -23
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/group-policy/store.d.ts +11 -0
- package/dist/hub/group-policy/store.js +57 -2
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/group-policy/welcome.d.ts +36 -0
- package/dist/hub/group-policy/welcome.js +55 -0
- package/dist/hub/group-policy/welcome.js.map +1 -0
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +184 -8
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +2 -0
- package/dist/hub/http/core.js +10 -1
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +10 -0
- package/dist/hub/http/schema.js +4 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/init/browser-certificate.d.ts +6 -1
- package/dist/hub/init/browser-certificate.js +22 -1
- package/dist/hub/init/browser-certificate.js.map +1 -1
- package/dist/hub/init/initializer.d.ts +11 -1
- package/dist/hub/init/initializer.js +202 -83
- package/dist/hub/init/initializer.js.map +1 -1
- package/dist/hub/init/layout.js +1 -1
- package/dist/hub/init/layout.js.map +1 -1
- package/dist/hub/init/text.js +2 -2
- package/dist/hub/init/text.js.map +1 -1
- package/dist/hub/init/types.d.ts +32 -4
- package/dist/hub/init/types.js.map +1 -1
- package/dist/hub/init/web-audit-import.d.ts +12 -0
- package/dist/hub/init/web-audit-import.js +39 -0
- package/dist/hub/init/web-audit-import.js.map +1 -0
- package/dist/hub/init/web-audit.d.ts +30 -0
- package/dist/hub/init/web-audit.js +42 -0
- package/dist/hub/init/web-audit.js.map +1 -0
- package/dist/hub/init/web-error.d.ts +6 -0
- package/dist/hub/init/web-error.js +8 -0
- package/dist/hub/init/web-error.js.map +1 -0
- package/dist/hub/init/web-http.d.ts +9 -0
- package/dist/hub/init/web-http.js +103 -0
- package/dist/hub/init/web-http.js.map +1 -0
- package/dist/hub/init/web.d.ts +118 -0
- package/dist/hub/init/web.js +428 -0
- package/dist/hub/init/web.js.map +1 -0
- package/dist/hub/init/wizard.js +1 -3
- package/dist/hub/init/wizard.js.map +1 -1
- package/dist/hub/join/client.d.ts +35 -0
- package/dist/hub/join/client.js +112 -0
- package/dist/hub/join/client.js.map +1 -0
- package/dist/hub/join/descriptor.d.ts +45 -0
- package/dist/hub/join/descriptor.js +52 -0
- package/dist/hub/join/descriptor.js.map +1 -0
- package/dist/hub/join/fleet-authority.d.ts +2 -0
- package/dist/hub/join/fleet-authority.js +3 -0
- package/dist/hub/join/fleet-authority.js.map +1 -0
- package/dist/hub/join/http.d.ts +8 -0
- package/dist/hub/join/http.js +112 -0
- package/dist/hub/join/http.js.map +1 -0
- package/dist/hub/join/invitation.d.ts +28 -0
- package/dist/hub/join/invitation.js +28 -0
- package/dist/hub/join/invitation.js.map +1 -0
- package/dist/hub/join/local-journal.d.ts +84 -0
- package/dist/hub/join/local-journal.js +65 -0
- package/dist/hub/join/local-journal.js.map +1 -0
- package/dist/hub/join/local.d.ts +116 -0
- package/dist/hub/join/local.js +419 -0
- package/dist/hub/join/local.js.map +1 -0
- package/dist/hub/join/private.d.ts +3 -0
- package/dist/hub/join/private.js +46 -0
- package/dist/hub/join/private.js.map +1 -0
- package/dist/hub/join/protocol.d.ts +69 -0
- package/dist/hub/join/protocol.js +96 -0
- package/dist/hub/join/protocol.js.map +1 -0
- package/dist/hub/join/receipt.d.ts +42 -0
- package/dist/hub/join/receipt.js +75 -0
- package/dist/hub/join/receipt.js.map +1 -0
- package/dist/hub/join/service.d.ts +177 -0
- package/dist/hub/join/service.js +564 -0
- package/dist/hub/join/service.js.map +1 -0
- package/dist/hub/join/store.d.ts +97 -0
- package/dist/hub/join/store.js +87 -0
- package/dist/hub/join/store.js.map +1 -0
- package/dist/hub/join/trust.d.ts +13 -0
- package/dist/hub/join/trust.js +68 -0
- package/dist/hub/join/trust.js.map +1 -0
- package/dist/hub/member/pairing-api.d.ts +2 -0
- package/dist/hub/member/pairing-api.js +7 -1
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/pairing-notices.d.ts +18 -0
- package/dist/hub/member/pairing-notices.js +60 -0
- package/dist/hub/member/pairing-notices.js.map +1 -0
- package/dist/hub/pairing-notices.d.ts +47 -0
- package/dist/hub/pairing-notices.js +246 -0
- package/dist/hub/pairing-notices.js.map +1 -0
- package/dist/hub/pairing.d.ts +39 -1
- package/dist/hub/pairing.js +316 -16
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/protocol.d.ts +61 -0
- package/dist/hub/protocol.js +8 -1
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/room-read-pacer.d.ts +14 -0
- package/dist/hub/room-read-pacer.js +51 -0
- package/dist/hub/room-read-pacer.js.map +1 -0
- package/dist/hub/rooms.d.ts +7 -1
- package/dist/hub/rooms.js +25 -13
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +8 -1
- package/dist/hub/runtime.js +13 -0
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +3 -0
- package/dist/hub/server.js +18 -0
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-directory-transition.d.ts +48 -0
- package/dist/hub/session-directory-transition.js +118 -0
- package/dist/hub/session-directory-transition.js.map +1 -0
- package/dist/hub/session-epoch.d.ts +16 -0
- package/dist/hub/session-epoch.js +50 -0
- package/dist/hub/session-epoch.js.map +1 -0
- package/dist/hub/sessions.d.ts +13 -0
- package/dist/hub/sessions.js +36 -16
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-api.d.ts +50 -0
- package/dist/hub/settings-api.js +92 -0
- package/dist/hub/settings-api.js.map +1 -0
- package/dist/hub/settings-commit.d.ts +95 -0
- package/dist/hub/settings-commit.js +490 -0
- package/dist/hub/settings-commit.js.map +1 -0
- package/dist/hub/settings-directory-decision.d.ts +433 -0
- package/dist/hub/settings-directory-decision.js +236 -0
- package/dist/hub/settings-directory-decision.js.map +1 -0
- package/dist/hub/settings-directory-proof.d.ts +77 -0
- package/dist/hub/settings-directory-proof.js +303 -0
- package/dist/hub/settings-directory-proof.js.map +1 -0
- package/dist/hub/store.d.ts +12 -2
- package/dist/hub/store.js +9 -5
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/types.d.ts +15 -2
- package/dist/hub-host-settings.d.ts +48 -0
- package/dist/hub-host-settings.js +85 -0
- package/dist/hub-host-settings.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +3 -0
- package/dist/instance-lifecycle.js +4 -0
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +54 -30
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +9 -1
- package/dist/login-controller.js +20 -1
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.js +4 -2
- package/dist/login-flows.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.js +1 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +2 -0
- package/dist/outbound-schemas.js +4 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +1 -1
- package/dist/profile-signins.d.ts +107 -0
- package/dist/profile-signins.js +249 -0
- package/dist/profile-signins.js.map +1 -0
- package/dist/quickstart-api.js +2 -2
- package/dist/quickstart-api.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +5 -1
- package/dist/reply-buttons-controller.js +8 -4
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-buttons.d.ts +6 -2
- package/dist/reply-buttons.js +7 -3
- package/dist/reply-buttons.js.map +1 -1
- package/dist/scheduler/db.d.ts +10 -0
- package/dist/scheduler/db.js +38 -11
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/types.d.ts +6 -1
- package/dist/settings-api.d.ts +9 -1
- package/dist/settings-api.js +200 -4
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-confirmation.d.ts +1 -1
- package/dist/settings-confirmation.js +1 -1
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.js +58 -0
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -0
- package/dist/settings-http-confirmation.js +8 -5
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-request-capability.d.ts +5 -0
- package/dist/settings-request-capability.js +6 -1
- package/dist/settings-request-capability.js.map +1 -1
- package/dist/signin-keepalive.d.ts +2 -0
- package/dist/signin-keepalive.js +30 -2
- package/dist/signin-keepalive.js.map +1 -1
- package/dist/structured-signin-transport.d.ts +20 -2
- package/dist/structured-signin-transport.js +57 -6
- package/dist/structured-signin-transport.js.map +1 -1
- package/dist/team-membership.d.ts +7 -0
- package/dist/team-membership.js +10 -0
- package/dist/team-membership.js.map +1 -0
- package/dist/tmux-manager.d.ts +1 -1
- package/dist/tmux-manager.js +4 -1
- package/dist/tmux-manager.js.map +1 -1
- package/dist/topic-commands.js +1 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +10 -5
- package/dist/ui/accounts-manage.js +29 -11
- package/dist/ui/accounts-view.js +75 -28
- package/dist/ui/backend-signin.js +61 -16
- package/dist/ui/hub-attachments.js +3 -3
- package/dist/ui/hub-chat-strings.js +2 -0
- package/dist/ui/hub-client.js +50 -4
- package/dist/ui/hub-company-join-strings.js +74 -0
- package/dist/ui/hub-company-join.js +119 -0
- package/dist/ui/hub-group-policy.js +175 -0
- package/dist/ui/hub-group-strings.js +97 -0
- package/dist/ui/hub-owner-strings.js +12 -12
- package/dist/ui/hub-pairing-progress-strings.js +15 -0
- package/dist/ui/hub-quick-pairing.js +209 -0
- package/dist/ui/hub-quick-strings.js +43 -0
- package/dist/ui/hub-read-strings.js +7 -0
- package/dist/ui/hub-this-hub.js +112 -0
- package/dist/ui/hub-welcome.js +102 -0
- package/dist/ui/panel-hub.js +217 -28
- package/dist/ui/panel-needs.js +1 -1
- package/dist/ui/panel-settings.js +7 -4
- package/dist/ui/settings-apply.js +12 -5
- package/dist/ui/settings-devices.js +2 -2
- package/dist/ui/settings-dialogs.js +3 -1
- package/dist/ui/settings-hub-company-join.js +90 -0
- package/dist/ui/settings-hub-membership.js +20 -5
- package/dist/ui/settings-hub-preview.js +74 -0
- package/dist/ui/settings-hub-run.js +60 -0
- package/dist/ui/settings-hub-section.js +30 -3
- package/dist/ui/settings-hub.js +52 -11
- package/dist/ui/settings-registry.js +2 -0
- package/dist/ui/settings-restart-strings.js +17 -0
- package/dist/ui/settings-strings.js +6 -4
- package/dist/ui/shared/accounts-keepalive.css +11 -6
- package/dist/ui/shared/accounts.css +68 -18
- package/dist/ui/shared/app-i18n.js +4 -1
- package/dist/ui/shared/app-shell.js +39 -25
- package/dist/ui/shared/app.css +9 -8
- package/dist/ui/shared/chat-strings.js +13 -13
- package/dist/ui/shared/hub-chat.css +12 -0
- package/dist/ui/shared/hub-groups.css +28 -0
- package/dist/ui/shared/hub-owner.css +19 -1
- package/dist/ui/shared/hub.css +8 -1
- package/dist/ui/shared/setup-host-text.js +4 -1
- package/dist/ui/shared/signin.js +3 -1
- package/dist/ui/shared/usage-dialog.js +3 -72
- package/dist/ui/shared/usage-meter.js +84 -0
- package/dist/ui/shared/web-authorize.js +4 -4
- package/dist/ui/structured-signin.js +24 -6
- package/dist/update-dispatch.d.ts +32 -4
- package/dist/update-dispatch.js +146 -16
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-launch.d.ts +1 -1
- package/dist/update-launch.js +2 -2
- package/dist/update-launch.js.map +1 -1
- package/dist/update-marker.d.ts +2 -0
- package/dist/update-marker.js.map +1 -1
- package/dist/view-api.d.ts +2 -8
- package/dist/view-api.js +3 -9
- package/dist/view-api.js.map +1 -1
- package/dist/web-api.d.ts +7 -1
- package/dist/web-api.js +91 -14
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +16 -2
- package/dist/web-backend-login.js +14 -0
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-notices.d.ts +9 -0
- package/dist/web-notices.js +19 -0
- package/dist/web-notices.js.map +1 -1
- package/dist/web-terminal.d.ts +7 -0
- package/dist/web-terminal.js +14 -2
- package/dist/web-terminal.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface HubPreviewSettingsView {
|
|
2
|
+
/** This fleet runs a Hub (hub.enabled is true): the card applies. */
|
|
3
|
+
hosted: boolean;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
port: number | null;
|
|
6
|
+
/** A port to offer when switching on: the Hub's web listener port + 1 when that is usable, else null. */
|
|
7
|
+
suggested: number | null;
|
|
8
|
+
}
|
|
9
|
+
export type HubPreviewRefusal = "not_hosted" | "invalid_port" | "port_conflict" | "port_in_use" | "busy";
|
|
10
|
+
export declare function hubPreviewSettingsView(rawConfig: unknown): HubPreviewSettingsView;
|
|
11
|
+
/** Can a listener bind host:port right now? (Closed at once; never left open.) */
|
|
12
|
+
export declare function portFree(host: string, port: number): Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* The patch for a requested state, or why not. `enabled: false` removes the key (previews off). Pure apart from the bind
|
|
15
|
+
* check, which runs only when the port changes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function hubPreviewPatch(rawConfig: unknown, body: unknown, opts?: {
|
|
18
|
+
busy?: () => boolean;
|
|
19
|
+
free?: (host: string, port: number) => Promise<boolean>;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
patch: {
|
|
22
|
+
path: string[];
|
|
23
|
+
value?: unknown;
|
|
24
|
+
remove?: true;
|
|
25
|
+
};
|
|
26
|
+
} | {
|
|
27
|
+
refused: HubPreviewRefusal;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* M-2682 (leader, cid-hubname-ui): fleet Settings → Hub → "Run this Hub" — hub.enabled, host owner only. Not sealed (the
|
|
31
|
+
* initialization manifest's digest leaves `enabled` out), so the ordinary save; the runtime mounts or stops the Hub on it.
|
|
32
|
+
* Only an initialized Hub (hub.hubId set) can be switched on; while a sealed-settings commit is unfinished, it waits.
|
|
33
|
+
*/
|
|
34
|
+
export interface HubRunView {
|
|
35
|
+
initialized: boolean;
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function hubRunView(rawConfig: unknown): HubRunView;
|
|
39
|
+
export declare function hubRunPatch(rawConfig: unknown, body: unknown, opts?: {
|
|
40
|
+
busy?: () => boolean;
|
|
41
|
+
}): {
|
|
42
|
+
patch: {
|
|
43
|
+
path: string[];
|
|
44
|
+
value: boolean;
|
|
45
|
+
};
|
|
46
|
+
} | {
|
|
47
|
+
refused: "not_initialized" | "invalid" | "busy";
|
|
48
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M-2682 part B: fleet Settings → Hub → "HTML previews on this Hub" — the host owner switches the Hub's preview listener on
|
|
3
|
+
* or off and picks its port, instead of editing hub.web.preview_port in fleet.yaml (721ca0c3).
|
|
4
|
+
*
|
|
5
|
+
* hub.web.preview_port is outside the Hub's sealed digest (hub/preview.ts: a local setting, part of the runtime's reload key),
|
|
6
|
+
* so this is the ordinary single-file save — no reseal — through the fleet's synchronous writer, which is the same
|
|
7
|
+
* serialization the sealed-settings writer commits under. While that writer has an unfinished commit, this waits (busy).
|
|
8
|
+
*
|
|
9
|
+
* Checks before saving (conflicts): the Hub's own rule (an integer 1–65535, not the Hub's web or member listener or origin
|
|
10
|
+
* port), not this fleet's dashboard (health_port) or its own preview port, and free to listen on now on the Hub's web host.
|
|
11
|
+
*/
|
|
12
|
+
import { createServer } from "node:net";
|
|
13
|
+
const obj = (v) => (v && typeof v === "object" && !Array.isArray(v) ? v : {});
|
|
14
|
+
function fleetPorts(raw) {
|
|
15
|
+
const health = typeof raw.health_port === "number" ? raw.health_port : 19280; // the fleet's default (cli.ts)
|
|
16
|
+
const web = obj(raw.web), preview = typeof web.preview_port === "number" ? web.preview_port : health + 1;
|
|
17
|
+
return [health, ...(web.preview === false ? [] : [preview])];
|
|
18
|
+
}
|
|
19
|
+
export function hubPreviewSettingsView(rawConfig) {
|
|
20
|
+
const raw = obj(rawConfig), hub = obj(raw.hub), web = obj(hub.web);
|
|
21
|
+
const hosted = hub.enabled === true;
|
|
22
|
+
const port = typeof web.preview_port === "number" ? web.preview_port : null;
|
|
23
|
+
const webPort = typeof obj(hub.webListen).port === "number" ? obj(hub.webListen).port : null;
|
|
24
|
+
const memberPort = typeof obj(hub.memberListen).port === "number" ? obj(hub.memberListen).port : null;
|
|
25
|
+
const next = webPort !== null && webPort < 65535 ? webPort + 1 : null;
|
|
26
|
+
const suggested = next !== null && next !== memberPort && !fleetPorts(raw).includes(next) ? next : null;
|
|
27
|
+
return { hosted, enabled: port !== null, port, suggested };
|
|
28
|
+
}
|
|
29
|
+
/** Can a listener bind host:port right now? (Closed at once; never left open.) */
|
|
30
|
+
export function portFree(host, port) {
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
const s = createServer();
|
|
33
|
+
s.once("error", () => resolve(false));
|
|
34
|
+
s.listen({ host, port, exclusive: true }, () => s.close(() => resolve(true)));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The patch for a requested state, or why not. `enabled: false` removes the key (previews off). Pure apart from the bind
|
|
39
|
+
* check, which runs only when the port changes.
|
|
40
|
+
*/
|
|
41
|
+
export async function hubPreviewPatch(rawConfig, body, opts = {}) {
|
|
42
|
+
const raw = obj(rawConfig), hub = obj(raw.hub), b = obj(body);
|
|
43
|
+
if (hub.enabled !== true)
|
|
44
|
+
return { refused: "not_hosted" };
|
|
45
|
+
if (opts.busy?.())
|
|
46
|
+
return { refused: "busy" };
|
|
47
|
+
if (b.enabled === false)
|
|
48
|
+
return { patch: { path: ["hub", "web", "preview_port"], remove: true } };
|
|
49
|
+
if (b.enabled !== true)
|
|
50
|
+
return { refused: "invalid_port" };
|
|
51
|
+
const port = b.port;
|
|
52
|
+
if (typeof port !== "number" || !Number.isInteger(port) || port < 1 || port > 65535)
|
|
53
|
+
return { refused: "invalid_port" };
|
|
54
|
+
// The Hub's own rule, exactly as the mount will apply it (a refusal there would hold the Hub).
|
|
55
|
+
const { hubPreviewSettings } = await import("./hub/preview.js");
|
|
56
|
+
try {
|
|
57
|
+
hubPreviewSettings({ web: { ...obj(hub.web), preview_port: port }, webOrigin: String(hub.webOrigin), memberOrigin: String(hub.memberOrigin),
|
|
58
|
+
webListen: { host: String(obj(hub.webListen).host), port: Number(obj(hub.webListen).port) },
|
|
59
|
+
memberListen: { host: String(obj(hub.memberListen).host), port: Number(obj(hub.memberListen).port) } });
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return { refused: "port_conflict" };
|
|
63
|
+
}
|
|
64
|
+
if (fleetPorts(raw).includes(port))
|
|
65
|
+
return { refused: "port_conflict" };
|
|
66
|
+
const current = obj(hub.web).preview_port;
|
|
67
|
+
if (current !== port && !(await (opts.free ?? portFree)(String(obj(hub.webListen).host), port)))
|
|
68
|
+
return { refused: "port_in_use" };
|
|
69
|
+
return { patch: { path: ["hub", "web", "preview_port"], value: port } };
|
|
70
|
+
}
|
|
71
|
+
export function hubRunView(rawConfig) {
|
|
72
|
+
const hub = obj(obj(rawConfig).hub);
|
|
73
|
+
return { initialized: typeof hub.hubId === "string" && hub.hubId !== "", enabled: hub.enabled === true };
|
|
74
|
+
}
|
|
75
|
+
export function hubRunPatch(rawConfig, body, opts = {}) {
|
|
76
|
+
const b = obj(body);
|
|
77
|
+
if (typeof b.enabled !== "boolean")
|
|
78
|
+
return { refused: "invalid" };
|
|
79
|
+
if (!hubRunView(rawConfig).initialized)
|
|
80
|
+
return { refused: "not_initialized" };
|
|
81
|
+
if (opts.busy?.())
|
|
82
|
+
return { refused: "busy" };
|
|
83
|
+
return { patch: { path: ["hub", "enabled"], value: b.enabled } };
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=hub-host-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub-host-settings.js","sourceRoot":"","sources":["../src/hub-host-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,GAAG,GAAG,CAAC,CAAU,EAA2B,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAA6B,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAY7I,SAAS,UAAU,CAAC,GAA4B;IAC9C,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAG,+BAA+B;IAC/G,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,CAAC,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACzG,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,SAAkB;IACvD,MAAM,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnE,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E,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;AAC1E,CAAC;AAQD,MAAM,UAAU,UAAU,CAAC,SAAkB;IAC3C,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;AAC3G,CAAC;AACD,MAAM,UAAU,WAAW,CAAC,SAAkB,EAAE,IAAa,EAAE,IAAI,GAA6B,EAAE;IAEhG,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAClE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW;QAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC9E,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC9C,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SettingsExecution } from "./settings-transaction.js";
|
|
2
|
+
import type { ActiveDecisionRow } from "./daemon.js";
|
|
2
3
|
import type { InstanceConfig, FleetConfig } from "./types.js";
|
|
3
4
|
import type { TopicDeleteOutcome } from "./instance-topic-delete.js";
|
|
4
5
|
import { RoutingEngine } from "./routing-engine.js";
|
|
@@ -176,6 +177,8 @@ export interface LifecycleContext {
|
|
|
176
177
|
* instances. Absent means the complete roster cannot be proven (#1624).
|
|
177
178
|
*/
|
|
178
179
|
kiroPeerWorkingDirectories?(name: string): string[];
|
|
180
|
+
/** The fleet's startup snapshot of active decisions; each daemon selects its own Active Decisions from it. */
|
|
181
|
+
activeDecisions?(): readonly ActiveDecisionRow[];
|
|
179
182
|
/** True while the fleet is stopping on purpose or an `agend update` is running. */
|
|
180
183
|
isPlannedRestart(): boolean;
|
|
181
184
|
/** Suppress only incident kinds caused by the active tmux server storm. */
|
|
@@ -3,6 +3,7 @@ import { addsSecondGeneral } from "./web-only-fleet.js";
|
|
|
3
3
|
import { NativePaneCrashBudget } from "./native-pane-crash-budget.js";
|
|
4
4
|
import { localWindowsCliEnabled, remoteRuntimeEnabled } from "./runtime-switches.js";
|
|
5
5
|
import { settingsUndo, undoSettingsPaths } from "./settings-transaction.js";
|
|
6
|
+
import { instanceTeams } from "./team-membership.js";
|
|
6
7
|
import { measureSyncWork } from "./sync-work-attribution.js";
|
|
7
8
|
import { REMOVED_BACKENDS, isRemovedBackend, removedBackendMessage } from "./backend/removed.js";
|
|
8
9
|
import { existsSync, readFileSync, mkdirSync, realpathSync, writeFileSync, statSync } from "node:fs";
|
|
@@ -1684,6 +1685,9 @@ export class InstanceLifecycle {
|
|
|
1684
1685
|
daemon.setWorkLeaseCheck(() => this.hasWorkLease(name));
|
|
1685
1686
|
if (seedNow)
|
|
1686
1687
|
daemon.seedActivityNow();
|
|
1688
|
+
// Read at each spawn, like the peers below: joining or leaving a team changes the next launch's Active Decisions.
|
|
1689
|
+
daemon.setDecisionTeams(() => instanceTeams(this.ctx.fleetConfig?.teams, name));
|
|
1690
|
+
daemon.setDecisionSource(this.ctx.activeDecisions ? () => this.ctx.activeDecisions() : undefined);
|
|
1687
1691
|
// Read at each spawn so a fleet.yaml reload is honoured (#984).
|
|
1688
1692
|
daemon.setPeerWorkingDirectories(backendName === "kiro-cli"
|
|
1689
1693
|
? this.ctx.kiroPeerWorkingDirectories ? () => this.ctx.kiroPeerWorkingDirectories(name) : undefined
|