@xnetjs/plugins 0.5.0 → 0.6.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.ts CHANGED
@@ -563,29 +563,38 @@ interface SchemaContribution {
563
563
  schema: unknown;
564
564
  }
565
565
  /**
566
- * SurfaceDock tier (exploration 0273). `hero` panels render as the corner
567
- * launcher's one-tap strip; `secondary` panels live behind "More" and the
568
- * command palette. Same progressive-disclosure grammar as the devtools
566
+ * Slot prominence (0273, generalized in 0280). `hero` views render in
567
+ * their region's one-tap strip; `secondary` views live behind "More" and
568
+ * the command palette. Same progressive-disclosure grammar as the devtools
569
569
  * panel registry (packages/devtools/src/panels/panel-registry.ts), lifted
570
570
  * to an app-level contribution point.
571
571
  */
572
572
  type SurfaceDockTier = 'hero' | 'secondary';
573
573
  /**
574
- * A panel summoned from the quiet shell's bottom-right dock launcher
575
- * (exploration 0273). First-party residents are the workbench tray views
576
- * (Shelf, Capture, Notifications, Sync, Console); features and plugins add
577
- * their own the way they contribute rail items today.
574
+ * The shell's region skeleton a slot view may occupy (exploration 0280).
575
+ * Mirrors the app's LayoutTree regions: edge strips (`rail`, `status`)
576
+ * and the four docks. The `surface` center is not a slot target — views
577
+ * there are routes/tabs, not panels.
578
578
  */
