Docs/QuickOps SDK

QuickOps SDK

Universal Developer

QuickOps SDK

Overview

QuickOps SDK lets plugins access the current QuickOps capabilities that are hosted by the CoreApp runtime while the CoreBox entry is owned by the official touch-quickops plugin: capability summaries, running sessions, local system info, network/file diagnostics, and recent local Flow audit summaries. The target shape is to keep moving migratable business logic into the official touch-quickops plugin plus host capability boundaries.

QuickOps SDK is not a high-risk execution API. Plugins cannot use it to kill ports, bulk-edit files, mutate persistent system settings, or bypass Flow confirmation.

Imports

Plugin Prelude scripts can use global quickOps / plugin.quickOps directly. Plugin renderer contexts can use useQuickOps(), or create the SDK explicitly when a channel is already available.

EXAMPLE.TYPESCRIPT
import { createQuickOpsSDK, useQuickOps } from '@talex-touch/utils/plugin/sdk'

// index.js / Prelude global context
const capabilitiesFromPrelude = await quickOps.capabilities()

// Plugin renderer context
const quickOps = useQuickOps()
const capabilities = await quickOps.capabilities()

// When a plugin channel is already available
const quickOpsFromChannel = createQuickOpsSDK(channel)
const sessions = await quickOpsFromChannel.sessions()

Renderer / app code can use the transport domain SDK:

EXAMPLE.TYPESCRIPT
import { createQuickOpsSdk } from '@talex-touch/utils/transport/sdk/domains/quick-ops'
import { useTuffTransport } from '@talex-touch/utils/transport'

const quickOps = createQuickOpsSdk(useTuffTransport())
const sessions = await quickOps.sessions()

API Overview

MethodTypeDescription
capabilities()Read-onlyCurrent platform capability matrix with supported / disabled / degraded, riskLevel, and reason
sessions()Read-onlyRunning QuickOps session snapshots without BrowserWindow, timeout, or runtime objects
auditRecent({ limit? })Read-onlyRecent local Flow delivery audit summary, in memory only, without payload values
systemInfo()Read-onlyOS, platform, CPU, memory, uptime, and load average
tuffDiagnostics()Read-onlyRedacted Tuff diagnostics, without log bodies or full config
diskSpace()Read-onlyHome / Tuff Data filesystem capacity summary
directoryUsage({ deep? })Read-onlyBounded shallow / deep usage for key directories
queryLocalIp()Read-onlyNon-internal local addresses
portStatus({ port, text? })Read-onlyLocal TCP port available / occupied / degraded state and copy-only release command
dnsQuery({ hostname, text?, deep? })Read-onlyDNS records through the local resolver
networkStatus()Read-onlyLocal addresses, DNS servers, and environment proxy summary
systemProxy()Read-onlyRedacted system proxy summary
batteryStatus()Read-onlyPlatform battery status or degraded reason
fileHash({ path, filePath?, text? })Read-onlySingle-file MD5 / SHA1 / SHA256
fileBase64({ path, filePath?, text? })Read-onlySingle-file Base64 encoding with a 1MB limit
recentDownload()Read-onlyLatest regular file metadata from top-level Downloads
commonDirectory({ query? })Read-onlyRestricted Desktop / Downloads / Documents / App Data / Logs metadata
pathFormat({ path, filePath?, text? })Read-onlyRaw path, shell path, file URL, and Windows/WSL path variants
formatText({ text, mode })Read-onlyCasing / naming-style conversion
developerPreview({ query })Host capabilityResolves Developer preview through the CoreApp QuickOps host facade and returns PreviewCardPayload
saveDeveloperPreview({ payload, format })Host capabilitySaves QR Developer preview as SVG / PNG under the Tuff QuickOps temp directory and copies the path

Developer Preview

The QuickOps Developer CoreBox surface is owned by the official plugins/touch-quickops plugin. When the plugin recognizes commands such as json, url encode, base64 decode, jwt decode, regex test, markdown table, csv to markdown, markdown to csv, timestamp, date, timezone, uuid, short id, qr code, and case snake, it calls quickOps.developerPreview({ query }).

