@industry-theme/file-city-panel 0.2.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.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Panel Tools
3
+ *
4
+ * UTCP-compatible tools for the File City panel extension.
5
+ * These tools can be invoked by AI agents and emit events that panels listen for.
6
+ *
7
+ * IMPORTANT: This file should NOT import any React components to ensure
8
+ * it can be imported server-side without pulling in React dependencies.
9
+ * Use the './tools' subpath export for server-safe imports.
10
+ */
11
+ import type { PanelTool, PanelToolsMetadata } from '@principal-ade/utcp-panel-event';
12
+ /**
13
+ * Tool: Focus Building
14
+ */
15
+ export declare const focusBuildingTool: PanelTool;
16
+ /**
17
+ * Tool: Select District
18
+ */
19
+ export declare const selectDistrictTool: PanelTool;
20
+ /**
21
+ * Tool: Reset View
22
+ */
23
+ export declare const resetViewTool: PanelTool;
24
+ /**
25
+ * All tools exported as an array.
26
+ */
27
+ export declare const codeCityPanelTools: PanelTool[];
28
+ /**
29
+ * Panel tools metadata for registration with PanelToolRegistry.
30
+ */
31
+ export declare const codeCityPanelToolsMetadata: PanelToolsMetadata;
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,SA6B/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SA6BhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAuB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,EAIzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,kBAKxC,CAAC"}
@@ -0,0 +1,103 @@
1
+ // src/tools/index.ts
2
+ var focusBuildingTool = {
3
+ name: "focus_building",
4
+ description: "Focuses the camera on a specific file (building) in the file city visualization",
5
+ inputs: {
6
+ type: "object",
7
+ properties: {
8
+ filePath: {
9
+ type: "string",
10
+ description: "Path to the file to focus on"
11
+ },
12
+ animate: {
13
+ type: "boolean",
14
+ description: "Whether to animate the camera transition"
15
+ }
16
+ },
17
+ required: ["filePath"]
18
+ },
19
+ outputs: {
20
+ type: "object",
21
+ properties: {
22
+ success: { type: "boolean" },
23
+ message: { type: "string" }
24
+ }
25
+ },
26
+ tags: ["navigation", "camera", "focus"],
27
+ tool_call_template: {
28
+ call_template_type: "panel_event",
29
+ event_type: "industry-theme.file-city-panel:focus-building"
30
+ }
31
+ };
32
+ var selectDistrictTool = {
33
+ name: "select_district",
34
+ description: "Selects and highlights a directory (district) in the file city visualization",
35
+ inputs: {
36
+ type: "object",
37
+ properties: {
38
+ directoryPath: {
39
+ type: "string",
40
+ description: "Path to the directory to select"
41
+ },
42
+ expandChildren: {
43
+ type: "boolean",
44
+ description: "Whether to expand and show child buildings"
45
+ }
46
+ },
47
+ required: ["directoryPath"]
48
+ },
49
+ outputs: {
50
+ type: "object",
51
+ properties: {
52
+ success: { type: "boolean" },
53
+ selectedDistrict: { type: "string" }
54
+ }
55
+ },
56
+ tags: ["selection", "district", "directory"],
57
+ tool_call_template: {
58
+ call_template_type: "panel_event",
59
+ event_type: "industry-theme.file-city-panel:select-district"
60
+ }
61
+ };
62
+ var resetViewTool = {
63
+ name: "reset_view",
64
+ description: "Resets the file city view to the default camera position",
65
+ inputs: {
66
+ type: "object",
67
+ properties: {
68
+ animate: {
69
+ type: "boolean",
70
+ description: "Whether to animate the camera reset"
71
+ }
72
+ }
73
+ },
74
+ outputs: {
75
+ type: "object",
76
+ properties: {
77
+ success: { type: "boolean" }
78
+ }
79
+ },
80
+ tags: ["navigation", "camera", "reset"],
81
+ tool_call_template: {
82
+ call_template_type: "panel_event",
83
+ event_type: "industry-theme.file-city-panel:reset-view"
84
+ }
85
+ };
86
+ var codeCityPanelTools = [
87
+ focusBuildingTool,
88
+ selectDistrictTool,
89
+ resetViewTool
90
+ ];
91
+ var codeCityPanelToolsMetadata = {
92
+ id: "industry-theme.file-city-panel",
93
+ name: "File City Panel",
94
+ description: "Tools provided by the file city visualization panel extension",
95
+ tools: codeCityPanelTools
96
+ };
97
+ export {
98
+ selectDistrictTool,
99
+ resetViewTool,
100
+ focusBuildingTool,
101
+ codeCityPanelToolsMetadata,
102
+ codeCityPanelTools
103
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Panel Extension Type Definitions
3
+ *
4
+ * Re-exports core types from @principal-ade/panel-framework-core
5
+ */
6
+ export type { DataSlice, WorkspaceMetadata, RepositoryMetadata, FileTreeSource, ActiveFileSlice, PanelEventType, PanelEvent, PanelEventEmitter, PanelActions, PanelContextValue, PanelComponentProps, PanelMetadata, PanelLifecycleHooks, PanelDefinition, PanelModule, PanelRegistryEntry, PanelLoader, PanelRegistryConfig, } from '@principal-ade/panel-framework-core';
7
+ export type { FileCityColorModesSliceData, QualitySliceData, ColorMode, ColorModeConfig, FileMetricData, HighlightLayer, } from '../panels/utils/qualityLayers';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAEV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe,EAGf,cAAc,EACd,UAAU,EACV,iBAAiB,EAGjB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EAGnB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,WAAW,EAGX,kBAAkB,EAClB,WAAW,EACX,mBAAmB,GACpB,MAAM,qCAAqC,CAAC;AAG7C,YAAY,EACV,2BAA2B,EAC3B,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,+BAA+B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,100 @@
1
+ {
2
+ "name": "@industry-theme/file-city-panel",
3
+ "version": "0.2.0",
4
+ "description": "File City visualization panel extension for @principal-ade/panel-framework-core",
5
+ "type": "module",
6
+ "main": "dist/panels.bundle.js",
7
+ "module": "dist/panels.bundle.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/panels.bundle.js",
13
+ "require": "./dist/panels.bundle.js",
14
+ "default": "./dist/panels.bundle.js"
15
+ },
16
+ "./tools": {
17
+ "types": "./dist/tools/index.d.ts",
18
+ "import": "./dist/tools.bundle.js",
19
+ "require": "./dist/tools.bundle.js",
20
+ "default": "./dist/tools.bundle.js"
21
+ }
22
+ },
23
+ "keywords": [
24
+ "panel-extension"
25
+ ],
26
+ "author": "Principal AI",
27
+ "license": "MIT",
28
+ "scripts": {
29
+ "build": "bun run clean && bun run build:panel && bun run build:tools && bun run build:types",
30
+ "build:panel": "vite build",
31
+ "build:tools": "bun build ./src/tools/index.ts --outfile ./dist/tools.bundle.js --format esm --target browser",
32
+ "build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
33
+ "dev": "vite build --watch",
34
+ "clean": "rm -rf dist",
35
+ "typecheck": "tsc --noEmit",
36
+ "lint": "eslint . --ext .ts,.tsx",
37
+ "lint:fix": "eslint . --ext .ts,.tsx --fix",
38
+ "format": "prettier --write .",
39
+ "format:check": "prettier --check .",
40
+ "test": "bun test",
41
+ "test:watch": "bun test --watch",
42
+ "storybook": "storybook dev -p 6006",
43
+ "build-storybook": "storybook build"
44
+ },
45
+ "peerDependencies": {
46
+ "react": ">=19.0.0",
47
+ "react-dom": ">=19.0.0"
48
+ },
49
+ "peerDependenciesMeta": {
50
+ "@principal-ade/panel-framework-core": {
51
+ "optional": true
52
+ }
53
+ },
54
+ "dependencies": {
55
+ "@principal-ade/industry-theme": "^0.1.3",
56
+ "@principal-ade/panel-framework-core": "^0.1.5",
57
+ "@principal-ade/utcp-panel-event": "^0.1.0",
58
+ "@principal-ai/file-city-builder": "^0.3.0",
59
+ "@principal-ai/file-city-react": "^0.3.0",
60
+ "clsx": "^2.1.1",
61
+ "lucide-react": "^0.552.0"
62
+ },
63
+ "devDependencies": {
64
+ "@chromatic-com/storybook": "^4.1.3",
65
+ "@eslint/js": "^9.32.0",
66
+ "@storybook/addon-docs": "10.1.2",
67
+ "@storybook/addon-links": "10.1.2",
68
+ "@storybook/addon-onboarding": "10.1.2",
69
+ "@storybook/react-vite": "10.1.2",
70
+ "@types/bun": "latest",
71
+ "@types/node": "^22.15.26",
72
+ "@types/react": "^19.0.0",
73
+ "@types/react-dom": "^19.0.0",
74
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
75
+ "@typescript-eslint/parser": "^8.38.0",
76
+ "@vitejs/plugin-react": "^4.3.4",
77
+ "esbuild": "^0.25.8",
78
+ "eslint": "^9.32.0",
79
+ "eslint-config-prettier": "^10.1.8",
80
+ "eslint-plugin-react": "^7.37.2",
81
+ "eslint-plugin-react-hooks": "^5.0.0",
82
+ "eslint-plugin-storybook": "10.1.2",
83
+ "prettier": "^3.6.2",
84
+ "react": "^19.0.0",
85
+ "react-dom": "^19.0.0",
86
+ "storybook": "10.1.2",
87
+ "typescript": "^5.0.4",
88
+ "typescript-eslint": "^8.38.0",
89
+ "vite": "^6.0.7"
90
+ },
91
+ "files": [
92
+ "dist",
93
+ "README.md",
94
+ "LICENSE"
95
+ ],
96
+ "repository": {
97
+ "type": "git",
98
+ "url": "git+https://github.com/your-org/panel-starter.git"
99
+ }
100
+ }