@industry-theme/repository-composition-panels 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.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Panel Tools
3
+ *
4
+ * UTCP-compatible tools for this 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: Refresh Git Status
14
+ */
15
+ export declare const refreshGitStatusTool: PanelTool;
16
+ /**
17
+ * Tool: Select File
18
+ */
19
+ export declare const selectFileTool: PanelTool;
20
+ /**
21
+ * Tool: Toggle Section
22
+ */
23
+ export declare const toggleSectionTool: PanelTool;
24
+ /**
25
+ * All tools exported as an array.
26
+ */
27
+ export declare const examplePanelTools: PanelTool[];
28
+ /**
29
+ * Panel tools metadata for registration with PanelToolRegistry.
30
+ */
31
+ export declare const examplePanelToolsMetadata: 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,oBAAoB,EAAE,SAwBlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,SA6B5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,SA+B/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,EAIxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAKvC,CAAC"}
@@ -0,0 +1,106 @@
1
+ // src/tools/index.ts
2
+ var refreshGitStatusTool = {
3
+ name: "refresh_git_status",
4
+ description: "Refreshes the git status display in the example panel",
5
+ inputs: {
6
+ type: "object",
7
+ properties: {
8
+ force: {
9
+ type: "boolean",
10
+ description: "Force refresh even if data is fresh"
11
+ }
12
+ }
13
+ },
14
+ outputs: {
15
+ type: "object",
16
+ properties: {
17
+ success: { type: "boolean" },
18
+ message: { type: "string" }
19
+ }
20
+ },
21
+ tags: ["git", "refresh", "status"],
22
+ tool_call_template: {
23
+ call_template_type: "panel_event",
24
+ event_type: "your-org.example-panel:refresh-git"
25
+ }
26
+ };
27
+ var selectFileTool = {
28
+ name: "select_file",
29
+ description: "Selects and highlights a file in the example panel file list",
30
+ inputs: {
31
+ type: "object",
32
+ properties: {
33
+ filePath: {
34
+ type: "string",
35
+ description: "Path to the file to select"
36
+ },
37
+ scrollIntoView: {
38
+ type: "boolean",
39
+ description: "Whether to scroll the file into view"
40
+ }
41
+ },
42
+ required: ["filePath"]
43
+ },
44
+ outputs: {
45
+ type: "object",
46
+ properties: {
47
+ success: { type: "boolean" },
48
+ selectedFile: { type: "string" }
49
+ }
50
+ },
51
+ tags: ["file", "selection", "navigation"],
52
+ tool_call_template: {
53
+ call_template_type: "panel_event",
54
+ event_type: "your-org.example-panel:select-file"
55
+ }
56
+ };
57
+ var toggleSectionTool = {
58
+ name: "toggle_section",
59
+ description: "Toggles the visibility of a section in the example panel",
60
+ inputs: {
61
+ type: "object",
62
+ properties: {
63
+ section: {
64
+ type: "string",
65
+ enum: ["staged", "unstaged", "untracked"],
66
+ description: "The section to toggle"
67
+ },
68
+ expanded: {
69
+ type: "boolean",
70
+ description: "Whether to expand (true) or collapse (false) the section"
71
+ }
72
+ },
73
+ required: ["section"]
74
+ },
75
+ outputs: {
76
+ type: "object",
77
+ properties: {
78
+ success: { type: "boolean" },
79
+ section: { type: "string" },
80
+ expanded: { type: "boolean" }
81
+ }
82
+ },
83
+ tags: ["ui", "toggle", "section"],
84
+ tool_call_template: {
85
+ call_template_type: "panel_event",
86
+ event_type: "your-org.example-panel:toggle-section"
87
+ }
88
+ };
89
+ var examplePanelTools = [
90
+ refreshGitStatusTool,
91
+ selectFileTool,
92
+ toggleSectionTool
93
+ ];
94
+ var examplePanelToolsMetadata = {
95
+ id: "your-org.example-panel",
96
+ name: "Example Panel",
97
+ description: "Tools provided by the example panel extension",
98
+ tools: examplePanelTools
99
+ };
100
+ export {
101
+ toggleSectionTool,
102
+ selectFileTool,
103
+ refreshGitStatusTool,
104
+ examplePanelToolsMetadata,
105
+ examplePanelTools
106
+ };
@@ -0,0 +1,22 @@
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, PanelTool, PanelToolsMetadata, JsonSchema, PanelEventCallTemplate, } from '@principal-ade/panel-framework-core';
7
+ export type { GitFileStatus } from '@principal-ade/dynamic-file-tree';
8
+ export type { FileTree } from '@principal-ai/repository-abstraction';
9
+ /**
10
+ * Git status data - categorized file paths
11
+ */
12
+ export interface GitStatus {
13
+ staged: string[];
14
+ unstaged: string[];
15
+ untracked: string[];
16
+ deleted: string[];
17
+ }
18
+ /**
19
+ * Git change selection status for callbacks
20
+ */
21
+ export type GitChangeSelectionStatus = 'staged' | 'unstaged' | 'untracked' | 'deleted';
22
+ //# 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,EAGnB,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAG7C,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,YAAY,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC"}
package/package.json ADDED
@@ -0,0 +1,100 @@
1
+ {
2
+ "name": "@industry-theme/repository-composition-panels",
3
+ "version": "0.1.0",
4
+ "description": "Repository composition panels including Git Changes panel for the panel framework",
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": "Your Name",
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/dynamic-file-tree": "^0.1.27",
56
+ "@principal-ade/industry-theme": "^0.1.3",
57
+ "@principal-ade/panel-framework-core": "^0.1.5",
58
+ "@principal-ade/utcp-panel-event": "^0.1.0",
59
+ "@principal-ai/repository-abstraction": "^0.2.5",
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/principal-ade/industry-themed-repository-composition-panels.git"
99
+ }
100
+ }