@eworkbase/sdk 0.8.6 → 0.8.7
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/{ExecutionLog.dto-Bq2u5C90.d.ts → ExecutionLog.dto-ig9GUWhK.d.ts} +1 -1
- package/dist/{components-DxL-99bM.js → components-V_fFZLTU.js} +41 -1
- package/dist/index.d.ts +3 -3
- package/dist/markdown.d.ts +1 -1
- package/dist/{types-b6G-gae3.d.ts → types-3v3whlPt.d.ts} +14 -2
- package/dist/{types-DDEHTBRv.d.ts → types-D1Ezgwbv.d.ts} +14 -2
- package/dist/ui/components.d.ts +9 -2
- package/dist/ui/components.js +2 -2
- package/dist/ui/error-panel.d.ts +1 -0
- package/dist/ui/error-panel.js +68 -2
- package/dist/ui/execution-log.d.ts +1 -1
- package/dist/ui/hooks.d.ts +1 -1
- package/dist/ui/hooks.js +2 -2
- package/dist/ui/index.css +10 -1
- package/dist/ui/index.d.ts +5 -4
- package/dist/ui/index.js +1 -1
- package/dist/ui/markdown-links.d.ts +1 -1
- package/dist/ui/model.d.ts +1 -1
- package/dist/ui/theme.css +73 -0
- package/dist/{ui-DGLeDJDe.js → ui-DC0oqP79.js} +55 -1
- package/package.json +1 -1
|
@@ -84,6 +84,46 @@ const PluginEmptyState = memo(function PluginEmptyState({ title, description, ic
|
|
|
84
84
|
]
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
+
const PluginPublicationButton = memo(function PluginPublicationButton({ label, count, isLoading = false, icon, disabled, className, type = "button", ...attributes }) {
|
|
88
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
89
|
+
...attributes,
|
|
90
|
+
type,
|
|
91
|
+
disabled: disabled || isLoading,
|
|
92
|
+
"aria-busy": isLoading || void 0,
|
|
93
|
+
"data-pending-count": count,
|
|
94
|
+
className: joinClassNames("workbase-publish-button", className),
|
|
95
|
+
children: [
|
|
96
|
+
isLoading ? /* @__PURE__ */ jsx("span", {
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
className: "workbase-pill-spinner"
|
|
99
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
100
|
+
"aria-hidden": "true",
|
|
101
|
+
className: "workbase-publish-icon",
|
|
102
|
+
children: icon ?? /* @__PURE__ */ jsxs("svg", {
|
|
103
|
+
viewBox: "0 0 24 24",
|
|
104
|
+
fill: "none",
|
|
105
|
+
stroke: "currentColor",
|
|
106
|
+
strokeWidth: "2",
|
|
107
|
+
strokeLinecap: "round",
|
|
108
|
+
strokeLinejoin: "round",
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx("path", { d: "M12 16V4" }),
|
|
111
|
+
/* @__PURE__ */ jsx("path", { d: "m7 9 5-5 5 5" }),
|
|
112
|
+
/* @__PURE__ */ jsx("path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" })
|
|
113
|
+
]
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ jsx("span", {
|
|
117
|
+
className: "workbase-publish-label",
|
|
118
|
+
children: label
|
|
119
|
+
}),
|
|
120
|
+
count > 0 ? /* @__PURE__ */ jsx("span", {
|
|
121
|
+
className: "workbase-publish-count",
|
|
122
|
+
children: count
|
|
123
|
+
}) : null
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
});
|
|
87
127
|
var PluginErrorBoundary = class extends Component {
|
|
88
128
|
state = {
|
|
89
129
|
error: null,
|
|
@@ -128,4 +168,4 @@ function joinClassNames(...values) {
|
|
|
128
168
|
return values.filter(Boolean).join(" ");
|
|
129
169
|
}
|
|
130
170
|
//#endregion
|
|
131
|
-
export {
|
|
171
|
+
export { PluginStatusPill as a, PluginPublicationButton as i, PluginErrorBoundary as n, PluginStatusTone as o, PluginInlineError as r, PluginEmptyState as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as executionLogRecordSchema, i as executionLogEntrySchema, n as ExecutionLogEntryKind, r as ExecutionLogRecord, t as ExecutionLogEntry } from "./ExecutionLog.dto-
|
|
2
|
-
import { $ as WorkbasePluginDefinition, A as PluginLifecycleStatus, At as
|
|
1
|
+
import { a as executionLogRecordSchema, i as executionLogEntrySchema, n as ExecutionLogEntryKind, r as ExecutionLogRecord, t as ExecutionLogEntry } from "./ExecutionLog.dto-ig9GUWhK.js";
|
|
2
|
+
import { $ as WorkbasePluginDefinition, A as PluginLifecycleStatus, At as PluginToastApi, B as PluginRepository, Bt as roleToolEnvironmentSchema, C as PluginHookId, Ct as PluginPublicationChanges, D as PluginLifecycleHook, Dt as PluginTaskDescriptor, E as PluginLifecycleDispatchResult, Et as PluginSystemContextService, F as PluginProcessApi, Ft as PluginViewStateService, G as PluginStatusContribution, H as PluginSetupHooks, Ht as roleToolsProposalSchema, I as PluginProcessOutputMode, It as PluginToolsService, J as PluginViewContribution, K as PluginStatusDefinition, L as PluginProcessResult, Lt as RoleToolEnvironment, M as PluginOverviewCardData, Mt as PluginToastOptions, N as PluginOverviewCardDefinition, Nt as PluginViewCatalogEntry, O as PluginLifecycleOutcome, Ot as PluginTaskResult, P as PluginOverviewCardStatus, Pt as PluginViewStatePublishOptions, Q as PluginWorkspace, R as PluginProcessRunOptions, Rt as RoleToolsApplied, S as PluginFileChange, St as PluginPromptViewRequest, T as PluginInvocationContext, Tt as PluginStoreApi, U as PluginSharedChangeKind, V as PluginRepositoryStatus, Vt as roleToolsAppliedSchema, W as PluginSharedChanges, X as PluginViewLayout, Y as PluginViewDefinition, Z as PluginViewMethod, _ as PluginContributionSnapshot, _t as PluginProjectWorkspaceSummary, a as PluginCapabilityReference, at as PluginCapabilityCommandRequest, b as PluginExecutionSnapshot, bt as PluginPromptQuestion, c as PluginCommandContribution, ct as PluginCommandCatalogEntry, d as PluginCommandEffect, dt as PluginHostServices, et as DEFAULT_VIEW_STATE_TOPIC, f as PluginCommandExecutionResult, ft as PluginInteractiveLogger, g as PluginContextExposure, gt as PluginLogService, h as PluginContext, ht as PluginLogQueryResult, i as PluginCapabilityKind, it as PluginCapabilityCatalog, j as PluginLogger, jt as PluginToastLevel, k as PluginLifecyclePolicy, kt as PluginTaskService, l as PluginCommandDefinition, lt as PluginConfigApi, m as PluginCommandTransaction, mt as PluginLogQueryRequest, n as PluginAgentContextDefinition, nt as PluginAgentContextCatalogEntry, o as PluginCardAction, ot as PluginCapabilityResolveRequest, p as PluginCommandLogPolicy, pt as PluginLogEntry, q as PluginToolContribution, r as PluginAgentScope, rt as PluginAgentPolicy, s as PluginCommandContext, st as PluginCapabilityService, t as PluginAgentContextContribution, tt as MAXIMUM_VIEW_STATE_BYTES, u as PluginCommandDetails, ut as PluginExecutionService, v as PluginDisposable, vt as PluginPromptApi, w as PluginHookResult, wt as PluginStatusCatalogEntry, x as PluginExecutionStatus, xt as PluginPromptType, y as PluginExecutionEvidence, yt as PluginPromptChoice, z as PluginProject, zt as RoleToolsProposal } from "./types-D1Ezgwbv.js";
|
|
3
3
|
import { ZodError, ZodType, z } from "zod";
|
|
4
4
|
//#region src/error.d.ts
|
|
5
5
|
/**
|
|
@@ -25,4 +25,4 @@ type DefinedWorkbasePlugin = Readonly<WorkbasePluginDefinition>;
|
|
|
25
25
|
export declare function definePlugin(definition: WorkbasePluginDefinition): DefinedWorkbasePlugin;
|
|
26
26
|
export declare function isDefinedPlugin(value: unknown): value is DefinedWorkbasePlugin;
|
|
27
27
|
//#endregion
|
|
28
|
-
export { DEFAULT_VIEW_STATE_TOPIC, type DefinedWorkbasePlugin, type ExecutionLogEntry, ExecutionLogEntryKind, type ExecutionLogRecord, MAXIMUM_VIEW_STATE_BYTES, type PluginAgentContextCatalogEntry, type PluginAgentContextContribution, type PluginAgentContextDefinition, type PluginAgentPolicy, PluginAgentScope, type PluginCapabilityCatalog, type PluginCapabilityCommandRequest, PluginCapabilityKind, type PluginCapabilityReference, type PluginCapabilityResolveRequest, type PluginCapabilityService, type PluginCardAction, type PluginCommandCatalogEntry, type PluginCommandContext, type PluginCommandContribution, type PluginCommandDefinition, type PluginCommandDetails, PluginCommandEffect, type PluginCommandExecutionResult, PluginCommandLogPolicy, PluginCommandTransaction, type PluginConfigApi, type PluginContext, PluginContextExposure, type PluginContributionSnapshot, type PluginDisposable, type PluginErrorOptions, type PluginExecutionEvidence, type PluginExecutionService, type PluginExecutionSnapshot, PluginExecutionStatus, type PluginFileChange, PluginHookId, type PluginHookResult, type PluginHostServices, type PluginInteractiveLogger, type PluginInvocationContext, type PluginLifecycleDispatchResult, type PluginLifecycleHook, type PluginLifecycleOutcome, PluginLifecyclePolicy, PluginLifecycleStatus, type PluginLogEntry, type PluginLogQueryRequest, type PluginLogQueryResult, type PluginLogService, type PluginLogger, type PluginOverviewCardData, type PluginOverviewCardDefinition, type PluginOverviewCardStatus, type PluginProcessApi, PluginProcessOutputMode, type PluginProcessResult, type PluginProcessRunOptions, type PluginProject, type PluginPromptApi, type PluginPromptChoice, type PluginPromptQuestion, type PluginPromptType, type PluginPromptViewRequest, type PluginPublicationChanges, type PluginRepository, PluginRepositoryStatus, type PluginSetupHooks, PluginSharedChangeKind, type PluginSharedChanges, type PluginStatusCatalogEntry, type PluginStatusContribution, type PluginStatusDefinition, type PluginStoreApi, type PluginSystemContextService, type PluginTaskDescriptor, type PluginTaskResult, type PluginTaskService, type PluginToastApi, type PluginToastLevel, type PluginToastOptions, type PluginToolContribution, PluginToolsService, type PluginViewCatalogEntry, type PluginViewContribution, type PluginViewDefinition, PluginViewLayout, PluginViewMethod, type PluginViewStatePublishOptions, type PluginViewStateService, type PluginWorkspace, RoleToolEnvironment, RoleToolsApplied, RoleToolsProposal, type WorkbasePluginDefinition, ZodError, type ZodType, executionLogEntrySchema, executionLogRecordSchema, roleToolEnvironmentSchema, roleToolsAppliedSchema, roleToolsProposalSchema, z };
|
|
28
|
+
export { DEFAULT_VIEW_STATE_TOPIC, type DefinedWorkbasePlugin, type ExecutionLogEntry, ExecutionLogEntryKind, type ExecutionLogRecord, MAXIMUM_VIEW_STATE_BYTES, type PluginAgentContextCatalogEntry, type PluginAgentContextContribution, type PluginAgentContextDefinition, type PluginAgentPolicy, PluginAgentScope, type PluginCapabilityCatalog, type PluginCapabilityCommandRequest, PluginCapabilityKind, type PluginCapabilityReference, type PluginCapabilityResolveRequest, type PluginCapabilityService, type PluginCardAction, type PluginCommandCatalogEntry, type PluginCommandContext, type PluginCommandContribution, type PluginCommandDefinition, type PluginCommandDetails, PluginCommandEffect, type PluginCommandExecutionResult, PluginCommandLogPolicy, PluginCommandTransaction, type PluginConfigApi, type PluginContext, PluginContextExposure, type PluginContributionSnapshot, type PluginDisposable, type PluginErrorOptions, type PluginExecutionEvidence, type PluginExecutionService, type PluginExecutionSnapshot, PluginExecutionStatus, type PluginFileChange, PluginHookId, type PluginHookResult, type PluginHostServices, type PluginInteractiveLogger, type PluginInvocationContext, type PluginLifecycleDispatchResult, type PluginLifecycleHook, type PluginLifecycleOutcome, PluginLifecyclePolicy, PluginLifecycleStatus, type PluginLogEntry, type PluginLogQueryRequest, type PluginLogQueryResult, type PluginLogService, type PluginLogger, type PluginOverviewCardData, type PluginOverviewCardDefinition, type PluginOverviewCardStatus, type PluginProcessApi, PluginProcessOutputMode, type PluginProcessResult, type PluginProcessRunOptions, type PluginProject, type PluginProjectWorkspaceSummary, type PluginPromptApi, type PluginPromptChoice, type PluginPromptQuestion, type PluginPromptType, type PluginPromptViewRequest, type PluginPublicationChanges, type PluginRepository, PluginRepositoryStatus, type PluginSetupHooks, PluginSharedChangeKind, type PluginSharedChanges, type PluginStatusCatalogEntry, type PluginStatusContribution, type PluginStatusDefinition, type PluginStoreApi, type PluginSystemContextService, type PluginTaskDescriptor, type PluginTaskResult, type PluginTaskService, type PluginToastApi, type PluginToastLevel, type PluginToastOptions, type PluginToolContribution, PluginToolsService, type PluginViewCatalogEntry, type PluginViewContribution, type PluginViewDefinition, PluginViewLayout, PluginViewMethod, type PluginViewStatePublishOptions, type PluginViewStateService, type PluginWorkspace, RoleToolEnvironment, RoleToolsApplied, RoleToolsProposal, type WorkbasePluginDefinition, ZodError, type ZodType, executionLogEntrySchema, executionLogRecordSchema, roleToolEnvironmentSchema, roleToolsAppliedSchema, roleToolsProposalSchema, z };
|
package/dist/markdown.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as PluginExecutionSnapshot, f as PluginCommandExecutionResult, jt as PluginToastLevel } from "./types-D1Ezgwbv.js";
|
|
2
2
|
//#region src/ui/types.d.ts
|
|
3
3
|
type PluginUiPromptType = 'confirm' | 'multi-select' | 'select' | 'text';
|
|
4
4
|
type PluginUiFileSelectionScope = 'project' | 'workspace';
|
|
@@ -10,7 +10,14 @@ interface PluginUiViewIdentity extends PluginUiContextIdentity {
|
|
|
10
10
|
readonly pluginId: string;
|
|
11
11
|
readonly title: string;
|
|
12
12
|
}
|
|
13
|
+
interface PluginUiActivationState {
|
|
14
|
+
readonly status: 'loading' | 'blocked' | 'failed' | 'ready';
|
|
15
|
+
readonly error: string | null;
|
|
16
|
+
readonly blockedByPluginId?: string | null;
|
|
17
|
+
}
|
|
13
18
|
interface PluginUiInitializationPayload {
|
|
19
|
+
/** Current host activation state of this plugin; updated in place without recreating the view. */
|
|
20
|
+
readonly activation?: PluginUiActivationState;
|
|
14
21
|
/** Accepted configuration for a view that refreshes in place. */
|
|
15
22
|
readonly configurationRevision?: string;
|
|
16
23
|
/** Changes when the workspace is prepared again; route changes retain the same generation. */
|
|
@@ -109,6 +116,10 @@ interface PluginUiStateChange<State = unknown> {
|
|
|
109
116
|
interface PluginUiView {
|
|
110
117
|
/** Report in-memory edits to the navigation for this view instance. */
|
|
111
118
|
readonly setModified: (modified: boolean) => Promise<void>;
|
|
119
|
+
/** Declare whether this view currently renders its own recovery surface for the host activation error. */
|
|
120
|
+
readonly setActivationErrorHandled?: (handled: boolean) => Promise<void>;
|
|
121
|
+
/** Subscribe to live host activation state changes for this plugin without recreating the view. */
|
|
122
|
+
readonly onActivationChanged?: (listener: (activation: PluginUiActivationState) => void) => () => void;
|
|
112
123
|
/** Refresh retained data when this plugin's declared files change. */
|
|
113
124
|
readonly onFilesChanged: (refresh: () => void | Promise<unknown>) => () => void;
|
|
114
125
|
/** Subscribe to backend-pushed state snapshots for a topic (defaults to "default"). */
|
|
@@ -187,6 +198,7 @@ interface PluginUiHostMethods {
|
|
|
187
198
|
readonly reportFatal: (message: string) => Promise<void>;
|
|
188
199
|
}
|
|
189
200
|
interface PluginUiClientMethods {
|
|
201
|
+
readonly activationChanged?: (activation: PluginUiActivationState) => Promise<void>;
|
|
190
202
|
readonly filesChanged: () => Promise<void>;
|
|
191
203
|
readonly executionChanged: (change: PluginUiExecutionChange) => Promise<void>;
|
|
192
204
|
readonly stateChanged: (change: PluginUiStateChange) => Promise<void>;
|
|
@@ -201,4 +213,4 @@ interface PluginUiControllerOptions {
|
|
|
201
213
|
readonly targetWindow: Window & typeof globalThis;
|
|
202
214
|
}
|
|
203
215
|
//#endregion
|
|
204
|
-
export {
|
|
216
|
+
export { PluginUiTransportConnection as A, PluginUiPromptType as C, PluginUiStateChange as D, PluginUiRepositoryPushTarget as E, PluginUiViewIdentity as M, WorkbasePluginUi as N, PluginUiStatus as O, WorkbasePluginUiDefinition as P, PluginUiPromptOptions as S, PluginUiRepositoryPushResult as T, PluginUiInitializationPayload as _, PluginUiCommands as a, PluginUiOutputOptions as b, PluginUiDesktopOpenOptions as c, PluginUiFileFilter as d, PluginUiFileSelectOptions as f, PluginUiHostMethods as g, PluginUiHostError as h, PluginUiCommandExecuteOptions as i, PluginUiView as j, PluginUiToastOptions as k, PluginUiDesktopOpenResult as l, PluginUiFileSelectionScope as m, PluginUiActivationState as n, PluginUiContextIdentity as o, PluginUiFileSelectionItemType as p, PluginUiClientMethods as r, PluginUiControllerOptions as s, PluginDesktopTarget as t, PluginUiExecutionChange as u, PluginUiNavigateOptions as v, PluginUiRepositoryPushOutcome as w, PluginUiPromptChoice as x, PluginUiOpenViewOptions as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as ExecutionLogRecord, t as ExecutionLogEntry } from "./ExecutionLog.dto-
|
|
1
|
+
import { r as ExecutionLogRecord, t as ExecutionLogEntry } from "./ExecutionLog.dto-ig9GUWhK.js";
|
|
2
2
|
import { ZodType, z } from "zod";
|
|
3
3
|
//#region src/Tools.dto.d.ts
|
|
4
4
|
declare const roleToolEnvironmentSchema: z.ZodObject<{
|
|
@@ -247,6 +247,11 @@ interface PluginPublicationChanges {
|
|
|
247
247
|
readonly working: readonly string[];
|
|
248
248
|
readonly partiallyStaged: boolean;
|
|
249
249
|
}
|
|
250
|
+
interface PluginProjectWorkspaceSummary {
|
|
251
|
+
readonly id: string;
|
|
252
|
+
readonly title: string;
|
|
253
|
+
readonly status: "active" | "paused" | "archived";
|
|
254
|
+
}
|
|
250
255
|
interface PluginLogQueryRequest {
|
|
251
256
|
readonly cursor?: string;
|
|
252
257
|
readonly limit?: number;
|
|
@@ -332,8 +337,12 @@ interface PluginHostServices {
|
|
|
332
337
|
readonly notifyRepositoryChanged: (repositoryId: string) => Promise<void>;
|
|
333
338
|
/** Reads unpublished changes in a plugin-owned directory relative to the host's publication baseline. */
|
|
334
339
|
readonly readPublicationChanges: (directory: string) => Promise<PluginPublicationChanges>;
|
|
340
|
+
/** Lists all defined workspaces in the current project (read-only). */
|
|
341
|
+
readonly listProjectWorkspaces?: () => Promise<readonly PluginProjectWorkspaceSummary[]>;
|
|
335
342
|
/** Checks committed code against the configured collaboration branches without closing the workspace. */
|
|
336
343
|
readonly verifySynchronized: () => Promise<void>;
|
|
344
|
+
/** Queues an asynchronous activation retry for this plugin when its host activation is currently failed or blocked. */
|
|
345
|
+
readonly requestActivationRetry?: () => Promise<void>;
|
|
337
346
|
};
|
|
338
347
|
}
|
|
339
348
|
//#endregion
|
|
@@ -637,6 +646,7 @@ interface PluginToolContribution {
|
|
|
637
646
|
readonly version?: string;
|
|
638
647
|
}
|
|
639
648
|
interface PluginLifecycleOutcome {
|
|
649
|
+
readonly artifactPaths?: readonly string[];
|
|
640
650
|
readonly fileChanges?: readonly PluginFileChange[];
|
|
641
651
|
readonly code: string | null;
|
|
642
652
|
readonly details: unknown | null;
|
|
@@ -651,6 +661,8 @@ interface PluginLifecycleOutcome {
|
|
|
651
661
|
readonly warnings: readonly string[];
|
|
652
662
|
}
|
|
653
663
|
interface PluginHookResult {
|
|
664
|
+
/** WorkspaceFinalize only: finite artifact files relative to project.workbaseRoot, outside configuration. */
|
|
665
|
+
readonly artifactPaths?: readonly string[];
|
|
654
666
|
/** WorkspaceProvision only: proposed project files, applied by the host after preparation. */
|
|
655
667
|
readonly fileChanges?: readonly PluginFileChange[];
|
|
656
668
|
readonly standardError?: string;
|
|
@@ -730,4 +742,4 @@ interface PluginContributionSnapshot {
|
|
|
730
742
|
readonly views: readonly PluginViewContribution[];
|
|
731
743
|
}
|
|
732
744
|
//#endregion
|
|
733
|
-
export { WorkbasePluginDefinition as $, PluginLifecycleStatus as A,
|
|
745
|
+
export { WorkbasePluginDefinition as $, PluginLifecycleStatus as A, PluginToastApi as At, PluginRepository as B, roleToolEnvironmentSchema as Bt, PluginHookId as C, PluginPublicationChanges as Ct, PluginLifecycleHook as D, PluginTaskDescriptor as Dt, PluginLifecycleDispatchResult as E, PluginSystemContextService as Et, PluginProcessApi as F, PluginViewStateService as Ft, PluginStatusContribution as G, PluginSetupHooks as H, roleToolsProposalSchema as Ht, PluginProcessOutputMode as I, PluginToolsService as It, PluginViewContribution as J, PluginStatusDefinition as K, PluginProcessResult as L, RoleToolEnvironment as Lt, PluginOverviewCardData as M, PluginToastOptions as Mt, PluginOverviewCardDefinition as N, PluginViewCatalogEntry as Nt, PluginLifecycleOutcome as O, PluginTaskResult as Ot, PluginOverviewCardStatus as P, PluginViewStatePublishOptions as Pt, PluginWorkspace as Q, PluginProcessRunOptions as R, RoleToolsApplied as Rt, PluginFileChange as S, PluginPromptViewRequest as St, PluginInvocationContext as T, PluginStoreApi as Tt, PluginSharedChangeKind as U, PluginRepositoryStatus as V, roleToolsAppliedSchema as Vt, PluginSharedChanges as W, PluginViewLayout as X, PluginViewDefinition as Y, PluginViewMethod as Z, PluginContributionSnapshot as _, PluginProjectWorkspaceSummary as _t, PluginCapabilityReference as a, PluginCapabilityCommandRequest as at, PluginExecutionSnapshot as b, PluginPromptQuestion as bt, PluginCommandContribution as c, PluginCommandCatalogEntry as ct, PluginCommandEffect as d, PluginHostServices as dt, DEFAULT_VIEW_STATE_TOPIC as et, PluginCommandExecutionResult as f, PluginInteractiveLogger as ft, PluginContextExposure as g, PluginLogService as gt, PluginContext as h, PluginLogQueryResult as ht, PluginCapabilityKind as i, PluginCapabilityCatalog as it, PluginLogger as j, PluginToastLevel as jt, PluginLifecyclePolicy as k, PluginTaskService as kt, PluginCommandDefinition as l, PluginConfigApi as lt, PluginCommandTransaction as m, PluginLogQueryRequest as mt, PluginAgentContextDefinition as n, PluginAgentContextCatalogEntry as nt, PluginCardAction as o, PluginCapabilityResolveRequest as ot, PluginCommandLogPolicy as p, PluginLogEntry as pt, PluginToolContribution as q, PluginAgentScope as r, PluginAgentPolicy as rt, PluginCommandContext as s, PluginCapabilityService as st, PluginAgentContextContribution as t, MAXIMUM_VIEW_STATE_BYTES as tt, PluginCommandDetails as u, PluginExecutionService as ut, PluginDisposable as v, PluginPromptApi as vt, PluginHookResult as w, PluginStatusCatalogEntry as wt, PluginExecutionStatus as x, PluginPromptType as xt, PluginExecutionEvidence as y, PluginPromptChoice as yt, PluginProject as z, RoleToolsProposal as zt };
|
package/dist/ui/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ErrorInfo, HTMLAttributes, ReactNode } from "react";
|
|
1
|
+
import { ButtonHTMLAttributes, Component, ErrorInfo, HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
//#region src/ui/Components.dto.d.ts
|
|
3
3
|
export declare enum PluginStatusTone {
|
|
4
4
|
Success = "success",
|
|
@@ -35,11 +35,18 @@ interface PluginErrorBoundaryProps {
|
|
|
35
35
|
readonly retryLabel?: string;
|
|
36
36
|
readonly onReset?: () => void;
|
|
37
37
|
}
|
|
38
|
+
interface PluginPublicationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
39
|
+
readonly label: string;
|
|
40
|
+
readonly count: number;
|
|
41
|
+
readonly isLoading?: boolean;
|
|
42
|
+
readonly icon?: ReactNode;
|
|
43
|
+
}
|
|
38
44
|
//#endregion
|
|
39
45
|
//#region src/ui/components.d.ts
|
|
40
46
|
export declare const PluginStatusPill: import("react").NamedExoticComponent<PluginStatusPillProps>;
|
|
41
47
|
export declare const PluginInlineError: import("react").NamedExoticComponent<PluginInlineErrorProps>;
|
|
42
48
|
export declare const PluginEmptyState: import("react").NamedExoticComponent<PluginEmptyStateProps>;
|
|
49
|
+
export declare const PluginPublicationButton: import("react").NamedExoticComponent<PluginPublicationButtonProps>;
|
|
43
50
|
interface PluginErrorBoundaryState {
|
|
44
51
|
readonly error: Error | null;
|
|
45
52
|
readonly componentStack: string | null;
|
|
@@ -52,4 +59,4 @@ export declare class PluginErrorBoundary extends Component<PluginErrorBoundaryPr
|
|
|
52
59
|
render(): ReactNode;
|
|
53
60
|
}
|
|
54
61
|
//#endregion
|
|
55
|
-
export type { PluginEmptyStateProps, PluginErrorBoundaryProps, PluginInlineErrorProps, PluginStatusPillProps, PluginStatusToneValue };
|
|
62
|
+
export type { PluginEmptyStateProps, PluginErrorBoundaryProps, PluginInlineErrorProps, PluginPublicationButtonProps, PluginStatusPillProps, PluginStatusToneValue };
|
package/dist/ui/components.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { PluginEmptyState, PluginErrorBoundary, PluginInlineError, PluginStatusPill, PluginStatusTone };
|
|
1
|
+
import { a as PluginStatusPill, i as PluginPublicationButton, n as PluginErrorBoundary, o as PluginStatusTone, r as PluginInlineError, t as PluginEmptyState } from "../components-V_fFZLTU.js";
|
|
2
|
+
export { PluginEmptyState, PluginErrorBoundary, PluginInlineError, PluginPublicationButton, PluginStatusPill, PluginStatusTone };
|
package/dist/ui/error-panel.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ interface PluginErrorPanelProps extends HTMLAttributes<HTMLElement> {
|
|
|
7
7
|
readonly recovery: string;
|
|
8
8
|
readonly technicalDetails?: string;
|
|
9
9
|
readonly isDismissible?: boolean;
|
|
10
|
+
readonly variant?: "default" | "compact";
|
|
10
11
|
readonly children?: ReactNode;
|
|
11
12
|
}
|
|
12
13
|
//#endregion
|
package/dist/ui/error-panel.js
CHANGED
|
@@ -10,16 +10,82 @@ const PluginErrorPanel = memo(function PluginErrorPanel(props) {
|
|
|
10
10
|
props.technicalDetails
|
|
11
11
|
]));
|
|
12
12
|
});
|
|
13
|
-
function ErrorDetails({ title, error, scope, recovery, technicalDetails = error, isDismissible = false, children, className, ...attributes }) {
|
|
13
|
+
function ErrorDetails({ title, error, scope, recovery, technicalDetails = error, isDismissible = false, variant = "default", children, className, ...attributes }) {
|
|
14
14
|
const headingId = useId();
|
|
15
15
|
const detailsId = useId();
|
|
16
16
|
const [closed, setClosed] = useState(false);
|
|
17
17
|
const [showDetails, setShowDetails] = useState(false);
|
|
18
|
+
const isCompact = variant === "compact";
|
|
19
|
+
const summary = errorSummary(error);
|
|
18
20
|
function handleClose() {
|
|
19
21
|
setShowDetails(false);
|
|
20
22
|
setClosed(!closed);
|
|
21
23
|
}
|
|
22
24
|
if (closed && isDismissible) return null;
|
|
25
|
+
if (isCompact) return /* @__PURE__ */ jsxs("section", {
|
|
26
|
+
tabIndex: 0,
|
|
27
|
+
...attributes,
|
|
28
|
+
"data-variant": "compact",
|
|
29
|
+
role: closed ? void 0 : "alert",
|
|
30
|
+
"aria-labelledby": headingId,
|
|
31
|
+
className: ["workbase-plugin-error", className].filter(Boolean).join(" "),
|
|
32
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
33
|
+
className: "workbase-error-header",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "workbase-error-compact-copy",
|
|
37
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
38
|
+
className: "workbase-error-title",
|
|
39
|
+
id: headingId,
|
|
40
|
+
children: title
|
|
41
|
+
}), !closed ? /* @__PURE__ */ jsx("p", {
|
|
42
|
+
className: "workbase-error-cause",
|
|
43
|
+
children: summary
|
|
44
|
+
}) : null]
|
|
45
|
+
}),
|
|
46
|
+
!closed ? /* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "workbase-error-compact-actions",
|
|
48
|
+
children: [children, /* @__PURE__ */ jsxs("button", {
|
|
49
|
+
type: "button",
|
|
50
|
+
className: "workbase-error-disclosure",
|
|
51
|
+
"aria-expanded": showDetails,
|
|
52
|
+
"aria-controls": detailsId,
|
|
53
|
+
onClick: () => setShowDetails(!showDetails),
|
|
54
|
+
children: [showDetails ? "收起详情" : "查看详情", /* @__PURE__ */ jsx("svg", {
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
width: "14",
|
|
57
|
+
height: "14",
|
|
58
|
+
viewBox: "0 0 24 24",
|
|
59
|
+
fill: "none",
|
|
60
|
+
stroke: "currentColor",
|
|
61
|
+
strokeWidth: "1.8",
|
|
62
|
+
strokeLinecap: "round",
|
|
63
|
+
strokeLinejoin: "round",
|
|
64
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
}) : null,
|
|
68
|
+
/* @__PURE__ */ jsx("button", {
|
|
69
|
+
type: "button",
|
|
70
|
+
className: closed ? "workbase-error-toggle" : "workbase-error-toggle workbase-error-close",
|
|
71
|
+
"aria-label": closed ? "查看错误详情" : "关闭错误提示",
|
|
72
|
+
title: closed ? void 0 : "关闭错误提示",
|
|
73
|
+
"aria-expanded": isDismissible ? void 0 : !closed,
|
|
74
|
+
onClick: handleClose,
|
|
75
|
+
children: closed ? "查看错误详情" : null
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
}), !closed ? /* @__PURE__ */ jsxs("dl", {
|
|
79
|
+
className: "workbase-error-details",
|
|
80
|
+
id: detailsId,
|
|
81
|
+
hidden: !showDetails,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "影响范围" }), /* @__PURE__ */ jsx("dd", { children: scope })] }),
|
|
84
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "处理建议" }), /* @__PURE__ */ jsx("dd", { children: recovery })] }),
|
|
85
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "技术详情" }), /* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx("pre", { children: technicalDetails }) })] })
|
|
86
|
+
]
|
|
87
|
+
}) : null]
|
|
88
|
+
});
|
|
23
89
|
return /* @__PURE__ */ jsxs("section", {
|
|
24
90
|
tabIndex: 0,
|
|
25
91
|
...attributes,
|
|
@@ -46,7 +112,7 @@ function ErrorDetails({ title, error, scope, recovery, technicalDetails = error,
|
|
|
46
112
|
children: [
|
|
47
113
|
/* @__PURE__ */ jsx("p", {
|
|
48
114
|
className: "workbase-error-cause",
|
|
49
|
-
children:
|
|
115
|
+
children: summary
|
|
50
116
|
}),
|
|
51
117
|
/* @__PURE__ */ jsxs("div", {
|
|
52
118
|
className: "workbase-error-actions",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as ExecutionLogRecord, t as ExecutionLogEntry } from "../ExecutionLog.dto-
|
|
1
|
+
import { r as ExecutionLogRecord, t as ExecutionLogEntry } from "../ExecutionLog.dto-ig9GUWhK.js";
|
|
2
2
|
//#region src/ui/ExecutionLogTimeline.dto.d.ts
|
|
3
3
|
export declare enum ExecutionLogDisplay {
|
|
4
4
|
Full = "full",
|
package/dist/ui/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as WorkbasePluginUi, _ as PluginUiInitializationPayload } from "../types-3v3whlPt.js";
|
|
2
2
|
import { ReactNode, RefObject } from "react";
|
|
3
3
|
//#region src/ui/hooks.d.ts
|
|
4
4
|
export interface ReactRootLike {
|
package/dist/ui/hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as DEFAULT_VIEW_STATE_TOPIC } from "../host-services-cIH3aYQD.js";
|
|
2
|
-
import { n as defineWorkbasePluginUi } from "../ui-
|
|
3
|
-
import { n as PluginErrorBoundary } from "../components-
|
|
2
|
+
import { n as defineWorkbasePluginUi } from "../ui-DC0oqP79.js";
|
|
3
|
+
import { n as PluginErrorBoundary } from "../components-V_fFZLTU.js";
|
|
4
4
|
import { initializeWorkbaseUiStyles } from "./theme.js";
|
|
5
5
|
import { Fragment, useCallback, useEffect, useRef, useState } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
package/dist/ui/index.css
CHANGED
|
@@ -190,10 +190,19 @@ h2 {
|
|
|
190
190
|
.status-page .operation-feedback { padding-top: 8px; }
|
|
191
191
|
|
|
192
192
|
.configuration-page-tabs { display: inline-flex; align-items: center; gap: 2px; width: max-content; max-width: 100%; padding: 4px; border-radius: 10px; background: var(--color-surface-muted); }
|
|
193
|
-
.configuration-page-tabs button { min-height: 32px; border: 0; border-radius: 7px; background: transparent; padding: 4px 13px; color: var(--color-muted); font: inherit; font-size: var(--workbase-type-body); font-weight: 600; cursor: pointer; white-space: nowrap; }
|
|
193
|
+
.configuration-page-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; border: 0; border-radius: 7px; background: transparent; padding: 4px 13px; color: var(--color-muted); font: inherit; font-size: var(--workbase-type-body); font-weight: 600; cursor: pointer; white-space: nowrap; }
|
|
194
194
|
.configuration-page-tabs button:hover { color: var(--color-foreground); }
|
|
195
195
|
.configuration-page-tabs button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-foreground); box-shadow: 0 1px 4px rgb(55 48 31 / 13%); }
|
|
196
196
|
.configuration-page-tabs button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
|
|
197
|
+
.configuration-page-tabs button[data-modified="true"]::after,
|
|
198
|
+
.configuration-tabs button[data-modified="true"]::after {
|
|
199
|
+
content: "";
|
|
200
|
+
width: 6px;
|
|
201
|
+
height: 6px;
|
|
202
|
+
flex-shrink: 0;
|
|
203
|
+
border-radius: 50%;
|
|
204
|
+
background: var(--color-warning);
|
|
205
|
+
}
|
|
197
206
|
.configuration-manager { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; font-size: var(--workbase-type-body); line-height: 1.6; }
|
|
198
207
|
.configuration-manager > :not(.configuration-resource-grid) { flex-shrink: 0; }
|
|
199
208
|
.configuration-view { min-width: 0; }
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { et as DEFAULT_VIEW_STATE_TOPIC, f as PluginCommandExecutionResult } from "../types-
|
|
2
|
-
import { A as
|
|
1
|
+
import { et as DEFAULT_VIEW_STATE_TOPIC, f as PluginCommandExecutionResult } from "../types-D1Ezgwbv.js";
|
|
2
|
+
import { A as PluginUiTransportConnection, C as PluginUiPromptType, D as PluginUiStateChange, E as PluginUiRepositoryPushTarget, M as PluginUiViewIdentity, N as WorkbasePluginUi, O as PluginUiStatus, P as WorkbasePluginUiDefinition, S as PluginUiPromptOptions, T as PluginUiRepositoryPushResult, _ as PluginUiInitializationPayload, a as PluginUiCommands, b as PluginUiOutputOptions, c as PluginUiDesktopOpenOptions, d as PluginUiFileFilter, f as PluginUiFileSelectOptions, g as PluginUiHostMethods, h as PluginUiHostError, i as PluginUiCommandExecuteOptions, j as PluginUiView, k as PluginUiToastOptions, l as PluginUiDesktopOpenResult, m as PluginUiFileSelectionScope, n as PluginUiActivationState, o as PluginUiContextIdentity, p as PluginUiFileSelectionItemType, r as PluginUiClientMethods, s as PluginUiControllerOptions, t as PluginDesktopTarget, u as PluginUiExecutionChange, v as PluginUiNavigateOptions, w as PluginUiRepositoryPushOutcome, x as PluginUiPromptChoice, y as PluginUiOpenViewOptions } from "../types-3v3whlPt.js";
|
|
3
3
|
//#region src/ui/controller.d.ts
|
|
4
4
|
export declare enum PluginUiHostMethod {
|
|
5
5
|
InteractionDismiss = "interaction.dismiss",
|
|
@@ -21,7 +21,8 @@ export declare enum PluginUiHostMethod {
|
|
|
21
21
|
StatusResolve = "status.resolve",
|
|
22
22
|
ToastShow = "toast.show",
|
|
23
23
|
ViewCall = "view.call",
|
|
24
|
-
ViewModified = "view.modified"
|
|
24
|
+
ViewModified = "view.modified",
|
|
25
|
+
ViewActivationErrorHandled = "view.activationErrorHandled"
|
|
25
26
|
}
|
|
26
27
|
export declare function createPluginUiController(definition: WorkbasePluginUiDefinition, options: PluginUiControllerOptions): WorkbasePluginUi;
|
|
27
28
|
//#endregion
|
|
@@ -47,4 +48,4 @@ export interface PluginTypedClient<Contract extends PluginContract> {
|
|
|
47
48
|
export declare function createPluginClient<Contract extends PluginContract>(host: WorkbasePluginUi): PluginTypedClient<Contract>;
|
|
48
49
|
export declare function defineWorkbasePluginUi(definition: WorkbasePluginUiDefinition): WorkbasePluginUi;
|
|
49
50
|
//#endregion
|
|
50
|
-
export { DEFAULT_VIEW_STATE_TOPIC, PluginDesktopTarget, type PluginUiClientMethods, type PluginUiCommandExecuteOptions, type PluginUiCommands, type PluginUiContextIdentity, type PluginUiControllerOptions, type PluginUiDesktopOpenOptions, type PluginUiDesktopOpenResult, type PluginUiExecutionChange, type PluginUiFileFilter, type PluginUiFileSelectOptions, type PluginUiFileSelectionItemType, type PluginUiFileSelectionScope, type PluginUiHostError, type PluginUiHostMethods, type PluginUiInitializationPayload, type PluginUiNavigateOptions, type PluginUiOpenViewOptions, type PluginUiOutputOptions, type PluginUiPromptChoice, type PluginUiPromptOptions, type PluginUiPromptType, type PluginUiRepositoryPushOutcome, type PluginUiRepositoryPushResult, type PluginUiRepositoryPushTarget, type PluginUiStateChange, type PluginUiStatus, type PluginUiToastOptions, type PluginUiTransportConnection, type PluginUiView, type PluginUiViewIdentity, type WorkbasePluginUi, type WorkbasePluginUiDefinition };
|
|
51
|
+
export { DEFAULT_VIEW_STATE_TOPIC, PluginDesktopTarget, type PluginUiActivationState, type PluginUiClientMethods, type PluginUiCommandExecuteOptions, type PluginUiCommands, type PluginUiContextIdentity, type PluginUiControllerOptions, type PluginUiDesktopOpenOptions, type PluginUiDesktopOpenResult, type PluginUiExecutionChange, type PluginUiFileFilter, type PluginUiFileSelectOptions, type PluginUiFileSelectionItemType, type PluginUiFileSelectionScope, type PluginUiHostError, type PluginUiHostMethods, type PluginUiInitializationPayload, type PluginUiNavigateOptions, type PluginUiOpenViewOptions, type PluginUiOutputOptions, type PluginUiPromptChoice, type PluginUiPromptOptions, type PluginUiPromptType, type PluginUiRepositoryPushOutcome, type PluginUiRepositoryPushResult, type PluginUiRepositoryPushTarget, type PluginUiStateChange, type PluginUiStatus, type PluginUiToastOptions, type PluginUiTransportConnection, type PluginUiView, type PluginUiViewIdentity, type WorkbasePluginUi, type WorkbasePluginUiDefinition };
|
package/dist/ui/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as DEFAULT_VIEW_STATE_TOPIC } from "../host-services-cIH3aYQD.js";
|
|
2
|
-
import { a as createPluginUiController, i as PluginUiHostMethod, n as defineWorkbasePluginUi, r as PluginDesktopTarget, t as createPluginClient } from "../ui-
|
|
2
|
+
import { a as createPluginUiController, i as PluginUiHostMethod, n as defineWorkbasePluginUi, r as PluginDesktopTarget, t as createPluginClient } from "../ui-DC0oqP79.js";
|
|
3
3
|
export { DEFAULT_VIEW_STATE_TOPIC, PluginDesktopTarget, PluginUiHostMethod, createPluginClient, createPluginUiController, defineWorkbasePluginUi };
|
package/dist/ui/model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as WorkbasePluginUi, k as PluginUiToastOptions } from "../types-3v3whlPt.js";
|
|
2
2
|
//#region src/ui/model.d.ts
|
|
3
3
|
/** A notification transport failure must not turn a completed operation into a failed one. */
|
|
4
4
|
export declare function showOperationToast(host: Pick<WorkbasePluginUi, "showToast">, options: PluginUiToastOptions): void;
|
package/dist/ui/theme.css
CHANGED
|
@@ -273,6 +273,12 @@
|
|
|
273
273
|
.workbase-plugin-error .workbase-error-title { flex: 1; min-width: 0; margin: 0; color: var(--color-foreground); font-size: var(--workbase-type-body); font-weight: 650; line-height: 1.45; }
|
|
274
274
|
.workbase-error-body { margin-inline-start: 28px; }
|
|
275
275
|
.workbase-plugin-error .workbase-error-cause { max-width: 75ch; margin: 0; color: var(--color-foreground); font-size: var(--workbase-type-body); font-weight: 400; line-height: 1.55; white-space: pre-wrap; }
|
|
276
|
+
.workbase-plugin-error[data-variant="compact"] { padding: 8px 12px; }
|
|
277
|
+
.workbase-plugin-error[data-variant="compact"] .workbase-error-header { flex-wrap: wrap; gap: 6px 10px; }
|
|
278
|
+
.workbase-error-compact-copy { display: flex; flex: 1 1 24ch; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
|
|
279
|
+
.workbase-plugin-error[data-variant="compact"] .workbase-error-title { flex: 0 1 auto; font-size: var(--workbase-type-meta); }
|
|
280
|
+
.workbase-plugin-error[data-variant="compact"] .workbase-error-cause { flex: 1 1 24ch; min-width: 0; color: var(--color-muted); font-size: var(--workbase-type-meta); line-height: 1.45; }
|
|
281
|
+
.workbase-error-compact-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-inline-start: auto; }
|
|
276
282
|
.workbase-error-actions, .workbase-inline-error { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
|
|
277
283
|
.workbase-error-actions { margin-block-start: 10px; }
|
|
278
284
|
.workbase-error-toggle, .workbase-error-disclosure, .workbase-inline-error > button {
|
|
@@ -356,6 +362,73 @@
|
|
|
356
362
|
}
|
|
357
363
|
@keyframes workbase-spin { to { transform: rotate(360deg); } }
|
|
358
364
|
|
|
365
|
+
.workbase-publish-button {
|
|
366
|
+
display: inline-flex;
|
|
367
|
+
align-items: center;
|
|
368
|
+
justify-content: center;
|
|
369
|
+
gap: 7px;
|
|
370
|
+
min-height: 36px;
|
|
371
|
+
padding: 6px 12px 6px 13px;
|
|
372
|
+
border: 1px solid color-mix(in srgb, var(--color-brand-gold) 52%, transparent);
|
|
373
|
+
border-radius: 8px;
|
|
374
|
+
background: var(--color-primary);
|
|
375
|
+
color: var(--color-primary-foreground);
|
|
376
|
+
box-shadow: 0 1px 3px rgb(138 80 0 / 16%);
|
|
377
|
+
font: inherit;
|
|
378
|
+
font-size: var(--workbase-type-body);
|
|
379
|
+
font-weight: 600;
|
|
380
|
+
line-height: 1.25;
|
|
381
|
+
white-space: nowrap;
|
|
382
|
+
cursor: pointer;
|
|
383
|
+
transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
|
|
384
|
+
}
|
|
385
|
+
.workbase-publish-button:hover:not(:disabled) {
|
|
386
|
+
background: var(--color-primary-hover);
|
|
387
|
+
box-shadow: 0 2px 6px rgb(138 80 0 / 22%);
|
|
388
|
+
}
|
|
389
|
+
.workbase-publish-button:active:not(:disabled) {
|
|
390
|
+
transform: translateY(1px);
|
|
391
|
+
}
|
|
392
|
+
.workbase-publish-button:disabled {
|
|
393
|
+
opacity: 0.55;
|
|
394
|
+
cursor: not-allowed;
|
|
395
|
+
box-shadow: none;
|
|
396
|
+
}
|
|
397
|
+
.workbase-publish-button:focus-visible {
|
|
398
|
+
outline: 2px solid var(--color-accent);
|
|
399
|
+
outline-offset: 2px;
|
|
400
|
+
}
|
|
401
|
+
.workbase-publish-icon {
|
|
402
|
+
display: inline-flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
justify-content: center;
|
|
405
|
+
width: 15px;
|
|
406
|
+
height: 15px;
|
|
407
|
+
flex-shrink: 0;
|
|
408
|
+
}
|
|
409
|
+
.workbase-publish-icon svg {
|
|
410
|
+
width: 15px;
|
|
411
|
+
height: 15px;
|
|
412
|
+
}
|
|
413
|
+
.workbase-publish-label {
|
|
414
|
+
min-width: 0;
|
|
415
|
+
}
|
|
416
|
+
.workbase-publish-count {
|
|
417
|
+
display: inline-flex;
|
|
418
|
+
align-items: center;
|
|
419
|
+
justify-content: center;
|
|
420
|
+
min-width: 20px;
|
|
421
|
+
height: 20px;
|
|
422
|
+
padding: 0 6px;
|
|
423
|
+
border-radius: 999px;
|
|
424
|
+
background: var(--color-brand-deep);
|
|
425
|
+
color: var(--color-brand-weak);
|
|
426
|
+
font-size: 11px;
|
|
427
|
+
font-weight: 700;
|
|
428
|
+
line-height: 1;
|
|
429
|
+
font-variant-numeric: tabular-nums;
|
|
430
|
+
}
|
|
431
|
+
|
|
359
432
|
.workbase-empty-state {
|
|
360
433
|
display: grid;
|
|
361
434
|
min-height: 140px;
|
|
@@ -26,6 +26,7 @@ let PluginUiHostMethod = /* @__PURE__ */ function(PluginUiHostMethod) {
|
|
|
26
26
|
PluginUiHostMethod["ToastShow"] = "toast.show";
|
|
27
27
|
PluginUiHostMethod["ViewCall"] = "view.call";
|
|
28
28
|
PluginUiHostMethod["ViewModified"] = "view.modified";
|
|
29
|
+
PluginUiHostMethod["ViewActivationErrorHandled"] = "view.activationErrorHandled";
|
|
29
30
|
return PluginUiHostMethod;
|
|
30
31
|
}({});
|
|
31
32
|
function createPluginUiController(definition, options) {
|
|
@@ -47,25 +48,45 @@ function createPluginUiController(definition, options) {
|
|
|
47
48
|
};
|
|
48
49
|
const executionListeners = /* @__PURE__ */ new Set();
|
|
49
50
|
const fileListeners = /* @__PURE__ */ new Set();
|
|
51
|
+
const activationListeners = /* @__PURE__ */ new Set();
|
|
50
52
|
const stateListeners = /* @__PURE__ */ new Map();
|
|
51
53
|
const latestStates = /* @__PURE__ */ new Map();
|
|
52
54
|
const pendingStateChanges = /* @__PURE__ */ new Map();
|
|
55
|
+
let latestActivation = null;
|
|
56
|
+
let pendingActivation = null;
|
|
53
57
|
let initialization = 0;
|
|
54
58
|
let refreshing = false;
|
|
55
59
|
let pending = false;
|
|
56
60
|
let lifecycle = null;
|
|
61
|
+
const deliverActivationChange = (nextActivation) => {
|
|
62
|
+
[...activationListeners].forEach((listener) => listener(nextActivation));
|
|
63
|
+
};
|
|
57
64
|
const deliverStateChange = (topic, nextState) => {
|
|
58
65
|
const listeners = stateListeners.get(topic);
|
|
59
66
|
if (!listeners) return;
|
|
60
67
|
[...listeners].forEach((listener) => listener(nextState));
|
|
61
68
|
};
|
|
62
69
|
const flushPendingStates = () => {
|
|
70
|
+
if (pendingActivation) {
|
|
71
|
+
const nextActivation = pendingActivation;
|
|
72
|
+
pendingActivation = null;
|
|
73
|
+
deliverActivationChange(nextActivation);
|
|
74
|
+
}
|
|
63
75
|
if (!pendingStateChanges.size) return;
|
|
64
76
|
const queued = [...pendingStateChanges.entries()];
|
|
65
77
|
pendingStateChanges.clear();
|
|
66
78
|
queued.forEach(([topic, nextState]) => deliverStateChange(topic, nextState));
|
|
67
79
|
};
|
|
68
80
|
const clientMethods = {
|
|
81
|
+
activationChanged: async (activation) => {
|
|
82
|
+
if (!isActivationState(activation)) return;
|
|
83
|
+
latestActivation = activation;
|
|
84
|
+
if (!state.isInitialized || initialization > 0) {
|
|
85
|
+
pendingActivation = activation;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
deliverActivationChange(activation);
|
|
89
|
+
},
|
|
69
90
|
filesChanged: async () => {
|
|
70
91
|
pending = true;
|
|
71
92
|
if (refreshing || initialization || !state.isInitialized) return;
|
|
@@ -101,6 +122,12 @@ function createPluginUiController(definition, options) {
|
|
|
101
122
|
if (state.contextIdentity !== null && state.contextIdentity !== nextIdentity) {
|
|
102
123
|
latestStates.clear();
|
|
103
124
|
pendingStateChanges.clear();
|
|
125
|
+
latestActivation = null;
|
|
126
|
+
pendingActivation = null;
|
|
127
|
+
}
|
|
128
|
+
if (isActivationState(payload.activation)) {
|
|
129
|
+
latestActivation = payload.activation;
|
|
130
|
+
pendingActivation = payload.activation;
|
|
104
131
|
}
|
|
105
132
|
state.contextIdentity = nextIdentity;
|
|
106
133
|
state.isInitialized = true;
|
|
@@ -136,9 +163,12 @@ function createPluginUiController(definition, options) {
|
|
|
136
163
|
const dispose = () => {
|
|
137
164
|
executionListeners.clear();
|
|
138
165
|
fileListeners.clear();
|
|
166
|
+
activationListeners.clear();
|
|
139
167
|
stateListeners.clear();
|
|
140
168
|
latestStates.clear();
|
|
141
169
|
pendingStateChanges.clear();
|
|
170
|
+
latestActivation = null;
|
|
171
|
+
pendingActivation = null;
|
|
142
172
|
lifecycle?.dispose();
|
|
143
173
|
};
|
|
144
174
|
const subscribe = async (onChange) => {
|
|
@@ -161,6 +191,20 @@ function createPluginUiController(definition, options) {
|
|
|
161
191
|
fileListeners.delete(refresh);
|
|
162
192
|
};
|
|
163
193
|
};
|
|
194
|
+
const onActivationChanged = (listener) => {
|
|
195
|
+
activationListeners.add(listener);
|
|
196
|
+
let active = true;
|
|
197
|
+
if (latestActivation && !pendingActivation) {
|
|
198
|
+
const snapshot = latestActivation;
|
|
199
|
+
queueMicrotask(() => {
|
|
200
|
+
if (active) listener(snapshot);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
return () => {
|
|
204
|
+
active = false;
|
|
205
|
+
activationListeners.delete(listener);
|
|
206
|
+
};
|
|
207
|
+
};
|
|
164
208
|
const onStateChanged = (listener, topic = DEFAULT_VIEW_STATE_TOPIC) => {
|
|
165
209
|
const wrapped = (nextState) => listener(nextState);
|
|
166
210
|
const bucket = stateListeners.get(topic) ?? /* @__PURE__ */ new Set();
|
|
@@ -184,6 +228,7 @@ function createPluginUiController(definition, options) {
|
|
|
184
228
|
state,
|
|
185
229
|
dispose,
|
|
186
230
|
subscribe,
|
|
231
|
+
onActivationChanged,
|
|
187
232
|
onFilesChanged,
|
|
188
233
|
onStateChanged
|
|
189
234
|
});
|
|
@@ -209,7 +254,7 @@ function createHostError(response) {
|
|
|
209
254
|
const code = typeof responseError?.code === "string" ? responseError.code : "host_error";
|
|
210
255
|
return Object.assign(new Error(message), { code });
|
|
211
256
|
}
|
|
212
|
-
function createPluginUiApi(request, { targetWindow, state, dispose, subscribe, onFilesChanged, onStateChanged }) {
|
|
257
|
+
function createPluginUiApi(request, { targetWindow, state, dispose, subscribe, onActivationChanged, onFilesChanged, onStateChanged }) {
|
|
213
258
|
const commands = Object.freeze({
|
|
214
259
|
subscribe,
|
|
215
260
|
reply: (executionId) => request("command.reply", { executionId }),
|
|
@@ -234,8 +279,10 @@ function createPluginUiApi(request, { targetWindow, state, dispose, subscribe, o
|
|
|
234
279
|
statusId
|
|
235
280
|
}) });
|
|
236
281
|
const view = Object.freeze({
|
|
282
|
+
onActivationChanged,
|
|
237
283
|
onFilesChanged,
|
|
238
284
|
onStateChanged,
|
|
285
|
+
setActivationErrorHandled: (handled) => request("view.activationErrorHandled", handled),
|
|
239
286
|
setModified: (modified) => request("view.modified", modified),
|
|
240
287
|
call: (method, input) => request("view.call", {
|
|
241
288
|
input,
|
|
@@ -373,6 +420,13 @@ function isContextIdentity(value) {
|
|
|
373
420
|
function isViewIdentity(value) {
|
|
374
421
|
return isContextIdentity(value) && isRecord(value) && typeof value.pluginId === "string" && value.pluginId.length > 0 && typeof value.title === "string" && value.title.length > 0;
|
|
375
422
|
}
|
|
423
|
+
function isActivationState(value) {
|
|
424
|
+
if (!isRecord(value)) return false;
|
|
425
|
+
const validStatus = value.status === "loading" || value.status === "blocked" || value.status === "failed" || value.status === "ready";
|
|
426
|
+
const validError = value.error === null || typeof value.error === "string";
|
|
427
|
+
const validBlocker = value.blockedByPluginId === void 0 || value.blockedByPluginId === null || typeof value.blockedByPluginId === "string";
|
|
428
|
+
return validStatus && validError && validBlocker;
|
|
429
|
+
}
|
|
376
430
|
function isRecord(value) {
|
|
377
431
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
378
432
|
}
|