diff --git a/.github/workflows/quality-line.yml b/.github/workflows/quality-line.yml
index ff82a60..862b1de 100644
--- a/.github/workflows/quality-line.yml
+++ b/.github/workflows/quality-line.yml
@@ -5,8 +5,7 @@ name: Quality line
# its answer no longer matches the spec Flyspace ships. A red run is the
# signal to fix the spec before a person's block breaks.
#
-# Keys are optional repository secrets (FRED_API_KEY, ALPHA_VANTAGE_API_KEY,
-# NEWSAPI_KEY, METACULUS_API_KEY). Without one, that API's keyed operations
+# ALPHA_VANTAGE_API_KEY is an optional repository secret. Without it, that API's keyed operations
# are reported as skipped, not failed. The report is kept as an artifact;
# committing public/curated-quality.json stays a person's step.
@@ -28,10 +27,7 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
- FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
ALPHA_VANTAGE_API_KEY: ${{ secrets.ALPHA_VANTAGE_API_KEY }}
- NEWSAPI_KEY: ${{ secrets.NEWSAPI_KEY }}
- METACULUS_API_KEY: ${{ secrets.METACULUS_API_KEY }}
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
diff --git a/APEX_PLAN.md b/APEX_PLAN.md
index e78beee..05c672a 100644
--- a/APEX_PLAN.md
+++ b/APEX_PLAN.md
@@ -108,8 +108,9 @@ database, so everything behind those facts went. Last present at `8a21350`:
engine, kernel, crystallize, run lineage, the Think result modal, markdown
rendering of answers. A turn now commits the preview's refusal.
- Postgres, migrations, the inference ledger, hosted OIDC auth.
-- The capability broker's server side and data plant (house keys). A brokered
- block still runs and shows the broker's 503.
+- The capability broker and data plant (house keys), and the curated APIs that
+ need them because they refuse browser calls: FRED, NewsAPI, Metaculus. Keyed
+ APIs that accept browser calls keep working with a visitor's own key.
- OAuth sign-in. A Google block still says sign-in is not set up.
- Remote speech (OpenAI Realtime). The browser recognizer remains.
- Jev and Kev persona suggestions and meaning search. Keyword search remains.
diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md
index 0388738..3892fc5 100644
--- a/DEPLOYMENT.md
+++ b/DEPLOYMENT.md
@@ -20,10 +20,10 @@ browser's IndexedDB unless the visitor saves an account backup (below).
| `GET /api/polymarket` | Polymarket markets |
| `POST /api/llm`, `POST /api/jev-persona`, `POST /api/capability-broker`, `POST /api/registry-intent`, `GET /api/inference-runs` | always 503 |
-The 503 routes are one-line stubs. They stay because
+The 503 routes are one-line stubs that no client calls. They stay only because
`.github/workflows/deploy-preview.yml` asserts those answers after every deploy
-and rolls back otherwise; the client calls only the capability broker one. Remove
-a stub only together with its check in that workflow.
+and rolls back otherwise. Remove a stub only together with its check in that
+workflow.
## Deploying the preview
@@ -83,7 +83,7 @@ Every push and PR, three jobs (`.github/workflows/ci.yml`):
| **Dependency audit** | Production dependencies block on `high`; dev-only advisories are reported, not blocking |
The bundle scan does not grep for variable *names* - a name proves nothing, and
-CI has no real keys. It builds with `FRED_API_KEY=OMNI-CANARY-FRED_API_KEY-`
+CI has no real keys. It builds with `ALPHA_VANTAGE_API_KEY=OMNI-CANARY-ALPHA_VANTAGE_API_KEY-`
and friends, then looks for those exact values in what a browser is served.
Run it locally against your own `.env`:
diff --git a/package.json b/package.json
index c40e786..c53f907 100644
--- a/package.json
+++ b/package.json
@@ -17,8 +17,6 @@
"test:watch": "vitest",
"test:e2e": "playwright test",
"scan:bundle": "npx tsx scripts/scan-client-bundle.ts",
- "dev:vinext": "vinext dev --port 3001",
- "build:vinext": "npm run build",
"start:vinext": "wrangler dev --config dist/server/wrangler.json",
"deploy:vinext": "vinext-cloudflare deploy --config dist/server/wrangler.json",
"catalog:build": "tsx scripts/build-api-index.ts",
diff --git a/public/curated-quality.json b/public/curated-quality.json
index 4ab13e9..f761a21 100644
--- a/public/curated-quality.json
+++ b/public/curated-quality.json
@@ -3,27 +3,6 @@
"version": 1,
"checkedAt": "2026-10-12T21:31:53.965Z",
"results": [
- {
- "api": "omni:fred",
- "operationId": "getSeriesObservations",
- "title": "Values of an economic series over time",
- "status": "skipped",
- "detail": "no key (set FRED_API_KEY)"
- },
- {
- "api": "omni:fred",
- "operationId": "searchSeries",
- "title": "Find economic series by keyword",
- "status": "skipped",
- "detail": "no key (set FRED_API_KEY)"
- },
- {
- "api": "omni:fred",
- "operationId": "getSeries",
- "title": "Describe one economic series",
- "status": "skipped",
- "detail": "no key (set FRED_API_KEY)"
- },
{
"api": "omni:bls",
"operationId": "getSeries",
@@ -38,27 +17,6 @@
"title": "Stock quote or price history",
"status": "skipped",
"detail": "no key (set ALPHA_VANTAGE_API_KEY)"
- },
- {
- "api": "omni:newsapi",
- "operationId": "topHeadlines",
- "title": "Top headlines now",
- "status": "skipped",
- "detail": "no key (set NEWSAPI_KEY)"
- },
- {
- "api": "omni:newsapi",
- "operationId": "everything",
- "title": "Search news articles",
- "status": "skipped",
- "detail": "no key (set NEWSAPI_KEY)"
- },
- {
- "api": "omni:metaculus",
- "operationId": "listPosts",
- "title": "Forecasting questions",
- "status": "skipped",
- "detail": "no key (set METACULUS_API_KEY)"
}
]
}
diff --git a/scripts/lib/verifySpec.ts b/scripts/lib/verifySpec.ts
index a636311..23e79fd 100644
--- a/scripts/lib/verifySpec.ts
+++ b/scripts/lib/verifySpec.ts
@@ -34,8 +34,7 @@ function sampleInput(manifest: CapabilityManifest): { ok: true; input: Record {
const results: QualityResult[] = [];
diff --git a/scripts/verify-curated.ts b/scripts/verify-curated.ts
index 1cdc390..485ae0c 100644
--- a/scripts/verify-curated.ts
+++ b/scripts/verify-curated.ts
@@ -12,9 +12,7 @@
// no example is reported as untestable rather than guessed at.
//
// Keys come from the environment (each curated entry's `keyEnv`); without
-// one, a keyed operation is "skipped", never "failed". In Node there is no
-// CORS, so a broker-routed API is called directly here: this verifies the
-// provider and the spec, not the broker.
+// one, a keyed operation is "skipped", never "failed".
//
// Exit 1 when any operation failed. Nothing is written without --write.
// ============================================
diff --git a/src/blocks/capability/CapabilityBlock.tsx b/src/blocks/capability/CapabilityBlock.tsx
index 8c10575..78b78ca 100644
--- a/src/blocks/capability/CapabilityBlock.tsx
+++ b/src/blocks/capability/CapabilityBlock.tsx
@@ -16,8 +16,6 @@ import { KeyField, keySlotOf, useHasKey } from '@/components/apis/KeyField';
import { useRememberingKeys } from '@/components/apis/RememberKeys';
import { SignInPrompt } from '@/components/apis/SignIn';
import { signInSlotOf } from '@/core/capabilities/connect';
-import { ProviderAttribution } from '@/components/apis/ProviderAttribution';
-import { attributionFor } from '@/core/capabilities/curatedApis';
import { argumentsFrom, CapabilityInputs, constantOf, inputSummaryOf, missingInputs } from './CapabilityInputs';
import { CapabilityResult } from './CapabilityResult';
@@ -48,7 +46,7 @@ function isUnboundKeyError(error: string): boolean {
/**
* An API that may be saying no to the credential: worth offering to change
- * the key. Some report a bad key as 400 (FRED does), not 401 or 403.
+ * the key. Some report a bad key as 400, not 401 or 403.
*/
function isRefusal(error: string): boolean {
return /\bHTTP (400|401|403)\b/.test(error);
@@ -97,8 +95,6 @@ export function CapabilityBlockView({ instanceId }: { instanceId: string }) {
const signIn = signInSlotOf(manifest);
const needsSignIn = signIn !== null;
const needsCredential = needsKey || needsSignIn;
- // A provider whose terms require a notice on every app screen that uses it (FRED).
- const attribution = attributionFor(manifest);
const sideEffect = manifest?.effect === 'write' || manifest?.effect === 'destructive';
const params = isPlainParams(block?.params) ? block.params : {};
@@ -185,9 +181,6 @@ export function CapabilityBlockView({ instanceId }: { instanceId: string }) {
{manifest ? : not installed }
{destination ? {destination} : null}
- {manifest?.transport.kind === 'http' && manifest.transport.access === 'server_broker' ? (
- via server
- ) : null}
{sideEffect ? (
{manifest?.approval === 'approved' ? 'approved' : 'needs approval'}
) : null}
@@ -260,7 +253,6 @@ export function CapabilityBlockView({ instanceId }: { instanceId: string }) {
) : null}
- {attribution ? : null}
{previewError ? (
{previewError}
) : null}
diff --git a/src/blocks/capability/CapabilityInputs.tsx b/src/blocks/capability/CapabilityInputs.tsx
index a69bd60..9e65eaa 100644
--- a/src/blocks/capability/CapabilityInputs.tsx
+++ b/src/blocks/capability/CapabilityInputs.tsx
@@ -83,8 +83,8 @@ export function coerceInput(input: CapabilityInput, draft: unknown): unknown {
}
/**
- * A required input with exactly one allowed value is not a choice: FRED's
- * `file_type` must be `json`. It is sent without a field.
+ * A required input with exactly one allowed value is not a choice. It is
+ * sent without a field.
*/
export function constantOf(input: CapabilityInput): { value: unknown } | null {
const options = input.schema.enum;
diff --git a/src/blocks/capability/CapabilityResult.tsx b/src/blocks/capability/CapabilityResult.tsx
index 60f2dbf..6cb5177 100644
--- a/src/blocks/capability/CapabilityResult.tsx
+++ b/src/blocks/capability/CapabilityResult.tsx
@@ -196,7 +196,7 @@ function rowsOf(value: unknown): unknown[] | null {
/**
* The one list a response carries, found through wrappers: a record holding
- * exactly one list (FRED's `observations`, a search's `results`), a
+ * exactly one list (a search's `results`), a
* one-element array around a record (BLS's `series`), or a map of rows.
* Plain values and flat records beside it are kept as details.
*/
diff --git a/src/blocks/capability/ProviderAttribution.component.test.tsx b/src/blocks/capability/ProviderAttribution.component.test.tsx
deleted file mode 100644
index 0a052e7..0000000
--- a/src/blocks/capability/ProviderAttribution.component.test.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-// @vitest-environment happy-dom
-import { afterEach, beforeEach, describe, expect, it } from 'vitest';
-import { render, screen } from '@testing-library/react';
-import { CapabilityBlockView } from './CapabilityBlock';
-import { attributionFor, curatedApi } from '@/core/capabilities/curatedApis';
-import { compileOpenApi } from '@/core/capabilities/openapi';
-import { clearCapabilities, installProposal } from '@/core/capabilities/registry';
-import { blockRegistry } from '@/core/registry/BlockRegistry';
-import { useBlockStore, useWireStore } from '@/core/stores';
-
-const NOTICE = 'This product uses the FRED® API but is not endorsed or certified by the Federal Reserve Bank of St. Louis.';
-
-function fredManifests() {
- const fred = curatedApi('omni:fred')!;
- return compileOpenApi(fred.spec, { sourceLocator: fred.entry.specUrl, brokerOrigins: fred.brokerOrigins }).manifests;
-}
-
-beforeEach(() => {
- clearCapabilities();
- useBlockStore.setState({ blocks: [], activeShellId: 'root' });
- useWireStore.setState({ wires: [] });
-});
-afterEach(() => {
- clearCapabilities();
- useBlockStore.setState({ blocks: [] });
-});
-
-describe('FRED attribution', () => {
- it('applies to every FRED operation, by its origin, however it was installed', () => {
- for (const manifest of fredManifests()) expect(attributionFor(manifest)?.notice).toBe(NOTICE);
- const pasted = compileOpenApi(curatedApi('omni:fred')!.spec).manifests[0];
- expect(attributionFor(pasted)?.notice).toBe(NOTICE);
- });
-
- it('does not apply to other APIs', () => {
- const metaculus = curatedApi('omni:metaculus')!;
- const [manifest] = compileOpenApi(metaculus.spec, { brokerOrigins: metaculus.brokerOrigins }).manifests;
- expect(attributionFor(manifest)).toBeNull();
- });
-
- it('shows the notice and the terms link on a FRED block, before any run', () => {
- const [manifest] = fredManifests();
- expect(installProposal(manifest).ok).toBe(true);
- const instanceId = useBlockStore.getState().addBlock(blockRegistry.get(manifest.id)!, { x: 0, y: 0 });
- render( );
- expect(screen.getByTestId('provider-attribution').textContent).toContain(NOTICE);
- const link = screen.getByRole('link', { name: 'FRED® API Terms of Use' }) as HTMLAnchorElement;
- expect(link.href).toBe('https://fred.stlouisfed.org/docs/api/terms_of_use.html');
- expect(link.rel).toContain('noopener');
- });
-});
diff --git a/src/components/ShellPanel.tsx b/src/components/ShellPanel.tsx
index cc73caf..09dbeb8 100644
--- a/src/components/ShellPanel.tsx
+++ b/src/components/ShellPanel.tsx
@@ -9,7 +9,7 @@ import { useState, useEffect, useId, useRef } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { useShellStore, useBlockStore } from '@/core/stores';
import { ShellConfig } from '@/core/schemas/shell.schema';
-import { SHELL_TEMPLATES, keyedProvidersForTemplate, type ShellTemplate } from '@/core/shells/templates';
+import { SHELL_TEMPLATES, type ShellTemplate } from '@/core/shells/templates';
interface ShellPanelProps {
isOpen: boolean;
@@ -257,7 +257,7 @@ export function ShellPanel({ isOpen, onClose }: ShellPanelProps) {
{template.description}
- {keyedProvidersLine(template)}
+ Works without API keys
@@ -408,13 +408,6 @@ export function ShellPanel({ isOpen, onClose }: ShellPanelProps) {
);
}
-function keyedProvidersLine(template: ShellTemplate): string {
- const keyed = keyedProvidersForTemplate(template);
- if (keyed.length === 0) return 'Works without API keys';
- const names = keyed.map(p => p.envVar).filter((name): name is string => Boolean(name));
- return `Needs ${names.join(', ')}`;
-}
-
// ============================================
// SHELL SECTION COMPONENT
// ============================================
diff --git a/src/components/apis/AddApiDialog.component.test.tsx b/src/components/apis/AddApiDialog.component.test.tsx
index 1ea8e6e..f22ffa5 100644
--- a/src/components/apis/AddApiDialog.component.test.tsx
+++ b/src/components/apis/AddApiDialog.component.test.tsx
@@ -104,36 +104,33 @@ afterEach(() => {
// Find → review → install & place
// ============================================
-describe('AddApiDialog: a curated API (FRED)', () => {
- it('finds FRED beside the directory, says its calls go through Flyspace, and installs it as broker reads', async () => {
+describe('AddApiDialog: a curated API (Alpha Vantage)', () => {
+ it('finds Alpha Vantage beside the directory, says its calls go to the provider, and installs it as a browser read', async () => {
render(
);
- fireEvent.change(await screen.findByLabelText('Search APIs'), { target: { value: 'unemployment inflation' } });
- const fred = screen.getByRole('button', { name: 'Review FRED Economic Data' });
- expect(fred.textContent).toContain('· curated by Flyspace');
- fireEvent.click(fred);
+ fireEvent.change(await screen.findByLabelText('Search APIs'), { target: { value: 'stock quotes' } });
+ const alpha = screen.getByRole('button', { name: 'Review Alpha Vantage Stocks' });
+ expect(alpha.textContent).toContain('· curated by Flyspace');
+ fireEvent.click(alpha);
expect(await screen.findByText(/Spec written by Flyspace from the provider/)).toBeTruthy();
- expect(screen.getByText(/Sends requests to/).textContent).toContain('https://api.stlouisfed.org through Flyspace’s own server');
- expect(screen.getByText(/refuses calls from a browser/)).toBeTruthy();
- // FRED's terms: its notice and terms link, shown before installing.
- expect(screen.getByTestId('provider-attribution').textContent).toContain('is not endorsed or certified by the Federal Reserve Bank of St. Louis');
- // Where to get the key, from FRED's own pages, and the documented format checked on paste.
+ expect(screen.getByText(/Sends requests to/).textContent).toContain('https://www.alphavantage.co');
+ // Where to get the key, from Alpha Vantage's own pages.
const guide = screen.getByTestId('key-guide');
- expect(guide.textContent).toContain('Get a key at fredaccount.stlouisfed.org/apikeys');
- expect(guide.textContent).toContain('A free FRED account');
+ expect(guide.textContent).toContain('Get a key at www.alphavantage.co/support');
+ expect(guide.textContent).toContain('what describes you, your organization, and your email');
expect(guide.querySelector('a')!.getAttribute('rel')).toBe('noopener noreferrer');
- fireEvent.change(screen.getByLabelText('Key for https://api.stlouisfed.org'), { target: { value: 'abc123' } });
- expect(screen.getByText(/does not look like the documented key format \(32 lowercase letters and digits\)/)).toBeTruthy();
+ fireEvent.change(screen.getByLabelText('Key for https://www.alphavantage.co'), { target: { value: 'abc123' } });
fireEvent.click(screen.getByRole('button', { name: 'Install & place' }));
- const installed = allCapabilities().filter(m => m.source.locator === 'omni:curated/fred');
- expect(installed).toHaveLength(3);
- for (const manifest of installed) expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('server_broker');
- expect(placedCapabilityBlocks()[0].schema.display_name).toBe('Values of an economic series over time');
- expect(calls().some(url => url.includes('stlouisfed'))).toBe(false); // nothing fetched for the spec
+ const installed = allCapabilities().filter(m => m.source.locator === 'omni:curated/alpha-vantage');
+ expect(installed).toHaveLength(1);
+ for (const manifest of installed) expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('browser_direct');
+ expect(placedCapabilityBlocks()[0].schema.display_name).toBe('Stock quote or price history');
+ expect(calls().some(url => url.includes('alphavantage'))).toBe(false); // nothing fetched for the spec
+ });
+
});
-});
describe('AddApiDialog: from search to the canvas', () => {
it('opens on search, and reviews nothing until an API is chosen', async () => {
diff --git a/src/components/apis/AddApiDialog.tsx b/src/components/apis/AddApiDialog.tsx
index 3782db5..1648de2 100644
--- a/src/components/apis/AddApiDialog.tsx
+++ b/src/components/apis/AddApiDialog.tsx
@@ -5,8 +5,8 @@ import { X } from 'lucide-react';
import { ApiSearch } from '@/components/ApiSearch';
import type { ApiIndexEntry } from '@/core/capabilities/apiIndex';
import { compileOpenApi } from '@/core/capabilities/openapi';
-import { attributionFor, curatedApi } from '@/core/capabilities/curatedApis';
-import { checkKeyFormat, keyGuideFor } from '@/core/capabilities/keyGuide';
+import { curatedApi } from '@/core/capabilities/curatedApis';
+import { keyGuideFor } from '@/core/capabilities/keyGuide';
import { KeyGuideNote } from './KeyGuideNote';
import { useKeyKeepingNote } from './RememberKeys';
import { fetchCatalogSpec, RegistryFetchError } from '@/core/capabilities/registrySearch';
@@ -18,7 +18,6 @@ import { spatialSession } from '@/core/interaction/session';
import { useUIStore } from '@/core/stores/uiStore';
import { ApiReview, destinationOf } from './ApiReview';
import { isUserInstalled, YourApis } from './YourApis';
-import { ProviderAttribution } from './ProviderAttribution';
/** A capability block's default footprint, used to center it on the canvas. */
const BLOCK_SIZE = { width: 320, height: 240 };
@@ -109,8 +108,8 @@ export function AddApiDialog({ open, onClose }: AddApiDialogProps) {
if (!open) return null;
- const showProposals = (document: unknown, title: string, subtitle: string, locator?: string, brokerOrigins?: readonly string[]) => {
- const result = compileOpenApi(document, { ...(locator ? { sourceLocator: locator } : {}), ...(brokerOrigins ? { brokerOrigins } : {}) });
+ const showProposals = (document: unknown, title: string, subtitle: string, locator?: string) => {
+ const result = compileOpenApi(document, locator ? { sourceLocator: locator } : {});
setInstall(Object.fromEntries(result.manifests.map(m => [m.id, true])));
setPlaceId(defaultPlacement(result.manifests));
setSecrets({});
@@ -137,7 +136,7 @@ export function AddApiDialog({ open, onClose }: AddApiDialogProps) {
const subtitle = curated
? `Spec written by Flyspace from the provider's docs · ${entry.updated}`
: entry.updated ? `Spec updated ${entry.updated} · ${entry.id}` : entry.id;
- showProposals(document, entry.title, subtitle, entry.specUrl, curated?.brokerOrigins);
+ showProposals(document, entry.title, subtitle, entry.specUrl);
} catch (err) {
if (abort.signal.aborted) return;
setReview({ state: 'failed', message: err instanceof RegistryFetchError ? err.message : `${entry.title}: the spec could not be fetched` });
@@ -310,10 +309,6 @@ export function AddApiDialog({ open, onClose }: AddApiDialogProps) {
{review.issues.map(issue => {issue} )}
) : null}
- {(() => {
- const attribution = proposals.map(attributionFor).find(Boolean);
- return attribution ?
: null;
- })()}
{proposals.some(manifest => install[manifest.id] && manifest.auth.kind === 'oauth') ? (
These operations read your own account, so they need a sign-in with read-only access. Place them, then sign in from the block.
@@ -325,7 +320,6 @@ export function AddApiDialog({ open, onClose }: AddApiDialogProps) {
{[...secretSlots].map(([ref, manifest]) => {
const destination = destinationOf(manifest);
const guide = keyGuideFor(manifest);
- const formatWarning = checkKeyFormat(guide, secrets[ref] ?? '');
return (
@@ -339,7 +333,6 @@ export function AddApiDialog({ open, onClose }: AddApiDialogProps) {
onChange={event => setSecrets(prev => ({ ...prev, [ref]: event.target.value }))}
className="mt-1 w-full rounded-lg border border-[var(--citadel-border)] bg-[var(--citadel-elevated)] px-2 py-1.5 text-sm text-[var(--text-primary)]"
/>
- {formatWarning ? {formatWarning} : null}
{manifest.auth.hint && guide?.source !== 'provider' ? (
The API says: {manifest.auth.hint}
diff --git a/src/components/apis/ApiReview.tsx b/src/components/apis/ApiReview.tsx
index 00df80c..3db3dcf 100644
--- a/src/components/apis/ApiReview.tsx
+++ b/src/components/apis/ApiReview.tsx
@@ -34,7 +34,7 @@ export function operationParts(manifest: CapabilityManifest): { method: string;
/** `city, state (optional: units)`: what you will be asked for before a run. */
function inputSummary(manifest: CapabilityManifest): string {
- // A one-value input (FRED's file_type) is filled in, not asked for.
+ // A one-value input is filled in, not asked for.
const asked = manifest.inputs.filter(input => !(input.required && input.schema.enum?.length === 1));
const required = asked.filter(input => input.required).map(input => input.name);
const optional = asked.filter(input => !input.required).map(input => input.name);
@@ -44,15 +44,13 @@ function inputSummary(manifest: CapabilityManifest): string {
}
/** The origin a request goes to, and how a credential travels with it. */
-export function destinationOf(manifest: CapabilityManifest): { origin: string; credential: string | null; inUrl: boolean; viaServer: boolean } | null {
+export function destinationOf(manifest: CapabilityManifest): { origin: string; credential: string | null; inUrl: boolean } | null {
if (manifest.transport.kind !== 'http') return null;
const placement = credentialPlacement(manifest);
return {
origin: new URL(manifest.transport.baseUrl).origin,
credential: placement ? `${manifest.auth.kind} in ${placement}` : null,
- inUrl: manifest.auth.in === 'query',
- /** Sent from Flyspace's own server (the broker), not from the browser. */
- viaServer: manifest.transport.access === 'server_broker'
+ inUrl: manifest.auth.in === 'query'
};
}
@@ -74,7 +72,6 @@ interface ApiReviewProps {
*/
export function ApiReview({ title, subtitle, proposals, install, placeId, onToggleInstall, onPlace }: ApiReviewProps) {
const destinations = [...new Set(proposals.map(p => destinationOf(p)?.origin).filter(Boolean))];
- const viaServer = proposals.some(p => destinationOf(p)?.viaServer);
return (
@@ -83,12 +80,6 @@ export function ApiReview({ title, subtitle, proposals, install, placeId, onTogg
{destinations.length > 0 ? (
Sends requests to {destinations.join(', ')}
- {viaServer ? ' through Flyspace’s own server' : null}
-
- ) : null}
- {viaServer ? (
-
- This API refuses calls from a browser, so Flyspace's server makes them. Your key goes with each request to that server and on to the API; the server does not keep it.
) : null}
diff --git a/src/components/apis/KeyField.tsx b/src/components/apis/KeyField.tsx
index c9e96e8..6b10e18 100644
--- a/src/components/apis/KeyField.tsx
+++ b/src/components/apis/KeyField.tsx
@@ -3,7 +3,7 @@
import { useState, useSyncExternalStore } from 'react';
import type { CapabilityManifest } from '@/core/capabilities/manifest';
import { MAX_SECRET_BYTES, capabilitySecrets, secretByteLength } from '@/core/capabilities/secrets';
-import { checkKeyFormat, keyGuideFor } from '@/core/capabilities/keyGuide';
+import { keyGuideFor } from '@/core/capabilities/keyGuide';
import { destinationOf } from './ApiReview';
import { KeyGuideNote } from './KeyGuideNote';
import { useKeyKeepingNote } from './RememberKeys';
@@ -45,7 +45,6 @@ export function KeyField({ manifest, onSaved, onCancel, autoFocus, compact }: Ke
const destination = destinationOf(manifest);
const guide = keyGuideFor(manifest);
const keepingNote = useKeyKeepingNote();
- const formatWarning = checkKeyFormat(guide, value);
if (!ref) return null;
const save = () => {
@@ -91,7 +90,6 @@ export function KeyField({ manifest, onSaved, onCancel, autoFocus, compact }: Ke
className="mt-1 w-full rounded-md border border-[var(--citadel-border)] bg-[var(--citadel-elevated)] px-2 py-1 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--citadel-primary)] focus:outline-none"
/>
- {formatWarning ?
{formatWarning}
: null}
{guide ?
: null}
{manifest.auth.hint && guide?.source !== 'provider' ? (
The API says: {manifest.auth.hint}
diff --git a/src/components/apis/ProviderAttribution.tsx b/src/components/apis/ProviderAttribution.tsx
deleted file mode 100644
index 526c845..0000000
--- a/src/components/apis/ProviderAttribution.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-'use client';
-
-import type { Attribution } from '@/core/capabilities/curatedApis';
-
-/**
- * What a provider's terms require an app to show (FRED's notice and terms
- * link), in the provider's own words. Not collapsible: the terms ask for it
- * to be shown prominently.
- */
-export function ProviderAttribution({ attribution }: { attribution: Attribution }) {
- return (
-
- {attribution.notice} Using this block means agreeing to the{' '}
-
- {attribution.termsTitle}
- .
-
- );
-}
diff --git a/src/components/apis/RememberKeys.component.test.tsx b/src/components/apis/RememberKeys.component.test.tsx
index e8ea75c..9f34741 100644
--- a/src/components/apis/RememberKeys.component.test.tsx
+++ b/src/components/apis/RememberKeys.component.test.tsx
@@ -15,8 +15,8 @@ beforeEach(async () => {
capabilitySecrets.clear();
indexedDB.deleteDatabase(KEY_VAULT_DB);
await startKeyVault();
- const fred = curatedApi('omni:fred')!;
- for (const manifest of compileOpenApi(fred.spec, { sourceLocator: fred.entry.specUrl, brokerOrigins: fred.brokerOrigins }).manifests) {
+ const alpha = curatedApi('omni:alpha-vantage')!;
+ for (const manifest of compileOpenApi(alpha.spec, { sourceLocator: alpha.entry.specUrl }).manifests) {
installProposal(manifest);
}
});
@@ -39,7 +39,7 @@ describe('Remember keys on this device', () => {
await waitFor(() => expect(toggle.checked).toBe(true));
expect(screen.getByText(/stored encrypted in this browser, with a key it cannot export/)).toBeTruthy();
- fireEvent.click(screen.getByRole('button', { name: /Enter key for https:\/\/api.stlouisfed.org/ }));
+ fireEvent.click(screen.getByRole('button', { name: /Enter key for https:\/\/www.alphavantage.co/ }));
expect(screen.getByText('Remembered on this device, encrypted. Never saved with your canvas.')).toBeTruthy();
});
diff --git a/src/components/blocks/BlockCard.tsx b/src/components/blocks/BlockCard.tsx
index 7a203c8..5700c47 100644
--- a/src/components/blocks/BlockCard.tsx
+++ b/src/components/blocks/BlockCard.tsx
@@ -14,7 +14,7 @@ import {
Brain
} from 'lucide-react';
import { BlockInstance, ConnectionStatus } from '@/core/schemas/block.schema';
-import { useMindStore, useUIStore } from '@/core/stores';
+import { useMindStore } from '@/core/stores';
import { useWireStore } from '@/core/stores/wireStore';
import { WireHandle } from '@/canvas/WireHandle';
import { BlockErrorBoundary } from './BlockErrorBoundary';
@@ -60,8 +60,6 @@ export function BlockCard({
// Focus (pin) state
const isPinned = useMindStore(state => state.isPinned(block.instance_id));
- // Lit while a provenance chip for this block is hovered (see PersonaBlock).
- const isCited = useUIStore(state => state.highlightedBlockIds.includes(block.instance_id));
const pinBlock = useMindStore(state => state.pinBlock);
const unpinBlock = useMindStore(state => state.unpinBlock);
@@ -97,21 +95,17 @@ export function BlockCard({
scale: isDragging ? 1.02 : 1,
boxShadow: isDragging
? '0 20px 40px rgba(0, 0, 0, 0.4), 0 0 40px rgba(99, 102, 241, 0.2)'
- : isCited
- ? '0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 28px rgba(34, 211, 238, 0.25)'
- : undefined
+ : undefined
}}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
- data-cited={isCited ? 'true' : 'false'}
data-status={block.status}
data-block-type={block.schema.block_id}
className={cn(
"block-card flex flex-col group",
isDragging && "ring-2 ring-[var(--citadel-primary)]",
isPinned && "ring-1 ring-[var(--mind-aqua-surface)] shadow-[0_0_12px_rgba(99,255,230,0.15)]",
- !isPinned && isWired && "ring-1 ring-[var(--truth-amber)]/20",
- isCited && "ring-2 ring-[var(--citadel-secondary)]"
+ !isPinned && isWired && "ring-1 ring-[var(--truth-amber)]/20"
)}
style={{
width: block.dimensions.width,
diff --git a/src/core/account/account.test.ts b/src/core/account/account.test.ts
index 6774a36..731b9aa 100644
--- a/src/core/account/account.test.ts
+++ b/src/core/account/account.test.ts
@@ -3,6 +3,10 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
import { accountRequest, prepareAccountSnapshot, validateAccountSnapshot, SIGN_IN_URL } from './account';
import { captureLiveStores } from './snapshot';
import type { OmniVaultExport } from '../vault/vaultExport';
+import { BLS_SPEC } from '../capabilities/curated/bls';
+import { compileOpenApi } from '../capabilities/openapi';
+import { clearCapabilities, restoreSnapshot } from '../capabilities/registry';
+import { sealManifest } from '../capabilities/manifest';
const snapshot: OmniVaultExport = { format: 'omni-vault-export', version: 1, exportedAt: 1, data: {
'omni-blocks': '{"state":{"blocks":[]}}',
'omni-api-vault': '{"key":"secret"}',
@@ -26,6 +30,30 @@ describe('private account snapshots', () => {
expect(() => validateAccountSnapshot({ ...snapshot, data: [] })).toThrow();
expect(validateAccountSnapshot(captureLiveStores()).format).toBe('omni-vault-export');
});
+ it('restores a canvas whose backup holds a retired capability, and drops only that capability', () => {
+ const [kept] = compileOpenApi(BLS_SPEC, { sourceLocator: 'test:bls' }).manifests;
+ const { digest: _digest, ...body } = kept;
+ const retired = sealManifest({ ...body, transport: { ...kept.transport, access: 'server_broker' } } as unknown as Parameters
[0]);
+ const backup = captureLiveStores();
+ const store = JSON.parse(backup.data['omni-capabilities']);
+ store.state.manifests = [retired, kept];
+ backup.data['omni-capabilities'] = JSON.stringify(store);
+
+ expect(validateAccountSnapshot(backup).format).toBe('omni-vault-export');
+
+ clearCapabilities();
+ const report = restoreSnapshot({ version: 1, manifests: [retired, kept] });
+ expect(report.installed).toContain(kept.id);
+ expect(report.rejected).toEqual([{ id: retired.id, errors: ['http transport access must be browser_direct'] }]);
+ clearCapabilities();
+ });
+ it('still refuses a backup whose capability is not an object', () => {
+ const backup = captureLiveStores();
+ const store = JSON.parse(backup.data['omni-capabilities']);
+ store.state.manifests = ['not a manifest'];
+ backup.data['omni-capabilities'] = JSON.stringify(store);
+ expect(() => validateAccountSnapshot(backup)).toThrow('A capability in this backup is invalid.');
+ });
it('rejects malformed and partial stores before local changes', () => {
const full = captureLiveStores();
localStorage.setItem('omni-blocks', 'original');
diff --git a/src/core/account/snapshot.ts b/src/core/account/snapshot.ts
index e399c1c..eb074e2 100644
--- a/src/core/account/snapshot.ts
+++ b/src/core/account/snapshot.ts
@@ -4,7 +4,6 @@ import { useShellStore, SHELL_CONFIG_SHAPE, SHELL_BLOCK_SHAPE } from '../stores/
import { useMindStore, LLM_CONFIG_SHAPE, GRAPH_SHAPE, PERSONA_SHAPE, CONTEXT_POOL_SHAPE, CONTEXT_ENTRY_SHAPE } from '../stores/mindStore';
import { useSettingsStore } from '../stores/settingsStore';
import { useCapabilityStore } from '../capabilities/store';
-import { validateManifest } from '../capabilities/manifest';
import { fieldError, type FieldSpec } from '../vault/hydration';
import type { OmniVaultExport } from '../vault/vaultExport';
@@ -54,5 +53,5 @@ export function validateStoreEnvelopes(snapshot: OmniVaultExport): void {
for (const pool of mind.contextPools as Record[]) records(pool.entries, CONTEXT_ENTRY_SHAPE, 'pool.entries');
check(states['omni-settings'], { useMockData: 'boolean', gridSnapping: 'boolean', gridSize: 'number' }, 'settings');
const capabilities = states['omni-capabilities']; check(capabilities.manifests, 'array', 'manifests'); records(capabilities.stale, { id: 'string', title: 'string', reason: 'string', manifest: 'unknown' }, 'stale');
- for (const manifest of capabilities.manifests as unknown[]) if (!validateManifest(manifest).ok) throw new Error('A capability in this backup is invalid.');
+ for (const manifest of capabilities.manifests as unknown[]) if (typeof manifest !== 'object' || manifest === null || Array.isArray(manifest)) throw new Error('A capability in this backup is invalid.');
}
diff --git a/src/core/capabilities/DESIGN.md b/src/core/capabilities/DESIGN.md
index 5fc27e0..1c026a5 100644
--- a/src/core/capabilities/DESIGN.md
+++ b/src/core/capabilities/DESIGN.md
@@ -29,7 +29,7 @@ other transport is `local`, for the built-in speech handlers.
An `oauth` binding carries scopes and a slot (one slot per origin and scope
set). The public preview has no sign-in, so nothing fills that slot: the block
says sign-in is not set up (`connect.ts`) and execution is `AUTH_UNBOUND`.
-`oauth` is http-only and never rides `server_broker`. `compileOpenApi` binds
+`oauth` is http-only. `compileOpenApi` binds
an OpenAPI oauth2 scheme only for a provider in `connectProviders.ts`
(Google), only when the API is on that provider's own hosts, and only for a
read operation with a read-only scope; a write that needs a sign-in is
@@ -59,7 +59,7 @@ A manifest describes a capability. It does not grant itself authority.
- Wires enter through `admitConnection`. Typed mismatches are refused. A string sink may record `text` or `join_titles` instead of pretending the source was already that string.
- Execution is one runtime: `executeCapability`. Each run is a vault record with an idempotency key. The same key and the same request replays; a different request under that key conflicts. The request is compared by its digest (the one a write confirms). A write that leaves the process and then throws, or is still `running` after its deadline, is `EFFECT_UNCERTAIN` and is not retryable.
- Triggers are `manual`, `on_create` (once per block), `on_input_change`, and `interval`. Write and destructive stay manual. Mounting a view is not a trigger.
-- HTTP capabilities are `browser_direct` or `server_broker`. `compileOpenApi` sets `server_broker` only when the host asks for it, and then only for read and compute; `validateManifest` refuses a brokered write, destructive or oauth manifest. The public preview has no broker: `/api/capability-broker` answers 503, and a brokered block shows that error.
+- HTTP capabilities are `browser_direct`: the browser calls the API itself, and a key goes straight to that API. The preview has no broker.
- A base URL is https, carries no query or fragment, and an IP literal in it must be public. Loopback (http or https) is allowed only when the host itself built the manifest (`validateManifest(..., { hostCreated: true })`). Unsupported OpenAPI constructs fail compilation instead of becoming `any`, with one exception: a response field below the top level that declares no type is typed `any` (`ConvertOptions` in `jsonSchema.ts`), because the API does return it and an `any` source is never assignable to a typed input. A response that is untyped as a whole, or a result list of untyped items, still fails, and so does an untyped input.
- Speech has a session id, a source (`unknown` until a local adapter proves otherwise), and cancel. A denied microphone is `Permission denied`, not the browser error code.
diff --git a/src/core/capabilities/capability.vertical.test.ts b/src/core/capabilities/capability.vertical.test.ts
index 51082dc..884f607 100644
--- a/src/core/capabilities/capability.vertical.test.ts
+++ b/src/core/capabilities/capability.vertical.test.ts
@@ -250,6 +250,15 @@ describe('capability compiler', () => {
expect(installProposal(blessed).manifest?.approval).toBe('pending');
});
+ it('rejects a sealed manifest whose http transport is not browser_direct', () => {
+ const list = byOp('listPosts');
+ if (list.transport.kind !== 'http') throw new Error('expected http');
+ const brokered = sealManifest({ ...list, transport: { ...list.transport, access: 'server_broker' as never } });
+ const validation = validateManifest(brokered);
+ expect(validation.ok).toBe(false);
+ expect(validation.errors).toEqual(['http transport access must be browser_direct']);
+ });
+
it('turns the sample API into a wired block, and removes it, without a catalog edit', async () => {
expect(blockRegistry.has('polymarket_live_odds')).toBe(true);
diff --git a/src/core/capabilities/connect.compile.test.ts b/src/core/capabilities/connect.compile.test.ts
index c87efc6..477ae53 100644
--- a/src/core/capabilities/connect.compile.test.ts
+++ b/src/core/capabilities/connect.compile.test.ts
@@ -57,11 +57,6 @@ describe('compiling a Google sign-in', () => {
expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('browser_direct');
});
- it('never routes a sign-in through the broker, even for a host the app brokers', () => {
- const [manifest] = compileOpenApi(googleSpec(), { brokerOrigins: ['https://www.googleapis.com'] }).manifests;
- expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('browser_direct');
- });
-
it('refuses a write operation that needs a sign-in', () => {
const { manifests, errors } = compileOpenApi(googleSpec({ post: true }));
expect(manifests.map(manifest => manifest.source.operationId)).toEqual(['calendar.calendars.get']);
diff --git a/src/core/capabilities/curated/fred.ts b/src/core/capabilities/curated/fred.ts
deleted file mode 100644
index aa6400e..0000000
--- a/src/core/capabilities/curated/fred.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-// FRED (Federal Reserve Economic Data), St. Louis Fed.
-// Hand-written from https://fred.stlouisfed.org/docs/api/fred/ (2026-10-07):
-// FRED publishes no OpenAPI document, and is not in the APIs.guru directory.
-// Three reads; FRED has no writes. `file_type` is pinned to json because the
-// API answers XML by default. FRED sends no CORS headers, so Flyspace reaches
-// it through its own server broker (see curatedApis.ts).
-
-const DATE = { type: 'string', format: 'date' };
-
-const SERIES = {
- type: 'object',
- properties: {
- id: { type: 'string', description: 'The series id, e.g. GDP or UNRATE' },
- title: { type: 'string' },
- observation_start: DATE,
- observation_end: DATE,
- frequency: { type: 'string' },
- units: { type: 'string' },
- seasonal_adjustment: { type: 'string' },
- last_updated: { type: 'string' },
- popularity: { type: 'integer' },
- notes: { type: 'string' }
- }
-};
-
-const FILE_TYPE = {
- name: 'file_type',
- in: 'query',
- required: true,
- description: 'Response format. Flyspace reads JSON.',
- schema: { type: 'string', enum: ['json'] }
-};
-
-const SERIES_ID = {
- name: 'series_id',
- in: 'query',
- required: true,
- description: 'The FRED series id: GDP, UNRATE (unemployment rate), CPIAUCSL (consumer prices), FEDFUNDS (fed funds rate), DGS10 (10-year Treasury yield).',
- example: 'UNRATE',
- schema: { type: 'string' }
-};
-
-export const FRED_SPEC = {
- openapi: '3.0.3',
- info: {
- title: 'FRED Economic Data',
- version: '1.0.0',
- description: 'Economic time series from the Federal Reserve Bank of St. Louis: GDP, unemployment, inflation, interest rates, and over 800,000 more.'
- },
- servers: [{ url: 'https://api.stlouisfed.org/fred' }],
- security: [{ fredKey: [] }],
- components: {
- securitySchemes: {
- fredKey: {
- type: 'apiKey',
- in: 'query',
- name: 'api_key',
- description: 'Your FRED API key (free). Request one at https://fredaccount.stlouisfed.org/apikeys'
- }
- }
- },
- paths: {
- '/series/observations': {
- get: {
- operationId: 'getSeriesObservations',
- summary: 'Values of an economic series over time',
- parameters: [
- SERIES_ID,
- FILE_TYPE,
- { name: 'observation_start', in: 'query', description: 'First date to include (YYYY-MM-DD).', schema: DATE },
- { name: 'observation_end', in: 'query', description: 'Last date to include (YYYY-MM-DD).', schema: DATE },
- { name: 'sort_order', in: 'query', description: 'desc puts the latest value first.', schema: { type: 'string', enum: ['asc', 'desc'], default: 'asc' } },
- { name: 'limit', in: 'query', description: 'How many values at most (1 to 100,000).', example: 24, schema: { type: 'integer' } },
- {
- name: 'units', in: 'query',
- description: 'lin: as published; chg: change; pch: percent change; pc1: percent change from a year ago; log: natural log.',
- schema: { type: 'string', enum: ['lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log'], default: 'lin' }
- },
- {
- name: 'frequency', in: 'query',
- description: 'Aggregate to a lower frequency: d daily, w weekly, m monthly, q quarterly, sa semiannual, a annual.',
- schema: { type: 'string', enum: ['d', 'w', 'bw', 'm', 'q', 'sa', 'a'] }
- }
- ],
- responses: {
- '200': {
- description: 'The observations',
- content: {
- 'application/json': {
- schema: {
- type: 'object',
- properties: {
- units: { type: 'string' },
- count: { type: 'integer' },
- observations: {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- date: DATE,
- value: { type: 'string', description: 'The value as text; "." when missing' },
- realtime_start: DATE,
- realtime_end: DATE
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- '/series/search': {
- get: {
- operationId: 'searchSeries',
- summary: 'Find economic series by keyword',
- parameters: [
- { name: 'search_text', in: 'query', required: true, description: 'Words to look for in series titles and notes.', example: 'unemployment rate', schema: { type: 'string' } },
- FILE_TYPE,
- { name: 'limit', in: 'query', description: 'How many series at most (1 to 1,000).', example: 10, schema: { type: 'integer' } },
- {
- name: 'order_by', in: 'query', description: 'popularity puts the most-used series first.',
- schema: { type: 'string', enum: ['search_rank', 'popularity', 'title', 'last_updated'], default: 'search_rank' }
- }
- ],
- responses: {
- '200': {
- description: 'Matching series',
- content: {
- 'application/json': {
- schema: { type: 'object', properties: { count: { type: 'integer' }, seriess: { type: 'array', items: SERIES } } }
- }
- }
- }
- }
- }
- },
- '/series': {
- get: {
- operationId: 'getSeries',
- summary: 'Describe one economic series',
- parameters: [SERIES_ID, FILE_TYPE],
- responses: {
- '200': {
- description: 'The series',
- content: {
- 'application/json': {
- schema: { type: 'object', properties: { seriess: { type: 'array', items: SERIES } } }
- }
- }
- }
- }
- }
- }
- }
-};
diff --git a/src/core/capabilities/curated/metaculus.ts b/src/core/capabilities/curated/metaculus.ts
deleted file mode 100644
index c75da1b..0000000
--- a/src/core/capabilities/curated/metaculus.ts
+++ /dev/null
@@ -1,71 +0,0 @@
-// Metaculus forecasting questions.
-// Metaculus serves its API docs and schema only to signed-in users, so this
-// is written from the integration Flyspace ran before #60 (GET /api/posts/
-// with limit and search; `Authorization: Token `; results[] with id,
-// title, slug, status, nr_forecasters, question). Every request needs the
-// token, and Metaculus answers browsers without CORS headers, so Flyspace
-// reaches it through its server broker.
-
-export const METACULUS_SPEC = {
- openapi: '3.0.3',
- info: {
- title: 'Metaculus Forecasts',
- version: '1.0.0',
- description: 'Community forecasts on future events: politics, science, technology, economics. Free token.'
- },
- servers: [{ url: 'https://www.metaculus.com/api' }],
- security: [{ metaculusToken: [] }],
- components: {
- securitySchemes: {
- metaculusToken: {
- type: 'http',
- scheme: 'Token',
- description: 'Your Metaculus API token (free). Create an account at https://www.metaculus.com; the token is issued from your account.'
- }
- }
- },
- paths: {
- '/posts/': {
- get: {
- operationId: 'listPosts',
- summary: 'Forecasting questions',
- parameters: [
- { name: 'search', in: 'query', description: 'Only questions about these words.', example: 'AI', schema: { type: 'string' } },
- { name: 'limit', in: 'query', description: 'How many questions.', example: 20, schema: { type: 'integer' } },
- { name: 'offset', in: 'query', description: 'Skip this many, for the next page.', schema: { type: 'integer' } }
- ],
- responses: {
- '200': {
- description: 'Questions',
- content: {
- 'application/json': {
- schema: {
- type: 'object',
- properties: {
- count: { type: 'integer' },
- next: { type: 'string', nullable: true },
- previous: { type: 'string', nullable: true },
- results: {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- id: { type: 'integer' },
- title: { type: 'string' },
- slug: { type: 'string' },
- status: { type: 'string' },
- nr_forecasters: { type: 'integer' },
- question: { type: 'object' }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-};
diff --git a/src/core/capabilities/curated/newsApi.ts b/src/core/capabilities/curated/newsApi.ts
deleted file mode 100644
index 5e39eba..0000000
--- a/src/core/capabilities/curated/newsApi.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-// NewsAPI.org headlines and article search.
-// Hand-written from https://newsapi.org/docs/endpoints/top-headlines and
-// /everything (2026-10-07). The key goes in the X-Api-Key header, which keeps
-// it out of the URL. NewsAPI sends no CORS headers (and its free plan refuses
-// browser calls), so Flyspace reaches it through its server broker.
-
-const ARTICLES = {
- type: 'object',
- properties: {
- status: { type: 'string' },
- totalResults: { type: 'integer' },
- articles: {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- source: { type: 'object', properties: { id: { type: 'string', nullable: true }, name: { type: 'string' } } },
- author: { type: 'string', nullable: true },
- title: { type: 'string' },
- description: { type: 'string', nullable: true },
- url: { type: 'string' },
- urlToImage: { type: 'string', nullable: true },
- publishedAt: { type: 'string' },
- content: { type: 'string', nullable: true }
- }
- }
- }
- }
-};
-
-const PAGE_SIZE = { name: 'pageSize', in: 'query', description: 'How many articles (1 to 100).', example: 20, schema: { type: 'integer' } };
-
-export const NEWS_API_SPEC = {
- openapi: '3.0.3',
- info: {
- title: 'NewsAPI Headlines',
- version: '2.0.0',
- description: 'Breaking headlines by country or category, and search across articles from thousands of sources. Free key.'
- },
- servers: [{ url: 'https://newsapi.org/v2' }],
- security: [{ newsApiKey: [] }],
- components: {
- securitySchemes: {
- newsApiKey: {
- type: 'apiKey',
- in: 'header',
- name: 'X-Api-Key',
- description: 'Your NewsAPI key (free for development). Get one at https://newsapi.org/register'
- }
- }
- },
- paths: {
- '/top-headlines': {
- get: {
- operationId: 'topHeadlines',
- summary: 'Top headlines now',
- parameters: [
- { name: 'country', in: 'query', description: 'Two-letter country code, e.g. us, gb, de. Leave empty when using sources.', example: 'us', schema: { type: 'string' } },
- {
- name: 'category', in: 'query', description: 'Only this category. Not with sources.',
- schema: { type: 'string', enum: ['business', 'entertainment', 'general', 'health', 'science', 'sports', 'technology'] }
- },
- { name: 'q', in: 'query', description: 'Only headlines with these words.', schema: { type: 'string' } },
- { name: 'sources', in: 'query', description: 'Comma-separated source ids, e.g. bbc-news. Not with country or category.', schema: { type: 'string' } },
- PAGE_SIZE
- ],
- responses: { '200': { description: 'Headlines', content: { 'application/json': { schema: ARTICLES } } } }
- }
- },
- '/everything': {
- get: {
- operationId: 'everything',
- summary: 'Search news articles',
- parameters: [
- { name: 'q', in: 'query', required: true, description: 'Words or phrases to find. Quote a phrase; + must appear, - must not.', example: 'interest rates', schema: { type: 'string' } },
- { name: 'language', in: 'query', description: 'Two-letter language code, e.g. en.', example: 'en', schema: { type: 'string' } },
- { name: 'from', in: 'query', description: 'Oldest article (ISO 8601 date or date-time).', schema: { type: 'string', format: 'date' } },
- { name: 'to', in: 'query', description: 'Newest article (ISO 8601 date or date-time).', schema: { type: 'string', format: 'date' } },
- { name: 'sortBy', in: 'query', description: 'Order of results.', schema: { type: 'string', enum: ['publishedAt', 'relevancy', 'popularity'], default: 'publishedAt' } },
- PAGE_SIZE
- ],
- responses: { '200': { description: 'Articles', content: { 'application/json': { schema: ARTICLES } } } }
- }
- }
- }
-};
diff --git a/src/core/capabilities/curatedApis.test.ts b/src/core/capabilities/curatedApis.test.ts
index a951b90..23f9bfd 100644
--- a/src/core/capabilities/curatedApis.test.ts
+++ b/src/core/capabilities/curatedApis.test.ts
@@ -1,67 +1,50 @@
import { describe, expect, it, vi } from 'vitest';
import { buildApiIndexEntries, credentialNeedOf, parseApiIndex } from './apiIndex';
import { CURATED_APIS, curatedApi } from './curatedApis';
-import { FRED_SPEC } from './curated/fred';
+import { ALPHA_VANTAGE_SPEC } from './curated/alphaVantage';
import { compileOpenApi } from './openapi';
import { fetchCatalogSpec, RegistryFetchError } from './registrySearch';
-const FRED = curatedApi('omni:fred')!;
+const ALPHA = curatedApi('omni:alpha-vantage')!;
-describe('FRED, as Flyspace ships it', () => {
- const { manifests, errors } = compileOpenApi(FRED.spec, { sourceLocator: FRED.entry.specUrl, brokerOrigins: FRED.brokerOrigins });
+describe('Alpha Vantage, as Flyspace ships it', () => {
+ const { manifests, errors } = compileOpenApi(ALPHA.spec, { sourceLocator: ALPHA.entry.specUrl });
- it('compiles to the three reads its entry claims, all through the server broker', () => {
+ it('compiles to the one read its entry claims, called from the browser', () => {
expect(errors).toEqual([]);
- expect(manifests).toHaveLength(FRED.entry.operations!);
+ expect(manifests).toHaveLength(ALPHA.entry.operations!);
for (const manifest of manifests) {
expect(manifest.effect).toBe('read');
- expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('server_broker');
- expect(manifest.transport.kind === 'http' && manifest.transport.baseUrl).toBe('https://api.stlouisfed.org/fred');
+ expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('browser_direct');
+ expect(manifest.transport.kind === 'http' && manifest.transport.baseUrl).toBe('https://www.alphavantage.co');
}
});
- it('asks for the key once, in the query where FRED reads it, with where to get one', () => {
+ it('asks for the key once, in the query where Alpha Vantage reads it, with where to get one', () => {
const slots = new Set(manifests.map(m => m.auth.secretRef));
expect(slots.size).toBe(1);
- expect(manifests[0].auth).toMatchObject({ kind: 'apiKey', in: 'query', name: 'api_key' });
- expect(manifests[0].auth.hint).toContain('https://fredaccount.stlouisfed.org/apikeys');
+ expect(manifests[0].auth).toMatchObject({ kind: 'apiKey', in: 'query', name: 'apikey' });
+ expect(manifests[0].auth.hint).toContain('https://www.alphavantage.co/support/#api-key');
});
- it('pins the JSON format FRED would otherwise not send', () => {
- const observations = manifests.find(m => m.source.operationId === 'getSeriesObservations')!;
- expect(observations.inputs.find(i => i.name === 'file_type')).toMatchObject({ required: true, schema: { enum: ['json'] } });
- expect(observations.inputs.find(i => i.name === 'series_id')).toMatchObject({ required: true, example: 'UNRATE' });
- });
-});
-
-describe('who can choose the server broker', () => {
- it('is the host: the same spec without its curated entry compiles browser-direct', () => {
- for (const manifest of compileOpenApi(FRED_SPEC).manifests) {
- expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('browser_direct');
- }
- });
-
- it('never a write, even on a broker origin', () => {
- const spec = structuredClone(FRED_SPEC) as typeof FRED_SPEC & { paths: Record };
- spec.paths['/notes'] = {
- post: { summary: 'Add a note', responses: { '200': { description: 'ok', content: { 'application/json': { schema: { type: 'object' } } } } } }
- };
- const write = compileOpenApi(spec, { brokerOrigins: FRED.brokerOrigins }).manifests.find(m => m.effect === 'write')!;
- expect(write.transport.kind === 'http' && write.transport.access).toBe('browser_direct');
+ it('requires the function and the symbol every query needs', () => {
+ const query = manifests.find(m => m.source.operationId === 'query')!;
+ expect(query.inputs.find(i => i.name === 'function')).toMatchObject({ required: true, schema: { enum: ['GLOBAL_QUOTE', 'TIME_SERIES_DAILY', 'TIME_SERIES_MONTHLY'] } });
+ expect(query.inputs.find(i => i.name === 'symbol')).toMatchObject({ required: true, example: 'MSFT' });
});
});
describe('a curated entry', () => {
it('serves its spec from the bundle, without a fetch', async () => {
const fetchImpl = vi.fn();
- const document = await fetchCatalogSpec(FRED.entry, { fetchImpl });
+ const document = await fetchCatalogSpec(ALPHA.entry, { fetchImpl });
expect(fetchImpl).not.toHaveBeenCalled();
- expect(document).toEqual(FRED_SPEC);
- expect(document).not.toBe(FRED_SPEC); // a copy: nothing downstream can change the shipped spec
+ expect(document).toEqual(ALPHA_VANTAGE_SPEC);
+ expect(document).not.toBe(ALPHA_VANTAGE_SPEC); // a copy: nothing downstream can change the shipped spec
});
it('cannot be claimed by an entry the repo does not list', async () => {
- const forged = { ...FRED.entry, id: 'omni:not-shipped' };
+ const forged = { ...ALPHA.entry, id: 'omni:not-shipped' };
await expect(fetchCatalogSpec(forged, { fetchImpl: vi.fn() })).rejects.toBeInstanceOf(RegistryFetchError);
});
@@ -87,25 +70,20 @@ describe('a curated entry', () => {
});
describe('every curated API', () => {
- it.each(CURATED_APIS.map(api => [api.entry.id, api] as const))('%s compiles to what its entry claims, routed as declared', (_id, api) => {
- const { manifests, errors } = compileOpenApi(api.spec, { sourceLocator: api.entry.specUrl, brokerOrigins: api.brokerOrigins });
+ it.each(CURATED_APIS.map(api => [api.entry.id, api] as const))('%s compiles to what its entry claims, called from the browser', (_id, api) => {
+ const { manifests, errors } = compileOpenApi(api.spec, { sourceLocator: api.entry.specUrl });
expect(errors).toEqual([]);
expect(manifests).toHaveLength(api.entry.operations!);
for (const manifest of manifests) {
expect(manifest.effect).toBe('read');
- const access = manifest.transport.kind === 'http' ? manifest.transport.access : null;
- expect(access).toBe(api.brokerOrigins.length > 0 ? 'server_broker' : 'browser_direct');
+ expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('browser_direct');
if (manifest.auth.kind !== 'none') expect(manifest.auth.hint?.length ?? 0, api.entry.id).toBeGreaterThan(20); // says where to get the key
}
});
- it('needs no key for BLS, and sends Metaculus its token the way it asks', () => {
+ it('needs no key for BLS', () => {
const bls = compileOpenApi(curatedApi('omni:bls')!.spec).manifests[0];
expect(bls.auth.kind).toBe('none');
- const metaculus = compileOpenApi(curatedApi('omni:metaculus')!.spec).manifests[0];
- expect(metaculus.auth).toMatchObject({ kind: 'apiKey', in: 'header', name: 'Authorization', prefix: 'Token ' });
- const news = compileOpenApi(curatedApi('omni:newsapi')!.spec).manifests[0];
- expect(news.auth).toMatchObject({ kind: 'apiKey', in: 'header', name: 'X-Api-Key' }); // kept out of the URL
});
});
@@ -129,7 +107,7 @@ describe('an http auth scheme that names a static token', () => {
describe('a curated entry says what it needs to run', () => {
it.each(CURATED_APIS.map(api => [api.entry.id, api] as const))('%s records the credential need its spec compiles to', (_id, api) => {
- const kinds = compileOpenApi(api.spec, { brokerOrigins: api.brokerOrigins }).manifests.map(m => m.auth.kind);
+ const kinds = compileOpenApi(api.spec).manifests.map(m => m.auth.kind);
expect(api.entry.credential).toBe(credentialNeedOf(kinds));
});
});
diff --git a/src/core/capabilities/curatedApis.ts b/src/core/capabilities/curatedApis.ts
index a07b934..246c4b0 100644
--- a/src/core/capabilities/curatedApis.ts
+++ b/src/core/capabilities/curatedApis.ts
@@ -1,72 +1,22 @@
// APIs Flyspace ships a spec for, because the directory has none that works.
// Each is reviewed by hand in this repo. Search lists them beside the
-// directory, marked as curated. Only an entry here can route an API through
-// the server broker: that is the host's choice, never a pasted document's.
+// directory, marked as curated.
import type { ApiIndexEntry } from './apiIndex';
import type { KeyGuide } from './keyGuide';
-import type { CapabilityManifest } from './manifest';
import { ALPHA_VANTAGE_SPEC } from './curated/alphaVantage';
import { BLS_SPEC } from './curated/bls';
-import { FRED_SPEC } from './curated/fred';
-import { METACULUS_SPEC } from './curated/metaculus';
-import { NEWS_API_SPEC } from './curated/newsApi';
export interface CuratedApi {
entry: ApiIndexEntry;
spec: Record;
- /** Origins reached through the server broker: the API refuses browser calls. */
- brokerOrigins: string[];
/** How to get its key, from the provider's own pages (checked 2026-10-12). */
keyGuide?: Omit;
/** The environment variable the quality line reads its key from (scripts/verify-curated.ts). */
keyEnv?: string;
- /** What the provider's terms require an app to show its users, on every block that calls it. */
- attribution?: Attribution;
-}
-
-export interface Attribution {
- /** The provider's own wording, shown as written. */
- notice: string;
- /** The terms a person agrees to by using the block. */
- termsUrl: string;
- termsTitle: string;
}
export const CURATED_APIS: readonly CuratedApi[] = [
- {
- entry: {
- id: 'omni:fred',
- title: 'FRED Economic Data',
- description: 'Federal Reserve economic time series: GDP, unemployment, inflation, interest rates, and 800,000 more. Free key.',
- categories: ['financial'],
- specUrl: 'omni:curated/fred',
- openapiVersion: FRED_SPEC.openapi,
- supported: true,
- updated: '2026-10-07',
- operations: 3,
- credential: 'key',
- curated: true
- },
- spec: FRED_SPEC,
- keyEnv: 'FRED_API_KEY',
- keyGuide: {
- url: 'https://fredaccount.stlouisfed.org/apikeys',
- requires: 'A free FRED account (fredaccount.stlouisfed.org); the key page needs you signed in.',
- freeTier: 'Free.',
- format: { pattern: '^[a-z0-9]{32}$', describe: '32 lowercase letters and digits' },
- test: { operationId: 'getSeriesObservations', input: { series_id: 'GDP', file_type: 'json', limit: 1 } }
- },
- brokerOrigins: ['https://api.stlouisfed.org'],
- // Required by https://fred.stlouisfed.org/docs/api/terms_of_use.html (checked 2026-10-12)
- // for an application other people use: this exact notice, shown prominently, and a link to
- // the terms that using the application means agreeing to.
- attribution: {
- notice: 'This product uses the FRED® API but is not endorsed or certified by the Federal Reserve Bank of St. Louis.',
- termsUrl: 'https://fred.stlouisfed.org/docs/api/terms_of_use.html',
- termsTitle: 'FRED® API Terms of Use'
- }
- },
{
entry: {
id: 'omni:bls',
@@ -83,7 +33,6 @@ export const CURATED_APIS: readonly CuratedApi[] = [
},
spec: BLS_SPEC,
// BLS sends Access-Control-Allow-Origin: *, so the browser calls it.
- brokerOrigins: []
},
{
entry: {
@@ -110,74 +59,9 @@ export const CURATED_APIS: readonly CuratedApi[] = [
test: { operationId: 'query', input: { function: 'GLOBAL_QUOTE', symbol: 'MSFT' }, provesKey: false }
},
// Alpha Vantage sends Access-Control-Allow-Origin: *, so the browser calls it.
- brokerOrigins: []
- },
- {
- entry: {
- id: 'omni:newsapi',
- title: 'NewsAPI Headlines',
- description: 'Top news headlines by country or category, and search across articles from thousands of sources. Free key.',
- categories: ['media'],
- specUrl: 'omni:curated/newsapi',
- openapiVersion: NEWS_API_SPEC.openapi,
- supported: true,
- updated: '2026-10-07',
- operations: 2,
- credential: 'key',
- curated: true
- },
- spec: NEWS_API_SPEC,
- keyEnv: 'NEWSAPI_KEY',
- keyGuide: {
- url: 'https://newsapi.org/register',
- requires: 'A free NewsAPI account.',
- freeTier: '100 requests a day; articles arrive 24 hours late.',
- caveat: 'NewsAPI allows its free plan for development and testing only, not in production.',
- test: { operationId: 'topHeadlines', input: { country: 'us', pageSize: 1 } }
- },
- brokerOrigins: ['https://newsapi.org']
- },
- {
- entry: {
- id: 'omni:metaculus',
- title: 'Metaculus Forecasts',
- description: 'Community forecasts and prediction questions on future events: politics, science, technology. Free token.',
- categories: ['open_data'],
- specUrl: 'omni:curated/metaculus',
- openapiVersion: METACULUS_SPEC.openapi,
- supported: true,
- updated: '2026-10-07',
- operations: 1,
- credential: 'key',
- curated: true
- },
- spec: METACULUS_SPEC,
- keyEnv: 'METACULUS_API_KEY',
- keyGuide: {
- url: 'https://www.metaculus.com',
- requires: 'A free Metaculus account; the API token is issued from your account.',
- test: { operationId: 'listPosts', input: { limit: 1 } }
- },
- brokerOrigins: ['https://www.metaculus.com']
}
];
-/**
- * The attribution a provider's terms require, for any manifest that calls it,
- * however it was installed: matched on the API's origin, not the install path.
- */
-export function attributionFor(manifest: CapabilityManifest | undefined): Attribution | null {
- if (!manifest || manifest.transport.kind !== 'http') return null;
- let origin: string;
- try {
- origin = new URL(manifest.transport.baseUrl).origin;
- } catch {
- return null;
- }
- const api = CURATED_APIS.find(entry => entry.attribution && entry.brokerOrigins.includes(origin));
- return api?.attribution ?? null;
-}
-
export function curatedApi(id: string): CuratedApi | undefined {
return CURATED_APIS.find(api => api.entry.id === id);
}
diff --git a/src/core/capabilities/execute.ts b/src/core/capabilities/execute.ts
index 4d32b05..7e25bb1 100644
--- a/src/core/capabilities/execute.ts
+++ b/src/core/capabilities/execute.ts
@@ -438,9 +438,6 @@ async function executeHttp(
const timeout = AbortSignal.timeout(REQUEST_TIMEOUT_MS);
const requestSignal = signal ? AbortSignal.any([signal, timeout]) : timeout;
markDispatched();
- if (manifest.transport.access === 'server_broker') {
- return executeBroker(manifest, run.args, idempotencyKey, secret, fetchImpl, requestSignal);
- }
const response = await fetchImpl(url.toString(), {
method: manifest.transport.method,
headers,
@@ -517,42 +514,6 @@ async function executeLocal(manifest: CapabilityManifest, args: Readonly>,
- idempotencyKey: string,
- secret: string | undefined,
- fetchImpl: typeof fetch,
- signal: AbortSignal
-): Promise {
- const response = await fetchImpl('/api/capability-broker', {
- method: 'POST',
- headers: { 'content-type': 'application/json' },
- body: JSON.stringify({
- manifest,
- input,
- idempotencyKey,
- ...(secret ? { secret } : {})
- }),
- signal
- });
- const payload = await response.json() as {
- value?: unknown;
- error?: { code?: string; message?: string };
- executionStatus?: string;
- };
- if (payload.error) {
- const code = typeof payload.error.code === 'string' && /^[A-Z_]{1,40}$/.test(payload.error.code)
- ? payload.error.code
- : 'UPSTREAM_ERROR';
- return halt(dispatchedFailure(manifest, code, payload.error.message || 'Broker request failed', false, secret));
- }
- if (!response.ok) {
- return halt(failure(manifest.id, 'UPSTREAM_ERROR', `Broker HTTP ${response.status}`, false));
- }
- return { type: 'value', value: payload.value };
-}
-
function encodeBase64(value: string): string {
const bytes = new TextEncoder().encode(value);
let binary = '';
diff --git a/src/core/capabilities/keyGuide.test.ts b/src/core/capabilities/keyGuide.test.ts
index ce69bae..57d279d 100644
--- a/src/core/capabilities/keyGuide.test.ts
+++ b/src/core/capabilities/keyGuide.test.ts
@@ -1,13 +1,12 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { checkKeyFormat, firstLink, keyGuideFor, testKey } from './keyGuide';
+import { firstLink, keyGuideFor, testKey } from './keyGuide';
import { curatedApi } from './curatedApis';
import { compileOpenApi } from './openapi';
import { clearCapabilities, installProposal } from './registry';
import { capabilitySecrets } from './secrets';
-const fred = curatedApi('omni:fred')!;
const alpha = curatedApi('omni:alpha-vantage')!;
-const compiled = (api: typeof fred) => compileOpenApi(api.spec, { sourceLocator: api.entry.specUrl, brokerOrigins: api.brokerOrigins }).manifests;
+const compiled = (api: typeof alpha) => compileOpenApi(api.spec, { sourceLocator: api.entry.specUrl }).manifests;
describe('firstLink', () => {
it('finds the link in a key description, as https', () => {
@@ -21,10 +20,10 @@ describe('firstLink', () => {
describe('keyGuideFor', () => {
it('gives a curated API the guide written from its provider', () => {
- const guide = keyGuideFor(compiled(fred)[0])!;
+ const guide = keyGuideFor(compiled(alpha)[0])!;
expect(guide.source).toBe('provider');
- expect(guide.url).toBe('https://fredaccount.stlouisfed.org/apikeys');
- expect(guide.requires).toMatch(/free FRED account/);
+ expect(guide.url).toBe('https://www.alphavantage.co/support/#api-key');
+ expect(guide.requires).toMatch(/what describes you, your organization, and your email/);
});
it('gives any other API the link from its own key description', () => {
@@ -43,20 +42,6 @@ describe('keyGuideFor', () => {
});
});
-describe('checkKeyFormat', () => {
- const guide = keyGuideFor(compiled(fred)[0]);
-
- it('warns, without blocking, when a key does not match the documented format', () => {
- expect(checkKeyFormat(guide, 'abc123')).toMatch(/32 lowercase letters and digits/);
- expect(checkKeyFormat(guide, 'a'.repeat(32))).toBeNull();
- expect(checkKeyFormat(guide, '')).toBeNull();
- });
-
- it('says nothing where the provider documents no format', () => {
- expect(checkKeyFormat(keyGuideFor(compiled(alpha)[0]), 'anything')).toBeNull();
- });
-});
-
describe('testKey', () => {
let answer: { status: number; body: unknown };
diff --git a/src/core/capabilities/keyGuide.ts b/src/core/capabilities/keyGuide.ts
index 216da53..b04dd88 100644
--- a/src/core/capabilities/keyGuide.ts
+++ b/src/core/capabilities/keyGuide.ts
@@ -3,8 +3,7 @@
// A curated API carries a guide written from the provider's own pages
// (curatedApis.ts). Any other API gets what its spec says: the first link in
// the key's description ("Register at www.interzoid.com/register"). Nothing
-// here claims what a provider's page did not say: no time estimates, and a
-// key format only where the provider documents one.
+// here claims what a provider's page did not say: no time estimates.
import { CURATED_APIS } from './curatedApis';
import { executeCapability } from './execute';
@@ -19,8 +18,6 @@ export interface KeyGuide {
freeTier?: string;
/** A limit a person should know before relying on the key. */
caveat?: string;
- /** The documented key format, for a warning on paste. Never blocks saving. */
- format?: { pattern: string; describe: string };
/**
* A cheap read that proves the key works once the API is installed.
* `provesKey: false` when the provider answers any key, so a pass only
@@ -59,14 +56,6 @@ export function keyGuideFor(manifest: CapabilityManifest): KeyGuide | null {
return url ? { url, requires: 'See the provider’s page.', source: 'spec' } : null;
}
-/** A warning when a pasted key does not look like the documented format, or null. */
-export function checkKeyFormat(guide: KeyGuide | null, key: string): string | null {
- if (!guide?.format || !key.trim()) return null;
- return new RegExp(guide.format.pattern).test(key.trim())
- ? null
- : `This does not look like the documented key format (${guide.format.describe}). You can still save it.`;
-}
-
type KeyTestResult = { ok: true; message: string } | { ok: false; message: string };
/** Fields some APIs use to refuse a key while answering 200 (Alpha Vantage). */
diff --git a/src/core/capabilities/manifest.ts b/src/core/capabilities/manifest.ts
index 1cd7b8d..115c82a 100644
--- a/src/core/capabilities/manifest.ts
+++ b/src/core/capabilities/manifest.ts
@@ -67,7 +67,7 @@ interface CapabilityOutput {
presentation: 'items' | 'content' | 'raw';
}
-type HttpAccess = 'browser_direct' | 'server_broker';
+type HttpAccess = 'browser_direct';
export type CapabilityTransport =
| { kind: 'http'; access: HttpAccess; baseUrl: string; method: HttpMethod; path: string }
@@ -422,13 +422,9 @@ export function validateManifest(input: unknown, options: ManifestValidationOpti
if (EFFECTS.includes(effect)) {
const triggerError = triggerProblem(effect, trigger);
if (triggerError) errors.push(triggerError);
- if ((effect === 'write' || effect === 'destructive') && isRecord(input.transport) && input.transport.access === 'server_broker') {
- errors.push('server_broker cannot carry a write or destructive effect');
- }
}
if (isRecord(input.auth) && input.auth.kind === 'oauth' && isRecord(input.transport)) {
if (input.transport.kind !== 'http') errors.push('oauth auth is only defined for http transports');
- else if (input.transport.access === 'server_broker') errors.push('server_broker cannot carry an oauth token');
}
if (
@@ -442,8 +438,8 @@ export function validateManifest(input: unknown, options: ManifestValidationOpti
if (typeof input.transport.method !== 'string' || !METHODS.includes(input.transport.method as HttpMethod)) {
errors.push('transport.method is invalid');
}
- if (input.transport.access !== 'browser_direct' && input.transport.access !== 'server_broker') {
- errors.push('http transport access must be browser_direct or server_broker');
+ if (input.transport.access !== 'browser_direct') {
+ errors.push('http transport access must be browser_direct');
}
if (typeof input.transport.path !== 'string' || !input.transport.path.startsWith('/') || input.transport.path.includes('..')) {
errors.push('transport.path must be an absolute path without ..');
@@ -643,7 +639,7 @@ function canonicalTransport(transport: CapabilityTransport): CapabilityTransport
}
return {
kind: 'http',
- access: transport.access === 'server_broker' ? 'server_broker' : 'browser_direct',
+ access: 'browser_direct',
baseUrl: transport.baseUrl,
method: transport.method,
path: transport.path
diff --git a/src/core/capabilities/openapi.ts b/src/core/capabilities/openapi.ts
index 8636914..026b383 100644
--- a/src/core/capabilities/openapi.ts
+++ b/src/core/capabilities/openapi.ts
@@ -45,13 +45,6 @@ interface CompileOptions {
* its locator stays `title@version` from the document itself.
*/
sourceLocator?: string;
- /**
- * Origins the host has chosen to reach through its server broker, for an
- * API that refuses browser calls (FRED sends no CORS headers). Only reads
- * go that way; a write stays browser-direct and approval-gated. A host
- * decision, never read from the document: a pasted spec cannot pick it.
- */
- brokerOrigins?: readonly string[];
}
export function compileOpenApi(spec: unknown, options: CompileOptions = {}): CompileResult {
@@ -100,8 +93,7 @@ export function compileOpenApi(spec: unknown, options: CompileOptions = {}): Com
label,
title: titles.get(`${method} ${path}`) ?? label.slice(0, MAX_TITLE),
baseUrl: base.url,
- locator,
- brokered: options.brokerOrigins?.includes(new URL(base.url).origin) === true
+ locator
});
if ('error' in compiled) errors.push({ operation: label, message: compiled.error });
else manifests.push(compiled.manifest);
@@ -174,7 +166,6 @@ function compileOperation(args: {
baseUrl: string;
locator: string;
/** The host routes this origin's reads through its server broker. */
- brokered: boolean;
}): { manifest: CapabilityManifest } | { error: string } {
const effectChoice = chooseEffect(args.method, args.operation);
if ('error' in effectChoice) return effectChoice;
@@ -191,12 +182,9 @@ function compileOperation(args: {
const output = collectOutput(args.spec, args.operation);
if ('error' in output) return output;
- const viaBroker = args.brokered
- && (effectChoice.effect === 'read' || effectChoice.effect === 'compute')
- && authBinding.kind !== 'oauth';
const transport = {
kind: 'http' as const,
- access: viaBroker ? 'server_broker' as const : 'browser_direct' as const,
+ access: 'browser_direct' as const,
baseUrl: args.baseUrl,
method: args.method,
path: args.path
@@ -423,7 +411,7 @@ function schemeToAuth(baseUrl: string, name: string, scheme: Record` (Metaculus, Django REST APIs): a static key
+ // `Authorization: Token ` (Django REST APIs): a static key
// under its own scheme name. Only names that mean a plain token; a
// challenge scheme (Digest, Negotiate) cannot be answered with a pasted key.
if (scheme.type === 'http' && typeof scheme.scheme === 'string' && STATIC_TOKEN_SCHEMES.has(scheme.scheme.toLowerCase())) {
diff --git a/src/core/capabilities/redaction.test.ts b/src/core/capabilities/redaction.test.ts
index 11ce8c1..c1f641a 100644
--- a/src/core/capabilities/redaction.test.ts
+++ b/src/core/capabilities/redaction.test.ts
@@ -86,13 +86,11 @@ function readSpec(security: Record) {
};
}
-function installRead(security: Record, secret: string, access: 'browser_direct' | 'server_broker' = 'browser_direct'): CapabilityManifest {
- const compiled = compileOpenApi(readSpec(security)).manifests[0];
- if (compiled.transport.kind !== 'http') throw new Error('expected http');
- const transport = { ...compiled.transport, access };
- const manifest = sealManifest({ ...compiled, id: canonicalCapabilityId(transport), transport });
+function installRead(security: Record, secret: string): CapabilityManifest {
+ const manifest = compileOpenApi(readSpec(security)).manifests[0];
+ if (manifest.transport.kind !== 'http') throw new Error('expected http');
expect(installProposal(manifest).ok).toBe(true);
- capabilitySecrets.set(credentialSlot(transport.baseUrl, manifest.auth), secret);
+ capabilitySecrets.set(credentialSlot(manifest.transport.baseUrl, manifest.auth), secret);
return manifest;
}
@@ -117,14 +115,6 @@ describe('dispatched-call errors carry no credential', () => {
expect(result.error?.code).toBe('UPSTREAM_ERROR');
});
- it('server_broker as seen by the browser', async () => {
- const manifest = installRead({ type: 'http', scheme: 'bearer' }, SECRET, 'server_broker');
- vi.stubGlobal('fetch', vi.fn(async () => new Response(JSON.stringify({
- error: { code: 'UPSTREAM_ERROR', message: echo(SECRET) }
- }), { status: 502, headers: { 'content-type': 'application/json' } })));
- await expectCleanRun(manifest, SECRET);
- });
-
it('local', async () => {
const transport = { kind: 'local' as const, handler: 'board.search' };
const secretRef = 'cred_board_fixture';
diff --git a/src/core/capabilities/runtime.contract.test.ts b/src/core/capabilities/runtime.contract.test.ts
index 3c5acdf..443b252 100644
--- a/src/core/capabilities/runtime.contract.test.ts
+++ b/src/core/capabilities/runtime.contract.test.ts
@@ -1,6 +1,5 @@
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { compileOpenApi } from './openapi';
-import { sealManifest } from './manifest';
import { approveCapability, clearCapabilities, installProposal } from './registry';
// Write runs need a confirmed preview; these tests exercise the engine after one.
import { executeConfirmed as executeCapability } from '../../../test/confirmedExecute';
@@ -76,15 +75,4 @@ describe('capability execution ledger', () => {
expect(claimCreateTrigger('block-a')).toBe(false);
expect(claimCreateTrigger('block-b')).toBe(true);
});
-
- it('seals a read capability onto the broker transport', () => {
- const list = compileOpenApi(SPEC).manifests.find(manifest => manifest.source.operationId === 'list')!;
- if (list.transport.kind !== 'http') throw new Error('expected http');
- const brokered = sealManifest({
- ...list,
- transport: { ...list.transport, access: 'server_broker' }
- });
- expect(brokered.transport).toMatchObject({ access: 'server_broker' });
- expect(brokered.trigger).toEqual({ kind: 'manual' });
- });
});
diff --git a/src/core/gateway/omnidata.schema.ts b/src/core/gateway/omnidata.schema.ts
index d0d3594..65b4c5e 100644
--- a/src/core/gateway/omnidata.schema.ts
+++ b/src/core/gateway/omnidata.schema.ts
@@ -22,7 +22,7 @@ type ApiCategory =
* Source metadata for any OmniData
*/
interface OmniSource {
- /** API provider ID (e.g., 'polymarket', 'newsapi') */
+ /** API provider ID (e.g., 'polymarket', 'coingecko') */
apiId: string;
/** Category of the API */
@@ -131,9 +131,6 @@ export interface OmniData {
message: string;
retryable: boolean;
};
-
- /** Raw response for debugging */
- _raw?: unknown;
}
/**
diff --git a/src/core/schemas/api.schema.ts b/src/core/schemas/api.schema.ts
index 6b32d54..57c2d31 100644
--- a/src/core/schemas/api.schema.ts
+++ b/src/core/schemas/api.schema.ts
@@ -103,12 +103,6 @@ export interface ApiProvider {
/** Whether API key is required */
requiresAuth: boolean;
- /**
- * process.env name of the server-side key (proxied via /api/data; the
- * browser never holds it). Render the NAME, never the value.
- */
- envVar?: string;
-
/** Corresponding block IDs that use this API */
blockIds?: string[];
diff --git a/src/core/schemas/shell.schema.ts b/src/core/schemas/shell.schema.ts
index a60bd6d..086a423 100644
--- a/src/core/schemas/shell.schema.ts
+++ b/src/core/schemas/shell.schema.ts
@@ -75,9 +75,6 @@ export interface ShellConfig {
/** Visual aesthetic */
aesthetic: AestheticTheme;
- /** Custom CSS overrides (from SKIN) */
- customCss?: string;
-
/** Hotkey slot (1-9) for quick access */
hotkeySlot?: number;
diff --git a/src/core/schemas/wire.schema.ts b/src/core/schemas/wire.schema.ts
index bd933d4..0078b9a 100644
--- a/src/core/schemas/wire.schema.ts
+++ b/src/core/schemas/wire.schema.ts
@@ -100,14 +100,6 @@ export interface ContextSource {
kind: ContextSourceKind;
/** Short human label for the provenance chip. */
label: string;
- /**
- * For `kind: 'inference'` — one persona feeding another — the inference
- * ledger row id of the ANSWER that was consumed, not the block that holds
- * it. This is what lets the server walk a cascade's full lineage instead
- * of stopping at "some persona said something". Absent without Postgres,
- * or when the upstream answer predates the ledger.
- */
- parentRunId?: string;
}
/**
diff --git a/src/core/secrets.ts b/src/core/secrets.ts
index 0317e91..343c531 100644
--- a/src/core/secrets.ts
+++ b/src/core/secrets.ts
@@ -17,7 +17,7 @@ export const SECRET_ENV_VARS = [
'TYPESAFE_API_KEY',
// Remote speech transcription
'OPENAI_API_KEY',
- // Keyed data providers (proxied through /api/data)
+ // Keyed data providers
'NEWSAPI_KEY',
'FRED_API_KEY',
'BLS_API_KEY',
diff --git a/src/core/shells/templates.test.ts b/src/core/shells/templates.test.ts
index 9092acd..b2a9829 100644
--- a/src/core/shells/templates.test.ts
+++ b/src/core/shells/templates.test.ts
@@ -3,7 +3,6 @@ import {
SHELL_TEMPLATES,
getShellTemplate,
validateTemplate,
- keyedProvidersForTemplate,
type ShellTemplate
} from './templates';
import { blockRegistry } from '@/core/registry/BlockRegistry';
@@ -35,12 +34,6 @@ describe('SHELL_TEMPLATES integrity (against the real registry)', () => {
});
});
-describe('keyedProvidersForTemplate — what a shell needs before it spawns', () => {
- it.each(SHELL_TEMPLATES.map(t => t.id))('%s needs zero keyed providers', (id) => {
- expect(keyedProvidersForTemplate(getShellTemplate(id)!)).toEqual([]);
- });
-});
-
describe('validateTemplate — catches authoring mistakes', () => {
const base: ShellTemplate = {
id: 'tmpl_test',
diff --git a/src/core/shells/templates.ts b/src/core/shells/templates.ts
index b86c984..7a725cb 100644
--- a/src/core/shells/templates.ts
+++ b/src/core/shells/templates.ts
@@ -7,7 +7,6 @@
// ============================================
import type { PersonaType, AestheticTheme } from '@/core/schemas/shell.schema';
-import { API_CATALOG, type ApiProvider } from '@/core/schemas/api.schema';
/** A block placement inside a template (placeholder instanceId, remapped on use). */
interface TemplateBlock {
@@ -152,17 +151,6 @@ export function getShellTemplate(id: string): ShellTemplate | undefined {
return SHELL_TEMPLATES.find(t => t.id === id);
}
-/**
- * Providers a template will ask for a key. Derived from catalog blockIds so
- * a shell can say, before spawning, whether it works on a fresh clone.
- */
-export function keyedProvidersForTemplate(template: ShellTemplate): ApiProvider[] {
- const blockIds = new Set(template.blocks.map(b => b.blockId));
- return API_CATALOG.filter(
- p => p.requiresAuth && p.blockIds?.some(id => blockIds.has(id))
- );
-}
-
/**
* Validate a template's internal integrity against a registry-membership check.
* Returns the list of problems (empty = valid). Decoupled from the registry import
diff --git a/src/core/stores/toolStore.ts b/src/core/stores/toolStore.ts
index 11d1d0d..b235ad3 100644
--- a/src/core/stores/toolStore.ts
+++ b/src/core/stores/toolStore.ts
@@ -14,7 +14,6 @@ type ToolType = 'navigate' | 'highlighter';
interface SelectionData {
text: string;
sourceBlockId?: string;
- sourceBlockType?: string;
}
interface ToolState {
diff --git a/src/core/stores/uiStore.ts b/src/core/stores/uiStore.ts
index 08694e8..289fbfc 100644
--- a/src/core/stores/uiStore.ts
+++ b/src/core/stores/uiStore.ts
@@ -34,26 +34,16 @@ interface UIState {
/** Set selected block */
setSelectedBlock: (instanceId: string | null) => void;
-
- /**
- * Blocks to highlight on the canvas. Set while hovering a provenance
- * chip on a persona answer, so 'what fed this' is answerable by
- * pointing rather than by reading ids.
- */
- highlightedBlockIds: string[];
- setHighlightedBlocks: (ids: string[]) => void;
}
export const useUIStore = create()((set) => ({
commandPaletteOpen: false,
draggingBlockId: null,
selectedBlockId: null,
- highlightedBlockIds: [],
openCommandPalette: () => set({ commandPaletteOpen: true }),
closeCommandPalette: () => set({ commandPaletteOpen: false }),
toggleCommandPalette: () => set(state => ({ commandPaletteOpen: !state.commandPaletteOpen })),
setDraggingBlock: (blockId) => set({ draggingBlockId: blockId }),
- setSelectedBlock: (instanceId) => set({ selectedBlockId: instanceId }),
- setHighlightedBlocks: (ids) => set({ highlightedBlockIds: ids })
+ setSelectedBlock: (instanceId) => set({ selectedBlockId: instanceId })
}));