When developerPreview() returns ready, it includes a PreviewCardPayload, and the official plugin renders core-preview-card. Normal previews expose preview-copy-primary; QR previews add plugin-owned execute actions and call saveDeveloperPreview() for saving.

EXAMPLE.TYPESCRIPT
const result = await quickOps.developerPreview({
  query: {
    text: 'json {"ok":true}',
    inputs: []
  }
})

if (result.state === 'ready') {
  renderCorePreviewCard(result.payload)
}

saveDeveloperPreview() supports PreviewSDK QR SVG payloads only. The output directory is fixed to CoreApp app.getPath('temp')/tuff-quickops, and a successful save writes the file path to the clipboard. It is not a general file-write API.

EXAMPLE.TYPESCRIPT
const saved = await quickOps.saveDeveloperPreview({
  format: 'png',
  payload: result.payload
})

if (saved.state === 'saved') {
  console.info(saved.path)
}

The generic CoreApp PreviewProvider no longer registers the QuickOps Developer ability, reads clipboard fallback for Developer commands, or exposes QR save actions. Plugins must not fall back to private PreviewProvider APIs, raw IPC, or direct clipboard reads to bypass the allowDeveloperTools policy.

Files Input Routing

The official plugins/touch-quickops manifest declares acceptedInputTypes: ["text", "files"]. When a CoreBox query includes Files input, the plugin parses the JSON string array from query.inputs[].type === "files" and uses the first valid path as the default path for fileHash(), fileBase64(), or pathFormat(); an explicit path in the command text still wins.

CoreApp file search providers now only own indexing, file open, reveal, and generic path-copy actions. Path-copy actions use generic action ids: file-copy-path, file-copy-shell-path, file-copy-url, plus file-copy-windows-path / file-copy-wsl-path when platform path conversion is available; do not add new quick-ops-* file-search action ids. QuickOps Hash/Base64 result rendering and command routing must stay in the official plugin; do not add new QuickOps execute actions back to file search results or provider onExecute() branches.

Choose An Extension Path

First decide whether you are composing QuickOps or changing official QuickOps capabilities. Normal plugins should compose by default and leave the quickops.* namespace untouched.

GoalRecommended pathChange built-in QuickOps?
Show a system health panelCall quickOps.systemInfo(), quickOps.networkStatus(), quickOps.diskSpace(), and quickOps.auditRecent()No
Add local diagnostics to a plugin workflowDispatch to existing quickops.* targets through the Flow SDKNo
Add team- or project-specific OpsRegister plugin-owned CoreBox items, Preview abilities, or Flow targets with Manifest permissionsNo
Add a local tool for every userPrefer migrating it into the official plugins/touch-quickops plugin, then sync host capabilities, typed transport, SDK facade, runtime injection, evidence, and Nexus docsYes, repository maintainers only
Add high-risk executionAdd policy, permissions, confirmation UI, audit, real evidence, and organization-level governance firstDo not expose directly

Plugins must not register new quickops.* targets or call private QuickOps IPC. Plugin-owned capabilities should use their own feature ids / target ids and treat QuickOps results as context input.

Capability Matrix

EXAMPLE.TYPESCRIPT
const info = await quickOps.capabilities()

for (const entry of info.entries) {
  if (entry.status === 'disabled') {
    console.info(`${entry.id} disabled: ${entry.reason}`)
  }
}

Common disabled reasons:

reasonMeaning
quickops-disabledQuickOps is globally disabled
stateful-tools-disabled-by-policyLocal policy disabled stateful / confirmation tools
network-tools-disabled-by-policyLocal policy disabled network tools
file-tools-disabled-by-policyLocal policy disabled file tools
system-tools-disabled-by-policyLocal policy disabled system tools
developer-tools-disabled-by-policyLocal policy disabled developer conversion tools
high-risk-tools-disabled-by-policyHigh-risk tools are disabled by default

Recent Audit Summary

