oficina / equipo Public

Add native Equipo r4 mockups and web-led sync proposal

Paul Campbell pushed by paul@keymail.dev 739c291946af573d379baa78645dbfa55c7ad24c parent 47b6eb6
71 files changed, +2,333 −0
  • docs/native/r4/index.md +44 −0
  • docs/native/r4/iphone-connections-dark.png binary
  • docs/native/r4/iphone-connections-light.png binary
  • docs/native/r4/iphone-contra-dark.png binary
  • docs/native/r4/iphone-contra-light.png binary
  • docs/native/r4/iphone-conversation-dark.png binary
  • docs/native/r4/iphone-conversation-light.png binary
  • docs/native/r4/iphone-copy-hold-dark.png binary
  • docs/native/r4/iphone-copy-hold-light.png binary
  • docs/native/r4/iphone-exploration-dark.png binary
  • docs/native/r4/iphone-exploration-light.png binary
  • docs/native/r4/iphone-needs-accessibility-dark.png binary
  • docs/native/r4/iphone-needs-dark.png binary
  • docs/native/r4/iphone-needs-light.png binary
  • docs/native/r4/iphone-notification-answered-dark.png binary
  • docs/native/r4/iphone-notification-answered-light.png binary
  • docs/native/r4/iphone-notification-compact-dark.png binary
  • docs/native/r4/iphone-notification-compact-light.png binary
  • docs/native/r4/iphone-notification-dark.png binary
  • docs/native/r4/iphone-notification-light.png binary
  • docs/native/r4/iphone-research-dark.png binary
  • docs/native/r4/iphone-research-light.png binary
  • docs/native/r4/iphone-task-dark.png binary
  • docs/native/r4/iphone-task-light.png binary
  • docs/native/r4/iphone-tasks-dark.png binary
  • docs/native/r4/iphone-tasks-light.png binary
  • docs/native/r4/iphone-team-dark.png binary
  • docs/native/r4/iphone-team-light.png binary
  • docs/native/r4/iphone-teams-dark.png binary
  • docs/native/r4/iphone-teams-light.png binary
  • docs/native/r4/iphone-usage-concept-dark.png binary
  • docs/native/r4/iphone-usage-concept-light.png binary
  • docs/native/r4/mac-main-dark.png binary
  • docs/native/r4/mac-main-light.png binary
  • docs/native/r4/mac-menu-dark.png binary
  • docs/native/r4/mac-menu-light.png binary
  • docs/native/r4/mac-notification-answered-dark.png binary
  • docs/native/r4/mac-notification-answered-light.png binary
  • docs/native/r4/mac-notification-compact-dark.png binary
  • docs/native/r4/mac-notification-compact-light.png binary
  • docs/native/r4/mac-notification-dark.png binary
  • docs/native/r4/mac-notification-light.png binary
  • docs/native/sync-proposal.md +65 −0
  • native/mockups/.gitignore +7 −0
  • native/mockups/EquipoCore/Package.swift +11 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Core.swift +51 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/budgets.json +17 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/connections.json +40 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/conversation.json +44 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/needs-you.json +79 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/notification.json +9 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/projects.json +28 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/question.json +23 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/tasks.json +182 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/teams.json +22 −0
  • native/mockups/EquipoCore/Sources/EquipoCore/Models.swift +190 −0
  • native/mockups/EquipoCore/Tests/EquipoCoreTests/ContractTests.swift +48 −0
  • native/mockups/EquipoMockups.xcodeproj/project.pbxproj +327 −0
  • native/mockups/EquipoMockups.xcodeproj/xcshareddata/xcschemes/EquipoMac.xcscheme +5 −0
  • native/mockups/EquipoMockups.xcodeproj/xcshareddata/xcschemes/EquipoPhone.xcscheme +5 −0
  • native/mockups/Mac/EquipoMacApp.swift +119 −0
  • native/mockups/Mac/MacPanels.swift +95 −0
  • native/mockups/Mac/NativeTranscript.swift +165 −0
  • native/mockups/Shared/Components.swift +247 −0
  • native/mockups/Shared/Theme.swift +58 −0
  • native/mockups/iOS/EquipoPhoneApp.swift +216 −0
  • native/mockups/scripts/check-fixtures.py +74 −0
  • native/mockups/scripts/generate-models.py +31 −0
  • native/mockups/scripts/generate-project.py +53 −0
  • native/mockups/scripts/mutation-check.py +31 −0
  • native/mockups/scripts/studio.sh +47 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/native/r4/index.md b/docs/native/r4/index.md