579
- interface SurfaceDockContribution {
580
- /** Unique panel ID, preferably plugin-scoped */
579
+ type SlotRegion = 'rail' | 'status' | 'dock.left' | 'dock.right' | 'dock.bottom' | 'dock.corner';
580
+ /**
581
+ * A view contributed to the shell's slot system (exploration 0280 —
582
+ * generalizing the 0273 SurfaceDock contract to every region). Where the
583
+ * view actually sits is the user's layout tree; `defaultRegion` only says
584
+ * where it lands until the user (or their agent) moves it, and
585
+ * `allowedRegions` bounds where it may go. A plugin places only its OWN
586
+ * views; moving anyone else's is the user's (or consented agent's) call.
587
+ */
588
+ interface SlotContribution {
589
+ /** Unique view ID, preferably plugin-scoped */
581
590
  id: string;
582
- /** Display name in the launcher strip / More menu / palette */
591
+ /** Display name in strips / menus / palette */
583
592
  label: string;
584
593
  /** Lucide icon name or component */
585
594
  icon?: string | ComponentType;
586
- /** Disclosure tier: hero = launcher strip, secondary = More + palette */
595
+ /** Prominence within the region: hero = strip, secondary = More + palette */
587
596
  tier: SurfaceDockTier;
588
- /** Grouping key for the More menu (e.g. 'capture', 'activity') */
597
+ /** Grouping key for menus (e.g. 'capture', 'activity', 'tools') */
589
598
  group?: string;
590
599
  /** Extra palette search terms */
591
600
  keywords?: string[];
@@ -595,9 +604,18 @@ interface SurfaceDockContribution {
595
604
  priority?: number;
596
605
  /** Dynamic badge (e.g. unread count); null hides it */
597
606
  badge?: () => string | number | null;
598
- /** The panel body, rendered inside the dock sheet/strip */
607
+ /** The view body, rendered inside its region's host */
599
608
  component: ComponentType;
609
+ /** Where the view lands if the user hasn't placed it (default: dock.corner) */
610
+ defaultRegion?: SlotRegion;
611
+ /** Regions the view may occupy (empty/undefined = any region) */
612
+ allowedRegions?: SlotRegion[];
600
613
  }
614
+ /**
615
+ * @deprecated Since 0280 — use {@link SlotContribution}. The dock was the
616
+ * first slot region; the contract is now region-agnostic.
617
+ */
618
+ type SurfaceDockContribution = SlotContribution;
601
619
  type CanvasPreviewTier = 'summary' | 'thumbnail' | 'shell' | 'live';
602
620
  type CanvasIngestInputKind = 'url' | 'file' | 'data-transfer' | 'text' | 'node' | 'custom';
603
621
  type CanvasToolGroup = 'select' | 'create' | 'connect' | 'annotate' | 'layout' | 'custom';
@@ -763,7 +781,9 @@ declare class ContributionRegistry {
763
781
  readonly importers: TypedRegistry<ImporterContribution>;
764
782
  readonly mentionProviders: TypedRegistry<MentionProviderContribution>;
765
783
  readonly agentTools: TypedRegistry<AgentToolContribution>;
766
- readonly surfaceDock: TypedRegistry<SurfaceDockContribution>;
784
+ readonly slots: TypedRegistry<SlotContribution>;
785
+ /** @deprecated Since 0280 — the dock registry is the slot registry. */
786
+ get surfaceDock(): TypedRegistry<SlotContribution>;
767
787
  /**
768
788
  * Clear all registries (for cleanup/testing)
769
789
  */
@@ -1036,6 +1056,8 @@ interface ExtensionContext {
1036
1056
  registerMentionProvider(provider: MentionProviderContribution): Disposable$1;
1037
1057
  /** Register a model-facing agent tool (exploration 0196) */
1038
1058
  registerAgentTool(tool: AgentToolContribution): Disposable$1;
1059
+ /** Register a shell slot view (exploration 0280) */
1060
+ registerSlotView(view: SlotContribution): Disposable$1;
1039
1061
  /** Add middleware to NodeStore */
1040
1062
  addMiddleware(middleware: NodeStoreMiddleware): Disposable$1;
1041
1063
  /** Plugin-private storage */
@@ -1167,6 +1189,12 @@ interface PluginContributions {
1167
1189
  mentionProviders?: MentionProviderContribution[];
1168
1190
  /** Model-facing agent tools — what a Connector exposes (exploration 0196). */
1169
1191
  agentTools?: AgentToolContribution[];
1192
+ /**
1193
+ * Shell slot views (exploration 0280): panels the shell hosts in its
1194
+ * docks/strips. A plugin's views land at their `defaultRegion` (default:
1195
+ * the corner dock) and move with the user's layout tree thereafter.
1196
+ */
1197
+ slots?: SlotContribution[];
1170
1198
  }
1171
1199
  declare class PluginValidationError extends Error {
1172
1200
  readonly issues: string[];
@@ -1182,6 +1210,105 @@ declare function validateManifest(manifest: unknown): XNetExtension;
1182
1210
  */
1183
1211
  declare function defineExtension(manifest: XNetExtension): XNetExtension;
1184
1212
 
1213
+ /**
1214
+ * LayoutTree — the shell as data (exploration 0280).
1215
+ *
1216
+ * One tree of regions → slots → view references replaces the hard fork
1217
+ * between the calm shell and the workbench grid. The former shells become
1218
+ * *presets*: named, data-only configurations of the same tree (`quiet`,
1219
+ * `calm`, `bench`). Components never branch on which preset is loaded —
1220
+ * only on the tree's axes (chrome posture, slot tiers, tabsEnabled); the
1221
+ * source-grep tripwire in layout-tree.test.ts enforces this.
1222
+ *
1223
+ * The module is pure (no DOM, no zustand) so presets round-trip through
1224
+ * the `xnet:workspace` node payload and unit tests without a shell.
1225
+ */
1226
+
1227
+ type ChromePosture = 'pinned' | 'quiet';
1228
+ /**
1229
+ * The fixed region skeleton (the Zed/VS Code lesson: regions never
1230
+ * multiply, only their contents move). `surface` is the center and always
1231
+ * exists; the slot regions (docks + edge strips) come from the
1232
+ * contribution contract.
1233
+ */
1234
+ type RegionId = 'surface' | SlotRegion;
1235
+ declare const REGION_IDS: RegionId[];
1236
+ /**
1237
+ * Disclosure tier of a placed view: `pinned` renders in the frame at rest,
1238
+ * `summoned` is reachable from its region's launcher/chord/palette,
1239
+ * `hidden` only from the palette.
1240
+ */
1241
+ type SlotTier = 'pinned' | 'summoned' | 'hidden';
1242
+ interface SlotPlacement {
1243
+ /** Contribution id from the slot registry (e.g. 'navigator', 'shelf'). */
1244
+ viewId: string;
1245
+ tier: SlotTier;
1246
+ /** Sort key within the region (lower = earlier). */
1247
+ order: number;
1248
+ }
1249
+ interface LayoutTree {
1250
+ /** Which workspace (preset or saved node) this tree was loaded from. */
1251
+ workspaceId: string;
1252
+ regions: Record<RegionId, SlotPlacement[]>;
1253
+ /**
1254
+ * Surface capabilities. Tabs/split groups are content state and stay in
1255
+ * the workbench store; the tree only says whether the surface *shows*
1256
+ * them (the bench's tab strip vs the calm bare surface).
1257
+ */
1258
+ surface: {
1259
+ tabsEnabled: boolean;
1260
+ };
1261
+ /** Chrome posture axis (0273) — orthogonal to placements. */
1262
+ chrome: ChromePosture;
1263
+ }
1264
+ /** Built-in presets — read-only system workspaces (0280 phase 3). */
1265
+ type PresetId = 'quiet' | 'calm' | 'bench';
1266
+ declare const PRESET_IDS: PresetId[];
1267
+ /** Deterministic node ids for the seeded system workspaces. */
1268
+ declare const PRESET_WORKSPACE_ID_PREFIX = "workspace-preset-";
1269
+ declare function presetWorkspaceId(preset: PresetId): string;
1270
+ /** Whether a workspace id denotes a built-in preset (not a saved node). */
1271
+ declare function isPresetWorkspaceId(workspaceId: string): boolean;
1272
+ declare function presetForWorkspaceId(workspaceId: string): PresetId | null;
1273
+ /**
1274
+ * Build the tree for a built-in preset. Presets are data ONLY — every
1275
+ * difference between the former shells must be expressible here, or it
1276
+ * does not exist.
1277
+ */
1278
+ declare function createPresetTree(preset: PresetId): LayoutTree;
1279
+ /** The region currently holding a view, if any. */
1280
+ declare function regionOf(tree: LayoutTree, viewId: string): RegionId | null;
1281
+ /** The placement record for a view, if any. */
1282
+ declare function placementOf(tree: LayoutTree, viewId: string): SlotPlacement | null;
1283
+ /**
1284
+ * Move a view to another region (appended last), keeping its tier.
1285
+ * No-op when the view is absent or already there.
1286
+ */
1287
+ declare function moveSlot(tree: LayoutTree, viewId: string, to: RegionId): LayoutTree;
1288
+ /** Change a placed view's disclosure tier. No-op when absent/unchanged. */
1289
+ declare function setSlotTier(tree: LayoutTree, viewId: string, tier: SlotTier): LayoutTree;
1290
+ /** Placements of a region, sorted, optionally filtered to a tier. */
1291
+ declare function slotsIn(tree: LayoutTree, region: RegionId, tier?: SlotTier): SlotPlacement[];
1292
+ /**
1293
+ * Portable workspace payload: the tree plus a human name. Device-local
1294
+ * state (pixel sizes, monitor splits) deliberately stays OUT of the node —
1295
+ * it lives in the local store keyed by workspaceId.
1296
+ */
1297
+ interface WorkspacePayload {
1298
+ name: string;
1299
+ /** Preset provenance, for "Reset to preset". Null = built from scratch. */
1300
+ preset: PresetId | null;
1301
+ tree: LayoutTree;
1302
+ }
1303
+ /**
1304
+ * Parse an untrusted payload (a synced node) back into a tree. Unknown
1305
+ * regions are dropped, missing regions become empty, malformed placements
1306
+ * are skipped — a shared workspace must never crash the shell.
1307
+ */
1308
+ declare function parseWorkspacePayload(value: unknown): WorkspacePayload | null;
1309
+ /** Serialize for the node payload. Inverse of {@link parseWorkspacePayload}. */
1310
+ declare function serializeWorkspacePayload(payload: WorkspacePayload): WorkspacePayload;
1311
+
1185
1312
  /**
1186
1313
  * @xnetjs/plugins — importer resolution (exploration 0189).
1187
1314
  *
@@ -2284,6 +2411,13 @@ declare function runConnectorSync(def: ConnectorDefinition, ports: RunConnectorS
2284
2411
  * renders on top of this; the view itself is app-side.
2285
2412
  */
2286
2413
 
2414
+ /**
2415
+ * What a marketplace listing distributes (exploration 0280). `plugin` is
2416
+ * the default (code, install-gated); `workspace` is a shared bench — a
2417
+ * `xnet:Workspace` node payload, pure data: importing one never runs code,
2418
+ * so it needs no sandbox tier, only the normal node import path.
2419
+ */
2420
+ type MarketplaceListingKind = 'plugin' | 'workspace';
2287
2421
  /** A single entry in the marketplace index (`registry.json`). */
2288
2422
  interface MarketplaceEntry {
2289
2423
  id: string;
@@ -2291,6 +2425,8 @@ interface MarketplaceEntry {
2291
2425
  description: string;
2292
2426
  version: string;
2293
2427
  author: string;
2428
+ /** Listing kind (default `plugin`). `workspace` = a shared bench (0280). */
2429
+ kind?: MarketplaceListingKind;
2294
2430
  /** Search keywords / tags. */
2295
2431
  keywords?: string[];
2296
2432
  /** Coarse category for filtering (`productivity`, `finance`, `social`, …). */
@@ -2299,6 +2435,11 @@ interface MarketplaceEntry {
2299
2435
  capabilities?: ModuleCapabilities;
2300
2436
  /** URL the full manifest is fetched from at install. */
2301
2437
  manifestUrl: string;
2438
+ /**
2439
+ * For `kind: 'workspace'` listings: URL of the workspace payload JSON
2440
+ * (the portable tree — parsed by `parseWorkspacePayload` on import).
2441
+ */
2442
+ workspaceUrl?: string;
2302
2443
  /** Lifetime install count (trust signal). */
2303
2444
  installs?: number;
2304
2445
  /** GitHub stars / community signal. */
@@ -3430,7 +3571,7 @@ declare function createTestPluginHarness(options?: TestHarnessOptions): TestPlug
3430
3571
  * (0196 — sync an external service into governed nodes + expose agent tools).
3431
3572
  */
3432
3573
 
3433
- type ScaffoldTemplate = 'client' | 'two-sided' | 'ai-script' | 'connector';
3574
+ type ScaffoldTemplate = 'client' | 'two-sided' | 'ai-script' | 'connector' | 'slot-view';
3434
3575
  interface ScaffoldSpec {
3435
3576
  /** Reverse-domain plugin id, e.g. `com.acme.kanban`. */
3436
3577
  id: string;
@@ -5892,4 +6033,4 @@ declare function leaveWithEverything(ports: RightToLeavePorts, opts: {
5892
6033
  */
5893
6034
  declare function deleteDay(ports: RightToLeavePorts, opts: DeleteDayOptions): Promise<DeleteDayResult>;
5894
6035
 
5895
- export { type AIComplexityLevel, type AICostModel, type AIGenerateRequest, type AIGenerateResponse, AIGenerationError, type AIMessage, type AIMessageRole, type AIModelCapabilities, type AIModelQuality, type AIPrivacyLevel, type AIProvider, type AIProviderConfig, type AIProviderOptions, AIProviderRouter, type AIProviderRouterOptions, type AIProviderType, type AIProviderUsage, AIRTABLE_CONNECTOR_ID, type AIRiskLevel, type AIScriptRequest, type AIScriptResponse, type AIStreamChunk, type AIToolCall, type AIToolSpec, type AIUsage, AI_GENERATED_PROVENANCE, AI_RISK_LEVELS, AI_SCOPES, AI_TARGET_KINDS, ALLOWED_PLUGIN_LICENSES, type ActionContext, type ActionDefinition, ActionDefinitionError, ActionDispatchError, type ActionEvent, ActionSsrfError, type ActionTrigger, type AgentToolContribution, type AgentToolInputSchema, type AiAgentApproval, type AiAgentApprovalRequestInput, type AiAgentApprovalResolveInput, type AiAgentApprovalStatus, type AiAgentBackgroundJob, type AiAgentBackgroundJobInput, type AiAgentBackgroundJobRunner, type AiAgentBackgroundJobStatus, type AiAgentDisplayState, type AiAgentDisplayStateKind, type AiAgentEvent, type AiAgentEventType, type AiAgentOrchestratorMode, type AiAgentRunSelectionTurnInput, type AiAgentRunTurnInput, type AiAgentRunTurnResult, AiAgentRuntime, type AiAgentRuntimeConfig, type AiAgentRuntimeListener, type AiAgentRuntimeSnapshot, type AiAgentRuntimeStorage, type AiAgentSelectionContext, type AiAgentSelectionKind, type AiAgentTelemetrySnapshot, type AiAgentThread, type AiAgentThreadCreateInput, type AiAgentThreadStatus, type AiAgentTurn, type AiAgentTurnRole, type AiAgentTurnStatus, type AiAssistMode, type AiAuditEvent, type AiAuthoredPlugin, AiAuthoringError, AiBudgetError, type AiCallableTool, type AiChangeSet, type AiCommandExposure, type AiContextPack, type AiContextPackResource, type AiContextRetriever, type AiContextSeed, type AiDatabaseMutationApplyResult, type AiExtraTool, type AiJsonSchema, type AiJsonSchemaType, type AiMutationPlan, type AiMutationPlanStatus, type AiOperation, type AiPageMarkdownApplyAdapter, type AiPageMarkdownApplyAdapterInput, type AiPageMarkdownApplyAdapterResult, type AiPageMarkdownApplyResult, type AiPageMarkdownRollbackResult, type AiPluginPipelineInput, type AiPluginPipelinePorts, type AiPluginPipelineResult, type AiResource, type AiResourceContent, type AiRetrievedNode, type AiRiskLevel, type AiScope, type AiSearchOptions, type AiSearchResult, type AiSurfaceLimits, AiSurfaceService, type AiSurfaceServiceConfig, type AiTargetKind, type AiToolCallResult, type AiToolDefinition, type AiValidationResult, type AirtableConnectorOptions, type AllowedPluginLicense, AnthropicProvider, type ArrayHelpers, type BlockContribution, type BlockProps, CANVAS_PLUGIN_FIXTURES, CHANNEL_SCHEMA, CHAT_MESSAGE_SCHEMA, CONNECTOR_CATEGORY, CONNECTOR_META, CRM_CANVAS_PLUGIN_FIXTURE, type CanvasCardContribution, type CanvasContribution, type CanvasContributionBase, type CanvasContributionPermission, type CanvasEdgeContribution, type CanvasErpPrototypeAuditEntry, type CanvasErpPrototypeAuditOperation, type CanvasErpPrototypeAuditSource, type CanvasErpPrototypeCard, type CanvasErpPrototypeCommand, type CanvasErpPrototypeEdge, type CanvasErpPrototypeEntityKind, type CanvasErpPrototypeLayoutKind, type CanvasErpPrototypeQueryFrame, type CanvasErpPrototypeQueryPredicate, type CanvasErpPrototypeRect, type CanvasErpPrototypeRisk, type CanvasErpPrototypeRiskSummary, type CanvasErpPrototypeScenario, type CanvasErpPrototypeStatus, type CanvasIngestInputKind, type CanvasIngestorContribution, type CanvasInspectorContribution, type CanvasInspectorPlacement, type CanvasLayoutContribution, type CanvasLayoutScope, type CanvasPluginFixture, type CanvasPluginFixtureCardSample, type CanvasPluginFixtureKind, type CanvasPluginPermissionDecisionStatus, type CanvasPluginPermissionGateDecision, type CanvasPluginPermissionGateInput, type CanvasPluginPermissionPrompt, type CanvasPluginPermissionPromptOption, type CanvasPluginPromptMode, type CanvasPluginSandboxDecision, type CanvasPluginSandboxDomAccess, type CanvasPluginSandboxKind, type CanvasPluginSandboxMutationAccess, type CanvasPluginSandboxNetworkAccess, type CanvasPluginSandboxOutput, type CanvasPluginSandboxOutputKind, type CanvasPluginSandboxOutputValidation, type CanvasPluginSandboxPolicy, type CanvasPluginSandboxRequest, type CanvasPluginWorkspacePolicy, type CanvasPreviewTier, type CanvasRendererSandboxContribution, type CanvasTemplateCategory, type CanvasTemplateContribution, type CanvasToolContribution, type CanvasToolGroup, CapabilityError, type CommandContext, type CommandContribution, CommandRegistry, type CommandScope, type ConnectorArtifacts, type ConnectorCadence, type ConnectorDefinition, ConnectorDefinitionError, type ConnectorDetection, type ConnectorEnv, type ConnectorFetch, type ConnectorInstallGate, type ConnectorStore, type ConnectorSyncContext, ConnectorSyncError, type ConnectorSyncResult, type ConnectorSyncSpec, type ConnectorTier, type ConnectorToolDescriptor, type ConsentDecision, type ConsentLine, ContributionRegistry, DEFAULT_PLUGIN_LICENSE, type DefinedAction, type DefinedConnector, type DeleteDayOptions, type DeleteDayResult, type DeliveryResult, DependencyCycleError, type DependencyNode, type Disposable$1 as Disposable, ERP_CANVAS_PLUGIN_FIXTURE, EXTERNAL_ITEM_SCHEMA, type EditorContribution, type EditorSchemaRisk, type EmailActionOptions, type ExtensionContext, type ExtensionStorage, FEED_ITEM_SCHEMA, type FeatureModule, type FeedEntry, type FetchJson, type FetchLike, type FlatNode, type FormatHelpers, GITHUB_CONNECTOR_ID, GOOGLE_CALENDAR_CONNECTOR_ID, type GeneratedScript, type GithubConnectorOptions, type GuardableConnectorStore, type IProcessManager, type ImporterContribution, type InstallOptions, LEAVE_README, LINEAR_CONNECTOR_ID, type LabRunOutcome, type LadderRuntimeTier, type LanguageModelLike, type LanguageModelMonitor, type LanguageModelSessionLike, type LeaveBundle, type LicenseCheckResult, LicenseRequiredError, type LinearConnectorOptions, type LocalAPIConfig, type LocalAPITokenConfig, type LocalAPITokenScope, type LocalAPITokenSummary, type LocalServerProbe, MARKETPLACE_PROVENANCE, type MCPPropertySchema, type MCPRequest, type MCPResource, type MCPResponse, type MCPServerConfig, type MCPTool, MEDIA_PROVIDER_CANVAS_PLUGIN_FIXTURE, type ManagedBudgetSnapshot, ManagedProvider, type ManagedProviderOptions, MarketplaceClient, type MarketplaceClientOptions, type MarketplaceEntry, type MarketplaceSort, type MathHelpers, type MentionProviderContribution, type MentionSuggestion, MiddlewareChain, type MissingDependency, type ModuleCapabilities, NOTION_CONNECTOR_ID, type NodeChangeEvent, type NodeChangeEventData, type NodeData, type NodeStoreAPI, type NodeStoreMiddleware, type NotionConnectorOptions, OllamaProvider, OpenAICompatibleProvider, type OpenAICompatibleProviderOptions, OpenAIProvider, type PendingChange, type Platform, type PlatformCapabilities, type PluginContributions, PluginError, type PluginNode, type PluginNodeChangeEvent, type PluginNodeChangeListener, type PluginPermissions, type PluginPricing, type PluginRating, PluginRegistry, type PluginRunInput, type PluginRunResult, PluginRuntimeError, type PluginRuntimeLadder, PluginSchema, type PluginStatus, PluginValidationError, type ProcessManagerEvents, type PromptApiAvailability, PromptApiProvider, type PromptApiProviderOptions, type PropertyCellProps, type PropertyEditorProps, type PropertyHandler, type PropertyHandlerContribution, type Provenance, type ProvenanceResult, type ProvenanceVerifier, type QueryFilter, RSS_CONNECTOR_ID, type RatingSummary, type RecommendOptions, type RegisteredPlugin, type ResolveMentionOptions, type RightToLeavePorts, type RssConnectorOptions, type RunActionPorts, type RunConnectorSyncPorts, type RunPluginCodeInput, SCAFFOLD_SYSTEM_GUARD, SERVICE_IPC_CHANNELS, SLACK_CONNECTOR_ID, type SandboxOptions, ScaffoldError, type ScaffoldResult, type ScaffoldSpec, type ScaffoldTemplate, type SchemaContribution, type SchemaData, type SchemaDefinition, type SchemaProperty, type SchemaRegistryAPI, type ScriptContext, ScriptError, type ScriptExecutionResult, type ScriptExecutor, ScriptGenerationError, ScriptGenerator, type ScriptGeneratorOptions, type ScriptNode, type ScriptNodeChangeEvent, type ScriptOutputType, ScriptRunner, type ScriptRunnerOptions, ScriptSandbox, ScriptSchema, type ScriptStore, ScriptTimeoutError, type ScriptToManifestInput, type ScriptTriggerType, ScriptValidationError, type SemVer, type ServiceClient, type ServiceCommunication, type ServiceDefinition, type ServiceHealthCheck, type ServiceLifecycle, type ServiceOutputEvent, type ServiceProcessConfig, type ServiceProvides, type ServiceState, type ServiceStatus, type ServiceStatusEvent, type SettingContribution, type SettingsPanelProps, ShortcutManager, type SidebarContribution, type SlackConnectorOptions, type SlashCommandContext, type SlashCommandContribution, type StatusBarContribution, type SurfaceDockContribution, type SurfaceDockTier, type TelemetryReporter, type TestHarnessOptions, type TestNodeStore, type TestPluginHarness, type TextHelpers, type ToolCallingFidelity, type ToolbarContribution, TypedRegistry, type UsageSignal, type ValidationResult, type VerifyProvenanceInput, type ViewContribution, type ViewProps, type WebLLMEngineLike, WebLLMProvider, type WebLLMProviderOptions, type WebhookConfig, WebhookEmitter, type WebhookOutOptions, type WebhookPayload, type WidgetContribution, type WidgetContributionConfigField, type WidgetContributionProps, type WorkspaceCommand, type WrapCliConnectorOptions, type WriteMode, XNET_MARKDOWN_DIRECTIVE_SPECS, type XNetExtension, type XNetMarkdownDiffLine, type XNetMarkdownDiffLineKind, type XNetMarkdownDirective, type XNetMarkdownDirectiveSpec, type XNetMarkdownReviewDiff, type XNetPageMarkdownFrontmatter, type XNetPageMarkdownValidation, type XNetPageMarkdownValidationOptions, agentToolToExtraTool, agentToolsAsExtraTools, aggregateRatings, assertNetwork, assertPublicUrl, assertSchemaWrite, assertSystemAudio, assistTurnProvenance, attachAiPlanValidation, buildAirtableConnector, buildDiscordAction, buildEmailAction, buildGithubConnector, buildGoogleCalendarConnector, buildLinearConnector, buildNotionConnector, buildRetryPrompt, buildRssConnector, buildScriptPrompt, buildSlackConnector, buildSlackWebhookAction, buildTelegramAction, buildWebhookOutAction, classifyAiAgentDisplayState, compareVersions, composeAssistSystemPrompt, connectorAsImporter, connectorMarketplaceEntry, contributionsAsAiTools, createAIProvider, createAIProviderRouter, createAiAgentRuntime, createAiChangeSet, createAiOperation, createAiSurfaceService, createAiValidationResult, createCanvasErpPrototypeRiskSummary, createCanvasErpPrototypeScenario, createCanvasPluginFixtureCards, createCanvasPluginFixtureManifests, createCanvasPluginPermissionPrompt, createCanvasPluginSandboxPolicy, createCanvasPreviewSandboxRequest, createCanvasRendererSandboxRequest, createExtensionContext, createExtensionStorage, createManagedProvider, createMemoryAiAgentRuntimeStorage, createPromptApiProvider, createScriptContext, createServiceClient, createTestNodeStore, createTestPluginHarness, createWebLLMProvider, createWebhookEmitter, defaultLocalServerProbes, defineAction, defineConnector, defineExtension, defineFeatureModule, deleteDay, describeCapabilities, detectConnectors, detectUpcomingMeeting, downloadPromptApiModel, emitConnectorArtifacts, evaluateCanvasPluginPermissionGate, evaluateCanvasPluginSandboxRequest, evaluateConnectorInstall, evaluateInstallConsent, executeScript, failClosedVerifier, filterByCategory, findEditorSchemaRisks, findMissingDependencies, generateScript, getCanvasErpPrototypeAuditEntriesForCard, getCanvasErpPrototypeCardsForFrame, getCanvasPluginFixture, getCommandRegistry, getPlatformCapabilities, getShortcutManager, getXNetMarkdownDirectiveSpecs, guardStore, guardedActionFetch, guardedFetch, hasUpdate, importerAdapters, installCommandHandler, installShortcutHandler, isAiRiskLevel, isAiScope, isAiTargetKind, isAllowedPluginLicense, isHostCompatible, isNetworkAllowed, isOllamaAvailable, isPaidPricing, isSchemaDefiningExtension, isSchemaReadAllowed, isSchemaWriteAllowed, isScriptNode, isServiceClientAvailable, isSystemAudioAllowed, ladderTierForTrust, leaveWithEverything, listOllamaModels, matchSchemaIri, normalizeCanvasPluginWorkspacePolicy, packageName, parseAiMutationPlan, parseFeed, parseVersion, parseXNetPageFrontmatter, pascalCase, pickBestConnector, pluginLicenseText, probeOpenAiCompatible, promptApiAvailability, quickSafetyCheck, recommendExtensions, renderEvent, renderMarkdownLineDiff, renderMarkdownReviewDiff, renderSelectionPrompt, resolveImporters, resolveInstallOrder, resolveMentionProviders, runAction, runAiPluginPipeline, runConnectorSync, runPluginCode, satisfiesRange, scaffoldPlugin, scriptToPluginManifest, searchMarketplace, serializeAiMutationPlan, shortSchemaName, shouldDispatch, sortMarketplace, stripXNetPageFrontmatter, summarizeProvenance, validateAiMutationPlan, validateCanvasPluginSandboxOutput, validateManifest, validateScript, validateScriptAST, validateXNetPageMarkdown, verifyProvenance, warnOnEditorSchemaRisks, wrapCliConnector, writeModeFor };
6036
+ export { type AIComplexityLevel, type AICostModel, type AIGenerateRequest, type AIGenerateResponse, AIGenerationError, type AIMessage, type AIMessageRole, type AIModelCapabilities, type AIModelQuality, type AIPrivacyLevel, type AIProvider, type AIProviderConfig, type AIProviderOptions, AIProviderRouter, type AIProviderRouterOptions, type AIProviderType, type AIProviderUsage, AIRTABLE_CONNECTOR_ID, type AIRiskLevel, type AIScriptRequest, type AIScriptResponse, type AIStreamChunk, type AIToolCall, type AIToolSpec, type AIUsage, AI_GENERATED_PROVENANCE, AI_RISK_LEVELS, AI_SCOPES, AI_TARGET_KINDS, ALLOWED_PLUGIN_LICENSES, type ActionContext, type ActionDefinition, ActionDefinitionError, ActionDispatchError, type ActionEvent, ActionSsrfError, type ActionTrigger, type AgentToolContribution, type AgentToolInputSchema, type AiAgentApproval, type AiAgentApprovalRequestInput, type AiAgentApprovalResolveInput, type AiAgentApprovalStatus, type AiAgentBackgroundJob, type AiAgentBackgroundJobInput, type AiAgentBackgroundJobRunner, type AiAgentBackgroundJobStatus, type AiAgentDisplayState, type AiAgentDisplayStateKind, type AiAgentEvent, type AiAgentEventType, type AiAgentOrchestratorMode, type AiAgentRunSelectionTurnInput, type AiAgentRunTurnInput, type AiAgentRunTurnResult, AiAgentRuntime, type AiAgentRuntimeConfig, type AiAgentRuntimeListener, type AiAgentRuntimeSnapshot, type AiAgentRuntimeStorage, type AiAgentSelectionContext, type AiAgentSelectionKind, type AiAgentTelemetrySnapshot, type AiAgentThread, type AiAgentThreadCreateInput, type AiAgentThreadStatus, type AiAgentTurn, type AiAgentTurnRole, type AiAgentTurnStatus, type AiAssistMode, type AiAuditEvent, type AiAuthoredPlugin, AiAuthoringError, AiBudgetError, type AiCallableTool, type AiChangeSet, type AiCommandExposure, type AiContextPack, type AiContextPackResource, type AiContextRetriever, type AiContextSeed, type AiDatabaseMutationApplyResult, type AiExtraTool, type AiJsonSchema, type AiJsonSchemaType, type AiMutationPlan, type AiMutationPlanStatus, type AiOperation, type AiPageMarkdownApplyAdapter, type AiPageMarkdownApplyAdapterInput, type AiPageMarkdownApplyAdapterResult, type AiPageMarkdownApplyResult, type AiPageMarkdownRollbackResult, type AiPluginPipelineInput, type AiPluginPipelinePorts, type AiPluginPipelineResult, type AiResource, type AiResourceContent, type AiRetrievedNode, type AiRiskLevel, type AiScope, type AiSearchOptions, type AiSearchResult, type AiSurfaceLimits, AiSurfaceService, type AiSurfaceServiceConfig, type AiTargetKind, type AiToolCallResult, type AiToolDefinition, type AiValidationResult, type AirtableConnectorOptions, type AllowedPluginLicense, AnthropicProvider, type ArrayHelpers, type BlockContribution, type BlockProps, CANVAS_PLUGIN_FIXTURES, CHANNEL_SCHEMA, CHAT_MESSAGE_SCHEMA, CONNECTOR_CATEGORY, CONNECTOR_META, CRM_CANVAS_PLUGIN_FIXTURE, type CanvasCardContribution, type CanvasContribution, type CanvasContributionBase, type CanvasContributionPermission, type CanvasEdgeContribution, type CanvasErpPrototypeAuditEntry, type CanvasErpPrototypeAuditOperation, type CanvasErpPrototypeAuditSource, type CanvasErpPrototypeCard, type CanvasErpPrototypeCommand, type CanvasErpPrototypeEdge, type CanvasErpPrototypeEntityKind, type CanvasErpPrototypeLayoutKind, type CanvasErpPrototypeQueryFrame, type CanvasErpPrototypeQueryPredicate, type CanvasErpPrototypeRect, type CanvasErpPrototypeRisk, type CanvasErpPrototypeRiskSummary, type CanvasErpPrototypeScenario, type CanvasErpPrototypeStatus, type CanvasIngestInputKind, type CanvasIngestorContribution, type CanvasInspectorContribution, type CanvasInspectorPlacement, type CanvasLayoutContribution, type CanvasLayoutScope, type CanvasPluginFixture, type CanvasPluginFixtureCardSample, type CanvasPluginFixtureKind, type CanvasPluginPermissionDecisionStatus, type CanvasPluginPermissionGateDecision, type CanvasPluginPermissionGateInput, type CanvasPluginPermissionPrompt, type CanvasPluginPermissionPromptOption, type CanvasPluginPromptMode, type CanvasPluginSandboxDecision, type CanvasPluginSandboxDomAccess, type CanvasPluginSandboxKind, type CanvasPluginSandboxMutationAccess, type CanvasPluginSandboxNetworkAccess, type CanvasPluginSandboxOutput, type CanvasPluginSandboxOutputKind, type CanvasPluginSandboxOutputValidation, type CanvasPluginSandboxPolicy, type CanvasPluginSandboxRequest, type CanvasPluginWorkspacePolicy, type CanvasPreviewTier, type CanvasRendererSandboxContribution, type CanvasTemplateCategory, type CanvasTemplateContribution, type CanvasToolContribution, type CanvasToolGroup, CapabilityError, type ChromePosture, type CommandContext, type CommandContribution, CommandRegistry, type CommandScope, type ConnectorArtifacts, type ConnectorCadence, type ConnectorDefinition, ConnectorDefinitionError, type ConnectorDetection, type ConnectorEnv, type ConnectorFetch, type ConnectorInstallGate, type ConnectorStore, type ConnectorSyncContext, ConnectorSyncError, type ConnectorSyncResult, type ConnectorSyncSpec, type ConnectorTier, type ConnectorToolDescriptor, type ConsentDecision, type ConsentLine, ContributionRegistry, DEFAULT_PLUGIN_LICENSE, type DefinedAction, type DefinedConnector, type DeleteDayOptions, type DeleteDayResult, type DeliveryResult, DependencyCycleError, type DependencyNode, type Disposable$1 as Disposable, ERP_CANVAS_PLUGIN_FIXTURE, EXTERNAL_ITEM_SCHEMA, type EditorContribution, type EditorSchemaRisk, type EmailActionOptions, type ExtensionContext, type ExtensionStorage, FEED_ITEM_SCHEMA, type FeatureModule, type FeedEntry, type FetchJson, type FetchLike, type FlatNode, type FormatHelpers, GITHUB_CONNECTOR_ID, GOOGLE_CALENDAR_CONNECTOR_ID, type GeneratedScript, type GithubConnectorOptions, type GuardableConnectorStore, type IProcessManager, type ImporterContribution, type InstallOptions, LEAVE_README, LINEAR_CONNECTOR_ID, type LabRunOutcome, type LadderRuntimeTier, type LanguageModelLike, type LanguageModelMonitor, type LanguageModelSessionLike, type LayoutTree, type LeaveBundle, type LicenseCheckResult, LicenseRequiredError, type LinearConnectorOptions, type LocalAPIConfig, type LocalAPITokenConfig, type LocalAPITokenScope, type LocalAPITokenSummary, type LocalServerProbe, MARKETPLACE_PROVENANCE, type MCPPropertySchema, type MCPRequest, type MCPResource, type MCPResponse, type MCPServerConfig, type MCPTool, MEDIA_PROVIDER_CANVAS_PLUGIN_FIXTURE, type ManagedBudgetSnapshot, ManagedProvider, type ManagedProviderOptions, MarketplaceClient, type MarketplaceClientOptions, type MarketplaceEntry, type MarketplaceSort, type MathHelpers, type MentionProviderContribution, type MentionSuggestion, MiddlewareChain, type MissingDependency, type ModuleCapabilities, NOTION_CONNECTOR_ID, type NodeChangeEvent, type NodeChangeEventData, type NodeData, type NodeStoreAPI, type NodeStoreMiddleware, type NotionConnectorOptions, OllamaProvider, OpenAICompatibleProvider, type OpenAICompatibleProviderOptions, OpenAIProvider, PRESET_IDS, PRESET_WORKSPACE_ID_PREFIX, type PendingChange, type Platform, type PlatformCapabilities, type PluginContributions, PluginError, type PluginNode, type PluginNodeChangeEvent, type PluginNodeChangeListener, type PluginPermissions, type PluginPricing, type PluginRating, PluginRegistry, type PluginRunInput, type PluginRunResult, PluginRuntimeError, type PluginRuntimeLadder, PluginSchema, type PluginStatus, PluginValidationError, type PresetId, type ProcessManagerEvents, type PromptApiAvailability, PromptApiProvider, type PromptApiProviderOptions, type PropertyCellProps, type PropertyEditorProps, type PropertyHandler, type PropertyHandlerContribution, type Provenance, type ProvenanceResult, type ProvenanceVerifier, type QueryFilter, REGION_IDS, RSS_CONNECTOR_ID, type RatingSummary, type RecommendOptions, type RegionId, type RegisteredPlugin, type ResolveMentionOptions, type RightToLeavePorts, type RssConnectorOptions, type RunActionPorts, type RunConnectorSyncPorts, type RunPluginCodeInput, SCAFFOLD_SYSTEM_GUARD, SERVICE_IPC_CHANNELS, SLACK_CONNECTOR_ID, type SandboxOptions, ScaffoldError, type ScaffoldResult, type ScaffoldSpec, type ScaffoldTemplate, type SchemaContribution, type SchemaData, type SchemaDefinition, type SchemaProperty, type SchemaRegistryAPI, type ScriptContext, ScriptError, type ScriptExecutionResult, type ScriptExecutor, ScriptGenerationError, ScriptGenerator, type ScriptGeneratorOptions, type ScriptNode, type ScriptNodeChangeEvent, type ScriptOutputType, ScriptRunner, type ScriptRunnerOptions, ScriptSandbox, ScriptSchema, type ScriptStore, ScriptTimeoutError, type ScriptToManifestInput, type ScriptTriggerType, ScriptValidationError, type SemVer, type ServiceClient, type ServiceCommunication, type ServiceDefinition, type ServiceHealthCheck, type ServiceLifecycle, type ServiceOutputEvent, type ServiceProcessConfig, type ServiceProvides, type ServiceState, type ServiceStatus, type ServiceStatusEvent, type SettingContribution, type SettingsPanelProps, ShortcutManager, type SidebarContribution, type SlackConnectorOptions, type SlashCommandContext, type SlashCommandContribution, type SlotContribution, type SlotPlacement, type SlotRegion, type SlotTier, type StatusBarContribution, type SurfaceDockContribution, type SurfaceDockTier, type TelemetryReporter, type TestHarnessOptions, type TestNodeStore, type TestPluginHarness, type TextHelpers, type ToolCallingFidelity, type ToolbarContribution, TypedRegistry, type UsageSignal, type ValidationResult, type VerifyProvenanceInput, type ViewContribution, type ViewProps, type WebLLMEngineLike, WebLLMProvider, type WebLLMProviderOptions, type WebhookConfig, WebhookEmitter, type WebhookOutOptions, type WebhookPayload, type WidgetContribution, type WidgetContributionConfigField, type WidgetContributionProps, type WorkspaceCommand, type WorkspacePayload, type WrapCliConnectorOptions, type WriteMode, XNET_MARKDOWN_DIRECTIVE_SPECS, type XNetExtension, type XNetMarkdownDiffLine, type XNetMarkdownDiffLineKind, type XNetMarkdownDirective, type XNetMarkdownDirectiveSpec, type XNetMarkdownReviewDiff, type XNetPageMarkdownFrontmatter, type XNetPageMarkdownValidation, type XNetPageMarkdownValidationOptions, agentToolToExtraTool, agentToolsAsExtraTools, aggregateRatings, assertNetwork, assertPublicUrl, assertSchemaWrite, assertSystemAudio, assistTurnProvenance, attachAiPlanValidation, buildAirtableConnector, buildDiscordAction, buildEmailAction, buildGithubConnector, buildGoogleCalendarConnector, buildLinearConnector, buildNotionConnector, buildRetryPrompt, buildRssConnector, buildScriptPrompt, buildSlackConnector, buildSlackWebhookAction, buildTelegramAction, buildWebhookOutAction, classifyAiAgentDisplayState, compareVersions, composeAssistSystemPrompt, connectorAsImporter, connectorMarketplaceEntry, contributionsAsAiTools, createAIProvider, createAIProviderRouter, createAiAgentRuntime, createAiChangeSet, createAiOperation, createAiSurfaceService, createAiValidationResult, createCanvasErpPrototypeRiskSummary, createCanvasErpPrototypeScenario, createCanvasPluginFixtureCards, createCanvasPluginFixtureManifests, createCanvasPluginPermissionPrompt, createCanvasPluginSandboxPolicy, createCanvasPreviewSandboxRequest, createCanvasRendererSandboxRequest, createExtensionContext, createExtensionStorage, createManagedProvider, createMemoryAiAgentRuntimeStorage, createPresetTree, createPromptApiProvider, createScriptContext, createServiceClient, createTestNodeStore, createTestPluginHarness, createWebLLMProvider, createWebhookEmitter, defaultLocalServerProbes, defineAction, defineConnector, defineExtension, defineFeatureModule, deleteDay, describeCapabilities, detectConnectors, detectUpcomingMeeting, downloadPromptApiModel, emitConnectorArtifacts, evaluateCanvasPluginPermissionGate, evaluateCanvasPluginSandboxRequest, evaluateConnectorInstall, evaluateInstallConsent, executeScript, failClosedVerifier, filterByCategory, findEditorSchemaRisks, findMissingDependencies, generateScript, getCanvasErpPrototypeAuditEntriesForCard, getCanvasErpPrototypeCardsForFrame, getCanvasPluginFixture, getCommandRegistry, getPlatformCapabilities, getShortcutManager, getXNetMarkdownDirectiveSpecs, guardStore, guardedActionFetch, guardedFetch, hasUpdate, importerAdapters, installCommandHandler, installShortcutHandler, isAiRiskLevel, isAiScope, isAiTargetKind, isAllowedPluginLicense, isHostCompatible, isNetworkAllowed, isOllamaAvailable, isPaidPricing, isPresetWorkspaceId, isSchemaDefiningExtension, isSchemaReadAllowed, isSchemaWriteAllowed, isScriptNode, isServiceClientAvailable, isSystemAudioAllowed, ladderTierForTrust, leaveWithEverything, listOllamaModels, matchSchemaIri, moveSlot, normalizeCanvasPluginWorkspacePolicy, packageName, parseAiMutationPlan, parseFeed, parseVersion, parseWorkspacePayload, parseXNetPageFrontmatter, pascalCase, pickBestConnector, placementOf, pluginLicenseText, presetForWorkspaceId, presetWorkspaceId, probeOpenAiCompatible, promptApiAvailability, quickSafetyCheck, recommendExtensions, regionOf, renderEvent, renderMarkdownLineDiff, renderMarkdownReviewDiff, renderSelectionPrompt, resolveImporters, resolveInstallOrder, resolveMentionProviders, runAction, runAiPluginPipeline, runConnectorSync, runPluginCode, satisfiesRange, scaffoldPlugin, scriptToPluginManifest, searchMarketplace, serializeAiMutationPlan, serializeWorkspacePayload, setSlotTier, shortSchemaName, shouldDispatch, slotsIn, sortMarketplace, stripXNetPageFrontmatter, summarizeProvenance, validateAiMutationPlan, validateCanvasPluginSandboxOutput, validateManifest, validateScript, validateScriptAST, validateXNetPageMarkdown, verifyProvenance, warnOnEditorSchemaRisks, wrapCliConnector, writeModeFor };
package/dist/index.js CHANGED
@@ -516,7 +516,11 @@ var ContributionRegistry = class {
516
516
  importers = new TypedRegistry();
517
517
  mentionProviders = new TypedRegistry();
518
518
  agentTools = new TypedRegistry();
519
- surfaceDock = new TypedRegistry();
519
+ slots = new TypedRegistry();
520
+ /** @deprecated Since 0280 — the dock registry is the slot registry. */
521
+ get surfaceDock() {
522
+ return this.slots;
523
+ }
520
524
  /**
521
525
  * Clear all registries (for cleanup/testing)
522
526
  */
@@ -541,10 +545,201 @@ var ContributionRegistry = class {
541
545
  this.importers.clear();
542
546
  this.mentionProviders.clear();
543
547
  this.agentTools.clear();
544
- this.surfaceDock.clear();
548
+ this.slots.clear();
545
549
  }
546
550
  };
547
551
 
552
+ // src/workspace/layout-tree.ts
553
+ var REGION_IDS = [
554
+ "surface",
555
+ "rail",
556
+ "status",
557
+ "dock.left",
558
+ "dock.right",
559
+ "dock.bottom",
560
+ "dock.corner"
561
+ ];
562
+ var PRESET_IDS = ["quiet", "calm", "bench"];
563
+ var PRESET_WORKSPACE_ID_PREFIX = "workspace-preset-";
564
+ function presetWorkspaceId(preset) {
565
+ return `${PRESET_WORKSPACE_ID_PREFIX}${preset}`;
566
+ }
567
+ function isPresetWorkspaceId(workspaceId) {
568
+ return presetForWorkspaceId(workspaceId) !== null;
569
+ }
570
+ function presetForWorkspaceId(workspaceId) {
571
+ if (!workspaceId.startsWith(PRESET_WORKSPACE_ID_PREFIX)) return null;
572
+ const rest = workspaceId.slice(PRESET_WORKSPACE_ID_PREFIX.length);
573
+ return PRESET_IDS.includes(rest) ? rest : null;
574
+ }
575
+ function place(viewId, tier, order) {
576
+ return { viewId, tier, order };
577
+ }
578
+ function emptyRegions() {
579
+ return {
580
+ surface: [],
581
+ rail: [],
582
+ status: [],
583
+ "dock.left": [],
584
+ "dock.right": [],
585
+ "dock.bottom": [],
586
+ "dock.corner": []
587
+ };
588
+ }
589
+ function cornerResidents() {
590
+ return [
591
+ place("shelf", "summoned", 0),
592
+ place("capture", "summoned", 1),
593
+ place("notifications", "summoned", 2),
594
+ place("sync", "summoned", 3),
595
+ place("console", "summoned", 4)
596
+ ];
597
+ }
598
+ function createPresetTree(preset) {
599
+ const regions = emptyRegions();
600
+ switch (preset) {
601
+ case "quiet":
602
+ regions.rail = [place("modes", "summoned", 0)];
603
+ regions["dock.left"] = [place("navigator", "summoned", 0)];
604
+ regions["dock.right"] = [place("context", "summoned", 0)];
605
+ regions["dock.corner"] = cornerResidents();
606
+ return {
607
+ workspaceId: presetWorkspaceId("quiet"),
608
+ regions,
609
+ surface: { tabsEnabled: false },
610
+ chrome: "quiet"
611
+ };
612
+ case "calm":
613
+ regions.rail = [place("modes", "pinned", 0)];
614
+ regions["dock.left"] = [place("navigator", "pinned", 0)];
615
+ regions["dock.right"] = [place("context", "summoned", 0)];
616
+ regions["dock.corner"] = cornerResidents();
617
+ return {
618
+ workspaceId: presetWorkspaceId("calm"),
619
+ regions,
620
+ surface: { tabsEnabled: false },
621
+ chrome: "pinned"
622
+ };
623
+ case "bench":
624
+ regions.rail = [place("rail", "pinned", 0)];
625
+ regions.status = [place("status", "pinned", 0)];
626
+ regions["dock.left"] = [
627
+ place("explorer", "pinned", 0),
628
+ place("chats", "summoned", 1),
629
+ place("tasks", "summoned", 2),
630
+ place("today", "summoned", 3),
631
+ place("data", "summoned", 4),
632
+ place("ai-chat", "summoned", 5)
633
+ ];
634
+ regions["dock.right"] = [place("context", "summoned", 0)];
635
+ regions["dock.bottom"] = [
636
+ place("shelf", "summoned", 0),
637
+ place("capture", "summoned", 1),
638
+ place("notifications", "summoned", 2),
639
+ place("sync", "summoned", 3),
640
+ place("console", "summoned", 4)
641
+ ];
642
+ regions["dock.corner"] = [];
643
+ return {
644
+ workspaceId: presetWorkspaceId("bench"),
645
+ regions,
646
+ surface: { tabsEnabled: true },
647
+ chrome: "pinned"
648
+ };
649
+ }
650
+ }
651
+ function cloneRegions(regions) {
652
+ return Object.fromEntries(
653
+ Object.entries(regions).map(([region, placements]) => [
654
+ region,
655
+ placements.map((placement) => ({ ...placement }))
656
+ ])
657
+ );
658
+ }
659
+ function regionOf(tree, viewId) {
660
+ for (const region of REGION_IDS) {
661
+ if (tree.regions[region].some((placement) => placement.viewId === viewId)) return region;
662
+ }
663
+ return null;
664
+ }
665
+ function placementOf(tree, viewId) {
666
+ const region = regionOf(tree, viewId);
667
+ if (!region) return null;
668
+ return tree.regions[region].find((placement) => placement.viewId === viewId) ?? null;
669
+ }
670
+ function renumber(placements) {
671
+ return [...placements].sort((a, b) => a.order - b.order).map((placement, index) => ({ ...placement, order: index }));
672
+ }
673
+ function moveSlot(tree, viewId, to) {
674
+ const from = regionOf(tree, viewId);
675
+ if (!from || from === to) return tree;
676
+ const placement = tree.regions[from].find((entry) => entry.viewId === viewId);
677
+ if (!placement) return tree;
678
+ const regions = cloneRegions(tree.regions);
679
+ regions[from] = renumber(regions[from].filter((entry) => entry.viewId !== viewId));
680
+ regions[to] = renumber([...regions[to], { ...placement, order: Number.MAX_SAFE_INTEGER }]);
681
+ return { ...tree, regions };
682
+ }
683
+ function setSlotTier(tree, viewId, tier) {
684
+ const region = regionOf(tree, viewId);
685
+ if (!region) return tree;
686
+ const current = tree.regions[region].find((entry) => entry.viewId === viewId);
687
+ if (!current || current.tier === tier) return tree;
688
+ const regions = cloneRegions(tree.regions);
689
+ regions[region] = regions[region].map(
690
+ (entry) => entry.viewId === viewId ? { ...entry, tier } : entry
691
+ );
692
+ return { ...tree, regions };
693
+ }
694
+ function slotsIn(tree, region, tier) {
695
+ const placements = [...tree.regions[region]].sort((a, b) => a.order - b.order);
696
+ return tier ? placements.filter((placement) => placement.tier === tier) : placements;
697
+ }
698
+ var TIERS = ["pinned", "summoned", "hidden"];
699
+ function isPlacement(value) {
700
+ if (typeof value !== "object" || value === null) return false;
701
+ const p = value;
702
+ return typeof p.viewId === "string" && typeof p.order === "number" && TIERS.includes(p.tier);
703
+ }
704
+ function parseWorkspacePayload(value) {
705
+ if (typeof value !== "object" || value === null) return null;
706
+ const payload = value;
707
+ if (typeof payload.name !== "string") return null;
708
+ const rawTree = payload.tree;
709
+ if (typeof rawTree !== "object" || rawTree === null) return null;
710
+ if (typeof rawTree.workspaceId !== "string") return null;
711
+ const chrome = rawTree.chrome === "quiet" ? "quiet" : "pinned";
712
+ const rawSurface = rawTree.surface;
713
+ const tabsEnabled = rawSurface?.tabsEnabled === true;
714
+ const regions = emptyRegions();
715
+ const rawRegions = rawTree.regions;
716
+ if (typeof rawRegions === "object" && rawRegions !== null) {
717
+ for (const region of REGION_IDS) {
718
+ const entries = rawRegions[region];
719
+ if (!Array.isArray(entries)) continue;
720
+ regions[region] = renumber(entries.filter(isPlacement));
721
+ }
722
+ }
723
+ const preset = PRESET_IDS.includes(payload.preset) ? payload.preset : null;
724
+ return {
725
+ name: payload.name,
726
+ preset,
727
+ tree: { workspaceId: rawTree.workspaceId, regions, surface: { tabsEnabled }, chrome }
728
+ };
729
+ }
730
+ function serializeWorkspacePayload(payload) {
731
+ return {
732
+ name: payload.name,
733
+ preset: payload.preset,
734
+ tree: {
735
+ workspaceId: payload.tree.workspaceId,
736
+ regions: cloneRegions(payload.tree.regions),
737
+ surface: { tabsEnabled: payload.tree.surface.tabsEnabled },
738
+ chrome: payload.tree.chrome
739
+ }
740
+ };
741
+ }
742
+
548
743
  // src/feature-module.ts
549
744
  function defineFeatureModule(module) {
550
745
  return module;
@@ -3314,6 +3509,11 @@ function createExtensionContext(options) {
3314
3509
  disposables.push(d);
3315
3510
  return d;
3316
3511
  },
3512
+ registerSlotView(view) {
3513
+ const d = contributions.slots.register(view);
3514
+ disposables.push(d);
3515
+ return d;
3516
+ },
3317
3517
  addMiddleware(middleware) {
3318
3518
  if (!middlewareChain) {
3319
3519
  console.warn(`[Plugin ${pluginId}] Middleware not available on this platform`);
@@ -3833,6 +4033,11 @@ var PluginRegistry = class {
3833
4033
  ctx.registerAgentTool(tool);
3834
4034
  }
3835
4035
  }
4036
+ if (c.slots) {
4037
+ for (const view of c.slots) {
4038
+ ctx.registerSlotView(view);
4039
+ }
4040
+ }
3836
4041
  }
3837
4042
  // ─── Load from Store ───────────────────────────────────────────────────
3838
4043
  /**
@@ -4203,7 +4408,13 @@ var ScaffoldError = class extends Error {
4203
4408
  }
4204
4409
  };
4205
4410
  var ID_RE3 = /^[a-z][a-z0-9]*(\.[a-z][a-z0-9-]*)+$/i;
4206
- var TEMPLATES = ["client", "two-sided", "ai-script", "connector"];
4411
+ var TEMPLATES = [
4412
+ "client",
4413
+ "two-sided",
4414
+ "ai-script",
4415
+ "connector",
4416
+ "slot-view"
4417
+ ];
4207
4418
  function validateSpec(spec) {
4208
4419
  if (!spec.id || !ID_RE3.test(spec.id)) {
4209
4420
  throw new ScaffoldError(`id must be reverse-domain (got: ${JSON.stringify(spec.id)})`);
@@ -4284,6 +4495,21 @@ var MODULE_BODIES = {
4284
4495
  }
4285
4496
  ]
4286
4497
  }`,
4498
+ // A dockable shell panel (exploration 0280). Capability-scoped: the default
4499
+ // manifest declares NO network and NO schemas — the essay's consent form
4500
+ // starts empty and every grant is an explicit, visible addition.
4501
+ "slot-view": (s) => ` capabilities: ${JSON.stringify(s.capabilities ?? { network: [] })},
4502
+ contributes: {
4503
+ slots: [
4504
+ {
4505
+ id: '${packageName(s.id)}',
4506
+ label: '${s.name}',
4507
+ tier: 'secondary',
4508
+ defaultRegion: 'dock.corner',
4509
+ component: ${pascalCase(s.id)}Panel
4510
+ }
4511
+ ]
4512
+ }`,
4287
4513
  "ai-script": (s) => ` contributes: {
4288
4514
  commands: [
4289
4515
  {
@@ -4382,9 +4608,17 @@ function indexSource(spec) {
4382
4608
  pricing: ${JSON.stringify(spec.pricing)},` : "";
4383
4609
  const publisher = spec.publisherDid ? `
4384
4610
  publisherDid: '${spec.publisherDid}',` : "";
4611
+ const slotPanel = spec.template === "slot-view" ? `import { createElement } from 'react'
4612
+
4613
+ /** The panel body \u2014 replace with your view (createElement keeps it JSX-free). */
4614
+ function ${ctor}Panel() {
4615
+ return createElement('div', { style: { padding: 12 } }, '${spec.name} panel')
4616
+ }
4617
+
4618
+ ` : "";
4385
4619
  return `import { defineFeatureModule } from '@xnetjs/plugins'
4386
4620
 
4387
- export const ${ctor}Module = defineFeatureModule({
4621
+ ${slotPanel}export const ${ctor}Module = defineFeatureModule({
4388
4622
  id: '${spec.id}',
4389
4623
  name: '${spec.name}',
4390
4624
  version: '0.1.0',${spec.author ? `
@@ -12129,12 +12363,15 @@ export {
12129
12363
  OllamaProvider,
12130
12364
  OpenAICompatibleProvider,
12131
12365
  OpenAIProvider,
12366
+ PRESET_IDS,
12367
+ PRESET_WORKSPACE_ID_PREFIX,
12132
12368
  PluginError,
12133
12369
  PluginRegistry,
12134
12370
  PluginRuntimeError,
12135
12371
  PluginSchema,
12136
12372
  PluginValidationError,
12137
12373
  PromptApiProvider,
12374
+ REGION_IDS,
12138
12375
  RSS_CONNECTOR_ID,
12139
12376
  SCAFFOLD_SYSTEM_GUARD,
12140
12377
  SERVICE_IPC_CHANNELS,
@@ -12201,6 +12438,7 @@ export {
12201
12438
  createExtensionStorage,
12202
12439
  createManagedProvider,
12203
12440
  createMemoryAiAgentRuntimeStorage,
12441
+ createPresetTree,
12204
12442
  createPromptApiProvider,
12205
12443
  createScriptContext,
12206
12444
  createServiceClient,
@@ -12252,6 +12490,7 @@ export {
12252
12490
  isNetworkAllowed,
12253
12491
  isOllamaAvailable,
12254
12492
  isPaidPricing,
12493
+ isPresetWorkspaceId,
12255
12494
  isSchemaDefiningExtension,
12256
12495
  isSchemaReadAllowed,
12257
12496
  isSchemaWriteAllowed,
@@ -12262,19 +12501,25 @@ export {
12262
12501
  leaveWithEverything,
12263
12502
  listOllamaModels,
12264
12503
  matchSchemaIri,
12504
+ moveSlot,
12265
12505
  normalizeCanvasPluginWorkspacePolicy,
12266
12506
  packageName,
12267
12507
  parseAiMutationPlan,
12268
12508
  parseFeed,
12269
12509
  parseVersion,
12510
+ parseWorkspacePayload,
12270
12511
  parseXNetPageFrontmatter,
12271
12512
  pascalCase,
12272
12513
  pickBestConnector,
12514
+ placementOf,
12273
12515
  pluginLicenseText,
12516
+ presetForWorkspaceId,
12517
+ presetWorkspaceId,
12274
12518
  probeOpenAiCompatible,
12275
12519
  promptApiAvailability,
12276
12520
  quickSafetyCheck,
12277
12521
  recommendExtensions,
12522
+ regionOf,
12278
12523
  renderEvent,
12279
12524
  renderMarkdownLineDiff,
12280
12525
  renderMarkdownReviewDiff,
@@ -12293,8 +12538,11 @@ export {
12293
12538
  scriptToPluginManifest,
12294
12539
  searchMarketplace,
12295
12540
  serializeAiMutationPlan,
12541
+ serializeWorkspacePayload,
12542
+ setSlotTier,
12296
12543
  shortSchemaName,
12297
12544
  shouldDispatch,
12545
+ slotsIn,
12298
12546
  sortMarketplace,
12299
12547
  stripXNetPageFrontmatter,
12300
12548
  summarizeProvenance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xnetjs/plugins",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,10 +30,10 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "acorn": "^8.15.0",
33
- "@xnetjs/abuse": "0.5.0",
34
- "@xnetjs/core": "0.5.0",
33
+ "@xnetjs/abuse": "0.6.0",
34
+ "@xnetjs/core": "0.6.0",
35
35
  "@xnetjs/trust": "0.0.2",
36
- "@xnetjs/data": "0.5.0",
36
+ "@xnetjs/data": "0.6.0",
37
37
  "@xnetjs/slack-compat": "0.0.2"
38
38
  },
39
39
  "peerDependencies": {
@@ -48,7 +48,7 @@
48
48
  "tsup": "^8.0.0",
49
49
  "typescript": "^5.4.0",
50
50
  "vitest": "^4.0.0",
51
- "@xnetjs/licenses": "0.0.9"
51
+ "@xnetjs/licenses": "0.0.10"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsup",