@symbiosis-lab/moss-api 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -457,6 +457,9 @@ declare function executeBinary(options: ExecuteOptions): Promise<ExecuteResult>;
457
457
  *
458
458
  * Allows plugins to store and retrieve authentication cookies
459
459
  * for external services (e.g., Matters.town, GitHub).
460
+ *
461
+ * Cookies are automatically scoped to the plugin's registered domain
462
+ * (defined in manifest.json) - plugins cannot access other plugins' cookies.
460
463
  */
461
464
  /**
462
465
  * A cookie stored for plugin authentication
@@ -472,37 +475,46 @@ interface Cookie {
472
475
  path?: string;
473
476
  }
474
477
  /**
475
- * Get stored cookies for a plugin
478
+ * Get stored cookies for the current plugin.
476
479
  *
477
- * @param pluginName - Name of the plugin
478
- * @param projectPath - Absolute path to the project directory
479
- * @returns Array of stored cookies
480
+ * The plugin's identity is automatically detected from the runtime context.
481
+ * Cookies are filtered by the domain declared in the plugin's manifest.json.
482
+ *
483
+ * **Must be called from within a plugin hook** (process, generate, deploy, syndicate).
484
+ *
485
+ * @returns Array of cookies for the plugin's registered domain
486
+ * @throws Error if called outside of a plugin hook execution
480
487
  *
481
488
  * @example
482
489
  * ```typescript
483
- * const cookies = await getPluginCookie("matters-syndicator", "/path/to/project");
490
+ * // Inside a hook function:
491
+ * const cookies = await getPluginCookie();
484
492
  * const token = cookies.find(c => c.name === "__access_token");
485
493
  * if (token) {
486
494
  * // Use token for authenticated requests
487
495
  * }
488
496
  * ```
489
497
  */
490
- declare function getPluginCookie(pluginName: string, projectPath: string): Promise<Cookie[]>;
498
+ declare function getPluginCookie(): Promise<Cookie[]>;
491
499
  /**
492
- * Store cookies for a plugin
500
+ * Store cookies for the current plugin.
501
+ *
502
+ * The plugin's identity is automatically detected from the runtime context.
503
+ *
504
+ * **Must be called from within a plugin hook** (process, generate, deploy, syndicate).
493
505
  *
494
- * @param pluginName - Name of the plugin
495
- * @param projectPath - Absolute path to the project directory
496
506
  * @param cookies - Array of cookies to store
507
+ * @throws Error if called outside of a plugin hook execution
497
508
  *
498
509
  * @example
499
510
  * ```typescript
500
- * await setPluginCookie("my-plugin", "/path/to/project", [
511
+ * // Inside a hook function:
512
+ * await setPluginCookie([
501
513
  * { name: "session", value: "abc123" }
502
514
  * ]);
503
515
  * ```
504
516
  */
505
- declare function setPluginCookie(pluginName: string, projectPath: string, cookies: Cookie[]): Promise<void>;
517
+ declare function setPluginCookie(cookies: Cookie[]): Promise<void>;
506
518
  //#endregion
507
519
  export { AfterDeployContext, ArticleInfo, BaseContext, BeforeBuildContext, CompleteMessage, Cookie, DeploymentInfo, DownloadOptions, DownloadResult, ErrorMessage, ExecuteOptions, ExecuteResult, FetchOptions, FetchResult, HookResult, LogMessage, OnBuildContext, OnDeployContext, PluginCategory, PluginManifest, PluginMessage, ProgressMessage, ProjectInfo, SourceFiles, TauriCore, closeBrowser, downloadAsset, error, executeBinary, fetchUrl, fileExists, getMessageContext, getPluginCookie, getTauriCore, isTauriAvailable, listFiles, log, openBrowser, readFile, reportComplete, reportError, reportProgress, sendMessage, setMessageContext, setPluginCookie, warn, writeFile };