new file mode 100644
index 00000000..4c5b11ab
--- /dev/null
+++ b/docs/native/r4/index.md
@@ -0,0 +1,44 @@
+# Equipo native, revision 4
+
+Draft mockups for Paul's review, based on main `47b6eb6d` on 2026-11-13. **All copy and data are placeholders.** No live instance, provider, credential, merge or release is involved. The Xcode project is [../../../native/mockups/EquipoMockups.xcodeproj](../../../native/mockups/EquipoMockups.xcodeproj). The [sync proposal](../sync-proposal.md) keeps web delivery in the lead.
+
+Screenshots come from Xcode 27.2 on the Tito Studio: iPhone 17 with iOS 27.2 through `simctl`, and the Mac app's offscreen NSView snapshot mode. Mac images show the actual content views, without the system title bar or desktop. The menu image is the real status-item popover content. Notification images depict compact and expanded native-view concepts plus a local answer receipt. They are app-rendered previews, not operating-system notification chrome or working push delivery.
+
+| Screen | Light | Dark | What to look at |
+| --- | --- | --- | --- |
+| Mac main window | [Light](mac-main-light.png) | [Dark](mac-main-dark.png) | Sidebar activity, AppKit transcript, selected task and steps |
+| Mac menu bar | [Light](mac-menu-light.png) | [Dark](mac-menu-dark.png) | One decision, with ordinary running work kept separate |
+| Mac compact notification | [Light](mac-notification-compact-light.png) | [Dark](mac-notification-compact-dark.png) | A compact question with an expand action |
+| Mac expanded notification | [Light](mac-notification-light.png) | [Dark](mac-notification-dark.png) | Question and answer options in an expanded notification concept |
+| Mac answer receipt | [Light](mac-notification-answered-light.png) | [Dark](mac-notification-answered-dark.png) | The selected answer retained in local preview state |
+| iPhone Teams | [Light](iphone-teams-light.png) | [Dark](iphone-teams-dark.png) | Separate instances; unknown count stays unknown |
+| iPhone team index | [Light](iphone-team-light.png) | [Dark](iphone-team-dark.png) | Native drill-down navigation and named specialists |
+| iPhone conversation | [Light](iphone-conversation-light.png) | [Dark](iphone-conversation-dark.png) | Daily roll-up, current question, named activity and composer |
+| iPhone Tasks | [Light](iphone-tasks-light.png) | [Dark](iphone-tasks-dark.png) | Project on every row, quiet navigation, project filter |
+| iPhone task | [Light](iphone-task-light.png) | [Dark](iphone-task-dark.png) | Decision followed by Engineering, Copy, Checks and Review |
+| iPhone Needs you | [Light](iphone-needs-light.png) | [Dark](iphone-needs-dark.png) | One real decision, rather than a queue of running tasks |
+| iPhone compact notification | [Light](iphone-notification-compact-light.png) | [Dark](iphone-notification-compact-dark.png) | A compact question before expansion |
+| iPhone expanded notification | [Light](iphone-notification-light.png) | [Dark](iphone-notification-dark.png) | Direct answer choices in an expanded notification concept |
+| iPhone answer receipt | [Light](iphone-notification-answered-light.png) | [Dark](iphone-notification-answered-dark.png) | A local answer, explicitly not sent to a server |
+| iPhone Connections & Usage | [Light](iphone-connections-light.png) | [Dark](iphone-connections-dark.png) | Available connections, nullable allowance and configured budget |
+| Exploration concept | [Light](iphone-exploration-light.png) | [Dark](iphone-exploration-dark.png) | Preview followed by a What next decision, no implied merge |
+| Research concept | [Light](iphone-research-light.png) | [Dark](iphone-research-dark.png) | Findings, sources, gaps and fetch history |
+| Usage concept | [Light](iphone-usage-concept-light.png) | [Dark](iphone-usage-concept-dark.png) | Illustrative headroom, age, reset time and Mark urgent |
+| Copy budget-hold concept | [Light](iphone-copy-hold-light.png) | [Dark](iphone-copy-hold-dark.png) | Continue without Copy for a pre-launch budget hold |
+| Contra concept | [Light](iphone-contra-light.png) | [Dark](iphone-contra-dark.png) | A secure handoff, never a secret field in chat |
+
+The [large Dynamic Type check](iphone-needs-accessibility-dark.png) is additional evidence of scrolling and reflow, not another theme. Long task details scroll; a screenshot is one viewport.
+
+## What changed since revision 3
+
+Tasks now carry project context. Specialists have task and activity lines. The conversation has named activity and daily roll-ups. New states cover Research findings, exploration previews and What next, real decisions in Needs you, Copy budget holds and the coming Contra handoff.
+
+The public person API lags several of these web features. The screenshots label Research, exploration, rich Usage, Copy bypass and Contra as concepts. Roll-ups and specialist activity also use presentation fixtures. The JSON response fixtures match the checked-in OpenAPI schemas without invented fields; they are authored examples, not recordings from staging. The supported Connections screen preserves unknown allowances and distinguishes configured budgets from remaining budget. No production copy or server behavior changes here.
+
+## Three choices for Paul
+
+1. **First native scope.** I recommend pairing, conversation, Tasks and safe answers, with authenticated web fallback for the missing contracts. Expanding the person API to all current web detail before the first app would postpone useful native work.
+2. **Where a notification answer happens.** I recommend an authenticated app handoff first, then direct unlocked answers for simple clarifications. Keep merges, spending, permissions and secrets in a full view with their consequences visible.
+3. **Mac inspector behavior.** I recommend a persistent, resizable inspector on wide windows, collapsible on smaller ones. Keep the transcript AppKit and preserve its scroll position as the inspector changes. The mockup uses fixed columns to make the first comparison repeatable.
+
+Build and capture on the Studio by syncing `native/mockups/` into `~/.cache/equipo-native-r4/build/`, then running `bash scripts/studio.sh` there. It builds both schemes, runs the core tests, captures both appearances, and deletes the dedicated simulator on exit. No package downloads or signing credentials are required. Fixture validation runs here with `python3 native/mockups/scripts/check-fixtures.py`.
diff --git a/docs/native/r4/iphone-connections-dark.png b/docs/native/r4/iphone-connections-dark.png
new file mode 100644
index 00000000..877a8343
Binary files /dev/null and b/docs/native/r4/iphone-connections-dark.png differ
diff --git a/docs/native/r4/iphone-connections-light.png b/docs/native/r4/iphone-connections-light.png
new file mode 100644
index 00000000..e93c5636
Binary files /dev/null and b/docs/native/r4/iphone-connections-light.png differ
diff --git a/docs/native/r4/iphone-contra-dark.png b/docs/native/r4/iphone-contra-dark.png
new file mode 100644
index 00000000..2b4fc15f
Binary files /dev/null and b/docs/native/r4/iphone-contra-dark.png differ
diff --git a/docs/native/r4/iphone-contra-light.png b/docs/native/r4/iphone-contra-light.png
new file mode 100644
index 00000000..b29cc7db
Binary files /dev/null and b/docs/native/r4/iphone-contra-light.png differ
diff --git a/docs/native/r4/iphone-conversation-dark.png b/docs/native/r4/iphone-conversation-dark.png
new file mode 100644
index 00000000..fdafa07c
Binary files /dev/null and b/docs/native/r4/iphone-conversation-dark.png differ
diff --git a/docs/native/r4/iphone-conversation-light.png b/docs/native/r4/iphone-conversation-light.png
new file mode 100644
index 00000000..b66876c1
Binary files /dev/null and b/docs/native/r4/iphone-conversation-light.png differ
diff --git a/docs/native/r4/iphone-copy-hold-dark.png b/docs/native/r4/iphone-copy-hold-dark.png
new file mode 100644
index 00000000..063995bb
Binary files /dev/null and b/docs/native/r4/iphone-copy-hold-dark.png differ
diff --git a/docs/native/r4/iphone-copy-hold-light.png b/docs/native/r4/iphone-copy-hold-light.png
new file mode 100644
index 00000000..25769e72
Binary files /dev/null and b/docs/native/r4/iphone-copy-hold-light.png differ
diff --git a/docs/native/r4/iphone-exploration-dark.png b/docs/native/r4/iphone-exploration-dark.png
new file mode 100644
index 00000000..c07ddb57
Binary files /dev/null and b/docs/native/r4/iphone-exploration-dark.png differ
diff --git a/docs/native/r4/iphone-exploration-light.png b/docs/native/r4/iphone-exploration-light.png
new file mode 100644
index 00000000..8b887fe7
Binary files /dev/null and b/docs/native/r4/iphone-exploration-light.png differ
diff --git a/docs/native/r4/iphone-needs-accessibility-dark.png b/docs/native/r4/iphone-needs-accessibility-dark.png
new file mode 100644
index 00000000..800026c4
Binary files /dev/null and b/docs/native/r4/iphone-needs-accessibility-dark.png differ
diff --git a/docs/native/r4/iphone-needs-dark.png b/docs/native/r4/iphone-needs-dark.png
new file mode 100644
index 00000000..036e62e3
Binary files /dev/null and b/docs/native/r4/iphone-needs-dark.png differ
diff --git a/docs/native/r4/iphone-needs-light.png b/docs/native/r4/iphone-needs-light.png
new file mode 100644
index 00000000..0f160256
Binary files /dev/null and b/docs/native/r4/iphone-needs-light.png differ
diff --git a/docs/native/r4/iphone-notification-answered-dark.png b/docs/native/r4/iphone-notification-answered-dark.png
new file mode 100644
index 00000000..0ff07d6a
Binary files /dev/null and b/docs/native/r4/iphone-notification-answered-dark.png differ
diff --git a/docs/native/r4/iphone-notification-answered-light.png b/docs/native/r4/iphone-notification-answered-light.png
new file mode 100644
index 00000000..f14b2f48
Binary files /dev/null and b/docs/native/r4/iphone-notification-answered-light.png differ
diff --git a/docs/native/r4/iphone-notification-compact-dark.png b/docs/native/r4/iphone-notification-compact-dark.png
new file mode 100644
index 00000000..833cef45
Binary files /dev/null and b/docs/native/r4/iphone-notification-compact-dark.png differ
diff --git a/docs/native/r4/iphone-notification-compact-light.png b/docs/native/r4/iphone-notification-compact-light.png
new file mode 100644
index 00000000..79f19a9f
Binary files /dev/null and b/docs/native/r4/iphone-notification-compact-light.png differ
diff --git a/docs/native/r4/iphone-notification-dark.png b/docs/native/r4/iphone-notification-dark.png
new file mode 100644
index 00000000..6ad05f64
Binary files /dev/null and b/docs/native/r4/iphone-notification-dark.png differ
diff --git a/docs/native/r4/iphone-notification-light.png b/docs/native/r4/iphone-notification-light.png
new file mode 100644
index 00000000..80f7865e
Binary files /dev/null and b/docs/native/r4/iphone-notification-light.png differ
diff --git a/docs/native/r4/iphone-research-dark.png b/docs/native/r4/iphone-research-dark.png
new file mode 100644
index 00000000..a64ad995
Binary files /dev/null and b/docs/native/r4/iphone-research-dark.png differ
diff --git a/docs/native/r4/iphone-research-light.png b/docs/native/r4/iphone-research-light.png
new file mode 100644
index 00000000..6faac271
Binary files /dev/null and b/docs/native/r4/iphone-research-light.png differ
diff --git a/docs/native/r4/iphone-task-dark.png b/docs/native/r4/iphone-task-dark.png
new file mode 100644
index 00000000..a84831e9
Binary files /dev/null and b/docs/native/r4/iphone-task-dark.png differ
diff --git a/docs/native/r4/iphone-task-light.png b/docs/native/r4/iphone-task-light.png
new file mode 100644
index 00000000..ecd720b3
Binary files /dev/null and b/docs/native/r4/iphone-task-light.png differ
diff --git a/docs/native/r4/iphone-tasks-dark.png b/docs/native/r4/iphone-tasks-dark.png
new file mode 100644
index 00000000..c8c24476
Binary files /dev/null and b/docs/native/r4/iphone-tasks-dark.png differ
diff --git a/docs/native/r4/iphone-tasks-light.png b/docs/native/r4/iphone-tasks-light.png
new file mode 100644
index 00000000..942522c0
Binary files /dev/null and b/docs/native/r4/iphone-tasks-light.png differ
diff --git a/docs/native/r4/iphone-team-dark.png b/docs/native/r4/iphone-team-dark.png
new file mode 100644
index 00000000..c9de5701
Binary files /dev/null and b/docs/native/r4/iphone-team-dark.png differ
diff --git a/docs/native/r4/iphone-team-light.png b/docs/native/r4/iphone-team-light.png
new file mode 100644
index 00000000..aade0af5
Binary files /dev/null and b/docs/native/r4/iphone-team-light.png differ
diff --git a/docs/native/r4/iphone-teams-dark.png b/docs/native/r4/iphone-teams-dark.png
new file mode 100644
index 00000000..b0b2deb6
Binary files /dev/null and b/docs/native/r4/iphone-teams-dark.png differ
diff --git a/docs/native/r4/iphone-teams-light.png b/docs/native/r4/iphone-teams-light.png
new file mode 100644
index 00000000..eb27f5a4
Binary files /dev/null and b/docs/native/r4/iphone-teams-light.png differ
diff --git a/docs/native/r4/iphone-usage-concept-dark.png b/docs/native/r4/iphone-usage-concept-dark.png
new file mode 100644
index 00000000..6b8cd983
Binary files /dev/null and b/docs/native/r4/iphone-usage-concept-dark.png differ
diff --git a/docs/native/r4/iphone-usage-concept-light.png b/docs/native/r4/iphone-usage-concept-light.png
new file mode 100644
index 00000000..6a511847
Binary files /dev/null and b/docs/native/r4/iphone-usage-concept-light.png differ
diff --git a/docs/native/r4/mac-main-dark.png b/docs/native/r4/mac-main-dark.png
new file mode 100644
index 00000000..b7c688fc
Binary files /dev/null and b/docs/native/r4/mac-main-dark.png differ
diff --git a/docs/native/r4/mac-main-light.png b/docs/native/r4/mac-main-light.png
new file mode 100644
index 00000000..ee3a435f
Binary files /dev/null and b/docs/native/r4/mac-main-light.png differ
diff --git a/docs/native/r4/mac-menu-dark.png b/docs/native/r4/mac-menu-dark.png
new file mode 100644
index 00000000..102f106d
Binary files /dev/null and b/docs/native/r4/mac-menu-dark.png differ
diff --git a/docs/native/r4/mac-menu-light.png b/docs/native/r4/mac-menu-light.png
new file mode 100644
index 00000000..6f2cc92a
Binary files /dev/null and b/docs/native/r4/mac-menu-light.png differ
diff --git a/docs/native/r4/mac-notification-answered-dark.png b/docs/native/r4/mac-notification-answered-dark.png
new file mode 100644
index 00000000..69ea3755
Binary files /dev/null and b/docs/native/r4/mac-notification-answered-dark.png differ
diff --git a/docs/native/r4/mac-notification-answered-light.png b/docs/native/r4/mac-notification-answered-light.png
new file mode 100644
index 00000000..26cfc8e6
Binary files /dev/null and b/docs/native/r4/mac-notification-answered-light.png differ
diff --git a/docs/native/r4/mac-notification-compact-dark.png b/docs/native/r4/mac-notification-compact-dark.png
new file mode 100644
index 00000000..10f9cca3
Binary files /dev/null and b/docs/native/r4/mac-notification-compact-dark.png differ
diff --git a/docs/native/r4/mac-notification-compact-light.png b/docs/native/r4/mac-notification-compact-light.png
new file mode 100644
index 00000000..7f2933ec
Binary files /dev/null and b/docs/native/r4/mac-notification-compact-light.png differ
diff --git a/docs/native/r4/mac-notification-dark.png b/docs/native/r4/mac-notification-dark.png
new file mode 100644
index 00000000..87ad3b7e
Binary files /dev/null and b/docs/native/r4/mac-notification-dark.png differ
diff --git a/docs/native/r4/mac-notification-light.png b/docs/native/r4/mac-notification-light.png
new file mode 100644
index 00000000..d5d1422b
Binary files /dev/null and b/docs/native/r4/mac-notification-light.png differ
diff --git a/docs/native/sync-proposal.md b/docs/native/sync-proposal.md
new file mode 100644
index 00000000..195a381d
--- /dev/null
+++ b/docs/native/sync-proposal.md
@@ -0,0 +1,65 @@
+# Keeping web, iPhone and Mac in sync
+
+Draft engineering proposal for Paul, 2026-11-13. The decision is settled: the web leads, native follows a parity list, and native must not slow web delivery. This branch contains fixture apps and screenshots, not a connected client or a release gate installed in CI.
+
+## One core, two native interfaces
+
+Keep the production Swift package at `native/EquipoCore/` in this repository, beside `native/iOS/` and `native/macOS/`. The disposable version is at `native/mockups/EquipoCore/`. Promote its tested contract boundaries later; do not promote the fixture store or snapshot startup into production.
+
+The core should own generated API types, the HTTP client, device pairing, revision and retry handling, pagination, notification deduplication, and small presentation models. Inject credential storage and transport so it can be tested without a device or an account. Keep AppKit, UIKit, SwiftUI layout and Apple notification handling in their app targets. Share the meaning of an answer and the request that sends it; let each platform lay out the controls.
+
+Generate types and the client from `docs/api/equipo-v1.openapi.json` with a pinned Swift OpenAPI Generator, OpenAPI Runtime and URLSession transport. Copy the canonical specification into the package build input with a deterministic script and fail on drift. Commit the dependency lockfile. Run generation and compile both targets in native CI; replay server-owned response and error fixtures through the generated decoders. Do not maintain a second hand-written API specification.
+
+The mockup's small `scripts/generate-models.py` generates only the Codable response subset used by its fixtures. It does not generate a transport or cover the whole API. Replace it for a production app. Apple's generator supports OpenAPI 3.0.3 and 3.1.0; test this particular contract's unions, nullable integers, discriminators and error bodies before adopting it. See [https://github.com/apple/swift-openapi-generator](https://github.com/apple/swift-openapi-generator) and [https://github.com/apple/swift-openapi-generator/blob/main/Sources/swift-openapi-generator/Documentation.docc/Articles/Supported-OpenAPI-features.md](https://github.com/apple/swift-openapi-generator/blob/main/Sources/swift-openapi-generator/Documentation.docc/Articles/Supported-OpenAPI-features.md).
+
+## The parity list and CI rule
+
+Add a machine-readable `native/parity.json` when implementation starts. Every API change adds an immutable row, including additive fields, changed permissions, errors and removed behavior. Each row records a stable ID, affected operations, behavior revision, web release sequence, classification, owner, fixture/test references, and iOS and Mac evidence. Cosmetic changes can share a row only when they are the same API change.
+
+Use two classes:
+
+| Class | Must remain equivalent | Permitted platform differences |
+| --- | --- | --- |
+| `must_match` | Questions, approval scope, merge authority, money and budgets, access/revocation, secrets, unknown values and stale-state handling | Placement and native controls, while preserving the decision and its consequences |
+| `may_differ` | The information remains accurate | Layout, typography, animation, panel arrangement and other cosmetics |
+
+A feature can have both kinds of row. “What next” is a must-match decision; its card layout may differ. Provider headroom and budget meaning must match; the shape of a meter may differ. A native fallback to the current authenticated web decision can satisfy a row only if that fallback has its own passing test and explicit acceptance evidence. Hiding a required action does not count as parity.
+
+Give public web API releases monotonically increasing sequence numbers. Do not use commit counts or compare unrelated app version strings. An unaccepted change first released in sequence `N` has lag `R - N + 1` at current sequence `R`. Lag 1 is the one-release allowance; lag greater than 1 fails native CI for each affected app. For example, a change in release 42 may be pending at 42, but must be accepted by 43. An accepted row requires the exact behavior revision and a passing test in a build available to users, not a checkbox or a local branch. Pending or unknown evidence is never a pass.
+
+Web PR CI checks that API changes include a parity row and server fixtures. Web release CI publishes the sequence and compatibility manifest. A separate required native compatibility job checks the ledger on every web release and every native PR, and blocks native distribution when overdue. It reports debt without blocking web merge or deployment. Otherwise the decided “web leads” policy would be undone by the gate itself. This is the recommended placement of the failing CI check.
+
+The apps fetch a compatibility manifest on sign-in and foregrounding. This manifest and a meaningful feature-capability set are proposed additions: today's `/capabilities` has only `version: 1.0.0`, browser/device authentication flags and `part: 3b`. If an installed app cannot safely perform a decision, it opens that decision in the authenticated web app or asks for an update. The server must still reject unsupported or unauthorized mutations. App Store review delays are a reason to preserve server compatibility and web fallback, not to weaken a decision.
+
+Start the ledger with the gaps in [r4/index.md](r4/index.md). Do not pretend that main's commit is already a numbered API release or that these mockups have accepted any parity row.
+
+## How a change reaches an app
+
+1. The web change updates the OpenAPI contract, server fixtures and parity row together. A runner-only change still needs a row if its consequences affect a person's decisions.
+2. Native CI regenerates, compiles and replays fixtures. A native implementation records per-platform acceptance against the new behavior revision. Test 401, 403, missing/private 404, revision conflicts, duplicate delivery, cancelled questions and unknown values as well as success.
+3. The next web release publishes its compatibility manifest. Native CI recalculates lag and raises an assigned failure for overdue must-match rows. The web proceeds.
+4. A released app carries its compatibility evidence. On reconnect it re-reads the conversation, Needs you and open tasks, then reconciles by ID and revision. A notification or cached view never supplies permission.
+
+The runner wire protocol is currently 21; the person API advertises 1.0.0. They are separate contracts. The apps should not consume runner frames or learn protocol 21 merely to draw a task. Project new runner evidence into the person API, version that behavior, then follow the same list. Additive changes can stay in v1. Breaking changes need a negotiated capability or parallel version, a documented support window, and a safe web route for older apps.
+
+## Sign-in and notifications
+
+Use the person API's existing device pairing, similar to runner enrolment. Generate an Ed25519 key on the device, request `/auth/devices`, display the user code, and open the returned verification URI in the system browser. The signed-in person checks the device label and types the code. Merely opening the link grants nothing. Sign and exchange the challenge as specified in [../api/equipo-v1.md](../api/equipo-v1.md); respect the five-second poll floor, ten-minute challenge lifetime and expiry errors. Store the private key and thirty-day credential in Keychain, separated by instance and device. Never paste a token, put it in a deep link, mix bearer requests with browser cookies, or log proofs and credentials.
+
+Remembered Teams are navigation only. Check each instance independently; retain an unknown Needs you count until authenticated. Revocation, roster removal and session-epoch changes must invalidate open views and pending actions immediately when detected, with server checks on every write. Oficina ID is planned. Keep pairing behind an authentication interface so Oficina ID can replace the browser identity step later; do not invent an Oficina ID protocol or delay the first native client for it.
+
+Use today's notification subscriptions, polling cursors and acknowledgements first. Deduplicate by notification ID, preserve the subscription revision, and treat acknowledgement only as delivery bookkeeping. Handle expired subscriptions explicitly. The Coordinator has no native bearer event stream; the Assistant's separate SSE stream cannot be borrowed for it.
+
+Apple Push Notification service (APNs) is a future transport. It needs device-token registration and rotation, an authenticated association with the person device and subscription, APNs credentials on the server, and removal on revocation/sign-out. Keep the push payload to a notification ID and instance routing information; fetch the current private resource after authentication. Do not put question text, secrets, credentials or approval authority in a push payload. Polling and refresh remain the recovery path for delayed or dropped pushes.
+
+For a clarification, an authenticated notification action can offer the current options after refreshing `/questions/{id}`. Send the answer with its revision and a retained idempotency key. If it changed or expired, show the current question; never retry a stale answer as a new decision. Require unlocking for answers. Route merges, approvals, spending changes and Contra requests into the full app or authenticated web view for context. The r4 images explore compact and expanded notifications with direct answer choices and a local receipt. They are app-rendered concepts, not captures of working APNs or an OS notification extension. An authenticated app handoff remains my recommendation for the first connected version. Apple documents these action hooks at [https://developer.apple.com/documentation/usernotifications/declaring-your-actionable-notification-types](https://developer.apple.com/documentation/usernotifications/declaring-your-actionable-notification-types) and [https://developer.apple.com/documentation/usernotifications/unnotificationactionoptions](https://developer.apple.com/documentation/usernotifications/unnotificationactionoptions).
+
+## What to take from Eleven and Woodstar
+
+Eleven's `NativeChatView.swift` separates sidebar selection from the expensive conversation switch, retains per-thread state, and avoids a blank flash while a newly selected feed settles. `NativeFeedView.swift` preserves scroll anchors, pins to the bottom only when appropriate, and routes drops to the active pane. Its Mac composer uses an NSTextView-backed field. These files are SwiftUI composition with AppKit integration, rather than an entirely AppKit transcript. Equipo's r4 deliberately makes the transcript itself AppKit, as requested.
+
+LChatCore shares identity, API models and per-thread feed state across the apps. Its `NativeFeedModelCache` also binds saved scroll anchors to cached models. I would retain that ownership rule but keep platform image/font aliases and SwiftUI rendering helpers outside EquipoCore. WoodstarCore’s `CoalescedRunner` is a useful refresh pattern: a refresh requested during an existing pass waits for a subsequent pass, so a pull-to-refresh cannot finish against older data.
+
+Keep those behaviors, but start Equipo with a smaller NSScrollView/NSTextView implementation and stable message IDs. Use a virtualized AppKit list when transcript volume warrants it. Preserve selection, link handling and native text editing. Avoid copying Eleven's window-wide event monitors and retained hidden panes until Equipo needs them; bounded per-conversation models and explicit active-view routing are easier to reason about. The mockup does not implement virtualized history or production scroll restoration.
+
+From Woodstar, take system type, restrained violet tint, flat surfaces with full hairline borders, and a NavigationStack with a clear index behind the current screen. Keep glass on floating system chrome, not scrolling cards. Use symbols beside specialist names. Keep data and request policy shared while respecting each platform's layout. The first production slice should be pairing, conversation, Tasks and safe answers, with authenticated web fallback for the richer states until their API rows are accepted.
diff --git a/native/mockups/.gitignore b/native/mockups/.gitignore
new file mode 100644
index 00000000..47951142
--- /dev/null
+++ b/native/mockups/.gitignore
@@ -0,0 +1,7 @@
+.build/
+DerivedData/
+SourcePackages/
+*.xcresult/
+Captures/
+*.xcuserstate
+xcuserdata/
diff --git a/native/mockups/EquipoCore/Package.swift b/native/mockups/EquipoCore/Package.swift
new file mode 100644
index 00000000..ad1a72de
--- /dev/null
+++ b/native/mockups/EquipoCore/Package.swift
@@ -0,0 +1,11 @@
+// swift-tools-version: 5.9
+import PackageDescription
+let package = Package(
+ name: "EquipoCore",
+ platforms: [.iOS(.v17), .macOS(.v14)],
+ products: [.library(name: "EquipoCore", targets: ["EquipoCore"])],
+ targets: [
+ .target(name: "EquipoCore", resources: [.copy("Fixtures")]),
+ .testTarget(name: "EquipoCoreTests", dependencies: ["EquipoCore"])
+ ]
+)
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Core.swift b/native/mockups/EquipoCore/Sources/EquipoCore/Core.swift
new file mode 100644
index 00000000..3a8c5b60
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Core.swift
@@ -0,0 +1,51 @@
+import Foundation
+
+public enum Fixtures {
+ public static func load<T: Decodable>(_ name: String, as type: T.Type) throws -> T {
+ let url = Bundle.module.url(forResource: name, withExtension: "json", subdirectory: "Fixtures")!
+ return try JSONDecoder().decode(type, from: Data(contentsOf: url))
+ }
+}
+extension TeamLink {
+ public var needsLabel: String { needs_you.map { String($0) } ?? "Unknown" }
+}
+extension ConnectionModel {
+ public var allowanceLabel: String { allowance_remaining.map { String($0) } ?? "Not reported" }
+}
+extension ClarificationQuestion {
+ public func canSubmit(currentRevision: Int64) -> Bool {
+ guard state == "open" && can_answer && revision == currentRevision else { return false }
+ if let expires_at {
+ guard let expiry = ISO8601DateFormatter().date(from: expires_at), expiry > Date() else { return false }
+ }
+ return true
+ }
+}
+public struct MockStore {
+ public let teams: [TeamLink]
+ public let tasks: [EquipoTask]
+ public let projects: [Project]
+ public let conversation: ConversationPage
+ public let question: Question
+ public let connections: [Connection]
+ public let budgets: Budgets
+ public let notification: NotificationEvent
+ public init() {
+ teams = try! Fixtures.load("teams", as: Page<TeamLink>.self).items
+ tasks = try! Fixtures.load("tasks", as: Page<EquipoTask>.self).items
+ projects = try! Fixtures.load("projects", as: Page<Project>.self).items
+ conversation = try! Fixtures.load("conversation", as: ConversationPage.self)
+ question = try! Fixtures.load("question", as: Question.self)
+ connections = try! Fixtures.load("connections", as: Page<Connection>.self).items
+ budgets = try! Fixtures.load("budgets", as: Budgets.self)
+ notification = try! Fixtures.load("notification", as: NotificationEvent.self)
+ }
+ public func activeTask(for category: String) -> EquipoTask? {
+ tasks.first { task in
+ task.steps?.contains { $0.category == category && ["running", "waiting"].contains($0.state) } == true
+ }
+ }
+ public func project(for task: EquipoTask) -> String {
+ projects.first { $0.id == String(task.project_id) }?.name ?? "Unknown project"
+ }
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/budgets.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/budgets.json
new file mode 100644
index 00000000..bbe28c90
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/budgets.json
@@ -0,0 +1,17 @@
+{
+ "team": {
+ "calls": 1000,
+ "input_tokens": 2000000,
+ "output_tokens": 200000,
+ "seconds": 36000
+ },
+ "projects": {
+ "1": {
+ "calls": 200,
+ "input_tokens": 400000,
+ "output_tokens": 40000,
+ "seconds": 7200
+ }
+ },
+ "revision": 1
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/connections.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/connections.json
new file mode 100644
index 00000000..6ff8655e
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/connections.json
@@ -0,0 +1,40 @@
+{
+ "items": [
+ {
+ "id": "connection-claude",
+ "runner_id": "runner-studio",
+ "label": "Claude \u00b7 Work",
+ "revision": 1,
+ "revoked_at": null,
+ "models": [
+ {
+ "provider": "claude",
+ "family": "claude",
+ "model": "fixture-model",
+ "kind": "subscription",
+ "available": true,
+ "allowance_remaining": 72000
+ }
+ ]
+ },
+ {
+ "id": "connection-codex",
+ "runner_id": "runner-studio",
+ "label": "Codex \u00b7 Personal",
+ "revision": 1,
+ "revoked_at": null,
+ "models": [
+ {
+ "provider": "codex",
+ "family": "codex",
+ "model": "fixture-model",
+ "kind": "subscription",
+ "available": true,
+ "allowance_remaining": null
+ }
+ ]
+ }
+ ],
+ "next_cursor": "",
+ "revision": 1
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/conversation.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/conversation.json
new file mode 100644
index 00000000..0b07b04f
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/conversation.json
@@ -0,0 +1,44 @@
+{
+ "messages": [
+ {
+ "id": "message-1",
+ "conversation_id": "conversation-paul",
+ "thread_id": "",
+ "author_kind": "person",
+ "author_id": "paul@example.test",
+ "body": "Can you fix the VAT rounding on invoice PDFs?",
+ "sequence": 1,
+ "revision": 1,
+ "created_at": "2026-11-13T09:41:00Z",
+ "sources": []
+ },
+ {
+ "id": "message-2",
+ "conversation_id": "conversation-paul",
+ "thread_id": "",
+ "author_kind": "coordinator",
+ "author_id": "coordinator",
+ "body": "Engineering has fixed the rounding. Copy has one question about how the tax is described before Checks and Review continue.",
+ "sequence": 2,
+ "revision": 1,
+ "created_at": "2026-11-13T09:42:00Z",
+ "sources": []
+ }
+ ],
+ "cards": [
+ {
+ "id": "card-vat",
+ "kind": "question",
+ "resource_id": "question-vat",
+ "task_id": "task-vat",
+ "revision": 7,
+ "copy_key": "questions.clarification",
+ "actions": [
+ "answer"
+ ],
+ "waiting_task_id": "task-vat"
+ }
+ ],
+ "next_cursor": "",
+ "revision": 7
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/needs-you.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/needs-you.json
new file mode 100644
index 00000000..cf79825b
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/needs-you.json
@@ -0,0 +1,79 @@
+{
+ "items": [
+ {
+ "id": "task-vat",
+ "project_id": 1,
+ "requester": "paul@example.test",
+ "description": "Fix VAT on invoice PDFs",
+ "kind": "bug",
+ "state": "waiting",
+ "revision": 7,
+ "plan_revision": 2,
+ "replacement_id": "",
+ "can_cancel": true,
+ "can_merge": false,
+ "needs_you": true,
+ "steps": [
+ {
+ "key": "eng",
+ "category": "engineering",
+ "action": "Reproduce and fix the VAT rounding",
+ "state": "done",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "Fixed rounding before totals.",
+ "reason": "",
+ "usage": {
+ "calls": 4,
+ "input_tokens": 18400,
+ "output_tokens": 2600
+ },
+ "allowance_remaining": null
+ },
+ {
+ "key": "copy",
+ "category": "copy",
+ "action": "Check the invoice wording",
+ "state": "waiting",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "",
+ "reason": "copy_question",
+ "usage": null,
+ "allowance_remaining": null
+ },
+ {
+ "key": "checks",
+ "category": "checks",
+ "action": "Run invoice tests",
+ "state": "queued",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "",
+ "reason": "",
+ "usage": null,
+ "allowance_remaining": null
+ },
+ {
+ "key": "review",
+ "category": "review",
+ "action": "Review the change",
+ "state": "queued",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "",
+ "reason": "",
+ "usage": null,
+ "allowance_remaining": null
+ }
+ ],
+ "usage": {
+ "calls": 4,
+ "input_tokens": 18400,
+ "output_tokens": 2600
+ }
+ }
+ ],
+ "next_cursor": "",
+ "revision": 1
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/notification.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/notification.json
new file mode 100644
index 00000000..5564f14e
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/notification.json
@@ -0,0 +1,9 @@
+{
+ "id": "notification-vat",
+ "kind": "question",
+ "resource_id": "question-vat",
+ "deep_link": "/questions/question-vat",
+ "resource_revision": 7,
+ "created_at": "2026-11-13T09:43:00Z",
+ "state": "unread"
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/projects.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/projects.json
new file mode 100644
index 00000000..7c2bd529
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/projects.json
@@ -0,0 +1,28 @@
+{
+ "items": [
+ {
+ "id": "1",
+ "account_id": 1,
+ "name": "Equipo",
+ "repository": "https://forge.example.test/oficina/equipo",
+ "app_name": "equipo",
+ "default_branch": "main",
+ "kind": "app",
+ "owners": [],
+ "revision": 1
+ },
+ {
+ "id": "2",
+ "account_id": 1,
+ "name": "Woodstar",
+ "repository": "https://forge.example.test/oficina/woodstar",
+ "app_name": "woodstar",
+ "default_branch": "main",
+ "kind": "app",
+ "owners": [],
+ "revision": 1
+ }
+ ],
+ "next_cursor": "",
+ "revision": 1
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/question.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/question.json
new file mode 100644
index 00000000..74da0615
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/question.json
@@ -0,0 +1,23 @@
+{
+ "id": "question-vat",
+ "kind": "clarification",
+ "task_id": "task-vat",
+ "text": "Which tax label should appear on the invoice?",
+ "state": "open",
+ "revision": 7,
+ "can_answer": true,
+ "can_allow": false,
+ "options": [
+ {
+ "id": "vat",
+ "label": "VAT"
+ },
+ {
+ "id": "sales-tax",
+ "label": "Sales tax"
+ }
+ ],
+ "fields": [],
+ "allow_text": true,
+ "expires_at": null
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/tasks.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/tasks.json
new file mode 100644
index 00000000..f12b0919
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/tasks.json
@@ -0,0 +1,182 @@
+{
+ "items": [
+ {
+ "id": "task-vat",
+ "project_id": 1,
+ "requester": "paul@example.test",
+ "description": "Fix VAT on invoice PDFs",
+ "kind": "bug",
+ "state": "waiting",
+ "revision": 7,
+ "plan_revision": 2,
+ "replacement_id": "",
+ "can_cancel": true,
+ "can_merge": false,
+ "needs_you": true,
+ "steps": [
+ {
+ "key": "eng",
+ "category": "engineering",
+ "action": "Reproduce and fix the VAT rounding",
+ "state": "done",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "Fixed rounding before totals.",
+ "reason": "",
+ "usage": {
+ "calls": 4,
+ "input_tokens": 18400,
+ "output_tokens": 2600
+ },
+ "allowance_remaining": null
+ },
+ {
+ "key": "copy",
+ "category": "copy",
+ "action": "Check the invoice wording",
+ "state": "waiting",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "",
+ "reason": "copy_question",
+ "usage": null,
+ "allowance_remaining": null
+ },
+ {
+ "key": "checks",
+ "category": "checks",
+ "action": "Run invoice tests",
+ "state": "queued",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "",
+ "reason": "",
+ "usage": null,
+ "allowance_remaining": null
+ },
+ {
+ "key": "review",
+ "category": "review",
+ "action": "Review the change",
+ "state": "queued",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "",
+ "reason": "",
+ "usage": null,
+ "allowance_remaining": null
+ }
+ ],
+ "usage": {
+ "calls": 4,
+ "input_tokens": 18400,
+ "output_tokens": 2600
+ }
+ },
+ {
+ "id": "task-onboarding",
+ "project_id": 1,
+ "requester": "paul@example.test",
+ "description": "Explore a shorter setup",
+ "kind": "investigation",
+ "state": "running",
+ "revision": 7,
+ "plan_revision": 2,
+ "replacement_id": "",
+ "can_cancel": true,
+ "can_merge": false,
+ "needs_you": false,
+ "steps": [
+ {
+ "key": "design",
+ "category": "design",
+ "action": "Compare two setup flows",
+ "state": "running",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "Comparing the setup flows.",
+ "reason": "",
+ "usage": null,
+ "allowance_remaining": null
+ }
+ ],
+ "usage": {
+ "calls": 4,
+ "input_tokens": 18400,
+ "output_tokens": 2600
+ }
+ },
+ {
+ "id": "task-research",
+ "project_id": 2,
+ "requester": "paul@example.test",
+ "description": "Research calendar connections",
+ "kind": "investigation",
+ "state": "done",
+ "revision": 7,
+ "plan_revision": 2,
+ "replacement_id": "",
+ "can_cancel": true,
+ "can_merge": false,
+ "needs_you": false,
+ "steps": [
+ {
+ "key": "research",
+ "category": "research",
+ "action": "Read the calendar API guides",
+ "state": "done",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "Found three options for calendar access.",
+ "reason": "",
+ "usage": {
+ "calls": 4,
+ "input_tokens": 18400,
+ "output_tokens": 2600
+ },
+ "allowance_remaining": null
+ }
+ ],
+ "usage": {
+ "calls": 4,
+ "input_tokens": 18400,
+ "output_tokens": 2600
+ }
+ },
+ {
+ "id": "task-signin",
+ "project_id": 2,
+ "requester": "paul@example.test",
+ "description": "Check sign-in recovery",
+ "kind": "investigation",
+ "state": "running",
+ "revision": 7,
+ "plan_revision": 2,
+ "replacement_id": "",
+ "can_cancel": true,
+ "can_merge": false,
+ "needs_you": false,
+ "steps": [
+ {
+ "key": "engineering",
+ "category": "engineering",
+ "action": "Reproduce the sign-in issue",
+ "state": "running",
+ "model": "fixture-model",
+ "account": "connection-claude",
+ "actual": "Reading the session tests.",
+ "reason": "",
+ "usage": null,
+ "allowance_remaining": null
+ }
+ ],
+ "usage": {
+ "calls": 4,
+ "input_tokens": 18400,
+ "output_tokens": 2600
+ }
+ }
+ ],
+ "next_cursor": "",
+ "revision": 1
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/teams.json b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/teams.json
new file mode 100644
index 00000000..83e848b4
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Fixtures/teams.json
@@ -0,0 +1,22 @@
+{
+ "items": [
+ {
+ "id": "team-oficina",
+ "name": "Oficina",
+ "origin": "https://oficina.example.test",
+ "last_signed_in_at": "2026-11-13T09:30:00Z",
+ "needs_you": 1,
+ "revision": 1
+ },
+ {
+ "id": "team-tito",
+ "name": "Tito",
+ "origin": "https://tito.example.test",
+ "last_signed_in_at": "2026-11-12T16:00:00Z",
+ "needs_you": null,
+ "revision": 1
+ }
+ ],
+ "next_cursor": "",
+ "revision": 1
+}
diff --git a/native/mockups/EquipoCore/Sources/EquipoCore/Models.swift b/native/mockups/EquipoCore/Sources/EquipoCore/Models.swift
new file mode 100644
index 00000000..f70240d1
--- /dev/null
+++ b/native/mockups/EquipoCore/Sources/EquipoCore/Models.swift
@@ -0,0 +1,190 @@
+// Generated from docs/api/equipo-v1.openapi.json. Fixture DTOs only.
+import Foundation
+
+public struct Person: Codable {
+ public var `address`: String
+ public var `display_identity`: String
+ public var `active`: Bool
+ public var `role`: String
+}
+
+public struct Me: Codable {
+ public var `person`: Person
+ public var `team_id`: String
+ public var `team_name`: String
+ public var `revision`: Int64
+}
+
+public struct TeamLink: Codable, Identifiable {
+ public var `id`: String
+ public var `last_signed_in_at`: String?
+ public var `name`: String
+ public var `needs_you`: Int64?
+ public var `origin`: String
+ public var `revision`: Int64
+}
+
+public struct Project: Codable, Identifiable {
+ public var `account_id`: Int64
+ public var `app_name`: String
+ public var `default_branch`: String
+ public var `id`: String
+ public var `kind`: String
+ public var `name`: String
+ public var `owners`: [DecisionOwner]?
+ public var `repository`: String
+ public var `revision`: Int64
+}
+
+public struct DecisionOwner: Codable {
+ public var `address`: String
+ public var `decision`: String
+}
+
+public struct EquipoTask: Codable, Identifiable {
+ public var `id`: String
+ public var `project_id`: Int64
+ public var `requester`: String
+ public var `description`: String
+ public var `kind`: String
+ public var `state`: String
+ public var `revision`: Int64
+ public var `plan_revision`: Int64
+ public var `replacement_id`: String
+ public var `can_cancel`: Bool
+ public var `can_merge`: Bool
+ public var `needs_you`: Bool
+ public var `steps`: [Step]?
+ public var `usage`: Usage?
+}
+
+public struct Step: Codable {
+ public var `key`: String
+ public var `category`: String
+ public var `action`: String
+ public var `state`: String
+ public var `model`: String
+ public var `account`: String
+ public var `actual`: String
+ public var `reason`: String
+ public var `usage`: Usage?
+ public var `allowance_remaining`: Int64?
+}
+
+public struct Usage: Codable {
+ public var `calls`: Int64
+ public var `input_tokens`: Int64
+ public var `output_tokens`: Int64
+}
+
+public struct Message: Codable, Identifiable {
+ public var `id`: String
+ public var `conversation_id`: String
+ public var `thread_id`: String
+ public var `author_kind`: String
+ public var `author_id`: String
+ public var `body`: String
+ public var `sequence`: Int64
+ public var `revision`: Int64
+ public var `created_at`: String
+ public var `sources`: [SourceRef]?
+}
+
+public struct SourceRef: Codable, Identifiable {
+ public var `kind`: String
+ public var `id`: String
+ public var `hash`: String
+ public var `revision`: Int64
+}
+
+public struct Card: Codable, Identifiable {
+ public var `id`: String
+ public var `kind`: String
+ public var `resource_id`: String
+ public var `task_id`: String
+ public var `revision`: Int64
+ public var `copy_key`: String
+ public var `actions`: [String]?
+ public var `waiting_task_id`: String
+}
+
+public struct ConversationPage: Codable {
+ public var `messages`: [Message]?
+ public var `cards`: [Card]?
+ public var `next_cursor`: String
+ public var `revision`: Int64
+}
+
+public struct ClarificationQuestion: Codable, Identifiable {
+ public var `id`: String
+ public var `kind`: String
+ public var `task_id`: String
+ public var `text`: String
+ public var `state`: String
+ public var `revision`: Int64
+ public var `can_answer`: Bool
+ public var `can_allow`: Bool
+ public var `options`: [QuestionOption]?
+ public var `fields`: [Field]?
+ public var `allow_text`: Bool
+ public var `expires_at`: String?
+}
+
+public struct QuestionOption: Codable, Identifiable {
+ public var `id`: String
+ public var `label`: String
+}
+
+public struct Field: Codable {
+ public var `key`: String
+ public var `prompt`: String
+}
+
+public struct Connection: Codable, Identifiable {
+ public var `id`: String
+ public var `label`: String
+ public var `models`: [ConnectionModel]?
+ public var `revision`: Int64
+ public var `revoked_at`: String?
+ public var `runner_id`: String
+}
+
+public struct ConnectionModel: Codable {
+ public var `allowance_remaining`: Int64?
+ public var `available`: Bool
+ public var `family`: String
+ public var `kind`: String
+ public var `model`: String
+ public var `provider`: String
+}
+
+public struct Budgets: Codable {
+ public var `projects`: [String: PeriodLimits]
+ public var `revision`: Int64
+ public var `team`: PeriodLimits
+}
+
+public struct PeriodLimits: Codable {
+ public var `calls`: Int64
+ public var `input_tokens`: Int64
+ public var `output_tokens`: Int64
+ public var `seconds`: Int64
+}
+
+public struct NotificationEvent: Codable, Identifiable {
+ public var `id`: String
+ public var `kind`: String
+ public var `resource_id`: String
+ public var `deep_link`: String
+ public var `resource_revision`: Int64
+ public var `created_at`: String
+ public var `state`: String
+}
+
+public typealias Question = ClarificationQuestion
+
+public struct Page<Item: Codable>: Codable {
+ public var items: [Item]
+ public var next_cursor: String
+ public var revision: Int64
+}
diff --git a/native/mockups/EquipoCore/Tests/EquipoCoreTests/ContractTests.swift b/native/mockups/EquipoCore/Tests/EquipoCoreTests/ContractTests.swift
new file mode 100644
index 00000000..bdd852b3
--- /dev/null
+++ b/native/mockups/EquipoCore/Tests/EquipoCoreTests/ContractTests.swift
@@ -0,0 +1,48 @@
+import XCTest
+@testable import EquipoCore
+
+final class ContractTests: XCTestCase {
+ func testUnknownIsNotZero() throws {
+ let teams = try Fixtures.load("teams", as: Page<TeamLink>.self)
+ XCTAssertNil(teams.items.last?.needs_you)
+ XCTAssertEqual(teams.items.last?.needsLabel, "Unknown")
+ let connections = try Fixtures.load("connections", as: Page<Connection>.self)
+ XCTAssertNil(connections.items[1].models?.first?.allowance_remaining)
+ XCTAssertEqual(connections.items[1].models?.first?.allowanceLabel, "Not reported")
+ }
+ func testDecisionsExcludeOrdinaryWork() throws {
+ let tasks = try Fixtures.load("tasks", as: Page<EquipoTask>.self)
+ XCTAssertEqual(tasks.items.filter(\.needs_you).map(\.id), ["task-vat"])
+ let needs = try Fixtures.load("needs-you", as: Page<EquipoTask>.self)
+ XCTAssertEqual(needs.items.map(\.id), ["task-vat"])
+ }
+ func testQuestionMustBeCurrentAndAnswerable() throws {
+ var question = try Fixtures.load("question", as: Question.self)
+ XCTAssertTrue(question.canSubmit(currentRevision: 7))
+ XCTAssertFalse(question.canSubmit(currentRevision: 6))
+ question.state = "answered"
+ XCTAssertFalse(question.canSubmit(currentRevision: 7))
+ question.state = "open"
+ question.can_answer = false
+ XCTAssertFalse(question.canSubmit(currentRevision: 7))
+ }
+ func testExpiredQuestionCannotBeAnswered() throws {
+ var question = try Fixtures.load("question", as: Question.self)
+ question.expires_at = "2000-01-01T00:00:00Z"
+ XCTAssertFalse(question.canSubmit(currentRevision: 7))
+ question.expires_at = "not-a-date"
+ XCTAssertFalse(question.canSubmit(currentRevision: 7))
+ }
+ func testSpecialistUsesTheRunningTask() {
+ let store = MockStore()
+ XCTAssertEqual(store.activeTask(for: "engineering")?.id, "task-signin")
+ XCTAssertEqual(store.activeTask(for: "copy")?.id, "task-vat")
+ XCTAssertNil(store.activeTask(for: "review"))
+ }
+ func testFixturesDecode() throws {
+ _ = try Fixtures.load("conversation", as: ConversationPage.self)
+ _ = try Fixtures.load("projects", as: Page<Project>.self)
+ _ = try Fixtures.load("budgets", as: Budgets.self)
+ _ = try Fixtures.load("notification", as: NotificationEvent.self)
+ }
+}
diff --git a/native/mockups/EquipoMockups.xcodeproj/project.pbxproj b/native/mockups/EquipoMockups.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..5f4c1982
--- /dev/null
+++ b/native/mockups/EquipoMockups.xcodeproj/project.pbxproj
@@ -0,0 +1,327 @@
+// !$*UTF8*$!
+{
+"archiveVersion" = 1;
+"classes" = {
+
+};
+"objectVersion" = 56;
+"objects" = {
+"9A32F360C8C381165C453B09" = {
+"isa" = "PBXFileReference";
+"lastKnownFileType" = "sourcecode.swift";
+"path" = "Shared/Components.swift";
+"sourceTree" = "<group>";
+};
+"4C88AE69E2BF7A63C18FC8DC" = {
+"isa" = "PBXFileReference";
+"lastKnownFileType" = "sourcecode.swift";
+"path" = "Shared/Theme.swift";
+"sourceTree" = "<group>";
+};
+"77D3D48B196F4CA8E45B435F" = {
+"isa" = "PBXFileReference";
+"lastKnownFileType" = "sourcecode.swift";
+"path" = "iOS/EquipoPhoneApp.swift";
+"sourceTree" = "<group>";
+};
+"310624EC755027929E86A63C" = {
+"isa" = "PBXFileReference";
+"lastKnownFileType" = "sourcecode.swift";
+"path" = "Mac/EquipoMacApp.swift";
+"sourceTree" = "<group>";
+};
+"0BF32EF05DC119C2AF6FDCF2" = {
+"isa" = "PBXFileReference";
+"lastKnownFileType" = "sourcecode.swift";
+"path" = "Mac/MacPanels.swift";
+"sourceTree" = "<group>";
+};
+"8AD34A7A0B76F4C31697F39A" = {
+"isa" = "PBXFileReference";
+"lastKnownFileType" = "sourcecode.swift";
+"path" = "Mac/NativeTranscript.swift";
+"sourceTree" = "<group>";
+};
+"582681C2EAE02B3F3D399C0C" = {
+"isa" = "XCLocalSwiftPackageReference";
+"relativePath" = "EquipoCore";
+};
+"E2A1AEF95091E82D9AB96427" = {
+"isa" = "PBXFileReference";
+"explicitFileType" = "wrapper.application";
+"path" = "EquipoPhone.app";
+"sourceTree" = "BUILT_PRODUCTS_DIR";
+};
+"215FCF780EBFE2096ABCB294" = {
+"isa" = "XCSwiftPackageProductDependency";
+"package" = "582681C2EAE02B3F3D399C0C";
+"productName" = "EquipoCore";
+};
+"7C337D417A390DDFEAB64703" = {
+"isa" = "PBXBuildFile";
+"productRef" = "215FCF780EBFE2096ABCB294";
+};
+"3B681A9FC64AB7C81A713615" = {
+"isa" = "PBXBuildFile";
+"fileRef" = "9A32F360C8C381165C453B09";
+};
+"6343DE7DFCD06C16BAC44A8C" = {
+"isa" = "PBXBuildFile";
+"fileRef" = "4C88AE69E2BF7A63C18FC8DC";
+};
+"BD7FFD04441E90C1615CB9FF" = {
+"isa" = "PBXBuildFile";
+"fileRef" = "77D3D48B196F4CA8E45B435F";
+};
+"C25567FF6C745D91FC82DCAA" = {
+"isa" = "PBXSourcesBuildPhase";
+"buildActionMask" = 2147483647;
+"files" = ("3B681A9FC64AB7C81A713615", "6343DE7DFCD06C16BAC44A8C", "BD7FFD04441E90C1615CB9FF");
+"runOnlyForDeploymentPostprocessing" = 0;
+};
+"B5240689BD1A36088B8B12CF" = {
+"isa" = "PBXFrameworksBuildPhase";
+"buildActionMask" = 2147483647;
+"files" = ("7C337D417A390DDFEAB64703");
+"runOnlyForDeploymentPostprocessing" = 0;
+};
+"81A76CD38166E2049140EA08" = {
+"isa" = "PBXResourcesBuildPhase";
+"buildActionMask" = 2147483647;
+"files" = ();
+"runOnlyForDeploymentPostprocessing" = 0;
+};
+"14315D882F4DB94D520EB70A" = {
+"isa" = "XCBuildConfiguration";
+"buildSettings" = {
+"PRODUCT_NAME" = "$(TARGET_NAME)";
+"PRODUCT_BUNDLE_IDENTIFIER" = "net.oficina.equipo.r4.ios";
+"SWIFT_VERSION" = "5.0";
+"GENERATE_INFOPLIST_FILE" = "YES";
+"CODE_SIGNING_ALLOWED" = "NO";
+"SDKROOT" = "iphoneos";
+"MARKETING_VERSION" = "0.4";
+"CURRENT_PROJECT_VERSION" = "4";
+"INFOPLIST_KEY_CFBundleDisplayName" = "Equipo R4";
+"ENABLE_USER_SCRIPT_SANDBOXING" = "YES";
+"IPHONEOS_DEPLOYMENT_TARGET" = "17.0";
+"TARGETED_DEVICE_FAMILY" = "1";
+"SUPPORTED_PLATFORMS" = "iphoneos iphonesimulator";
+"INFOPLIST_KEY_UILaunchScreen_Generation" = "YES";
+"INFOPLIST_KEY_UIApplicationSceneManifest_Generation" = "YES";
+"INFOPLIST_KEY_UISupportedInterfaceOrientations" = "UIInterfaceOrientationPortrait";
+"ONLY_ACTIVE_ARCH" = "YES";
+"SWIFT_OPTIMIZATION_LEVEL" = "-Onone";
+};
+"name" = "Debug";
+};
+"186B95BC7E639E8FB1AA9A84" = {
+"isa" = "XCBuildConfiguration";
+"buildSettings" = {
+"PRODUCT_NAME" = "$(TARGET_NAME)";
+"PRODUCT_BUNDLE_IDENTIFIER" = "net.oficina.equipo.r4.ios";
+"SWIFT_VERSION" = "5.0";
+"GENERATE_INFOPLIST_FILE" = "YES";
+"CODE_SIGNING_ALLOWED" = "NO";
+"SDKROOT" = "iphoneos";
+"MARKETING_VERSION" = "0.4";
+"CURRENT_PROJECT_VERSION" = "4";
+"INFOPLIST_KEY_CFBundleDisplayName" = "Equipo R4";
+"ENABLE_USER_SCRIPT_SANDBOXING" = "YES";
+"IPHONEOS_DEPLOYMENT_TARGET" = "17.0";
+"TARGETED_DEVICE_FAMILY" = "1";
+"SUPPORTED_PLATFORMS" = "iphoneos iphonesimulator";
+"INFOPLIST_KEY_UILaunchScreen_Generation" = "YES";
+"INFOPLIST_KEY_UIApplicationSceneManifest_Generation" = "YES";
+"INFOPLIST_KEY_UISupportedInterfaceOrientations" = "UIInterfaceOrientationPortrait";
+"ONLY_ACTIVE_ARCH" = "NO";
+"SWIFT_OPTIMIZATION_LEVEL" = "-O";
+};
+"name" = "Release";
+};
+"0F2BE8D6EBBCDEFACC670A17" = {
+"isa" = "XCConfigurationList";
+"buildConfigurations" = ("14315D882F4DB94D520EB70A", "186B95BC7E639E8FB1AA9A84");
+"defaultConfigurationIsVisible" = 0;
+"defaultConfigurationName" = "Debug";
+};
+"AB526D6441E6594E13D006BF" = {
+"isa" = "PBXNativeTarget";
+"buildConfigurationList" = "0F2BE8D6EBBCDEFACC670A17";
+"buildPhases" = ("C25567FF6C745D91FC82DCAA", "B5240689BD1A36088B8B12CF", "81A76CD38166E2049140EA08");
+"buildRules" = ();
+"dependencies" = ();
+"name" = "EquipoPhone";
+"productName" = "EquipoPhone";
+"productReference" = "E2A1AEF95091E82D9AB96427";
+"productType" = "com.apple.product-type.application";
+"packageProductDependencies" = ("215FCF780EBFE2096ABCB294");
+};
+"CAAA41D9138ADAA6FFED867E" = {
+"isa" = "PBXFileReference";
+"explicitFileType" = "wrapper.application";
+"path" = "EquipoMac.app";
+"sourceTree" = "BUILT_PRODUCTS_DIR";
+};
+"0B480BD6198259D40773D238" = {
+"isa" = "XCSwiftPackageProductDependency";
+"package" = "582681C2EAE02B3F3D399C0C";
+"productName" = "EquipoCore";
+};
+"C42BE94DC1A122435B02F37C" = {
+"isa" = "PBXBuildFile";
+"productRef" = "0B480BD6198259D40773D238";
+};
+"9EC2DCD4EF73C1F55E3711A4" = {
+"isa" = "PBXBuildFile";
+"fileRef" = "9A32F360C8C381165C453B09";
+};
+"157DBD90D3BA7E416FDF7DF2" = {
+"isa" = "PBXBuildFile";
+"fileRef" = "4C88AE69E2BF7A63C18FC8DC";
+};
+"84B5E38A4644C046B498A36D" = {
+"isa" = "PBXBuildFile";
+"fileRef" = "310624EC755027929E86A63C";
+};
+"6528FBE13898B654F6FA2B99" = {
+"isa" = "PBXBuildFile";
+"fileRef" = "0BF32EF05DC119C2AF6FDCF2";
+};
+"9CF224D8099DAEA88A7879D8" = {
+"isa" = "PBXBuildFile";
+"fileRef" = "8AD34A7A0B76F4C31697F39A";
+};
+"970DDFB7275054EB69197FD9" = {
+"isa" = "PBXSourcesBuildPhase";
+"buildActionMask" = 2147483647;
+"files" = ("9EC2DCD4EF73C1F55E3711A4", "157DBD90D3BA7E416FDF7DF2", "84B5E38A4644C046B498A36D", "6528FBE13898B654F6FA2B99", "9CF224D8099DAEA88A7879D8");
+"runOnlyForDeploymentPostprocessing" = 0;
+};
+"FC5C63BDA68734DFDE79CC76" = {
+"isa" = "PBXFrameworksBuildPhase";
+"buildActionMask" = 2147483647;
+"files" = ("C42BE94DC1A122435B02F37C");
+"runOnlyForDeploymentPostprocessing" = 0;
+};
+"B8F38B9A093D0324834059D9" = {
+"isa" = "PBXResourcesBuildPhase";
+"buildActionMask" = 2147483647;
+"files" = ();
+"runOnlyForDeploymentPostprocessing" = 0;
+};
+"02CD2281E4562550E80EA15C" = {
+"isa" = "XCBuildConfiguration";
+"buildSettings" = {
+"PRODUCT_NAME" = "$(TARGET_NAME)";
+"PRODUCT_BUNDLE_IDENTIFIER" = "net.oficina.equipo.r4.mac";
+"SWIFT_VERSION" = "5.0";
+"GENERATE_INFOPLIST_FILE" = "YES";
+"CODE_SIGNING_ALLOWED" = "NO";
+"SDKROOT" = "macosx";
+"MARKETING_VERSION" = "0.4";
+"CURRENT_PROJECT_VERSION" = "4";
+"INFOPLIST_KEY_CFBundleDisplayName" = "Equipo R4";
+"ENABLE_USER_SCRIPT_SANDBOXING" = "YES";
+"MACOSX_DEPLOYMENT_TARGET" = "14.0";
+"SUPPORTED_PLATFORMS" = "macosx";
+"ONLY_ACTIVE_ARCH" = "YES";
+"SWIFT_OPTIMIZATION_LEVEL" = "-Onone";
+};
+"name" = "Debug";
+};
+"DCBEDD96942A4B354EB42387" = {
+"isa" = "XCBuildConfiguration";
+"buildSettings" = {
+"PRODUCT_NAME" = "$(TARGET_NAME)";
+"PRODUCT_BUNDLE_IDENTIFIER" = "net.oficina.equipo.r4.mac";
+"SWIFT_VERSION" = "5.0";
+"GENERATE_INFOPLIST_FILE" = "YES";
+"CODE_SIGNING_ALLOWED" = "NO";
+"SDKROOT" = "macosx";
+"MARKETING_VERSION" = "0.4";
+"CURRENT_PROJECT_VERSION" = "4";
+"INFOPLIST_KEY_CFBundleDisplayName" = "Equipo R4";
+"ENABLE_USER_SCRIPT_SANDBOXING" = "YES";
+"MACOSX_DEPLOYMENT_TARGET" = "14.0";
+"SUPPORTED_PLATFORMS" = "macosx";
+"ONLY_ACTIVE_ARCH" = "NO";
+"SWIFT_OPTIMIZATION_LEVEL" = "-O";
+};
+"name" = "Release";
+};
+"FF8BA39AA8277064E4F694AA" = {
+"isa" = "XCConfigurationList";
+"buildConfigurations" = ("02CD2281E4562550E80EA15C", "DCBEDD96942A4B354EB42387");
+"defaultConfigurationIsVisible" = 0;
+"defaultConfigurationName" = "Debug";
+};
+"AE4F9B09FC1BF6AEA29782B7" = {
+"isa" = "PBXNativeTarget";
+"buildConfigurationList" = "FF8BA39AA8277064E4F694AA";
+"buildPhases" = ("970DDFB7275054EB69197FD9", "FC5C63BDA68734DFDE79CC76", "B8F38B9A093D0324834059D9");
+"buildRules" = ();
+"dependencies" = ();
+"name" = "EquipoMac";
+"productName" = "EquipoMac";
+"productReference" = "CAAA41D9138ADAA6FFED867E";
+"productType" = "com.apple.product-type.application";
+"packageProductDependencies" = ("0B480BD6198259D40773D238");
+};
+"FBDC4F23F93125BBEEAE800C" = {
+"isa" = "PBXGroup";
+"children" = ("E2A1AEF95091E82D9AB96427", "CAAA41D9138ADAA6FFED867E");
+"name" = "Products";
+"sourceTree" = "<group>";
+};
+"325F10A6957A34D66CB8C0E4" = {
+"isa" = "PBXGroup";
+"children" = ("9A32F360C8C381165C453B09", "4C88AE69E2BF7A63C18FC8DC", "77D3D48B196F4CA8E45B435F", "310624EC755027929E86A63C", "0BF32EF05DC119C2AF6FDCF2", "8AD34A7A0B76F4C31697F39A", "FBDC4F23F93125BBEEAE800C");
+"sourceTree" = "<group>";
+};
+"89E1FD6268CC0F221A2BE178" = {
+"isa" = "XCBuildConfiguration";
+"buildSettings" = {
+"CLANG_ENABLE_MODULES" = "YES";
+"SWIFT_VERSION" = "5.0";
+"ONLY_ACTIVE_ARCH" = "YES";
+"SWIFT_OPTIMIZATION_LEVEL" = "-Onone";
+};
+"name" = "Debug";
+};
+"E6DE6C99132752C914FEF632" = {
+"isa" = "XCBuildConfiguration";
+"buildSettings" = {
+"CLANG_ENABLE_MODULES" = "YES";
+"SWIFT_VERSION" = "5.0";
+"ONLY_ACTIVE_ARCH" = "NO";
+"SWIFT_OPTIMIZATION_LEVEL" = "-O";
+};
+"name" = "Release";
+};
+"862894B703A6DEDF96A9DD6C" = {
+"isa" = "XCConfigurationList";
+"buildConfigurations" = ("89E1FD6268CC0F221A2BE178", "E6DE6C99132752C914FEF632");
+"defaultConfigurationIsVisible" = 0;
+"defaultConfigurationName" = "Debug";
+};
+"98F54143AB4E86B28C3AFEE0" = {
+"isa" = "PBXProject";
+"attributes" = {
+"LastUpgradeCheck" = "2720";
+};
+"buildConfigurationList" = "862894B703A6DEDF96A9DD6C";
+"compatibilityVersion" = "Xcode 14.0";
+"developmentRegion" = "en";
+"hasScannedForEncodings" = 0;
+"knownRegions" = ("en", "Base");
+"mainGroup" = "325F10A6957A34D66CB8C0E4";
+"productRefGroup" = "FBDC4F23F93125BBEEAE800C";
+"projectDirPath" = "";
+"projectRoot" = "";
+"targets" = ("AB526D6441E6594E13D006BF", "AE4F9B09FC1BF6AEA29782B7");
+"packageReferences" = ("582681C2EAE02B3F3D399C0C");
+};
+};
+"rootObject" = "98F54143AB4E86B28C3AFEE0";
+}
diff --git a/native/mockups/EquipoMockups.xcodeproj/xcshareddata/xcschemes/EquipoMac.xcscheme b/native/mockups/EquipoMockups.xcodeproj/xcshareddata/xcschemes/EquipoMac.xcscheme
new file mode 100644
index 00000000..3941e702
--- /dev/null
+++ b/native/mockups/EquipoMockups.xcodeproj/xcshareddata/xcschemes/EquipoMac.xcscheme
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme LastUpgradeVersion="2720" version="1.3">
+<BuildAction parallelizeBuildables="YES" buildImplicitDependencies="YES"><BuildActionEntries><BuildActionEntry buildForTesting="YES" buildForRunning="YES" buildForProfiling="YES" buildForArchiving="NO" buildForAnalyzing="YES"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="AE4F9B09FC1BF6AEA29782B7" BuildableName="EquipoMac.app" BlueprintName="EquipoMac" ReferencedContainer="container:EquipoMockups.xcodeproj"/></BuildActionEntry></BuildActionEntries></BuildAction>
+<LaunchAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.IDEFoundation.Launcher.LLDB" launchStyle="0" useCustomWorkingDirectory="NO" ignoresPersistentStateOnLaunch="NO" debugDocumentVersioning="YES" allowLocationSimulation="YES"><BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="AE4F9B09FC1BF6AEA29782B7" BuildableName="EquipoMac.app" BlueprintName="EquipoMac" ReferencedContainer="container:EquipoMockups.xcodeproj"/></BuildableProductRunnable></LaunchAction>
+</Scheme>
diff --git a/native/mockups/EquipoMockups.xcodeproj/xcshareddata/xcschemes/EquipoPhone.xcscheme b/native/mockups/EquipoMockups.xcodeproj/xcshareddata/xcschemes/EquipoPhone.xcscheme
new file mode 100644
index 00000000..9785b19d
--- /dev/null
+++ b/native/mockups/EquipoMockups.xcodeproj/xcshareddata/xcschemes/EquipoPhone.xcscheme
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme LastUpgradeVersion="2720" version="1.3">
+<BuildAction parallelizeBuildables="YES" buildImplicitDependencies="YES"><BuildActionEntries><BuildActionEntry buildForTesting="YES" buildForRunning="YES" buildForProfiling="YES" buildForArchiving="NO" buildForAnalyzing="YES"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="AB526D6441E6594E13D006BF" BuildableName="EquipoPhone.app" BlueprintName="EquipoPhone" ReferencedContainer="container:EquipoMockups.xcodeproj"/></BuildActionEntry></BuildActionEntries></BuildAction>
+<LaunchAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.IDEFoundation.Launcher.LLDB" launchStyle="0" useCustomWorkingDirectory="NO" ignoresPersistentStateOnLaunch="NO" debugDocumentVersioning="YES" allowLocationSimulation="YES"><BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="AB526D6441E6594E13D006BF" BuildableName="EquipoPhone.app" BlueprintName="EquipoPhone" ReferencedContainer="container:EquipoMockups.xcodeproj"/></BuildableProductRunnable></LaunchAction>
+</Scheme>
diff --git a/native/mockups/Mac/EquipoMacApp.swift b/native/mockups/Mac/EquipoMacApp.swift
new file mode 100644
index 00000000..d04e9c3b
--- /dev/null
+++ b/native/mockups/Mac/EquipoMacApp.swift
@@ -0,0 +1,119 @@
+import AppKit
+import SwiftUI
+import EquipoCore
+
+final class MainContent: NSView {
+ override var isFlipped: Bool { true }
+ let sidebar = NSHostingView(rootView: MacSidebar())
+ let transcript: NativeTranscript
+ let inspector: NSHostingView<MacInspector>
+ init(store: MockStore) {
+ transcript = NativeTranscript(store: store)
+ inspector = NSHostingView(rootView: MacInspector(store: store))
+ super.init(frame: NSRect(x: 0, y: 0, width: 1400, height: 900))
+ [sidebar, transcript, inspector].forEach { addSubview($0) }
+ }
+ required init?(coder: NSCoder) { fatalError() }
+ override func layout() {
+ super.layout()
+ sidebar.frame = NSRect(x: 0, y: 0, width: 256, height: bounds.height)
+ transcript.frame = NSRect(x: 257, y: 0, width: bounds.width - 598, height: bounds.height)
+ inspector.frame = NSRect(x: bounds.width - 340, y: 0, width: 340, height: bounds.height)
+ }
+ override func draw(_ rect: NSRect) {
+ NSColor.separatorColor.setFill()
+ NSRect(x: 256, y: 0, width: 1, height: bounds.height).fill()
+ NSRect(x: bounds.width - 341, y: 0, width: 1, height: bounds.height).fill()
+ }
+}
+@main
+final class EquipoMacApp: NSObject, NSApplicationDelegate {
+ let store = MockStore()
+ var window: NSWindow?
+ var statusItem: NSStatusItem?
+ var popover: NSPopover?
+ static func main() {
+ let app = NSApplication.shared
+ let delegate = EquipoMacApp()
+ app.delegate = delegate
+ withExtendedLifetime(delegate) { app.run() }
+ }
+ func applicationDidFinishLaunching(_ notification: Notification) {
+ let args = ProcessInfo.processInfo.arguments
+ if let i = args.firstIndex(of: "--snapshots"), args.indices.contains(i + 1) {
+ NSApp.setActivationPolicy(.prohibited)
+ DispatchQueue.main.async { self.snapshots(to: args[i + 1]); NSApp.terminate(nil) }
+ return
+ }
+ NSApp.setActivationPolicy(.regular)
+ let window = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 1400, height: 900), styleMask: [.titled, .closable, .miniaturizable, .resizable], backing: .buffered, defer: false)
+ window.title = "Equipo"
+ window.contentView = MainContent(store: store)
+ window.center()
+ window.makeKeyAndOrderFront(nil)
+ self.window = window
+ let item = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
+ item.button?.image = NSImage(systemSymbolName: "hand.raised", accessibilityDescription: "Needs you")
+ item.button?.title = " 1"
+ item.button?.target = self
+ item.button?.action = #selector(togglePopover)
+ statusItem = item
+ let menu = NSMenu()
+ let appMenu = NSMenu()
+ appMenu.addItem(withTitle: "Quit Equipo", action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q")
+ let top = NSMenuItem(); top.submenu = appMenu; menu.addItem(top); NSApp.mainMenu = menu
+ NSApp.activate(ignoringOtherApps: true)
+ }
+ @objc func togglePopover() {
+ guard let button = statusItem?.button else { return }
+ if popover?.isShown == true { popover?.close(); return }
+ let p = NSPopover()
+ p.behavior = .transient
+ p.contentSize = NSSize(width: 390, height: 500)
+ p.contentViewController = NSHostingController(rootView: MenuBarPanel(store: store))
+ p.show(relativeTo: button.bounds, of: button, preferredEdge: .minY)
+ popover = p
+ }
+ func snapshots(to directory: String) {
+ try! FileManager.default.createDirectory(atPath: directory, withIntermediateDirectories: true)
+ for dark in [false, true] {
+ let appearance = NSAppearance(named: dark ? .darkAqua : .aqua)!
+ NSApp.appearance = appearance
+ let theme = dark ? "dark" : "light"
+ capture(MainContent(store: store), size: NSSize(width: 1400, height: 900), appearance: appearance, path: directory + "/mac-main-\(theme).png")
+ capture(host(rootView: MenuBarPanel(store: store)), size: NSSize(width: 410, height: 520), appearance: appearance, path: directory + "/mac-menu-\(theme).png")
+ capture(host(rootView: NotificationAnswerView(store: store, answer: nil, compact: true)), size: NSSize(width: 440, height: 570), appearance: appearance, path: directory + "/mac-notification-compact-\(theme).png")
+ capture(host(rootView: NotificationAnswerView(store: store, answer: nil)), size: NSSize(width: 440, height: 570), appearance: appearance, path: directory + "/mac-notification-\(theme).png")
+ capture(host(rootView: NotificationAnswerView(store: store, answer: "VAT")), size: NSSize(width: 440, height: 570), appearance: appearance, path: directory + "/mac-notification-answered-\(theme).png")
+ }
+ }
+ func host<V: View>(rootView: V) -> NSHostingView<V> {
+ let view = NSHostingView(rootView: rootView)
+ view.sizingOptions = []
+ return view
+ }
+ func capture(_ view: NSView, size: NSSize, appearance: NSAppearance, path: String) {
+ let window = NSWindow(contentRect: NSRect(origin: NSPoint(x: -20000, y: -20000), size: size), styleMask: .borderless, backing: .buffered, defer: false)
+ window.appearance = appearance
+ window.contentView = view
+ view.frame = NSRect(origin: .zero, size: size)
+ view.appearance = appearance
+ window.orderFrontRegardless()
+ view.layoutSubtreeIfNeeded()
+ RunLoop.current.run(until: Date().addingTimeInterval(0.25))
+ view.layoutSubtreeIfNeeded()
+ view.display()
+ appearance.performAsCurrentDrawingAppearance {
+ let rep = view.bitmapImageRepForCachingDisplay(in: view.bounds)!
+ view.cacheDisplay(in: view.bounds, to: rep)
+ try! rep.representation(using: .png, properties: [:])!.write(to: URL(fileURLWithPath: path))
+ }
+ window.orderOut(nil)
+ window.contentView = nil
+ }
+ func applicationWillTerminate(_ notification: Notification) {
+ if let item = statusItem { NSStatusBar.system.removeStatusItem(item) }
+ popover?.close()
+ window?.orderOut(nil)
+ }
+}
diff --git a/native/mockups/Mac/MacPanels.swift b/native/mockups/Mac/MacPanels.swift
new file mode 100644
index 00000000..d3ecbbf4
--- /dev/null
+++ b/native/mockups/Mac/MacPanels.swift
@@ -0,0 +1,95 @@
+import SwiftUI
+import EquipoCore
+
+struct MacSidebar: View {
+ @State private var selection = "Conversation"
+ var body: some View {
+ VStack(alignment: .leading, spacing: 0) {
+ HStack {
+ Image(systemName: "person.2").foregroundStyle(Palette.accent)
+ Text("Oficina").font(.title2.weight(.semibold))
+ Spacer()
+ Image(systemName: "chevron.up.chevron.down").font(.caption)
+ }.padding(22)
+ VStack(spacing: 4) {
+ sidebarRow("Conversation", "bubble.left.and.bubble.right", "")
+ sidebarRow("Needs you", "hand.raised", "1")
+ sidebarRow("Tasks", "checklist", "4")
+ sidebarRow("Projects", "folder", "2")
+ }.padding(.horizontal, 12)
+ Text("Specialists").font(.subheadline.weight(.semibold)).foregroundStyle(Palette.secondary).padding(.horizontal, 22).padding(.top, 32).padding(.bottom, 12)
+ VStack(alignment: .leading, spacing: 23) {
+ specialist("Engineering", "Check sign-in recovery", "Reading the session tests")
+ specialist("Design", "Explore a shorter setup", "Comparing two flows")
+ specialist("Copy", "Fix VAT on invoice PDFs", "Waiting for your answer")
+ specialist("Research", "Calendar connections", "Finished")
+ specialist("Review", "", "No current task")
+ }.padding(.horizontal, 22)
+ Spacer()
+ Divider().padding(.horizontal, 18)
+ sidebarRow("Connections & Usage", "point.3.connected.trianglepath.dotted", "").padding(12)
+ HStack { Image(systemName: "person.crop.circle"); Text("Paul"); Spacer(); Image(systemName: "gearshape") }
+ .font(.subheadline).foregroundStyle(Palette.secondary).padding(.horizontal, 22).padding(.bottom, 20)
+ }.background(Palette.background).tint(Palette.accent)
+ }
+ func sidebarRow(_ title: String, _ icon: String, _ count: String) -> some View {
+ Button { selection = title } label: {
+ HStack(spacing: 11) { Image(systemName: icon).frame(width: 19); Text(title); Spacer(minLength: 0); Text(count).monospacedDigit() }
+ .font(.system(size: 13, weight: selection == title ? .semibold : .regular))
+ .padding(.horizontal, 11).padding(.vertical, 10)
+ .foregroundStyle(selection == title ? Palette.accent : Color.primary)
+ .background(selection == title ? Palette.soft : .clear)
+ .clipShape(RoundedRectangle(cornerRadius: 8))
+ }.buttonStyle(.plain)
+ }
+ func specialist(_ name: String, _ task: String, _ activity: String) -> some View {
+ VStack(alignment: .leading, spacing: 6) {
+ Label(name, systemImage: specialistIcon(name)).font(.system(size: 13, weight: .semibold))
+ if !task.isEmpty { Text(task).font(.system(size: 12)).lineLimit(1) }
+ Text(activity).font(.system(size: 11)).foregroundStyle(Palette.secondary)
+ }
+ }
+}
+struct MacInspector: View {
+ let store: MockStore
+ var body: some View {
+ ScrollView {
+ VStack(alignment: .leading, spacing: 20) {
+ HStack { Text("Task").font(.headline); Spacer(); Image(systemName: "sidebar.right") }
+ Divider()
+ Text(store.tasks[0].description).font(.title2.weight(.semibold))
+ Label("Equipo", systemImage: "folder").font(.subheadline).foregroundStyle(Palette.secondary)
+ Label("Needs your answer", systemImage: "hand.raised").font(.subheadline).foregroundStyle(Palette.accent)
+ Divider()
+ Text("Steps").font(.headline)
+ StepsView(task: store.tasks[0])
+ Divider()
+ Text("Copy is waiting").font(.headline)
+ QuietLabel(text: "Answer the question in the conversation to continue this task.")
+ QuietLabel(text: "Specialist activity is a web parity concept awaiting API support.")
+ }.padding(22)
+ }.background(Palette.surface).tint(Palette.accent)
+ }
+}
+struct MenuBarPanel: View {
+ let store: MockStore
+ @State private var answer: String?
+ var body: some View {
+ VStack(alignment: .leading, spacing: 18) {
+ HStack {
+ Label("Equipo", systemImage: "bubble.left.and.bubble.right").font(.headline)
+ Spacer()
+ Text("Oficina").foregroundStyle(Palette.secondary)
+ }
+ Divider()
+ HStack { Text("Needs you").font(.title2.weight(.semibold)); Spacer(); Text(answer == nil ? "1" : "0").foregroundStyle(Palette.accent) }
+ Text("Fix VAT on invoice PDFs").font(.headline)
+ QuietLabel(text: "Equipo · Copy")
+ QuestionCard(question: store.question, answer: $answer)
+ Divider()
+ HStack { Text("2 tasks in progress").foregroundStyle(Palette.secondary); Spacer(); Image(systemName: "arrow.up.right") }.font(.subheadline)
+ Button("Open Equipo") { NSApp.windows.first(where: { $0.title == "Equipo" })?.makeKeyAndOrderFront(nil) }.buttonStyle(.bordered)
+ Spacer(minLength: 0)
+ }.padding(22).background(Palette.background).tint(Palette.accent)
+ }
+}
diff --git a/native/mockups/Mac/NativeTranscript.swift b/native/mockups/Mac/NativeTranscript.swift
new file mode 100644
index 00000000..c78030a5
--- /dev/null
+++ b/native/mockups/Mac/NativeTranscript.swift
@@ -0,0 +1,165 @@
+import AppKit
+import EquipoCore
+
+final class ActionButton: NSButton {
+ var actionBlock: (() -> Void)?
+ init(_ title: String, action: @escaping () -> Void) {
+ super.init(frame: .zero)
+ self.title = title
+ self.actionBlock = action
+ bezelStyle = .rounded
+ target = self
+ self.action = #selector(performAction)
+ }
+ required init?(coder: NSCoder) { fatalError() }
+ @objc private func performAction() { actionBlock?() }
+}
+final class FlippedView: NSView { override var isFlipped: Bool { true } }
+final class ComposerTextView: NSTextView {
+ override func draw(_ dirtyRect: NSRect) {
+ super.draw(dirtyRect)
+ if string.isEmpty {
+ ("Message your coordinator" as NSString).draw(at: NSPoint(x: 14, y: 14), withAttributes: [
+ .font: NSFont.systemFont(ofSize: 14), .foregroundColor: NSColor.secondaryLabelColor
+ ])
+ }
+ }
+ override func didChangeText() { super.didChangeText(); needsDisplay = true }
+}
+
+private let transcriptAccent = NSColor(name: nil) { appearance in
+ appearance.bestMatch(from: [.aqua, .darkAqua]) == .darkAqua
+ ? NSColor(srgbRed: 0.74, green: 0.64, blue: 0.96, alpha: 1)
+ : NSColor(srgbRed: 0.41, green: 0.25, blue: 0.74, alpha: 1)
+}
+final class NativeTranscript: NSView {
+ override var isFlipped: Bool { true }
+ private let store: MockStore
+ private let scroll = NSScrollView()
+ private let document = FlippedView()
+ private let composer = ComposerTextView()
+ private var answer: String?
+ private var transcriptOpen = false
+ private var localMessages: [String] = []
+ private var contentWidth: CGFloat = 0
+ init(store: MockStore) {
+ self.store = store
+ super.init(frame: .zero)
+ wantsLayer = true
+ scroll.documentView = document
+ scroll.hasVerticalScroller = true
+ scroll.drawsBackground = false
+ addSubview(scroll)
+ composer.font = .systemFont(ofSize: 14)
+ composer.isRichText = false
+ composer.textContainerInset = NSSize(width: 10, height: 12)
+ composer.string = ""
+ composer.setAccessibilityLabel("Message your coordinator")
+ composer.wantsLayer = true
+ composer.layer?.cornerRadius = 10
+ addSubview(composer)
+ let send = ActionButton("Send") { [weak self] in
+ guard let self, !self.composer.string.isEmpty else { return }
+ self.localMessages.append(self.composer.string)
+ self.composer.string = ""
+ self.rebuild()
+ }
+ send.identifier = NSUserInterfaceItemIdentifier("send")
+ addSubview(send)
+ }
+ required init?(coder: NSCoder) { fatalError() }
+ override func layout() {
+ super.layout()
+ layer?.backgroundColor = NSColor.windowBackgroundColor.cgColor
+ scroll.frame = NSRect(x: 0, y: 68, width: bounds.width, height: bounds.height - 158)
+ composer.frame = NSRect(x: 28, y: bounds.height - 75, width: bounds.width - 122, height: 51)
+ composer.backgroundColor = .controlBackgroundColor
+ composer.layer?.borderColor = NSColor.separatorColor.cgColor
+ composer.layer?.borderWidth = 0.5
+ subviews.first(where: { $0.identifier?.rawValue == "send" })?.frame = NSRect(x: bounds.width - 84, y: bounds.height - 66, width: 62, height: 32)
+ if contentWidth != bounds.width { contentWidth = bounds.width; rebuild() }
+ }
+ override func draw(_ dirtyRect: NSRect) {
+ super.draw(dirtyRect)
+ let title = "Conversation" as NSString
+ title.draw(at: NSPoint(x: 28, y: 21), withAttributes: [.font: NSFont.systemFont(ofSize: 18, weight: .semibold), .foregroundColor: NSColor.labelColor])
+ ("Your coordinator" as NSString).draw(at: NSPoint(x: bounds.width - 139, y: 26), withAttributes: [.font: NSFont.systemFont(ofSize: 12), .foregroundColor: NSColor.secondaryLabelColor])
+ NSColor.separatorColor.setFill()
+ NSRect(x: 0, y: 67, width: bounds.width, height: 0.5).fill()
+ NSRect(x: 0, y: bounds.height - 90, width: bounds.width, height: 0.5).fill()
+
+ }
+ func rebuild() {
+ document.subviews.forEach { $0.removeFromSuperview() }
+ let width = max(bounds.width - 64, 260)
+ var y: CGFloat = 22
+ func text(_ value: String, size: CGFloat = 14, weight: NSFont.Weight = .regular, color: NSColor = .labelColor, x: CGFloat = 32, inset: CGFloat = 0) {
+ let field = NSTextField(wrappingLabelWithString: value)
+ field.font = .systemFont(ofSize: size, weight: weight)
+ field.textColor = color
+ field.isSelectable = true
+ let w = width - inset
+ let h = max(field.cell?.cellSize(forBounds: NSRect(x: 0, y: 0, width: w, height: 10000)).height ?? 20, size + 5)
+ field.frame = NSRect(x: x, y: y, width: w, height: h)
+ document.addSubview(field)
+ y += h + 10
+ }
+ func panel(start: CGFloat, end: CGFloat, tinted: Bool = false) {
+ let box = NSView(frame: NSRect(x: 26, y: start, width: width + 12, height: end - start))
+ box.wantsLayer = true
+ box.layer?.cornerRadius = 12
+ box.layer?.borderWidth = 0.5
+ box.layer?.borderColor = NSColor.separatorColor.cgColor
+ box.layer?.backgroundColor = (tinted ? transcriptAccent.withAlphaComponent(0.08) : NSColor.controlBackgroundColor).cgColor
+ document.addSubview(box, positioned: .below, relativeTo: nil)
+ }
+ let dayStart = y
+ y += 16
+ text("Yesterday, 12 November", size: 13, weight: .semibold, x: 44, inset: 24)
+ text("2 finished · 1 decision · 1 still open", size: 12, color: .secondaryLabelColor, x: 44, inset: 24)
+ let transcript = ActionButton(transcriptOpen ? "Hide the conversation" : "Show the conversation") { [weak self] in self?.transcriptOpen.toggle(); self?.rebuild() }
+ transcript.bezelStyle = .rounded
+ transcript.frame = NSRect(x: 42, y: y, width: 183, height: 26)
+ document.addSubview(transcript)
+ y += 36
+ if transcriptOpen { text("You chose the shorter setup. Engineering will investigate it next.", size: 13, x: 44, inset: 24) }
+ panel(start: dayStart, end: y)
+ y += 26
+ text("Today · 09:41", size: 11, color: .secondaryLabelColor)
+ for message in store.conversation.messages ?? [] {
+ if message.author_kind == "person" {
+ let start = y
+ y += 14
+ text(message.body, x: 48, inset: 34)
+ y += 4
+ panel(start: start, end: y, tinted: true)
+ } else {
+ text("Coordinator", size: 13, weight: .semibold, color: transcriptAccent)
+ text(message.body)
+ }
+ y += 23
+ }
+ let questionStart = y
+ y += 17
+ text("Copy", size: 12, weight: .semibold, color: transcriptAccent, x: 44, inset: 24)
+ text(store.question.text, size: 15, weight: .semibold, x: 44, inset: 24)
+ if let answer {
+ text("Answered: \(answer) · saved in this preview", size: 13, color: .secondaryLabelColor, x: 44, inset: 24)
+ } else {
+ for (i, option) in (store.question.options ?? []).enumerated() {
+ let button = ActionButton(option.label) { [weak self] in self?.answer = option.label; self?.rebuild() }
+ button.frame = NSRect(x: 42 + CGFloat(i) * 112, y: y, width: 100, height: 32)
+ document.addSubview(button)
+ }
+ y += 42
+ }
+ y += 6
+ panel(start: questionStart, end: y, tinted: true)
+ y += 24
+ text("Checking the next step", size: 12, color: .secondaryLabelColor)
+ for message in localMessages { text(message); y += 12 }
+ y += 15
+ text("Roll-up and activity line are web parity concepts. All content is fixture data.", size: 11, color: .secondaryLabelColor)
+ document.frame = NSRect(x: 0, y: 0, width: bounds.width, height: max(y + 18, scroll.bounds.height))
+ }
+}
diff --git a/native/mockups/Shared/Components.swift b/native/mockups/Shared/Components.swift
new file mode 100644
index 00000000..2d358c4a
--- /dev/null
+++ b/native/mockups/Shared/Components.swift
@@ -0,0 +1,247 @@
+import SwiftUI
+import EquipoCore
+
+struct TaskRow: View {
+ let task: EquipoTask
+ let store: MockStore
+ var body: some View {
+ VStack(alignment: .leading, spacing: 8) {
+ HStack(alignment: .firstTextBaseline) {
+ Text(task.description).font(.headline)
+ Spacer(minLength: 8)
+ if task.needs_you { Image(systemName: "hand.raised").foregroundStyle(Palette.accent) }
+ }
+ HStack(spacing: 6) {
+ Image(systemName: "folder").font(.caption)
+ Text(store.project(for: task))
+ Text("·")
+ Text(task.needs_you ? "Needs you" : task.state.capitalized)
+ }.font(.subheadline).foregroundStyle(Palette.secondary)
+ if let step = task.steps?.first(where: { $0.state == "running" || $0.state == "waiting" }) {
+ Label(step.action, systemImage: specialistIcon(step.category))
+ .font(.footnote).foregroundStyle(Palette.secondary).lineLimit(2)
+ }
+ }.padding(.vertical, 9)
+ }
+}
+struct QuestionCard: View {
+ let question: Question
+ @Binding var answer: String?
+ var body: some View {
+ Panel(tinted: true) {
+ Label("Copy", systemImage: "pencil.line").font(.subheadline.weight(.semibold)).foregroundStyle(Palette.accent)
+ Text(question.text).font(.headline).fixedSize(horizontal: false, vertical: true)
+ if let answer {
+ Label("Answered: \(answer)", systemImage: "checkmark.circle.fill")
+ .font(.subheadline).foregroundStyle(Palette.accent)
+ QuietLabel(text: "Saved in this preview. No answer was sent.")
+ } else {
+ HStack(spacing: 12) {
+ ForEach(question.options ?? []) { option in
+ Button(option.label) { answer = option.label }
+ .buttonStyle(.bordered).controlSize(.large)
+ .disabled(!question.canSubmit(currentRevision: 7))
+ }
+ }
+ }
+ }
+ }
+}
+struct StepsView: View {
+ let task: EquipoTask
+ var body: some View {
+ VStack(alignment: .leading, spacing: 0) {
+ ForEach(task.steps ?? [], id: \.key) { step in
+ HStack(alignment: .top, spacing: 12) {
+ Image(systemName: step.state == "done" ? "checkmark.circle.fill" : (step.state == "waiting" ? "pause.circle" : "circle"))
+ .foregroundStyle(step.state == "queued" ? Palette.secondary : Palette.accent)
+ .font(.title3).frame(width: 24)
+ VStack(alignment: .leading, spacing: 6) {
+ Label(step.category.capitalized, systemImage: specialistIcon(step.category)).font(.subheadline.weight(.semibold))
+ Text(step.action).font(.subheadline).fixedSize(horizontal: false, vertical: true)
+ QuietLabel(text: step.state == "done" ? step.actual : step.state.capitalized)
+ }
+ Spacer(minLength: 0)
+ }.padding(.vertical, 13)
+ if step.key != task.steps?.last?.key { Divider().padding(.leading, 36) }
+ }
+ }
+ }
+}
+struct RollupCard: View {
+ @State private var expanded = false
+ var body: some View {
+ Panel {
+ HStack {
+ Image(systemName: "calendar")
+ Text("Yesterday, 12 November").font(.subheadline.weight(.semibold))
+ Spacer()
+ Image(systemName: "chevron.down").font(.caption)
+ }
+ QuietLabel(text: "2 finished · 1 decision · 1 still open")
+ Button(expanded ? "Hide the conversation" : "Show the conversation") { expanded.toggle() }
+ .font(.subheadline)
+ if expanded { Text("You chose the shorter setup. Engineering will investigate it next.").font(.subheadline) }
+ }
+ }
+}
+struct NotificationAnswerView: View {
+ let store: MockStore
+ @State var answer: String?
+ var compact = false
+ @State private var expanded = false
+ var body: some View {
+ VStack(alignment: .leading, spacing: 24) {
+ Text(compact && !expanded ? "Compact notification" : "Expanded notification").font(.title2.weight(.semibold))
+ QuietLabel(text: "Notification design concept")
+ Panel {
+ HStack {
+ Label("Equipo · Oficina", systemImage: "bubble.left.and.bubble.right").font(.subheadline.weight(.semibold))
+ Spacer()
+ QuietLabel(text: "now")
+ }.foregroundStyle(Palette.accent)
+ Divider()
+ Text("Copy needs you").font(.headline)
+ Text(store.tasks[0].description).font(.subheadline).foregroundStyle(Palette.secondary)
+ Text(store.question.text).font(.headline).fixedSize(horizontal: false, vertical: true)
+ if let answer {
+ Label("Answered: \(answer)", systemImage: "checkmark.circle.fill").foregroundStyle(Palette.accent)
+ QuietLabel(text: "Saved in this preview. No answer was sent.")
+ } else if compact && !expanded {
+ Button("Expand to answer") { expanded = true }.buttonStyle(.bordered).controlSize(.large)
+ } else {
+ HStack(spacing: 12) {
+ ForEach(store.question.options ?? []) { option in
+ Button(option.label) { answer = option.label }.buttonStyle(.bordered).controlSize(.large)
+ }
+ }
+ Label("Unlock to answer", systemImage: "lock").font(.footnote).foregroundStyle(Palette.secondary)
+ }
+ }
+ if answer != nil { Label("Checks can continue", systemImage: "arrow.right.circle").font(.headline) }
+ Spacer(minLength: 0)
+ QuietLabel(text: "App-rendered notification concept. A real action must authenticate and refresh the question. Apple push delivery is not connected.")
+ }.padding(24).background(Palette.background).tint(Palette.accent)
+ }
+}
+struct ConnectionsContent: View {
+ let store: MockStore
+ var body: some View {
+ VStack(alignment: .leading, spacing: 22) {
+ ForEach(store.connections) { connection in
+ Panel {
+ HStack {
+ Image(systemName: connection.id.contains("claude") ? "sun.max" : "circle.hexagongrid")
+ .font(.title2).foregroundStyle(Palette.accent)
+ Text(connection.label).font(.headline)
+ Spacer()
+ Image(systemName: "checkmark.circle").foregroundStyle(Palette.accent)
+ }
+ ForEach(connection.models ?? [], id: \.model) { model in
+ HStack {
+ Text(model.available ? "Available" : "Unavailable").font(.subheadline)
+ Spacer()
+ Text(model.allowance_remaining == nil ? "Allowance not reported" : "\(model.allowanceLabel) remaining").font(.footnote).foregroundStyle(Palette.secondary)
+ }
+ }
+ }
+ }
+ Text("Team budget").font(.title3.weight(.semibold))
+ Panel {
+ LabeledContent("Input tokens", value: store.budgets.team.input_tokens.formatted())
+ Divider()
+ LabeledContent("Output tokens", value: store.budgets.team.output_tokens.formatted())
+ Divider()
+ LabeledContent("Calls", value: store.budgets.team.calls.formatted())
+ }.font(.subheadline)
+ QuietLabel(text: "Configured limits. Remaining budget and reset times are not available in the person API.")
+ NavigationLink(value: "usage-concept") {
+ Label("Preview web Usage parity", systemImage: "arrow.up.right")
+ }.font(.subheadline)
+ }
+ }
+}
+struct WebConceptView: View {
+ let screen: String
+ @State private var choice: String?
+ var body: some View {
+ ScrollView {
+ VStack(alignment: .leading, spacing: 20) {
+ QuietLabel(text: "Design concept · awaiting person API support")
+ if screen == "exploration" {
+ Text("Explore a shorter setup").font(.title2.weight(.semibold))
+ Label("Equipo · Design", systemImage: "pencil.and.outline").foregroundStyle(Palette.secondary)
+ Panel {
+ Label("Preview ready", systemImage: "macwindow").font(.headline)
+ Text("Two steps instead of five. Connect a runner, then choose your first project.")
+ Button("Open preview") { choice = "Preview selected" }.buttonStyle(.bordered)
+ }
+ Panel(tinted: true) {
+ Text("What next?").font(.headline)
+ Text("Keep exploring, build this direction, or leave it here.")
+ ForEach(["Build this", "Keep exploring", "Leave it here"], id: \.self) { text in
+ Button(text) { choice = text }.buttonStyle(.bordered).controlSize(.large)
+ }
+ }
+ QuietLabel(text: "An exploration ends at its preview. Building requires a new decision.")
+ } else if screen == "copy-hold" {
+ Text("Refresh the welcome page").font(.title2.weight(.semibold))
+ Label("Equipo · Copy", systemImage: "pencil.line").foregroundStyle(Palette.secondary)
+ Panel(tinted: true) {
+ Text("Copy cannot start").font(.headline)
+ Text("There is not enough room in this task’s token allowance to review the changed wording.")
+ Button("Continue without Copy") { choice = "Continued in this preview. Checks and Review can resume." }.buttonStyle(.bordered).controlSize(.large)
+ }
+ Text("Only the task creator can continue. This applies to the current candidate and leaves its wording unaccepted.")
+ QuietLabel(text: "The release copy gate still applies. This is a separate budget-hold scenario, not a way to skip an open question.")
+ } else if screen == "research" {
+ Text("Calendar connections").font(.title2.weight(.semibold))
+ Label("Woodstar · Research finished", systemImage: "magnifyingglass").foregroundStyle(Palette.secondary)
+ Panel {
+ Text("What Research found").font(.headline)
+ Text("Calendar access needs a separate permission. Read-only access is enough for the first version.")
+ Divider()
+ Label("Sources", systemImage: "link").font(.subheadline.weight(.semibold))
+ Text("Calendar API guide\nAuthorization guide").foregroundStyle(Palette.accent)
+ }
+ Panel {
+ Text("Still unknown").font(.headline)
+ Text("Whether shared calendars need an administrator’s approval.")
+ }
+ DisclosureGroup("Fetch log and kept images") { QuietLabel(text: "Two pages read. No images kept.") }
+ } else if screen == "usage-concept" {
+ Text("Usage").font(.title2.weight(.semibold))
+ Panel {
+ Label("Claude · Work", systemImage: "sun.max").font(.headline)
+ LabeledContent("Session used", value: "38%")
+ ProgressView(value: 0.38).tint(Palette.accent)
+ QuietLabel(text: "Resets in 2 hours · read 1 minute ago")
+ }
+ Panel {
+ Label("Codex · Personal", systemImage: "circle.hexagongrid").font(.headline)
+ QuietLabel(text: "Headroom unknown. No recent reading.")
+ }
+ Text("Waiting for headroom").font(.headline)
+ Panel(tinted: true) {
+ Text("Check sign-in recovery").font(.headline)
+ QuietLabel(text: "Woodstar · Engineering")
+ Text("The preferred connection is near its limit. Equipo recommends waiting.")
+ Button("Mark urgent") { choice = "Marked urgent in this preview" }.buttonStyle(.bordered)
+ }
+ QuietLabel(text: "Illustrative provider readings. These fields and the priority action need an API addition.")
+ } else {
+ Text("A secure handoff").font(.title2.weight(.semibold))
+ Panel(tinted: true) {
+ Label("Contra", systemImage: "key.horizontal").font(.headline)
+ Text("Engineering needs a deployment credential.")
+ QuietLabel(text: "Equipo · Preview environment")
+ Button("Open Contra") { choice = "Secure handoff selected" }.buttonStyle(.bordered).controlSize(.large)
+ }
+ Text("Enter the secret in Contra. Keep it out of the conversation and notification.")
+ QuietLabel(text: "Proposed interaction only. No Contra contract or secret-request endpoint exists in this checkout.")
+ }
+ if let choice { Label(choice, systemImage: "checkmark.circle").foregroundStyle(Palette.accent) }
+ }.padding(20)
+ }.background(Palette.background).tint(Palette.accent)
+ }
+}
diff --git a/native/mockups/Shared/Theme.swift b/native/mockups/Shared/Theme.swift
new file mode 100644
index 00000000..9243ea89
--- /dev/null
+++ b/native/mockups/Shared/Theme.swift
@@ -0,0 +1,58 @@
+import SwiftUI
+import EquipoCore
+#if os(macOS)
+import AppKit
+#else
+import UIKit
+#endif
+
+enum Palette {
+ static let accent = Color(light: 0x6941BD, dark: 0xBDA2F5)
+ static let background = Color(light: 0xF7F7F8, dark: 0x101216)
+ static let surface = Color(light: 0xFFFFFF, dark: 0x1B1D23)
+ static let soft = Color(light: 0xF1ECF9, dark: 0x292335)
+ static let border = Color(light: 0xDDDEE3, dark: 0x383B44)
+ static let secondary = Color(light: 0x616572, dark: 0xA8ABB7)
+}
+extension Color {
+ init(light: UInt32, dark: UInt32) {
+ #if os(macOS)
+ self.init(nsColor: NSColor(name: nil) { appearance in
+ let hex = appearance.bestMatch(from: [.aqua, .darkAqua]) == .darkAqua ? dark : light
+ return NSColor(srgbRed: Double((hex >> 16) & 255) / 255, green: Double((hex >> 8) & 255) / 255, blue: Double(hex & 255) / 255, alpha: 1)
+ })
+ #else
+ self.init(uiColor: UIColor { traits in
+ let hex = traits.userInterfaceStyle == .dark ? dark : light
+ return UIColor(red: Double((hex >> 16) & 255) / 255, green: Double((hex >> 8) & 255) / 255, blue: Double(hex & 255) / 255, alpha: 1)
+ })
+ #endif
+ }
+}
+struct Panel<Content: View>: View {
+ var tinted = false
+ @ViewBuilder var content: Content
+ var body: some View {
+ VStack(alignment: .leading, spacing: 12) { content }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .padding(16)
+ .background(tinted ? Palette.soft : Palette.surface)
+ .clipShape(RoundedRectangle(cornerRadius: 14))
+ .overlay(RoundedRectangle(cornerRadius: 14).stroke(Palette.border, lineWidth: 0.5))
+ }
+}
+struct QuietLabel: View {
+ let text: String
+ var body: some View { Text(text).font(.footnote).foregroundStyle(Palette.secondary) }
+}
+func specialistIcon(_ category: String) -> String {
+ switch category.lowercased() {
+ case "engineering": return "hammer"
+ case "copy": return "pencil.line"
+ case "review": return "checkmark.shield"
+ case "checks": return "checkmark.circle"
+ case "research": return "magnifyingglass"
+ case "design": return "pencil.and.outline"
+ default: return "sparkle"
+ }
+}
diff --git a/native/mockups/iOS/EquipoPhoneApp.swift b/native/mockups/iOS/EquipoPhoneApp.swift
new file mode 100644
index 00000000..49b2882b
--- /dev/null
+++ b/native/mockups/iOS/EquipoPhoneApp.swift
@@ -0,0 +1,216 @@
+import SwiftUI
+import EquipoCore
+
+@main
+struct EquipoPhoneApp: App {
+ init() {
+ if ProcessInfo.processInfo.arguments.contains("--screen") { UIView.setAnimationsEnabled(false) }
+ }
+ var body: some Scene {
+ WindowGroup { PhoneRoot().preferredColorScheme(captureScheme) }
+ }
+ private var captureScheme: ColorScheme? {
+ let args = ProcessInfo.processInfo.arguments
+ guard let i = args.firstIndex(of: "--theme"), args.indices.contains(i + 1) else { return nil }
+ return args[i + 1] == "dark" ? .dark : .light
+ }
+}
+struct PhoneRoot: View {
+ let store = MockStore()
+ @State private var path: [String]
+ init() {
+ let args = ProcessInfo.processInfo.arguments
+ let index = args.firstIndex(of: "--screen")
+ let screen = index.flatMap { args.indices.contains($0 + 1) ? args[$0 + 1] : nil } ?? "teams"
+ _path = State(initialValue: screen == "teams" ? [] : (screen == "team" ? ["team"] : ["team", screen]))
+ }
+ var body: some View {
+ NavigationStack(path: $path) {
+ List {
+ Section {
+ ForEach(store.teams) { team in
+ NavigationLink(value: "team") {
+ HStack(spacing: 14) {
+ Image(systemName: "person.2").font(.title2).foregroundStyle(Palette.accent)
+ VStack(alignment: .leading, spacing: 5) {
+ Text(team.name).font(.headline)
+ Text(team.needs_you == nil ? "Sign in to check" : "\(team.needsLabel) decision needs you")
+ .font(.subheadline).foregroundStyle(Palette.secondary)
+ }
+ }.padding(.vertical, 10)
+ }.disabled(team.needs_you == nil)
+ }
+ } footer: {
+ Text("Each team has its own sign-in. Remembering a team does not grant access.")
+ }
+ Section {
+ NavigationLink(value: "needs") { Label("Needs you in Oficina", systemImage: "hand.raised") }
+ }
+ }
+ .navigationTitle("Teams")
+ .navigationDestination(for: String.self) { screen in
+ destination(screen)
+ }
+ }
+ .tint(Palette.accent)
+
+ }
+ @ViewBuilder func destination(_ screen: String) -> some View {
+ switch screen {
+ case "team": TeamIndex(store: store)
+ case "conversation": PhoneConversation(store: store)
+ case "tasks": PhoneTasks(store: store)
+ case "task": PhoneTask(store: store, task: store.tasks[0])
+ case "needs": PhoneNeeds(store: store)
+ case "connections": ScrollView { ConnectionsContent(store: store).padding(20) }.background(Palette.background).navigationTitle("Connections & Usage").navigationBarTitleDisplayMode(.inline)
+ case "notification", "notification-answered", "notification-compact": NotificationAnswerView(store: store, answer: screen == "notification-answered" ? "VAT" : nil, compact: screen == "notification-compact").navigationTitle("Notification preview").navigationBarTitleDisplayMode(.inline)
+ default:
+ if screen.hasPrefix("task:"), let task = store.tasks.first(where: { $0.id == String(screen.dropFirst(5)) }) {
+ PhoneTask(store: store, task: task)
+ } else { WebConceptView(screen: screen).navigationTitle(screen == "usage-concept" ? "Usage preview" : "Web parity preview").navigationBarTitleDisplayMode(.inline) }
+ }
+ }
+}
+struct TeamIndex: View {
+ let store: MockStore
+ var body: some View {
+ List {
+ Section {
+ NavigationLink(value: "conversation") { Label("Conversation", systemImage: "bubble.left.and.bubble.right") }
+ NavigationLink(value: "needs") { HStack { Label("Needs you", systemImage: "hand.raised"); Spacer(); Text("1").foregroundStyle(Palette.accent) } }
+ NavigationLink(value: "tasks") { Label("Tasks", systemImage: "checklist") }
+ NavigationLink(value: "connections") { Label("Connections & Usage", systemImage: "point.3.connected.trianglepath.dotted") }
+ }
+ Section("Specialists") {
+ ForEach(["Engineering", "Design", "Copy", "Research", "Review"], id: \.self) { name in
+ HStack(spacing: 13) {
+ Image(systemName: specialistIcon(name)).foregroundStyle(Palette.accent).frame(width: 22)
+ VStack(alignment: .leading, spacing: 5) {
+ Text(name).font(.headline)
+ if let task = store.activeTask(for: name.lowercased()) {
+ Text(task.description).font(.subheadline).foregroundStyle(Palette.secondary)
+ if let step = task.steps?.first(where: { $0.category == name.lowercased() }) {
+ Text(step.actual.isEmpty ? step.action : step.actual).font(.footnote).foregroundStyle(Palette.secondary)
+ }
+ } else { Text("No current task").font(.subheadline).foregroundStyle(Palette.secondary) }
+ }
+ }.padding(.vertical, 5)
+ }
+ }
+ Section("Web parity previews") {
+ NavigationLink("Exploration and What next", value: "exploration")
+ NavigationLink("Research findings", value: "research")
+ NavigationLink("Contra request", value: "contra")
+ }
+ }.navigationTitle("Oficina")
+ }
+}
+struct PhoneConversation: View {
+ let store: MockStore
+ @State private var answer: String?
+ @State private var message = ""
+ @State private var sent: [String] = []
+ var body: some View {
+ ScrollView {
+ VStack(alignment: .leading, spacing: 22) {
+ RollupCard()
+ Text("Today").font(.footnote).foregroundStyle(Palette.secondary).frame(maxWidth: .infinity)
+ ForEach(store.conversation.messages ?? []) { item in
+ VStack(alignment: .leading, spacing: 7) {
+ if item.author_kind != "person" {
+ Label("Coordinator", systemImage: "sparkle").font(.subheadline.weight(.semibold)).foregroundStyle(Palette.accent)
+ }
+ Text(item.body).font(.body).fixedSize(horizontal: false, vertical: true)
+ .padding(item.author_kind == "person" ? 14 : 0)
+ .background(item.author_kind == "person" ? Palette.soft : Color.clear)
+ .clipShape(RoundedRectangle(cornerRadius: 16))
+ }.frame(maxWidth: .infinity, alignment: item.author_kind == "person" ? .trailing : .leading)
+ }
+ QuestionCard(question: store.question, answer: $answer)
+ ForEach(sent, id: \.self) { text in Text(text).padding(14).background(Palette.soft).clipShape(RoundedRectangle(cornerRadius: 16)) }
+ Label("Checking the next step", systemImage: "sparkle")
+ .font(.footnote).foregroundStyle(Palette.secondary)
+ QuietLabel(text: "Roll-up and activity line preview web features awaiting API support.")
+ }.padding(20)
+ }
+ .background(Palette.background)
+ .safeAreaInset(edge: .bottom) {
+ HStack(spacing: 12) {
+ TextField("Message your coordinator", text: $message, axis: .vertical).lineLimit(1...4)
+ Button { if !message.isEmpty { sent.append(message); message = "" } } label: {
+ Image(systemName: "arrow.up.circle.fill").font(.title).frame(width: 44, height: 44)
+ }.accessibilityLabel("Send preview message")
+ }.padding(.horizontal, 18).padding(.vertical, 7).background(.bar)
+ }
+ .navigationTitle("Conversation").navigationBarTitleDisplayMode(.inline)
+ .toolbar { ToolbarItem(placement: .topBarTrailing) { NavigationLink(value: "needs") { Image(systemName: "hand.raised") }.accessibilityLabel("Needs you") } }
+ }
+}
+struct PhoneTasks: View {
+ let store: MockStore
+ @State private var filter = "All projects"
+ var body: some View {
+ List {
+ Section {
+ Picker("Project", selection: $filter) {
+ Text("All projects").tag("All projects")
+ Text("Equipo").tag("Equipo")
+ Text("Woodstar").tag("Woodstar")
+ }
+ }
+ Section("Needs you") {
+ ForEach(store.tasks.filter { $0.needs_you && (filter == "All projects" || store.project(for: $0) == filter) }) { task in
+ NavigationLink(value: "task") { TaskRow(task: task, store: store) }
+ }
+ }
+ Section("In progress") {
+ ForEach(store.tasks.filter { !$0.needs_you && $0.state != "done" && (filter == "All projects" || store.project(for: $0) == filter) }) { task in
+ NavigationLink(value: task.id == "task-onboarding" ? "exploration" : "task:\(task.id)") { TaskRow(task: task, store: store) }
+ }
+ }
+ Section("Finished") {
+ ForEach(store.tasks.filter { $0.state == "done" && (filter == "All projects" || store.project(for: $0) == filter) }) { task in
+ NavigationLink(value: "research") { TaskRow(task: task, store: store) }
+ }
+ }
+ }.navigationTitle("Tasks")
+ }
+}
+struct PhoneTask: View {
+ let store: MockStore
+ let task: EquipoTask
+ @State private var answer: String?
+ var body: some View {
+ ScrollView {
+ VStack(alignment: .leading, spacing: 22) {
+ Text(task.description).font(.title2.weight(.semibold))
+ Label("\(store.project(for: task)) · \(task.needs_you ? "Needs you" : task.state.capitalized)", systemImage: "folder").font(.subheadline).foregroundStyle(Palette.secondary)
+ if task.needs_you { QuestionCard(question: store.question, answer: $answer) }
+ Text("Steps").font(.headline)
+ StepsView(task: task)
+ NavigationLink("Preview a Copy budget hold", value: "copy-hold")
+
+ }.padding(20)
+ }.background(Palette.background).navigationTitle("Task").navigationBarTitleDisplayMode(.inline)
+ }
+}
+struct PhoneNeeds: View {
+ let store: MockStore
+ @State private var answer: String?
+ var body: some View {
+ ScrollView {
+ VStack(alignment: .leading, spacing: 24) {
+ Text(answer == nil ? "One decision is waiting for you." : "You are caught up in this preview.")
+ .font(.body).foregroundStyle(Palette.secondary)
+ VStack(alignment: .leading, spacing: 10) {
+ Text(store.tasks[0].description).font(.headline)
+ Label("Equipo", systemImage: "folder").font(.subheadline).foregroundStyle(Palette.secondary)
+ }
+ QuestionCard(question: store.question, answer: $answer)
+ NavigationLink(value: "task") { Label("Open task and steps", systemImage: "arrow.right") }
+ Divider()
+ QuietLabel(text: "Work that is running or waiting for a runner stays in Tasks.")
+ }.padding(20)
+ }.background(Palette.background).navigationTitle("Needs you")
+ }
+}
diff --git a/native/mockups/scripts/check-fixtures.py b/native/mockups/scripts/check-fixtures.py
new file mode 100644
index 00000000..640cabed
--- /dev/null
+++ b/native/mockups/scripts/check-fixtures.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python3
+"""Validate the fixture DTO subset against the checked-in person API schema."""
+import copy
+import datetime
+import json
+import re
+from pathlib import Path
+
+root = Path(__file__).resolve().parents[3]
+spec = json.loads((root / 'docs/api/equipo-v1.openapi.json').read_text())
+fixtures = root / 'native/mockups/EquipoCore/Sources/EquipoCore/Fixtures'
+contracts = {'teams': 'TeamLinkPage', 'tasks': 'TaskPage', 'needs-you': 'TaskPage',
+ 'projects': 'ProjectPage', 'conversation': 'ConversationPage',
+ 'question': 'Question', 'connections': 'ConnectionPage',
+ 'budgets': 'Budgets', 'notification': 'Notification'}
+
+def validate(value, schema, path='$'):
+ if '$ref' in schema:
+ return validate(value, spec['components']['schemas'][schema['$ref'].split('/')[-1]], path)
+ for key in ['oneOf', 'anyOf']:
+ if key in schema:
+ matched = 0
+ for variant in schema[key]:
+ try:
+ validate(value, variant, path)
+ matched += 1
+ except AssertionError:
+ pass
+ assert matched == 1 if key == 'oneOf' else matched >= 1, path + ': union mismatch'
+ return
+ if 'const' in schema: assert value == schema['const'], path + ': const mismatch'
+ if 'enum' in schema: assert value in schema['enum'], path + ': enum mismatch'
+ kind = schema.get('type')
+ kinds = kind if isinstance(kind, list) else [kind]
+ actual = ('null' if value is None else 'boolean' if isinstance(value, bool) else
+ 'integer' if isinstance(value, int) else 'number' if isinstance(value, float) else
+ 'string' if isinstance(value, str) else 'array' if isinstance(value, list) else 'object')
+ if kind: assert actual in kinds, path + ': wrong type ' + actual
+ if isinstance(value, dict):
+ properties = schema.get('properties', {})
+ assert set(schema.get('required', [])) <= value.keys(), path + ': missing field'
+ if schema.get('additionalProperties') is False:
+ assert value.keys() <= properties.keys(), path + ': invented field'
+ for name, item in value.items():
+ child = properties.get(name, schema.get('additionalProperties', {}))
+ if isinstance(child, dict): validate(item, child, path + '.' + name)
+ elif isinstance(value, list):
+ for index, item in enumerate(value): validate(item, schema['items'], path + f'[{index}]')
+ elif isinstance(value, str):
+ if 'pattern' in schema: assert re.search(schema['pattern'], value), path + ': pattern mismatch'
+ if schema.get('format') == 'date-time': datetime.datetime.fromisoformat(value.replace('Z', '+00:00'))
+ elif isinstance(value, int) and not isinstance(value, bool):
+ if 'minimum' in schema: assert value >= schema['minimum'], path + ': below minimum'
+ if schema.get('format') == 'int64': assert -(2**63) <= value < 2**63, path + ': out of range'
+
+for name, contract in contracts.items():
+ validate(json.loads((fixtures / (name + '.json')).read_text()), {'$ref': '#/components/schemas/' + contract})
+print(f'{len(contracts)} API response fixtures validated')
+
+original = json.loads((fixtures / 'tasks.json').read_text())
+for name, mutate in [
+ ('invented preview field', lambda x: x['items'][0].update(preview_url='https://example.test')),
+ ('missing project', lambda x: x['items'][0].pop('project_id')),
+ ('opaque task ID turned into integer', lambda x: x['items'][0].update(id=1)),
+ ('invented task kind', lambda x: x['items'][0].update(kind='exploration')),
+]:
+ changed = copy.deepcopy(original)
+ mutate(changed)
+ try:
+ validate(changed, spec['components']['schemas']['TaskPage'])
+ except AssertionError:
+ print('Guard rejected: ' + name)
+ else:
+ raise SystemExit('Guard survived: ' + name)
diff --git a/native/mockups/scripts/generate-models.py b/native/mockups/scripts/generate-models.py
new file mode 100644
index 00000000..77bac539
--- /dev/null
+++ b/native/mockups/scripts/generate-models.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+import json
+from pathlib import Path
+root = Path(__file__).resolve().parents[3]
+spec = json.loads((root / 'docs/api/equipo-v1.openapi.json').read_text())
+schemas = spec['components']['schemas']
+names = ['Person', 'Me', 'TeamLink', 'Project', 'DecisionOwner', 'Task', 'Step', 'Usage', 'Message', 'SourceRef', 'Card', 'ConversationPage', 'ClarificationQuestion', 'Option', 'Field', 'Connection', 'ConnectionModel', 'Budgets', 'PeriodLimits', 'Notification']
+rename = {'Task': 'EquipoTask', 'Notification': 'NotificationEvent', 'Option': 'QuestionOption'}
+def typename(s):
+ if '$ref' in s:
+ n = s['$ref'].split('/')[-1]
+ return rename.get(n, n)
+ if 'anyOf' in s:
+ return typename(next(x for x in s['anyOf'] if x.get('type') != 'null')) + '?'
+ t = s.get('type', 'string')
+ nullable = isinstance(t, list) and 'null' in t
+ if isinstance(t, list): t = next(x for x in t if x != 'null')
+ if t == 'array': out = '[' + typename(s['items']) + ']'
+ elif t == 'object': out = '[String: ' + typename(s['additionalProperties']) + ']'
+ else: out = {'string': 'String', 'integer': 'Int64', 'boolean': 'Bool', 'number': 'Double'}[t]
+ return out + ('?' if nullable else '')
+lines = ['// Generated from docs/api/equipo-v1.openapi.json. Fixture DTOs only.', 'import Foundation', '']
+for name in names:
+ props = schemas[name]['properties']
+ conform = 'Codable' + (', Identifiable' if 'id' in props else '')
+ lines.append(f'public struct {rename.get(name, name)}: {conform} {{')
+ for key, value in props.items():
+ lines.append(f' public var `{key}`: {typename(value)}')
+ lines.append('}\n')
+lines += ['public typealias Question = ClarificationQuestion', '', 'public struct Page<Item: Codable>: Codable {', ' public var items: [Item]', ' public var next_cursor: String', ' public var revision: Int64', '}']
+(root / 'native/mockups/EquipoCore/Sources/EquipoCore/Models.swift').write_text('\n'.join(lines) + '\n')
diff --git a/native/mockups/scripts/generate-project.py b/native/mockups/scripts/generate-project.py
new file mode 100644
index 00000000..6e104cea
--- /dev/null
+++ b/native/mockups/scripts/generate-project.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python3
+from pathlib import Path
+import hashlib, json
+root=Path(__file__).resolve().parents[1]
+objects={}
+def ident(name): return hashlib.sha1(name.encode()).hexdigest()[:24].upper()
+def add(key, **v):
+ i=ident(key);objects[i]=v;return i
+def configs(name, settings):
+ ids=[]
+ for config in ['Debug','Release']:
+ v=dict(settings)
+ v['ONLY_ACTIVE_ARCH']='YES' if config=='Debug' else 'NO'
+ v['SWIFT_OPTIMIZATION_LEVEL']='-Onone' if config=='Debug' else '-O'
+ ids.append(add(name+config,isa='XCBuildConfiguration',buildSettings=v,name=config))
+ return add(name+'configs',isa='XCConfigurationList',buildConfigurations=ids,defaultConfigurationIsVisible=0,defaultConfigurationName='Debug')
+files={}
+for folder in ['Shared','iOS','Mac']:
+ for p in sorted((root/folder).glob('*.swift')):
+ name=str(p.relative_to(root));files[name]=add(name,isa='PBXFileReference',lastKnownFileType='sourcecode.swift',path=name,sourceTree='<group>')
+package=add('package',isa='XCLocalSwiftPackageReference',relativePath='EquipoCore')
+products=[];targets=[]
+for name,folder,sdk in [('EquipoPhone','iOS','iphoneos'),('EquipoMac','Mac','macosx')]:
+ product=add(name+'product',isa='PBXFileReference',explicitFileType='wrapper.application',path=name+'.app',sourceTree='BUILT_PRODUCTS_DIR');products.append(product)
+ dep=add(name+'core',isa='XCSwiftPackageProductDependency',package=package,productName='EquipoCore')
+ framework=add(name+'framework',isa='PBXBuildFile',productRef=dep)
+ sourceids=[]
+ for path,ref in files.items():
+ if path.startswith(('Shared/',folder+'/')): sourceids.append(add(name+path,isa='PBXBuildFile',fileRef=ref))
+ sources=add(name+'sources',isa='PBXSourcesBuildPhase',buildActionMask=2147483647,files=sourceids,runOnlyForDeploymentPostprocessing=0)
+ frameworks=add(name+'frameworks',isa='PBXFrameworksBuildPhase',buildActionMask=2147483647,files=[framework],runOnlyForDeploymentPostprocessing=0)
+ resources=add(name+'resources',isa='PBXResourcesBuildPhase',buildActionMask=2147483647,files=[],runOnlyForDeploymentPostprocessing=0)
+ settings=dict(PRODUCT_NAME='$(TARGET_NAME)',PRODUCT_BUNDLE_IDENTIFIER='net.oficina.equipo.r4.'+folder.lower(),SWIFT_VERSION='5.0',GENERATE_INFOPLIST_FILE='YES',CODE_SIGNING_ALLOWED='NO',SDKROOT=sdk,MARKETING_VERSION='0.4',CURRENT_PROJECT_VERSION='4',INFOPLIST_KEY_CFBundleDisplayName='Equipo R4',ENABLE_USER_SCRIPT_SANDBOXING='YES')
+ if folder=='iOS':settings.update(IPHONEOS_DEPLOYMENT_TARGET='17.0',TARGETED_DEVICE_FAMILY='1',SUPPORTED_PLATFORMS='iphoneos iphonesimulator',INFOPLIST_KEY_UILaunchScreen_Generation='YES',INFOPLIST_KEY_UIApplicationSceneManifest_Generation='YES',INFOPLIST_KEY_UISupportedInterfaceOrientations='UIInterfaceOrientationPortrait')
+ else:settings.update(MACOSX_DEPLOYMENT_TARGET='14.0',SUPPORTED_PLATFORMS='macosx')
+ targets.append(add(name,isa='PBXNativeTarget',buildConfigurationList=configs(name,settings),buildPhases=[sources,frameworks,resources],buildRules=[],dependencies=[],name=name,productName=name,productReference=product,productType='com.apple.product-type.application',packageProductDependencies=[dep]))
+productgroup=add('products',isa='PBXGroup',children=products,name='Products',sourceTree='<group>')
+group=add('rootgroup',isa='PBXGroup',children=list(files.values())+[productgroup],sourceTree='<group>')
+project=add('project',isa='PBXProject',attributes={'LastUpgradeCheck':'2720'},buildConfigurationList=configs('project',dict(CLANG_ENABLE_MODULES='YES',SWIFT_VERSION='5.0')),compatibilityVersion='Xcode 14.0',developmentRegion='en',hasScannedForEncodings=0,knownRegions=['en','Base'],mainGroup=group,productRefGroup=productgroup,projectDirPath='',projectRoot='',targets=targets,packageReferences=[package])
+def emit(v):
+ if isinstance(v,dict):return '{\n'+'\n'.join(json.dumps(k)+' = '+emit(val)+';' for k,val in v.items())+'\n}'
+ if isinstance(v,list):return '('+', '.join(emit(x) for x in v)+')'
+ return json.dumps(v)
+p=root/'EquipoMockups.xcodeproj';p.mkdir(exist_ok=True)
+(p/'project.pbxproj').write_text('// !$*UTF8*$!\n'+emit(dict(archiveVersion=1,classes={},objectVersion=56,objects=objects,rootObject=project))+'\n')
+for name in ['EquipoPhone','EquipoMac']:
+ d=p/'xcshareddata/xcschemes';d.mkdir(parents=True,exist_ok=True)
+ ref=f'<BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="{ident(name)}" BuildableName="{name}.app" BlueprintName="{name}" ReferencedContainer="container:EquipoMockups.xcodeproj"/>'
+ (d/(name+'.xcscheme')).write_text(f'''<?xml version="1.0" encoding="UTF-8"?>
+<Scheme LastUpgradeVersion="2720" version="1.3">
+<BuildAction parallelizeBuildables="YES" buildImplicitDependencies="YES"><BuildActionEntries><BuildActionEntry buildForTesting="YES" buildForRunning="YES" buildForProfiling="YES" buildForArchiving="NO" buildForAnalyzing="YES">{ref}</BuildActionEntry></BuildActionEntries></BuildAction>
+<LaunchAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.IDEFoundation.Launcher.LLDB" launchStyle="0" useCustomWorkingDirectory="NO" ignoresPersistentStateOnLaunch="NO" debugDocumentVersioning="YES" allowLocationSimulation="YES"><BuildableProductRunnable runnableDebuggingMode="0">{ref}</BuildableProductRunnable></LaunchAction>
+</Scheme>\n''')
diff --git a/native/mockups/scripts/mutation-check.py b/native/mockups/scripts/mutation-check.py
new file mode 100644
index 00000000..a8ac1dae
--- /dev/null
+++ b/native/mockups/scripts/mutation-check.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+"""Run on the Studio inside the synced build directory."""
+import subprocess
+from pathlib import Path
+root = Path(__file__).resolve().parents[1]
+core = root / 'EquipoCore/Sources/EquipoCore/Core.swift'
+source = core.read_text()
+cases = [
+ ('specialist-status', '["running", "waiting"]', '["done"]', 'testSpecialistUsesTheRunningTask'),
+ ('unknown-team', '?? "Unknown"', '?? "0"', 'testUnknownIsNotZero'),
+ ('unknown-allowance', '?? "Not reported"', '?? "0"', 'testUnknownIsNotZero'),
+ ('stale-revision', ' && revision == currentRevision', '', 'testQuestionMustBeCurrentAndAnswerable'),
+ ('closed-question', 'state == "open" && ', '', 'testQuestionMustBeCurrentAndAnswerable'),
+ ('expired-question', 'expiry > Date()', 'true', 'testExpiredQuestionCannotBeAnswered'),
+ ('denied-question', 'can_answer && ', '', 'testQuestionMustBeCurrentAndAnswerable'),
+]
+try:
+ for name, old, new, test in cases:
+ assert old in source
+ core.write_text(source.replace(old, new))
+ result = subprocess.run(['swift', 'test', '--package-path', str(root/'EquipoCore'), '--scratch-path', str(root/'CoreTests'), '--filter', test], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ (root/(name+'.log')).write_bytes(result.stdout)
+ assert result.returncode != 0, 'Mutation survived: ' + name
+ assert b'XCTAssert' in result.stdout, 'Did not fail an assertion: ' + name
+ print('Caught mutation: ' + name, flush=True)
+finally:
+ core.write_text(source)
+result = subprocess.run(['swift','test','--package-path',str(root/'EquipoCore'),'--scratch-path',str(root/'CoreTests')], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+(root/'core-tests-final.log').write_bytes(result.stdout)
+assert result.returncode == 0, 'Restored tests failed'
+print('Restored: all core tests passed')
diff --git a/native/mockups/scripts/studio.sh b/native/mockups/scripts/studio.sh
new file mode 100755
index 00000000..8e5f7874
--- /dev/null
+++ b/native/mockups/scripts/studio.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+set -euo pipefail
+cd "$(dirname "$0")/.."
+if [ "$PWD" != "$HOME/.cache/equipo-native-r4/build" ]; then
+ echo 'Run only inside ~/.cache/equipo-native-r4/build on the Studio.' >&2
+ exit 1
+fi
+sim=''
+cleanup() {
+ if [ -n "$sim" ]; then
+ xcrun simctl terminate "$sim" net.oficina.equipo.r4.ios >/dev/null 2>&1 || true
+ xcrun simctl shutdown "$sim" >/dev/null 2>&1 || true
+ xcrun simctl delete "$sim"
+ fi
+}
+trap cleanup EXIT
+if [ "${R4_CAPTURE_ONLY:-0}" != 1 ]; then
+ stamp=$(date +%Y%m%d%H%M%S)
+ swift test --package-path EquipoCore --scratch-path CoreTests > core-tests.log 2>&1
+ xcodebuild -project EquipoMockups.xcodeproj -scheme EquipoMac -configuration Debug -destination 'platform=macOS,arch=arm64' -derivedDataPath DerivedData/Mac -clonedSourcePackagesDirPath SourcePackages -resultBundlePath "mac-$stamp.xcresult" CODE_SIGNING_ALLOWED=NO build > mac-build.log 2>&1
+ xcodebuild -project EquipoMockups.xcodeproj -scheme EquipoPhone -configuration Debug -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath DerivedData/Phone -clonedSourcePackagesDirPath SourcePackages -resultBundlePath "phone-$stamp.xcresult" ARCHS=arm64 CODE_SIGNING_ALLOWED=NO build > phone-build.log 2>&1
+fi
+mkdir -p Captures
+DerivedData/Mac/Build/Products/Debug/EquipoMac.app/Contents/MacOS/EquipoMac --snapshots "$PWD/Captures" > snapshots.log 2>&1
+if xcrun simctl list devices -j | python3 -c 'import json,sys; sys.exit(0 if any(d["name"]=="equipo-r4" for ds in json.load(sys.stdin)["devices"].values() for d in ds) else 1)'; then
+ echo 'An equipo-r4 simulator already exists; leave it untouched.' >&2
+ exit 1
+fi
+sim=$(xcrun simctl create equipo-r4 com.apple.CoreSimulator.SimDeviceType.iPhone-17 com.apple.CoreSimulator.SimRuntime.iOS-27-2)
+xcrun simctl boot "$sim"
+xcrun simctl bootstatus "$sim" -b > simulator-boot.log 2>&1
+xcrun simctl status_bar "$sim" override --time '9:41' --dataNetwork wifi --wifiMode active --wifiBars 3 --batteryState charged --batteryLevel 100
+xcrun simctl install "$sim" DerivedData/Phone/Build/Products/Debug-iphonesimulator/EquipoPhone.app
+for theme in light dark; do
+ xcrun simctl ui "$sim" appearance "$theme"
+ for screen in teams team conversation tasks task needs connections notification-compact notification notification-answered exploration research usage-concept contra copy-hold; do
+ xcrun simctl terminate "$sim" net.oficina.equipo.r4.ios >/dev/null 2>&1 || true
+ xcrun simctl launch "$sim" net.oficina.equipo.r4.ios --screen "$screen" --theme "$theme" >/dev/null
+ sleep 6
+ xcrun simctl io "$sim" screenshot "Captures/iphone-$screen-$theme.png" >/dev/null 2>&1
+ done
+done
+# Extra evidence of reflow; the baseline screens above keep the system default.
+xcrun simctl ui "$sim" content_size accessibility-large
+xcrun simctl launch --terminate-running-process "$sim" net.oficina.equipo.r4.ios --screen needs --theme dark >/dev/null
+sleep 3
+xcrun simctl io "$sim" screenshot Captures/iphone-needs-accessibility-dark.png >/dev/null 2>&1