auditRecent() returns recent local summaries for QuickOps Flow deliveries. It stores observable decisions only, not payload values.

EXAMPLE.TYPESCRIPT
const audit = await quickOps.auditRecent({ limit: 10 })

for (const entry of audit.entries) {
  console.log(entry.targetId, entry.decision, entry.reason, entry.payloadKeys)
}

Response fields:

FieldDescription
stateempty or ready
countNumber of returned entries
limitNormalized limit
maxEntriesCurrent in-memory ring buffer cap
entries[].decisiondelivered / blocked / degraded
entries[].payloadKeysTop-level payload key names only

The audit summary is cleared when the module is destroyed. It is not enterprise centralized audit or compliance retention.

Flow Extension Pattern

QuickOps built-in Flow targets are registered by CoreApp. If a plugin needs to compose with QuickOps, dispatch to existing targets through the Flow SDK instead of private IPC.

EXAMPLE.TYPESCRIPT
import { createFlowSDK } from '@talex-touch/utils/plugin/sdk'

const flow = createFlowSDK(channel, 'my-plugin-id')

const result = await flow.dispatch({
  type: 'json',
  data: {},
  context: {
    sourcePluginId: 'my-plugin-id'
  }
}, {
  preferredTarget: 'quickops.system-info',
  skipSelector: true,
  requireAck: true
})

if (result.state === 'blocked') {
  console.warn(result.reason)
}

QuickOps targets marked requireConfirm=true must receive a one-time confirmationToken from app UI before delivery and pass it in dispatch options, for example quickops.keep-awake, quickops.copy-to-clipboard, quickops.open-folder, and quickops.temp-text-file.

Flow Target Catalog

Public QuickOps targets use the quickops.<target> naming pattern. Targets are grouped into read-only, low-risk session control, and confirmation-required actions:

targetTypePurpose
quickops.capabilitiesRead-onlyCapability matrix and policy state
quickops.sessionsRead-onlyCurrent running QuickOps session snapshots
quickops.system-info / quickops.tuff-diagnostics / quickops.disk-space / quickops.directory-usageRead-onlyLocal system, diagnostics, disk, and directory summaries
quickops.network-status / quickops.system-proxy / quickops.query-local-ip / quickops.port-status / quickops.dns-queryRead-onlyLocal network, proxy, port, and DNS diagnostics
quickops.file-hash / quickops.file-base64 / quickops.recent-download / quickops.common-directory / quickops.path-formatRead-onlyFile summaries, common folders, and path formatting
quickops.format-textRead-onlyCasing and naming-style conversion
quickops.stop-keep-awake / quickops.stop-system-awake / quickops.pause-timer / quickops.resume-timer / quickops.stop-timer / quickops.pause-pomodoro / quickops.resume-pomodoro / quickops.stop-pomodoro / quickops.stop-clean-screen / quickops.pause-stopwatch / quickops.resume-stopwatch / quickops.lap-stopwatch / quickops.reset-stopwatchLow-risk session controlControls an existing session without creating new system state
quickops.stop-all-sessions / quickops.public-ip / quickops.temp-text-file / quickops.temp-directory / quickops.keep-awake / quickops.system-awake / quickops.start-timer / quickops.start-pomodoro / quickops.clean-screen / quickops.start-stopwatch / quickops.show-notification / quickops.copy-to-clipboard / quickops.open-folderConfirmation requiredChanges local state, writes local resources, opens a local folder, or performs an external lookup

Plugins can use read-only target results as context for their own workflows. Confirmation-required targets must not run silently in the background, and old confirmationToken values must not be cached.

Third-Party Extension Patterns

Normal plugins should not mutate the built-in QuickOps runtime. Use these extension patterns instead:

ScenarioRecommendedAvoid
Show a system diagnostics panelCall quickOps.systemInfo(), quickOps.diskSpace(), and quickOps.auditRecent(), then render your own UIReading CoreApp private files or calling main-process private IPC
Add local diagnostics to a workflowDispatch to existing quickops.* targets through the Flow SDKCopying QuickOps internals or bypassing requireConfirm
Add your own plugin OpsDeclare Manifest permissions and register plugin CoreBox items, Preview abilities, or your own Flow targetsPutting plugin logic into the built-in QuickOps namespace
Handle high-risk actionsUse Permission SDK and Flow confirmation, then return explicit blocked / degraded reasonsExecuting kill, bulk file edits, or system setting writes by default

