@songsid/agend 2.4.0-beta.8 → 2.4.0-beta.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/auth-api.js +3 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/cli-runtime-switch.js +1 -26
- package/dist/backend/cli-runtime-switch.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/connect/mcp.d.ts +9 -0
- package/dist/connect/mcp.js +10 -0
- package/dist/connect/mcp.js.map +1 -0
- package/dist/connect/stdio.d.ts +1 -1
- package/dist/connect/stdio.js +22 -28
- package/dist/connect/stdio.js.map +1 -1
- package/dist/fleet-manager.d.ts +1 -1
- package/dist/fleet-manager.js +11 -16
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +78 -4
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +10 -2
- package/dist/hub/admin-dashboard.js +17 -1
- package/dist/hub/admin-dashboard.js.map +1 -1
- package/dist/hub/audit/index.d.ts +2 -0
- package/dist/hub/audit/index.js +8 -0
- package/dist/hub/audit/index.js.map +1 -1
- package/dist/hub/buttons.js +3 -1
- package/dist/hub/buttons.js.map +1 -1
- package/dist/hub/catalog.d.ts +1 -0
- package/dist/hub/catalog.js +6 -4
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +3 -0
- package/dist/hub/client.js +14 -2
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.js +28 -11
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +5 -0
- package/dist/hub/compose/server.js +91 -10
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/group-policy/admin-api.d.ts +1 -0
- package/dist/hub/group-policy/admin-api.js +1 -1
- package/dist/hub/group-policy/admin-api.js.map +1 -1
- package/dist/hub/group-policy/admin-dto.d.ts +2 -1
- package/dist/hub/group-policy/admin-inventory.d.ts +2 -0
- package/dist/hub/group-policy/admin-inventory.js +13 -4
- package/dist/hub/group-policy/admin-inventory.js.map +1 -1
- package/dist/hub/group-policy/authorization.d.ts +2 -0
- package/dist/hub/group-policy/authorization.js +7 -2
- package/dist/hub/group-policy/authorization.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +2 -0
- package/dist/hub/group-policy/resources.js +12 -1
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/http/compose.js +99 -22
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.js +27 -3
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +11 -0
- package/dist/hub/http/schema.js +6 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/mcp/auth.d.ts +3 -0
- package/dist/hub/mcp/auth.js +11 -1
- package/dist/hub/mcp/auth.js.map +1 -1
- package/dist/hub/mcp/catalog.d.ts +44 -0
- package/dist/hub/mcp/catalog.js +31 -0
- package/dist/hub/mcp/catalog.js.map +1 -0
- package/dist/hub/mcp/door-schema.d.ts +7 -0
- package/dist/hub/mcp/door-schema.js +20 -0
- package/dist/hub/mcp/door-schema.js.map +1 -0
- package/dist/hub/mcp/http.d.ts +25 -0
- package/dist/hub/mcp/http.js +259 -0
- package/dist/hub/mcp/http.js.map +1 -0
- package/dist/hub/mcp/policy.d.ts +65 -0
- package/dist/hub/mcp/policy.js +153 -0
- package/dist/hub/mcp/policy.js.map +1 -0
- package/dist/hub/mcp/server.d.ts +3 -0
- package/dist/hub/mcp/server.js +32 -0
- package/dist/hub/mcp/server.js.map +1 -0
- package/dist/hub/mcp/tools.d.ts +31 -0
- package/dist/hub/mcp/tools.js +176 -0
- package/dist/hub/mcp/tools.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +4 -4
- package/dist/hub/member/room-ask.js +12 -0
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-mention-feedback.d.ts +44 -0
- package/dist/hub/member/room-mention-feedback.js +121 -0
- package/dist/hub/member/room-mention-feedback.js.map +1 -0
- package/dist/hub/member/room-notification.d.ts +9 -0
- package/dist/hub/member/room-notification.js +2 -0
- package/dist/hub/member/room-notification.js.map +1 -0
- package/dist/hub/member/room-post-answers.d.ts +1 -7
- package/dist/hub/member/room-post-answers.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +3 -0
- package/dist/hub/member/room-post.js +9 -1
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/pairing.d.ts +15 -1
- package/dist/hub/pairing.js +33 -2
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/personal/owner-host.d.ts +76 -0
- package/dist/hub/personal/owner-host.js +137 -40
- package/dist/hub/personal/owner-host.js.map +1 -1
- package/dist/hub/personal/refusals.d.ts +11 -0
- package/dist/hub/personal/refusals.js +33 -0
- package/dist/hub/personal/refusals.js.map +1 -0
- package/dist/hub/personal/runtime-host.d.ts +26 -0
- package/dist/hub/personal/runtime-host.js +51 -0
- package/dist/hub/personal/runtime-host.js.map +1 -0
- package/dist/hub/personal/schema.d.ts +2 -0
- package/dist/hub/personal/schema.js +7 -1
- package/dist/hub/personal/schema.js.map +1 -1
- package/dist/hub/personal/turns.d.ts +39 -0
- package/dist/hub/personal/turns.js +221 -0
- package/dist/hub/personal/turns.js.map +1 -0
- package/dist/hub/personal/types.d.ts +1 -1
- package/dist/hub/policy.d.ts +1 -1
- package/dist/hub/protocol.d.ts +43 -0
- package/dist/hub/protocol.js +16 -4
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/roles/admin-control.js +69 -16
- package/dist/hub/roles/admin-control.js.map +1 -1
- package/dist/hub/roles/admin-types.d.ts +24 -1
- package/dist/hub/roles/allowed-list-control.d.ts +34 -0
- package/dist/hub/roles/allowed-list-control.js +179 -0
- package/dist/hub/roles/allowed-list-control.js.map +1 -0
- package/dist/hub/roles/allowed-list.d.ts +8 -0
- package/dist/hub/roles/allowed-list.js +49 -0
- package/dist/hub/roles/allowed-list.js.map +1 -0
- package/dist/hub/roles/audit-details.d.ts +144 -0
- package/dist/hub/roles/audit-details.js +26 -0
- package/dist/hub/roles/audit-details.js.map +1 -0
- package/dist/hub/roles/authority.d.ts +12 -0
- package/dist/hub/roles/authority.js +39 -3
- package/dist/hub/roles/authority.js.map +1 -1
- package/dist/hub/roles/change.d.ts +3 -1
- package/dist/hub/roles/change.js +4 -3
- package/dist/hub/roles/change.js.map +1 -1
- package/dist/hub/roles/clock.d.ts +3 -0
- package/dist/hub/roles/clock.js +1 -1
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/cutover-inventory.d.ts +2 -0
- package/dist/hub/roles/cutover-inventory.js +8 -1
- package/dist/hub/roles/cutover-inventory.js.map +1 -1
- package/dist/hub/roles/cutover.d.ts +2 -2
- package/dist/hub/roles/cutover.js +3 -4
- package/dist/hub/roles/cutover.js.map +1 -1
- package/dist/hub/roles/delegation.d.ts +4 -1
- package/dist/hub/roles/delegation.js +3 -2
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/expiry-effects.d.ts +8 -0
- package/dist/hub/roles/expiry-effects.js +50 -0
- package/dist/hub/roles/expiry-effects.js.map +1 -0
- package/dist/hub/roles/migrations.d.ts +7 -0
- package/dist/hub/roles/migrations.js +44 -0
- package/dist/hub/roles/migrations.js.map +1 -0
- package/dist/hub/roles/model.d.ts +2 -0
- package/dist/hub/roles/model.js +2 -1
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/overview.d.ts +8 -0
- package/dist/hub/roles/overview.js +15 -0
- package/dist/hub/roles/overview.js.map +1 -0
- package/dist/hub/roles/resource-effects.d.ts +3 -2
- package/dist/hub/roles/resource-effects.js +1 -1
- package/dist/hub/roles/resource-effects.js.map +1 -1
- package/dist/hub/roles/review.d.ts +16 -0
- package/dist/hub/roles/review.js +42 -0
- package/dist/hub/roles/review.js.map +1 -0
- package/dist/hub/roles/writer.d.ts +8 -2
- package/dist/hub/roles/writer.js +56 -16
- package/dist/hub/roles/writer.js.map +1 -1
- package/dist/hub/room-mention-feedback-model.d.ts +12 -0
- package/dist/hub/room-mention-feedback-model.js +12 -0
- package/dist/hub/room-mention-feedback-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +3 -1
- package/dist/hub/rooms/agents.js +94 -12
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/direct-view.d.ts +6 -2
- package/dist/hub/rooms/direct-view.js +3 -3
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +27 -3
- package/dist/hub/rooms/service.js +74 -13
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +3 -1
- package/dist/hub/rooms.d.ts +11 -1
- package/dist/hub/rooms.js +76 -10
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.js +1 -1
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +2 -0
- package/dist/hub/server.js +19 -3
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-directory-transition.d.ts +2 -1
- package/dist/hub/session-directory-transition.js +10 -3
- package/dist/hub/session-directory-transition.js.map +1 -1
- package/dist/hub/sessions.d.ts +1 -1
- package/dist/hub/sessions.js +14 -10
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-commit.d.ts +32 -1
- package/dist/hub/settings-commit.js +11 -4
- package/dist/hub/settings-commit.js.map +1 -1
- package/dist/hub/settings-directory-ca.js +1 -1
- package/dist/hub/settings-directory-ca.js.map +1 -1
- package/dist/hub/settings-directory-control.js +7 -7
- package/dist/hub/settings-directory-control.js.map +1 -1
- package/dist/hub/settings-directory-http.d.ts +2 -0
- package/dist/hub/settings-directory-http.js +21 -6
- package/dist/hub/settings-directory-http.js.map +1 -1
- package/dist/hub/settings-directory-proof.d.ts +5 -1
- package/dist/hub/settings-directory-proof.js +27 -9
- package/dist/hub/settings-directory-proof.js.map +1 -1
- package/dist/hub/settings-directory-recovery.js +2 -1
- package/dist/hub/settings-directory-recovery.js.map +1 -1
- package/dist/hub/settings-directory-save.d.ts +2 -0
- package/dist/hub/settings-directory-save.js +9 -6
- package/dist/hub/settings-directory-save.js.map +1 -1
- package/dist/hub/types.d.ts +11 -0
- package/dist/locale.js +10 -10
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +19 -2
- package/dist/login-controller.js +26 -8
- package/dist/login-controller.js.map +1 -1
- package/dist/runtime-build-info.js +1 -1
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-client.js +6 -6
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.js +8 -3
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-install.d.ts +3 -1
- package/dist/runtime-install.js +5 -3
- package/dist/runtime-install.js.map +1 -1
- package/dist/runtime-personal-answer-only-probe.d.ts +3 -0
- package/dist/runtime-personal-answer-only-probe.js +134 -0
- package/dist/runtime-personal-answer-only-probe.js.map +1 -0
- package/dist/runtime-personal-answer-only.d.ts +16 -0
- package/dist/runtime-personal-answer-only.js +54 -0
- package/dist/runtime-personal-answer-only.js.map +1 -0
- package/dist/runtime-personal-answer.d.ts +6 -2
- package/dist/runtime-personal-answer.js +10 -2
- package/dist/runtime-personal-answer.js.map +1 -1
- package/dist/runtime-personal-preflight.d.ts +4 -1
- package/dist/runtime-personal-preflight.js +50 -4
- package/dist/runtime-personal-preflight.js.map +1 -1
- package/dist/runtime-personal-profile.d.ts +4 -0
- package/dist/runtime-personal-profile.js +11 -0
- package/dist/runtime-personal-profile.js.map +1 -1
- package/dist/runtime-personal-protocol.d.ts +4 -1
- package/dist/runtime-personal-protocol.js +5 -1
- package/dist/runtime-personal-protocol.js.map +1 -1
- package/dist/runtime-personal-stage.d.ts +1 -0
- package/dist/runtime-personal-stage.js +7 -3
- package/dist/runtime-personal-stage.js.map +1 -1
- package/dist/runtime-protocol.d.ts +1 -1
- package/dist/setup-form.js +10 -0
- package/dist/setup-form.js.map +1 -1
- package/dist/tunnel/lease.d.ts +14 -0
- package/dist/tunnel/lease.js +23 -0
- package/dist/tunnel/lease.js.map +1 -1
- package/dist/ui/backend-signin.js +86 -20
- package/dist/ui/chat-activity-groups.js +41 -8
- package/dist/ui/chat-activity.js +3 -1
- package/dist/ui/chat-tour.js +1 -1
- package/dist/ui/fleet-canvas.js +10 -5
- package/dist/ui/fleet-office.js +73 -7
- package/dist/ui/hub-ai-apps-strings.js +6 -0
- package/dist/ui/hub-ai-apps.js +83 -0
- package/dist/ui/hub-client.js +19 -2
- package/dist/ui/hub-directory-editor-strings.js +2 -2
- package/dist/ui/hub-directory-editor.js +1 -0
- package/dist/ui/hub-group-policy.js +4 -3
- package/dist/ui/hub-group-strings.js +2 -2
- package/dist/ui/hub-personal-agent-strings.js +160 -0
- package/dist/ui/hub-personal-agent.js +94 -0
- package/dist/ui/hub-role-audit.js +39 -0
- package/dist/ui/hub-role-forms.js +99 -0
- package/dist/ui/hub-role-notices.js +11 -0
- package/dist/ui/hub-role-view.js +86 -0
- package/dist/ui/hub-roles-strings.js +428 -4
- package/dist/ui/hub-roles.js +76 -41
- package/dist/ui/hub-room-composer.js +3 -2
- package/dist/ui/hub-room-list.js +4 -3
- package/dist/ui/hub-room-members.js +4 -2
- package/dist/ui/hub-room-settings.js +6 -0
- package/dist/ui/hub-room-source-strings.js +17 -0
- package/dist/ui/hub-room-source.js +34 -0
- package/dist/ui/hub-room-thread.js +10 -4
- package/dist/ui/panel-chat.js +4 -4
- package/dist/ui/panel-fleet.js +3 -3
- package/dist/ui/panel-hub.js +39 -25
- package/dist/ui/runtime-commands.d.ts +2 -2
- package/dist/ui/runtime-commands.js +7 -4
- package/dist/ui/settings-build-version.js +2 -2
- package/dist/ui/shared/access-overview.css +1 -1
- package/dist/ui/shared/accounts-keepalive.css +1 -1
- package/dist/ui/shared/accounts.css +1 -1
- package/dist/ui/shared/agent-sheet.js +2 -2
- package/dist/ui/shared/app-prefs.js +5 -2
- package/dist/ui/shared/app-shell.js +1 -1
- package/dist/ui/shared/app-swipe.js +3 -1
- package/dist/ui/shared/app.css +124 -40
- package/dist/ui/shared/app.js +1 -1
- package/dist/ui/shared/chat-thread.js +5 -1
- package/dist/ui/shared/chat-work-bar.css +5 -5
- package/dist/ui/shared/connector-prompt.d.ts +1 -0
- package/dist/ui/shared/connector-prompt.js +10 -0
- package/dist/ui/shared/hub-ai-apps.css +12 -0
- package/dist/ui/shared/hub-chat.css +9 -2
- package/dist/ui/shared/hub-groups.css +1 -1
- package/dist/ui/shared/hub-owner.css +5 -5
- package/dist/ui/shared/hub-roles.css +98 -26
- package/dist/ui/shared/hub-rooms-u2.css +14 -0
- package/dist/ui/shared/hub.css +3 -3
- package/dist/ui/shared/instance-nav.js +24 -9
- package/dist/ui/shared/loading.css +1 -1
- package/dist/ui/shared/model-picker.css +2 -2
- package/dist/ui/shared/preview-panel-actions.js +1 -1
- package/dist/ui/shared/preview-panel.js +2 -2
- package/dist/ui/shared/signin.js +27 -12
- package/dist/ui/shared/task-board.css +2 -2
- package/dist/ui/shared/tokens.css +1 -1
- package/dist/ui/shared/ui-toast.js +4 -4
- package/dist/ui/shared/usage-dialog.js +43 -4
- package/dist/ui/signin.html +4 -2
- package/dist/ui/structured-signin.js +64 -12
- package/dist/ui/web-terminal/terminal.css +1 -1
- package/dist/web-backend-login.d.ts +5 -1
- package/dist/web-backend-login.js +8 -2
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-prefs.js +2 -0
- package/dist/web-prefs.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +3 -0
- package/dist/windows-cli-worker.js +33 -4
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +1 -0
- package/dist/windows-cli.js +8 -4
- package/dist/windows-cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/runtime-install/install.ps1 +24 -4
|
@@ -3,9 +3,10 @@ import { randomUUID } from "node:crypto";
|
|
|
3
3
|
import { lstatSync, realpathSync, readFileSync, writeFileSync, mkdtempSync, mkdirSync, rmSync } from "node:fs";
|
|
4
4
|
import { homedir, tmpdir } from "node:os";
|
|
5
5
|
import { join, win32 } from "node:path";
|
|
6
|
-
import { PERSONAL_AGENT_DEADLINE_MS, personalAgentFolder, personalAgentProfile } from "./runtime-personal-profile.js";
|
|
6
|
+
import { PERSONAL_AGENT_DEADLINE_MS, PERSONAL_AGENT_READ_CHECK_FILE, PERSONAL_AGENT_READ_CHECK_TEXT, personalAgentFolder, personalAgentProfile } from "./runtime-personal-profile.js";
|
|
7
7
|
import { isPersonalAgentCli } from "./runtime-personal-answer.js";
|
|
8
8
|
import { protectRuntimeProfileDirectorySync } from "./runtime-pane-private.js";
|
|
9
|
+
import { ANSWER_ONLY_CATALOG_FILE } from "./runtime-personal-answer-only.js";
|
|
9
10
|
export class PersonalAgentStageError extends Error {
|
|
10
11
|
reason;
|
|
11
12
|
constructor(reason) {
|
|
@@ -100,12 +101,15 @@ function stage(input, host, withAuthentication) {
|
|
|
100
101
|
const skills = ["imagegen", "openai-docs", "review-agent", "skill-creator", "skill-installer"].map(name => win32.join(stage.home, "skills", ".system", name, "SKILL.md"));
|
|
101
102
|
const plan = personalAgentProfile({ ...input, canonicalFolder: folder, context, work: stage.work, home: stage.home, disabledSkills: skills });
|
|
102
103
|
for (const [name, content] of Object.entries(plan.files)) {
|
|
103
|
-
if (name !== "config.toml")
|
|
104
|
+
if (name !== "config.toml" && !(input.answerOnly && name === ANSWER_ONLY_CATALOG_FILE))
|
|
104
105
|
throw new PersonalAgentStageError("profile-unavailable");
|
|
105
106
|
host.writePrivate(win32.join(stage.home, name), content);
|
|
106
107
|
}
|
|
107
|
-
if (input.cli === "codex")
|
|
108
|
+
if (input.cli === "codex") {
|
|
109
|
+
if (!input.answerOnly)
|
|
110
|
+
host.writePrivate(win32.join(stage.work, PERSONAL_AGENT_READ_CHECK_FILE), PERSONAL_AGENT_READ_CHECK_TEXT);
|
|
108
111
|
plan.args.splice(1, 0, "--strict-config");
|
|
112
|
+
}
|
|
109
113
|
return { plan, cleanup: stage.cleanup };
|
|
110
114
|
}
|
|
111
115
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-personal-stage.js","sourceRoot":"","sources":["../src/runtime-personal-stage.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,oBAAoB,EAA4B,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime-personal-stage.js","sourceRoot":"","sources":["../src/runtime-personal-stage.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,oBAAoB,EAA4B,MAAM,+BAA+B,CAAC;AAChN,OAAO,EAAE,kBAAkB,EAAyB,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAE3E,MAAM,OAAO,uBAAwB,SAAQ,KAAK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qB,CAAC,CAAC;YAAC,CAAC;YACxJ,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACzE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC3D,SAAS,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YAAC,SAAS,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACnH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO;oBAC1B,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;oBAChC,IAAI,OAAO,CAAC,cAAc,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,KAAK,MAAM;wBAAE,MAAM,KAAK,CAAC,mDAAmD,CAAC,CAAC;oBACxN,MAAM,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpC,CAAC,EAAE,CAAC;QACN,CAAC,EAAE,CAAC;AACR,CAAC"}
|
|
@@ -180,7 +180,7 @@ export declare function parseRuntimeRemotePayload<K extends RuntimeRemoteOperati
|
|
|
180
180
|
export interface RuntimeRunPayload {
|
|
181
181
|
task: NativeTaskInput;
|
|
182
182
|
/** Opted-in local personal binding only; never widens the task's permissions. */
|
|
183
|
-
profile?: "personal-
|
|
183
|
+
profile?: import("./runtime-personal-protocol.js").PersonalProfile;
|
|
184
184
|
resumeSessionId?: string;
|
|
185
185
|
context?: string;
|
|
186
186
|
/** Tool names only; coordinator credentials never cross this transport. */
|
package/dist/setup-form.js
CHANGED
|
@@ -101,6 +101,16 @@ export const SETUP_FORM_HTML = `<!DOCTYPE html>
|
|
|
101
101
|
.sub { color: #6b7280; font-size: 13px; }
|
|
102
102
|
.step { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; margin-top: 16px; }
|
|
103
103
|
.step h2 { font-size: 14px; margin: 0 0 12px; }
|
|
104
|
+
.signin-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: signin-step; }
|
|
105
|
+
.signin-steps > li { display: flex; align-items: flex-start; gap: 10px; counter-increment: signin-step; }
|
|
106
|
+
.signin-steps > li::before { content: counter(signin-step); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #f3f4f6; color: #4b5563; font-size: 12px; font-weight: 600; }
|
|
107
|
+
.signin-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; } .signin-step-title { font-size: 14px; font-weight: 500; }
|
|
108
|
+
.signin-linkrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
109
|
+
a.signin-open { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; background: #2563eb; color: #fff; font-size: 14px; text-decoration: none; }
|
|
110
|
+
.signin-copy { display: inline-flex; align-items: center; gap: 6px; } .signin-url { font: 12px ui-monospace, Menlo, Consolas, monospace; color: #6b7280; overflow-wrap: anywhere; }
|
|
111
|
+
.signin-code-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; box-sizing: border-box; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px; }
|
|
112
|
+
.signin-code { font: 600 18px/1.3 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; user-select: all; }
|
|
113
|
+
.s-info { padding: 6px 12px; border-radius: 6px; background: #f3f4f6; color: #4b5563; font-size: 12px; }
|
|
104
114
|
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
|
|
105
115
|
input, select { width: 100%; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 14px; }
|
|
106
116
|
button { padding: 8px 14px; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; font-size: 14px; cursor: pointer; }
|
package/dist/setup-form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-form.js","sourceRoot":"","sources":["../src/setup-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE3F;;;;;;;;GAQG;AACH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqChC,gBAAgB,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG
|
|
1
|
+
{"version":3,"file":"setup-form.js","sourceRoot":"","sources":["../src/setup-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE3F;;;;;;;;GAQG;AACH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqChC,gBAAgB,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyF3B,gBAAgB,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+TvC,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAa;IACtD,OAAO;QACL,oBAAoB;QACpB,qBAAqB,KAAK,GAAG;QAC7B,oBAAoB,KAAK,GAAG;QAC5B,sBAAsB;QACtB,oBAAoB;QACpB,iBAAiB;QACjB,oBAAoB;QACpB,wBAAwB;KACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,kBAAkB,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC,CAAC;AACvH,CAAC"}
|
package/dist/tunnel/lease.d.ts
CHANGED
|
@@ -61,6 +61,12 @@ export interface ReapOptions {
|
|
|
61
61
|
/** Injected so the grace periods do not make tests slow. */
|
|
62
62
|
wait?: (ms: number) => Promise<void>;
|
|
63
63
|
graceMs?: number;
|
|
64
|
+
/**
|
|
65
|
+
* M-3247: a lease THIS process wrote (its pid, and its fingerprint when both are known) is held, not a leftover.
|
|
66
|
+
* Only for the fleet's startup sweep, which runs while this run's own tunnels may already be up (auto_open, /web).
|
|
67
|
+
* ManagedTunnel's own reap leaves it off: it reaps only when it holds no tunnel, so its own lease is then a leftover.
|
|
68
|
+
*/
|
|
69
|
+
spareThisProcess?: boolean;
|
|
64
70
|
}
|
|
65
71
|
/**
|
|
66
72
|
* Resolve whatever the last run left behind, before anything new is started.
|
|
@@ -73,3 +79,11 @@ export declare function reapStaleTunnel(dataDir: string, opts?: ReapOptions): Pr
|
|
|
73
79
|
export declare function manualCleanupMessage(outcome: Extract<ReapOutcome, {
|
|
74
80
|
kind: "manual";
|
|
75
81
|
}>): string;
|
|
82
|
+
export interface LeftoverSweepOptions extends ReapOptions {
|
|
83
|
+
log: (level: "info" | "warn", message: string, detail: Record<string, unknown>) => void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The fleet's startup sweep: resolve what a previous run, or a setup host that crashed, left behind in each lease directory.
|
|
87
|
+
* Never throws. A lease that cannot be resolved blocks the next tunnel and says so; it does not block the fleet.
|
|
88
|
+
*/
|
|
89
|
+
export declare function reapLeftoverTunnels(dirs: readonly string[], opts: LeftoverSweepOptions): Promise<void>;
|
package/dist/tunnel/lease.js
CHANGED
|
@@ -147,6 +147,14 @@ export async function reapStaleTunnel(dataDir, opts = {}) {
|
|
|
147
147
|
return { kind: "held", ownerPid: lease.ownerPid };
|
|
148
148
|
}
|
|
149
149
|
void now;
|
|
150
|
+
if (opts.spareThisProcess && lease.ownerPid === process.pid) {
|
|
151
|
+
// Same pid as ours: ours unless the fingerprint proves it was a previous run's (a reused pid). Unknown counts as ours —
|
|
152
|
+
// the one mistake a reaper must not make is killing a live tunnel; a real leftover is reaped by the next start.
|
|
153
|
+
const self = probe(process.pid);
|
|
154
|
+
const ours = self.kind === "identified" && lease.ownerIdentity ? self.identity === lease.ownerIdentity : true;
|
|
155
|
+
if (ours)
|
|
156
|
+
return { kind: "held", ownerPid: lease.ownerPid };
|
|
157
|
+
}
|
|
150
158
|
if (lease.providerPid === null) {
|
|
151
159
|
// Reserved but never recorded: either nothing was ever spawned, or the
|
|
152
160
|
// owner died in the instant between the spawn returning and the pid being
|
|
@@ -211,4 +219,19 @@ export function manualCleanupMessage(outcome) {
|
|
|
211
219
|
+ `No new tunnel will be opened until this is resolved. Check ${target}, kill it if it is still running, `
|
|
212
220
|
+ `then delete ${outcome.leasePath}.`;
|
|
213
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* The fleet's startup sweep: resolve what a previous run, or a setup host that crashed, left behind in each lease directory.
|
|
224
|
+
* Never throws. A lease that cannot be resolved blocks the next tunnel and says so; it does not block the fleet.
|
|
225
|
+
*/
|
|
226
|
+
export async function reapLeftoverTunnels(dirs, opts) {
|
|
227
|
+
const { log, ...reap } = opts;
|
|
228
|
+
await Promise.all(dirs.map(dir => reapStaleTunnel(dir, { ...reap, spareThisProcess: true })
|
|
229
|
+
.then(outcome => {
|
|
230
|
+
if (outcome.kind === "manual")
|
|
231
|
+
log("warn", manualCleanupMessage(outcome), { tunnel: outcome });
|
|
232
|
+
else if (outcome.kind === "reaped")
|
|
233
|
+
log("info", "Reaped a leftover tunnel", { how: outcome.how, tunnelPid: outcome.pid });
|
|
234
|
+
})
|
|
235
|
+
.catch(err => log("warn", "Tunnel reaper failed", { err }))));
|
|
236
|
+
}
|
|
214
237
|
//# sourceMappingURL=lease.js.map
|
package/dist/tunnel/lease.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lease.js","sourceRoot":"","sources":["../../src/tunnel/lease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAA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AO,CAAC,EAAE;QACd,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ;YAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;aAC1F,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ;YAAE,GAAG,CAAC,MAAM,EAAE,0BAA0B,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5H,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,sBAAsB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -12,7 +12,8 @@ import { closeDialog, shellStore, showDialog } from "/assets/app-shell.js";
|
|
|
12
12
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
13
13
|
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
14
14
|
import { toast } from "/assets/ui-toast.js";
|
|
15
|
-
import { mountStructuredSignIns } from "./structured-signin.js";
|
|
15
|
+
import { mountStructuredSignIns, shortUrl } from "./structured-signin.js";
|
|
16
|
+
import { Icon } from "/assets/ui-icons.js";
|
|
16
17
|
import { CliProductMark, cliLabel } from "./cli-picker.js";
|
|
17
18
|
import { identityText } from "./account-identity.js";
|
|
18
19
|
import { FIRST_RUN_BACKENDS, capsOf } from "./cli-caps.js";
|
|
@@ -129,8 +130,53 @@ register("signin", {
|
|
|
129
130
|
profile: "{0} · 設定檔 {1}",
|
|
130
131
|
},
|
|
131
132
|
});
|
|
133
|
+
// M-3238 (the user): the device step as numbered steps with a big link and a big code, and the end as one headline and one
|
|
134
|
+
// plain line on which agents were reloaded (it was the chat's status lines, with their `backticks` and "instance").
|
|
135
|
+
register("signin", {
|
|
136
|
+
en: {
|
|
137
|
+
stepOpen: "Open sign-in page", deviceStepTitle: "Finish on the provider's official website", stepCode: "Enter this code on that page", stepPaste: "If the page gives you a code, paste it into the authorization terminal.",
|
|
138
|
+
stepTerminal: "Open the authorization terminal", stepAccess: "Enter this access code there. It works once, for {0} minutes.",
|
|
139
|
+
stepBack: "Come back here when you're done. This page updates by itself.", copyLink: "Copy link",
|
|
140
|
+
doneReloading: "Reloading the agents that use this account…",
|
|
141
|
+
doneReloaded: "Reloaded to use it: {0}.",
|
|
142
|
+
doneReloadedCaption: "Reloaded to use this account:",
|
|
143
|
+
donePendingCaption: "Still reloading (they come back on their own):",
|
|
144
|
+
doneNone: "No agent uses it yet, so nothing needed reloading.",
|
|
145
|
+
donePending: "Still reloading: {0}. They come back on their own.",
|
|
146
|
+
doneFailed: "The agents that use it could not be reloaded automatically. If one does not answer, restart it from Fleet.",
|
|
147
|
+
doneCleanup: "The sign-in program on this computer could not be confirmed closed.",
|
|
148
|
+
},
|
|
149
|
+
"zh-TW": {
|
|
150
|
+
stepOpen: "開啟登入頁面", deviceStepTitle: "前往官方網站完成授權", stepCode: "在那個頁面輸入這組授權碼", stepPaste: "如果頁面給你一組授權碼,請貼到授權終端機。",
|
|
151
|
+
stepTerminal: "開啟授權終端機", stepAccess: "在那裡輸入這個存取碼。只能用一次,{0} 分鐘內有效。",
|
|
152
|
+
stepBack: "完成後回到這裡,這個畫面會自動更新。", copyLink: "複製連結",
|
|
153
|
+
doneReloading: "正在重新載入使用這個帳號的 Agent…",
|
|
154
|
+
doneReloaded: "已重新載入,改用這個帳號:{0}。",
|
|
155
|
+
doneReloadedCaption: "已重新載入並改用這個帳號的 Agent:",
|
|
156
|
+
donePendingCaption: "還在重新載入(會自己恢復):",
|
|
157
|
+
doneNone: "目前沒有 Agent 使用它,不需要重新載入。",
|
|
158
|
+
donePending: "還在重新載入:{0}。它們會自己恢復。",
|
|
159
|
+
doneFailed: "無法自動重新載入使用它的 Agent。如果有 Agent 沒有回應,請到 Fleet 重新啟動它。",
|
|
160
|
+
doneCleanup: "無法確認這台電腦上的登入程式已關閉。",
|
|
161
|
+
},
|
|
162
|
+
});
|
|
132
163
|
const tn = (k, ...v) => t(`signin.${k}`, ...v);
|
|
133
|
-
const shownOf = (backend, profile) => (profile ? tn("profile", backend, profile) : backend);
|
|
164
|
+
const shownOf = (backend, profile) => (profile ? tn("profile", cliLabel(backend), profile) : cliLabel(backend));
|
|
165
|
+
/** An agent by the name the person sees (its display name). */
|
|
166
|
+
const agentLabel = (n) => { const it = (appStore.get().instances || []).find((i) => i && i.name === n); return (it && typeof it.display_name === "string" && it.display_name.trim()) || n; };
|
|
167
|
+
/**
|
|
168
|
+
* M-3238 (the user; Argon's review): after a good sign-in — a check banner with the headline, then what bringing its agents
|
|
169
|
+
* back did: the agents reloaded (or still reloading) as tags in one box, or one quiet line (reloading…, none, could not).
|
|
170
|
+
*/
|
|
171
|
+
function SignedIn({ login }) {
|
|
172
|
+
const r = login.recovery, back = r ? [...(r.woken || []), ...(r.restarted || [])] : [], pending = r ? r.pending || [] : [];
|
|
173
|
+
const list = !r || r.failed ? null : pending.length ? ["donePendingCaption", pending] : back.length ? ["doneReloadedCaption", back] : null;
|
|
174
|
+
return html`<div class="signin-done-banner" role="status"><${Icon} name="check" size=${18} /><span class="signin-headline">${tn("signedIn", shownOf(login.backend, login.profile))}</span></div>
|
|
175
|
+
${list ? html`<div class="signin-recovery-box" data-recovery="known"><span class="note">${tn(list[0])}</span>
|
|
176
|
+
<div class="chips">${list[1].map((n) => html`<span key=${n} class="tag" title=${n}>${agentLabel(n)}</span>`)}</div></div>`
|
|
177
|
+
: html`<p class=${r && r.failed ? "s-info signin-after" : "note signin-after"} data-recovery=${r ? "known" : "pending"}>${!r ? tn("doneReloading") : r.failed ? tn("doneFailed") : tn("doneNone")}</p>`}
|
|
178
|
+
${login.cleanupFailed ? html`<p class="s-info signin-after">${tn("doneCleanup")}</p>` : null}`;
|
|
179
|
+
}
|
|
134
180
|
|
|
135
181
|
/** What this page knows: the current sign-in as this session may see it, and Settings' list. */
|
|
136
182
|
export const signInStore = createStore({ loaded: false, login: null, targets: [], structured: null });
|
|
@@ -208,25 +254,35 @@ const errorText = (code) => (code === "confirm_expired" ? tn("expired") : code =
|
|
|
208
254
|
export const signInOffered = () => !(typeof document !== "undefined" && document.body && document.body.dataset.publicLink === "1");
|
|
209
255
|
const loopbackHost = (h) => h === "localhost" || h === "::1" || h === "[::1]" || /^127\./.test(h);
|
|
210
256
|
|
|
211
|
-
function
|
|
257
|
+
function CopyButton({ value, label, small = false }) {
|
|
212
258
|
const [copied, setCopied] = useState(false);
|
|
213
|
-
const copy = async () => { try { await navigator.clipboard.writeText(value); setCopied(true); } catch { toast(value); } };
|
|
214
|
-
return html`<
|
|
215
|
-
<button type="button" class="btn btn-sm" onClick=${copy}>${copied ? tn("copied") : tn("copy")}</button></div>`;
|
|
259
|
+
const copy = async () => { try { await navigator.clipboard.writeText(value); setCopied(true); setTimeout(() => setCopied(false), 1500); } catch { toast(value); } };
|
|
260
|
+
return html`<button type="button" class=${`btn${small ? " btn-sm" : ""} signin-copy`} onClick=${copy}><${Icon} name="copy" size=${14} /><span>${copied ? tn("copied") : label}</span></button>`;
|
|
216
261
|
}
|
|
217
262
|
|
|
263
|
+
|
|
218
264
|
/** The starter's view of a running sign-in: the device link and code, or the terminal and its access code. */
|
|
219
265
|
function Running({ login }) {
|
|
220
266
|
const { hint, terminal, accessCode } = login;
|
|
221
267
|
const away = terminal && terminal.loopback && typeof location !== "undefined" && !loopbackHost(location.hostname);
|
|
268
|
+
// M-3238 (the user; Argon's review): the step circles; a short primary 「開啟登入頁面」 beside Copy link, the page's address
|
|
269
|
+
// a quiet note under them; the code with Copy in one box; "come back here" a quiet status line — as the account dialog's
|
|
270
|
+
// cards draw it. The terminal the same way.
|
|
271
|
+
let url = null;
|
|
272
|
+
if (hint) { try { url = new URL(hint.url); } catch { url = null; } }
|
|
273
|
+
const step = (title, body) => html`<li><div class="signin-step-body"><span class="signin-step-title">${title}</span>${body}</div></li>`;
|
|
274
|
+
const codeBox = (label, value) => html`<div class="signin-code-box"><code class="signin-code" aria-label=${`${label} ${value}`}>${value}</code><${CopyButton} value=${value} label=${tn("copy")} small=${true} /></div>`;
|
|
222
275
|
return html`<div class="signin-run">
|
|
223
|
-
${hint ? html`<
|
|
224
|
-
${hint.linkable ? html`<
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
276
|
+
${hint ? html`<ol class="signin-steps">
|
|
277
|
+
${step(tn("deviceStepTitle"), hint.linkable && url ? html`<div class="signin-linkrow"><a data-trust="navigation" class="btn btn-primary signin-open" href=${hint.url} target="_blank" rel="noopener noreferrer">${tn("stepOpen")}<${Icon} name="external" size=${14} /></a><${CopyButton} value=${hint.url} label=${tn("copyLink")} /></div>
|
|
278
|
+
<span class="note mono signin-url">${url ? shortUrl(url) : hint.url}</span>`
|
|
279
|
+
: html`<div class="signin-code-box"><code class="signin-value">${hint.url}</code><${CopyButton} value=${hint.url} label=${tn("copyLink")} small=${true} /></div>`)}
|
|
280
|
+
${hint.code ? step(tn("stepCode"), codeBox(tn("code"), hint.code)) : step(tn("stepPaste"), null)}</ol>
|
|
281
|
+
${terminal ? null : html`<p class="s-info signin-back" role="status">${tn("stepBack")}</p>`}` : null}
|
|
282
|
+
${terminal ? html`<ol class="signin-steps">
|
|
283
|
+
${step(tn("stepTerminal"), html`<div class="signin-linkrow"><a data-trust="navigation" class="btn btn-primary signin-open" href=${terminal.url} target="_blank" rel="noopener noreferrer">${tn("openTerminal")}<${Icon} name="external" size=${14} /></a></div>`)}
|
|
284
|
+
${accessCode ? step(tn("stepAccess", terminal.ttlMinutes), codeBox(tn("accessCode"), accessCode)) : null}</ol>
|
|
285
|
+
<p class="s-info signin-back" role="status">${tn("stepBack")}</p>
|
|
230
286
|
${terminal.public ? html`<p class="signin-note">${tn("publicLink")}</p>` : null}
|
|
231
287
|
${away ? html`<p class="signin-note">${tn("loopback")}</p>` : null}` : null}
|
|
232
288
|
${!hint && !terminal ? html`<p class="signin-note">${tn("waitingHint")}</p>` : null}
|
|
@@ -243,7 +299,8 @@ function Running({ login }) {
|
|
|
243
299
|
* Shared pieces only: Dialog, `.btn`, `.note`, the in-app confirmation (ui-confirm.js).
|
|
244
300
|
*/
|
|
245
301
|
export function BrowserSignInDialog({ backend, profile, backends, onClose }) {
|
|
246
|
-
const root = useRef(null), close = onClose || closeDialog;
|
|
302
|
+
const root = useRef(null), close = onClose || closeDialog, cardsRef = useRef(null);
|
|
303
|
+
const [running, setRunning] = useState(false); // M-3238: a sign-in of this account runs: its Cancel is in the footer
|
|
247
304
|
// The id of the run THIS dialog started (a named account's): closing the dialog ends exactly that run — never one another session or another tab started.
|
|
248
305
|
const run = useRef(null);
|
|
249
306
|
const endpoint = profile ? profileSignInEndpoint(backend, profile) : "/ui/browser-backend-signins";
|
|
@@ -252,16 +309,18 @@ export function BrowserSignInDialog({ backend, profile, backends, onClose }) {
|
|
|
252
309
|
let cards, last = "";
|
|
253
310
|
// Ridge #3321 S01: "Sign in again" asks in the dashboard's own confirmation (its title names the CLI), not the browser's.
|
|
254
311
|
const ask = (message, cli) => confirmDialog({ title: t("signin.reloginTitle", cli), message, confirmLabel: t("signin.reloginGo") });
|
|
255
|
-
cards = mountStructuredSignIns(root.current, { endpoint, lang, ask, dashboard: true, codeHint: b => !!capsOf(b)?.codeHint, ...(single ? { dialog: true, focus: backend } : {}), started: id => { run.current = id; },
|
|
312
|
+
cards = mountStructuredSignIns(root.current, { endpoint, lang, ask, dashboard: true, codeHint: b => !!capsOf(b)?.codeHint, ...(single ? { dialog: true, focus: backend, footerCancel: true } : {}), started: id => { run.current = id; },
|
|
256
313
|
// The dialog was closed while its start was still in flight and the server made the run after all: nobody sees it, so it is ended here — by its id, so no other run is touched.
|
|
257
314
|
abandoned: id => { if (profile || single) void post(endpoint, { operation: "cancel", id }).then(() => refreshSignIn()); }, changed: next => {
|
|
258
315
|
if (!profile) {
|
|
259
316
|
if (backends) { if (backends.some(b => !next.selected.includes(b))) void cards.addBackends(backends); }
|
|
260
317
|
else if (!next.selected.includes(backend)) void cards.addBackend(backend);
|
|
261
318
|
}
|
|
319
|
+
if (single) { const l = next.login && next.login.backend === backend ? next.login : null; setRunning(!!l && l.phase !== "done" && !(l.phase === "failed" && l.reason)); }
|
|
262
320
|
const signature = JSON.stringify([next.login, next.pending]);
|
|
263
321
|
if (signature !== last) { last = signature; void refreshSignIn(); }
|
|
264
322
|
} });
|
|
323
|
+
cardsRef.current = cards;
|
|
265
324
|
const unlisten = onLang(() => cards.relabel());
|
|
266
325
|
return () => {
|
|
267
326
|
unlisten(); cards.dispose();
|
|
@@ -283,11 +342,12 @@ export function BrowserSignInDialog({ backend, profile, backends, onClose }) {
|
|
|
283
342
|
showDialog(SignInDialog, { backend: chosen, ...(profile && chosen === backend ? { profile } : {}) });
|
|
284
343
|
};
|
|
285
344
|
const actions = html`<div class="signin-browser-actions">
|
|
345
|
+
${single && running ? html`<button type="button" class="btn danger" onClick=${() => cardsRef.current && cardsRef.current.cancel()}>${tn("cancelSignIn")}</button><span class="dlg-spacer"></span>` : null}
|
|
286
346
|
${backends ? backends.filter(b => capsOf(b)?.chatSignIn).map(b => html`<button type="button" class="btn" onClick=${() => fallback(b)}>${b} · ${tn("consoleFallback")}</button>`) : null}
|
|
287
347
|
<button type="button" class="btn" onClick=${close}>${tn("close")}</button></div>`;
|
|
288
348
|
const account = backend ? `${cliLabel(backend)} · ${profile || tn("defaultAccount")}` : "";
|
|
289
349
|
return html`<${Dialog} title=${backends ? tn("listTitle") : tn("title", account)} onClose=${close} actions=${actions}>
|
|
290
|
-
<div class
|
|
350
|
+
<div class=${`signin-browser${single ? " is-single" : ""}`} ref=${root}></div>
|
|
291
351
|
${single && capsOf(backend)?.chatSignIn ? html`<p class="note"><button type="button" class="btn btn-sm btn-ghost" onClick=${() => fallback(backend)}>${tn("consoleFallback")}</button></p>` : null}
|
|
292
352
|
${single && capsOf(backend)?.chatSignIn ? html`<p class="note" data-signin-console-note>${tn("consoleFallbackNote")}</p>` : null}
|
|
293
353
|
</${Dialog}>`;
|
|
@@ -386,11 +446,17 @@ export function SignInDialog({ backend, profile, resume = false, onClose }) {
|
|
|
386
446
|
${login.phase === "running" ? html`<button type="button" class="btn btn-danger" disabled=${busy} onClick=${cancelRun}>${tn("cancelSignIn")}</button>` : null}`;
|
|
387
447
|
} else {
|
|
388
448
|
const lines = Array.isArray(login.lines) ? login.lines : [];
|
|
449
|
+
// M-3238: a good sign-in is one headline and one plain line on its agents (`recovery`); the chat's status lines are shown
|
|
450
|
+
// only for one that did not succeed (they say why), or from an older server that sends no `recovery`.
|
|
451
|
+
const structuredEnd = login.ok && Object.hasOwn(login, "recovery");
|
|
389
452
|
body = html`${login.phase === "running" ? html`<${Running} login=${login} />`
|
|
453
|
+
: structuredEnd ? html`<${SignedIn} login=${login} />`
|
|
390
454
|
: html`<p role="status" class=${login.ok ? "signin-ok" : "signin-message"}>${login.ok ? tn("signedIn", shownOf(login.backend, login.profile)) : tn("ended")}</p>`}
|
|
391
|
-
${lines.length ? html`<ul class="signin-lines">${lines.map((l, i) => html`<li key=${i}>${l}</li>`)}</ul>` : null}`;
|
|
392
|
-
|
|
393
|
-
|
|
455
|
+
${lines.length && !structuredEnd ? html`<ul class="signin-lines">${lines.map((l, i) => html`<li key=${i}>${l}</li>`)}</ul>` : null}`;
|
|
456
|
+
// M-3238 (Argon): Cancel connecting a quiet danger button on the footer's left, Close on its right; at the end, Close alone.
|
|
457
|
+
actions = login.phase === "running"
|
|
458
|
+
? html`<button type="button" class="btn danger" disabled=${busy} onClick=${cancelRun}>${tn("cancelSignIn")}</button><span class="dlg-spacer"></span><button type="button" class="btn" onClick=${close}>${tn("close")}</button>`
|
|
459
|
+
: html`<button type="button" class=${structuredEnd ? "btn btn-primary" : "btn"} onClick=${close}>${tn("close")}</button>`;
|
|
394
460
|
}
|
|
395
461
|
return html`<${Dialog} title=${tn("title", shown)} onClose=${close} busy=${busy} actions=${actions}>${body}</${Dialog}>`;
|
|
396
462
|
}
|
|
@@ -400,7 +466,7 @@ export function SignInLine() {
|
|
|
400
466
|
const { login, structured } = useStore(signInStore);
|
|
401
467
|
const active = structured?.login;
|
|
402
468
|
if ((!login || login.phase !== "running") && active && active.phase !== "done" && !(active.phase === "failed" && active.reason)) {
|
|
403
|
-
return html`<div data-trust="status" class="conn op-line signin-line" role="status"><span>${tn("browserRunning", active.backend)}</span>
|
|
469
|
+
return html`<div data-trust="status" class="conn op-line signin-line" role="status"><span>${tn("browserRunning", cliLabel(active.backend))}</span>
|
|
404
470
|
<button type="button" class="btn btn-sm" onClick=${() => openSignIn({ backend: active.backend })}>${tn("open")}</button></div>`;
|
|
405
471
|
}
|
|
406
472
|
if (!login || login.phase !== "running") return null;
|
|
@@ -27,7 +27,11 @@
|
|
|
27
27
|
// step has no group at all. Text after the last reply with substance stays in that reply's group (the same block as the
|
|
28
28
|
// turn's other steps), and only until its reply row arrives is it ever the live group.
|
|
29
29
|
// A page labels `text`, `time`, `turn` and `none` as inferred. A reply call seen a moment before its row arrives is
|
|
30
|
-
// `live`
|
|
30
|
+
// `live` so the group does not jump when the row comes.
|
|
31
|
+
// Where the live group sits (#3756): before the first agent row newer than its start (`from`) that no group claims — the
|
|
32
|
+
// reply row of this very turn can arrive (SSE) before the steps read that names it, and the block must not be drawn
|
|
33
|
+
// under it for one read and then jump above it. At the end when there is none, when a person's message newer than the
|
|
34
|
+
// start comes first (it may start another turn: the work is never hung on a later reply), and for rows with no time.
|
|
31
35
|
//
|
|
32
36
|
// Keys: `act:<turn>:<n>` (n: the segment's number in its turn) — the same key while a segment is live and after its
|
|
33
37
|
// reply arrives, so the page keeps the node (no remount, no scroll jump). A turn the transcript gave no id for is named
|
|
@@ -73,8 +77,12 @@ function turnsOf(steps) {
|
|
|
73
77
|
* @returns { groups: Group[], live: Group|null }
|
|
74
78
|
* Group = { key, turn, n, level, rowKey: string|null, items: Step[], trailing: Step[], ts: number, from, to (ms: when the
|
|
75
79
|
* work for the reply began — the turn's start, or the previous reply's call — and when it ended; `to` 0 while live), partial?: true,
|
|
76
|
-
* ended: the segment is complete (false: live), turnEnded: the turn is over — only then are `trailing` steps "never sent"
|
|
77
|
-
*
|
|
80
|
+
* ended: the segment is complete (false: live), turnEnded: the turn is over — only then are `trailing` steps "never sent",
|
|
81
|
+
* promptKey?: the live group's own prompt row (the key of its turn's user row, when the ledger has it), waitsFor?: the
|
|
82
|
+
* live group's reply call's id, when its result named one (its row is the only one it may go before); atEnd?: true —
|
|
83
|
+
* a live group composeRows always puts last (chat-activity.js' status-only "Working…" line) }
|
|
84
|
+
* `groups` are in thread order; `rowKey` is the row a group sits above (null: between rows by `ts`; the live group by
|
|
85
|
+
* composeRows' rule).
|
|
78
86
|
*/
|
|
79
87
|
export function groupSteps(rows, steps, opts = {}) {
|
|
80
88
|
const now = opts.now ?? Date.now();
|
|
@@ -85,6 +93,7 @@ export function groupSteps(rows, steps, opts = {}) {
|
|
|
85
93
|
const turns = turnsOf(steps);
|
|
86
94
|
const groups = [];
|
|
87
95
|
let live = null;
|
|
96
|
+
let livePrompt = null; // the newest turn's own prompt row (only it has a live group): composeRows, #3756
|
|
88
97
|
// Prism #3709 R4: the rows some reply call names by its explicit id. A call that names none yet (its result not seen) may
|
|
89
98
|
// still be matched by its words or its time — but never onto a row another call has proved to be its own.
|
|
90
99
|
const named = new Set();
|
|
@@ -127,6 +136,7 @@ export function groupSteps(rows, steps, opts = {}) {
|
|
|
127
136
|
const userRow = first && first.anchor && first.anchor.messageId
|
|
128
137
|
? users.find((r) => r.x.anchor === first.anchor.messageId) || null : null;
|
|
129
138
|
const tkey = turn.turn || `~${(first || turn.steps[0]).id}`;
|
|
139
|
+
if (lastTurn && userRow) livePrompt = rowKeyOf(userRow.x);
|
|
130
140
|
// Which agent rows can belong to this turn's replies by time: between its user row and the next user row; with no
|
|
131
141
|
// user row to go by, between the turn's first step and the next turn's first (rows keep their own clock).
|
|
132
142
|
const next = userRow ? users.find((r) => r.i > userRow.i) : null;
|
|
@@ -164,7 +174,7 @@ export function groupSteps(rows, steps, opts = {}) {
|
|
|
164
174
|
const awaiting = lastTurn && (sg.reply.status === "running" || (sg.reply.ts && now - sg.reply.ts < AWAIT_ROW_MS));
|
|
165
175
|
if (!awaiting) { groups.push({ ...base, level: "none", rowKey: null }); return; }
|
|
166
176
|
if (live) groups.push({ ...live, level: "none", ended: true });
|
|
167
|
-
live = { ...base, level: "live", rowKey: null, ended: false };
|
|
177
|
+
live = { ...base, level: "live", rowKey: null, ended: false, ...(sg.reply.anchor && sg.reply.anchor.messageId ? { waitsFor: sg.reply.anchor.messageId } : {}) };
|
|
168
178
|
});
|
|
169
179
|
if (!tail.length) {
|
|
170
180
|
// nothing shown yet, but the agent is working on this turn (the page says so: `busy`). Some CLIs write a
|
|
@@ -196,13 +206,15 @@ export function groupSteps(rows, steps, opts = {}) {
|
|
|
196
206
|
if (lastPlaced) { lastPlaced.trailing = tail; lastPlaced.to = tail[tail.length - 1].ts || lastPlaced.to; return; }
|
|
197
207
|
groups.push({ key: `act:${tkey}:${n}`, turn: turn.turn, n, level: "none", rowKey: null, items: tail, trailing: [], ts: tail[0].ts || 0, from, to: tail[tail.length - 1].ts || 0, ended: true, turnEnded: ended, ...(partial && !segs.length ? { partial: true } : {}) });
|
|
198
208
|
});
|
|
209
|
+
if (live && livePrompt) live.promptKey = livePrompt;
|
|
199
210
|
if (live && opts.busy) { live.busy = true; if (opts.phase) live.phase = opts.phase; } // the page knows the agent is working: this live group is shown even when it holds nothing to show yet; grok's phase (reasoning, a tool…) is what the live line says
|
|
200
211
|
return { groups, live };
|
|
201
212
|
}
|
|
202
213
|
|
|
203
214
|
/**
|
|
204
215
|
* The ledger rows with each group as a synthetic `{ role: "activity" }` row before the reply it belongs to; a group
|
|
205
|
-
* with no row (`none`, by its time) between the rows; the live group
|
|
216
|
+
* with no row (`none`, by its time) between the rows; the live group before the reply row it is waiting for (see the
|
|
217
|
+
* top: `liveRowIndex`), else last. The rows themselves are never changed.
|
|
206
218
|
*/
|
|
207
219
|
export function composeRows(rows, { groups, live }) {
|
|
208
220
|
const before = new Map();
|
|
@@ -213,13 +225,34 @@ export function composeRows(rows, { groups, live }) {
|
|
|
213
225
|
const act = (g) => ({ role: "activity", boot: "act", id: g.key, group: g, ts: g.ts ? new Date(g.ts).toISOString() : "" });
|
|
214
226
|
const out = [];
|
|
215
227
|
const looseLeft = loose.slice().sort((a, b) => a.ts - b.ts);
|
|
216
|
-
|
|
228
|
+
const liveAt = live ? liveRowIndex(rows, live, before) : -1;
|
|
229
|
+
rows.forEach((x, i) => {
|
|
217
230
|
const t = rowTs(x);
|
|
218
231
|
while (looseLeft.length && t && looseLeft[0].ts && looseLeft[0].ts < t) out.push(act(looseLeft.shift()));
|
|
219
232
|
for (const g of before.get(rowKeyOf(x)) || []) out.push(act(g));
|
|
233
|
+
if (i === liveAt) out.push(act(live));
|
|
220
234
|
out.push(x);
|
|
221
|
-
}
|
|
235
|
+
});
|
|
222
236
|
for (const g of looseLeft) out.push(act(g));
|
|
223
|
-
if (live) out.push(act(live));
|
|
237
|
+
if (live && liveAt < 0) out.push(act(live));
|
|
224
238
|
return out;
|
|
225
239
|
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* #3756: the row the live group goes before — the first agent row newer than the group's start that no group claims
|
|
243
|
+
* (a reply of this turn whose row came before the steps read that names it). -1 (the end): a person's message newer
|
|
244
|
+
* than the start comes first (other than the turn's own prompt), there is no such row, or the group has no start.
|
|
245
|
+
* Rows with no time are passed over. A reply call whose result named its row's id waits for that row only (R4: never a
|
|
246
|
+
* guess); while it is missing, the end. A group marked `atEnd` (the status-only "Working…" line) is always last.
|
|
247
|
+
*/
|
|
248
|
+
function liveRowIndex(rows, live, claimed) {
|
|
249
|
+
const from = live.from || live.ts || 0;
|
|
250
|
+
if (!from || live.atEnd) return -1;
|
|
251
|
+
for (let i = 0; i < rows.length; i++) {
|
|
252
|
+
const x = rows[i], t = rowTs(x);
|
|
253
|
+
if (t <= from) continue; // older, or no time (0)
|
|
254
|
+
if (x.role === "user" && rowKeyOf(x) !== live.promptKey) return -1;
|
|
255
|
+
if (x.role === "agent" && !claimed.has(rowKeyOf(x)) && (!live.waitsFor || x.anchor === live.waitsFor)) return i;
|
|
256
|
+
}
|
|
257
|
+
return -1;
|
|
258
|
+
}
|
package/dist/ui/chat-activity.js
CHANGED
|
@@ -245,7 +245,9 @@ export function composeActivity(name, rows, now = Date.now(), opts = {}) {
|
|
|
245
245
|
function statusRows(rows, since, statusOnly, phase) {
|
|
246
246
|
let from = Number.isFinite(since) ? since : 0;
|
|
247
247
|
if (!from) { for (let i = rows.length - 1; i >= 0; i--) if (rows[i].role === "user") { const t = Date.parse(rows[i].ts); if (Number.isFinite(t)) from = t; break; } }
|
|
248
|
-
|
|
248
|
+
// atEnd: the "Working…" line stays under the newest row (#3756 moves a turn's live group above a reply that came
|
|
249
|
+
// before its steps; this line never becomes a reply's block, and the agent may still be working after a reply)
|
|
250
|
+
const live = { key: "act:status", turn: "status", n: 0, level: "live", rowKey: null, items: [], trailing: [], ts: from, from, to: 0, ended: false, turnEnded: false, busy: true, atEnd: true, ...(statusOnly ? { statusOnly: true } : {}), ...(phase ? { phase } : {}) };
|
|
249
251
|
return composeRows(rows, { groups: [], live });
|
|
250
252
|
}
|
|
251
253
|
|
package/dist/ui/chat-tour.js
CHANGED
|
@@ -15,7 +15,7 @@ const TOUR_KEY = "agend_tour_done";
|
|
|
15
15
|
const byId = (id) => document.getElementById(id) || document.querySelector(`.ws-focused [id$="-${id}"]`);
|
|
16
16
|
// On a phone the instance list is in the closed drawer: the tour outlines what opens it (☰), and for "needs you" the
|
|
17
17
|
// bottom tab's badge (#1408 step 5: retargeted to the app's shell).
|
|
18
|
-
const narrow = () => typeof matchMedia === "function" && matchMedia("(max-width: 899px)").matches;
|
|
18
|
+
const narrow = () => typeof matchMedia === "function" && matchMedia("(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)").matches;
|
|
19
19
|
const STEPS = [
|
|
20
20
|
{ text: "chat.tour1", spot: () => (narrow() ? byId("sbOpen") : byId("instanceList")) },
|
|
21
21
|
{ text: "chat.tour2", spot: () => byId("main") },
|
package/dist/ui/fleet-canvas.js
CHANGED
|
@@ -29,7 +29,7 @@ import { Icon } from "/assets/ui-icons.js";
|
|
|
29
29
|
import { avatarOf, firstCharacter, namesOf } from "/assets/instance-nav.js";
|
|
30
30
|
import { identityClasses, identityOf, paintIdentity, useIdentityColors } from "/assets/identity-color.js";
|
|
31
31
|
import { buildOrgView, nodeText, OrgChart, OrgSummary } from "./fleet-org.js";
|
|
32
|
-
import { Office } from "./fleet-office.js";
|
|
32
|
+
import { Office, useOfficePhone } from "./fleet-office.js";
|
|
33
33
|
import { OC, REST_KEY, SUM_LINE, canvasLayout, hits, needle, openingRegion, summaryRows } from "./fleet-canvas-layout.js";
|
|
34
34
|
import { createTrafficStore, FAR_K, HEAD, POLL_MS, sendingBy, trafficEdges } from "./fleet-traffic.js";
|
|
35
35
|
import { routeScene } from "./fleet-route-scene.js";
|
|
@@ -74,7 +74,7 @@ const MODE_KEY = "agend_org_mode", FOLD_KEY = "agend_org_folded", LIVE_KEY = "ag
|
|
|
74
74
|
const MODES = ["canvas", "list", "office"];
|
|
75
75
|
/** The org page's view: this device's choice, else the canvas — on a phone the list (M-3166, Argon 5: a phone opens on it). */
|
|
76
76
|
function readMode() {
|
|
77
|
-
const phone = typeof matchMedia === "function" && matchMedia("(max-width: 899px)").matches, fallback = phone ? "list" : "canvas";
|
|
77
|
+
const phone = typeof matchMedia === "function" && matchMedia("(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)").matches, fallback = phone ? "list" : "canvas";
|
|
78
78
|
try { const m = localStorage.getItem(MODE_KEY); return MODES.includes(m) ? m : fallback; } catch { return fallback; }
|
|
79
79
|
}
|
|
80
80
|
function readLive() { try { return localStorage.getItem(LIVE_KEY) !== "0"; } catch { return true; } }
|
|
@@ -458,6 +458,8 @@ export function OrgCanvas({ org, app, lease }) {
|
|
|
458
458
|
useIdentityColors();
|
|
459
459
|
const [mode, setMode] = useState(readMode);
|
|
460
460
|
const [live, setLive] = useState(readLive);
|
|
461
|
+
// M-3253: on a phone the Office's tools (and Live) are one ⋯ sheet at the end of this bar: one row, Find keeps its width.
|
|
462
|
+
const phone = useOfficePhone(), [officeMore, setOfficeMore] = useState(false), officeSheet = phone && mode === "office";
|
|
461
463
|
const traffic = useTraffic(lease, live);
|
|
462
464
|
const sending = useMemo(() => sendingBy(traffic), [traffic]);
|
|
463
465
|
const [folded, setFolded] = useState(readFolded);
|
|
@@ -499,14 +501,17 @@ export function OrgCanvas({ org, app, lease }) {
|
|
|
499
501
|
<input type="search" value=${query} placeholder=${tc("findShort")} autocomplete="off" onInput=${(e) => setQuery(e.target.value)} onKeyDown=${onFind} />
|
|
500
502
|
${q ? html`<span class="oc-found" role="status">${found ? (found === 1 ? tc("foundOne") : tc("found", found)) : tc("noMatch")}</span>` : null}</label>` : null}
|
|
501
503
|
${mode === "canvas" && live ? html`<${KeyToggle} open=${keyOpen} onToggle=${toggleKey} />` : null}
|
|
502
|
-
|
|
503
|
-
onClick=${() => setLive((v) => !v)}><span class="oc-live-dot" aria-hidden="true"></span>${tc("live")}</button
|
|
504
|
+
${officeSheet ? null : html`<button type="button" class=${`btn btn-sm oc-live${live ? " on" : ""}`} aria-pressed=${live ? "true" : "false"} title=${live ? tc("liveOn") : tc("liveOff")}
|
|
505
|
+
onClick=${() => setLive((v) => !v)}><span class="oc-live-dot" aria-hidden="true"></span>${tc("live")}</button>`}
|
|
504
506
|
<div class="seg-inline" role="group" aria-label=${tc("view")}>${modeBtn("canvas")}${modeBtn("list")}${modeBtn("office")}</div>
|
|
507
|
+
${officeSheet ? html`<button type="button" class="icon-btn oo-more-btn" aria-haspopup="dialog" aria-expanded=${officeMore ? "true" : "false"}
|
|
508
|
+
aria-label=${t("app.more")} title=${t("app.more")} onClick=${() => setOfficeMore(true)}><${Icon} name="more" /></button>` : null}
|
|
505
509
|
</div>
|
|
506
510
|
</div>
|
|
507
511
|
${mode === "canvas" && live && keyOpen ? html`<${Legend} />` : null}
|
|
508
512
|
${mode === "list" ? html`<${OrgChart} org=${org} app=${app} bare=${true} sending=${sending} />`
|
|
509
|
-
: mode === "office" ? html`<${Office} view=${view} traffic=${live ? traffic : null} q=${q} lease=${lease} onOpen=${openChat}
|
|
513
|
+
: mode === "office" ? html`<${Office} view=${view} traffic=${live ? traffic : null} q=${q} lease=${lease} onOpen=${openChat}
|
|
514
|
+
more=${officeSheet && officeMore} onMore=${officeSheet ? setOfficeMore : null} live=${live} onLive=${setLive} />`
|
|
510
515
|
: html`<${Canvas} view=${view} folded=${folded} onFold=${onFold} q=${q} jump=${jump} traffic=${live ? traffic : null} />`}
|
|
511
516
|
</div>`;
|
|
512
517
|
}
|