@xnetjs/plugins 2.4.0 → 3.0.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/README.md +5 -0
- package/dist/index.d.ts +39 -8
- package/dist/index.js +216 -14
- package/dist/services/node.d.ts +8 -0
- package/dist/services/node.js +190 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Plugin system for xNet -- registry, sandboxed script execution, AI-powered script generation, and service integrations.
|
|
4
4
|
|
|
5
|
+
> **Alpha software.** xNet is released but early: this package is on npm and
|
|
6
|
+
> usable today, but its API can change between releases, sometimes without a
|
|
7
|
+
> migration path. Pin your version. See the
|
|
8
|
+
> [project README](https://github.com/crs48/xNet#readme) for what alpha means here.
|
|
9
|
+
|
|
5
10
|
## Installation
|
|
6
11
|
|
|
7
12
|
```bash
|
package/dist/index.d.ts
CHANGED
|
@@ -322,6 +322,21 @@ interface ViewContribution {
|
|
|
322
322
|
/** Schema IRIs this view supports (empty = all) */
|
|
323
323
|
supportedSchemas?: string[];
|
|
324
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* A frame source renderer (0346): how a node of some schema renders as
|
|
327
|
+
* a frame (document embeds, dashboard frame widgets, frame tabs). The
|
|
328
|
+
* capability rule mirrors slots: a plugin registers renderers only under
|
|
329
|
+
* its OWN id namespace and never replaces another provider's renderer —
|
|
330
|
+
* enforced by `PluginContext.registerFrameRenderer`.
|
|
331
|
+
*/
|
|
332
|
+
interface FrameRendererContribution {
|
|
333
|
+
/** Renderer id — namespaced `${pluginId}:${name}` by the context. */
|
|
334
|
+
id: string;
|
|
335
|
+
/** Schema IRIs this renderer can frame ('*' = any). */
|
|
336
|
+
supportedSchemas: string[] | '*';
|
|
337
|
+
/** Component receiving the host's NodeFrameProps contract. */
|
|
338
|
+
component: ComponentType<never>;
|
|
339
|
+
}
|
|
325
340
|
interface ViewProps {
|
|
326
341
|
nodeId: string;
|
|
327
342
|
schemaId: string;
|
|
@@ -783,6 +798,7 @@ declare class ContributionRegistry {
|
|
|
783
798
|
readonly mentionProviders: TypedRegistry<MentionProviderContribution>;
|
|
784
799
|
readonly agentTools: TypedRegistry<AgentToolContribution>;
|
|
785
800
|
readonly slots: TypedRegistry<SlotContribution>;
|
|
801
|
+
readonly frameRenderers: TypedRegistry<FrameRendererContribution>;
|
|
786
802
|
/** @deprecated Since 0280 — the dock registry is the slot registry. */
|
|
787
803
|
get surfaceDock(): TypedRegistry<SlotContribution>;
|
|
788
804
|
/**
|
|
@@ -1023,6 +1039,13 @@ interface ExtensionContext {
|
|
|
1023
1039
|
registerSchema(schema: unknown): Disposable$1;
|
|
1024
1040
|
/** Register a custom view type */
|
|
1025
1041
|
registerView(view: ViewContribution): Disposable$1;
|
|
1042
|
+
/**
|
|
1043
|
+
* Register a frame source renderer (0346). Own-views-only rule: the
|
|
1044
|
+
* renderer id is namespaced under this plugin's id, so a plugin can
|
|
1045
|
+
* add frames for its own schemas but never replace another provider's
|
|
1046
|
+
* renderer.
|
|
1047
|
+
*/
|
|
1048
|
+
registerFrameRenderer(renderer: FrameRendererContribution): Disposable$1;
|
|
1026
1049
|
/** Register a dashboard widget (trust tier assigned by the host) */
|
|
1027
1050
|
registerWidget(widget: WidgetContribution): Disposable$1;
|
|
1028
1051
|
/** Register a property type handler */
|
|
@@ -1699,7 +1722,7 @@ declare function warnOnEditorSchemaRisks(pluginId: string, contributions: readon
|
|
|
1699
1722
|
*
|
|
1700
1723
|
* A Connector is xNet's answer to the agent-native CLI (Printing Press / OpenClaw):
|
|
1701
1724
|
* instead of giving the agent a credentialed shell, it syncs an external service
|
|
1702
|
-
* into governed
|
|
1725
|
+
* into governed xNet nodes and exposes agent-callable tools over them. It is a
|
|
1703
1726
|
* `FeatureModule` subtype that bundles three things:
|
|
1704
1727
|
*
|
|
1705
1728
|
* 1. a `capabilities` manifest — `secrets` (held by the hub broker, never the
|
|
@@ -2163,6 +2186,14 @@ declare class AiSurfaceService {
|
|
|
2163
2186
|
private readPageMarkdown;
|
|
2164
2187
|
private readPageOutline;
|
|
2165
2188
|
private planPagePatch;
|
|
2189
|
+
/**
|
|
2190
|
+
* Compose a page of frames (0346, Phase 5): create the Page node, then
|
|
2191
|
+
* plan + apply its markdown content (intro + frame directives) through
|
|
2192
|
+
* the standard page pipeline — one audited step, rollbackable via the
|
|
2193
|
+
* page-markdown rollback handle (the created page itself is reported
|
|
2194
|
+
* so a rejected compose can be cleaned up).
|
|
2195
|
+
*/
|
|
2196
|
+
private composePage;
|
|
2166
2197
|
private applyPageMarkdown;
|
|
2167
2198
|
private finalizeAppliedPageMarkdown;
|
|
2168
2199
|
private getAuditLog;
|
|
@@ -2969,16 +3000,16 @@ declare function wrapCliConnector(options: WrapCliConnectorOptions): DefinedConn
|
|
|
2969
3000
|
/**
|
|
2970
3001
|
* @xnetjs/plugins — the Slack migration connector (exploration 0198).
|
|
2971
3002
|
*
|
|
2972
|
-
* "Switch from Slack to
|
|
3003
|
+
* "Switch from Slack to xNet and bring my data with me." This is the Half-1
|
|
2973
3004
|
* answer from exploration 0198: a {@link defineConnector} that pulls a Slack
|
|
2974
|
-
* workspace's channels and message history into
|
|
3005
|
+
* workspace's channels and message history into xNet's native `Channel` and
|
|
2975
3006
|
* `ChatMessage` nodes, through the guarded connector store (egress-contained to
|
|
2976
3007
|
* `slack.com`, space-stamped, budget-charged). The Slack token lives in the hub
|
|
2977
3008
|
* broker and never reaches the agent — it only ever sees the synced nodes.
|
|
2978
3009
|
*
|
|
2979
3010
|
* Message bodies are translated to GitHub-flavored markdown via
|
|
2980
3011
|
* `@xnetjs/slack-compat` (Block Kit first, then `mrkdwn`), so they render
|
|
2981
|
-
* natively in
|
|
3012
|
+
* natively in xNet chat. Pagination, DMs, files and reactions are deferred (see
|
|
2982
3013
|
* the exploration's checklist).
|
|
2983
3014
|
*/
|
|
2984
3015
|
|
|
@@ -5039,7 +5070,7 @@ type ManagedProviderOptions = AIProviderOptions & {
|
|
|
5039
5070
|
onBudget?: (snapshot: ManagedBudgetSnapshot) => void;
|
|
5040
5071
|
};
|
|
5041
5072
|
/**
|
|
5042
|
-
*
|
|
5073
|
+
* xNet Cloud **managed** AI provider (exploration 0208).
|
|
5043
5074
|
*
|
|
5044
5075
|
* Posts to the hub's `/ai/chat`, which forwards to the metered control-plane
|
|
5045
5076
|
* gateway (OpenRouter behind a per-tenant budgeted key). Unlike every other cloud
|
|
@@ -5053,7 +5084,7 @@ type ManagedProviderOptions = AIProviderOptions & {
|
|
|
5053
5084
|
* No `stream` method, so the runtime uses the request/response path.
|
|
5054
5085
|
*/
|
|
5055
5086
|
declare class ManagedProvider implements AIProvider {
|
|
5056
|
-
readonly name = "
|
|
5087
|
+
readonly name = "xNet Cloud";
|
|
5057
5088
|
private readonly baseUrl;
|
|
5058
5089
|
private readonly model?;
|
|
5059
5090
|
private readonly fetchImpl;
|
|
@@ -5513,7 +5544,7 @@ type WriteMode = 'agentic' | 'propose-only';
|
|
|
5513
5544
|
*/
|
|
5514
5545
|
interface ConnectorEnv {
|
|
5515
5546
|
/**
|
|
5516
|
-
* Probe
|
|
5547
|
+
* Probe xNet Cloud managed AI: GET `${managedUrl}/ai/health` is `ok` and the
|
|
5517
5548
|
* tenant has AI enabled. Default: a same-origin fetch (returns false off-cloud).
|
|
5518
5549
|
*/
|
|
5519
5550
|
probeManaged?: (baseUrl: string) => Promise<boolean>;
|
|
@@ -7170,4 +7201,4 @@ declare function buildCommunityRegistryEntry(source: PluginSourceNode, options:
|
|
|
7170
7201
|
*/
|
|
7171
7202
|
declare function exportPluginSourceAsRepoFiles(source: PluginSourceNode): Record<string, string>;
|
|
7172
7203
|
|
|
7173
|
-
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 AgentAuditContext, AgentAuditRecorder, type AgentAuditRecorderConfig, type AgentAuditSurface, type AgentCallOutcome, type AgentExecutedResult, type AgentNotificationToolsOptions, type AgentPendingApproval, 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 BlockNotePageMarkdownAdapterOptions, 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 CommunityRegistryEntry, 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, DEFAULT_WORKSPACE_ID, 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 HotReloadEvent, 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, PLUGIN_FRAME_SANDBOX, PLUGIN_SOURCE_SCHEMA_IRI, PLUGIN_STORE_DENYLIST, PRESET_IDS, PRESET_WORKSPACE_ID_PREFIX, type PendingChange, type Platform, type PlatformCapabilities, type PluginBuildDiagnostic, type PluginBuildInput, type PluginContributions, PluginError, type PluginFeedbackEntry, type PluginFileTranspiler, type PluginFrameSession, type PluginFrameToHostMessage, type PluginFrameTransport, type PluginGraphPayload, type PluginHostToFrameMessage, type PluginModuleGraph, type PluginNode, type PluginNodeChangeEvent, type PluginNodeChangeListener, type PluginPermissions, type PluginPricing, type PluginRating, type PluginRegisteredHandlers, PluginRegistry, type PluginRunInput, type PluginRunResult, PluginRuntimeError, type PluginRuntimeLadder, PluginSchema, type PluginSourceDiff, type PluginSourceNode, PluginSourceSchema, type PluginSourceWatcher, type PluginStatus, type PluginStoreRpc, PluginStoreRpcError, type PluginUpdateAssessment, 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 PublishConsentRequest, 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, SOURCE_SETTLE_DEBOUNCE_MS, 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, TypedRegistry, type UsageSignal, type ValidationResult, type VendorModuleSources, type VerifyProvenanceInput, type ViewContribution, type ViewProps, WRITING_XNET_PLUGINS_SKILL_MD, type WebLLMEngineLike, WebLLMProvider, type WebLLMProviderOptions, type WebhookConfig, WebhookEmitter, type WebhookOutOptions, type WebhookPayload, type WidgetContribution, type WidgetContributionConfigField, type WidgetContributionProps, type WorkspaceCommand, type WorkspacePayload, type WorkspacePluginAgentToolsOptions, type WorkspacePluginContributionsData, type WorkspacePluginDraftBackend, WorkspacePluginError, type WorkspacePluginHandle, type WorkspacePluginHostDeps, type WorkspacePluginHotReloader, type WorkspacePluginManifestData, type WorkspacePluginPreviewManager, type WorkspacePluginPreviewResult, type WorkspacePluginPublishResult, type WorkspacePluginSourceBackend, type WorkspacePluginStore, type WrapCliConnectorOptions, type WriteMode, XNET_MARKDOWN_DIRECTIVE_SPECS, XNET_PAGE_FRAGMENT_FIELD, XNET_PAGE_LEGACY_FRAGMENT_FIELD, type XNetExtension, type XNetMarkdownDiffLine, type XNetMarkdownDiffLineKind, type XNetMarkdownDirective, type XNetMarkdownDirectiveSpec, type XNetMarkdownReviewDiff, type XNetPageDocResolver, type XNetPageFragmentReadOptions, type XNetPageFragmentWriteOptions, type XNetPageMarkdownFrontmatter, type XNetPageMarkdownValidation, type XNetPageMarkdownValidationOptions, activateWorkspacePlugin, agentToolToExtraTool, agentToolsAsExtraTools, aggregateRatings, assertNetwork, assertPublicUrl, assertSchemaWrite, assertSystemAudio, assessPluginUpdate, assistTurnProvenance, attachAiPlanValidation, blockNoteFragmentToMarkdown, buildAirtableConnector, buildCommunityRegistryEntry, buildDiscordAction, buildEmailAction, buildGithubConnector, buildGoogleCalendarConnector, buildLinearConnector, buildNotionConnector, buildPluginFrameSrcdoc, buildPluginModuleGraph, buildRetryPrompt, buildRssConnector, buildScriptPrompt, buildSlackConnector, buildSlackWebhookAction, buildTelegramAction, buildWebhookOutAction, buildWorkspacePlugin, classifyAiAgentDisplayState, compareVersions, composeAssistSystemPrompt, computePluginSourceHash, connectorAsImporter, connectorMarketplaceEntry, contributionsAsAiTools, createAIProvider, createAIProviderRouter, createAgentCeremonyTools, createAgentNotificationTools, createAiAgentRuntime, createAiChangeSet, createAiOperation, createAiSurfaceService, createAiValidationResult, createBlockNotePageMarkdownAdapter, createCanvasErpPrototypeRiskSummary, createCanvasErpPrototypeScenario, createCanvasPluginFixtureCards, createCanvasPluginFixtureManifests, createCanvasPluginPermissionPrompt, createCanvasPluginSandboxPolicy, createCanvasPreviewSandboxRequest, createCanvasRendererSandboxRequest, createDefaultTree, createExtensionContext, createExtensionStorage, createManagedProvider, createMemoryAiAgentRuntimeStorage, createPluginFrameSession, createPluginSourceWatcher, createPluginStoreRpc, createPresetTree, createPromptApiProvider, createScriptContext, createServiceClient, createTestNodeStore, createTestPluginHarness, createWebLLMProvider, createWebhookEmitter, createWorkspacePluginAgentTools, createWorkspacePluginHotReloader, createWorkspacePluginPreviewManager, defaultLocalServerProbes, defineAction, defineConnector, defineExtension, defineFeatureModule, deleteDay, describeCapabilities, detectConnectors, detectUpcomingMeeting, diffPluginSourceFiles, downloadPromptApiModel, emitConnectorArtifacts, evaluateCanvasPluginPermissionGate, evaluateCanvasPluginSandboxRequest, evaluateConnectorInstall, evaluateInstallConsent, executeScript, exportPluginSourceAsRepoFiles, failClosedVerifier, filterByCategory, findEditorSchemaRisks, findMissingDependencies, framePluginCsp, generateScript, getCanvasErpPrototypeAuditEntriesForCard, getCanvasErpPrototypeCardsForFrame, getCanvasPluginFixture, getCommandRegistry, getPlatformCapabilities, getShortcutManager, getXNetMarkdownDirectiveSpecs, guardStore, guardedActionFetch, guardedFetch, hasUpdate, hashNonce, importerAdapters, insertSlot, installCommandHandler, installShortcutHandler, isAiRiskLevel, isAiScope, isAiTargetKind, isAllowedPluginLicense, isDenylistedSchema, isHostCompatible, isNetworkAllowed, isOllamaAvailable, isPaidPricing, isPresetWorkspaceId, isSchemaDefiningContribution, isSchemaReadAllowed, isSchemaWriteAllowed, isScriptNode, isServiceClientAvailable, isSystemAudioAllowed, ladderTierForTrust, leaveWithEverything, legacyFragmentToMarkdown, listOllamaModels, matchSchemaIri, moveSlot, normalizeCanvasPluginWorkspacePolicy, packageName, parseAiMutationPlan, parseFeed, parseVersion, parseWorkspacePayload, parseXNetPageFrontmatter, pascalCase, permissionsToCapabilities, pickBestConnector, placementOf, pluginLicenseText, presetForWorkspaceId, presetWorkspaceId, probeOpenAiCompatible, promptApiAvailability, quickSafetyCheck, readPluginSourceNode, recommendExtensions, regionOf, renderEvent, renderMarkdownLineDiff, renderMarkdownReviewDiff, renderSelectionPrompt, replaceXNetPageFragmentWithMarkdown, requestWorkspacePluginPublish, resolveImporters, resolveInstallOrder, resolveMentionProviders, reversibilityForTool, riskForTool, runAction, runAiPluginPipeline, runConnectorSync, runPluginCode, satisfiesRange, scaffoldPlugin, scaffoldWorkspacePluginFiles, scriptToPluginManifest, searchMarketplace, serializeAiMutationPlan, serializeWorkspacePayload, setSlotTier, shortSchemaName, shouldDispatch, slotsIn, sortMarketplace, stripXNetPageFrontmatter, summarizeProvenance, validateAiMutationPlan, validateCanvasPluginSandboxOutput, validateManifest, validateScript, validateScriptAST, validateWorkspaceManifest, validateXNetPageMarkdown, verifyProvenance, warnOnEditorSchemaRisks, wrapCliConnector, writeModeFor, xnetPageFragmentToMarkdown };
|
|
7204
|
+
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 AgentAuditContext, AgentAuditRecorder, type AgentAuditRecorderConfig, type AgentAuditSurface, type AgentCallOutcome, type AgentExecutedResult, type AgentNotificationToolsOptions, type AgentPendingApproval, 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 BlockNotePageMarkdownAdapterOptions, 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 CommunityRegistryEntry, 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, DEFAULT_WORKSPACE_ID, 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, type FrameRendererContribution, GITHUB_CONNECTOR_ID, GOOGLE_CALENDAR_CONNECTOR_ID, type GeneratedScript, type GithubConnectorOptions, type GuardableConnectorStore, type HotReloadEvent, 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, PLUGIN_FRAME_SANDBOX, PLUGIN_SOURCE_SCHEMA_IRI, PLUGIN_STORE_DENYLIST, PRESET_IDS, PRESET_WORKSPACE_ID_PREFIX, type PendingChange, type Platform, type PlatformCapabilities, type PluginBuildDiagnostic, type PluginBuildInput, type PluginContributions, PluginError, type PluginFeedbackEntry, type PluginFileTranspiler, type PluginFrameSession, type PluginFrameToHostMessage, type PluginFrameTransport, type PluginGraphPayload, type PluginHostToFrameMessage, type PluginModuleGraph, type PluginNode, type PluginNodeChangeEvent, type PluginNodeChangeListener, type PluginPermissions, type PluginPricing, type PluginRating, type PluginRegisteredHandlers, PluginRegistry, type PluginRunInput, type PluginRunResult, PluginRuntimeError, type PluginRuntimeLadder, PluginSchema, type PluginSourceDiff, type PluginSourceNode, PluginSourceSchema, type PluginSourceWatcher, type PluginStatus, type PluginStoreRpc, PluginStoreRpcError, type PluginUpdateAssessment, 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 PublishConsentRequest, 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, SOURCE_SETTLE_DEBOUNCE_MS, 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, TypedRegistry, type UsageSignal, type ValidationResult, type VendorModuleSources, type VerifyProvenanceInput, type ViewContribution, type ViewProps, WRITING_XNET_PLUGINS_SKILL_MD, type WebLLMEngineLike, WebLLMProvider, type WebLLMProviderOptions, type WebhookConfig, WebhookEmitter, type WebhookOutOptions, type WebhookPayload, type WidgetContribution, type WidgetContributionConfigField, type WidgetContributionProps, type WorkspaceCommand, type WorkspacePayload, type WorkspacePluginAgentToolsOptions, type WorkspacePluginContributionsData, type WorkspacePluginDraftBackend, WorkspacePluginError, type WorkspacePluginHandle, type WorkspacePluginHostDeps, type WorkspacePluginHotReloader, type WorkspacePluginManifestData, type WorkspacePluginPreviewManager, type WorkspacePluginPreviewResult, type WorkspacePluginPublishResult, type WorkspacePluginSourceBackend, type WorkspacePluginStore, type WrapCliConnectorOptions, type WriteMode, XNET_MARKDOWN_DIRECTIVE_SPECS, XNET_PAGE_FRAGMENT_FIELD, XNET_PAGE_LEGACY_FRAGMENT_FIELD, type XNetExtension, type XNetMarkdownDiffLine, type XNetMarkdownDiffLineKind, type XNetMarkdownDirective, type XNetMarkdownDirectiveSpec, type XNetMarkdownReviewDiff, type XNetPageDocResolver, type XNetPageFragmentReadOptions, type XNetPageFragmentWriteOptions, type XNetPageMarkdownFrontmatter, type XNetPageMarkdownValidation, type XNetPageMarkdownValidationOptions, activateWorkspacePlugin, agentToolToExtraTool, agentToolsAsExtraTools, aggregateRatings, assertNetwork, assertPublicUrl, assertSchemaWrite, assertSystemAudio, assessPluginUpdate, assistTurnProvenance, attachAiPlanValidation, blockNoteFragmentToMarkdown, buildAirtableConnector, buildCommunityRegistryEntry, buildDiscordAction, buildEmailAction, buildGithubConnector, buildGoogleCalendarConnector, buildLinearConnector, buildNotionConnector, buildPluginFrameSrcdoc, buildPluginModuleGraph, buildRetryPrompt, buildRssConnector, buildScriptPrompt, buildSlackConnector, buildSlackWebhookAction, buildTelegramAction, buildWebhookOutAction, buildWorkspacePlugin, classifyAiAgentDisplayState, compareVersions, composeAssistSystemPrompt, computePluginSourceHash, connectorAsImporter, connectorMarketplaceEntry, contributionsAsAiTools, createAIProvider, createAIProviderRouter, createAgentCeremonyTools, createAgentNotificationTools, createAiAgentRuntime, createAiChangeSet, createAiOperation, createAiSurfaceService, createAiValidationResult, createBlockNotePageMarkdownAdapter, createCanvasErpPrototypeRiskSummary, createCanvasErpPrototypeScenario, createCanvasPluginFixtureCards, createCanvasPluginFixtureManifests, createCanvasPluginPermissionPrompt, createCanvasPluginSandboxPolicy, createCanvasPreviewSandboxRequest, createCanvasRendererSandboxRequest, createDefaultTree, createExtensionContext, createExtensionStorage, createManagedProvider, createMemoryAiAgentRuntimeStorage, createPluginFrameSession, createPluginSourceWatcher, createPluginStoreRpc, createPresetTree, createPromptApiProvider, createScriptContext, createServiceClient, createTestNodeStore, createTestPluginHarness, createWebLLMProvider, createWebhookEmitter, createWorkspacePluginAgentTools, createWorkspacePluginHotReloader, createWorkspacePluginPreviewManager, defaultLocalServerProbes, defineAction, defineConnector, defineExtension, defineFeatureModule, deleteDay, describeCapabilities, detectConnectors, detectUpcomingMeeting, diffPluginSourceFiles, downloadPromptApiModel, emitConnectorArtifacts, evaluateCanvasPluginPermissionGate, evaluateCanvasPluginSandboxRequest, evaluateConnectorInstall, evaluateInstallConsent, executeScript, exportPluginSourceAsRepoFiles, failClosedVerifier, filterByCategory, findEditorSchemaRisks, findMissingDependencies, framePluginCsp, generateScript, getCanvasErpPrototypeAuditEntriesForCard, getCanvasErpPrototypeCardsForFrame, getCanvasPluginFixture, getCommandRegistry, getPlatformCapabilities, getShortcutManager, getXNetMarkdownDirectiveSpecs, guardStore, guardedActionFetch, guardedFetch, hasUpdate, hashNonce, importerAdapters, insertSlot, installCommandHandler, installShortcutHandler, isAiRiskLevel, isAiScope, isAiTargetKind, isAllowedPluginLicense, isDenylistedSchema, isHostCompatible, isNetworkAllowed, isOllamaAvailable, isPaidPricing, isPresetWorkspaceId, isSchemaDefiningContribution, isSchemaReadAllowed, isSchemaWriteAllowed, isScriptNode, isServiceClientAvailable, isSystemAudioAllowed, ladderTierForTrust, leaveWithEverything, legacyFragmentToMarkdown, listOllamaModels, matchSchemaIri, moveSlot, normalizeCanvasPluginWorkspacePolicy, packageName, parseAiMutationPlan, parseFeed, parseVersion, parseWorkspacePayload, parseXNetPageFrontmatter, pascalCase, permissionsToCapabilities, pickBestConnector, placementOf, pluginLicenseText, presetForWorkspaceId, presetWorkspaceId, probeOpenAiCompatible, promptApiAvailability, quickSafetyCheck, readPluginSourceNode, recommendExtensions, regionOf, renderEvent, renderMarkdownLineDiff, renderMarkdownReviewDiff, renderSelectionPrompt, replaceXNetPageFragmentWithMarkdown, requestWorkspacePluginPublish, resolveImporters, resolveInstallOrder, resolveMentionProviders, reversibilityForTool, riskForTool, runAction, runAiPluginPipeline, runConnectorSync, runPluginCode, satisfiesRange, scaffoldPlugin, scaffoldWorkspacePluginFiles, scriptToPluginManifest, searchMarketplace, serializeAiMutationPlan, serializeWorkspacePayload, setSlotTier, shortSchemaName, shouldDispatch, slotsIn, sortMarketplace, stripXNetPageFrontmatter, summarizeProvenance, validateAiMutationPlan, validateCanvasPluginSandboxOutput, validateManifest, validateScript, validateScriptAST, validateWorkspaceManifest, validateXNetPageMarkdown, verifyProvenance, warnOnEditorSchemaRisks, wrapCliConnector, writeModeFor, xnetPageFragmentToMarkdown };
|
package/dist/index.js
CHANGED
|
@@ -517,6 +517,7 @@ var ContributionRegistry = class {
|
|
|
517
517
|
mentionProviders = new TypedRegistry();
|
|
518
518
|
agentTools = new TypedRegistry();
|
|
519
519
|
slots = new TypedRegistry();
|
|
520
|
+
frameRenderers = new TypedRegistry();
|
|
520
521
|
/** @deprecated Since 0280 — the dock registry is the slot registry. */
|
|
521
522
|
get surfaceDock() {
|
|
522
523
|
return this.slots;
|
|
@@ -546,6 +547,7 @@ var ContributionRegistry = class {
|
|
|
546
547
|
this.mentionProviders.clear();
|
|
547
548
|
this.agentTools.clear();
|
|
548
549
|
this.slots.clear();
|
|
550
|
+
this.frameRenderers.clear();
|
|
549
551
|
}
|
|
550
552
|
};
|
|
551
553
|
|
|
@@ -621,7 +623,7 @@ function createPresetTree(preset) {
|
|
|
621
623
|
chrome: "pinned"
|
|
622
624
|
};
|
|
623
625
|
case "bench":
|
|
624
|
-
regions.rail = [
|
|
626
|
+
regions.rail = [];
|
|
625
627
|
regions.status = [place("status", "pinned", 0)];
|
|
626
628
|
regions["dock.left"] = [
|
|
627
629
|
place("explorer", "pinned", 0),
|
|
@@ -651,15 +653,16 @@ function createPresetTree(preset) {
|
|
|
651
653
|
var DEFAULT_WORKSPACE_ID = "workspace-default";
|
|
652
654
|
function createDefaultTree() {
|
|
653
655
|
const regions = emptyRegions();
|
|
654
|
-
regions.rail = [
|
|
656
|
+
regions.rail = [];
|
|
655
657
|
regions.status = [place("status", "pinned", 0)];
|
|
656
658
|
regions["dock.left"] = [
|
|
657
|
-
place("
|
|
658
|
-
place("
|
|
659
|
-
place("
|
|
660
|
-
place("
|
|
661
|
-
place("
|
|
662
|
-
place("
|
|
659
|
+
place("tree", "pinned", 0),
|
|
660
|
+
place("explorer", "summoned", 1),
|
|
661
|
+
place("chats", "summoned", 2),
|
|
662
|
+
place("tasks", "summoned", 3),
|
|
663
|
+
place("today", "summoned", 4),
|
|
664
|
+
place("data", "summoned", 5),
|
|
665
|
+
place("ai-chat", "summoned", 6)
|
|
663
666
|
];
|
|
664
667
|
regions["dock.right"] = [place("context", "summoned", 0)];
|
|
665
668
|
regions["dock.bottom"] = [
|
|
@@ -2526,7 +2529,7 @@ function searchTool(id, search) {
|
|
|
2526
2529
|
return {
|
|
2527
2530
|
id: `${id}.search`,
|
|
2528
2531
|
name: "slack_search_messages",
|
|
2529
|
-
description: "Search messages imported from Slack into
|
|
2532
|
+
description: "Search messages imported from Slack into xNet channels.",
|
|
2530
2533
|
inputSchema: {
|
|
2531
2534
|
type: "object",
|
|
2532
2535
|
properties: { query: { type: "string", description: "Full-text query." } },
|
|
@@ -2541,7 +2544,7 @@ function buildSlackConnector(options = {}) {
|
|
|
2541
2544
|
return defineConnector({
|
|
2542
2545
|
id,
|
|
2543
2546
|
name: "Slack",
|
|
2544
|
-
description: "Import Slack channels and message history into
|
|
2547
|
+
description: "Import Slack channels and message history into xNet.",
|
|
2545
2548
|
capabilities: {
|
|
2546
2549
|
secrets: ["SLACK_USER_TOKEN"],
|
|
2547
2550
|
schemaWrite: [CHANNEL_SCHEMA, CHAT_MESSAGE_SCHEMA],
|
|
@@ -3473,6 +3476,16 @@ function createExtensionContext(options) {
|
|
|
3473
3476
|
disposables.push(d);
|
|
3474
3477
|
return d;
|
|
3475
3478
|
},
|
|
3479
|
+
registerFrameRenderer(renderer) {
|
|
3480
|
+
const namespacedId = renderer.id.startsWith(`${pluginId}:`) ? renderer.id : `${pluginId}:${renderer.id}`;
|
|
3481
|
+
const existing = contributions.frameRenderers.getAll().find((entry) => entry.id === namespacedId);
|
|
3482
|
+
if (existing) {
|
|
3483
|
+
throw new Error(`[Plugin ${pluginId}] frame renderer already registered: ${namespacedId}`);
|
|
3484
|
+
}
|
|
3485
|
+
const d = contributions.frameRenderers.register({ ...renderer, id: namespacedId });
|
|
3486
|
+
disposables.push(d);
|
|
3487
|
+
return d;
|
|
3488
|
+
},
|
|
3476
3489
|
registerWidget(widget) {
|
|
3477
3490
|
const d = contributions.widgets.register(widget);
|
|
3478
3491
|
disposables.push(d);
|
|
@@ -6348,6 +6361,156 @@ var rollbackPageMarkdownTool = {
|
|
|
6348
6361
|
execute: async (host, args) => await host.rollbackPageMarkdown(args)
|
|
6349
6362
|
};
|
|
6350
6363
|
|
|
6364
|
+
// src/ai-surface/tools/frames.ts
|
|
6365
|
+
function readPlacements(args) {
|
|
6366
|
+
const raw = args.placements;
|
|
6367
|
+
if (!Array.isArray(raw) || raw.length === 0) {
|
|
6368
|
+
throw new Error("placements must be a non-empty array");
|
|
6369
|
+
}
|
|
6370
|
+
return raw.map((entry, index) => {
|
|
6371
|
+
if (typeof entry !== "object" || entry === null) {
|
|
6372
|
+
throw new Error(`placements[${index}] must be an object`);
|
|
6373
|
+
}
|
|
6374
|
+
const record = entry;
|
|
6375
|
+
const nodeId = record.nodeId;
|
|
6376
|
+
if (typeof nodeId !== "string" || !nodeId) {
|
|
6377
|
+
throw new Error(`placements[${index}].nodeId is required`);
|
|
6378
|
+
}
|
|
6379
|
+
const kind = record.kind === "page" ? "page" : "database";
|
|
6380
|
+
return {
|
|
6381
|
+
nodeId,
|
|
6382
|
+
kind,
|
|
6383
|
+
viewType: typeof record.viewType === "string" ? record.viewType : void 0,
|
|
6384
|
+
title: typeof record.title === "string" ? record.title : void 0,
|
|
6385
|
+
config: typeof record.config === "object" && record.config !== null ? record.config : void 0
|
|
6386
|
+
};
|
|
6387
|
+
});
|
|
6388
|
+
}
|
|
6389
|
+
function framePlacementDirective(placement) {
|
|
6390
|
+
if (placement.kind === "page") {
|
|
6391
|
+
const payload2 = { nodeId: placement.nodeId, title: placement.title ?? "" };
|
|
6392
|
+
return `:::xnet-page
|
|
6393
|
+
${JSON.stringify(payload2)}
|
|
6394
|
+
:::`;
|
|
6395
|
+
}
|
|
6396
|
+
const payload = {
|
|
6397
|
+
databaseId: placement.nodeId,
|
|
6398
|
+
viewType: placement.viewType ?? "table",
|
|
6399
|
+
viewConfig: placement.config ?? {}
|
|
6400
|
+
};
|
|
6401
|
+
return `:::xnet-database
|
|
6402
|
+
${JSON.stringify(payload)}
|
|
6403
|
+
:::`;
|
|
6404
|
+
}
|
|
6405
|
+
function frameMarkdownBody(intro, placements) {
|
|
6406
|
+
const sections = placements.map((p) => framePlacementDirective(p));
|
|
6407
|
+
return [intro?.trim(), ...sections].filter(Boolean).join("\n\n");
|
|
6408
|
+
}
|
|
6409
|
+
var placementsSchema = {
|
|
6410
|
+
type: "array",
|
|
6411
|
+
description: 'Frames to place, in order. kind "database" embeds a live database view (viewType: table | board | list | gallery | calendar | timeline | map | plugin types); kind "page" embeds a live page transclusion.',
|
|
6412
|
+
items: {
|
|
6413
|
+
type: "object",
|
|
6414
|
+
properties: {
|
|
6415
|
+
nodeId: { type: "string", description: "Target node id (database or page)." },
|
|
6416
|
+
kind: { type: "string", enum: ["database", "page"] },
|
|
6417
|
+
viewType: { type: "string", description: "Registry view type for database frames." },
|
|
6418
|
+
title: { type: "string", description: "Display title for page frames." },
|
|
6419
|
+
config: { type: "object", description: "Per-view presentation config." }
|
|
6420
|
+
},
|
|
6421
|
+
required: ["nodeId"]
|
|
6422
|
+
}
|
|
6423
|
+
};
|
|
6424
|
+
var planFramePlacementTool = {
|
|
6425
|
+
definition: {
|
|
6426
|
+
name: "xnet_plan_frame_placement",
|
|
6427
|
+
title: "Plan frame placement",
|
|
6428
|
+
description: "Plan appending live frames (database views, page transclusions) to an existing page. Returns a validated mutation plan with a review diff; apply with xnet_apply_frame_placement.",
|
|
6429
|
+
risk: "medium",
|
|
6430
|
+
requiredScopes: ["page.read", "page.propose"],
|
|
6431
|
+
inputSchema: {
|
|
6432
|
+
type: "object",
|
|
6433
|
+
properties: {
|
|
6434
|
+
pageId: { type: "string", description: "Page to place frames on." },
|
|
6435
|
+
placements: placementsSchema,
|
|
6436
|
+
intent: { type: "string", description: "Why these frames are being placed." }
|
|
6437
|
+
},
|
|
6438
|
+
required: ["pageId", "placements"]
|
|
6439
|
+
}
|
|
6440
|
+
},
|
|
6441
|
+
execute: async (host, args) => {
|
|
6442
|
+
const pageId = readRequiredString(args, "pageId");
|
|
6443
|
+
const placements = readPlacements(args);
|
|
6444
|
+
const current = await host.readPageMarkdown(pageId, true);
|
|
6445
|
+
const markdown = `${current.text.trimEnd()}
|
|
6446
|
+
|
|
6447
|
+
${frameMarkdownBody(void 0, placements)}
|
|
6448
|
+
`;
|
|
6449
|
+
return host.planPagePatch({
|
|
6450
|
+
pageId,
|
|
6451
|
+
markdown,
|
|
6452
|
+
actor: readOptionalString(args, "actor") ?? "ai-agent",
|
|
6453
|
+
intent: readOptionalString(args, "intent") ?? `Place ${placements.length} frame${placements.length === 1 ? "" : "s"} on the page`
|
|
6454
|
+
});
|
|
6455
|
+
}
|
|
6456
|
+
};
|
|
6457
|
+
var applyFramePlacementTool = {
|
|
6458
|
+
definition: {
|
|
6459
|
+
name: "xnet_apply_frame_placement",
|
|
6460
|
+
title: "Apply frame placement",
|
|
6461
|
+
description: "Apply a validated frame-placement plan (from xnet_plan_frame_placement). Requires confirmApply: true. Audited and rollbackable via xnet_rollback_page_markdown.",
|
|
6462
|
+
risk: "high",
|
|
6463
|
+
requiredScopes: ["page.write"],
|
|
6464
|
+
inputSchema: {
|
|
6465
|
+
type: "object",
|
|
6466
|
+
properties: {
|
|
6467
|
+
plan: { type: "object", description: "The validated mutation plan." },
|
|
6468
|
+
confirmApply: { type: "boolean", description: "Must be true to apply." }
|
|
6469
|
+
},
|
|
6470
|
+
required: ["plan", "confirmApply"]
|
|
6471
|
+
}
|
|
6472
|
+
},
|
|
6473
|
+
execute: async (host, args) => host.applyPageMarkdown(args)
|
|
6474
|
+
};
|
|
6475
|
+
var composePageTool = {
|
|
6476
|
+
definition: {
|
|
6477
|
+
name: "xnet_compose_page",
|
|
6478
|
+
title: "Compose a page of frames",
|
|
6479
|
+
description: "Create a new page and seed it with intro text plus live frames (database views, page transclusions) in one audited step. The result is ordinary editable content \u2014 every frame stays live and human-editable. Requires confirmApply: true.",
|
|
6480
|
+
risk: "high",
|
|
6481
|
+
requiredScopes: ["page.write"],
|
|
6482
|
+
inputSchema: {
|
|
6483
|
+
type: "object",
|
|
6484
|
+
properties: {
|
|
6485
|
+
title: { type: "string", description: "New page title." },
|
|
6486
|
+
intro: { type: "string", description: "Optional intro paragraph (markdown)." },
|
|
6487
|
+
placements: placementsSchema,
|
|
6488
|
+
confirmApply: { type: "boolean", description: "Must be true to create and compose." },
|
|
6489
|
+
intent: { type: "string" }
|
|
6490
|
+
},
|
|
6491
|
+
required: ["title", "placements", "confirmApply"]
|
|
6492
|
+
}
|
|
6493
|
+
},
|
|
6494
|
+
execute: async (host, args) => {
|
|
6495
|
+
const title = readRequiredString(args, "title");
|
|
6496
|
+
const placements = readPlacements(args);
|
|
6497
|
+
const body = frameMarkdownBody(readOptionalString(args, "intro"), placements);
|
|
6498
|
+
return host.composePage({
|
|
6499
|
+
title,
|
|
6500
|
+
markdown: body,
|
|
6501
|
+
confirmApply: args.confirmApply === true,
|
|
6502
|
+
actor: readOptionalString(args, "actor") ?? "ai-agent",
|
|
6503
|
+
intent: readOptionalString(args, "intent") ?? `Compose page "${title}"`,
|
|
6504
|
+
extra: readOptionalRecord(args, "extra") ?? void 0
|
|
6505
|
+
});
|
|
6506
|
+
}
|
|
6507
|
+
};
|
|
6508
|
+
var frameToolEntries = [
|
|
6509
|
+
planFramePlacementTool,
|
|
6510
|
+
applyFramePlacementTool,
|
|
6511
|
+
composePageTool
|
|
6512
|
+
];
|
|
6513
|
+
|
|
6351
6514
|
// src/ai-surface/tools/search.ts
|
|
6352
6515
|
var searchTool4 = {
|
|
6353
6516
|
definition: {
|
|
@@ -6473,7 +6636,9 @@ var BUILT_IN_TOOL_ENTRIES = [
|
|
|
6473
6636
|
rollbackPageMarkdownTool,
|
|
6474
6637
|
...databaseToolEntries,
|
|
6475
6638
|
...canvasToolEntries,
|
|
6476
|
-
validateMutationPlanTool
|
|
6639
|
+
validateMutationPlanTool,
|
|
6640
|
+
// Frame placement (0346) — appended last to keep prior positions stable.
|
|
6641
|
+
...frameToolEntries
|
|
6477
6642
|
];
|
|
6478
6643
|
var BUILT_IN_TOOLS_BY_NAME = new Map(
|
|
6479
6644
|
BUILT_IN_TOOL_ENTRIES.map((entry) => [entry.definition.name, entry])
|
|
@@ -6532,6 +6697,7 @@ var AiSurfaceService = class {
|
|
|
6532
6697
|
planPagePatch: (args) => this.planPagePatch(args),
|
|
6533
6698
|
applyPageMarkdown: (args) => this.applyPageMarkdown(args),
|
|
6534
6699
|
rollbackPageMarkdown: (args) => this.rollbackPageMarkdown(args),
|
|
6700
|
+
composePage: (args) => this.composePage(args),
|
|
6535
6701
|
getAuditLog: (options) => this.getAuditLog(options),
|
|
6536
6702
|
describeDatabase: (databaseId, options) => this.describeDatabase(databaseId, options),
|
|
6537
6703
|
readDatabaseViews: (databaseId) => this.readDatabaseViews(databaseId),
|
|
@@ -6972,6 +7138,42 @@ var AiSurfaceService = class {
|
|
|
6972
7138
|
errors: markdownValidation.validation.errors
|
|
6973
7139
|
});
|
|
6974
7140
|
}
|
|
7141
|
+
/**
|
|
7142
|
+
* Compose a page of frames (0346, Phase 5): create the Page node, then
|
|
7143
|
+
* plan + apply its markdown content (intro + frame directives) through
|
|
7144
|
+
* the standard page pipeline — one audited step, rollbackable via the
|
|
7145
|
+
* page-markdown rollback handle (the created page itself is reported
|
|
7146
|
+
* so a rejected compose can be cleaned up).
|
|
7147
|
+
*/
|
|
7148
|
+
async composePage(args) {
|
|
7149
|
+
if (!args.confirmApply) {
|
|
7150
|
+
throw new Error("confirmApply must be true to compose a page");
|
|
7151
|
+
}
|
|
7152
|
+
const created = await this.config.store.create({
|
|
7153
|
+
schemaId: "xnet://xnet.fyi/Page@1.0.0",
|
|
7154
|
+
properties: { title: args.title, ...args.extra ?? {} }
|
|
7155
|
+
});
|
|
7156
|
+
const frontmatterBody = args.markdown;
|
|
7157
|
+
const plan = await this.planPagePatch({
|
|
7158
|
+
pageId: created.id,
|
|
7159
|
+
markdown: frontmatterBody,
|
|
7160
|
+
actor: args.actor ?? "ai-agent",
|
|
7161
|
+
intent: args.intent ?? `Compose page "${args.title}"`
|
|
7162
|
+
});
|
|
7163
|
+
if (plan.status !== "validated") {
|
|
7164
|
+
return { pageId: created.id, planId: plan.id, applied: false, plan };
|
|
7165
|
+
}
|
|
7166
|
+
const result = await this.applyPageMarkdown({
|
|
7167
|
+
plan,
|
|
7168
|
+
confirmApply: true
|
|
7169
|
+
});
|
|
7170
|
+
return {
|
|
7171
|
+
pageId: created.id,
|
|
7172
|
+
planId: plan.id,
|
|
7173
|
+
applied: result.applied ?? false,
|
|
7174
|
+
result
|
|
7175
|
+
};
|
|
7176
|
+
}
|
|
6975
7177
|
async applyPageMarkdown(args) {
|
|
6976
7178
|
const confirmApply = readOptionalBoolean(args, "confirmApply") ?? false;
|
|
6977
7179
|
if (!confirmApply) {
|
|
@@ -11698,7 +11900,7 @@ var AiBudgetError = class extends Error {
|
|
|
11698
11900
|
}
|
|
11699
11901
|
};
|
|
11700
11902
|
var ManagedProvider = class {
|
|
11701
|
-
name = "
|
|
11903
|
+
name = "xNet Cloud";
|
|
11702
11904
|
baseUrl;
|
|
11703
11905
|
model;
|
|
11704
11906
|
fetchImpl;
|
|
@@ -12811,7 +13013,7 @@ var CONNECTOR_META = {
|
|
|
12811
13013
|
// Preferred when available: no key to paste, metered + budget-capped, switchable
|
|
12812
13014
|
// models — the managed path the rest of this exploration (0208) wires up.
|
|
12813
13015
|
managed: {
|
|
12814
|
-
label: "
|
|
13016
|
+
label: "xNet Cloud (managed, metered)",
|
|
12815
13017
|
toolCalling: "reliable",
|
|
12816
13018
|
preference: 0
|
|
12817
13019
|
},
|
|
@@ -12911,7 +13113,7 @@ async function detectConnectors(env = {}) {
|
|
|
12911
13113
|
{
|
|
12912
13114
|
tier: "managed",
|
|
12913
13115
|
available: managed,
|
|
12914
|
-
...managed ? {} : { setupHint: "Managed AI is available on
|
|
13116
|
+
...managed ? {} : { setupHint: "Managed AI is available on xNet Cloud plans with AI enabled." }
|
|
12915
13117
|
},
|
|
12916
13118
|
{
|
|
12917
13119
|
tier: "bridge",
|
package/dist/services/node.d.ts
CHANGED
|
@@ -379,6 +379,14 @@ declare class AiSurfaceService {
|
|
|
379
379
|
private readPageMarkdown;
|
|
380
380
|
private readPageOutline;
|
|
381
381
|
private planPagePatch;
|
|
382
|
+
/**
|
|
383
|
+
* Compose a page of frames (0346, Phase 5): create the Page node, then
|
|
384
|
+
* plan + apply its markdown content (intro + frame directives) through
|
|
385
|
+
* the standard page pipeline — one audited step, rollbackable via the
|
|
386
|
+
* page-markdown rollback handle (the created page itself is reported
|
|
387
|
+
* so a rejected compose can be cleaned up).
|
|
388
|
+
*/
|
|
389
|
+
private composePage;
|
|
382
390
|
private applyPageMarkdown;
|
|
383
391
|
private finalizeAppliedPageMarkdown;
|
|
384
392
|
private getAuditLog;
|
package/dist/services/node.js
CHANGED
|
@@ -1279,6 +1279,156 @@ var rollbackPageMarkdownTool = {
|
|
|
1279
1279
|
execute: async (host, args) => await host.rollbackPageMarkdown(args)
|
|
1280
1280
|
};
|
|
1281
1281
|
|
|
1282
|
+
// src/ai-surface/tools/frames.ts
|
|
1283
|
+
function readPlacements(args) {
|
|
1284
|
+
const raw = args.placements;
|
|
1285
|
+
if (!Array.isArray(raw) || raw.length === 0) {
|
|
1286
|
+
throw new Error("placements must be a non-empty array");
|
|
1287
|
+
}
|
|
1288
|
+
return raw.map((entry, index) => {
|
|
1289
|
+
if (typeof entry !== "object" || entry === null) {
|
|
1290
|
+
throw new Error(`placements[${index}] must be an object`);
|
|
1291
|
+
}
|
|
1292
|
+
const record = entry;
|
|
1293
|
+
const nodeId = record.nodeId;
|
|
1294
|
+
if (typeof nodeId !== "string" || !nodeId) {
|
|
1295
|
+
throw new Error(`placements[${index}].nodeId is required`);
|
|
1296
|
+
}
|
|
1297
|
+
const kind = record.kind === "page" ? "page" : "database";
|
|
1298
|
+
return {
|
|
1299
|
+
nodeId,
|
|
1300
|
+
kind,
|
|
1301
|
+
viewType: typeof record.viewType === "string" ? record.viewType : void 0,
|
|
1302
|
+
title: typeof record.title === "string" ? record.title : void 0,
|
|
1303
|
+
config: typeof record.config === "object" && record.config !== null ? record.config : void 0
|
|
1304
|
+
};
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
function framePlacementDirective(placement) {
|
|
1308
|
+
if (placement.kind === "page") {
|
|
1309
|
+
const payload2 = { nodeId: placement.nodeId, title: placement.title ?? "" };
|
|
1310
|
+
return `:::xnet-page
|
|
1311
|
+
${JSON.stringify(payload2)}
|
|
1312
|
+
:::`;
|
|
1313
|
+
}
|
|
1314
|
+
const payload = {
|
|
1315
|
+
databaseId: placement.nodeId,
|
|
1316
|
+
viewType: placement.viewType ?? "table",
|
|
1317
|
+
viewConfig: placement.config ?? {}
|
|
1318
|
+
};
|
|
1319
|
+
return `:::xnet-database
|
|
1320
|
+
${JSON.stringify(payload)}
|
|
1321
|
+
:::`;
|
|
1322
|
+
}
|
|
1323
|
+
function frameMarkdownBody(intro, placements) {
|
|
1324
|
+
const sections = placements.map((p) => framePlacementDirective(p));
|
|
1325
|
+
return [intro?.trim(), ...sections].filter(Boolean).join("\n\n");
|
|
1326
|
+
}
|
|
1327
|
+
var placementsSchema = {
|
|
1328
|
+
type: "array",
|
|
1329
|
+
description: 'Frames to place, in order. kind "database" embeds a live database view (viewType: table | board | list | gallery | calendar | timeline | map | plugin types); kind "page" embeds a live page transclusion.',
|
|
1330
|
+
items: {
|
|
1331
|
+
type: "object",
|
|
1332
|
+
properties: {
|
|
1333
|
+
nodeId: { type: "string", description: "Target node id (database or page)." },
|
|
1334
|
+
kind: { type: "string", enum: ["database", "page"] },
|
|
1335
|
+
viewType: { type: "string", description: "Registry view type for database frames." },
|
|
1336
|
+
title: { type: "string", description: "Display title for page frames." },
|
|
1337
|
+
config: { type: "object", description: "Per-view presentation config." }
|
|
1338
|
+
},
|
|
1339
|
+
required: ["nodeId"]
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
1342
|
+
var planFramePlacementTool = {
|
|
1343
|
+
definition: {
|
|
1344
|
+
name: "xnet_plan_frame_placement",
|
|
1345
|
+
title: "Plan frame placement",
|
|
1346
|
+
description: "Plan appending live frames (database views, page transclusions) to an existing page. Returns a validated mutation plan with a review diff; apply with xnet_apply_frame_placement.",
|
|
1347
|
+
risk: "medium",
|
|
1348
|
+
requiredScopes: ["page.read", "page.propose"],
|
|
1349
|
+
inputSchema: {
|
|
1350
|
+
type: "object",
|
|
1351
|
+
properties: {
|
|
1352
|
+
pageId: { type: "string", description: "Page to place frames on." },
|
|
1353
|
+
placements: placementsSchema,
|
|
1354
|
+
intent: { type: "string", description: "Why these frames are being placed." }
|
|
1355
|
+
},
|
|
1356
|
+
required: ["pageId", "placements"]
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
execute: async (host, args) => {
|
|
1360
|
+
const pageId = readRequiredString(args, "pageId");
|
|
1361
|
+
const placements = readPlacements(args);
|
|
1362
|
+
const current = await host.readPageMarkdown(pageId, true);
|
|
1363
|
+
const markdown = `${current.text.trimEnd()}
|
|
1364
|
+
|
|
1365
|
+
${frameMarkdownBody(void 0, placements)}
|
|
1366
|
+
`;
|
|
1367
|
+
return host.planPagePatch({
|
|
1368
|
+
pageId,
|
|
1369
|
+
markdown,
|
|
1370
|
+
actor: readOptionalString(args, "actor") ?? "ai-agent",
|
|
1371
|
+
intent: readOptionalString(args, "intent") ?? `Place ${placements.length} frame${placements.length === 1 ? "" : "s"} on the page`
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
};
|
|
1375
|
+
var applyFramePlacementTool = {
|
|
1376
|
+
definition: {
|
|
1377
|
+
name: "xnet_apply_frame_placement",
|
|
1378
|
+
title: "Apply frame placement",
|
|
1379
|
+
description: "Apply a validated frame-placement plan (from xnet_plan_frame_placement). Requires confirmApply: true. Audited and rollbackable via xnet_rollback_page_markdown.",
|
|
1380
|
+
risk: "high",
|
|
1381
|
+
requiredScopes: ["page.write"],
|
|
1382
|
+
inputSchema: {
|
|
1383
|
+
type: "object",
|
|
1384
|
+
properties: {
|
|
1385
|
+
plan: { type: "object", description: "The validated mutation plan." },
|
|
1386
|
+
confirmApply: { type: "boolean", description: "Must be true to apply." }
|
|
1387
|
+
},
|
|
1388
|
+
required: ["plan", "confirmApply"]
|
|
1389
|
+
}
|
|
1390
|
+
},
|
|
1391
|
+
execute: async (host, args) => host.applyPageMarkdown(args)
|
|
1392
|
+
};
|
|
1393
|
+
var composePageTool = {
|
|
1394
|
+
definition: {
|
|
1395
|
+
name: "xnet_compose_page",
|
|
1396
|
+
title: "Compose a page of frames",
|
|
1397
|
+
description: "Create a new page and seed it with intro text plus live frames (database views, page transclusions) in one audited step. The result is ordinary editable content \u2014 every frame stays live and human-editable. Requires confirmApply: true.",
|
|
1398
|
+
risk: "high",
|
|
1399
|
+
requiredScopes: ["page.write"],
|
|
1400
|
+
inputSchema: {
|
|
1401
|
+
type: "object",
|
|
1402
|
+
properties: {
|
|
1403
|
+
title: { type: "string", description: "New page title." },
|
|
1404
|
+
intro: { type: "string", description: "Optional intro paragraph (markdown)." },
|
|
1405
|
+
placements: placementsSchema,
|
|
1406
|
+
confirmApply: { type: "boolean", description: "Must be true to create and compose." },
|
|
1407
|
+
intent: { type: "string" }
|
|
1408
|
+
},
|
|
1409
|
+
required: ["title", "placements", "confirmApply"]
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
execute: async (host, args) => {
|
|
1413
|
+
const title = readRequiredString(args, "title");
|
|
1414
|
+
const placements = readPlacements(args);
|
|
1415
|
+
const body = frameMarkdownBody(readOptionalString(args, "intro"), placements);
|
|
1416
|
+
return host.composePage({
|
|
1417
|
+
title,
|
|
1418
|
+
markdown: body,
|
|
1419
|
+
confirmApply: args.confirmApply === true,
|
|
1420
|
+
actor: readOptionalString(args, "actor") ?? "ai-agent",
|
|
1421
|
+
intent: readOptionalString(args, "intent") ?? `Compose page "${title}"`,
|
|
1422
|
+
extra: readOptionalRecord(args, "extra") ?? void 0
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
};
|
|
1426
|
+
var frameToolEntries = [
|
|
1427
|
+
planFramePlacementTool,
|
|
1428
|
+
applyFramePlacementTool,
|
|
1429
|
+
composePageTool
|
|
1430
|
+
];
|
|
1431
|
+
|
|
1282
1432
|
// src/ai-surface/tools/search.ts
|
|
1283
1433
|
var searchTool = {
|
|
1284
1434
|
definition: {
|
|
@@ -1404,7 +1554,9 @@ var BUILT_IN_TOOL_ENTRIES = [
|
|
|
1404
1554
|
rollbackPageMarkdownTool,
|
|
1405
1555
|
...databaseToolEntries,
|
|
1406
1556
|
...canvasToolEntries,
|
|
1407
|
-
validateMutationPlanTool
|
|
1557
|
+
validateMutationPlanTool,
|
|
1558
|
+
// Frame placement (0346) — appended last to keep prior positions stable.
|
|
1559
|
+
...frameToolEntries
|
|
1408
1560
|
];
|
|
1409
1561
|
var BUILT_IN_TOOLS_BY_NAME = new Map(
|
|
1410
1562
|
BUILT_IN_TOOL_ENTRIES.map((entry) => [entry.definition.name, entry])
|
|
@@ -1463,6 +1615,7 @@ var AiSurfaceService = class {
|
|
|
1463
1615
|
planPagePatch: (args) => this.planPagePatch(args),
|
|
1464
1616
|
applyPageMarkdown: (args) => this.applyPageMarkdown(args),
|
|
1465
1617
|
rollbackPageMarkdown: (args) => this.rollbackPageMarkdown(args),
|
|
1618
|
+
composePage: (args) => this.composePage(args),
|
|
1466
1619
|
getAuditLog: (options) => this.getAuditLog(options),
|
|
1467
1620
|
describeDatabase: (databaseId, options) => this.describeDatabase(databaseId, options),
|
|
1468
1621
|
readDatabaseViews: (databaseId) => this.readDatabaseViews(databaseId),
|
|
@@ -1903,6 +2056,42 @@ var AiSurfaceService = class {
|
|
|
1903
2056
|
errors: markdownValidation.validation.errors
|
|
1904
2057
|
});
|
|
1905
2058
|
}
|
|
2059
|
+
/**
|
|
2060
|
+
* Compose a page of frames (0346, Phase 5): create the Page node, then
|
|
2061
|
+
* plan + apply its markdown content (intro + frame directives) through
|
|
2062
|
+
* the standard page pipeline — one audited step, rollbackable via the
|
|
2063
|
+
* page-markdown rollback handle (the created page itself is reported
|
|
2064
|
+
* so a rejected compose can be cleaned up).
|
|
2065
|
+
*/
|
|
2066
|
+
async composePage(args) {
|
|
2067
|
+
if (!args.confirmApply) {
|
|
2068
|
+
throw new Error("confirmApply must be true to compose a page");
|
|
2069
|
+
}
|
|
2070
|
+
const created = await this.config.store.create({
|
|
2071
|
+
schemaId: "xnet://xnet.fyi/Page@1.0.0",
|
|
2072
|
+
properties: { title: args.title, ...args.extra ?? {} }
|
|
2073
|
+
});
|
|
2074
|
+
const frontmatterBody = args.markdown;
|
|
2075
|
+
const plan = await this.planPagePatch({
|
|
2076
|
+
pageId: created.id,
|
|
2077
|
+
markdown: frontmatterBody,
|
|
2078
|
+
actor: args.actor ?? "ai-agent",
|
|
2079
|
+
intent: args.intent ?? `Compose page "${args.title}"`
|
|
2080
|
+
});
|
|
2081
|
+
if (plan.status !== "validated") {
|
|
2082
|
+
return { pageId: created.id, planId: plan.id, applied: false, plan };
|
|
2083
|
+
}
|
|
2084
|
+
const result = await this.applyPageMarkdown({
|
|
2085
|
+
plan,
|
|
2086
|
+
confirmApply: true
|
|
2087
|
+
});
|
|
2088
|
+
return {
|
|
2089
|
+
pageId: created.id,
|
|
2090
|
+
planId: plan.id,
|
|
2091
|
+
applied: result.applied ?? false,
|
|
2092
|
+
result
|
|
2093
|
+
};
|
|
2094
|
+
}
|
|
1906
2095
|
async applyPageMarkdown(args) {
|
|
1907
2096
|
const confirmApply = readOptionalBoolean(args, "confirmApply") ?? false;
|
|
1908
2097
|
if (!confirmApply) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xnetjs/plugins",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./node": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"types": "./dist/services/node.d.ts",
|
|
19
|
+
"import": "./dist/services/node.js"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"acorn": "^8.15.0",
|
|
33
33
|
"yjs": "^13.6.24",
|
|
34
|
-
"@xnetjs/abuse": "
|
|
35
|
-
"@xnetjs/core": "
|
|
36
|
-
"@xnetjs/trust": "0.0.
|
|
37
|
-
"@xnetjs/data": "
|
|
38
|
-
"@xnetjs/slack-compat": "0.0.
|
|
34
|
+
"@xnetjs/abuse": "3.0.0",
|
|
35
|
+
"@xnetjs/core": "3.0.0",
|
|
36
|
+
"@xnetjs/trust": "0.0.3",
|
|
37
|
+
"@xnetjs/data": "3.0.0",
|
|
38
|
+
"@xnetjs/slack-compat": "0.0.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^18.0.0"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"tsup": "^8.0.0",
|
|
48
48
|
"typescript": "^5.4.0",
|
|
49
49
|
"vitest": "^4.0.0",
|
|
50
|
-
"@xnetjs/licenses": "0.0.
|
|
50
|
+
"@xnetjs/licenses": "0.0.25"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "tsup",
|