Files
fusion/plugins/fusion-plugin-cli-printing-press
gsxdsm 7be377da0c FN-5926: break bundled plugin dashboard dependency cycle
Remove direct dashboard package dependencies from bundled plugins while preserving typed dashboard interop.

- add a workspace acyclic dependency regression test for all packages and dashboard-bundled plugins
- expose dashboard app aliases in dashboard TS/Vite/Vitest configs for plugin interop imports
- replace bundled plugin @fusion/dashboard dependencies with local dashboard interop declarations and updated tsconfig path mappings

Files changed:
 .../workspace-dependency-acyclicity.test.ts        | 174 +++++++++++++++++++++
 packages/dashboard/tsconfig.app.json               |   6 +-
 packages/dashboard/tsconfig.test-check.json        |   6 +-
 packages/dashboard/vite.config.ts                  |   4 +
 packages/dashboard/vitest.config.ts                |   4 +
 .../fusion-plugin-cli-printing-press/package.json  |   1 -
 .../src/dashboard-interop.d.ts                     |  19 +++
 .../fusion-plugin-cli-printing-press/tsconfig.json |   7 +-
 .../fusion-plugin-dependency-graph/package.json    |   1 -
 .../src/dashboard-interop.d.ts                     |   6 +
 .../fusion-plugin-dependency-graph/tsconfig.json   |   3 +-
 plugins/fusion-plugin-roadmap/package.json         |   1 -
 .../src/dashboard-interop.d.ts                     |  19 +++
 plugins/fusion-plugin-roadmap/tsconfig.json        |   7 +-
 pnpm-lock.yaml                                     |   9 --
 15 files changed, 248 insertions(+), 19 deletions(-)

Fusion-Task-Id: FN-5926

Fusion-Task-Lineage: 1b39c08a-1415-407d-90cc-b3de89af0316
2026-06-03 00:12:13 -07:00
..
2026-05-31 20:05:32 -07:00

fusion-plugin-cli-printing-press

Bundled first-party Fusion plugin for generating and managing service CLIs.

Storage & Config Model

Tables

  • cli_press_services: service metadata (id, slug, displayName, description, baseUrl, sourceKind, sourceRef, timestamps)
  • cli_press_cli_specs: generated/spec inputs per service (id, serviceId, name, version, generatorVersion, specJson, generatedAt, status, lastGenerationError, timestamps)
  • cli_press_artifacts: generated artifact metadata (id, cliSpecId, kind, path, executable, checksum, sizeBytes, timestamps)
  • cli_press_credentials: non-OAuth credentials (id, serviceId, name, kind, value envelope, placement, timestamps)
  • cli_press_service_settings: service-scoped key/value settings (id, serviceId, key, value, scope, timestamps)

All IDs are UUIDv4-based with prefixes: svc_, cli_, art_, cred_, set_. Timestamps are ISO-8601 strings.

Exported Types

  • Service: canonical external-service record
  • CliSpec: persisted cli-printing-press spec/generation state
  • CliArtifact: artifact file metadata (path stored relative to <projectRoot>/.fusion/)
  • Credential: persisted secret envelope + placement metadata
  • CredentialKind: closed union of non-OAuth kinds (api_key, bearer_token, basic_auth, header, query_param, env_var)
  • CredentialPlacement: discriminated placement union
  • ServiceSetting: service-level setting entry (runtime | wizard | metadata)
  • OAuthNotSupportedError: thrown when oauth/oauth2 is passed
  • InvalidCredentialPlacementError: thrown on kind/placement mismatch or invalid api_key placement

Credential placement union

  • { kind: "header", header: string }
  • { kind: "query_param", queryParam: string }
  • { kind: "env_var", envVar: string }
  • { kind: "bearer_token", header: string }
  • { kind: "api_key", header?: string, queryParam?: string } (exactly one required)
  • { kind: "basic_auth", header: string }

Credential encoding/materialization

  • Values are stored as { encoding: "base64", value: string } via encodeCredentialValue/decodeCredentialValue.
  • applyCredentialToRequest materializes credentials into { headers, query, env } and rejects OAuth at runtime.

OAuth policy (deferred)

OAuth/OAuth2 flows are intentionally excluded from v1. Any oauth/oauth2 kind is rejected by store-layer and helper-layer guards with OAuthNotSupportedError. Follow-up remains tracked in FN-3762.

Artifact path convention

Generated artifacts are expected under: <projectRoot>/.fusion/plugins/cli-printing-press/artifacts/<serviceId>/<specId>/<artifactFile>

CliArtifact.path stores the path relative to <projectRoot>/.fusion/.

Deletions and filesystem cleanup

deleteService, deleteSpec, and deleteArtifact remove DB records. v1 intentionally does not remove artifact files from disk; cleanup is deferred to FN-3767.

Executor Runtime Exposure

When the plugin contributes executorRuntimeEnv, executor-spawned task commands receive extra runtime wiring:

  • Generated CLI artifact directories for each service's latest generated spec are prepended to task PATH (deduped, absolute paths only).
  • Credentials with kind: "env_var" are decoded and injected as environment variables for task subprocesses, including executor agent-session subprocesses (for example bash tool commands run inside createFnAgent(...)).
  • Non-env credential kinds (header, query_param, basic_auth, bearer_token, api_key) are intentionally excluded from env injection and remain request-time concerns.

Security model:

  • Runtime env is merged per task (process.env base, plugin env overlay, PATH prepend), without mutating global engine process.env.
  • Secrets are never logged; executor diagnostics only report counts of injected keys/paths.
  • OAuth credentials are rejected defensively if encountered.

To opt out for a service, remove generated artifacts or env-var credentials in the FN-3766-backed service configuration model.