508
520
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/plugin.ts","../src/types/context.ts","../src/types/hooks.ts","../src/types/messages.ts","../src/utils/tauri.ts","../src/utils/messaging.ts","../src/utils/logger.ts","../src/utils/browser.ts","../src/utils/filesystem.ts","../src/utils/http.ts","../src/utils/binary.ts","../src/utils/cookies.ts"],"sourcesContent":[],"mappings":";;AAIA;AAOA;AAWY,UAlBK,WAAA,CAkBS;;;;ECbT,aAAA,CAAW,EAAA,MAAA;AAU5B;AAKiB,UDbA,cAAA,CCae;EAOf,IAAA,EAAA,MAAA;EAQA,OAAA,EAAA,MAAA;EAGL,KAAA,EAAA,MAAA;EACG,QAAA,ED5BH,cC4BG;EAJ6B,WAAA,CAAA,EA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CRbU,UAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,CAAA,EQgB7B,ORhB6B,CQgBrB,MRhBqB,EAAA,CAAA;;;;AC9BhC;;;;;AAqBA;AAWA;;;;ACtBA;AAQgB,iBMiDM,eAAA,CNjDW,UAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,EAAA,OAAA,EMoDtB,MNpDsB,EAAA,CAAA,EMqD9B,ONrD8B,CAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types/plugin.ts","../src/types/context.ts","../src/types/hooks.ts","../src/types/messages.ts","../src/utils/tauri.ts","../src/utils/messaging.ts","../src/utils/logger.ts","../src/utils/browser.ts","../src/utils/filesystem.ts","../src/utils/http.ts","../src/utils/binary.ts","../src/utils/cookies.ts"],"sourcesContent":[],"mappings":";;AAIA;AAOA;AAWY,UAlBK,WAAA,CAkBS;;;;ECbT,aAAA,CAAW,EAAA,MAAA;AAU5B;AAKiB,UDbA,cAAA,CCae;EAOf,IAAA,EAAA,MAAA;EAQA,OAAA,EAAA,MAAA;EAGL,KAAA,EAAA,MAAA;EACG,QAAA,ED5BH,cC4BG;EAJ6B,WAAA,CAAA,EAAA,MAAA;EAAW,IAAA,CAAA,EAAA,MAAA;EAUtC,MAAA,CAAA,EAAA,MAAW;EAUX,MAAA,CAAA,EDxCN,MCwCiB,CAAA,MAAA,EAAA,OAIb,CAAA;AASf;KDlDY,cAAA;;;;;;ACbK,UAAA,WAAA,CAAW;EAUX,YAAA,EAAA,MAAA;EAKA,QAAA,EAAA,MAAA;EAOA,YAAA,EAnBD,WAmBiB;EAQhB,MAAA,EA1BP,MA0BO,CAAA,MAAmB,EAAA,OAAA,CAAA;;;;;AAUnB,UA9BA,kBAAA,SAA2B,WA8BhB,CAAA,CAU5B;AAaA;;;UAhDiB,cAAA,SAAuB;ECfvB,YAAA,EDgBD,WCbD;;;;ACLf;AACI,UFuBa,eAAA,SAAwB,WEvBrC,CAAA;EACA,UA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EAGL;EACG,IAAA,EAAA,MAAA,EAAA;EAJ6B;EAAW,UAAA,EAAA,MAAA;EAUtC;EAUA,SAAA,CAAA,EAAA,MAAW;EAaX;QS9CT;;;ARjBR;;UQuBiB,aAAA;;EPzBL,OAAA,EAAA,OAAa;EACrB;EACA,QAAA,EAAA,MAAA;EACA;EACA,MAAA,EAAA,MAAA;EAAe;EAEF,MAAA,EAAA,MAAU;AAM3B;AAQA;AAOA;;;;AC9BA;;;;;AAqBA;AAWA;;;;ACtBA;AAQA;AAQA;AAmBA;AAYA;AAWA;;;;AC/DA;AAOA;AAOA;;;;ACbA;AAOA;;;;ACKsB,iBEuEA,aAAA,CFpEZ,OAAA,EEqEC,cFrED,CAAA,EEsEP,OFtEO,CEsEC,aFtED,CAAA;;;;ARrBV;AAOA;AAWA;;;;ACbA;AAUA;AAKA;AAOA;AAQA;AAGY,UUvBK,MAAA,CVuBL;EACG;EAJ6B,IAAA,EAAA,MAAA;EAAW;EAUtC,KAAA,EAAA,MAAA;EAUA;EAaA,MAAA,CAAA,EAAA,MAAA;;;;AC/DjB;;;;ACFA;;;;;;AAMA;AAMA;AAQA;AAOA;;;;AC9BA;;;;AACqE,iBO2D/C,eAAA,CAAA,CP3D+C,EO2D5B,OP3D4B,CO2DpB,MP3DoB,EAAA,CAAA;AAoBrE;AAWA;;;;ACtBA;AAQA;AAQA;AAmBA;AAYA;AAWA;;;;AC/DA;AAOA;AAOA;;iBK2EsB,eAAA,UAAyB,WAAW"}
package/dist/index.mjs CHANGED
@@ -388,47 +388,63 @@ async function executeBinary(options) {
388
388
  *
389
389
  * Allows plugins to store and retrieve authentication cookies
390
390
  * for external services (e.g., Matters.town, GitHub).
391
+ *
392
+ * Cookies are automatically scoped to the plugin's registered domain
393
+ * (defined in manifest.json) - plugins cannot access other plugins' cookies.
391
394
  */
392
395
  /**
393
- * Get stored cookies for a plugin
396
+ * Get stored cookies for the current plugin.
394
397
  *
395
- * @param pluginName - Name of the plugin
396
- * @param projectPath - Absolute path to the project directory
397
- * @returns Array of stored cookies
398
+ * The plugin's identity is automatically detected from the runtime context.
399
+ * Cookies are filtered by the domain declared in the plugin's manifest.json.
400
+ *
401
+ * **Must be called from within a plugin hook** (process, generate, deploy, syndicate).
402
+ *
403
+ * @returns Array of cookies for the plugin's registered domain
404
+ * @throws Error if called outside of a plugin hook execution
398
405
  *
399
406
  * @example
400
407
  * ```typescript
401
- * const cookies = await getPluginCookie("matters-syndicator", "/path/to/project");
408
+ * // Inside a hook function:
409
+ * const cookies = await getPluginCookie();
402
410
  * const token = cookies.find(c => c.name === "__access_token");
403
411
  * if (token) {
404
412
  * // Use token for authenticated requests
405
413
  * }
406
414
  * ```
407
415
  */
408
- async function getPluginCookie(pluginName, projectPath) {
416
+ async function getPluginCookie() {
417
+ const context = window.__MOSS_CURRENT_CONTEXT__;
418
+ if (!context) throw new Error("getPluginCookie() must be called from within a plugin hook. Ensure you're calling this from process(), generate(), deploy(), or syndicate().");
409
419
  return getTauriCore().invoke("get_plugin_cookie", {
410
- pluginName,
411
- projectPath
420
+ pluginName: context.plugin_name,
421
+ projectPath: context.project_path
412
422
  });
413
423
  }
414
424
  /**
415
- * Store cookies for a plugin
425
+ * Store cookies for the current plugin.
426
+ *
427
+ * The plugin's identity is automatically detected from the runtime context.
428
+ *
429
+ * **Must be called from within a plugin hook** (process, generate, deploy, syndicate).
416
430
  *
417
- * @param pluginName - Name of the plugin
418
- * @param projectPath - Absolute path to the project directory
419
431
  * @param cookies - Array of cookies to store
432
+ * @throws Error if called outside of a plugin hook execution
420
433
  *
421
434
  * @example
422
435
  * ```typescript
423
- * await setPluginCookie("my-plugin", "/path/to/project", [
436
+ * // Inside a hook function:
437
+ * await setPluginCookie([
424
438
  * { name: "session", value: "abc123" }
425
439
  * ]);
426
440
  * ```
427
441
  */
428
- async function setPluginCookie(pluginName, projectPath, cookies) {
442
+ async function setPluginCookie(cookies) {
443
+ const context = window.__MOSS_CURRENT_CONTEXT__;
444
+ if (!context) throw new Error("setPluginCookie() must be called from within a plugin hook. Ensure you're calling this from process(), generate(), deploy(), or syndicate().");
429
445
  await getTauriCore().invoke("set_plugin_cookie", {
430
- pluginName,
431
- projectPath,
446
+ pluginName: context.plugin_name,
447
+ projectPath: context.project_path,
432
448
  cookies
433
449
  });
434
450
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/utils/tauri.ts","../src/utils/messaging.ts","../src/utils/logger.ts","../src/utils/browser.ts","../src/utils/filesystem.ts","../src/utils/http.ts","../src/utils/binary.ts","../src/utils/cookies.ts"],"sourcesContent":["/**\n * Tauri core utilities for plugin communication\n */\n\nexport interface TauriCore {\n invoke: <T>(cmd: string, args?: Record<string, unknown>) => Promise<T>;\n}\n\ninterface TauriWindow {\n __TAURI__?: {\n core: TauriCore;\n };\n}\n\n/**\n * Get the Tauri core API\n *\n * @deprecated Use higher-level APIs instead:\n * - File operations: `readFile`, `writeFile`, `listFiles`, `fileExists`\n * - HTTP: `fetchUrl`, `downloadAsset`\n * - Binary execution: `executeBinary`\n * - Cookies: `getPluginCookie`, `setPluginCookie`\n *\n * @throws Error if Tauri is not available\n */\nexport function getTauriCore(): TauriCore {\n const w = window as unknown as TauriWindow;\n if (!w.__TAURI__?.core) {\n throw new Error(\"Tauri core not available\");\n }\n return w.__TAURI__.core;\n}\n\n/**\n * Check if Tauri is available\n */\nexport function isTauriAvailable(): boolean {\n const w = window as unknown as TauriWindow;\n return !!w.__TAURI__?.core;\n}\n","/**\n * Plugin messaging utilities for communicating with Moss\n */\n\nimport type { PluginMessage } from \"../types/messages\";\nimport { getTauriCore, isTauriAvailable } from \"./tauri\";\n\nlet currentPluginName = \"\";\nlet currentHookName = \"\";\n\n/**\n * Set the message context for subsequent messages\n * This is typically called automatically by the plugin runtime\n */\nexport function setMessageContext(pluginName: string, hookName: string): void {\n currentPluginName = pluginName;\n currentHookName = hookName;\n}\n\n/**\n * Get the current message context\n */\nexport function getMessageContext(): { pluginName: string; hookName: string } {\n return { pluginName: currentPluginName, hookName: currentHookName };\n}\n\n/**\n * Send a message to Moss\n * Silently fails if Tauri is unavailable (useful for testing)\n */\nexport async function sendMessage(message: PluginMessage): Promise<void> {\n if (!isTauriAvailable()) {\n return;\n }\n\n try {\n await getTauriCore().invoke(\"plugin_message\", {\n pluginName: currentPluginName,\n hookName: currentHookName,\n message,\n });\n } catch {\n // Silently fail - logging would be recursive\n }\n}\n\n/**\n * Report progress to Moss\n */\nexport async function reportProgress(\n phase: string,\n current: number,\n total: number,\n message?: string\n): Promise<void> {\n await sendMessage({ type: \"progress\", phase, current, total, message });\n}\n\n/**\n * Report an error to Moss\n */\nexport async function reportError(\n error: string,\n context?: string,\n fatal = false\n): Promise<void> {\n await sendMessage({ type: \"error\", error, context, fatal });\n}\n\n/**\n * Report completion to Moss\n */\nexport async function reportComplete(result: unknown): Promise<void> {\n await sendMessage({ type: \"complete\", result });\n}\n","/**\n * Logging utilities for plugins\n */\n\nimport { sendMessage } from \"./messaging\";\n\n/**\n * Log an informational message\n */\nexport async function log(message: string): Promise<void> {\n await sendMessage({ type: \"log\", level: \"log\", message });\n}\n\n/**\n * Log a warning message\n */\nexport async function warn(message: string): Promise<void> {\n await sendMessage({ type: \"log\", level: \"warn\", message });\n}\n\n/**\n * Log an error message\n */\nexport async function error(message: string): Promise<void> {\n await sendMessage({ type: \"log\", level: \"error\", message });\n}\n","/**\n * Browser utilities for plugins\n * Abstracts Tauri browser commands to decouple plugins from internal APIs\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n/**\n * Open a URL in the plugin browser window\n */\nexport async function openBrowser(url: string): Promise<void> {\n await getTauriCore().invoke(\"open_plugin_browser\", { url });\n}\n\n/**\n * Close the plugin browser window\n */\nexport async function closeBrowser(): Promise<void> {\n await getTauriCore().invoke(\"close_plugin_browser\", {});\n}\n","/**\n * File system operations for Moss plugins\n *\n * These functions abstract away the underlying Tauri commands,\n * providing a clean API for plugins to read/write project files.\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n/**\n * Read a file from the project directory\n *\n * @param projectPath - Absolute path to the project directory\n * @param relativePath - Path relative to the project root\n * @returns File contents as a string\n * @throws Error if file cannot be read\n *\n * @example\n * ```typescript\n * const content = await readFile(\"/path/to/project\", \"src/index.ts\");\n * ```\n */\nexport async function readFile(\n projectPath: string,\n relativePath: string\n): Promise<string> {\n return getTauriCore().invoke<string>(\"read_project_file\", {\n projectPath,\n relativePath,\n });\n}\n\n/**\n * Write content to a file in the project directory\n *\n * Creates parent directories if they don't exist.\n *\n * @param projectPath - Absolute path to the project directory\n * @param relativePath - Path relative to the project root\n * @param content - Content to write to the file\n * @throws Error if file cannot be written\n *\n * @example\n * ```typescript\n * await writeFile(\"/path/to/project\", \"output/result.md\", \"# Hello World\");\n * ```\n */\nexport async function writeFile(\n projectPath: string,\n relativePath: string,\n content: string\n): Promise<void> {\n await getTauriCore().invoke(\"write_project_file\", {\n projectPath,\n relativePath,\n data: content,\n });\n}\n\n/**\n * List all files in a project directory\n *\n * Returns file paths relative to the project root.\n *\n * @param projectPath - Absolute path to the project directory\n * @returns Array of relative file paths\n * @throws Error if directory cannot be listed\n *\n * @example\n * ```typescript\n * const files = await listFiles(\"/path/to/project\");\n * // [\"src/index.ts\", \"package.json\", \"README.md\"]\n * ```\n */\nexport async function listFiles(projectPath: string): Promise<string[]> {\n return getTauriCore().invoke<string[]>(\"list_project_files\", {\n projectPath,\n });\n}\n\n/**\n * Check if a file exists in the project directory\n *\n * @param projectPath - Absolute path to the project directory\n * @param relativePath - Path relative to the project root\n * @returns true if file exists, false otherwise\n *\n * @example\n * ```typescript\n * if (await fileExists(\"/path/to/project\", \"config.json\")) {\n * // load config\n * }\n * ```\n */\nexport async function fileExists(\n projectPath: string,\n relativePath: string\n): Promise<boolean> {\n try {\n await readFile(projectPath, relativePath);\n return true;\n } catch {\n return false;\n }\n}\n","/**\n * HTTP operations for Moss plugins\n *\n * These functions provide HTTP capabilities that bypass browser CORS\n * restrictions by using Rust's HTTP client under the hood.\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Options for HTTP fetch requests\n */\nexport interface FetchOptions {\n /** Timeout in milliseconds (default: 30000) */\n timeoutMs?: number;\n}\n\n/**\n * Result from an HTTP fetch operation\n */\nexport interface FetchResult {\n /** HTTP status code */\n status: number;\n /** Whether the request was successful (2xx status) */\n ok: boolean;\n /** Content-Type header from response */\n contentType: string | null;\n /** Response body as Uint8Array */\n body: Uint8Array;\n /** Get response body as text */\n text(): string;\n}\n\n/**\n * Options for asset download\n */\nexport interface DownloadOptions {\n /** Timeout in milliseconds (default: 30000) */\n timeoutMs?: number;\n}\n\n/**\n * Result from an asset download operation\n */\nexport interface DownloadResult {\n /** HTTP status code */\n status: number;\n /** Whether the request was successful (2xx status) */\n ok: boolean;\n /** Content-Type header from response */\n contentType: string | null;\n /** Number of bytes written to disk */\n bytesWritten: number;\n /** Actual path where file was saved (relative to project) */\n actualPath: string;\n}\n\n// ============================================================================\n// Internal Types (Tauri response shapes)\n// ============================================================================\n\ninterface TauriFetchResult {\n status: number;\n ok: boolean;\n body_base64: string;\n content_type: string | null;\n}\n\ninterface TauriDownloadResult {\n status: number;\n ok: boolean;\n content_type: string | null;\n bytes_written: number;\n actual_path: string;\n}\n\n// ============================================================================\n// Functions\n// ============================================================================\n\n/**\n * Fetch a URL using Rust's HTTP client (bypasses CORS)\n *\n * @param url - URL to fetch\n * @param options - Optional fetch configuration\n * @returns Fetch result with status, body, and helpers\n * @throws Error if network request fails\n *\n * @example\n * ```typescript\n * const result = await fetchUrl(\"https://api.example.com/data\");\n * if (result.ok) {\n * const data = JSON.parse(result.text());\n * }\n * ```\n */\nexport async function fetchUrl(\n url: string,\n options: FetchOptions = {}\n): Promise<FetchResult> {\n const { timeoutMs = 30000 } = options;\n\n const result = await getTauriCore().invoke<TauriFetchResult>(\"fetch_url\", {\n url,\n timeoutMs,\n });\n\n // Decode base64 body to Uint8Array\n const binaryString = atob(result.body_base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n\n return {\n status: result.status,\n ok: result.ok,\n contentType: result.content_type,\n body: bytes,\n text(): string {\n return new TextDecoder().decode(bytes);\n },\n };\n}\n\n/**\n * Download a URL and save directly to disk\n *\n * Downloads the file and writes it directly to disk without passing\n * the binary data through JavaScript. The filename is derived from\n * the URL, and file extension is inferred from Content-Type if needed.\n *\n * @param url - URL to download\n * @param projectPath - Absolute path to the project directory\n * @param targetDir - Target directory within project (e.g., \"assets\")\n * @param options - Optional download configuration\n * @returns Download result with actual path where file was saved\n * @throws Error if download or write fails\n *\n * @example\n * ```typescript\n * const result = await downloadAsset(\n * \"https://example.com/image\",\n * \"/path/to/project\",\n * \"assets\"\n * );\n * if (result.ok) {\n * console.log(`Saved to ${result.actualPath}`); // e.g., \"assets/image.png\"\n * }\n * ```\n */\nexport async function downloadAsset(\n url: string,\n projectPath: string,\n targetDir: string,\n options: DownloadOptions = {}\n): Promise<DownloadResult> {\n const { timeoutMs = 30000 } = options;\n\n const result = await getTauriCore().invoke<TauriDownloadResult>(\n \"download_asset\",\n {\n url,\n projectPath,\n targetDir,\n timeoutMs,\n }\n );\n\n return {\n status: result.status,\n ok: result.ok,\n contentType: result.content_type,\n bytesWritten: result.bytes_written,\n actualPath: result.actual_path,\n };\n}\n","/**\n * Binary execution for Moss plugins\n *\n * Allows plugins to execute external binaries (git, npm, etc.)\n * in a controlled environment.\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Options for executing a binary\n */\nexport interface ExecuteOptions {\n /** Path to the binary (can be just the name if in PATH) */\n binaryPath: string;\n /** Arguments to pass to the binary */\n args: string[];\n /** Working directory for execution */\n workingDir: string;\n /** Timeout in milliseconds (default: 60000) */\n timeoutMs?: number;\n /** Additional environment variables */\n env?: Record<string, string>;\n}\n\n/**\n * Result from binary execution\n */\nexport interface ExecuteResult {\n /** Whether the command succeeded (exit code 0) */\n success: boolean;\n /** Exit code from the process */\n exitCode: number;\n /** Standard output from the process */\n stdout: string;\n /** Standard error output from the process */\n stderr: string;\n}\n\n// ============================================================================\n// Internal Types (Tauri response shape)\n// ============================================================================\n\ninterface TauriBinaryResult {\n success: boolean;\n exit_code: number;\n stdout: string;\n stderr: string;\n}\n\n// ============================================================================\n// Functions\n// ============================================================================\n\n/**\n * Execute an external binary\n *\n * @param options - Execution options including binary path, args, and working directory\n * @returns Execution result with stdout, stderr, and exit code\n * @throws Error if binary cannot be executed\n *\n * @example\n * ```typescript\n * // Run git status\n * const result = await executeBinary({\n * binaryPath: \"git\",\n * args: [\"status\"],\n * workingDir: \"/path/to/repo\",\n * });\n *\n * if (result.success) {\n * console.log(result.stdout);\n * } else {\n * console.error(result.stderr);\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Run npm install with timeout\n * const result = await executeBinary({\n * binaryPath: \"npm\",\n * args: [\"install\"],\n * workingDir: \"/path/to/project\",\n * timeoutMs: 120000,\n * env: { NODE_ENV: \"production\" },\n * });\n * ```\n */\nexport async function executeBinary(\n options: ExecuteOptions\n): Promise<ExecuteResult> {\n const { binaryPath, args, workingDir, timeoutMs = 60000, env } = options;\n\n const result = await getTauriCore().invoke<TauriBinaryResult>(\n \"execute_binary\",\n {\n binaryPath,\n args,\n workingDir,\n timeoutMs,\n env,\n }\n );\n\n return {\n success: result.success,\n exitCode: result.exit_code,\n stdout: result.stdout,\n stderr: result.stderr,\n };\n}\n","/**\n * Cookie management for Moss plugins\n *\n * Allows plugins to store and retrieve authentication cookies\n * for external services (e.g., Matters.town, GitHub).\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * A cookie stored for plugin authentication\n */\nexport interface Cookie {\n /** Cookie name */\n name: string;\n /** Cookie value */\n value: string;\n /** Optional domain for the cookie */\n domain?: string;\n /** Optional path for the cookie */\n path?: string;\n}\n\n// ============================================================================\n// Functions\n// ============================================================================\n\n/**\n * Get stored cookies for a plugin\n *\n * @param pluginName - Name of the plugin\n * @param projectPath - Absolute path to the project directory\n * @returns Array of stored cookies\n *\n * @example\n * ```typescript\n * const cookies = await getPluginCookie(\"matters-syndicator\", \"/path/to/project\");\n * const token = cookies.find(c => c.name === \"__access_token\");\n * if (token) {\n * // Use token for authenticated requests\n * }\n * ```\n */\nexport async function getPluginCookie(\n pluginName: string,\n projectPath: string\n): Promise<Cookie[]> {\n return getTauriCore().invoke<Cookie[]>(\"get_plugin_cookie\", {\n pluginName,\n projectPath,\n });\n}\n\n/**\n * Store cookies for a plugin\n *\n * @param pluginName - Name of the plugin\n * @param projectPath - Absolute path to the project directory\n * @param cookies - Array of cookies to store\n *\n * @example\n * ```typescript\n * await setPluginCookie(\"my-plugin\", \"/path/to/project\", [\n * { name: \"session\", value: \"abc123\" }\n * ]);\n * ```\n */\nexport async function setPluginCookie(\n pluginName: string,\n projectPath: string,\n cookies: Cookie[]\n): Promise<void> {\n await getTauriCore().invoke(\"set_plugin_cookie\", {\n pluginName,\n projectPath,\n cookies,\n });\n}\n"],"mappings":";;;;;;;;;;;;AAyBA,SAAgB,eAA0B;CACxC,MAAM,IAAI;AACV,KAAI,CAAC,EAAE,WAAW,KAChB,OAAM,IAAI,MAAM,2BAA2B;AAE7C,QAAO,EAAE,UAAU;;;;;AAMrB,SAAgB,mBAA4B;AAE1C,QAAO,CAAC,CADE,OACC,WAAW;;;;;AC/BxB,IAAI,oBAAoB;AACxB,IAAI,kBAAkB;;;;;AAMtB,SAAgB,kBAAkB,YAAoB,UAAwB;AAC5E,qBAAoB;AACpB,mBAAkB;;;;;AAMpB,SAAgB,oBAA8D;AAC5E,QAAO;EAAE,YAAY;EAAmB,UAAU;EAAiB;;;;;;AAOrE,eAAsB,YAAY,SAAuC;AACvE,KAAI,CAAC,kBAAkB,CACrB;AAGF,KAAI;AACF,QAAM,cAAc,CAAC,OAAO,kBAAkB;GAC5C,YAAY;GAC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ACD,CAAC;;;;;;;;;;;;;;;;AAiBJ,eAAsB,gBACpB,YACA,aACA,SACe;AACf,OAAM,cAAc,CAAC,OAAO,qBAAqB;EAC/C;EACA;EACA;EACD,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/utils/tauri.ts","../src/utils/messaging.ts","../src/utils/logger.ts","../src/utils/browser.ts","../src/utils/filesystem.ts","../src/utils/http.ts","../src/utils/binary.ts","../src/utils/cookies.ts"],"sourcesContent":["/**\n * Tauri core utilities for plugin communication\n */\n\nexport interface TauriCore {\n invoke: <T>(cmd: string, args?: Record<string, unknown>) => Promise<T>;\n}\n\ninterface TauriWindow {\n __TAURI__?: {\n core: TauriCore;\n };\n}\n\n/**\n * Get the Tauri core API\n *\n * @deprecated Use higher-level APIs instead:\n * - File operations: `readFile`, `writeFile`, `listFiles`, `fileExists`\n * - HTTP: `fetchUrl`, `downloadAsset`\n * - Binary execution: `executeBinary`\n * - Cookies: `getPluginCookie`, `setPluginCookie`\n *\n * @throws Error if Tauri is not available\n */\nexport function getTauriCore(): TauriCore {\n const w = window as unknown as TauriWindow;\n if (!w.__TAURI__?.core) {\n throw new Error(\"Tauri core not available\");\n }\n return w.__TAURI__.core;\n}\n\n/**\n * Check if Tauri is available\n */\nexport function isTauriAvailable(): boolean {\n const w = window as unknown as TauriWindow;\n return !!w.__TAURI__?.core;\n}\n","/**\n * Plugin messaging utilities for communicating with Moss\n */\n\nimport type { PluginMessage } from \"../types/messages\";\nimport { getTauriCore, isTauriAvailable } from \"./tauri\";\n\nlet currentPluginName = \"\";\nlet currentHookName = \"\";\n\n/**\n * Set the message context for subsequent messages\n * This is typically called automatically by the plugin runtime\n */\nexport function setMessageContext(pluginName: string, hookName: string): void {\n currentPluginName = pluginName;\n currentHookName = hookName;\n}\n\n/**\n * Get the current message context\n */\nexport function getMessageContext(): { pluginName: string; hookName: string } {\n return { pluginName: currentPluginName, hookName: currentHookName };\n}\n\n/**\n * Send a message to Moss\n * Silently fails if Tauri is unavailable (useful for testing)\n */\nexport async function sendMessage(message: PluginMessage): Promise<void> {\n if (!isTauriAvailable()) {\n return;\n }\n\n try {\n await getTauriCore().invoke(\"plugin_message\", {\n pluginName: currentPluginName,\n hookName: currentHookName,\n message,\n });\n } catch {\n // Silently fail - logging would be recursive\n }\n}\n\n/**\n * Report progress to Moss\n */\nexport async function reportProgress(\n phase: string,\n current: number,\n total: number,\n message?: string\n): Promise<void> {\n await sendMessage({ type: \"progress\", phase, current, total, message });\n}\n\n/**\n * Report an error to Moss\n */\nexport async function reportError(\n error: string,\n context?: string,\n fatal = false\n): Promise<void> {\n await sendMessage({ type: \"error\", error, context, fatal });\n}\n\n/**\n * Report completion to Moss\n */\nexport async function reportComplete(result: unknown): Promise<void> {\n await sendMessage({ type: \"complete\", result });\n}\n","/**\n * Logging utilities for plugins\n */\n\nimport { sendMessage } from \"./messaging\";\n\n/**\n * Log an informational message\n */\nexport async function log(message: string): Promise<void> {\n await sendMessage({ type: \"log\", level: \"log\", message });\n}\n\n/**\n * Log a warning message\n */\nexport async function warn(message: string): Promise<void> {\n await sendMessage({ type: \"log\", level: \"warn\", message });\n}\n\n/**\n * Log an error message\n */\nexport async function error(message: string): Promise<void> {\n await sendMessage({ type: \"log\", level: \"error\", message });\n}\n","/**\n * Browser utilities for plugins\n * Abstracts Tauri browser commands to decouple plugins from internal APIs\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n/**\n * Open a URL in the plugin browser window\n */\nexport async function openBrowser(url: string): Promise<void> {\n await getTauriCore().invoke(\"open_plugin_browser\", { url });\n}\n\n/**\n * Close the plugin browser window\n */\nexport async function closeBrowser(): Promise<void> {\n await getTauriCore().invoke(\"close_plugin_browser\", {});\n}\n","/**\n * File system operations for Moss plugins\n *\n * These functions abstract away the underlying Tauri commands,\n * providing a clean API for plugins to read/write project files.\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n/**\n * Read a file from the project directory\n *\n * @param projectPath - Absolute path to the project directory\n * @param relativePath - Path relative to the project root\n * @returns File contents as a string\n * @throws Error if file cannot be read\n *\n * @example\n * ```typescript\n * const content = await readFile(\"/path/to/project\", \"src/index.ts\");\n * ```\n */\nexport async function readFile(\n projectPath: string,\n relativePath: string\n): Promise<string> {\n return getTauriCore().invoke<string>(\"read_project_file\", {\n projectPath,\n relativePath,\n });\n}\n\n/**\n * Write content to a file in the project directory\n *\n * Creates parent directories if they don't exist.\n *\n * @param projectPath - Absolute path to the project directory\n * @param relativePath - Path relative to the project root\n * @param content - Content to write to the file\n * @throws Error if file cannot be written\n *\n * @example\n * ```typescript\n * await writeFile(\"/path/to/project\", \"output/result.md\", \"# Hello World\");\n * ```\n */\nexport async function writeFile(\n projectPath: string,\n relativePath: string,\n content: string\n): Promise<void> {\n await getTauriCore().invoke(\"write_project_file\", {\n projectPath,\n relativePath,\n data: content,\n });\n}\n\n/**\n * List all files in a project directory\n *\n * Returns file paths relative to the project root.\n *\n * @param projectPath - Absolute path to the project directory\n * @returns Array of relative file paths\n * @throws Error if directory cannot be listed\n *\n * @example\n * ```typescript\n * const files = await listFiles(\"/path/to/project\");\n * // [\"src/index.ts\", \"package.json\", \"README.md\"]\n * ```\n */\nexport async function listFiles(projectPath: string): Promise<string[]> {\n return getTauriCore().invoke<string[]>(\"list_project_files\", {\n projectPath,\n });\n}\n\n/**\n * Check if a file exists in the project directory\n *\n * @param projectPath - Absolute path to the project directory\n * @param relativePath - Path relative to the project root\n * @returns true if file exists, false otherwise\n *\n * @example\n * ```typescript\n * if (await fileExists(\"/path/to/project\", \"config.json\")) {\n * // load config\n * }\n * ```\n */\nexport async function fileExists(\n projectPath: string,\n relativePath: string\n): Promise<boolean> {\n try {\n await readFile(projectPath, relativePath);\n return true;\n } catch {\n return false;\n }\n}\n","/**\n * HTTP operations for Moss plugins\n *\n * These functions provide HTTP capabilities that bypass browser CORS\n * restrictions by using Rust's HTTP client under the hood.\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Options for HTTP fetch requests\n */\nexport interface FetchOptions {\n /** Timeout in milliseconds (default: 30000) */\n timeoutMs?: number;\n}\n\n/**\n * Result from an HTTP fetch operation\n */\nexport interface FetchResult {\n /** HTTP status code */\n status: number;\n /** Whether the request was successful (2xx status) */\n ok: boolean;\n /** Content-Type header from response */\n contentType: string | null;\n /** Response body as Uint8Array */\n body: Uint8Array;\n /** Get response body as text */\n text(): string;\n}\n\n/**\n * Options for asset download\n */\nexport interface DownloadOptions {\n /** Timeout in milliseconds (default: 30000) */\n timeoutMs?: number;\n}\n\n/**\n * Result from an asset download operation\n */\nexport interface DownloadResult {\n /** HTTP status code */\n status: number;\n /** Whether the request was successful (2xx status) */\n ok: boolean;\n /** Content-Type header from response */\n contentType: string | null;\n /** Number of bytes written to disk */\n bytesWritten: number;\n /** Actual path where file was saved (relative to project) */\n actualPath: string;\n}\n\n// ============================================================================\n// Internal Types (Tauri response shapes)\n// ============================================================================\n\ninterface TauriFetchResult {\n status: number;\n ok: boolean;\n body_base64: string;\n content_type: string | null;\n}\n\ninterface TauriDownloadResult {\n status: number;\n ok: boolean;\n content_type: string | null;\n bytes_written: number;\n actual_path: string;\n}\n\n// ============================================================================\n// Functions\n// ============================================================================\n\n/**\n * Fetch a URL using Rust's HTTP client (bypasses CORS)\n *\n * @param url - URL to fetch\n * @param options - Optional fetch configuration\n * @returns Fetch result with status, body, and helpers\n * @throws Error if network request fails\n *\n * @example\n * ```typescript\n * const result = await fetchUrl(\"https://api.example.com/data\");\n * if (result.ok) {\n * const data = JSON.parse(result.text());\n * }\n * ```\n */\nexport async function fetchUrl(\n url: string,\n options: FetchOptions = {}\n): Promise<FetchResult> {\n const { timeoutMs = 30000 } = options;\n\n const result = await getTauriCore().invoke<TauriFetchResult>(\"fetch_url\", {\n url,\n timeoutMs,\n });\n\n // Decode base64 body to Uint8Array\n const binaryString = atob(result.body_base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n\n return {\n status: result.status,\n ok: result.ok,\n contentType: result.content_type,\n body: bytes,\n text(): string {\n return new TextDecoder().decode(bytes);\n },\n };\n}\n\n/**\n * Download a URL and save directly to disk\n *\n * Downloads the file and writes it directly to disk without passing\n * the binary data through JavaScript. The filename is derived from\n * the URL, and file extension is inferred from Content-Type if needed.\n *\n * @param url - URL to download\n * @param projectPath - Absolute path to the project directory\n * @param targetDir - Target directory within project (e.g., \"assets\")\n * @param options - Optional download configuration\n * @returns Download result with actual path where file was saved\n * @throws Error if download or write fails\n *\n * @example\n * ```typescript\n * const result = await downloadAsset(\n * \"https://example.com/image\",\n * \"/path/to/project\",\n * \"assets\"\n * );\n * if (result.ok) {\n * console.log(`Saved to ${result.actualPath}`); // e.g., \"assets/image.png\"\n * }\n * ```\n */\nexport async function downloadAsset(\n url: string,\n projectPath: string,\n targetDir: string,\n options: DownloadOptions = {}\n): Promise<DownloadResult> {\n const { timeoutMs = 30000 } = options;\n\n const result = await getTauriCore().invoke<TauriDownloadResult>(\n \"download_asset\",\n {\n url,\n projectPath,\n targetDir,\n timeoutMs,\n }\n );\n\n return {\n status: result.status,\n ok: result.ok,\n contentType: result.content_type,\n bytesWritten: result.bytes_written,\n actualPath: result.actual_path,\n };\n}\n","/**\n * Binary execution for Moss plugins\n *\n * Allows plugins to execute external binaries (git, npm, etc.)\n * in a controlled environment.\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Options for executing a binary\n */\nexport interface ExecuteOptions {\n /** Path to the binary (can be just the name if in PATH) */\n binaryPath: string;\n /** Arguments to pass to the binary */\n args: string[];\n /** Working directory for execution */\n workingDir: string;\n /** Timeout in milliseconds (default: 60000) */\n timeoutMs?: number;\n /** Additional environment variables */\n env?: Record<string, string>;\n}\n\n/**\n * Result from binary execution\n */\nexport interface ExecuteResult {\n /** Whether the command succeeded (exit code 0) */\n success: boolean;\n /** Exit code from the process */\n exitCode: number;\n /** Standard output from the process */\n stdout: string;\n /** Standard error output from the process */\n stderr: string;\n}\n\n// ============================================================================\n// Internal Types (Tauri response shape)\n// ============================================================================\n\ninterface TauriBinaryResult {\n success: boolean;\n exit_code: number;\n stdout: string;\n stderr: string;\n}\n\n// ============================================================================\n// Functions\n// ============================================================================\n\n/**\n * Execute an external binary\n *\n * @param options - Execution options including binary path, args, and working directory\n * @returns Execution result with stdout, stderr, and exit code\n * @throws Error if binary cannot be executed\n *\n * @example\n * ```typescript\n * // Run git status\n * const result = await executeBinary({\n * binaryPath: \"git\",\n * args: [\"status\"],\n * workingDir: \"/path/to/repo\",\n * });\n *\n * if (result.success) {\n * console.log(result.stdout);\n * } else {\n * console.error(result.stderr);\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Run npm install with timeout\n * const result = await executeBinary({\n * binaryPath: \"npm\",\n * args: [\"install\"],\n * workingDir: \"/path/to/project\",\n * timeoutMs: 120000,\n * env: { NODE_ENV: \"production\" },\n * });\n * ```\n */\nexport async function executeBinary(\n options: ExecuteOptions\n): Promise<ExecuteResult> {\n const { binaryPath, args, workingDir, timeoutMs = 60000, env } = options;\n\n const result = await getTauriCore().invoke<TauriBinaryResult>(\n \"execute_binary\",\n {\n binaryPath,\n args,\n workingDir,\n timeoutMs,\n env,\n }\n );\n\n return {\n success: result.success,\n exitCode: result.exit_code,\n stdout: result.stdout,\n stderr: result.stderr,\n };\n}\n","/**\n * Cookie management for Moss plugins\n *\n * Allows plugins to store and retrieve authentication cookies\n * for external services (e.g., Matters.town, GitHub).\n *\n * Cookies are automatically scoped to the plugin's registered domain\n * (defined in manifest.json) - plugins cannot access other plugins' cookies.\n */\n\nimport { getTauriCore } from \"./tauri\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * A cookie stored for plugin authentication\n */\nexport interface Cookie {\n /** Cookie name */\n name: string;\n /** Cookie value */\n value: string;\n /** Optional domain for the cookie */\n domain?: string;\n /** Optional path for the cookie */\n path?: string;\n}\n\n/**\n * Plugin execution context - set by plugin runtime during hook execution.\n * Used for auto-detecting the calling plugin's identity.\n */\ninterface PluginContext {\n plugin_name: string;\n project_path: string;\n}\n\n// ============================================================================\n// Functions\n// ============================================================================\n\n/**\n * Get stored cookies for the current plugin.\n *\n * The plugin's identity is automatically detected from the runtime context.\n * Cookies are filtered by the domain declared in the plugin's manifest.json.\n *\n * **Must be called from within a plugin hook** (process, generate, deploy, syndicate).\n *\n * @returns Array of cookies for the plugin's registered domain\n * @throws Error if called outside of a plugin hook execution\n *\n * @example\n * ```typescript\n * // Inside a hook function:\n * const cookies = await getPluginCookie();\n * const token = cookies.find(c => c.name === \"__access_token\");\n * if (token) {\n * // Use token for authenticated requests\n * }\n * ```\n */\nexport async function getPluginCookie(): Promise<Cookie[]> {\n const context = (window as unknown as { __MOSS_CURRENT_CONTEXT__?: PluginContext }).__MOSS_CURRENT_CONTEXT__;\n\n if (!context) {\n throw new Error(\n \"getPluginCookie() must be called from within a plugin hook. \" +\n \"Ensure you're calling this from process(), generate(), deploy(), or syndicate().\"\n );\n }\n\n return getTauriCore().invoke<Cookie[]>(\"get_plugin_cookie\", {\n pluginName: context.plugin_name,\n projectPath: context.project_path,\n });\n}\n\n/**\n * Store cookies for the current plugin.\n *\n * The plugin's identity is automatically detected from the runtime context.\n *\n * **Must be called from within a plugin hook** (process, generate, deploy, syndicate).\n *\n * @param cookies - Array of cookies to store\n * @throws Error if called outside of a plugin hook execution\n *\n * @example\n * ```typescript\n * // Inside a hook function:\n * await setPluginCookie([\n * { name: \"session\", value: \"abc123\" }\n * ]);\n * ```\n */\nexport async function setPluginCookie(cookies: Cookie[]): Promise<void> {\n const context = (window as unknown as { __MOSS_CURRENT_CONTEXT__?: PluginContext }).__MOSS_CURRENT_CONTEXT__;\n\n if (!context) {\n throw new Error(\n \"setPluginCookie() must be called from within a plugin hook. \" +\n \"Ensure you're calling this from process(), generate(), deploy(), or syndicate().\"\n );\n }\n\n await getTauriCore().invoke(\"set_plugin_cookie\", {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AAM,cAAc,CAAC,OAClC,kBACA;EACE;EACA;EACA;EACA;EACD,CACF;AAED,QAAO;EACL,QAAQ,OAAO;EACf,IAAI,OAAO;EACX,aAAa,OAAO;EACpB,cAAc,OAAO;EACrB,YAAY,OAAO;EACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtFH,eAAsB,cACpB,SACwB;CACxB,MAAM,EAAE,YAAY,MAAM,YAAY,YAAY,KAAO,QAAQ;CAEjE,MAAM,SAAS,MAAM,cAAc,CAAC,OAClC,kBACA;EACE;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QAAO;EACL,SAAS,OAAO;EAChB,UAAU,OAAO;EACjB,QAAQ,OAAO;EACf,QAAQ,OAAO;EAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClDH,eAAsB,kBAAqC;CACzD,MAAM,UAAW,OAAmE;AAEpF,KAAI,CAAC,QACH,OAAM,IAAI,MACR,+IAED;AAGH,QAAO,cAAc,CAAC,OAAiB,qBAAqB;EAC1D,YAAY,QAAQ;EACpB,aAAa,QAAQ;EACtB,CAAC;;;;;;;;;;;;;;;;;;;;AAqBJ,eAAsB,gBAAgB,SAAkC;CACtE,MAAM,UAAW,OAAmE;AAEpF,KAAI,CAAC,QACH,OAAM,IAAI,MACR,+IAED;AAGH,OAAM,cAAc,CAAC,OAAO,qBAAqB;EAC/C,YAAY,QAAQ;EACpB,aAAa,QAAQ;EACrB;EACD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbiosis-lab/moss-api",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Official API for building Moss plugins - types and utilities for plugin development",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",