paseo-office 0.0.0-stage → 0.2.1
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/LICENSE +32 -0
- package/OVERVIEW.md +27 -0
- package/README.md +75 -2
- package/client/action-button.tsx +127 -0
- package/client/activity-feed-text.ts +84 -0
- package/client/activity-feed.ts +339 -0
- package/client/activity-panel.tsx +308 -0
- package/client/agent-appearance.tsx +257 -0
- package/client/agent-card.tsx +231 -0
- package/client/agent-picker-text.ts +116 -0
- package/client/agent-picker.tsx +157 -0
- package/client/app-locale.ts +14 -0
- package/client/ask-text.ts +75 -0
- package/client/attention-strip.tsx +194 -0
- package/client/beside.ts +42 -0
- package/client/board-sheet.tsx +451 -0
- package/client/board-text.ts +105 -0
- package/client/brand.ts +30 -0
- package/client/chat-acts.ts +24 -0
- package/client/chat-chrome.tsx +318 -0
- package/client/chat-compose-tools.tsx +314 -0
- package/client/chat-dictation.tsx +133 -0
- package/client/chat-more.tsx +119 -0
- package/client/chat-panel.tsx +1087 -0
- package/client/chat-quick.tsx +198 -0
- package/client/chat-seen.ts +63 -0
- package/client/chat-text.ts +249 -0
- package/client/choice-pills.tsx +75 -0
- package/client/column-model.ts +68 -0
- package/client/column-sheet.tsx +227 -0
- package/client/context-text.ts +130 -0
- package/client/conversation-model.ts +163 -0
- package/client/duty-sheet.tsx +321 -0
- package/client/duty-text.ts +20 -0
- package/client/floor-plan-row.tsx +84 -0
- package/client/focus-request.ts +6 -0
- package/client/follow-end.ts +28 -0
- package/client/fullscreen-header.tsx +138 -0
- package/client/fullscreen-theme.ts +38 -0
- package/client/host-details.tsx +269 -0
- package/client/host-styles.ts +129 -0
- package/client/host-switches.tsx +481 -0
- package/client/incidents-card.tsx +126 -0
- package/client/incidents-text.ts +81 -0
- package/client/janitor-card.tsx +165 -0
- package/client/labeled-switch.tsx +49 -0
- package/client/language-switch.tsx +57 -0
- package/client/library-card.tsx +328 -0
- package/client/library-text.ts +166 -0
- package/client/list-text.ts +179 -0
- package/client/lobby-board.tsx +375 -0
- package/client/luminance.ts +38 -0
- package/client/machine-card.tsx +360 -0
- package/client/messenger-styles.ts +216 -0
- package/client/new-agent-form.tsx +353 -0
- package/client/new-agent-model.ts +167 -0
- package/client/notes-card.tsx +348 -0
- package/client/notes-days.tsx +94 -0
- package/client/notes-text.ts +153 -0
- package/client/office-brand-context.ts +44 -0
- package/client/office-column.tsx +449 -0
- package/client/office-keyboard.ts +79 -0
- package/client/office-link.ts +53 -0
- package/client/office-mark.tsx +29 -0
- package/client/office-modal.tsx +440 -0
- package/client/office-settings.tsx +113 -0
- package/client/office-state.ts +88 -0
- package/client/office-surface.tsx +2296 -0
- package/client/permission-actions.tsx +123 -0
- package/client/pixel/actors.ts +295 -0
- package/client/pixel/art.ts +792 -0
- package/client/pixel/floor-plan.ts +282 -0
- package/client/pixel/pixel-office.tsx +1286 -0
- package/client/pixel/room.ts +62 -0
- package/client/pixel/sprite-view.tsx +71 -0
- package/client/pixel/sprite.ts +75 -0
- package/client/pixel/ticker.ts +40 -0
- package/client/prompt-coach.tsx +152 -0
- package/client/qa-card.tsx +211 -0
- package/client/qa-text.ts +189 -0
- package/client/review-card.tsx +188 -0
- package/client/review-text.ts +207 -0
- package/client/room-board.tsx +89 -0
- package/client/scene-picker.tsx +158 -0
- package/client/scene-previews.ts +10 -0
- package/client/segment-pill.tsx +58 -0
- package/client/session-pane.tsx +136 -0
- package/client/session-panel-detail.tsx +238 -0
- package/client/session-panel.tsx +462 -0
- package/client/session-styles.ts +363 -0
- package/client/session-text.ts +38 -0
- package/client/session-transcript.tsx +243 -0
- package/client/sessions-panel.tsx +448 -0
- package/client/sessions-text.ts +158 -0
- package/client/setting-field.tsx +71 -0
- package/client/settings-sections.tsx +126 -0
- package/client/settings-text.ts +25 -0
- package/client/sidebar-launcher.ts +29 -0
- package/client/ssh-hosts.tsx +331 -0
- package/client/ssh-metrics.ts +76 -0
- package/client/standup-card.tsx +242 -0
- package/client/structure-view.tsx +442 -0
- package/client/styles.ts +1427 -0
- package/client/tab-reveal.ts +54 -0
- package/client/team-chat-preview.tsx +96 -0
- package/client/transcript-styles.ts +90 -0
- package/client/use-agent-actions.ts +35 -0
- package/client/use-board-actions.ts +57 -0
- package/client/use-column.ts +95 -0
- package/client/use-conversation.ts +246 -0
- package/client/use-device-switch.ts +88 -0
- package/client/use-duty-actions.ts +43 -0
- package/client/use-group-photo.ts +48 -0
- package/client/use-incidents.ts +17 -0
- package/client/use-janitor.ts +19 -0
- package/client/use-library.ts +83 -0
- package/client/use-machine.ts +39 -0
- package/client/use-new-agent.ts +172 -0
- package/client/use-office.ts +66 -0
- package/client/use-qa.ts +25 -0
- package/client/use-reply-drafts.ts +34 -0
- package/client/use-reviews.ts +68 -0
- package/client/use-script-log.ts +27 -0
- package/client/use-sound.ts +8 -0
- package/client/use-standup.ts +46 -0
- package/client/use-street.ts +21 -0
- package/client/view-switch.tsx +83 -0
- package/client/weather-settings.tsx +84 -0
- package/client/weather-text.ts +31 -0
- package/client/web-env.web.ts +69 -0
- package/client/workspace-office-tools.tsx +102 -0
- package/client/workspace-overlay-route.web.ts +47 -0
- package/client/workspace-overlay.tsx +195 -0
- package/client/world/adapter.ts +456 -0
- package/client/world/escape.ts +58 -0
- package/client/world/rung-incidents.ts +25 -0
- package/client/world/script-frame-kit.ts +41 -0
- package/client/world/street-events.ts +18 -0
- package/client/world/use-floor-plan.ts +34 -0
- package/client/world/use-incident-alarm.ts +81 -0
- package/client/world/use-life.ts +40 -0
- package/client/world/use-scene-words.ts +76 -0
- package/client/world/use-street-kit.ts +28 -0
- package/client/world/use-world-feed.ts +178 -0
- package/client/world/words-loader.ts +35 -0
- package/client/world/workspace-dock.ts +6 -0
- package/client/world/world-api.ts +293 -0
- package/client/world/world-bridge-page.ts +57 -0
- package/client/world/world-bridge.ts +149 -0
- package/client/world/world-frame.web.ts +111 -0
- package/client/world/world-loader.ts +59 -0
- package/client/world/world-loading.tsx +11 -0
- package/client/world/world-view-native.tsx +225 -0
- package/client/world/world-view-shared.ts +199 -0
- package/client/world/world-view.tsx +348 -0
- package/docs/office.md +732 -0
- package/icon.png +0 -0
- package/index.client.tsx +66 -0
- package/index.server.ts +786 -0
- package/package.json +67 -4
- package/paseo-plugin.json +7 -0
- package/server/activity.ts +444 -0
- package/server/agent-tools.ts +159 -0
- package/server/board-service.ts +655 -0
- package/server/board-store.ts +115 -0
- package/server/brand-logo.ts +34 -0
- package/server/chat-group.ts +83 -0
- package/server/chat-service.ts +790 -0
- package/server/chat-store.ts +119 -0
- package/server/directory.ts +407 -0
- package/server/duty-service.ts +230 -0
- package/server/errors.ts +3 -0
- package/server/fake-clock.ts +60 -0
- package/server/fake-schedules.ts +61 -0
- package/server/group-photo.ts +39 -0
- package/server/home-departure.ts +47 -0
- package/server/hub.ts +589 -0
- package/server/incidents-check.ts +213 -0
- package/server/incidents-http.ts +115 -0
- package/server/incidents-jira.ts +129 -0
- package/server/incidents-schedule.ts +87 -0
- package/server/incidents-sentry.ts +97 -0
- package/server/incidents-store.ts +122 -0
- package/server/janitor.ts +53 -0
- package/server/life-feed.ts +143 -0
- package/server/life-store.ts +93 -0
- package/server/lift-service.ts +75 -0
- package/server/live-ports.ts +310 -0
- package/server/lobby-pickup.ts +170 -0
- package/server/local-schedules.ts +262 -0
- package/server/machine/cleanup.ts +98 -0
- package/server/machine/details.ts +91 -0
- package/server/machine/fake-proc.ts +87 -0
- package/server/machine/live-ports.ts +98 -0
- package/server/machine/machine.ts +79 -0
- package/server/machine/proc.ts +238 -0
- package/server/machine/reading.ts +70 -0
- package/server/machine/watch.ts +121 -0
- package/server/mention-queue.ts +229 -0
- package/server/notes-files.ts +92 -0
- package/server/notes-prompt.ts +70 -0
- package/server/notes-schedule.ts +113 -0
- package/server/notes-writer.ts +356 -0
- package/server/office.ts +295 -0
- package/server/paseo-directory.ts +114 -0
- package/server/paseo-holder.ts +37 -0
- package/server/paths.ts +81 -0
- package/server/prompt-text.ts +12 -0
- package/server/repo-age.ts +26 -0
- package/server/schedule-follower.ts +80 -0
- package/server/script-log.ts +61 -0
- package/server/skills.ts +197 -0
- package/server/ssh/LICENSE.paseo +211 -0
- package/server/ssh/client.ts +401 -0
- package/server/ssh/discovery.ts +230 -0
- package/server/ssh/installed.ts +104 -0
- package/server/ssh/monitor.ts +104 -0
- package/server/ssh/pid-files.ts +194 -0
- package/server/ssh/read.ts +136 -0
- package/server/street-kit.generated.ts +2 -0
- package/server/street-watch.ts +143 -0
- package/server/subagent-names.ts +92 -0
- package/server/tenure.ts +184 -0
- package/server/timers.ts +25 -0
- package/server/weather-read.ts +132 -0
- package/server/weather-service.ts +158 -0
- package/server/words.generated.ts +3 -0
- package/server/world-script.ts +18 -0
- package/server/world-words.ts +17 -0
- package/server/world.generated.ts +3 -0
- package/shared/appearance.ts +43 -0
- package/shared/branding.ts +53 -0
- package/shared/chat-words.ts +80 -0
- package/shared/contracts.ts +840 -0
- package/shared/duties.ts +100 -0
- package/shared/host-details.ts +25 -0
- package/shared/host-extras.ts +21 -0
- package/shared/life-lines.ts +330 -0
- package/shared/lobby-assignment.ts +34 -0
- package/shared/machine-text.ts +152 -0
- package/shared/model.ts +314 -0
- package/shared/names.ts +43 -0
- package/shared/scene-language.ts +26 -0
- package/shared/settings.ts +217 -0
- package/shared/ssh.ts +34 -0
- package/shared/standup-report.ts +8 -0
- package/shared/standup-text.ts +252 -0
- package/shared/upstream/README.md +1 -0
- package/shared/upstream/chat-engine.d.ts +101 -0
- package/shared/upstream/chat-engine.js +231 -0
- package/shared/upstream/chat.d.ts +12 -0
- package/shared/upstream/chat.js +387 -0
- package/shared/upstream/prompt-coach.d.ts +6 -0
- package/shared/upstream/prompt-coach.js +178 -0
- package/shared/weather.ts +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 allrested
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Third-party software in this repository keeps its own licence:
|
|
26
|
+
|
|
27
|
+
- vendor/my-office/ is my-office (https://github.com/khanh020905/my-office),
|
|
28
|
+
MIT, Copyright (c) 2026 khanh020905. Its licence is vendor/my-office/LICENSE.
|
|
29
|
+
The files under shared/upstream/ are taken from it too.
|
|
30
|
+
- vendor/my-office/three/ is three.js, MIT, Copyright © 2010-2023 three.js
|
|
31
|
+
authors. Its licence is vendor/my-office/three/LICENSE.
|
|
32
|
+
- server/world.generated.ts is built from both and carries both notices.
|
package/OVERVIEW.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Office 3D
|
|
2
|
+
|
|
3
|
+
See your Paseo sessions as people at work in a shared office. Each workspace has a room, so you can spot an agent waiting for approval, walk over to its desk and open the conversation without leaving the floor.
|
|
4
|
+
|
|
5
|
+
## Working in the office
|
|
6
|
+
|
|
7
|
+
Open **Office 3D** from the sidebar and choose **Full screen**. **Sessions** groups agents by status and shows their current activity. When a provider reports checklist progress, the row shows completed items. A bar labeled **Context** measures context-window usage.
|
|
8
|
+
|
|
9
|
+
Select a row to read the conversation, reply or answer a permission request. On desktop and web, the **↗** beside the row opens the agent’s Paseo workspace over the floor, including files, diffs and terminals. In **Walk in**, press **E** next to the agent for the same workspace. Minimize it to keep your place, or hide the Sessions and Details sidebars for a wider view.
|
|
10
|
+
|
|
11
|
+
Use **Team chat** to talk to the group or address one session. Use the **Lobby board** for work that an available agent can claim. With **Agent tools** and **Wake agents** enabled, idle agents pick up unassigned tasks. Completing a linked workspace task also checks it off in the lobby. The pantry **Duty board** schedules recurring assignments on the days you choose.
|
|
12
|
+
|
|
13
|
+
## Setup and compatibility
|
|
14
|
+
|
|
15
|
+
Office 3D requires Paseo 0.16.0 or newer and plugins enabled on the host. Desktop and web support the 3D floor with WebGL 2. The store mobile app offers the 2D floor and List. Mobile builds with a script-capable frame can also show 3D.
|
|
16
|
+
|
|
17
|
+
The settings gear controls the floor plan, backdrop, lighting and sound. Under **Appearance → Branding**, the host can set a shared office name, logo and mark color. The 3D scene supports English, Vietnamese, Thai and Indonesian. The surrounding Office controls use English.
|
|
18
|
+
|
|
19
|
+
**Archive idle sessions** is off by default. Enable it under **Office settings → Automation** if you want an open 3D floor to archive a session when its worker goes home. Workers can go home after resting for at least 30 minutes at night or after evening drinks. The session must still be idle, with no pending approval or working subagent. Archiving removes it from the active list and keeps its conversation history.
|
|
20
|
+
|
|
21
|
+
Stand-up notes need a host folder. Jira and Sentry alerts need project settings and host credentials. Weather from a service needs a configured URL. Linux hosts can also show CPU, memory and processes.
|
|
22
|
+
|
|
23
|
+
## Data access
|
|
24
|
+
|
|
25
|
+
Office reads session status, activity and provider-reported usage. It stores team chat, tasks and duty records on the Paseo host. An agent’s configured provider processes messages, assignments and tool results. A whole-group message can include up to six recent group or scene messages when Office asks an available agent to reply.
|
|
26
|
+
|
|
27
|
+
Configured issue trackers and weather services receive requests from the host. Clients fetch a custom logo from its configured URL. A session’s available actions depend on its provider and the host SDK.
|
package/README.md
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Office 3D for Paseo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Office 3D puts your Paseo agents on a shared floor. Each workspace has a room. Pick a desk to see what its agent is doing, open the agent’s workbench over the floor, or leave the office in view while you watch for permission requests.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Install on a host
|
|
8
|
+
|
|
9
|
+
Office 3D requires Paseo **0.16.0 or newer**. The plugin has been tested on stock Paseo 0.16.2.
|
|
10
|
+
|
|
11
|
+
1. In the host’s existing `$PASEO_HOME/config.json` (default `~/.paseo/config.json`), set `"pluginsEnabled": true`. If you changed it on a running daemon, run `paseo daemon reload`.
|
|
12
|
+
2. Install from the repository’s default branch.
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
paseo plugin install git:allrested/paseo-office
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
To install a particular branch or tag, add `--ref <ref>`. The host supplies the SDK and runs the bundled scene directly.
|
|
19
|
+
|
|
20
|
+
3. Open **Office 3D** in the Paseo sidebar. The gear on the floor opens **Office settings**.
|
|
21
|
+
|
|
22
|
+
## Work from the floor
|
|
23
|
+
|
|
24
|
+
| What you want to do | Where to go |
|
|
25
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| See who needs you | Open **Sessions** for working, waiting and resting agents. A row shows the current activity. A checklist bar shows reported task completion. A bar labeled **Context** shows how much of the agent’s context window is in use. |
|
|
27
|
+
| Open an agent’s work | In fullscreen, click the **↗** beside the session. In **Walk in**, face the agent and press **E** or tap the prompt. On desktop or web, the agent’s workbench opens over the office. Minimize it to revisit the floor or close it to return to your walk. |
|
|
28
|
+
| Reply or approve a request | Select the session row to open its conversation and permission requests. **New agent** lets you choose a workspace, provider and model, set the agent’s appearance and send the first prompt. |
|
|
29
|
+
| Talk to the team | Open **Team chat** for group conversation, polls and office photos. Choose **To** or mention a session when you want that agent to act. |
|
|
30
|
+
| Give an idle agent a task | Add a to-do on the **Lobby board**. Turn on **Agent tools** and **Wake agents** for automatic pickup. When an agent claims a task for its workspace, checking it off on either board completes the linked item on both. |
|
|
31
|
+
| Schedule recurring work | On the pantry **Duty board**, choose the days and add instructions for an agent. Duties with instructions enter the pickup queue at 08:00 on their scheduled days. Duties without instructions are acted out on the floor. |
|
|
32
|
+
| Read a stand-up | Open **Stand-up notes** at the meeting screen to browse entries by date. Set the notes folder, days and time zone to have an agent write scheduled entries. |
|
|
33
|
+
|
|
34
|
+
On wide screens, **Sessions** and **Details** toggle the sidebars independently. Hide both for a full-width floor. [Workspace screenshot](https://raw.githubusercontent.com/allrested/paseo-office/main/docs/fullscreen-workspace.webp) · [Team chat screenshot](https://raw.githubusercontent.com/allrested/paseo-office/main/docs/fullscreen-team-chat.webp)
|
|
35
|
+
|
|
36
|
+
## Make the office yours
|
|
37
|
+
|
|
38
|
+
In **Office settings → Appearance**, choose Company floor, Cozy room or Headquarters. Choose City for streets and shops, Countryside, Beach or Plain for the backdrop, and App theme, Day or Night for lighting. The scene offers English, Vietnamese, Thai and Indonesian. The Office panels and team chat use English.
|
|
39
|
+
|
|
40
|
+
Under **Branding**, set the office name, logo URL and mark color. Blank fields inherit their host defaults. To change one agent’s name, character or avatar, open their session and choose **Customize agent**. [Branding environment variables](https://github.com/allrested/paseo-office/blob/main/docs/office.md#custom-branding)
|
|
41
|
+
|
|
42
|
+
## Platform support
|
|
43
|
+
|
|
44
|
+
| Client | Available views and controls |
|
|
45
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
46
|
+
| Paseo Desktop and web browsers | 3D with WebGL 2, 2D and List. Fullscreen workbench, walk-in controls, photos and 15-second clips. |
|
|
47
|
+
| Mobile app | 2D and List. Mobile builds with a script-capable frame also support 3D. Use Office session controls for replies and approvals. |
|
|
48
|
+
| Stock Paseo 0.16 | Stop and idle-runtime cleanup depend on host SDK support. The stock 0.16 SDK lacks these operations. |
|
|
49
|
+
|
|
50
|
+
The Linux Host panel shows memory, CPU and processes. Choose **Host → SSH** for memory, load averages and disk use on hosts configured through SSH-MCP. The floor also reflects reported agent spending, repository birthdays and team tenure. Git tags, pull-request checks and the installed Claude CLI version can trigger city activities. Weather and Jira or Sentry alerts are optional. [Feature guide](https://github.com/allrested/paseo-office/blob/main/docs/office.md) · [Compatibility checks](https://github.com/allrested/paseo-office/blob/main/docs/verified.md)
|
|
51
|
+
|
|
52
|
+
## Data and integrations
|
|
53
|
+
|
|
54
|
+
Boards, duties, team chat and stand-up state are stored under `$PASEO_HOME/office/`. View preferences are stored on the device. Clips download to the device. A custom logo is fetched from the image URL you configure.
|
|
55
|
+
|
|
56
|
+
Agent prompts, tool results and scheduled assignments go through the agent’s configured provider. A **Whole group** chat message can go to one available session with up to six recent group or scene messages for context. **To**, mentions and replies address a particular session.
|
|
57
|
+
|
|
58
|
+
Jira and Sentry use project settings and credentials from the host environment. A configured weather service receives requests while Office is open, at most once every 15 minutes. Its URL is visible in host settings. On stock hosts using fallback timers, scheduled work resumes after daemon restart when Office or an agent activates the plugin. Missed runs are skipped. [Plugin overview](https://github.com/allrested/paseo-office/blob/main/OVERVIEW.md) · [Implementation and storage](https://github.com/allrested/paseo-office/blob/main/docs/office.md)
|
|
59
|
+
|
|
60
|
+
## Development
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npm ci
|
|
64
|
+
npm run typecheck
|
|
65
|
+
npm test
|
|
66
|
+
npm run test:scripts
|
|
67
|
+
npm run lint
|
|
68
|
+
npm run format:check
|
|
69
|
+
npm run check:world
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
After editing the vendored scene, run `npm run build:world` and commit the regenerated files.
|
|
73
|
+
|
|
74
|
+
## Credits and license
|
|
75
|
+
|
|
76
|
+
This is an independent community port of **my-office** by **khanh020905**, used with the author’s permission. The scene is based on upstream v0.6.0 at `b682288` and uses three.js 0.160.0. Report Paseo-specific issues in this repository. [Upstream project](https://github.com/khanh020905/my-office) · [Vendored sources and credits](https://github.com/allrested/paseo-office/blob/main/vendor/SOURCES.md) · [Issue tracker](https://github.com/allrested/paseo-office/issues) · [MIT license](https://github.com/allrested/paseo-office/blob/main/LICENSE)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
Text,
|
|
5
|
+
View,
|
|
6
|
+
type PressableStateCallbackType,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import type { OfficeStyles } from "./styles.js";
|
|
10
|
+
|
|
11
|
+
export interface ActionButtonProps {
|
|
12
|
+
label: string;
|
|
13
|
+
/** Shown while the action runs, e.g. "Sending...". */
|
|
14
|
+
pendingLabel: string;
|
|
15
|
+
onPress(): void | Promise<void>;
|
|
16
|
+
styles: OfficeStyles;
|
|
17
|
+
primary?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Its name for a screen reader, where the label alone does not say what it acts on. */
|
|
20
|
+
name?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Same as server/errors.ts errorMessage; client code may not import server/.
|
|
24
|
+
function messageOf(error: unknown): string {
|
|
25
|
+
return error instanceof Error ? error.message : String(error);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A label is imperative ("Send"), so its failure reads "Unable to send: ...". A message that
|
|
30
|
+
* already starts "Unable to" (the board service's errors) is shown as it is, not prefixed twice,
|
|
31
|
+
* and an error that says nothing leaves no colon behind.
|
|
32
|
+
*/
|
|
33
|
+
export function failureText(label: string, error: unknown): string {
|
|
34
|
+
const message = messageOf(error).trim();
|
|
35
|
+
if (message.startsWith("Unable to")) return message;
|
|
36
|
+
const failure = `Unable to ${label.charAt(0).toLowerCase()}${label.slice(1)}`;
|
|
37
|
+
return message === "" ? failure : `${failure}: ${message}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function buttonStyle(
|
|
41
|
+
styles: OfficeStyles,
|
|
42
|
+
primary: boolean,
|
|
43
|
+
dim: boolean,
|
|
44
|
+
pressed: boolean,
|
|
45
|
+
): ViewStyle {
|
|
46
|
+
if (primary) {
|
|
47
|
+
if (dim) return styles.buttonPrimaryDisabled;
|
|
48
|
+
return pressed ? styles.buttonPrimaryPressed : styles.buttonPrimary;
|
|
49
|
+
}
|
|
50
|
+
if (dim) return styles.buttonDisabled;
|
|
51
|
+
return pressed ? styles.buttonPressed : styles.button;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** A button that shows its own pending state and keeps its error in place (docs/testing.md). */
|
|
55
|
+
export function ActionButton({
|
|
56
|
+
label,
|
|
57
|
+
pendingLabel,
|
|
58
|
+
onPress,
|
|
59
|
+
styles,
|
|
60
|
+
primary = false,
|
|
61
|
+
disabled = false,
|
|
62
|
+
name,
|
|
63
|
+
}: ActionButtonProps) {
|
|
64
|
+
const [pending, setPending] = useState(false);
|
|
65
|
+
const [error, setError] = useState<string | null>(null);
|
|
66
|
+
const mounted = useRef(true);
|
|
67
|
+
// Set before the first await, so a second tap before the re-render cannot fire twice.
|
|
68
|
+
const inFlight = useRef(false);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
mounted.current = true;
|
|
71
|
+
return () => {
|
|
72
|
+
mounted.current = false;
|
|
73
|
+
};
|
|
74
|
+
}, []);
|
|
75
|
+
const press = useCallback(() => {
|
|
76
|
+
if (inFlight.current) return;
|
|
77
|
+
inFlight.current = true;
|
|
78
|
+
setPending(true);
|
|
79
|
+
setError(null);
|
|
80
|
+
Promise.resolve()
|
|
81
|
+
.then(() => onPress())
|
|
82
|
+
.then(
|
|
83
|
+
() => {
|
|
84
|
+
inFlight.current = false;
|
|
85
|
+
if (mounted.current) setPending(false);
|
|
86
|
+
return undefined;
|
|
87
|
+
},
|
|
88
|
+
(failure: unknown) => {
|
|
89
|
+
inFlight.current = false;
|
|
90
|
+
if (!mounted.current) return;
|
|
91
|
+
setPending(false);
|
|
92
|
+
setError(failureText(label, failure));
|
|
93
|
+
},
|
|
94
|
+
);
|
|
95
|
+
}, [label, onPress]);
|
|
96
|
+
const dim = disabled || pending;
|
|
97
|
+
const style = useCallback(
|
|
98
|
+
({ pressed }: PressableStateCallbackType) => buttonStyle(styles, primary, dim, pressed),
|
|
99
|
+
[styles, primary, dim],
|
|
100
|
+
);
|
|
101
|
+
const shown = pending ? pendingLabel : label;
|
|
102
|
+
return (
|
|
103
|
+
<View style={styles.actionButton}>
|
|
104
|
+
<Pressable
|
|
105
|
+
accessibilityRole="button"
|
|
106
|
+
accessibilityLabel={pending || name === undefined ? shown : name}
|
|
107
|
+
disabled={dim}
|
|
108
|
+
onPress={press}
|
|
109
|
+
style={style}
|
|
110
|
+
>
|
|
111
|
+
{primary ? null : <View style={styles.buttonFill} />}
|
|
112
|
+
<Text style={primary ? styles.buttonPrimaryText : styles.buttonText} numberOfLines={1}>
|
|
113
|
+
{shown}
|
|
114
|
+
</Text>
|
|
115
|
+
{/* "Approve" turning into "Approving..." would widen the button and move its neighbour. */}
|
|
116
|
+
<Text aria-hidden style={styles.buttonSpacer} numberOfLines={1}>
|
|
117
|
+
{pending ? label : pendingLabel}
|
|
118
|
+
</Text>
|
|
119
|
+
</Pressable>
|
|
120
|
+
{error ? (
|
|
121
|
+
<Text accessibilityRole="alert" style={styles.actionError}>
|
|
122
|
+
{error}
|
|
123
|
+
</Text>
|
|
124
|
+
) : null}
|
|
125
|
+
</View>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// The words the feed says, and nothing else: an event's text is built from this file alone, so
|
|
2
|
+
// no file name, command, prompt or permission detail can reach the screen. `activity-feed.ts`
|
|
3
|
+
// imports this module, never the other way round.
|
|
4
|
+
import type { PermissionKind } from "../shared/contracts.js";
|
|
5
|
+
import type { ActivityKind } from "../shared/names.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What an event is: the office's step kinds, and the five moments around them. It lives here
|
|
9
|
+
* because every one of them needs a word, and the feed module takes its list from this file.
|
|
10
|
+
*/
|
|
11
|
+
export type FeedKind =
|
|
12
|
+
| ActivityKind
|
|
13
|
+
| "started"
|
|
14
|
+
| "finished"
|
|
15
|
+
| "permission"
|
|
16
|
+
| "error"
|
|
17
|
+
| "subagent-started";
|
|
18
|
+
|
|
19
|
+
/** The feed's first line, before the office has changed under it. */
|
|
20
|
+
export const FEED_EMPTY = "Nothing yet since the office opened.";
|
|
21
|
+
|
|
22
|
+
/** The feed has events, but the tab and the chips hide every card. */
|
|
23
|
+
export const FEED_NO_MATCH = "No activity matches.";
|
|
24
|
+
|
|
25
|
+
/** A step's word: what the agent is at, in the office's own kind and no detail of the call. */
|
|
26
|
+
const STEP_WORDS: Readonly<Record<ActivityKind, string>> = {
|
|
27
|
+
read: "Reading",
|
|
28
|
+
search: "Searching",
|
|
29
|
+
skill: "Using a skill",
|
|
30
|
+
edit: "Editing",
|
|
31
|
+
write: "Writing",
|
|
32
|
+
command: "Running a command",
|
|
33
|
+
web: "Searching the web",
|
|
34
|
+
tool: "Using a tool",
|
|
35
|
+
subagent: "Starting a sub-agent",
|
|
36
|
+
plan: "Updating the plan",
|
|
37
|
+
test: "Running tests",
|
|
38
|
+
commit: "Committing",
|
|
39
|
+
push: "Pushing",
|
|
40
|
+
deploy: "Deploying",
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export interface EventTextExtra {
|
|
44
|
+
/** A permission's short title, or a sub-agent's name; absent when there is nothing to name. */
|
|
45
|
+
title?: string;
|
|
46
|
+
/** A permission's kind, which decides whether its title may be shown. */
|
|
47
|
+
permissionKind?: PermissionKind;
|
|
48
|
+
/** A step that ended badly: its word gets " failed". */
|
|
49
|
+
failed?: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A permission's line. Only a tool's or a mode's title is a short name; a question's title is the
|
|
54
|
+
* question itself (Claude's AskUserQuestion) and a plan's can be prose too, so those, and a kind
|
|
55
|
+
* not given, get their words alone.
|
|
56
|
+
*/
|
|
57
|
+
function permissionText({ title, permissionKind }: EventTextExtra): string {
|
|
58
|
+
if (permissionKind === "question") return "Has a question";
|
|
59
|
+
if (permissionKind === "plan") return "Has a plan to review";
|
|
60
|
+
const named = permissionKind === "tool" || permissionKind === "mode" ? (title?.trim() ?? "") : "";
|
|
61
|
+
return named === "" ? "Needs permission" : `Needs permission: ${named}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** What one event says. */
|
|
65
|
+
export function eventText(kind: FeedKind, extra: EventTextExtra = {}): string {
|
|
66
|
+
switch (kind) {
|
|
67
|
+
case "started":
|
|
68
|
+
return "Started working";
|
|
69
|
+
case "finished":
|
|
70
|
+
return "Finished";
|
|
71
|
+
case "error":
|
|
72
|
+
return "Stopped on an error";
|
|
73
|
+
case "permission":
|
|
74
|
+
return permissionText(extra);
|
|
75
|
+
case "subagent-started": {
|
|
76
|
+
const title = extra.title?.trim() ?? "";
|
|
77
|
+
return title === "" ? "A sub-agent started" : `Started ${title}`;
|
|
78
|
+
}
|
|
79
|
+
default: {
|
|
80
|
+
const word = STEP_WORDS[kind];
|
|
81
|
+
return extra.failed === true ? `${word} failed` : word;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|