Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

open a swift package's Package.swift when it has no .xcodeproj to resolve

[._.]/ Adam Eivy7490edd40d8e
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 2bc6f565c0..8c572cd268 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -55,4 +55,4 @@
- **Quota-burn agents run as TUI, so a burn can be watched and steered.** A burn runs unattended for minutes on the user's own subscription, and the family's provider was picked with a plain `find` over the enabled CLI/TUI providers — which returns the CLI, because that is what sorts first. Every dispatch therefore went to a headless run that could only be read after it finished. The picker now prefers the TUI (the same preference `pickScrapeProvider` applies when reading `/usage`), so the agent shows up in Active Agents with a live terminal. Two selection bugs came out with it: the whole **`agy` family was unreachable** — its providers ship as `antigravity-cli`/`antigravity-tui`, neither of which contains "agy", so a configured Antigravity plan reported "no enabled CLI/TUI provider" forever while the quota card above it showed a healthy window (the card's matcher checks the *command*; the burn picker only checked the id, and now checks both) — and an **ollama-backed wrapper was eligible**: `claude-ollama-tui` matches the claude family and is a TUI, but it runs a local model, so burning through it spends nothing and lets the window it was meant to drain expire unused. `resolveEnabledFamilies` already excludes those from the quota cards for the same reason; the burn picker now excludes them too, explicit pin included.
- **A provider's reset time is an instant, not the wording its CLI happened to use.** Two of the four quota adapters put a raw panel string on the wire — claude's `Aug 4 at 1:59pm` plus a separate `timezone` field, grok's year-less `August 10, 06:07` — so the Usage page printed those two verbatim while codex and agy rendered properly: the same field, formatted two ways on one screen, with no localization and no relative time. The parsing stays in `server/lib/quotaReset.js` but is now exported as `parseHumanReset(str, { now, timezone })` and called from `parseLimitLine` and `parseGrokUsage`, so `resetsAt` is ISO 8601 (or `null` when unreadable) for all four families and a fifth provider's dialect belongs in its own adapter rather than in the shared choke point. Both parsers take `now` explicitly, as `parseAgyUsage` already did. `normalizeResetAt` keeps its wall-clock fallback — a reading off an older federated peer still carries the raw string and must not regress to "no window states a reset time" — but every in-tree adapter now hits its `hasExplicitZone` fast path. The Usage page localizes the instant and adds the countdown (`Aug 4, 1:59 PM (in 3h)`). (#3433)
- **Unarchiving your last archived app no longer strands you on a blank Apps page.** The Active/Archived toggle only rendered while at least one archived app existed, and `showArchived` was local state with nothing to reset it — so unarchiving the last one unmounted the only control on screen and left a permanently empty "No archived apps" card, recoverable only by navigating away and back. The filter now lives in the URL (`/apps?view=archived`), so the archived list is linkable and reload-safe; the toggle stays mounted while the archived view is open even once it empties (reading `Active (N)`), and the empty state gained a "Back to active apps" button. (#3434)
-- **"Open in Xcode" opens the actual project instead of guessing its filename.** The button built `<display name>.xcodeproj` on the client and navigated to an `xcode://` URL, so any app whose display name wasn't byte-identical to its project on disk ("My Client" → `MyClient.xcodeproj`) got a path that doesn't exist — and a custom-scheme navigation reports nothing either way, so the click was a silent no-op, doubly so from a phone where the scheme isn't registered at all. The new `POST /api/apps/:id/open-xcode` resolves the real target the same way the Xcode script generators do (`deriveProjectInfo`: `project.yml` `name:` → the `*.xcodeproj` on disk → the sanitized app name), prefers a `.xcworkspace` over the `.xcodeproj` it wraps, and opens it on the machine Xcode is installed on. A repo with no Xcode project comes back as a 404 naming what it looked for, so the click always ends in a visible toast. (#3438)
+- **"Open in Xcode" opens the actual project instead of guessing its filename.** The button built `<display name>.xcodeproj` on the client and navigated to an `xcode://` URL, so any app whose display name wasn't byte-identical to its project on disk ("My Client" → `MyClient.xcodeproj`) got a path that doesn't exist — and a custom-scheme navigation reports nothing either way, so the click was a silent no-op, doubly so from a phone where the scheme isn't registered at all. The new `POST /api/apps/:id/open-xcode` resolves the real target the same way the Xcode script generators do (`deriveProjectInfo`: `project.yml` `name:` → the `*.xcodeproj` on disk → the sanitized app name), prefers a `.xcworkspace` over the `.xcodeproj` it wraps, and opens it on the machine Xcode is installed on. A `swift` SPM package — which has no `.xcodeproj` at all — falls back to its `Package.swift`, and a repo with none of the three comes back as a 404 naming everything it looked for, so the click always ends in a visible toast. (#3438)
diff --git a/server/routes/apps/launch.js b/server/routes/apps/launch.js
index 790738ceeb..35677b143a 100644
--- a/server/routes/apps/launch.js
+++ b/server/routes/apps/launch.js
@@ -164,27 +164,30 @@ router.post('/:id/open-xcode', loadApp, asyncHandler(async (req, res) => {
const { targetName } = await deriveProjectInfo(app.repoPath, app.name);
- // A workspace supersedes the project it wraps (CocoaPods/SPM multi-project
- // setups), so prefer it when both are present.
+ // In preference order: a workspace supersedes the project it wraps (CocoaPods
+ // / multi-project setups), and a plain SPM package (`swift` apps, which have
+ // no .xcodeproj at all) opens in Xcode straight from its manifest.
+ const candidates = [`${targetName}.xcworkspace`, `${targetName}.xcodeproj`, 'Package.swift'];
+
let projectPath = null;
- for (const ext of ['.xcworkspace', '.xcodeproj']) {
- const candidate = join(app.repoPath, `${targetName}${ext}`);
- if (await pathExists(candidate)) {
- projectPath = candidate;
+ for (const candidate of candidates) {
+ const fullPath = join(app.repoPath, candidate);
+ if (await pathExists(fullPath)) {
+ projectPath = fullPath;
break;
}
}
if (!projectPath) {
throw new ServerError(
- `No ${targetName}.xcworkspace or ${targetName}.xcodeproj found in ${app.repoPath}`,
+ `No Xcode project in ${app.repoPath} — looked for ${candidates.join(', ')}`,
{ status: 404, code: 'XCODE_PROJECT_NOT_FOUND', context: { targetName, repoPath: app.repoPath } }
);
}
openWithSystemHandler(projectPath);
- console.log(`📱 Opened Xcode project for ${app.name}: ${targetName}`);
+ console.log(`📱 Opened Xcode project for ${app.name}: ${projectPath}`);
res.json({ success: true, path: projectPath });
}));
diff --git a/server/routes/apps/launch.test.js b/server/routes/apps/launch.test.js
index f1678f6fce..2d3672bec9 100644
--- a/server/routes/apps/launch.test.js
+++ b/server/routes/apps/launch.test.js
@@ -86,7 +86,17 @@ describe('Apps Launch Routes — POST /:id/open-xcode', () => {
expect(response.body.path).toBe(join(REPO_PATH, 'MyClient.xcworkspace'));
});
- it('returns 404 with the resolved target name when no project exists', async () => {
+ it('falls back to the SPM manifest for a swift package with no .xcodeproj', async () => {
+ deriveProjectInfo.mockResolvedValue({ targetName: 'MyClient', bundleId: 'com.example.MyClient' });
+ existingPaths(REPO_PATH, join(REPO_PATH, 'Package.swift'));
+
+ const response = await request(app).post('/api/apps/app-001/open-xcode');
+
+ expect(response.status).toBe(200);
+ expect(response.body.path).toBe(join(REPO_PATH, 'Package.swift'));
+ });
+
+ it('returns 404 naming every candidate when no project exists', async () => {
deriveProjectInfo.mockResolvedValue({ targetName: 'MyClient', bundleId: 'com.example.MyClient' });
existingPaths(REPO_PATH);
@@ -95,6 +105,7 @@ describe('Apps Launch Routes — POST /:id/open-xcode', () => {
expect(response.status).toBe(404);
expect(response.body.code).toBe('XCODE_PROJECT_NOT_FOUND');
expect(response.body.error).toContain('MyClient.xcodeproj');
+ expect(response.body.error).toContain('Package.swift');
expect(spawn).not.toHaveBeenCalled();
});