@eworkbase/sdk 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -1
- package/dist/{types-CoZB_r31.d.ts → types-Cmfedh3f.d.ts} +50 -2
- package/dist/ui/index.css +138 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/model.d.ts +10 -0
- package/dist/ui/model.js +12 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as PluginAgentPolicy, A as PluginLifecycleOutcome, At as RoleToolEnvironment, B as PluginSetupHooks, C as PluginExecutionStatus, Ct as PluginTaskResult, D as PluginInvocationContext, Dt as PluginToastOptions, E as PluginHookResult, Et as PluginToastLevel, F as PluginProcessResult, Ft as roleToolsProposalSchema, G as PluginToolContribution, H as PluginSharedChanges, I as PluginProcessRunOptions, J as PluginViewLayout, K as PluginViewContribution, L as PluginProject, M as PluginLifecycleStatus, Mt as RoleToolsProposal, N as PluginLogger, Nt as roleToolEnvironmentSchema, O as PluginLifecycleDispatchResult, Ot as PluginViewCatalogEntry, P as PluginProcessApi, Pt as roleToolsAppliedSchema, Q as PluginAgentContextCatalogEntry, R as PluginRepository, S as PluginExecutionSnapshot, St as PluginTaskDescriptor, T as PluginHookId, Tt as PluginToastApi, U as PluginStatusContribution, V as PluginSharedChangeKind, W as PluginStatusDefinition, X as PluginWorkspace, Y as PluginViewRequest, Z as WorkbasePluginDefinition, _ as PluginContext, _t as PluginPromptType, a as PluginCapabilityReference, at as PluginCommandCatalogEntry, b as PluginDisposable, bt as PluginStoreApi, c as PluginCommandContext, ct as PluginHostServices, d as PluginCommandDetails, dt as PluginLogQueryRequest, et as PluginCapabilityCatalog, f as PluginCommandEffect, ft as PluginLogQueryResult, g as PluginCommandTransaction, gt as PluginPromptQuestion, h as PluginCommandOption, ht as PluginPromptChoice, i as PluginCapabilityKind, it as PluginColoredMessage, j as PluginLifecyclePolicy, jt as RoleToolsApplied, k as PluginLifecycleHook, kt as PluginToolsService, l as PluginCommandContribution, lt as PluginInteractiveLogger, m as PluginCommandExecutionResult, mt as PluginPromptApi, n as PluginAgentContextDefinition, nt as PluginCapabilityResolveRequest, o as PluginCommandArgument, ot as PluginConfigApi, p as PluginCommandExecutionMode, pt as PluginLogService, q as PluginViewDefinition, r as PluginAgentScope, rt as PluginCapabilityService, s as PluginCommandCategory, st as PluginExecutionService, t as PluginAgentContextContribution, tt as PluginCapabilityCommandRequest, u as PluginCommandDefinition, ut as PluginLogEntry, v as PluginContextExposure, vt as PluginPromptViewRequest, w as PluginFileChange, wt as PluginTaskService, x as PluginExecutionEvidence, xt as PluginSystemContextService, y as PluginContributionSnapshot, yt as PluginStatusCatalogEntry, z as PluginRepositoryStatus } from "./types-Cmfedh3f.js";
|
|
2
2
|
export * from "zod";
|
|
3
3
|
//#region src/definition.d.ts
|
|
4
4
|
export declare const PLUGIN_API_VERSION = 2;
|
|
@@ -6,4 +6,4 @@ type DefinedWorkbasePlugin = Readonly<WorkbasePluginDefinition>;
|
|
|
6
6
|
export declare function definePlugin(definition: WorkbasePluginDefinition): DefinedWorkbasePlugin;
|
|
7
7
|
export declare function isDefinedPlugin(value: unknown): value is DefinedWorkbasePlugin;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { type DefinedWorkbasePlugin, type PluginAgentContextCatalogEntry, type PluginAgentContextContribution, type PluginAgentContextDefinition, type PluginAgentPolicy, type PluginCapabilityCatalog, type PluginCapabilityCommandRequest, type PluginCapabilityResolveRequest, type PluginCapabilityService, type PluginColoredMessage, type PluginCommandArgument, type PluginCommandCatalogEntry, PluginCommandCategory, type PluginCommandContext, type PluginCommandContribution, type PluginCommandDefinition, type PluginCommandDetails, PluginCommandEffect, PluginCommandExecutionMode, type PluginCommandExecutionResult, type PluginCommandOption, PluginCommandTransaction, type PluginConfigApi, type PluginContext, PluginContextExposure, type PluginContributionSnapshot, type PluginDisposable, type PluginExecutionService, type PluginExecutionSnapshot, PluginExecutionStatus, 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 PluginProcessApi, type PluginProcessResult, type PluginProcessRunOptions, type PluginProject, type PluginPromptApi, type PluginPromptChoice, type PluginPromptQuestion, type PluginPromptType, type PluginPromptViewRequest, 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, type PluginViewRequest, type PluginWorkspace, RoleToolEnvironment, RoleToolsApplied, RoleToolsProposal, type WorkbasePluginDefinition, roleToolEnvironmentSchema, roleToolsAppliedSchema, roleToolsProposalSchema };
|
|
9
|
+
export { type DefinedWorkbasePlugin, type PluginAgentContextCatalogEntry, type PluginAgentContextContribution, type PluginAgentContextDefinition, type PluginAgentPolicy, PluginAgentScope, type PluginCapabilityCatalog, type PluginCapabilityCommandRequest, PluginCapabilityKind, type PluginCapabilityReference, type PluginCapabilityResolveRequest, type PluginCapabilityService, type PluginColoredMessage, type PluginCommandArgument, type PluginCommandCatalogEntry, PluginCommandCategory, type PluginCommandContext, type PluginCommandContribution, type PluginCommandDefinition, type PluginCommandDetails, PluginCommandEffect, PluginCommandExecutionMode, type PluginCommandExecutionResult, type PluginCommandOption, PluginCommandTransaction, type PluginConfigApi, type PluginContext, PluginContextExposure, type PluginContributionSnapshot, type PluginDisposable, 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 PluginProcessApi, type PluginProcessResult, type PluginProcessRunOptions, type PluginProject, type PluginPromptApi, type PluginPromptChoice, type PluginPromptQuestion, type PluginPromptType, type PluginPromptViewRequest, 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, type PluginViewRequest, type PluginWorkspace, RoleToolEnvironment, RoleToolsApplied, RoleToolsProposal, type WorkbasePluginDefinition, roleToolEnvironmentSchema, roleToolsAppliedSchema, roleToolsProposalSchema };
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,17 @@ let PluginExecutionStatus = /* @__PURE__ */ function(PluginExecutionStatus) {
|
|
|
53
53
|
PluginExecutionStatus["Interrupted"] = "interrupted";
|
|
54
54
|
return PluginExecutionStatus;
|
|
55
55
|
}({});
|
|
56
|
+
let PluginCapabilityKind = /* @__PURE__ */ function(PluginCapabilityKind) {
|
|
57
|
+
PluginCapabilityKind["Command"] = "command";
|
|
58
|
+
PluginCapabilityKind["Status"] = "status";
|
|
59
|
+
PluginCapabilityKind["Context"] = "context";
|
|
60
|
+
return PluginCapabilityKind;
|
|
61
|
+
}({});
|
|
62
|
+
let PluginAgentScope = /* @__PURE__ */ function(PluginAgentScope) {
|
|
63
|
+
PluginAgentScope["Workspace"] = "workspace";
|
|
64
|
+
PluginAgentScope["Execution"] = "execution";
|
|
65
|
+
return PluginAgentScope;
|
|
66
|
+
}({});
|
|
56
67
|
let PluginCommandEffect = /* @__PURE__ */ function(PluginCommandEffect) {
|
|
57
68
|
PluginCommandEffect["Immediate"] = "immediate";
|
|
58
69
|
PluginCommandEffect["LongRunning"] = "longRunning";
|
|
@@ -189,4 +200,4 @@ const roleToolsAppliedSchema = z.object({
|
|
|
189
200
|
requiresPreparation: z.boolean()
|
|
190
201
|
});
|
|
191
202
|
//#endregion
|
|
192
|
-
export { PLUGIN_API_VERSION, PluginCommandCategory, PluginCommandEffect, PluginCommandExecutionMode, PluginCommandTransaction, PluginContextExposure, PluginExecutionStatus, PluginHookId, PluginLifecyclePolicy, PluginLifecycleStatus, PluginRepositoryStatus, PluginSharedChangeKind, PluginViewLayout, definePlugin, isDefinedPlugin, roleToolEnvironmentSchema, roleToolsAppliedSchema, roleToolsProposalSchema };
|
|
203
|
+
export { PLUGIN_API_VERSION, PluginAgentScope, PluginCapabilityKind, PluginCommandCategory, PluginCommandEffect, PluginCommandExecutionMode, PluginCommandTransaction, PluginContextExposure, PluginExecutionStatus, PluginHookId, PluginLifecyclePolicy, PluginLifecycleStatus, PluginRepositoryStatus, PluginSharedChangeKind, PluginViewLayout, definePlugin, isDefinedPlugin, roleToolEnvironmentSchema, roleToolsAppliedSchema, roleToolsProposalSchema };
|
|
@@ -168,6 +168,8 @@ interface PluginStoreApi {
|
|
|
168
168
|
readonly subscribe: (listener: () => void) => () => void;
|
|
169
169
|
}
|
|
170
170
|
interface PluginConfigApi {
|
|
171
|
+
/** Reads the current project config without changing the initialization snapshot. */
|
|
172
|
+
readonly read: () => Promise<Readonly<Record<string, unknown>>>;
|
|
171
173
|
readonly patch: (patch: Readonly<Record<string, unknown>>) => Promise<Readonly<Record<string, unknown>>>;
|
|
172
174
|
readonly replace: (config: Readonly<Record<string, unknown>>) => Promise<Readonly<Record<string, unknown>>>;
|
|
173
175
|
}
|
|
@@ -186,6 +188,7 @@ interface PluginCommandCatalogEntry {
|
|
|
186
188
|
readonly transaction: PluginCommandTransaction;
|
|
187
189
|
}
|
|
188
190
|
interface PluginAgentPolicy {
|
|
191
|
+
readonly scope?: PluginAgentScope;
|
|
189
192
|
readonly callable: boolean;
|
|
190
193
|
readonly destructive?: boolean;
|
|
191
194
|
readonly idempotent?: boolean;
|
|
@@ -290,10 +293,16 @@ interface PluginExecutionService {
|
|
|
290
293
|
readonly grant: (options: {
|
|
291
294
|
readonly readOnly: boolean;
|
|
292
295
|
readonly tasks: readonly string[];
|
|
296
|
+
readonly capabilities: readonly PluginCapabilityReference[];
|
|
293
297
|
}) => Promise<string>;
|
|
298
|
+
/** Verified parent, available only inside a host-delegated command. */
|
|
299
|
+
readonly identity: () => Promise<{
|
|
300
|
+
readonly executionId: string;
|
|
301
|
+
readonly pluginId: string;
|
|
302
|
+
} | null>;
|
|
294
303
|
readonly revoke: (token: string) => Promise<void>;
|
|
295
304
|
readonly delegate: (token: string, request: {
|
|
296
|
-
readonly method: "tasks.list" | "tasks.run" | "commands.execute" | "commands.start" | "commands.query";
|
|
305
|
+
readonly method: "capabilities.list" | "statuses.resolve" | "contexts.resolve" | "tasks.list" | "tasks.run" | "commands.execute" | "commands.start" | "commands.query";
|
|
297
306
|
readonly input: unknown;
|
|
298
307
|
}) => Promise<unknown>;
|
|
299
308
|
}
|
|
@@ -332,7 +341,35 @@ declare enum PluginExecutionStatus {
|
|
|
332
341
|
Cancelled = "cancelled",
|
|
333
342
|
Interrupted = "interrupted"
|
|
334
343
|
}
|
|
344
|
+
declare enum PluginCapabilityKind {
|
|
345
|
+
Command = "command",
|
|
346
|
+
Status = "status",
|
|
347
|
+
Context = "context"
|
|
348
|
+
}
|
|
349
|
+
declare enum PluginAgentScope {
|
|
350
|
+
Workspace = "workspace",
|
|
351
|
+
Execution = "execution"
|
|
352
|
+
}
|
|
353
|
+
interface PluginCapabilityReference {
|
|
354
|
+
readonly pluginId: string;
|
|
355
|
+
readonly kind: PluginCapabilityKind;
|
|
356
|
+
readonly id: string;
|
|
357
|
+
}
|
|
358
|
+
/** Host-owned receipts; plugin progress and Agent output cannot replace these. */
|
|
359
|
+
interface PluginExecutionEvidence {
|
|
360
|
+
readonly callId: string;
|
|
361
|
+
readonly kind: PluginCapabilityKind | "task";
|
|
362
|
+
readonly pluginId: string;
|
|
363
|
+
readonly id: string;
|
|
364
|
+
readonly status: "running" | "succeeded" | "failed";
|
|
365
|
+
readonly time: string;
|
|
366
|
+
readonly childExecutionId?: string | null;
|
|
367
|
+
readonly logId?: string | null;
|
|
368
|
+
readonly error?: string | null;
|
|
369
|
+
}
|
|
335
370
|
interface PluginExecutionSnapshot {
|
|
371
|
+
readonly evidence?: readonly PluginExecutionEvidence[];
|
|
372
|
+
readonly evidenceIncomplete?: boolean;
|
|
336
373
|
readonly afterExecutionId?: string | null;
|
|
337
374
|
readonly revision: number;
|
|
338
375
|
readonly tasks: readonly {
|
|
@@ -403,6 +440,7 @@ interface PluginRepository {
|
|
|
403
440
|
readonly branch: string;
|
|
404
441
|
readonly id: string;
|
|
405
442
|
readonly label: string;
|
|
443
|
+
readonly description?: string | null;
|
|
406
444
|
readonly root: string;
|
|
407
445
|
readonly status: PluginRepositoryStatus;
|
|
408
446
|
}
|
|
@@ -475,6 +513,7 @@ interface PluginCommandDetails {
|
|
|
475
513
|
readonly warnings?: readonly string[];
|
|
476
514
|
}
|
|
477
515
|
interface PluginCommandExecutionResult<Value = unknown> {
|
|
516
|
+
readonly success?: boolean | null;
|
|
478
517
|
readonly value: Value;
|
|
479
518
|
readonly executionId: string;
|
|
480
519
|
readonly parentExecutionId: string | null;
|
|
@@ -557,6 +596,7 @@ interface PluginToolContribution {
|
|
|
557
596
|
readonly version?: string;
|
|
558
597
|
}
|
|
559
598
|
interface PluginLifecycleOutcome {
|
|
599
|
+
readonly fileChanges?: readonly PluginFileChange[];
|
|
560
600
|
readonly code: string | null;
|
|
561
601
|
readonly details: unknown | null;
|
|
562
602
|
readonly durationMilliseconds: number;
|
|
@@ -570,6 +610,8 @@ interface PluginLifecycleOutcome {
|
|
|
570
610
|
readonly warnings: readonly string[];
|
|
571
611
|
}
|
|
572
612
|
interface PluginHookResult {
|
|
613
|
+
/** WorkspaceProvision only: proposed project files, applied by the host after preparation. */
|
|
614
|
+
readonly fileChanges?: readonly PluginFileChange[];
|
|
573
615
|
readonly standardError?: string;
|
|
574
616
|
readonly standardOutput?: string;
|
|
575
617
|
readonly warnings?: readonly string[];
|
|
@@ -579,6 +621,12 @@ interface PluginLifecycleDispatchResult {
|
|
|
579
621
|
readonly outcomes: readonly PluginLifecycleOutcome[];
|
|
580
622
|
readonly policy: PluginLifecyclePolicy;
|
|
581
623
|
}
|
|
624
|
+
/** Compare-and-set text changes relative to project.workbaseRoot, bounded by the project root. */
|
|
625
|
+
interface PluginFileChange {
|
|
626
|
+
readonly path: string;
|
|
627
|
+
readonly before: string | null;
|
|
628
|
+
readonly after: string | null;
|
|
629
|
+
}
|
|
582
630
|
interface PluginLifecycleHook {
|
|
583
631
|
readonly tap: (name: string, handler: (payload: unknown, context: PluginInvocationContext) => void | PluginHookResult | Promise<void | PluginHookResult>) => void;
|
|
584
632
|
}
|
|
@@ -637,4 +685,4 @@ interface PluginContributionSnapshot {
|
|
|
637
685
|
readonly views: readonly PluginViewContribution[];
|
|
638
686
|
}
|
|
639
687
|
//#endregion
|
|
640
|
-
export {
|
|
688
|
+
export { PluginAgentPolicy as $, PluginLifecycleOutcome as A, RoleToolEnvironment as At, PluginSetupHooks as B, PluginExecutionStatus as C, PluginTaskResult as Ct, PluginInvocationContext as D, PluginToastOptions as Dt, PluginHookResult as E, PluginToastLevel as Et, PluginProcessResult as F, roleToolsProposalSchema as Ft, PluginToolContribution as G, PluginSharedChanges as H, PluginProcessRunOptions as I, PluginViewLayout as J, PluginViewContribution as K, PluginProject as L, PluginLifecycleStatus as M, RoleToolsProposal as Mt, PluginLogger as N, roleToolEnvironmentSchema as Nt, PluginLifecycleDispatchResult as O, PluginViewCatalogEntry as Ot, PluginProcessApi as P, roleToolsAppliedSchema as Pt, PluginAgentContextCatalogEntry as Q, PluginRepository as R, PluginExecutionSnapshot as S, PluginTaskDescriptor as St, PluginHookId as T, PluginToastApi as Tt, PluginStatusContribution as U, PluginSharedChangeKind as V, PluginStatusDefinition as W, PluginWorkspace as X, PluginViewRequest as Y, WorkbasePluginDefinition as Z, PluginContext as _, PluginPromptType as _t, PluginCapabilityReference as a, PluginCommandCatalogEntry as at, PluginDisposable as b, PluginStoreApi as bt, PluginCommandContext as c, PluginHostServices as ct, PluginCommandDetails as d, PluginLogQueryRequest as dt, PluginCapabilityCatalog as et, PluginCommandEffect as f, PluginLogQueryResult as ft, PluginCommandTransaction as g, PluginPromptQuestion as gt, PluginCommandOption as h, PluginPromptChoice as ht, PluginCapabilityKind as i, PluginColoredMessage as it, PluginLifecyclePolicy as j, RoleToolsApplied as jt, PluginLifecycleHook as k, PluginToolsService as kt, PluginCommandContribution as l, PluginInteractiveLogger as lt, PluginCommandExecutionResult as m, PluginPromptApi as mt, PluginAgentContextDefinition as n, PluginCapabilityResolveRequest as nt, PluginCommandArgument as o, PluginConfigApi as ot, PluginCommandExecutionMode as p, PluginLogService as pt, PluginViewDefinition as q, PluginAgentScope as r, PluginCapabilityService as rt, PluginCommandCategory as s, PluginExecutionService as st, PluginAgentContextContribution as t, PluginCapabilityCommandRequest as tt, PluginCommandDefinition as u, PluginLogEntry as ut, PluginContextExposure as v, PluginPromptViewRequest as vt, PluginFileChange as w, PluginTaskService as wt, PluginExecutionEvidence as x, PluginSystemContextService as xt, PluginContributionSnapshot as y, PluginStatusCatalogEntry as yt, PluginRepositoryStatus as z };
|
package/dist/ui/index.css
CHANGED
|
@@ -247,3 +247,141 @@ h2 {
|
|
|
247
247
|
.maintenance-panel .mantine-Accordion-control { padding: 11px 14px; font-size: 13px; }
|
|
248
248
|
.error-message, .notice-card { margin: 12px 0 0; }
|
|
249
249
|
}
|
|
250
|
+
|
|
251
|
+
/** Shared configuration workbench: navigation, reading and explicit editing. */
|
|
252
|
+
[hidden] { display: none !important; }
|
|
253
|
+
.configuration-toolbar, .configuration-toolbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
254
|
+
.configuration-page-tabs { display: flex; gap: 4px; width: fit-content; padding: 4px; border-radius: 8px; background: var(--color-surface-muted); }
|
|
255
|
+
.configuration-page-tabs button { border: 0; border-radius: 5px; background: transparent; padding: 8px 14px; color: var(--color-muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
|
|
256
|
+
.configuration-page-tabs button[aria-pressed="true"] { color: var(--color-foreground); background: var(--color-surface); box-shadow: 0 1px 3px #342f2812; }
|
|
257
|
+
.configuration-page-tabs button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
|
|
258
|
+
.configuration-manager { min-width: 0; font-size: 13px; line-height: 1.6; }
|
|
259
|
+
.configuration-view { min-width: 0; }
|
|
260
|
+
.configuration-manager ::selection { color: var(--color-primary-foreground); background: var(--color-primary); }
|
|
261
|
+
.configuration-manager :is(input, textarea) { caret-color: var(--color-brand); }
|
|
262
|
+
.configuration-manager :is(pre, .configuration-items) { scrollbar-width: thin; scrollbar-color: var(--color-border-strong) transparent; }
|
|
263
|
+
.configuration-navigation { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--color-border); }
|
|
264
|
+
.configuration-tabs { display: flex; align-self: stretch; min-width: 0; gap: 24px; overflow-x: auto; }
|
|
265
|
+
.configuration-tabs button { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto; padding: 11px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--color-muted); font: inherit; font-weight: 500; cursor: pointer; }
|
|
266
|
+
.configuration-tabs button[aria-pressed="true"] { color: var(--color-foreground); border-bottom-color: var(--color-brand-gold); }
|
|
267
|
+
.configuration-tabs button:hover { color: var(--color-foreground); }
|
|
268
|
+
.configuration-tabs button span { color: var(--color-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
|
|
269
|
+
.configuration-tabs button:disabled { cursor: default; }
|
|
270
|
+
.configuration-manager :is(button, input, select, textarea, summary, pre):focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
|
|
271
|
+
.configuration-manager .configuration-resource-grid { display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: stretch; min-height: 540px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); }
|
|
272
|
+
.configuration-list { min-width: 0; padding: 20px 12px 12px; border-right: 1px solid var(--color-border); border-radius: 10px 0 0 10px; background: var(--color-surface-raised); }
|
|
273
|
+
.configuration-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 16px; }
|
|
274
|
+
.configuration-manager .configuration-list-heading h2 { margin: 0; font-size: 13px; font-weight: 600; }
|
|
275
|
+
.configuration-search { width: 100%; min-height: 36px; min-width: 0; padding: 7px 10px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); color: var(--color-foreground); font: inherit; font-size: 12px; }
|
|
276
|
+
.configuration-search::placeholder, .configuration-field :is(input, textarea)::placeholder { color: var(--color-tertiary); opacity: 1; }
|
|
277
|
+
.configuration-items { display: grid; align-content: start; gap: 4px; padding-top: 12px; max-height: 600px; overflow: auto; }
|
|
278
|
+
.configuration-row { display: grid; gap: 5px; width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 6px; text-align: left; color: inherit; background: transparent; font: inherit; cursor: pointer; overflow-wrap: anywhere; }
|
|
279
|
+
.configuration-row strong { font-size: 13px; font-weight: 600; line-height: 1.5; }
|
|
280
|
+
.configuration-row span { color: var(--color-muted); font-size: 11px; line-height: 1.5; }
|
|
281
|
+
.configuration-row:hover { background: var(--color-surface-muted); }
|
|
282
|
+
.configuration-row[aria-current="true"] { border-color: var(--color-border); background: var(--color-surface); }
|
|
283
|
+
.configuration-row[aria-current="true"] strong { color: var(--color-brand-deep); }
|
|
284
|
+
.configuration-row:disabled { cursor: default; }
|
|
285
|
+
.configuration-row:disabled:not([aria-current="true"]) { opacity: .6; }
|
|
286
|
+
.configuration-manager .configuration-list-footer { display: flex; justify-content: flex-start; margin: 16px 4px 0; padding-top: 16px; border-top: 1px solid var(--color-border); color: var(--color-muted); font-size: 12px; line-height: 1.7; }
|
|
287
|
+
.configuration-detail { display: flex; flex-direction: column; min-width: 0; }
|
|
288
|
+
.configuration-detail-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding: 26px 32px 22px; border-bottom: 1px solid var(--color-border); }
|
|
289
|
+
.configuration-detail-header.is-editing { position: sticky; top: 0; z-index: 2; background: var(--color-surface); }
|
|
290
|
+
.configuration-header-feedback { flex-basis: 100%; display: grid; gap: 12px; }
|
|
291
|
+
.configuration-manager .configuration-header-feedback p { margin: 0; font-size: 12px; }
|
|
292
|
+
.configuration-header-feedback .mantine-Alert-root { margin: 0; }
|
|
293
|
+
.configuration-detail-header > div { min-width: 0; }
|
|
294
|
+
.configuration-manager .configuration-detail-header h2 { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
|
|
295
|
+
.configuration-manager .configuration-detail-header p { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; color: var(--color-muted); font-size: 12px; }
|
|
296
|
+
.configuration-detail-header code { font-size: 11px; overflow-wrap: anywhere; }
|
|
297
|
+
.configuration-mode { padding-left: 10px; border-left: 1px solid var(--color-border-strong); }
|
|
298
|
+
.configuration-detail-body { flex: 1; min-width: 0; padding: 28px 32px 32px; }
|
|
299
|
+
.configuration-section + .configuration-section, .configuration-section + .configuration-disclosure { margin-top: 28px; }
|
|
300
|
+
.configuration-manager .configuration-section h3, .configuration-tasks legend { margin: 0 0 14px; color: var(--color-foreground); font-size: 14px; font-weight: 600; line-height: 1.5; }
|
|
301
|
+
.configuration-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
|
|
302
|
+
.configuration-manager .configuration-section-heading h3 { margin: 0; }
|
|
303
|
+
.configuration-manager .configuration-notice { margin: 0; color: var(--color-muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
|
|
304
|
+
.configuration-items > .configuration-notice { padding: 12px 4px; }
|
|
305
|
+
.configuration-manager .configuration-feedback { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: 6px; color: var(--color-foreground); background: var(--color-surface-raised); font-size: 13px; }
|
|
306
|
+
.configuration-manager .mantine-Alert-root { margin-bottom: 16px; }
|
|
307
|
+
.configuration-reading { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 32px; color: var(--color-muted); font-size: 12px; border-bottom: 1px solid var(--color-border); }
|
|
308
|
+
.configuration-empty { margin: auto; max-width: 480px; padding: 48px 32px; }
|
|
309
|
+
.configuration-manager .configuration-empty h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
|
|
310
|
+
.configuration-manager .configuration-empty p { margin: 8px 0 0; color: var(--color-muted); font-size: 13px; line-height: 1.8; }
|
|
311
|
+
.configuration-loading { padding: 32px; color: var(--color-muted); }
|
|
312
|
+
.configuration-field { display: grid; align-content: start; gap: 8px; min-width: 0; font-size: 13px; font-weight: 500; }
|
|
313
|
+
.configuration-field + .configuration-field, .configuration-fields + .configuration-field { margin-top: 16px; }
|
|
314
|
+
.configuration-notice + .configuration-field { margin-top: 16px; }
|
|
315
|
+
.configuration-field :is(input, select, textarea), .configuration-file-picker select { width: 100%; min-width: 0; padding: 10px 12px; color: var(--color-foreground); background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: 6px; font: inherit; font-weight: 400; line-height: 1.6; }
|
|
316
|
+
.configuration-field :is(input, select) { min-height: 40px; }
|
|
317
|
+
.configuration-field input[readonly] { color: var(--color-muted); background: var(--color-surface-raised); }
|
|
318
|
+
.configuration-field textarea { line-height: 1.8; resize: vertical; }
|
|
319
|
+
.configuration-field .configuration-code-editor { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.75; tab-size: 2; }
|
|
320
|
+
.configuration-hint { color: var(--color-muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
|
|
321
|
+
.configuration-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
|
|
322
|
+
.configuration-fields > .configuration-field { margin: 0; }
|
|
323
|
+
.configuration-form { display: flex; flex: 1; flex-direction: column; min-width: 0; }
|
|
324
|
+
.configuration-form > fieldset { min-width: 0; border: 0; margin: 0; }
|
|
325
|
+
.configuration-document-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--color-border); color: var(--color-muted); font-size: 12px; overflow-wrap: anywhere; }
|
|
326
|
+
.configuration-document-bar > span { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
|
|
327
|
+
.configuration-file-picker { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
|
|
328
|
+
.configuration-file-picker select { width: auto; font-size: 12px; padding: 6px 8px; }
|
|
329
|
+
.configuration-manager .configuration-content { max-height: 520px; margin: 0; padding: 20px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface-raised); white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.8; }
|
|
330
|
+
.configuration-manager .configuration-prose { max-width: 72ch; color: var(--color-foreground); font-size: 14px; line-height: 1.85; overflow-wrap: anywhere; }
|
|
331
|
+
.configuration-manager .configuration-prose :is(h1, h2, h3, h4) { margin: 28px 0 12px; line-height: 1.5; font-weight: 600; }
|
|
332
|
+
.configuration-manager .configuration-prose h1 { font-size: 22px; }
|
|
333
|
+
.configuration-manager .configuration-prose h2 { font-size: 18px; }
|
|
334
|
+
.configuration-manager .configuration-prose :is(h3, h4) { font-size: 15px; }
|
|
335
|
+
.configuration-manager .configuration-prose > :first-child { margin-top: 0; }
|
|
336
|
+
.configuration-manager .configuration-prose > :last-child { margin-bottom: 0; }
|
|
337
|
+
.configuration-manager .configuration-prose p { margin: 12px 0; }
|
|
338
|
+
.configuration-prose :is(ul, ol) { margin: 12px 0; padding-left: 22px; }
|
|
339
|
+
.configuration-prose li + li { margin-top: 5px; }
|
|
340
|
+
.configuration-prose a { color: var(--color-brand); text-underline-offset: 3px; }
|
|
341
|
+
.configuration-prose code { padding: 2px 4px; border-radius: 3px; background: var(--color-surface-muted); font-size: .9em; }
|
|
342
|
+
.configuration-prose pre { max-width: 100%; padding: 16px; overflow-x: auto; background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: 6px; }
|
|
343
|
+
.configuration-prose pre code { padding: 0; background: transparent; }
|
|
344
|
+
.configuration-prose blockquote { margin: 16px 0; padding: 4px 16px; border-left: 1px solid var(--color-border-strong); color: var(--color-muted); }
|
|
345
|
+
.configuration-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 13px; }
|
|
346
|
+
.configuration-prose :is(td, th) { padding: 8px 12px; border: 1px solid var(--color-border); text-align: left; }
|
|
347
|
+
.configuration-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; margin: 0; }
|
|
348
|
+
.configuration-facts dt { margin-bottom: 5px; color: var(--color-muted); font-size: 12px; }
|
|
349
|
+
.configuration-facts dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
|
|
350
|
+
.configuration-tasks { min-width: 0; padding: 0; border: 0; }
|
|
351
|
+
.configuration-tasks legend { padding: 0; }
|
|
352
|
+
.configuration-tasks > label { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--color-border); cursor: pointer; overflow-wrap: anywhere; }
|
|
353
|
+
.configuration-tasks input { flex-shrink: 0; width: 16px; height: 16px; margin: 3px 0; accent-color: var(--color-brand); }
|
|
354
|
+
.configuration-tasks label span { display: grid; gap: 3px; }
|
|
355
|
+
.configuration-tasks strong, .configuration-task-list strong { font-size: 13px; font-weight: 500; }
|
|
356
|
+
.configuration-tasks small, .configuration-task-list span { color: var(--color-muted); font-size: 12px; }
|
|
357
|
+
.configuration-task-list { list-style: none; padding: 0; margin: 0; }
|
|
358
|
+
.configuration-task-list li { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--color-border); overflow-wrap: anywhere; }
|
|
359
|
+
.configuration-disclosure { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--color-border); }
|
|
360
|
+
.configuration-disclosure summary { width: fit-content; padding: 4px 0; font-size: 13px; font-weight: 500; cursor: pointer; }
|
|
361
|
+
.configuration-disclosure summary span { margin-left: 10px; color: var(--color-muted); font-size: 12px; font-weight: 400; }
|
|
362
|
+
.configuration-disclosure[open] > summary { margin-bottom: 16px; }
|
|
363
|
+
.configuration-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: auto; padding: 16px 24px; border-top: 1px solid var(--color-border); border-radius: 0 0 10px 0; background: var(--color-surface-raised); }
|
|
364
|
+
.configuration-manager .configuration-footer p { flex: 1 1 220px; margin: 0; color: var(--color-muted); font-size: 12px; line-height: 1.6; }
|
|
365
|
+
.configuration-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
|
|
366
|
+
@media (max-width: 900px) {
|
|
367
|
+
.configuration-manager .configuration-resource-grid { grid-template-columns: 200px minmax(0, 1fr); }
|
|
368
|
+
.configuration-detail-header { padding: 22px 24px; }
|
|
369
|
+
.configuration-detail-body { padding: 24px; }
|
|
370
|
+
.configuration-tabs { gap: 18px; }
|
|
371
|
+
}
|
|
372
|
+
@media (max-width: 720px) {
|
|
373
|
+
.configuration-navigation { flex-wrap: wrap; gap: 12px; padding-bottom: 12px; }
|
|
374
|
+
.configuration-tabs { width: 100%; gap: 20px; }
|
|
375
|
+
.configuration-manager .configuration-resource-grid { grid-template-columns: minmax(0, 1fr); }
|
|
376
|
+
.configuration-list { border-right: 0; border-bottom: 1px solid var(--color-border); border-radius: 10px 10px 0 0; }
|
|
377
|
+
.configuration-manager[data-editing="true"] .configuration-list { display: none; }
|
|
378
|
+
.configuration-items { max-height: 176px; }
|
|
379
|
+
.configuration-list-footer { margin-top: 12px; }
|
|
380
|
+
.configuration-detail-header { padding: 20px; gap: 12px; }
|
|
381
|
+
.configuration-detail-body { padding: 24px 20px; }
|
|
382
|
+
.configuration-fields, .configuration-facts { grid-template-columns: minmax(0, 1fr); gap: 16px; }
|
|
383
|
+
.configuration-empty { padding: 36px 20px; }
|
|
384
|
+
.configuration-footer { padding: 16px 20px; border-radius: 0 0 10px 10px; }
|
|
385
|
+
.configuration-actions { margin-left: auto; }
|
|
386
|
+
.configuration-disclosure summary span { display: block; margin: 4px 0 0 16px; }
|
|
387
|
+
}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as PluginExecutionSnapshot, m as PluginCommandExecutionResult } from "../types-Cmfedh3f.js";
|
|
2
2
|
//#region src/ui/types.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Browser authoring API and transport contracts for Workbase plugin views.
|
package/dist/ui/model.d.ts
CHANGED
|
@@ -7,6 +7,16 @@ export interface PluginActionOutput {
|
|
|
7
7
|
readonly status: "completed" | "failed";
|
|
8
8
|
readonly title: string;
|
|
9
9
|
}
|
|
10
|
+
export declare enum ConfigurationMode {
|
|
11
|
+
View = "view",
|
|
12
|
+
Edit = "edit",
|
|
13
|
+
Create = "create"
|
|
14
|
+
}
|
|
15
|
+
export declare const TEAM_CONFIGURATION_NOTICE = "保存后将同步到团队工作区,团队成员共享此配置。";
|
|
16
|
+
export declare function configurationSavedMessage(publication: {
|
|
17
|
+
readonly status: "local" | "synced" | "pending";
|
|
18
|
+
readonly warning: string | null;
|
|
19
|
+
}): string;
|
|
10
20
|
export declare function formatActionOutput(title: string, result: unknown, logs: unknown): PluginActionOutput;
|
|
11
21
|
export declare function formatActionError(title: string, error: unknown): PluginActionOutput;
|
|
12
22
|
export declare function readableError(error: unknown, fallback: string): string;
|
package/dist/ui/model.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
//#region src/ui/model.ts
|
|
2
|
+
let ConfigurationMode = /* @__PURE__ */ function(ConfigurationMode) {
|
|
3
|
+
ConfigurationMode["View"] = "view";
|
|
4
|
+
ConfigurationMode["Edit"] = "edit";
|
|
5
|
+
ConfigurationMode["Create"] = "create";
|
|
6
|
+
return ConfigurationMode;
|
|
7
|
+
}({});
|
|
8
|
+
const TEAM_CONFIGURATION_NOTICE = "保存后将同步到团队工作区,团队成员共享此配置。";
|
|
9
|
+
function configurationSavedMessage(publication) {
|
|
10
|
+
if (publication.status === "pending") return `已保存,等待团队同步。${publication.warning ?? "请重试同步。"}`;
|
|
11
|
+
return publication.status === "synced" ? "已保存并同步到团队工作区。" : "已保存到本地项目;连接团队同步后共享。";
|
|
12
|
+
}
|
|
2
13
|
function formatActionOutput(title, result, logs) {
|
|
3
14
|
const logText = formatLogEntries(logs);
|
|
4
15
|
const resultText = formatResult(result);
|
|
@@ -35,4 +46,4 @@ function isRecord(value) {
|
|
|
35
46
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
36
47
|
}
|
|
37
48
|
//#endregion
|
|
38
|
-
export { formatActionError, formatActionOutput, readableError };
|
|
49
|
+
export { ConfigurationMode, TEAM_CONFIGURATION_NOTICE, configurationSavedMessage, formatActionError, formatActionOutput, readableError };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eworkbase/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"./ui/theme.css": "./dist/ui/theme.css"
|
|
27
27
|
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsdown",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
31
|
+
"pack:local": "pnpm build && pnpm pack"
|
|
32
|
+
},
|
|
28
33
|
"engines": {
|
|
29
34
|
"node": ">=22"
|
|
30
35
|
},
|
|
@@ -42,10 +47,5 @@
|
|
|
42
47
|
"@types/node": "^24.0.3",
|
|
43
48
|
"tsdown": "0.23.0",
|
|
44
49
|
"typescript": "^5.8.3"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "tsdown",
|
|
48
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
49
|
-
"pack:local": "pnpm build && pnpm pack"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|