JSPM

@creator-studio-os/core

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q70925F
  • License MIT

Shared runtime for Creator Studio OS — AppleScript runners, project schema, ledger, error types, iWork shared automation

Package Exports

  • @creator-studio-os/core

Readme

Creator Studio OS

@creator-studio-os/core

Shared runtime for Creator Studio OS — AppleScript runners, project schema, ledger, error types, iWork shared automation

Version 2.0.0 Coverage 89% MIT License macOS

Part of the Creator Studio OS MCP control plane for Apple Creator Studio apps.


Install

npm install @creator-studio-os/core

What this package does

@creator-studio-os/core is the runtime foundation shared by every other @creator-studio-os/* package. It provides:

  • AppleScript runnersrunAppleScript, runApp, awaitOutput, openApp, withDaemonRecovery
  • Project schemaProjectV2 Zod schema, resolver, and typed path map
  • Error systemCreatorStudioError with structured { code, message, hint } shape
  • ConfigloadConfig() reads CREATOR_STUDIO_DATA_DIR and all app bundle IDs
  • Ledger — structured encode/project history at <dataDir>/.csos/ledger.jsonl
  • iWork sharedopenDocumentInApp, closeDocumentInApp, exportDocumentInApp, activateApp, isAppRunning

Tool (1)

Tool Description
csos_app_status Check whether any Creator Studio app is running and healthy. Pass app="all" to query all 8 at once.

Example

import {
  runAppleScript,
  CreatorStudioError,
  loadConfig,
  registerStatusTool,
} from "@creator-studio-os/core";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

const server = new McpServer({ name: "csos", version: "2.0.0" });
registerStatusTool(server);

// Escape user input before interpolation — always
const name = escapeAppleScriptString(userInput);
const result = await runAppleScript(`tell app "Keynote" to get name of document "${name}"`);

Error handling

All runtime errors are CreatorStudioError:

import { CreatorStudioError } from "@creator-studio-os/core";

try {
  await runAppleScript(`...`);
} catch (err) {
  if (err instanceof CreatorStudioError) {
    console.error(err.code);   // "E_OSASCRIPT_FAILED", "E_AUTOMATION_DENIED", …
    console.error(err.hint);   // actionable suggestion
  }
}

macOS requirement

@creator-studio-os/core is macOS-only ("os": ["darwin"]). AppleScript runners invoke osascript; openApp uses open -b <bundleId>.


Main README · Changelog · Security