diff --git a/.github/workflows/ds-bot-upstream.yml b/.github/workflows/ds-bot-upstream.yml index 0eb62abe3..734f529d6 100644 --- a/.github/workflows/ds-bot-upstream.yml +++ b/.github/workflows/ds-bot-upstream.yml @@ -77,8 +77,8 @@ jobs: - name: Check managed private histories with the native DSH host working-directory: . run: node --test runtime/flybot-image/test/native-open-parts.test.mjs - # Upstream's annotation test owns its mock clock. The restart fixture's - # cleanup waits for pending writes before removing its temporary directory. + # Upstream's annotation test owns its mock clock. The restart and dedup + # fixtures stop their runtimes before removing their temporary directories. # Every assertion and vendor byte stays intact; source hashes fail closed. - name: Full pinned upstream suite with checked fixture lifecycle run: NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--import=$(realpath ../../../scripts/upstream-test-clock.mjs)" npm test -- --test-concurrency=1 diff --git a/.github/workflows/ui-screenshots.yml b/.github/workflows/ui-screenshots.yml index d66241c70..00fe0a579 100644 --- a/.github/workflows/ui-screenshots.yml +++ b/.github/workflows/ui-screenshots.yml @@ -24,8 +24,8 @@ jobs: working-directory: ${{ runner.temp }} run: | set -eu - mkdir -p ot-playwright - cd ot-playwright + mkdir -p flybot-playwright + cd flybot-playwright npm init -y >/dev/null npm install playwright@1.56.1 npx playwright install chromium --with-deps @@ -33,7 +33,7 @@ jobs: run: | set -eu # Playwright is resolved next to the browser runner script. - ln -sfn "$RUNNER_TEMP/ot-playwright/node_modules" "$GITHUB_WORKSPACE/node_modules" + ln -sfn "$RUNNER_TEMP/flybot-playwright/node_modules" "$GITHUB_WORKSPACE/node_modules" node --import ./services/bot-social/node_modules/tsx/dist/loader.mjs \ scripts/ci-native-ui-screenshots.mjs "$GITHUB_WORKSPACE/ui-screenshots" - name: Upload screenshots diff --git a/README.md b/README.md index 69487be3a..03b46066f 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,83 @@ +
+ +FlyBot on desktop and mobile, showing an agent reply with a release checklist and a flowchart + # FlyBot -FlyBot is a self-hosted workspace for chat, AI agents, and team collaboration. Each account runs its own DS-Bot container. The gateway handles authentication and routes requests to the right account. Bot Social coordinates shared groups and public workspace content. +**A self-hosted workspace for AI agents, conversations, and teamwork.** + +[Quick start](#quick-start) · [Deployment](#deployment) · [Architecture](#architecture) · [Documentation](#documentation) -- Chat with your personal agent or bring people and agents into a group. Stream replies, tables, and flowcharts into the conversation. -- Save results to the workspace library and use its versions, sharing, and memory features. -- Keep track of meetings, action items, and scheduled automations. -- Explore public agents and works, manage skills, and organize team membership. +[![FlyBot CI](https://github.com/ThinkFlowLab/FlyBot/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ThinkFlowLab/FlyBot/actions/workflows/tests.yml) -## Get started +
-| Task | Instructions | +FlyBot gives each account a private DS-Bot runtime for its agents, conversations, skills, and memory. People and agents can collaborate in shared groups through Bot Social. The cover shows a sample conversation captured in Chromium on desktop and mobile. + +## Capabilities + +| Area | What FlyBot supports | | --- | --- | -| Start the local browser preview | [Quick start](docs/GETTING_STARTED.md) | -| Run one container per account | [Compose manager](docs/COMPOSE_MANAGER.md) and [Bot Social setup](deploy/isolated/BOT_SOCIAL_DEPLOY.md) | -| Work on the management and runtime APIs | [Architecture](docs/ARCHITECTURE.md), [Management API](docs/MANAGEMENT_API.md), and [DS-Bot plugin contract](docs/DSBOT_PLUGIN_ARCHITECTURE.md) | -| Reproduce a workflow | [Acceptance records](docs/ACCEPTANCE.md) | +| **Chat and agents** | Personal agents, groups with people and AI agents, streaming replies, Markdown, tables, and flowcharts. | +| **Workspace library** | Save agent outputs, manage versions and sharing, and retrieve context from workspace memory. | +| **Automations and meetings** | Schedule recurring jobs, review their results, and turn meeting notes into action items. | +| **Discovery and administration** | Browse published agents and works, install skills, and manage workspace membership and permissions. | + +## Quick start + +Run the local management preview with Git and Python 3.11 or later. + +```sh +git clone https://github.com/ThinkFlowLab/FlyBot.git +cd FlyBot + +preview_data="$(mktemp -d)" +preview_data="$(cd "$preview_data" && pwd -P)" + +python3 -m flybot_workspace.server \ + --data-dir "$preview_data" \ + --origin http://127.0.0.1:8787 \ + --port 8787 \ + --insecure-local \ + --open-registration +``` + +Open [http://127.0.0.1:8787/login](http://127.0.0.1:8787/login) and register a test account. The preview uses a temporary local database. Follow the deployment guide to connect a model and try shared groups. + +## Deployment + +A full installation uses Docker Engine, Compose v2, and BuildKit on a Linux host. The deployment guides cover building the pinned runtime image, provisioning one container per account, configuring the shared Bot Social service, and setting a default model API for newly provisioned accounts. [Compose manager](docs/COMPOSE_MANAGER.md) · [Bot Social and gateway](deploy/isolated/BOT_SOCIAL_DEPLOY.md) + +## Architecture + +The management gateway authenticates requests and routes them to the account's DS-Bot container. Each account reuses its container across workspaces and keeps runtime state on a dedicated volume. Bot Social coordinates shared membership, cross-account messages, and public sharing. + +```mermaid +flowchart LR + Browser["Desktop and mobile browsers"] --> Gateway["Management service and gateway"] + Gateway --> A["Account A · DS-Bot
FlyBot Workspace + Bot Social"] + Gateway --> B["Account B · DS-Bot
FlyBot Workspace + Bot Social"] + A --- VA[("Account A data volume")] + B --- VB[("Account B data volume")] + A --> Social["Shared Bot Social service"] + B --> Social +``` + +The runtime is pinned to **DS-Bot v0.3.10**. [Runtime pin](runtime/ds-bot-upstream.pin.json) · [Service and data boundaries](docs/ARCHITECTURE.md) + +## Documentation + +| Topic | Reference | +| --- | --- | +| Setup and development | [Getting started](docs/GETTING_STARTED.md) | +| APIs and plugins | [Management API](docs/MANAGEMENT_API.md) · [DS-Bot plugin contract](docs/DSBOT_PLUGIN_ARCHITECTURE.md) | +| Verification | [Acceptance records](docs/ACCEPTANCE.md) · [FlyBot CI](https://github.com/ThinkFlowLab/FlyBot/actions/workflows/tests.yml) | +| Project direction | [Roadmap](docs/ROADMAP.md) | + +## Contributing -Choose **English** under **Settings → Language → System language** for English settings and core chat controls. The chat reply language is configured separately. +Include reproduction steps and verification results in your pull request. CI runs the management, browser, pinned runtime, container isolation, and Bot Social suites on pull requests and in the merge queue. [Open a pull request](https://github.com/ThinkFlowLab/FlyBot/pulls) -## Runtime and licenses +## Licensing -This workspace is derived from [OpenTeamily at `07e8b6fbd`](https://github.com/openTeamily/openTeamily/tree/07e8b6fbd). Its container recipe pins [DS-Bot v0.3.10](runtime/ds-bot-upstream.pin.json) and installs the Workspace and Bot Social extensions. See the [license inventory](docs/LICENSING.md), [original NOTICE](NOTICE), and [Bot Social rebrand manifest](docs/upstream/flybot-workspace-overlay.json) for component boundaries and attribution. +The workspace derives from OpenTeamily at `07e8b6fbd` and is distributed under the MIT License. Imported DS-Bot and FlyBot runtime source, Bot Social, and third-party components retain their respective licenses and notices. [MIT License](LICENSE) · [NOTICE](NOTICE) · [Licensing inventory](docs/LICENSING.md) · [Source revision](https://github.com/openTeamily/openTeamily/tree/07e8b6fbd) diff --git a/docs/ACCEPTANCE.md b/docs/ACCEPTANCE.md index c3a47e695..edfe9f196 100644 --- a/docs/ACCEPTANCE.md +++ b/docs/ACCEPTANCE.md @@ -1,6 +1,12 @@ # Evidence and acceptance status -Record release verification and product comparison separately. The linked prior runs cover the OpenTeamily source build and environment named in each run. FlyBot Workspace requires its own release verification. A Teamily comparison requires the same operation in both products with equivalent roles and relevant settings. +Record each result against the tested revision, user role, and environment. + +## FlyBot 0.3.0 + +All 16 jobs passed in the [FlyBot release candidate CI run](https://github.com/ThinkFlowLab/FlyBot/actions/runs/45523580750) for [PR #3377](https://github.com/ThinkFlowLab/FlyBot/pull/3377). The run covered the management API, desktop and mobile Chromium, the pinned DS-Bot suite, Compose lifecycle and retained volumes, gateway isolation, and collaboration between two DS-Bot accounts through Bot Social. The [merge queue run](https://github.com/ThinkFlowLab/FlyBot/actions/runs/45526147080) passed at the squash commit. + +The two sections below preserve verification history from the OpenTeamily source repository. ## Verified DS-Bot v0.3.10 upgrade @@ -14,7 +20,7 @@ The [DS-Bot conversation upgrade job](https://github.com/openTeamily/openTeamily The [runtime image checks](https://github.com/openTeamily/openTeamily/actions/runs/45196194354) also passed on the same PR head. They cover the Compose lifecycle and retained volume, owner-specific gateway routing and two DS-Bots sharing state through Bot Social. The upgrade uses a deterministic local model and disposable accounts. It covers runtime migration and browser behavior on the test volumes. An operator rollout and a Teamily comparison each require their own evidence. -Reproduce the upgrade check with the [workflow](../.github/workflows/ds-bot-conversation-upgrade.yml) and [test runner](../runtime/flybot-image/test/upgrade/check.py). See [Compose manager](COMPOSE_MANAGER.md) for deployment and existing-volume boundaries. +The [source workflow](https://github.com/openTeamily/openTeamily/blob/07e8b6fbd05788e1c4c14cac65f18e392e82f452/.github/workflows/ds-bot-conversation-upgrade.yml) records the original test inputs. See the [test runner](../runtime/flybot-image/test/upgrade/check.py) and [Compose manager](COMPOSE_MANAGER.md) for the runner and deployment details. ## Memory and navigation release diff --git a/docs/BOT_SOCIAL.md b/docs/BOT_SOCIAL.md index f2044523b..3f083a6d2 100644 --- a/docs/BOT_SOCIAL.md +++ b/docs/BOT_SOCIAL.md @@ -1,8 +1,6 @@ # Bot Social collaboration endpoint -Related: [#1](https://github.com/openTeamily/openTeamily/issues/1). - -The management server records only a validated Bot Social **server URL** and an optional display name. A self-host operator sets a platform default; a workspace owner or admin may optionally override it. The workspace override wins when it has a server. Connector tokens are issued later by onboarding on the instance volume and are never accepted, stored or returned by management. This is an FlyBot wiring choice, not a Teamily parity claim. +The FlyBot management server records a validated Bot Social **server URL** and an optional display name. The operator sets a platform default that a workspace owner or admin can override. Each DS-Bot instance obtains its connector token during onboarding and stores it on the account's volume. ## Routes @@ -21,18 +19,9 @@ The compose manager fetches the already-resolved URL over a lease-gated loopback Existing frozen `compose-*.json` files written before this second bind was added will fail the exact-content check (`manifest_changed`) until the operator recreates the instance. -## Not in this slice - -No live call to a third-party Bot Social, no connector-token storage, no settings UI, no Teamily comparison. Unit tests use in-process WSGI and a temporary SQLite store only. Compose-manager tests use the filesystem Docker stub, not a Docker engine. CI image smoke against an in-container fake server is a separate path and is not management-plane proof. This box has no Docker engine. - -## Phase C: cross-user FlyBot features through Bot Social +## Cross-user FlyBot features -Per `docs/DSBOT_PLUGIN_ARCHITECTURE.md`, features that involve more than one user run between users' own -DS-Bots through Bot Social. `services/bot-social/src/flybot-workspace/` adds `/v1/ot/*` routes (FlyBot-authored, -recorded in `docs/upstream/migration-manifest.json` as additions to the snapshot). Every route takes the -FlyBot home **connector token** (or an owner login) — the same identity `@flybot/social` saves at onboarding — -so each DS-Bot acts only as its own owner. Bot Social stores only shared state; private data stays on the -user's volume. +Cross-user features run between users' own DS-Bots through Bot Social. The [source overlay manifest](upstream/flybot-workspace-overlay.json) records the shared-state routes added to the Bot Social snapshot. Private routes authenticate the FlyBot home connector token or an owner login. Each DS-Bot acts with its owner's identity, and the account's private data stays on its volume. | Area | Routes | DS-Bot plugin feature | |---|---|---| diff --git a/docs/COMPOSE_MANAGER.md b/docs/COMPOSE_MANAGER.md index 1fb2bb58f..157189716 100644 --- a/docs/COMPOSE_MANAGER.md +++ b/docs/COMPOSE_MANAGER.md @@ -2,11 +2,7 @@ The manager runs the isolated DS-Bot containers and reports verified state back to the platform. The web service handles account sessions and provisioning. A separate, operator-managed process executes the Docker work over an authenticated loopback connection. Execution and automatic account provisioning are opt-in. -The v0.3.10 build passed real Docker/Compose lifecycle, volume retention, gateway -routing and two-account Bot Social tests. Chromium verified private-chat history -on two separate account volumes before upgrade, after upgrade and after restart. -[Runtime image checks](https://github.com/openTeamily/openTeamily/actions/runs/45196194354) -and [upgrade acceptance](ACCEPTANCE.md#verified-ds-bot-v0310-upgrade) record the evidence. +[FlyBot 0.3.0 CI](https://github.com/ThinkFlowLab/FlyBot/actions/runs/45523580750) verified Docker Compose lifecycle, volume retention, gateway isolation, and two-account Bot Social collaboration. The [DS-Bot v0.3.10 upgrade record](ACCEPTANCE.md#verified-ds-bot-v0310-upgrade) also documents Chromium verification of private chat history on two separate account volumes before upgrade, after upgrade, and after restart. ## Scope and prerequisites diff --git a/docs/GUIDE.md b/docs/GUIDE.md index e18b8e15b..9b440678a 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -1,7 +1,8 @@ -# Feature guide +# FlyBot feature guide -`/guide` is FlyBot's own searchable feature directory. The page layout follows the recorded Teamily feature-guide chrome: heading「功能指引」, search placeholder「搜索功能,例如:添加成员」, a list/graph toggle, a left category list with counts, a grouped item list, and an item dialog with an operation path. +Open **功能指引** to search for an operation or browse categories such as chat, +agents, automation, memory, and settings. Each result explains the feature and +shows the steps to reach it. The graph view is currently unavailable. -This is not a copy of Teamily's 295 feature texts. The catalog only describes entries that already exist in this repository, plus honest labels for unfinished pieces such as the memory profile body. Category names follow the recorded navigation (including an empty「通话窗口」group). The graph toggle is visible but disabled, because the recapture only has the list view. - -The page is served as a same-origin management asset. It does not add a new API, does not invent a settings-hub or account-menu entry (those entry points were not recaptured), and must not be treated as Teamily or Impeccable acceptance. +The guide supports links with a search term (`/guide?q=`), a category +(`/guide?category=`), or both. The catalog and search run in the browser. diff --git a/docs/LICENSING.md b/docs/LICENSING.md index a5d35c637..d93acd96c 100644 --- a/docs/LICENSING.md +++ b/docs/LICENSING.md @@ -6,14 +6,14 @@ relicense imported upstream trees. | Tree | License | Binding files | Copyright / notice | | --- | --- | --- | --- | -| New FlyBot code and docs (`flybot-workspace/`, `manager/`, `tests/`, `docs/` except copied upstream docs, `scripts/` authored here, `runtime/flybot-social-host/`, `runtime/flybot-web-slots/`, `runtime/flybot-image/`) | MIT | [`LICENSE`](../LICENSE) | FlyBot contributors | -| `runtime/flybot/` (except `ORIGIN.md` and `FLYBOT_WORKSPACE.md`) | Apache License 2.0 | [`runtime/flybot/LICENSE`](../runtime/flybot/LICENSE), [`runtime/flybot/NOTICE`](../runtime/flybot/NOTICE) | NOTICE: DS Bot, Copyright 2026 Fei2411 and the DS Bot contributors | -| `services/bot-social/` (except `ORIGIN.md` and `FLYBOT_WORKSPACE.md`) | MIT | [`services/bot-social/LICENSE`](../services/bot-social/LICENSE) | Copyright (c) 2026 Birfy | +| New FlyBot code and docs (`flybot_workspace/`, `manager/`, `tests/`, `docs/` except copied upstream docs, `scripts/` authored here, `runtime/flybot-social-host/`, `runtime/flybot-web-slots/`, `runtime/flybot-image/`) | MIT | [`LICENSE`](../LICENSE) | FlyBot contributors | +| `runtime/flybot/` (except `ORIGIN.md` and `OPENTEAMILY.md`) | Apache License 2.0 | [`runtime/flybot/LICENSE`](../runtime/flybot/LICENSE), [`runtime/flybot/NOTICE`](../runtime/flybot/NOTICE) | NOTICE: DS Bot, Copyright 2026 Fei2411 and the DS Bot contributors | +| `services/bot-social/` (except `ORIGIN.md` and `OPENTEAMILY.md`) | MIT | [`services/bot-social/LICENSE`](../services/bot-social/LICENSE) | Copyright (c) 2026 Birfy | | `runtime/ds-bot-upstream/` (except `UPSTREAM.md`) | Apache License 2.0 | [`runtime/ds-bot-upstream/LICENSE`](../runtime/ds-bot-upstream/LICENSE), [`runtime/ds-bot-upstream/NOTICE`](../runtime/ds-bot-upstream/NOTICE) | Unmodified pinned copy of [Fei2411/DS-Bot](https://github.com/Fei2411/DS-Bot) v0.3.10 (`d104d9ca18d69a35460f14e15dff4d553181433a`); LICENSE and NOTICE retained | -`ORIGIN.md` and `FLYBOT_WORKSPACE.md` files inside imported FlyBot and Bot Social -trees, and `UPSTREAM.md` inside `runtime/ds-bot-upstream/`, are FlyBot -documentation overlays and follow the root MIT license. They do not change the +`ORIGIN.md` and `OPENTEAMILY.md` files inside imported FlyBot and Bot Social +trees, and `UPSTREAM.md` inside `runtime/ds-bot-upstream/`, are documentation overlays from the original +OpenTeamily integration and follow the root MIT license. They do not change the license of neighboring upstream files. If you redistribute this repository, include the Apache-2.0 text and NOTICE diff --git a/docs/MODEL_API.md b/docs/MODEL_API.md index 67e3fa612..f709a9113 100644 --- a/docs/MODEL_API.md +++ b/docs/MODEL_API.md @@ -1,8 +1,6 @@ # Model API configuration -Related: [#4](https://github.com/openTeamily/openTeamily/issues/4), [#6](https://github.com/openTeamily/openTeamily/issues/6), [#1](https://github.com/openTeamily/openTeamily/issues/1). - -FlyBot does **not** implement Teamily account credits, billing or usage limits. A self-host operator configures a platform default model API; an account or workspace may optionally override it. The effective configuration is “override if a key is set, otherwise the platform default”. This is an FlyBot choice, not Teamily parity. +A self-host operator configures FlyBot's platform default model API. An account or workspace can override it. FlyBot uses the override when it contains a key and the platform default otherwise. The API key is stored only as a wrapped blob next to the private management database. It is never returned in JSON, logs or run records. Runtime hooks receive the unwrapped key in-process. The compose manager fetches the already-resolved key over a lease-gated loopback endpoint (`POST /v1/internal/instances/{id}/runtime-secret`) and writes it to a private 0600 file that is bind-mounted read-only into the container. The key is not echoed on user HTTP APIs, claim receipts, observe payloads or operator logs; the lease-gated response is written to disk and not logged. The wrapping construction is a local HMAC-SHA256 keystream with an encrypt-then-MAC tag, using a 32-byte key in `model-api.wrap` (mode 0600). It is not a substitute for disk encryption or a cryptographic review. @@ -24,6 +22,6 @@ Instances include a redacted `model_api` object for the manager-supplied configu `--operator-admin` is a private JSON file `{"credential_hash":""}`. The token itself is never stored. Disabled if the flag is omitted. Do not commit this file or put secrets in the repository. -## Not in this slice +## Deployment verification -No credits, no quotas, no live call to a model provider, no Teamily billing UI. Browser acceptance is not claimed. Live Docker create/start/stop of a real FlyBot container on an operator host is documented in `docs/COMPOSE_MANAGER.md` and is not proven by the unit tests in this repository (this box has no Docker engine). +Repository tests use a deterministic model fixture. To verify your model provider, follow the [Compose manager deployment guide](COMPOSE_MANAGER.md#account-provisioning-and-deployment) and send a message from a newly provisioned account. diff --git a/docs/PERSONAL_AGENT.md b/docs/PERSONAL_AGENT.md index c9c12f229..d8529951c 100644 --- a/docs/PERSONAL_AGENT.md +++ b/docs/PERSONAL_AGENT.md @@ -1,11 +1,6 @@ # Personal Agent and built-in roster -Related: [#130](https://github.com/openTeamily/openTeamily/issues/130), [#1](https://github.com/openTeamily/openTeamily/issues/1), [#6](https://github.com/openTeamily/openTeamily/issues/6), [#7](https://github.com/openTeamily/openTeamily/issues/7). - -The 2026-11-18 real-account contrast (#130) showed that Teamily signs a user in with a default -`'s Personal Agent`, a built-in assistant roster, and a pinned personal conversation. -This slice adds the same identity and roster on the management side, written for FlyBot. It -does not copy Teamily prompts, marks, or credits, and it is not Teamily parity yet. +FlyBot provisions a Personal Agent, built-in assistants, and a welcome conversation in each user's personal workspace. When an account has a native DS-Bot runtime, its Personal Agent is bound to that runtime's Chief bot. ## API @@ -35,7 +30,7 @@ workspaces the call returns `429 quota` and creates nothing. - A `个人空间` workspace owned by the user. - `'s Personal Agent` with the summary `Your Cross-context Super AI Agent.` and an original instruction prompt. -- Ten built-in assistant records: Teamily Agent, Content Creator, Finance Assistant, Health +- Ten built-in assistant records: FlyBot Assistant, Content Creator, Finance Assistant, Health Assistant, AI Stock Assistant, Market Research, Travel Planner, Accounting Assistant, Slides Assistant, Webpage Developer. Summaries and instructions are FlyBot-authored, not copied. - One welcome conversation titled `Personal Agent` with a single succeeded assistant message @@ -56,17 +51,8 @@ records. If the user saved onboarding step 4, `GET`/`POST /v1/personal-agent` also returns `personal_agent.look` and the owner's Personal Agent card/session renders it as an -original CSS avatar. It is owner-only, decorative and not a generated image or a -Teamily art match. See [PERSONAL_LOOK.md](PERSONAL_LOOK.md). +owner-only decorative CSS avatar. See [Personal Agent appearance](PERSONAL_LOOK.md). -## Explicitly not in this slice +## Verification -- The observed 4-step onboarding (industry/role and later steps). Only the personal-agent/roster - effect is implemented; onboarding remains #130. -- A shared "对话 · 9" agent-only group. The current social model requires at least two human - members, so an agent-only group is not created here. -- Credits, `CREDIT`/`$CASH`, upgrade, pricing, or onboarding rewards (excluded by repository rule). -- Real vendor/container execution; replies still use the existing runtime infer contract and the - labeled fake-provider tests. -- Browser E2E and Teamily page-by-page comparison. Historical screenshots from the source repository are - synthetic review material. +See [onboarding](ONBOARDING.md) for the setup flow, [DS-Bot plugin architecture](DSBOT_PLUGIN_ARCHITECTURE.md) for native execution, and [acceptance records](ACCEPTANCE.md) for the checked environments. diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 4cbf1bd45..a2eefd468 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -6,10 +6,8 @@ Bot Social handles shared activity across accounts. DS-Bot v0.3.10 has passed the [two-account container upgrade and Chromium checks](ACCEPTANCE.md#verified-ds-bot-v0310-upgrade). The product goal is usable everyday workflows with responsive pages, clear -controls and fast interaction feedback. Compare each workflow with Teamily when -there is direct evidence for the same task and user role. The capability map -below describes the scope of work. [Acceptance records](ACCEPTANCE.md) record -which flows have passed. +controls and fast interaction feedback. [Acceptance records](ACCEPTANCE.md) +identify which flows have passed and the exact revisions tested. ## Functional domains @@ -40,12 +38,11 @@ independent features. interrupted requests. Verify mobile layouts and desktop keyboard access in Chromium alongside API tests. - Verify runtime upgrades with retained volumes and separate account sessions. - Keep deployment, browser and product-comparison evidence tied to tested - revisions. + Keep deployment and browser evidence tied to tested revisions. ## Existing planning input (historical, read-only) -An earlier requirement inventory and 11 work-package issues exist in [FlyBot #3110](https://github.com/ThinkFlowLab/FlyBot/issues/3110) and #3113–#3123. They are reference material only: the subsequent decision to create this independent repository supersedes their instructions to develop in the original repository and their fixed branding assumptions. Do not close, rewrite or extend those old issues as part of the new project. +[FlyBot #3110](https://github.com/ThinkFlowLab/FlyBot/issues/3110) and #3113–#3123 record the earlier requirement inventory and work packages. Use them as historical reference for how the current scope was developed. The earlier inventory provides functional requirements. Use the [architecture](DSBOT_PLUGIN_ARCHITECTURE.md) for current plugin boundaries and diff --git a/docs/inventory/visible-controls.json b/docs/inventory/visible-controls.json index 6f1bfee09..544b161f2 100644 --- a/docs/inventory/visible-controls.json +++ b/docs/inventory/visible-controls.json @@ -166,7 +166,7 @@ "backend_state": "Original static help documentation landed on main in contributor PR 307", "execution_path": "settings_page allowlist -> served help page and real internal navigation", "verification": "Individual control unverified unless explicitly exercised; route evidence: tests/docs_pages.test.mjs and tests/test_docs_pages.py", - "external_dependency_or_gap": "Teamily scene parity and every help scenario unverified", + "external_dependency_or_gap": "Individual help scenarios require browser verification", "checklist": "docs/VISIBLE_FUNCTIONS_INVENTORY.md" }, "terms": { @@ -190,7 +190,7 @@ "backend_state": "Original static branding/version/license information", "execution_path": "Static served page and real repository links", "verification": "Individual control unverified unless explicitly exercised; route evidence: Existing branding/page suites and CI scene", - "external_dependency_or_gap": "No Teamily assets; full scene parity unverified", + "external_dependency_or_gap": "Individual branding and link states remain unverified", "checklist": "docs/VISIBLE_FUNCTIONS_INVENTORY.md" }, "download": { @@ -2473,8 +2473,8 @@ {"source": "flybot_workspace/static/discover/comments.mjs", "line": 84, "construction": "const button = document.createElement('button');", "execution_profile": "discover", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/discover/document-reader.mjs", "line": 14, "construction": "const retry = document.createElement('button');", "execution_profile": "discover", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/discover/followed-creators.mjs", "line": 39, "construction": "const button = document.createElement('button');", "execution_profile": "discover", "verification": "unverified dynamic construction site; conditional instances require execution"}, - {"source": "flybot_workspace/static/guide/app.mjs", "line": 330, "construction": "const button = document.createElement('button');", "execution_profile": "guide", "verification": "unverified dynamic construction site; conditional instances require execution"}, - {"source": "flybot_workspace/static/guide/app.mjs", "line": 383, "construction": "const button = document.createElement('button');", "execution_profile": "guide", "verification": "unverified dynamic construction site; conditional instances require execution"}, + {"source": "flybot_workspace/static/guide/app.mjs", "line": 328, "construction": "const button = document.createElement('button');", "execution_profile": "guide", "verification": "unverified dynamic construction site; conditional instances require execution"}, + {"source": "flybot_workspace/static/guide/app.mjs", "line": 381, "construction": "const button = document.createElement('button');", "execution_profile": "guide", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/home/app.mjs", "line": 371, "construction": "const retry = document.createElement('button');", "execution_profile": "home", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/home/app.mjs", "line": 377, "construction": "const back = document.createElement('a');", "execution_profile": "home", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/meetings/app.mjs", "line": 145, "construction": "const link = document.createElement('a');", "execution_profile": "meetings", "verification": "unverified dynamic construction site; conditional instances require execution"}, @@ -2544,7 +2544,7 @@ {"source": "flybot_workspace/static/settings/connected-tools.mjs", "line": 46, "construction": "const button = document.createElement('button')", "execution_profile": "settings", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/settings/custom-mcp.mjs", "line": 23, "construction": "const remove = document.createElement('button')", "execution_profile": "settings", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/shell/app.mjs", "line": 261, "construction": "link = doc.createElement('a');", "execution_profile": "shell", "verification": "unverified dynamic construction site; conditional instances require execution"}, - {"source": "flybot_workspace/static/shell/app.mjs", "line": 439, "construction": "const skip = document.createElement('a');", "execution_profile": "shell", "verification": "unverified dynamic construction site; conditional instances require execution"}, + {"source": "flybot_workspace/static/shell/app.mjs", "line": 437, "construction": "const skip = document.createElement('a');", "execution_profile": "shell", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/shell/dsbot-api.mjs", "line": 219, "construction": "const link = win.document.createElement('a');", "execution_profile": "shell", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/shell/markdown.mjs", "line": 171, "construction": "const el = document.createElement('a');", "execution_profile": "shell", "verification": "unverified dynamic construction site; conditional instances require execution"}, {"source": "flybot_workspace/static/shell/markdown.mjs", "line": 203, "construction": "const checkbox = document.createElement('input');", "execution_profile": "shell", "verification": "unverified dynamic construction site; conditional instances require execution"}, @@ -2567,12 +2567,12 @@ {"source": "flybot_workspace/static/team/app.mjs", "line": 440, "construction": "const mail = document.createElement('a');", "execution_profile": "team", "verification": "unverified dynamic construction site; conditional instances require execution"} ], "server_template_controls": [ - {"source": "flybot_workspace/agents.py", "line": 370, "tag": "button", "id": null, "name": null, "href": null, "type": "button", "label": "未接通:公开主页不会发送消息。 Send", "initially_disabled": true, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, - {"source": "flybot_workspace/agents.py", "line": 507, "tag": "a", "id": null, "name": null, "href": "/agents", "type": null, "label": "打开工作区智能体页。公开主页不会直接创建智能体。 Create your own Agent", "initially_disabled": false, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, - {"source": "flybot_workspace/agents.py", "line": 418, "tag": "button", "id": null, "name": null, "href": null, "type": "button", "label": " Web", "initially_disabled": true, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, - {"source": "flybot_workspace/agents.py", "line": 488, "tag": "button", "id": null, "name": null, "href": null, "type": "button", "label": "未接通:公开主页还不能连接即时通讯渠道。 Channels", "initially_disabled": true, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, - {"source": "flybot_workspace/agents.py", "line": 376, "tag": "a", "id": null, "name": null, "href": "/chat", "type": null, "label": "FlyBot FlyBot", "initially_disabled": false, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, - {"source": "flybot_workspace/composio.py", "line": 536, "tag": "a", "id": null, "name": null, "href": "/settings/connectors", "type": null, "label": " 应用连接器", "initially_disabled": false, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"} + {"source": "flybot_workspace/agents.py", "line": 358, "tag": "button", "id": null, "name": null, "href": null, "type": "button", "label": "未接通:公开主页不会发送消息。 Send", "initially_disabled": true, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, + {"source": "flybot_workspace/agents.py", "line": 495, "tag": "a", "id": null, "name": null, "href": "/agents", "type": null, "label": "打开工作区智能体页。公开主页不会直接创建智能体。 Create your own Agent", "initially_disabled": false, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, + {"source": "flybot_workspace/agents.py", "line": 406, "tag": "button", "id": null, "name": null, "href": null, "type": "button", "label": " Web", "initially_disabled": true, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, + {"source": "flybot_workspace/agents.py", "line": 476, "tag": "button", "id": null, "name": null, "href": null, "type": "button", "label": "未接通:公开主页还不能连接即时通讯渠道。 Channels", "initially_disabled": true, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, + {"source": "flybot_workspace/agents.py", "line": 364, "tag": "a", "id": null, "name": null, "href": "/chat", "type": null, "label": "FlyBot FlyBot", "initially_disabled": false, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"}, + {"source": "flybot_workspace/composio.py", "line": 535, "tag": "a", "id": null, "name": null, "href": "/settings/connectors", "type": null, "label": " 应用连接器", "initially_disabled": false, "data": {}, "execution_profile": "server", "verification": "unverified individual control/state; route-level evidence is not universal acceptance"} ], "routes": { "flybot_workspace/static/about/index.html": { diff --git a/docs/media/overview.webp b/docs/media/overview.webp new file mode 100644 index 000000000..6b66b06c0 Binary files /dev/null and b/docs/media/overview.webp differ diff --git a/flybot_workspace/agents.py b/flybot_workspace/agents.py index 0211c7afe..1cc804a9e 100644 --- a/flybot_workspace/agents.py +++ b/flybot_workspace/agents.py @@ -1,19 +1,7 @@ -"""Workspace agent directory and public homepages (issue #6). - -Self-written for FlyBot; no upstream or Teamily source. Teamily's -create flow and Auto / Instant / Agentic mode differences were not fully -observed, so this slice does not invent modes or embeddable conversations. -Public homepages are unlisted share links: name, summary, and optional -owner-set quick starts only, never instructions. The public HTML follows -the recorded profile typography (identity, talk-via, start-a-conversation -list, a web-conversation panel with typography-only quick-start cards, -and a create footer that links to the existing /agents page) but does -not copy Teamily marks, a verified badge, LIVE state, or the recorded -official Teamily Agent prompts. The public page still does not run a -conversation, send a starter, or call a model. These -records live in the management database only: the management process -does not run agents. Container execution, embed routes, and Teamily -comparison remain later slices and must not be claimed from these tests. +"""Workspace agent metadata and public homepages. + +An unlisted homepage shows the agent name, summary, and optional quick starts. +Management holds metadata while agent execution belongs to DS-Bot. """ from html import escape import re diff --git a/flybot_workspace/app.py b/flybot_workspace/app.py index d256409e7..433bcd88f 100644 --- a/flybot_workspace/app.py +++ b/flybot_workspace/app.py @@ -1176,7 +1176,10 @@ def manager_dispatch(self, env, manager, method, path, query): body = self.body(env, ['job_id', 'observed_revision', 'lease']) if set(body) != {'job_id', 'observed_revision', 'lease'} or not isinstance(body['job_id'], str) or not re.fullmatch(r'[0-9a-f]{32}', body['job_id']): refuse(400, 'invalid', 'Incomplete or invalid manager observation') - return 200, runtime.runtime_secret(manager, secret[1], body['job_id'], body['observed_revision'], body['lease'], http_policy=self.model_http_policy, capability=env.get('HTTP_X_OPENTEAMILY_MODEL_HTTP')), [] + from .model_http_policy import WSGI_HEADER + return 200, runtime.runtime_secret( + manager, secret[1], body['job_id'], body['observed_revision'], body['lease'], + http_policy=self.model_http_policy, capability=env.get(WSGI_HEADER)), [] collaboration = re.fullmatch(r'/v1/internal/instances/([0-9a-f]{32})/runtime-bot-social', path) if collaboration and method == 'POST' and not query: body = self.body(env, ['job_id', 'observed_revision', 'lease']) diff --git a/flybot_workspace/artifacts.py b/flybot_workspace/artifacts.py index daab8a143..90c97791a 100644 --- a/flybot_workspace/artifacts.py +++ b/flybot_workspace/artifacts.py @@ -1,11 +1,7 @@ -"""Workspace artifacts (issue 9, second slice). - -Self-written for FlyBot; no upstream or Teamily source, fonts or -marketing copy. This slice adds media uploads and structured whiteboards -with real persistence, in addition to documents, websites, provenance and -explicit revocable shares. It is not a works-library parity claim and not -browser E2E acceptance. Management has no message store, so message-to-library -is not implemented here. +"""Workspace documents, websites, media uploads, and whiteboards. + +This metadata store records provenance and revocable sharing. DS-Bot owns +live message history. """ import hashlib import json diff --git a/flybot_workspace/automations.py b/flybot_workspace/automations.py index 6caaa2d08..aeb8838e9 100644 --- a/flybot_workspace/automations.py +++ b/flybot_workspace/automations.py @@ -1,12 +1,4 @@ -"""Workspace automations persistence (issue #6, slice 1). - -Self-written for FlyBot; no FlyBot Project plugin, Bot Social, DS-Bot or -Teamily source. Schedule kinds, the twelve work templates, and the tag -compiler follow the 2026-11-16 round-1 Teamily contrast. Titles are -rephrased; this is not a verbatim copy and not automation parity. Life -templates were not captured. Scheduling and run records live in -scheduler.py; run records can now carry a durable agent result. This module still does not execute containers. -""" +"""Workspace automation templates, schedules, and run records.""" import json import re from datetime import date, datetime diff --git a/flybot_workspace/bot_social.py b/flybot_workspace/bot_social.py index 69a69d08e..ce97620ff 100644 --- a/flybot_workspace/bot_social.py +++ b/flybot_workspace/bot_social.py @@ -1,9 +1,7 @@ """Platform and workspace Bot Social collaboration endpoint. -Management records only a validated server URL (and optional display name). -Connector tokens stay on the instance volume after onboarding; they are never -accepted, stored, or returned here. Workspace override wins over the platform -default. Self-written; not a Teamily parity claim. +A workspace override can replace the platform server URL and display name. +Connector credentials live on the instance volume. """ from urllib.parse import urlsplit diff --git a/flybot_workspace/ci_ui_fixtures.py b/flybot_workspace/ci_ui_fixtures.py index 7b23c446d..bcbe9190a 100644 --- a/flybot_workspace/ci_ui_fixtures.py +++ b/flybot_workspace/ci_ui_fixtures.py @@ -1,8 +1,7 @@ -"""Synthetic, clearly labeled fixtures for CI screenshots of the management UI. +"""Synthetic fixtures for CI screenshots of the management UI. -Throwaway data only. Never log or return passwords, session cookies, invite -tokens, runtime keys, or public homepage tokens. Not a Teamily or production -dataset. +Passwords, session cookies, invite tokens, runtime keys, and public homepage +tokens stay out of logs and fixture responses. """ from datetime import datetime, timezone import os diff --git a/flybot_workspace/composio.py b/flybot_workspace/composio.py index 424d12709..acfcc5c94 100644 --- a/flybot_workspace/composio.py +++ b/flybot_workspace/composio.py @@ -15,8 +15,7 @@ - GET /connected_accounts?user_ids=... a user's connected accounts - DELETE /connected_accounts/{nanoid} disconnect -Self-written; no upstream, Composio SDK or Teamily source. No brand logos are -fetched or returned. +Toolkit metadata is returned without external logo assets. """ import json import re diff --git a/flybot_workspace/discover.py b/flybot_workspace/discover.py index 460f23570..399777432 100644 --- a/flybot_workspace/discover.py +++ b/flybot_workspace/discover.py @@ -1,11 +1,7 @@ -"""Opt-in public agent catalog (issue #87). - -Self-written for FlyBot; no upstream or Teamily source. Only workspace -owners/admins can list an agent. The public listing exposes a whitelisted -name/summary/slug projection and never instructions, workspace ids or tokens. -This is not Teamily Discover parity: there is no recommendation, ranking, -follow, like or federation support. An opt-in public works feed can list -voluntarily published artifacts without inventing engagement counts. +"""Opt-in public catalogs for agents and published works. + +Workspace owners and admins publish listings. The public projection exposes +only allowlisted fields. """ import re diff --git a/flybot_workspace/dsbot_bundle.py b/flybot_workspace/dsbot_bundle.py index e4f5aea8c..094ee1bb9 100644 --- a/flybot_workspace/dsbot_bundle.py +++ b/flybot_workspace/dsbot_bundle.py @@ -225,7 +225,10 @@ def build_personal_bootstrap(db, user_id, instance_id, now): messages = db.execute( 'SELECT * FROM agent_messages WHERE conversation_id=? AND seq=1 AND role=?', (welcome['id'], 'assistant')).fetchall() if welcome else [] - raw = {'personal_agents': [binding], 'workspace_agents': roster, + builtins = db.execute( + 'SELECT agent_id, workspace_id, builtin_key FROM builtin_agents WHERE workspace_id=? ORDER BY agent_id', + (workspace,)).fetchall() + raw = {'personal_agents': [binding], 'workspace_agents': roster, 'builtin_agents': builtins, 'agent_conversations': [welcome] if welcome else [], 'agent_messages': messages} tables = {name: canonical([dict(row) for row in rows]) for name, rows in raw.items()} manifest = {name: {'rows': len(raw[name]), 'sha256': hashlib.sha256(text.encode('utf-8')).hexdigest()} diff --git a/flybot_workspace/invites.py b/flybot_workspace/invites.py index 7353becd1..fc78b3a21 100644 --- a/flybot_workspace/invites.py +++ b/flybot_workspace/invites.py @@ -1,11 +1,4 @@ -"""Workspace invite links (issue #5, slice 1). - -Self-written for FlyBot; no upstream or Teamily source. Teamily pricing -copy mentioned joining by invite link, and a chat-bar Invite entry was seen, -but no invite was created or accepted and wizard steps 2/3 were not opened. -Credits-center invite codes are a different, unpaid-referral feature and are -not implemented here. These defaults are not Teamily parity. -""" +"""Workspace invite links and membership approval.""" SCHEMA = ''' CREATE TABLE IF NOT EXISTS workspace_invites ( @@ -37,9 +30,7 @@ UNIQUE(workspace_id, user_id)); ''' -# Approval and freeze (issue #5): an invite may require an owner/admin decision -# before membership, and may be frozen (paused) without being revoked. These -# are FlyBot semantics; Teamily approval behaviour was not observed. +# An invite can require owner or admin approval and can be paused independently. TOKEN = __import__('re').compile(r'[A-Za-z0-9_-]{32,128}') diff --git a/flybot_workspace/manager/client.py b/flybot_workspace/manager/client.py index f43824ee7..1f8346455 100644 --- a/flybot_workspace/manager/client.py +++ b/flybot_workspace/manager/client.py @@ -7,6 +7,7 @@ from urllib.parse import urlsplit, urlencode from ..dsbot_bundle import FORMAT as BUNDLE_FORMAT +from ..model_http_policy import FORMAT as HTTP_POLICY_FORMAT, HEADER as HTTP_POLICY_HEADER, valid_grant from .safety import ManagerError, require, json_loads HEX = re.compile(r'[0-9a-f]{32}') @@ -73,7 +74,7 @@ def abort(): conn.request(method, path, body=body, headers={ 'Host': self.host_header, 'Authorization': f'Bearer {self.manager_id}.{self._token}', 'Content-Type': 'application/json', 'Accept': 'application/json', 'Connection': 'close', - 'X-FlyBot-Workspace-Model-HTTP': 'flybot-workspace.exact-http-task.v1'}) + HTTP_POLICY_HEADER: HTTP_POLICY_FORMAT}) response = conn.getresponse() raw = response.read(131073) require(len(raw) <= 131072, 'response_limit') @@ -182,7 +183,6 @@ def runtime_secret(self, iid, claim): require(isinstance(doc[key], str) and doc[key], 'secret_shape') require(doc['source'] in ('platform', 'user'), 'secret_shape') from .. import model_api - from ..model_http_policy import valid_grant grant = doc.get('http_endpoint_grant') require(valid_grant(doc['base_url'], grant) if 'http_endpoint_grant' in doc else model_api.valid_base_url(doc['base_url']), 'model_endpoint') return doc diff --git a/flybot_workspace/meetings.py b/flybot_workspace/meetings.py index b8915dd00..2c32d1747 100644 --- a/flybot_workspace/meetings.py +++ b/flybot_workspace/meetings.py @@ -1,10 +1,5 @@ -"""Workspace meeting notes and action items (issue #212). - -Self-written for FlyBot; no upstream or Teamily source. This slice stores -manual meeting notes only: title, start time, attendees, transcript, summary and -action items. It does not record audio/video, transcribe, diarize, or dispatch -action items to agents. The existing /space meeting chrome is reused, not -reimplemented. +"""Workspace meeting records with titles, start times, attendees, transcript, +summary, and action items. """ from datetime import datetime, timezone import json diff --git a/flybot_workspace/members.py b/flybot_workspace/members.py index 3b7bcbb33..2b6d17072 100644 --- a/flybot_workspace/members.py +++ b/flybot_workspace/members.py @@ -1,9 +1,4 @@ -"""Workspace membership and roles (issue #7, slice 1). - -Self-written for FlyBot; no upstream or Teamily source. Roles and -permission defaults below are FlyBot choices. Teamily team creation, -invites and role behavior have not been compared yet; do not claim parity. -""" +"""Workspace membership, roles, and permission defaults.""" SCHEMA = ''' CREATE TABLE IF NOT EXISTS workspace_members ( @@ -24,7 +19,7 @@ # A suspended member keeps their membership row (role, history, authored data) # but loses all workspace access until an owner/admin resumes them. The owner can -# never be suspended. FlyBot semantics; Teamily freeze behaviour not observed. +# never be suspended. ACTIVE = ('(SELECT workspace_id FROM workspace_members WHERE user_id=? AND NOT EXISTS ' '(SELECT 1 FROM workspace_member_suspensions s WHERE s.workspace_id=workspace_members.workspace_id ' 'AND s.user_id=workspace_members.user_id))') diff --git a/flybot_workspace/memory.py b/flybot_workspace/memory.py index 1d1eff72e..99c1ec10e 100644 --- a/flybot_workspace/memory.py +++ b/flybot_workspace/memory.py @@ -1,12 +1,7 @@ -"""Workspace memory pages, next actions, and the relationship graph (issue 8). - -Self-written for FlyBot; no upstream, Timeline, Project, or Teamily -source, fonts or marketing copy. Pages, next actions, topics and links are -workspace-scoped. Pages and actions persist on create and can be edited or -deleted. The graph is derived from optional page topics, [[Title]] mentions -in page bodies, and optional manual links. Export covers one saved page as a -Markdown file; it is not a workspace export, a share link, a profile, or -Teamily memory parity, and it is not browser E2E acceptance. +"""Workspace memory pages, next actions, and the relationship graph. + +The graph derives edges from page topics, [[Title]] references, and manual +links. A saved page can be exported as Markdown. """ from datetime import datetime, timezone import json diff --git a/flybot_workspace/model_api.py b/flybot_workspace/model_api.py index fc5cc9709..baa154b88 100644 --- a/flybot_workspace/model_api.py +++ b/flybot_workspace/model_api.py @@ -1,16 +1,8 @@ """Per-account and per-workspace model API configuration. -FlyBot does not implement Teamily account credits, billing or usage limits. -A self-host operator configures a platform default model API; accounts and -workspaces may optionally override it. Resolution is override-if-set, else the -platform default. -The key is stored only as a wrapped blob in the private data directory, never -returned by the API. Runtime hooks receive it in-process. The compose manager -writes the already-resolved key to a private 0600 file and bind-mounts it into -the container at start; the key is not placed in claim or observe JSON. - -Self-written; no upstream or Teamily source. Provider names and URL rules are -FlyBot defaults and are not Teamily parity. +An operator configures a platform default; accounts and workspaces may +override it. Management stores a wrapped key. The compose manager writes +the resolved key to a private file and mounts it into the instance at startup. """ import hmac import hashlib diff --git a/flybot_workspace/model_http_policy.py b/flybot_workspace/model_http_policy.py index 27ec4ef3f..d5685e7fa 100644 --- a/flybot_workspace/model_http_policy.py +++ b/flybot_workspace/model_http_policy.py @@ -15,7 +15,7 @@ FORMAT = 'flybot-workspace.exact-http-task.v1' HEADER = 'X-FlyBot-Workspace-Model-HTTP' -WSGI_HEADER = 'HTTP_X_OPENTEAMILY_MODEL_HTTP' +WSGI_HEADER = 'HTTP_' + HEADER.upper().replace('-', '_') # Keep in sync with runtime/flybot-image/model-http-policy.mjs. Use an explicit # conservative union, not is_global alone (multicast is_global is True on some # Python versions). IPv6, including mapped IPv4, is intentionally unsupported. diff --git a/flybot_workspace/notifications.py b/flybot_workspace/notifications.py index 1d1f697ad..ade0f5228 100644 --- a/flybot_workspace/notifications.py +++ b/flybot_workspace/notifications.py @@ -1,11 +1,8 @@ -"""Workspace notification center: @mentions in messenger conversations (issues #4 #86). - -Self-written for FlyBot; no upstream or Teamily source. A notification is -created only when a human message names another human member of the same -conversation as ``@username``. Visibility is re-checked on every read: a -recipient who left the conversation or a retracted message stops showing. -Group agent request completion and due message reminders are also listed. -Work shares and creator publication notices live on Bot Social. +"""Workspace notifications for messages, group agent requests, and reminders. + +A mention requires a human sender and recipient in the same conversation. +Visibility is checked again on every read. Work shares and creator notices +come from Bot Social. """ import json import re diff --git a/flybot_workspace/oidc.py b/flybot_workspace/oidc.py index 3a6d29d51..fe598103a 100644 --- a/flybot_workspace/oidc.py +++ b/flybot_workspace/oidc.py @@ -3,7 +3,6 @@ Authorization Code + PKCE, state and nonce checks, verified-email only. Operator-configured client secrets stay in a private file, never in the repository, JSON responses or logs. Disabled providers are omitted. -Self-written; no upstream or Teamily source. Not identity-provider parity. """ import base64 import hashlib diff --git a/flybot_workspace/onboarding.py b/flybot_workspace/onboarding.py index 93331d80f..a9fdbe56c 100644 --- a/flybot_workspace/onboarding.py +++ b/flybot_workspace/onboarding.py @@ -1,11 +1,6 @@ -"""Work-context onboarding (industry and role). - -Self-written for FlyBot; no upstream or Teamily prompt source. The 2026-11-18 -real-account walk captured the four onboarding steps (work context, app -connectors, automation picks, Personal Agent look). This slice implements only -the captured work-context step and stores it for later recommendations. -Connectors are intentionally out of scope (Birfy/Bot Social territory); the -automation and avatar steps remain pending. +"""Work-context onboarding for industry and role. + +The stored context supports later workspace recommendations. """ import json import re @@ -105,13 +100,8 @@ def load(db, user_id): return db.execute('SELECT * FROM user_onboarding WHERE user_id=?', (user_id,)).fetchone() -# Steps 2-4 (issue #130). The 2026-11-18 walk captured the step titles, the app -# list and the look attributes, but not a comparable layout, so this is a -# functional flow that has not been compared with Teamily. Step 2 lists apps -# honestly as not connected (no OAuth here); step 3 stores picks of self-written -# task/routine suggestions (saving never creates automations; an explicit opt-in -# button may create paused templates); step 4 stores the Personal -# Agent look. Recommendation copy and look option labels are self-written. +# App suggestions, automation picks, and the Personal Agent's appearance. +# A separate opt-in action creates paused automation templates. STEPS_SCHEMA = ''' CREATE TABLE IF NOT EXISTS user_onboarding_steps ( user_id TEXT PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE, diff --git a/flybot_workspace/personal.py b/flybot_workspace/personal.py index 10fe9abb2..10fc60e99 100644 --- a/flybot_workspace/personal.py +++ b/flybot_workspace/personal.py @@ -1,11 +1,7 @@ """Per-user Personal Agent and built-in agent roster (issue #130 / #1). -Self-written for FlyBot; no upstream or Teamily prompt source. The observed -Teamily account defaults to a "'s Personal Agent" plus a built-in -assistant roster. This slice creates an explicit personal workspace, the -personal agent, ten built-in assistant records and one welcome conversation. -It does not implement the 4-step onboarding, a shared "对话" agent-only group, -credits, or real vendor/container acceptance. +Create the personal workspace, the user's personal agent, ten built-in +assistant records, and a welcome conversation. """ import re @@ -41,8 +37,10 @@ class WorkspaceCapacity(ValueError): pass +WORKSPACE_ASSISTANT = ('flybot-assistant', 'FlyBot Assistant', 'FlyBot 平台助手', '帮助用户了解和使用平台功能。') + BUILTINS = ( - ('teamily-agent', 'Teamily Agent', 'Teamily 平台助手', '帮助用户了解和使用平台功能。'), + WORKSPACE_ASSISTANT, ('content-creator', 'Content Creator', '内容创作助手', '协助起草、改写和润色内容。'), ('finance-assistant', 'Finance Assistant', '财务助手', '帮助整理预算、账单与财务问题。'), ('health-assistant', 'Health Assistant', '健康助手', '提供一般性的健康与运动建议。'), @@ -72,6 +70,37 @@ def builtins(db, workspace_id): ).fetchall() + +def rebrand_builtin_assistant(db): + """Rename the built-in in place, including in existing personal workspaces.""" + from . import agents + + key, default_name, default_summary, _ = WORKSPACE_ASSISTANT + rows = db.execute( + 'SELECT b.workspace_id, a.id, a.name, a.summary FROM builtin_agents b ' + 'JOIN workspace_agents a ON a.id=b.agent_id WHERE b.builtin_key=?', + ('teamily-agent',), + ).fetchall() + for row in rows: + db.execute('UPDATE builtin_agents SET builtin_key=? WHERE agent_id=?', (key, row['id'])) + name, summary = row['name'], row['summary'] + if name == 'Teamily Agent': + name = default_name + suffix = 2 + while db.execute('SELECT 1 FROM workspace_agents WHERE workspace_id=? AND name_hash=?', + (row['workspace_id'], agents.name_hash(name))).fetchone(): + name = f'{default_name} {suffix}' + suffix += 1 + if summary == 'Teamily 平台助手': + summary = default_summary + if (name, summary) != (row['name'], row['summary']): + db.execute( + "UPDATE workspace_agents SET name=?, name_hash=?, summary=?, revision=revision+1, " + "updated=MAX(updated, CAST(strftime('%s','now') AS INTEGER)) WHERE id=?", + (name, agents.name_hash(name), summary, row['id']), + ) + + def _insert_agent(db, workspace_id, name, summary, instructions, user_id, key, now): from . import agents if not agents.valid_name(name) or not agents.valid_summary(summary) or not agents.valid_instructions(instructions): diff --git a/flybot_workspace/profiles.py b/flybot_workspace/profiles.py index aa5448222..c0896e6aa 100644 --- a/flybot_workspace/profiles.py +++ b/flybot_workspace/profiles.py @@ -1,10 +1,7 @@ -"""Self-service account profile and public handle projection. +"""Self-service account profiles and a public handle projection. -Self-written for FlyBot; no upstream or Teamily source. The observed 2026-11-18 -profile editor fields are the basis (name, FlyBot ID handle, bio, tags, gender, -location, website, private life goals, avatar). This slice implements the text -fields, private goals and the account avatar; social posts/follows/likes are not -included. The public projection never returns goals, email, or account ids. +The account owns its avatar, identity fields, and private life goals. +The public projection omits goals, email, and account IDs. """ import hashlib import json diff --git a/flybot_workspace/search.py b/flybot_workspace/search.py index 3477ab4eb..b057c3fe4 100644 --- a/flybot_workspace/search.py +++ b/flybot_workspace/search.py @@ -1,9 +1,7 @@ -"""Workspace-authorized message search (issue #88). +"""Workspace-authorized substring search with bounded pages. -Self-written for FlyBot; no upstream or Teamily source. Searches only the -messages the caller may already read: their own user↔agent conversations and -social conversations they belong to. It is a simple substring scan with a -bounded page, not a full-text index, ranking model or semantic search. +Search only the caller’s agent conversations and social conversations +they are allowed to read. """ import re diff --git a/flybot_workspace/settings.py b/flybot_workspace/settings.py index 9964a1bcd..1e7ea522c 100644 --- a/flybot_workspace/settings.py +++ b/flybot_workspace/settings.py @@ -1,10 +1,6 @@ -"""Per-account interface preferences (issue #4, domain 10). +"""Per-account interface preferences. -Self-written for FlyBot; no upstream or Teamily source. Option semantics -follow the 2026-11-16 Teamily contrasts (rounds 1 and 2). Teamily does not -expose locale codes; the codes below are our mapping of the recaptured labels. -Custom appearance period fields were not captured; start/end stay as HH:MM -and are unverified. Still not settings parity. +Locale codes are FlyBot mappings. Custom appearance times use HH:MM. """ import json import re @@ -15,7 +11,7 @@ document TEXT NOT NULL, revision INTEGER NOT NULL CHECK(revision >= 1), updated INTEGER NOT NULL); ''' -# Codes are FlyBot mappings of labels recaptured from Teamily's lists. +# Use stable FlyBot locale codes. LANGUAGES = ( 'en', 'fa', 'fr', 'de', 'es', 'it', 'pt-BR', 'ru', 'id', 'ms', 'hi', 'bn', 'th', 'ja', 'ko', 'zh-HK', 'zh-TW', 'zh-CN', diff --git a/flybot_workspace/settings_page.py b/flybot_workspace/settings_page.py index f520e2b48..398d2e475 100644 --- a/flybot_workspace/settings_page.py +++ b/flybot_workspace/settings_page.py @@ -1,7 +1,7 @@ """Same-origin management pages for the /v1 APIs (settings and automations). Serves only an exact asset allowlist. API security stays in App; this wrapper -does not interpret /v1 routes. Self-written; no upstream or Teamily source. +serves the settings and automations pages. """ from hashlib import sha256 import os diff --git a/flybot_workspace/social.py b/flybot_workspace/social.py index 2cd773ae6..6ffdbd06b 100644 --- a/flybot_workspace/social.py +++ b/flybot_workspace/social.py @@ -1,10 +1,6 @@ -"""Workspace human-to-human social messenger (issue #86). +"""Workspace conversation metadata for direct messages and groups. -Self-written for FlyBot; no upstream or Teamily source. This slice adds -direct messages and named group conversations between members of the same -workspace. Groups may persist agent members (not speakers). It does not add unread -counts, notifications, attachments or cross-workspace delivery. Those remain -separate issues; do not describe this as Teamily messenger parity. +Groups can include workspace agents as well as human members. """ import re @@ -119,7 +115,7 @@ PRIMARY KEY(message_id, user_id, emoji)); ''' -# Fixed, self-chosen reaction set (FlyBot default, not a Teamily copy). +# Default reaction set. REACTIONS = ('👍', '❤️', '😄', '🎉', '👀', '✅') KINDS = ('dm', 'group') diff --git a/flybot_workspace/static/about/app.css b/flybot_workspace/static/about/app.css index 64de39f64..d292fb801 100644 --- a/flybot_workspace/static/about/app.css +++ b/flybot_workspace/static/about/app.css @@ -52,20 +52,17 @@ body.about-page a:visited { color: #097845; } .about-wordmark:hover, .about-wordmark:visited { color: #1f2a24 !important; } .about-mark { display: inline-flex; align-items: center; justify-content: center; - width: 1.75rem; height: 1.75rem; border-radius: 50%; - background: #097845; color: #ffffff; + width: 1.75rem; height: 1.75rem; } -.about-mark .brand-glyph { width: 1.1rem; height: 1.1rem; } +.about-mark .brand-glyph { display: block; width: 100%; height: 100%; } .brand-wordmark-text { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.03em; } .about-cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; } .about-cover .about-mark { - width: 3.25rem; height: 3.25rem; background: rgb(255 255 255 / 16%); - color: #ffffff; + width: 3.25rem; height: 3.25rem; } -.about-cover .about-mark .brand-glyph { width: 2rem; height: 2rem; } .about-cover p { font-size: 1.25rem; letter-spacing: -0.03em; } /* The about article pins light colours; keep the skip link legible too diff --git a/flybot_workspace/static/agents/app.css b/flybot_workspace/static/agents/app.css index d574da0a0..ee9cb4dc6 100644 --- a/flybot_workspace/static/agents/app.css +++ b/flybot_workspace/static/agents/app.css @@ -1,5 +1,4 @@ -/* Agent directory: card grid + manage drawer. Structure follows the - 2026-11-17 Teamily visit; palette stays FlyBot tokens. */ +/* Agent directory card grid and management drawer. */ body.app-workspace #main-panel { display: flex; flex-direction: column; diff --git a/flybot_workspace/static/chat/app.css b/flybot_workspace/static/chat/app.css index df2356535..b64f7feff 100644 --- a/flybot_workspace/static/chat/app.css +++ b/flybot_workspace/static/chat/app.css @@ -1,7 +1,4 @@ -/* Independent /chat workspace. Structure follows the 2026-11-17 Teamily - visit (rail + ~350px session column + main canvas + bottom composer). - Colors stay FlyBot tokens. Non-empty message bubbles are an original - supplement and were not compared this round. */ +/* Chat workspace: navigation rail, conversation list, messages and composer. */ .visually-hidden, body.app-workspace > #status[data-announce-only="true"] { position: absolute; @@ -1449,7 +1446,7 @@ html[data-theme-resolved="dark"] { --ot-bubble-mine: var(--ot-accent-soft); } #message-scroller { background: linear-gradient(180deg, var(--ot-surface) 0%, var(--ot-surface-2) 100%); } #conversation-list .session-row[aria-current="true"], #conversation-list .session-row[aria-current="true"]:hover { box-shadow: none; } .chat-header .chat-title, #chat-title { font-size: .875rem; font-weight: 650; } -/* Recorded Teamily shows no persistent per-message toolbar: actions surface on hover/focus only. */ +/* Reveal message actions on hover or keyboard focus. */ @media (hover: hover) { #message-list > li > button, #message-list > li > .reaction-add, #message-list > li .reactions > .reaction-add, #message-list > li > .message-actions { opacity: 0; transition: opacity .12s ease; diff --git a/flybot_workspace/static/guide/app.mjs b/flybot_workspace/static/guide/app.mjs index 0f8f04d75..f672e04d9 100644 --- a/flybot_workspace/static/guide/app.mjs +++ b/flybot_workspace/static/guide/app.mjs @@ -13,7 +13,7 @@ export const CATEGORIES = [ {id: 'other', label: '其他'}, ]; -// FlyBot's own catalog. Do not copy Teamily guide prose or its 295-item counts. +// Guide entries for FlyBot pages. export const CATALOG = [ {id: 'open-chat', href: '/chat', category: 'chat', title: '打开聊天', body: '在左侧应用栏打开「聊天」,查看已经统一的会话列表。人与智能体的会话在同一页,不是单独的消息页。', path: ['应用栏', '聊天']}, {id: 'conversation-search', href: '/chat', category: 'chat', title: '会话内搜索', body: '在打开的会话标题栏里搜索当前会话中的已授权消息。这不是全站搜索面板。', path: ['聊天', '会话标题栏', '搜索']}, @@ -189,9 +189,7 @@ async function request(method, path, body) { return {status: response.status, body: payload}; } -// Original icons for FlyBot's own catalog. They follow the recorded -// Teamily guide placements (category chip, group title, row) and meanings, -// without copying Teamily artwork or its 295-item catalog. +// Category icons shared by filter chips, section titles, and guide rows. export const CATEGORY_ICON_PATHS = { all: 'M4 4h7v7H4V4zm9 0h7v7h-7V4zM4 13h7v7H4v-7zm9 0h7v7h-7v-7z', chat: 'M4 4h16v11H8.8L4 19.2V4zm2 2v9.2l2.1-1.7H18V6H6z', diff --git a/flybot_workspace/static/home/auth.css b/flybot_workspace/static/home/auth.css index 439884b11..df778a8c7 100644 --- a/flybot_workspace/static/home/auth.css +++ b/flybot_workspace/static/home/auth.css @@ -42,14 +42,11 @@ body.home-page:not(.home-signed-in):has(#main-panel[hidden]) { color: var(--ot-accent-hover); } -.auth-brand svg { +.auth-brand .brand-glyph { display: block; width: 2rem; height: 2rem; - padding: .16rem; - border-radius: .65rem; - background: var(--ot-accent); - color: var(--ot-on-accent); + flex: none; } body.home-page:not(.home-signed-in):has(#main-panel[hidden]) > #main { diff --git a/flybot_workspace/static/members/app.css b/flybot_workspace/static/members/app.css index 33706ac88..824ad8090 100644 --- a/flybot_workspace/static/members/app.css +++ b/flybot_workspace/static/members/app.css @@ -1,7 +1,4 @@ -/* Members, invites, join requests and the local team directory. - Row density and typography follow the shared Teamily-aligned - settings/list language. Inline confirm for remove / leave / revoke - is unchanged in behaviour. */ +/* Members, invites, join requests and the local team directory. */ body.app-workspace #main-panel { display: flex; diff --git a/flybot_workspace/static/onboarding/app.css b/flybot_workspace/static/onboarding/app.css index 9a9c9e266..cdcd38292 100644 --- a/flybot_workspace/static/onboarding/app.css +++ b/flybot_workspace/static/onboarding/app.css @@ -83,7 +83,7 @@ body.app-workspace:not(.chat-open) > main > #main-panel { min-width: 0; width: 1 /* Page parity layer (2026-11-19): recorded four-step onboarding — progress bars, card pickers for industry and role, app rows, grouped task cards and an avatar - customiser. Glyph tiles and the avatar are original drawings, not Teamily art. */ + customiser. FlyBot includes original glyph tiles and avatar artwork. */ body.app-workspace:not(.chat-open) > main > #main-panel { max-width: 34rem; padding: 2.5rem 1.25rem 3rem; } .onboarding-top { display: block; margin: 0 0 1.25rem; padding: 0; border: 0; background: transparent; box-shadow: none; min-height: 0; } .onboarding-step-label { margin: 0 0 .5rem; font-size: .75rem; color: var(--ot-muted); } diff --git a/flybot_workspace/static/settings/app.css b/flybot_workspace/static/settings/app.css index aba48d10b..877ad67e8 100644 --- a/flybot_workspace/static/settings/app.css +++ b/flybot_workspace/static/settings/app.css @@ -832,8 +832,7 @@ body.app-workspace > main > #settings-panel { max-width: 34rem; padding: clamp(1 #settings-panel .skill-form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .6rem; } #settings-panel .skill-empty { border: 0; box-shadow: none; background: var(--ot-surface-2, #f4f7f5); } -/* Original geometric connector marks. These are not vendor trademarks - and were not traced from Teamily, Google, or GitHub assets. */ +/* Geometric connector icons for the settings interface. */ .connector-mark { width: 2.25rem; height: 2.25rem; diff --git a/flybot_workspace/static/shell/app.css b/flybot_workspace/static/shell/app.css index 5ce0c0bc7..e4335dab8 100644 --- a/flybot_workspace/static/shell/app.css +++ b/flybot_workspace/static/shell/app.css @@ -604,8 +604,7 @@ pre { } } -/* App workspace chrome for /chat and the agent directory. - Structure follows the 2026-11-17 Teamily visit; colors stay FlyBot tokens. */ +/* Shared workspace layout for chat and the agent directory. */ body.app-workspace { display: grid; grid-template-columns: 5rem minmax(0, 1fr); @@ -1083,11 +1082,7 @@ body.app-workspace .account-menu { } body.app-workspace #login-panel { width: min(24rem, calc(100% - 2rem)); box-sizing: border-box; } -/* ------------------------------------------------------------------ - Page parity layer (2026-11-19). Original CSS recreating the spatial - rhythm seen in private read-only Teamily captures: quiet page ground, - one white rounded canvas, 14px UI type, soft pill controls. No Teamily - pixels, icons, fonts or logos are used. */ +/* Shared workspace typography and page surfaces. */ body.app-workspace { font-size: .875rem; line-height: 1.5; } body.app-workspace > main { margin: .375rem .375rem .375rem 0; @@ -1140,8 +1135,8 @@ body.app-workspace > .app-rail .brand-mark { } body.app-workspace > .app-rail .brand-mark .brand-glyph { display: block; - width: 1.85rem; - height: 1.85rem; + width: 100%; + height: 100%; } html[data-theme-resolved="dark"] body.app-workspace > .app-rail > a.brand-mark:hover { background: var(--ot-accent-hover); @@ -1571,9 +1566,9 @@ body.app-workspace > .app-rail { body.app-workspace > .app-rail > .brand-mark, html[data-theme-resolved="dark"] body.app-workspace > .app-rail > .brand-mark { - border: 1px solid var(--ot-glass-line); - border-radius: .8rem; - background: #f4f7ff; + border: 0; + border-radius: .6rem; + background: transparent; box-shadow: var(--ot-shadow-sm); } diff --git a/flybot_workspace/static/shell/app.mjs b/flybot_workspace/static/shell/app.mjs index e55d26226..d865c31a9 100644 --- a/flybot_workspace/static/shell/app.mjs +++ b/flybot_workspace/static/shell/app.mjs @@ -282,9 +282,7 @@ export function ensureOnboardingMenuItem(doc) { return placeMenuLink(menu, link, reference); } -/* Recorded Teamily account menu has Agent 渠道 and 应用连接器 after 创建团队 - (and the skipped credit/plan rows) and before 新手引导/帮助. Both pages already - exist; this only adds navigation. Connector account linking stays unconnected. */ +/* Place channel and connector links above the guide and help links. */ export function ensureChannelsAndConnectorsMenuItems(doc) { const menu = doc.getElementById('account-menu'); if (!menu) return null; diff --git a/flybot_workspace/static/shell/flybot-logo.svg b/flybot_workspace/static/shell/flybot-logo.svg index 9d45f98cd..7f5b301cf 100644 --- a/flybot_workspace/static/shell/flybot-logo.svg +++ b/flybot_workspace/static/shell/flybot-logo.svg @@ -1 +1,21 @@ - + + + + + + + + + + + + + + + + + + + + + diff --git a/flybot_workspace/static/shell/thumb.mjs b/flybot_workspace/static/shell/thumb.mjs index a41e43b48..2bd010067 100644 --- a/flybot_workspace/static/shell/thumb.mjs +++ b/flybot_workspace/static/shell/thumb.mjs @@ -1,6 +1,6 @@ // Work thumbnails drawn from the server's text-only preview model. // Text goes through textContent and shapes through SVG attributes, so stored -// HTML is never interpreted. Self-written; no Teamily assets. +// HTML is never interpreted. const SVG = 'http://www.w3.org/2000/svg'; const COLOR = /^#[0-9a-fA-F]{6}$/; diff --git a/flybot_workspace/store.py b/flybot_workspace/store.py index c3a9c6887..bf05d2a31 100644 --- a/flybot_workspace/store.py +++ b/flybot_workspace/store.py @@ -53,7 +53,9 @@ def __init__(self, data_dir): if version == 0 and db.execute("SELECT name FROM sqlite_master WHERE type='table'").fetchone(): raise ValueError('Unrecognized non-empty database; refusing initialization') db.execute('PRAGMA journal_mode=WAL') - db.executescript('BEGIN IMMEDIATE;\n' + SCHEMA + settings.SCHEMA + members.SCHEMA + automations.SCHEMA + invites.SCHEMA + model_api.SCHEMA + oidc.SCHEMA + skill_installs.SCHEMA + skill_secrets.SCHEMA + teams.SCHEMA + retired_task_schema.SCHEMA + bot_social.SCHEMA + artifacts.SCHEMA + memory.SCHEMA + agents.SCHEMA + conversations.SCHEMA + social.SCHEMA + notifications.SCHEMA + discover.SCHEMA + profiles.SCHEMA + onboarding.SCHEMA + personal.SCHEMA + meetings.SCHEMA + team_directory.SCHEMA + composio.SCHEMA + custom_mcp.SCHEMA + message_utilities.SCHEMA + skill_packages.SCHEMA + '\nPRAGMA user_version=1;\nCOMMIT;') + db.executescript('BEGIN IMMEDIATE;\n' + SCHEMA + settings.SCHEMA + members.SCHEMA + automations.SCHEMA + invites.SCHEMA + model_api.SCHEMA + oidc.SCHEMA + skill_installs.SCHEMA + skill_secrets.SCHEMA + teams.SCHEMA + retired_task_schema.SCHEMA + bot_social.SCHEMA + artifacts.SCHEMA + memory.SCHEMA + agents.SCHEMA + conversations.SCHEMA + social.SCHEMA + notifications.SCHEMA + discover.SCHEMA + profiles.SCHEMA + onboarding.SCHEMA + personal.SCHEMA + meetings.SCHEMA + team_directory.SCHEMA + composio.SCHEMA + custom_mcp.SCHEMA + message_utilities.SCHEMA + skill_packages.SCHEMA + '\nPRAGMA user_version=1;') + personal.rebrand_builtin_assistant(db) + db.commit() @contextmanager def connect(self): diff --git a/flybot_workspace/team_directory.py b/flybot_workspace/team_directory.py index 6f091117d..8f426f77f 100644 --- a/flybot_workspace/team_directory.py +++ b/flybot_workspace/team_directory.py @@ -1,11 +1,7 @@ -"""Public team directory and search (issues #5 #86). +"""Public team directory for signed-in accounts. -Self-written for FlyBot; no Teamily layout evidence for this surface, so it -is a functional flow that has not been compared with Teamily. An owner may list -a workspace with a short summary. Any signed-in account on this instance can -search listed teams and ask to join; joining always goes through the existing -owner/admin approval queue, backed by an approval-required member invite that -the listing owns. Nothing is visible to anonymous visitors. +An owner can list a workspace with a short summary. A request to join uses the +workspace’s membership approval queue. """ import re diff --git a/flybot_workspace/team_templates.py b/flybot_workspace/team_templates.py index 360a3449b..d5dbc2cf7 100644 --- a/flybot_workspace/team_templates.py +++ b/flybot_workspace/team_templates.py @@ -1,10 +1,7 @@ -"""AI agent team templates (issues #7 #89). +"""Built-in agent team templates. -Self-written for FlyBot; no upstream or Teamily source, names or prompts. -Applying a template creates (or reuses same-name) workspace agents and one group -conversation with the requesting member plus those agents. Agents speak only on -the selected #124 single-explicit-request protocol; nothing runs automatically. -Public team directory/search and multi-agent orchestration remain pending. +Applying a template creates or reuses workspace agents and creates a group +with the requesting member. """ TEMPLATES = ( diff --git a/flybot_workspace/teams.py b/flybot_workspace/teams.py index 5be8ad55f..177496342 100644 --- a/flybot_workspace/teams.py +++ b/flybot_workspace/teams.py @@ -1,9 +1,4 @@ -"""Team profiles and the create/convert wizard (round-1 contrast). - -Self-written for FlyBot; no Teamily source. Name length, Team ID pattern -and "new workspace vs convert current" follow the 2026-11-16 contrast. Roles -and invites were not comparable on a free personal account. Not team parity. -""" +"""Team profiles and the create or convert workspace wizard.""" import re SCHEMA = ''' diff --git a/runtime/ds-bot-upstream.pin.json b/runtime/ds-bot-upstream.pin.json index 7402d9c1a..4d63b7cc3 100644 --- a/runtime/ds-bot-upstream.pin.json +++ b/runtime/ds-bot-upstream.pin.json @@ -7,7 +7,7 @@ "committed": "2026-11-22T18:25:36+08:00", "version": "0.3.10", "dsh": "0.2.2-rc.1", - "note": "runtime/ds-bot-upstream/ is byte-identical to upstream : (git object ids below). Never edit it; OpenTeamily changes live outside it (see runtime/ds-bot-upstream/UPSTREAM.md). Update with: node scripts/ds-bot-upstream.mjs sync ", + "note": "runtime/ds-bot-upstream/ is byte-identical to upstream : (git object ids below). Never edit it; FlyBot changes live outside it (see runtime/ds-bot-upstream/UPSTREAM.md). Update with: node scripts/ds-bot-upstream.mjs sync ", "paths": { "ds-bot": { "type": "tree", diff --git a/runtime/flybot-image/README.md b/runtime/flybot-image/README.md index f560f28e4..9dfee0981 100644 --- a/runtime/flybot-image/README.md +++ b/runtime/flybot-image/README.md @@ -37,6 +37,7 @@ From the repository root (context is `runtime/`): dsh=$(node -p "require('./runtime/ds-bot-upstream.pin.json').dsh") docker build -f runtime/flybot-image/Dockerfile \ --build-arg "DSH_VERSION=$dsh" \ + --build-context flybot-workspace-static=flybot_workspace/static \ -t flybot-workspace-flybot:local \ runtime ``` @@ -52,12 +53,9 @@ is generated into the same artifact. None of that is legal clearance. ## What this slice does not claim -- Related tracking remains open: [issue 3](https://github.com/openTeamily/openTeamily/issues/3), - [issue 1](https://github.com/openTeamily/openTeamily/issues/1), and - [issue 5](https://github.com/openTeamily/openTeamily/issues/5). - DeepSeek Harness `0.2.2-rc.1`, the Node/Debian base image, and third-party - notices still need review before a public image release. The CI inventory - is evidence collection, not legal clearance. +- Review DeepSeek Harness `0.2.2-rc.1`, the Node/Debian base image, and + third-party notices before publishing an image. See the repository + [licensing documentation](../../docs/LICENSING.md). - Management can inject a validated Bot Social server URL at instance start (`docs/BOT_SOCIAL.md`); operators can also set a file or env (see below) or use Settings → Bot Social. This is not live third-party proof. diff --git a/runtime/flybot-social-host/README.md b/runtime/flybot-social-host/README.md index f37fbef8c..ab29a9cfd 100644 --- a/runtime/flybot-social-host/README.md +++ b/runtime/flybot-social-host/README.md @@ -6,7 +6,7 @@ unmodified `runtime/ds-bot-upstream/` tree and is **not** a FlyBot It sits between: -- the pinned upstream DS-Bot runtime (`runtime/ds-bot-upstream`, v0.3.6), and +- the pinned upstream DS-Bot runtime (`runtime/ds-bot-upstream`, [version pin](../ds-bot-upstream.pin.json)), and - the imported `@flybot/social` plugin (`runtime/flybot/plugins/social`). The plugin injects a `flybot` Cordis service that upstream DS-Bot does not @@ -34,7 +34,7 @@ truth. only `ot-fake-` tokens: first start writes mode 0600 credentials, the token does not appear in logs, a second start does not onboard again, and a torn credentials file is refused rather than replaced. -- Richer group/DM façade flows on the v0.3.6 ledger: notices, human and +- Richer group/DM façade flows on the native ledger: notices, human and remote lines, face-to-face upsert/apply/drop, inbound DM deliver, and approval/invite hooks. - Room-link seating on the host seam: mint/claim/revoke go through @@ -51,7 +51,6 @@ truth. `docs/BOT_SOCIAL.md`. - Composer `@` mentions and the Bot details drawer in the official ds-bot / dsh web client. -- Live Bot Social room-invite HTTP, a Members-card UI, or a Teamily - comparison of group/DM or room-link flows. +- Live Bot Social room-invite HTTP or a Members-card UI. See `docs/upstream/GAPS.md` and `docs/upstream/INTEGRATION.md`. diff --git a/runtime/flybot-web-slots/README.md b/runtime/flybot-web-slots/README.md index a2adf74de..0cb64e994 100644 --- a/runtime/flybot-web-slots/README.md +++ b/runtime/flybot-web-slots/README.md @@ -1,7 +1,7 @@ # FlyBot web slots for dsh web -FlyBot-authored adapter. Upstream DS-Bot v0.3.6 has no `globalThis.__flybot__` -slot host, so `@flybot/social`'s browser half cannot register its UI by itself. +The FlyBot web adapter provides the `globalThis.__flybot__` slot host +for the `@flybot/social` browser client. This package: @@ -16,11 +16,10 @@ The official ds-bot client bundle is **not** loaded as a second profile plugin: the runtime wrapper already runs `createRuntime()` once. Composer `@` rows from `flybot.composer.mention` are registered on the official -DSH `inputTriggers.registerSource` seam (the same contract unmodified ds-bot -v0.3.6 uses in `src/client/at-menu.js`). Tests use an in-process fake -`registerSource` only; they are not a live dsh-web or Teamily comparison. +DSH `inputTriggers.registerSource` interface. Tests use an in-process +`registerSource` fixture. -The official ds-bot v0.3.6 details drawer (`src/client/details-drawer.js`) +The upstream DS-Bot details drawer (`src/client/details-drawer.js`) has no slot for `flybot.bot.details`. This adapter does not invent a drawer slot or edit the vendored ds-bot tree. Instead it installs its own FlyBot-branded details surface on the already-bridged dsh-web-app regions @@ -28,9 +27,9 @@ FlyBot-branded details surface on the already-bridged dsh-web-app regions the host hides a blank session header), and `settings.section`. Opening that surface renders components registered on `flybot.bot.details` (Bot Social registers `BotSocialDetails`). Tests mount a fake dsh slot host and drive -the real social client; they are not a live dsh-web or Teamily comparison. +the social client. `@flybot-workspace/flybot-social-web` is a client-only DSH bundle that loads `@flybot/social/client.js` after this host. Its server `apply()` is a no-op. -Not Teamily parity. Live Bot Social onboarding stays off (`onboard: false`). +The browser bundle leaves Bot Social onboarding off (`onboard: false`). diff --git a/runtime/flybot-workspace-web/features/agents/index.js b/runtime/flybot-workspace-web/features/agents/index.js index 286cea188..60ebe88b0 100644 --- a/runtime/flybot-workspace-web/features/agents/index.js +++ b/runtime/flybot-workspace-web/features/agents/index.js @@ -13,7 +13,7 @@ import { createHash } from 'node:crypto' import { openDatabase, newId } from '../../src/store.js' import { agentsV1 } from './v1.js' import { PRIVATE_FILE_COUNT, privateFiles, fingerprintAttachments } from './files.js' -import { importOfficialBundle } from './migrate.js' +import { importOfficialBundle, verifyOfficial } from './migrate.js' import { PRIVATE_TEXT_LIMIT, sendId, textReplyKey, textReplyAttempt } from './private-reply.js' import { replyStream, waitForReplyChange } from './reply-stream.js' import { rank, noteBlock, personalizationBlock } from '../chat/recall.js' @@ -1468,15 +1468,60 @@ export function createAgents({ db, host }) { return endpoints.create(payload ?? {}, false, call.source ?? null) } endpoints.v1 = agentsV1({ endpoints, chatDirectory, host, log: host?.log }) + async function rebrandBuiltinAssistant(bundle, binding) { + const tables = verifyOfficial(bundle) + if (!tables.personal_agents?.some(row => + row.agent_id === binding.agent_id && row.workspace_id === binding.workspace_id)) return + const builtin = tables.builtin_agents?.find(row => + row.builtin_key === 'flybot-assistant' && row.workspace_id === binding.workspace_id) + if (!builtin) return + const seed = tables.workspace_agents?.find(row => + row.id === builtin.agent_id && row.workspace_id === binding.workspace_id) + if (!seed || !validName(seed.name) || !validSummary(seed.summary)) return + const previous = one("SELECT * FROM agents WHERE id=? AND workspace_id=? AND imported_from='management'", + seed.id, binding.workspace_id) + const oldName = 'Teamily Agent' + const oldSummary = 'Teamily 平台助手' + if (!previous || (previous.name !== oldName && previous.summary !== oldSummary)) return + + await native.write(async ({ensure, update}) => { + const row = await ensure(previous) + if (row.native_deleted) return + const {rt} = await host.runtime() + const bot = rt.botOf(row.native_bot_id) + if (bot?.flybotWorkspace?.agent_id !== row.id || bot.flybotWorkspace.workspace_id !== row.workspace_id) return + const changes = {} + if (row.name === oldName && seed.name !== oldName) { + let name = seed.name + let suffix = 2 + while (one('SELECT 1 FROM agents WHERE workspace_id=? AND name_hash=? AND id<>?', + row.workspace_id, sha(name.toLowerCase()), row.id)) { + name = seed.name.slice(0, 72) + ' ' + suffix++ + } + changes.name = name + } + if (row.summary === oldSummary && seed.summary !== oldSummary && + (bot.role === oldSummary || bot.role === seed.summary.slice(0, 24))) { + changes.summary = seed.summary + } + if (!Object.keys(changes).length) return + await update(row, changes) + const {name = row.name, summary = row.summary} = changes + run('UPDATE agents SET name=?, name_hash=?, summary=?, revision=revision+1, updated=? WHERE id=?', + name, sha(name.toLowerCase()), summary, now(), row.id) + }, previous.id) + } + const migrate = async (bundle) => (bundle?.format === 'flybot-workspace-dsbot-import' ? importOfficialBundle(endpoints, bundle) : endpoints.import(bundle)) - return { endpoints, migrate, attachHistory:historyProjection.attach } + return { endpoints, migrate, rebrandBuiltinAssistant, attachHistory:historyProjection.attach } } export default async function agents(host) { const db = await openDatabase(host, 'agents.sqlite3') - const { endpoints, migrate, attachHistory } = createAgents({ db, host }) + const { endpoints, migrate, rebrandBuiltinAssistant, attachHistory } = createAgents({ db, host }) await importPending({ host, db, migrate }) - if (!await endpoints['personal-binding']()) { + const binding = await endpoints['personal-binding']() + if (!binding) { let bootstrap try { bootstrap = loadPersonalAgentBootstrap() } catch { throw new Error('Personal agent bootstrap configuration is unreadable') @@ -1488,7 +1533,19 @@ export default async function agents(host) { await migrate(bootstrap) } } - const timer = setTimeout(() => endpoints.reconcile().catch(() => host.log('native agent history reconciliation pending; retry agents/reconcile')), 10000) + const timer = setTimeout(async () => { + if (binding) { + try { + const bootstrap = loadPersonalAgentBootstrap() + if (bootstrap?.instance_id && bootstrap.instance_id === (host.identity?.routingInstanceId || host.identity?.instanceId)) { + await rebrandBuiltinAssistant(bootstrap, binding) + } + } catch { + host.log('Built-in assistant name update will retry on the next startup.') + } + } + await endpoints.reconcile().catch(() => host.log('native agent history reconciliation pending; retry agents/reconcile')) + }, 10000) timer.unref?.() const runtime = host.currentRuntime?.() if (runtime) attachHistory(runtime) diff --git a/runtime/flybot-workspace-web/features/members/index.js b/runtime/flybot-workspace-web/features/members/index.js index aa6a345df..3236b2f69 100644 --- a/runtime/flybot-workspace-web/features/members/index.js +++ b/runtime/flybot-workspace-web/features/members/index.js @@ -9,7 +9,7 @@ export default function members(host) { pages: ['members'], endpoints: { v1: membersV1(host), - // Wizard step 3 (#281): static FlyBot role copy, not a Teamily claim. + // Wizard step 3 uses the workspace role descriptions. roles: async () => ({ roles: [ { role: 'owner', title: 'Owner', summary: 'Can delete the team, assign admin/member roles, and transfer ownership before leaving. Cannot be removed or suspended.' }, { role: 'admin', title: 'Admin', summary: 'Manages members (except the owner), invites and join requests; cannot change roles.' }, diff --git a/runtime/flybot-workspace-web/test/agents.test.js b/runtime/flybot-workspace-web/test/agents.test.js index 791b43ae0..10b19511d 100644 --- a/runtime/flybot-workspace-web/test/agents.test.js +++ b/runtime/flybot-workspace-web/test/agents.test.js @@ -21,7 +21,7 @@ function fixture(options) { } } const db = new DatabaseSync(join(mkdtempSync(join(tmpdir(), 'ot-agents-')), 'a.sqlite3')) const created = createAgents({ db, host }) - return { e: created.endpoints, migrate: created.migrate, db, ...runtime } + return { e: created.endpoints, migrate: created.migrate, rebrandBuiltinAssistant: created.rebrandBuiltinAssistant, db, ...runtime } } test('categories stay in step with the Python source', () => { @@ -313,6 +313,45 @@ test('official agents bundle imports once including history', async () => { assert.equal((await migrate(bundle)).imported, 0) }) +test('an authenticated bootstrap ID rebrands its existing native built-in and retries interrupted writes', async () => { + const {createHash} = await import('node:crypto') + const {e, rebrandBuiltinAssistant, bots, services, db} = fixture() + const id = 'c'.repeat(32), otherId = 'd'.repeat(32) + const binding = {workspace_id: W, agent_id: 'e'.repeat(32)} + const old = {workspace_id: W, name: 'Teamily Agent', summary: 'Teamily 平台助手', instructions: 'Keep my edit'} + await e.import({agents: [{id, ...old}, {id: otherId, ...old, workspace_id: 'b'.repeat(32)}]}) + const payload = {workspace_id: W, id} + const {agent: before} = await e.get(payload) + const {agent: other} = await e.get({workspace_id: 'b'.repeat(32), id: otherId}) + const current = {id, ...old, name: 'FlyBot Assistant', summary: 'FlyBot 平台助手'} + const tables = {}, manifest = {} + for (const [name, rows] of Object.entries({ + personal_agents: [binding], workspace_agents: [current], + builtin_agents: [{workspace_id: W, agent_id: id, builtin_key: 'flybot-assistant'}], + })) { + tables[name] = JSON.stringify(rows) + manifest[name] = {rows: rows.length, sha256: createHash('sha256').update(tables[name]).digest('hex')} + } + const bundle = {format: 'flybot-workspace-dsbot-import', version: 1, feature: 'agents', tables, manifest} + const bot = bots[before.native_bot_id] + services.rt.save = async () => { throw new Error('interrupted native save') } + await assert.rejects(rebrandBuiltinAssistant(bundle, binding), /interrupted native save/) + assert.equal(db.prepare('SELECT name FROM agents WHERE id=?').get(id).name, old.name) + services.rt.save = async () => {} + await rebrandBuiltinAssistant(bundle, binding) + const {agent: after} = await e.get(payload) + assert.equal(after.id, id) + assert.equal(after.native_bot_id, before.native_bot_id) + assert.equal(after.name, current.name) + assert.equal(after.summary, current.summary) + assert.equal(bot.name, current.name) + assert.equal(bot.instructions, old.instructions) + assert.equal(bots[other.native_bot_id].name.startsWith('Teamily Agent'), true) + await rebrandBuiltinAssistant(bundle, binding) + assert.equal((await e.get(payload)).agent.revision, after.revision) + db.close() +}) + test('official personal history is durable before native attachment and binds to Chief on first use', async () => { const { createHash } = await import('node:crypto') const aid = 'c'.repeat(32), cid = 'd'.repeat(32) diff --git a/scripts/accept-compose-manager-stub.sh b/scripts/accept-compose-manager-stub.sh index a0adbd03b..958934dfd 100755 --- a/scripts/accept-compose-manager-stub.sh +++ b/scripts/accept-compose-manager-stub.sh @@ -2,5 +2,5 @@ # Creates temporary SQLite/loopback HTTP/subprocess stub fixtures only. NOT DOCKER. set -eu cd "$(dirname "$0")/.." -printf '%s\n' 'STUB ACCEPTANCE ONLY: no real Docker, runtime image, volume, FlyBot or Teamily acceptance.' +printf '%s\n' 'Compose manager tests use local stubs. Docker images and volumes are covered by the runtime image workflow.' PYTHONPATH=tests python3 -m unittest test_compose_manager -v diff --git a/scripts/ci-native-ui.mjs b/scripts/ci-native-ui.mjs index a875fa044..4b78ec2d8 100644 --- a/scripts/ci-native-ui.mjs +++ b/scripts/ci-native-ui.mjs @@ -78,7 +78,7 @@ async function closeServer(server) { } export async function startNativeUI() { - const temp = await realpath(await mkdtemp(join(tmpdir(), 'ot-native-screenshots-'))); + const temp = await realpath(await mkdtemp(join(tmpdir(), 'flybot-native-ui-'))); const scope = new AsyncLocalStorage(); const accounts = new Map(); let auth, app, social, engine, socialSocket; diff --git a/scripts/ci_ui_screenshots.mjs b/scripts/ci_ui_screenshots.mjs index e09b00ad3..44dba7741 100644 --- a/scripts/ci_ui_screenshots.mjs +++ b/scripts/ci_ui_screenshots.mjs @@ -2234,7 +2234,7 @@ async function main() { && !homeText.includes("Help me organize today's priorities") && !homeText.includes('Create something with my team') && !homeText.includes('Connect a messaging channel') - && !/(? {"; @@ -12,14 +12,32 @@ export const replacements=[ " let stopRestarted\n t.after(async () => {\n if (stopRestarted) await stopRestarted()\n rmSync(home, { recursive: true, force: true, maxRetries: 5 })\n })"], [" t.after(() => again.stop({ keep: true }))"," stopRestarted = () => again.stop({ keep: true })"], ]; -export function transformRestartFixture(source){ - if(createHash('sha256').update(source).digest('hex')!==expected)throw Error('Upstream rounds fixture changed: independently review cleanup ordering'); - const begin=source.indexOf(marker),end=source.indexOf('\n})',begin)+3; - if(begin<0||end rmSync(home, { recursive: true, force: true, maxRetries: 5, retryDelay: 20 }))", + " let host\n t.after(async () => {\n await host?.stop()\n rmSync(home, { recursive: true, force: true, maxRetries: 5, retryDelay: 20 })\n })"], + [" const host = await createRestartHost(t, home, new Map())\n t.after(() => host.stop())", + " host = await createRestartHost(t, home, new Map())"], +]; + +function transformFixture(source,name,hash,marker,replacements){ + if(createHash('sha256').update(source).digest('hex')!==hash)throw Error('Upstream '+name+' fixture changed: independently review cleanup ordering'); + const begin=source.indexOf(marker),end=source.indexOf('\n})',begin); + if(begin<0||end<0)throw Error('Missing exact '+name+' fixture'); let block=source.slice(begin,end); for(const [before,after]of replacements){ - if(block.split(before).length!==2)throw Error('Unexpected restart cleanup wiring'); + if(block.split(before).length!==2)throw Error('Unexpected '+name+' cleanup wiring'); block=block.replace(before,after); } return source.slice(0,begin)+block+source.slice(end); } + +export function transformRestartFixture(source){ + return transformFixture(source,'rounds',expected,marker,replacements); +} + +export function transformDeliveryFixture(source){ + return transformFixture(source,'delivery dedup',deliveryHash,deliveryMarker,deliveryReplacements); +} diff --git a/scripts/upstream-test-cleanup-overlay.test.mjs b/scripts/upstream-test-cleanup-overlay.test.mjs index 89d45f6b4..ad081caab 100644 --- a/scripts/upstream-test-cleanup-overlay.test.mjs +++ b/scripts/upstream-test-cleanup-overlay.test.mjs @@ -2,7 +2,10 @@ import test from 'node:test'; import assert from 'node:assert/strict'; import {readFileSync} from 'node:fs'; import {spawnSync} from 'node:child_process'; -import {target,marker,replacements,transformRestartFixture} from './upstream-test-cleanup-overlay.mjs'; +import { + deliveryMarker,deliveryReplacements,deliveryTarget,marker,replacements,target, + transformDeliveryFixture,transformRestartFixture, +} from './upstream-test-cleanup-overlay.mjs'; import {load} from './upstream-test-clock-loader.mjs'; const original=readFileSync(new URL(target),'utf8'); const patched=transformRestartFixture(original); @@ -44,3 +47,54 @@ test('overlay retains every assertion byte, reverses exactly, rejects drift and assert.equal((await load(target,{},async()=>({format:'module',source:Buffer.from(original)}))).source,patched); const other={format:'module',source:'untouched'};assert.equal(await load('file:///production.js',{},async()=>other),other); }); + + +async function deliveryHooks(source, stop, remove) { + const start = source.indexOf(' const home =', source.indexOf(deliveryMarker)); + const end = source.indexOf(' const agent =', start); + const registered = []; + const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor; + const register = new AsyncFunction( + 't', 'mkdtempSync', 'join', 'tmpdir', 'rmSync', 'writeFileSync', 'baseSeed', 'createRestartHost', + source.slice(start, end), + ); + const context = {after: callback => registered.push(callback)}; + await register(context, () => '/tmp/delivery', () => '', () => '', remove, () => {}, () => ({}), async () => ({stop})); + return registered; +} + +test('dedup fixture drains the existing runtime before its original directory removal', async () => { + const original = readFileSync(new URL(deliveryTarget), 'utf8'); + const patched = transformDeliveryFixture(original); + const order = []; + const originalHooks = await deliveryHooks(original, () => order.push('stop'), () => order.push('remove')); + assert.equal(originalHooks.length, 2); + for (const callback of originalHooks) await callback(); + assert.deepEqual(order, ['remove', 'stop']); + + let stopped = false; + let removed = 0; + let release; + const patchedHooks = await deliveryHooks(patched, async () => { + await new Promise(resolve => { release = resolve; }); + stopped = true; + }, (directory, options) => { + assert.equal(stopped, true); + assert.equal(directory, '/tmp/delivery'); + assert.deepEqual(options, {recursive: true, force: true, maxRetries: 5, retryDelay: 20}); + removed++; + }); + assert.equal(patchedHooks.length, 1); + const pending = patchedHooks[0](); + assert.equal(typeof release, 'function'); + assert.equal(removed, 0); + release(); + await pending; + assert.equal(removed, 1); + + let restored = patched; + for (const [before, after] of [...deliveryReplacements].reverse()) restored = restored.replace(after, before); + assert.equal(restored, original); + assert.throws(() => transformDeliveryFixture(original + '\n'), /fixture changed/); + assert.equal((await load(deliveryTarget, {}, async () => ({format: 'module', source: Buffer.from(original)}))).source, patched); +}); diff --git a/scripts/upstream-test-clock-loader.mjs b/scripts/upstream-test-clock-loader.mjs index 62a873ae0..bd5f2a909 100644 --- a/scripts/upstream-test-clock-loader.mjs +++ b/scripts/upstream-test-clock-loader.mjs @@ -2,7 +2,7 @@ // v0.3.9+ already drains the VM's cross-realm send with mock timers, so this // overlay is an identity check: unexpected fixture changes still fail closed. import { createHash } from 'node:crypto'; -import {target as cleanupTarget,transformRestartFixture} from './upstream-test-cleanup-overlay.mjs'; +import {deliveryTarget,target as cleanupTarget,transformDeliveryFixture,transformRestartFixture} from './upstream-test-cleanup-overlay.mjs'; export const target = new URL('../runtime/ds-bot-upstream/ds-bot/test/text-annotation.test.js', import.meta.url).href; const expected = '3f832ee90adcbfd661b404d0c979b5f896a88402d21d49a233fbd1eaa0eb48f7'; const required = [ @@ -21,6 +21,7 @@ export function transformAnnotationFixture(source) { export async function load(url, context, nextLoad) { const result = await nextLoad(url, context); if(url===cleanupTarget)return {...result,source:transformRestartFixture(Buffer.from(result.source).toString('utf8'))}; + if(url===deliveryTarget)return {...result,source:transformDeliveryFixture(Buffer.from(result.source).toString('utf8'))}; if (url !== target) return result; return { ...result, source: transformAnnotationFixture(Buffer.from(result.source).toString('utf8')) }; } diff --git a/scripts/visible_inventory.py b/scripts/visible_inventory.py index a265723f6..9cc329b65 100644 --- a/scripts/visible_inventory.py +++ b/scripts/visible_inventory.py @@ -29,10 +29,10 @@ 'home': ('/', 'workspace/profile/recent works/search/notification state', 'home/app.mjs and shell -> authenticated homepage/search/navigation/notification APIs', 'Existing home/search/notification suites and CI scenes', 'Authenticated SSE invalidations consumed by chat/document editors; no token stream/browser delivery/full unread; contributor340 followed-public-work notifications landed; active #309/#284'), 'messenger': ('/messenger -> /chat', 'Same social conversation state as chat', 'Compatibility redirect and messenger client -> chat/social APIs', 'Existing messenger redirect and social suites', 'Same unmet chat states; old route is not a second implementation'), 'guide': ('/guide', 'Original static documentation', 'Guide client index/search/navigation', 'Existing guide suite/CI scene', 'Active #302; scene-level content/target verification incomplete'), - 'help': ('/help', 'Original static help documentation landed on main in contributor PR 307', 'settings_page allowlist -> served help page and real internal navigation', 'tests/docs_pages.test.mjs and tests/test_docs_pages.py', 'Teamily scene parity and every help scenario unverified'), + 'help': ('/help', 'Original static help documentation landed on main in contributor PR 307', 'settings_page allowlist -> served help page and real internal navigation', 'tests/docs_pages.test.mjs and tests/test_docs_pages.py', 'Individual help scenarios require browser verification'), 'terms': ('/terms', 'Original static service terms landed on main in contributor PR 307', 'settings_page allowlist -> served terms and real internal navigation', 'tests/docs_pages.test.mjs and tests/test_docs_pages.py', 'Operator-specific legal review remains external; no legal compliance claim'), 'privacy': ('/privacy', 'Original static privacy documentation landed on main in contributor PR 307', 'settings_page allowlist -> served privacy page and real internal navigation', 'tests/docs_pages.test.mjs and tests/test_docs_pages.py', 'Operator-specific policy review remains external; no legal compliance claim'), - 'about': ('/about', 'Original static branding/version/license information', 'Static served page and real repository links', 'Existing branding/page suites and CI scene', 'No Teamily assets; full scene parity unverified'), + 'about': ('/about', 'Original static branding/version/license information', 'Static served page and real repository links', 'Existing branding/page suites and CI scene', 'Individual branding and link states remain unverified'), 'download': ('/download', 'Static platform/download guidance', 'Static served page and package/help targets', 'Existing served-page/navigation checks', 'Package availability/platform installation not independently accepted'), 'server': ('server-generated auth/public/invite/share/agent pages', 'sessions/CSRF/registration/OIDC and existing profile/share/invite/key state', 'Source template -> corresponding authenticated/public render handler; source AST fragments do not prove a live route', 'Existing auth/public/share/invite/server-page tests; individual template state unverified', 'Active #293; SMTP/OIDC/MFA/reset/abuse/provider flows and conditional templates need separate acceptance'), 'shell': ('shared navigation/account/menu', 'session, appearance/settings and current navigation', 'shell/app.mjs -> auth/logout/settings and real page hrefs', 'Existing shell/page suites and CI scenes', 'Help/legal pages landed in #307; active #317; download targets and conditional states unverified'), diff --git a/tests/profile_page.test.mjs b/tests/profile_page.test.mjs index d984b6327..f824247f8 100644 --- a/tests/profile_page.test.mjs +++ b/tests/profile_page.test.mjs @@ -102,7 +102,7 @@ function installShareGlobals({pathname = '/profile', clipboard = 'stub'} = {}) { const savedHistory = globalThis.history; const copied = []; const pushes = []; - const loc = {pathname, origin: 'https://teamily.ai', search: '', href: 'https://teamily.ai' + pathname}; + const loc = {pathname, origin: 'https://flybot.test', search: '', href: 'https://flybot.test' + pathname}; globalThis.location = loc; globalThis.history = { pushState(state, title, url) { @@ -402,7 +402,7 @@ test('有 FlyBot ID 时分享按钮把公开主页链接复制到剪贴板', asy }); try { await shareHandler(doc)({preventDefault() {}}); - assert.deepEqual(env.copied, ['https://teamily.ai/p/alice.smith'], + assert.deepEqual(env.copied, ['https://flybot.test/p/alice.smith'], 'clicking 分享 must copy the public profile URL built from the saved handle'); const status = doc.getElementById('status'); assert.equal(status.dataset.kind, 'ok'); @@ -452,7 +452,7 @@ test('剪贴板不可用时把链接显示出来让人手动复制', async () => assert.equal(fallback.hidden, false, 'when the clipboard refuses the copy the URL must be shown for manual copying'); assert.equal(doc.querySelector('#profile-share-link').textContent, - 'https://teamily.ai/p/alice.smith'); + 'https://flybot.test/p/alice.smith'); } finally { restore(); } } finally { env.restore(); } }); diff --git a/tests/settings_page.test.mjs b/tests/settings_page.test.mjs index a2063b0d9..caeddf249 100644 --- a/tests/settings_page.test.mjs +++ b/tests/settings_page.test.mjs @@ -100,7 +100,7 @@ test('syncOverviewCurrentValues shows saved choices in the current language', () assert.equal(folding.textContent, ''); }); -test('the settings overview lists preference and support rows in the recorded Teamily order', () => { +test('the settings overview lists preference and support rows in order', () => { const html = readFileSync(new URL('../flybot_workspace/static/settings/index.html', import.meta.url), 'utf8'); const prefs = html.slice(html.indexOf('id="group-prefs"'), html.indexOf('id="group-notification-prefs"')); const prefHrefs = [...prefs.matchAll(/href="([^"]+)"/g)].map((m) => m[1]); diff --git a/tests/test_compose_manager.py b/tests/test_compose_manager.py index 80489bf68..5090c1a17 100644 --- a/tests/test_compose_manager.py +++ b/tests/test_compose_manager.py @@ -20,6 +20,7 @@ import test_runtime as fixtures from flybot_workspace.app import App, Config from flybot_workspace.lifecycle import Lifecycle, RuntimeFault, RuntimePolicy, ManagerIdentity +from flybot_workspace.model_http_policy import ModelHttpPolicy from flybot_workspace.store import Store from flybot_workspace.manager.client import ManagerClient from flybot_workspace.manager.engine import Registry, Runner, ComposeEngine, manifest, compatible_manifest_upgrade, BOT_SOCIAL_TARGET, RUNTIME_KEY_TARGET, SOCIAL_SOCKET_BIND, SOCIAL_SOCKET_SOURCE, SOCIAL_SOCKET_TARGET, compose_bytes @@ -591,6 +592,15 @@ def test_missing_model_api_writes_empty_secret_file(self): self.assertEqual(path.read_text(), '') assert_container_readable_secret(self, path) + def test_runtime_secret_accepts_the_manager_model_http_capability(self): + endpoint = 'http://203.0.114.10:8081/v1' + self.app.model_http_policy = ModelHttpPolicy((endpoint,)) + self.put_model_api('platform', 'sk-model-http-test-key', provider='openai', base_url=endpoint) + client = self.start_http() + claim = client.claim(self.iid) + secret = client.runtime_secret(self.iid, claim) + self.assertEqual(secret['http_endpoint_grant'], self.app.model_http_policy.grant_for(endpoint)) + def test_runtime_secret_requires_a_lease_and_rejects_stop_jobs(self): client = self.start_http() worker = ManagerWorker(client, self.registry, self.engine) diff --git a/tests/test_dsbot_bundle.py b/tests/test_dsbot_bundle.py index bd4489ae9..95ee1be58 100644 --- a/tests/test_dsbot_bundle.py +++ b/tests/test_dsbot_bundle.py @@ -154,6 +154,10 @@ def test_personal_bootstrap_seeds_only_initial_roster_and_welcome(self): self.assertEqual(tables['personal_agents'][0]['user_id'], aid) self.assertTrue(all(a['workspace_id'] == private['workspace']['id'] for a in tables['workspace_agents'])) self.assertEqual(len(tables['workspace_agents']), 11) + assistant = next(row for row in tables['builtin_agents'] if row['builtin_key'] == 'flybot-assistant') + self.assertEqual(assistant['workspace_id'], private['workspace']['id']) + seeded = next(row for row in tables['workspace_agents'] if row['id'] == assistant['agent_id']) + self.assertEqual(seeded['name'], 'FlyBot Assistant') self.assertEqual(len(tables['agent_messages']), 1) self.assertEqual(tables['agent_messages'][0]['agent_id'], private['agent']['id']) self.assertNotIn(other['workspace']['id'], str(bundle)) diff --git a/tests/test_personal_agent.py b/tests/test_personal_agent.py index 91d05dba3..2cf6c34ec 100644 --- a/tests/test_personal_agent.py +++ b/tests/test_personal_agent.py @@ -5,6 +5,7 @@ import tempfile import unittest +from flybot_workspace.agents import name_hash from flybot_workspace.app import App, Config from flybot_workspace.store import Store from tests.test_management import Client, ORIGIN, seed_legacy_workspace @@ -35,7 +36,7 @@ def test_ensure_creates_personal_space_agent_and_roster_once(self): self.assertEqual(personal['agent']['summary'], 'Your Cross-context Super AI Agent.') self.assertEqual(len(created['body']['builtin_agents']), 10) names = [item['agent']['name'] for item in created['body']['builtin_agents']] - self.assertIn('Teamily Agent', names) + self.assertIn('FlyBot Assistant', names) self.assertIn('Travel Planner', names) self.assertIn('Webpage Developer', names) again = self.alice.call('POST', '/v1/personal-agent') @@ -71,6 +72,27 @@ def test_ensure_creates_personal_space_agent_and_roster_once(self): self.assertEqual(history['status'], 410) self.assertEqual(history['body']['error']['code'], 'moved_to_dsbot') + def test_existing_builtin_assistant_is_rebranded_without_recreating_it(self): + created = self.alice.call('POST', '/v1/personal-agent')['body'] + builtin = next(item for item in created['builtin_agents'] if item['key'] == 'flybot-assistant') + old = builtin['agent'] + with self.app.store.transaction() as db: + db.execute('UPDATE builtin_agents SET builtin_key=? WHERE agent_id=?', + ('teamily-agent', old['id'])) + db.execute('UPDATE workspace_agents SET name=?, name_hash=?, summary=?, instructions=? WHERE id=?', + ('Teamily Agent', name_hash('Teamily Agent'), 'Teamily 平台助手', + 'Personalized instructions', old['id'])) + self.app.store = Store(self.path) + restored = self.alice.call('GET', '/v1/personal-agent')['body'] + updated = next(item for item in restored['builtin_agents'] if item['key'] == 'flybot-assistant') + self.assertEqual(updated['agent']['id'], old['id']) + self.assertEqual(updated['agent']['name'], 'FlyBot Assistant') + self.assertEqual(updated['agent']['summary'], 'FlyBot 平台助手') + self.assertEqual(updated['agent']['instructions'], 'Personalized instructions') + self.assertEqual(len(restored['builtin_agents']), 10) + self.app.store = Store(self.path) + self.assertEqual(self.alice.call('GET', '/v1/personal-agent')['body'], restored) + def test_personal_look_is_exposed_only_to_its_owner(self): look = {'color': '天空蓝', 'expression': '微笑', 'headwear': '耳机', 'glasses': '无', 'hand': '咖啡杯'} diff --git a/tests/test_runtime_autoprovision.py b/tests/test_runtime_autoprovision.py index f21c91a88..725b19e89 100644 --- a/tests/test_runtime_autoprovision.py +++ b/tests/test_runtime_autoprovision.py @@ -189,6 +189,10 @@ def test_auto_provision_returns_personal_bootstrap_without_minting_key(self): self.assertEqual(len(bindings), 1) self.assertEqual(bindings[0]['workspace_id'], personal['workspace']['id']) self.assertEqual(bindings[0]['agent_id'], personal['agent']['id']) + builtins = json.loads(bundle['tables']['builtin_agents']) + assistant = next(row for row in builtins if row['builtin_key'] == 'flybot-assistant') + self.assertEqual(assistant['workspace_id'], personal['workspace']['id']) + self.assertTrue(all(row['workspace_id'] == personal['workspace']['id'] for row in builtins)) self.assertNotIn(other['agent']['id'], bundle['tables']['workspace_agents']) self.assertEqual(self.count('SELECT COUNT(*) FROM runtime_keys'), 0) self.assertEqual(self.count('SELECT COUNT(*) FROM instance_runtime_keys'), 0)