Plugin-defined Ops can read the capability matrix first, then call Flow from their own UI, CoreBox result, or command handler:

EXAMPLE.TYPESCRIPT
import { createFlowSDK, useQuickOps } from '@talex-touch/utils/plugin/sdk'

const quickOps = useQuickOps()
const flow = createFlowSDK(channel, 'my-plugin-id')

async function runNetworkSummary() {
  const capabilities = await quickOps.capabilities()
  const hasNetwork = capabilities.entries.some((entry) =>
    entry.id.startsWith('quickops.network.') && entry.status !== 'disabled'
  )

  if (!hasNetwork) {
    return { state: 'blocked', reason: 'quickops-network-disabled' }
  }

  return flow.dispatch({ type: 'json', data: {} }, {
    preferredTarget: 'quickops.network-status',
    skipSelector: true,
    requireAck: true
  })
}

Plugin-Owned Ops Checklist

  1. Declare the actual required permissions and reasons in the Manifest. Do not borrow QuickOps permissions.
  2. Use the plugin's own namespace, such as a plugin feature id or custom Flow target.
  3. Read capabilities() before execution and surface disabled policy, unsupported platform, and degraded reasons in your UI.
  4. Reuse Permission / Flow confirmation when writing clipboard, writing files, opening folders, calling external services, or changing local state.
  5. Return stable blocked / degraded reasons instead of fake success.
  6. Log and audit target, decision, reason, payload keys, or lengths only; do not record sensitive payload values.

Changing Official QuickOps

Only repository maintainers should change official QuickOps capabilities. When adding or changing a common capability, prefer moving it into plugins/touch-quickops; Electron / OS-bound parts must remain behind CoreApp host capabilities.

The official plugin already owns the CoreBox root-result entry, expanded read-only panels, Developer preview, settings summary entry, and low-risk session-control triggers: capabilities, sessions, auditRecent, system info, Tuff diagnostics, disk space, directory usage, network status, local IP, port status, DNS query, file hash, file Base64, recent download, common directory, path format, format text, Developer preview, battery status, system proxy, quickops settings, plus stop-all-sessions and timer / Pomodoro / clean-screen / awake / stopwatch stop/pause/resume/lap/reset controls. Read-only panels fetch through the globalThis.quickOps transition facade; Developer preview calls developerPreview() through the CoreApp host facade and renders core-preview-card, while QR saves call saveDeveloperPreview() to write under the Tuff QuickOps temp directory; the settings summary reads current policy/defaults through capabilities and diagnostics without mutating CoreApp host policy; low-risk session controls dispatch through the injected Flow SDK to existing QuickOps Flow targets; file hash/Base64/path format support both text and files input routing. The plugin also owns the QuickOps Flow/AI source-level adapter contract: command routing emits redacted flowAdapterTrace, confirmation-required actions only show the App UI confirmationToken requirement, and high-risk requests such as kill port fail closed without a dispatch payload. The plugin must not execute high-risk actions or fall back to private IPC. Confirmation-required actions need a confirmationToken issued by App UI, so the plugin may only render the confirmation-required notice. CoreApp currently keeps the QuickOpsRuntimeHost / quickOpsRuntime host boundary, platform capabilities, Flow confirmation, policy/evidence gates, AppSetting schema / settings read path, and typed bridge. CoreApp no longer keeps a QuickOps natural-language resolver implementation, and the generic PreviewProvider, file search providers, plus CoreApp Tools settings no longer own QuickOps product surfaces. For the next migratable entries, extend this plugin's command routing and rendering path; writable settings require an official-plugin allowlisted host capability, and must not use private IPC to mutate settings. Do not reintroduce a CoreApp QuickOps CoreBox provider, Tools settings controls, generic PreviewProvider Developer surface, or file-search-specific QuickOps execute branch.

