@hachej/boring-workspace 0.1.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/LICENSE +21 -0
- package/README.md +94 -0
- package/dist/CodeEditor-DQqOn4xz.js +266 -0
- package/dist/CommandPalette-aM61U-b0.js +5229 -0
- package/dist/FileTree-DRq_bfue.js +245 -0
- package/dist/MarkdownEditor-DjiHxnRv.js +349 -0
- package/dist/WorkspaceLoadingState-By0dZoPD.js +568 -0
- package/dist/agent-tool-NvxKfist.d.ts +28 -0
- package/dist/app-front.d.ts +485 -0
- package/dist/app-front.js +452 -0
- package/dist/app-server.d.ts +53 -0
- package/dist/app-server.js +769 -0
- package/dist/bootstrapServer-BRUqUpVW.d.ts +66 -0
- package/dist/boring-workspace.css +1 -0
- package/dist/charts.d.ts +114 -0
- package/dist/charts.js +143 -0
- package/dist/events.d.ts +178 -0
- package/dist/events.js +88 -0
- package/dist/explorer-DtLUnuah.d.ts +129 -0
- package/dist/panel-DnvDNQac.js +6 -0
- package/dist/server.d.ts +84 -0
- package/dist/server.js +811 -0
- package/dist/shared.d.ts +113 -0
- package/dist/shared.js +11 -0
- package/dist/testing-e2e.d.ts +68 -0
- package/dist/testing-e2e.js +45 -0
- package/dist/testing.d.ts +464 -0
- package/dist/testing.js +10984 -0
- package/dist/utils-B6yFEsav.js +8 -0
- package/dist/workspace.css +5780 -0
- package/dist/workspace.d.ts +2119 -0
- package/dist/workspace.js +1884 -0
- package/docs/INTERFACES.md +58 -0
- package/docs/PLUGIN_STRUCTURE.md +162 -0
- package/docs/README.md +19 -0
- package/docs/bridge.md +135 -0
- package/docs/panels.md +102 -0
- package/docs/plans/GENERIC_EXPLORER_PLUGIN_PLAN.md +455 -0
- package/docs/plans/MACRO_PLUGIN_GENERIC_HELPERS_AUDIT.md +962 -0
- package/docs/plans/PLUGIN_OUTPUTS_ISOLATION_PLAN.md +301 -0
- package/docs/plans/README.md +9 -0
- package/docs/plans/UI_BRIDGE_OWNERSHIP_REFACTOR.md +303 -0
- package/docs/plans/archive/CODE_OWNERSHIP_CLEANUP_PLAN.md +387 -0
- package/docs/plans/archive/COMMAND_PALETTE_REGISTRY.md +814 -0
- package/docs/plans/archive/DECLARATIVE_LAYOUT_MIGRATION.md +277 -0
- package/docs/plans/archive/PLUGIN_MODEL.md +3674 -0
- package/docs/plans/archive/SRC_FOLDER_REORG_PLAN.md +307 -0
- package/docs/plans/archive/UNIFIED_EVENT_BUS.md +647 -0
- package/docs/plans/archive/WORKSPACE_V2_PLAN.md +2489 -0
- package/docs/plugins.md +158 -0
- package/package.json +164 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
interface UiBridge {
|
|
2
|
+
getState(): Promise<UiState | null>;
|
|
3
|
+
setState(state: UiState): Promise<void>;
|
|
4
|
+
postCommand(cmd: UiCommand): Promise<CommandResult>;
|
|
5
|
+
subscribeCommands(handler: (cmd: UiCommand & {
|
|
6
|
+
seq: number;
|
|
7
|
+
}) => void): () => void;
|
|
8
|
+
drainCommands?(): Promise<Array<UiCommand & {
|
|
9
|
+
seq: number;
|
|
10
|
+
}>>;
|
|
11
|
+
}
|
|
12
|
+
type UiState = Record<string, unknown>;
|
|
13
|
+
type UiCommand = {
|
|
14
|
+
kind: 'openFile';
|
|
15
|
+
params: {
|
|
16
|
+
path: string;
|
|
17
|
+
mode?: 'view' | 'edit' | 'diff';
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'openSurface';
|
|
21
|
+
params: {
|
|
22
|
+
kind: string;
|
|
23
|
+
target: string;
|
|
24
|
+
meta?: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'openPanel';
|
|
28
|
+
params: {
|
|
29
|
+
id: string;
|
|
30
|
+
component: string;
|
|
31
|
+
params?: Record<string, unknown>;
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'closePanel';
|
|
35
|
+
params: {
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'closeWorkbenchLeftPane';
|
|
40
|
+
params: Record<string, never>;
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'showNotification';
|
|
43
|
+
params: {
|
|
44
|
+
msg: string;
|
|
45
|
+
level?: 'info' | 'warn' | 'error';
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'navigateToLine';
|
|
49
|
+
params: {
|
|
50
|
+
file: string;
|
|
51
|
+
line: number;
|
|
52
|
+
};
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'expandToFile';
|
|
55
|
+
params: {
|
|
56
|
+
path: string;
|
|
57
|
+
};
|
|
58
|
+
} | {
|
|
59
|
+
kind: string;
|
|
60
|
+
params: Record<string, unknown>;
|
|
61
|
+
};
|
|
62
|
+
interface CommandResult {
|
|
63
|
+
seq: number;
|
|
64
|
+
status: 'ok' | 'error';
|
|
65
|
+
error?: {
|
|
66
|
+
code: string;
|
|
67
|
+
message: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* DataExplorer shared types — no runtime deps.
|
|
73
|
+
*
|
|
74
|
+
* Importable from BOTH front and server bundles without dragging in
|
|
75
|
+
* platform-specific code.
|
|
76
|
+
*/
|
|
77
|
+
type Badge = {
|
|
78
|
+
/** 1–4 char mono code rendered as a chip. */
|
|
79
|
+
code: string;
|
|
80
|
+
tooltip?: string;
|
|
81
|
+
};
|
|
82
|
+
type ExplorerRow = {
|
|
83
|
+
id: string;
|
|
84
|
+
title: string;
|
|
85
|
+
/** Optional muted second line (truncates with title). */
|
|
86
|
+
subtitle?: string;
|
|
87
|
+
/** Group key — must match one of the facet values for `groupBy`. */
|
|
88
|
+
group?: string;
|
|
89
|
+
/** Leading mono chip (e.g. type code, frequency). */
|
|
90
|
+
leading?: Badge;
|
|
91
|
+
/** Trailing mono chips for status flags (e.g. [D] derived, [LIVE]). */
|
|
92
|
+
trailing?: Badge[];
|
|
93
|
+
/** Right-aligned plain text for numeric metadata (e.g. "1.2M", "2.4s"). */
|
|
94
|
+
meta?: string;
|
|
95
|
+
};
|
|
96
|
+
type FacetValue = {
|
|
97
|
+
value: string;
|
|
98
|
+
count: number;
|
|
99
|
+
};
|
|
100
|
+
type Facets = Record<string, FacetValue[]>;
|
|
101
|
+
type SearchArgs = {
|
|
102
|
+
query: string;
|
|
103
|
+
filters: Record<string, string[]>;
|
|
104
|
+
/** Scope to a single group's value (only set when paginating inside a group). */
|
|
105
|
+
group?: {
|
|
106
|
+
key: string;
|
|
107
|
+
value: string;
|
|
108
|
+
};
|
|
109
|
+
limit: number;
|
|
110
|
+
offset: number;
|
|
111
|
+
signal?: AbortSignal;
|
|
112
|
+
};
|
|
113
|
+
type SearchResult = {
|
|
114
|
+
items: ExplorerRow[];
|
|
115
|
+
/** Total count for the current scope (query + filters + optional group). */
|
|
116
|
+
total: number;
|
|
117
|
+
hasMore: boolean;
|
|
118
|
+
};
|
|
119
|
+
type FacetsArgs = {
|
|
120
|
+
filters: Record<string, string[]>;
|
|
121
|
+
signal?: AbortSignal;
|
|
122
|
+
};
|
|
123
|
+
type ExplorerAdapter = {
|
|
124
|
+
search(args: SearchArgs): Promise<SearchResult>;
|
|
125
|
+
/** Optional. When omitted, the explorer renders flat (no facet popover). */
|
|
126
|
+
fetchFacets?(args: FacetsArgs): Promise<Facets>;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export type { CommandResult as C, ExplorerAdapter as E, SearchResult as S, UiBridge as U, UiCommand as a, UiState as b, ExplorerRow as c };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { U as UiBridge, E as ExplorerAdapter, S as SearchResult } from './explorer-DtLUnuah.js';
|
|
2
|
+
export { C as CommandResult, a as UiCommand, b as UiState } from './explorer-DtLUnuah.js';
|
|
3
|
+
import { FastifyRequest, FastifyInstance } from 'fastify';
|
|
4
|
+
import { A as AgentTool } from './agent-tool-NvxKfist.js';
|
|
5
|
+
import { b as WorkspaceServerPlugin } from './bootstrapServer-BRUqUpVW.js';
|
|
6
|
+
export { C as ComposeServerPluginsOptions, S as ServerBootstrapOptions, e as ServerBootstrapResult, f as ServerPluginError, W as WorkspaceProvisioningContribution, a as WorkspaceRouteContribution, g as bootstrapServer, c as composeServerPlugins, d as defineServerPlugin, v as validateServerPlugin } from './bootstrapServer-BRUqUpVW.js';
|
|
7
|
+
export { PiPackageSource as WorkspacePiPackageSource } from '@hachej/boring-agent/server';
|
|
8
|
+
|
|
9
|
+
declare function createInMemoryBridge(): UiBridge;
|
|
10
|
+
|
|
11
|
+
interface UiRoutesOptions {
|
|
12
|
+
bridge?: UiBridge;
|
|
13
|
+
getBridge?: (request: FastifyRequest) => UiBridge | Promise<UiBridge>;
|
|
14
|
+
}
|
|
15
|
+
declare function uiRoutes(app: FastifyInstance, opts: UiRoutesOptions, done: (err?: Error) => void): void;
|
|
16
|
+
|
|
17
|
+
interface ExecUiToolOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Workspace root used to validate paths in path-bearing commands
|
|
20
|
+
* (`openFile`, `expandToFile`, `navigateToLine`). When provided, the
|
|
21
|
+
* tool stat-checks the resolved path before queueing the UI command and
|
|
22
|
+
* returns an error to the agent if the file is missing or escapes the
|
|
23
|
+
* root — so the model gets immediate feedback instead of the frontend
|
|
24
|
+
* silently no-op'ing on a wrong path. When omitted, paths are passed
|
|
25
|
+
* through unvalidated (back-compat for callers without server-side
|
|
26
|
+
* filesystem access).
|
|
27
|
+
*/
|
|
28
|
+
workspaceRoot?: string;
|
|
29
|
+
/**
|
|
30
|
+
* After dispatching a state-changing command (openFile, openPanel,
|
|
31
|
+
* openSurface, closePanel), wait this many ms before the first state
|
|
32
|
+
* read. Set to 0 to disable verification entirely. Defaults to 200ms.
|
|
33
|
+
*/
|
|
34
|
+
verifyDelayMs?: number;
|
|
35
|
+
/**
|
|
36
|
+
* How many additional state reads to attempt after the first if the
|
|
37
|
+
* expected change hasn't appeared yet. Defaults to 2.
|
|
38
|
+
*/
|
|
39
|
+
verifyRetries?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Milliseconds between retry state reads. Defaults to 200ms.
|
|
42
|
+
*/
|
|
43
|
+
verifyIntervalMs?: number;
|
|
44
|
+
}
|
|
45
|
+
declare function createGetUiStateTool(uiBridge: UiBridge): AgentTool;
|
|
46
|
+
declare function createExecUiTool(uiBridge: UiBridge, opts?: ExecUiToolOptions): AgentTool;
|
|
47
|
+
/**
|
|
48
|
+
* Convenience: returns both UI tools as an `AgentTool[]` ready to merge into
|
|
49
|
+
* `extraTools`. `createWorkspaceAgentServer` calls this internally; hosts that
|
|
50
|
+
* want manual control can use it directly:
|
|
51
|
+
*
|
|
52
|
+
* const bridge = createInMemoryBridge()
|
|
53
|
+
* const app = await createAgentApp({
|
|
54
|
+
* extraTools: createWorkspaceUiTools(bridge),
|
|
55
|
+
* })
|
|
56
|
+
* await app.register(uiRoutes, { bridge })
|
|
57
|
+
*/
|
|
58
|
+
declare function createWorkspaceUiTools(uiBridge: UiBridge, opts?: ExecUiToolOptions): AgentTool[];
|
|
59
|
+
|
|
60
|
+
interface DataCatalogAgentToolOptions {
|
|
61
|
+
name?: string;
|
|
62
|
+
label?: string;
|
|
63
|
+
adapter: ExplorerAdapter;
|
|
64
|
+
defaultLimit?: number;
|
|
65
|
+
maxLimit?: number;
|
|
66
|
+
}
|
|
67
|
+
interface DataCatalogSkillOptions {
|
|
68
|
+
label?: string;
|
|
69
|
+
toolName?: string;
|
|
70
|
+
surfaceKind?: string;
|
|
71
|
+
guidance?: string;
|
|
72
|
+
}
|
|
73
|
+
interface DataCatalogServerPluginOptions extends DataCatalogAgentToolOptions, DataCatalogSkillOptions {
|
|
74
|
+
id?: string;
|
|
75
|
+
}
|
|
76
|
+
declare function formatDataCatalogSearchResult(query: string, result: SearchResult): string;
|
|
77
|
+
declare function createDataCatalogAgentTool(options: DataCatalogAgentToolOptions): AgentTool;
|
|
78
|
+
declare function createDataCatalogSkillPrompt(options?: DataCatalogSkillOptions): string;
|
|
79
|
+
declare function createDataCatalogServerPlugin(options: DataCatalogServerPluginOptions): WorkspaceServerPlugin & {
|
|
80
|
+
agentTools: AgentTool[];
|
|
81
|
+
systemPrompt: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { type DataCatalogAgentToolOptions, type DataCatalogServerPluginOptions, type DataCatalogSkillOptions, UiBridge, type UiRoutesOptions, WorkspaceServerPlugin, createDataCatalogAgentTool, createDataCatalogServerPlugin, createDataCatalogSkillPrompt, createExecUiTool, createGetUiStateTool, createInMemoryBridge, createWorkspaceUiTools, formatDataCatalogSearchResult, uiRoutes };
|