Keep these layers in sync:

LayerTypical filesRequirement
CoreApp runtime / host capabilityapps/core-app/src/main/modules/quick-ops/quick-ops-runtime-host.ts, apps/core-app/src/main/modules/quick-ops/quick-ops-session-manager.ts, apps/core-app/src/main/modules/quick-ops/index.tsDuring migration, keep QuickOpsSessionManager, platform helpers, typed transport, Flow targets, policy/evidence gates, and confirmation; do not put new CoreBox entries back into the default SearchEngine provider
Official pluginplugins/touch-quickopsOwn the CoreBox root-result entry, plugin-side read-only panel, settings summary entry, low-risk session-control triggers, future migratable business logic, and plugin-owned UI; new migratable entries should land here first
QuickOps module / Flowapps/core-app/src/main/modules/quick-ops/index.tsDuring migration, keep host capabilities / Flow targets and declare risk / category / requireConfirm; confirmation-required targets can only be delivered with an App UI token
Typed transportpackages/utils/transport/events/types/quick-ops.ts, packages/utils/transport/sdk/domains/quick-ops.tsExpose only allowed public SDK methods through typed events and the domain SDK
Plugin SDK facadepackages/utils/plugin/sdk/quick-ops.ts, packages/utils/plugin/sdk/index.tsKeep the plugin facade bounded and policy-aware; read-only / low-risk host capabilities can be public, but high-risk execution methods must not be exposed
Runtime injectionapps/core-app/src/main/modules/plugin/plugin.tsKeep globalThis.quickOps / plugin.quickOps aligned with the public SDK method set
Evidenceapps/core-app/scripts/quickops-surface-audit.ts, apps/core-app/scripts/quickops-flow-ai-adapter-audit.ts, apps/core-app/scripts/quickops-evidence-verify.tsUpdate surface audit, Flow/AI adapter audit, evidence templates, and strict verification
DocumentationThis page, user guide, QuickOps PRD, TODO, CHANGESSync behavior, API, policy, or safety-boundary changes

Built-in capability checklist:

  1. Classify the capability as read-only, low-risk session control, confirmation-required action, or high-risk action.
  2. Read-only capabilities may enter the SDK facade; state-changing, file-writing, clipboard-writing, folder-opening, or external-network capabilities must prefer Flow targets and confirmation.
  3. High-risk capabilities must not enter the plugin SDK by default. Add policy, permission, confirmation UI, audit, and real evidence first.
  4. If the change touches settings surfaces, add a read-only summary in plugins/touch-quickops first. Writable settings need an official-plugin allowlisted host capability, permission reasons, and evidence before they can mutate AppSetting.quickOps; do not call private IPC.
  5. Update focused tests for plugin command routing, runtime helpers, Flow delivery, policy fail-closed behavior, redacted ACK / audit, and typed transport surface.
  6. Run quickops:surface:audit --strict to catch raw channels, SDK bypasses, or runtime facade drift.
  7. Run quickops:flow-ai:audit --strict. It should prove the Flow target catalog, confirmation set, policy blocking, redacted ACK / audit, plugin-side Flow dispatch adapter / trace, and runtime dispatch bridge contracts; if a new capability does not update those source-level contracts, it should fail closed.
  8. Document only capabilities backed by evidence. Missing packaged, cross-platform, visual, real AI UI orchestration, or confirmation UI evidence must stay marked as incomplete; do not treat Flow metadata, resolver/bridge focused tests, or mock artifacts as complete evidence.

Extension Guidance

  1. Use capabilities() before showing an entry point.
  2. Use sessions() for live status, but do not persist session ids as durable state.
  3. Use auditRecent() for a local recent status panel, but do not upload it as enterprise audit.
  4. Custom execution paths should declare Manifest permissions and reuse Permission / Flow confirmation.
  5. File, network, clipboard, and system-state extensions must return explicit degraded / blocked reasons instead of fake success.