@pooder/core 1.1.0 → 2.0.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.
@@ -1,79 +1,79 @@
1
- import { ExtensionContext } from "./context";
2
- import {
3
- ContributionPointIds,
4
- CommandContribution,
5
- ToolContribution,
6
- ViewContribution,
7
- } from "./contribution";
8
- import { Extension } from "./extension";
9
- import CommandService from "./services/CommandService";
10
-
11
- export const fullExtension: Extension = {
12
- id: "full-feature-test-extension",
13
- metadata: {
14
- name: "Full Feature Test Extension",
15
- },
16
-
17
- activate(context: ExtensionContext) {
18
- console.log("Full Feature Test Extension activated!");
19
-
20
- // Manually register a command (imperative way)
21
- const commandService =
22
- context.services.get<CommandService>("CommandService");
23
- commandService!.registerCommand("test.imperative.hello", (name: string) => {
24
- return `Hello Imperative ${name}`;
25
- });
26
- },
27
-
28
- deactivate(context: ExtensionContext) {
29
- console.log("Full Feature Test Extension deactivated!");
30
- },
31
-
32
- contribute() {
33
- return {
34
- // 1. Command Contributions
35
- [ContributionPointIds.COMMANDS]: [
36
- // Declarative command with handler (auto-registered by our updated ExtensionManager)
37
- {
38
- id: "test.declarative.auto",
39
- command: "test.declarative.auto",
40
- title: "Auto Registered Command",
41
- handler: () => {
42
- return "Auto Registered Result";
43
- },
44
- } as CommandContribution,
45
-
46
- // Declarative command without handler (just definition, maybe handled elsewhere)
47
- {
48
- id: "test.declarative.no-handler",
49
- command: "test.declarative.no-handler",
50
- title: "No Handler Command",
51
- } as CommandContribution,
52
- ],
53
-
54
- // 2. Tool Contributions
55
- [ContributionPointIds.TOOLS]: [
56
- {
57
- id: "test.tool.calculator",
58
- name: "Calculator",
59
- description: "Simple calculator",
60
- execute: async (op: string, a: number, b: number) => {
61
- if (op === "add") return a + b;
62
- return 0;
63
- },
64
- } as ToolContribution,
65
- ],
66
-
67
- // 3. View Contributions
68
- [ContributionPointIds.VIEWS]: [
69
- {
70
- id: "test.view.sidebar",
71
- name: "Test Sidebar",
72
- type: "sidebar",
73
- component: "SidebarComponent", // Mock component string
74
- location: "left",
75
- } as ViewContribution,
76
- ],
77
- };
78
- },
79
- };
1
+ import { ExtensionContext } from "./context";
2
+ import {
3
+ ContributionPointIds,
4
+ CommandContribution,
5
+ ToolContribution,
6
+ ViewContribution,
7
+ } from "./contribution";
8
+ import { Extension } from "./extension";
9
+ import CommandService from "./services/CommandService";
10
+
11
+ export const fullExtension: Extension = {
12
+ id: "full-feature-test-extension",
13
+ metadata: {
14
+ name: "Full Feature Test Extension",
15
+ },
16
+
17
+ activate(context: ExtensionContext) {
18
+ console.log("Full Feature Test Extension activated!");
19
+
20
+ // Manually register a command (imperative way)
21
+ const commandService =
22
+ context.services.get<CommandService>("CommandService");
23
+ commandService!.registerCommand("test.imperative.hello", (name: string) => {
24
+ return `Hello Imperative ${name}`;
25
+ });
26
+ },
27
+
28
+ deactivate(context: ExtensionContext) {
29
+ console.log("Full Feature Test Extension deactivated!");
30
+ },
31
+
32
+ contribute() {
33
+ return {
34
+ // 1. Command Contributions
35
+ [ContributionPointIds.COMMANDS]: [
36
+ // Declarative command with handler (auto-registered by our updated ExtensionManager)
37
+ {
38
+ id: "test.declarative.auto",
39
+ command: "test.declarative.auto",
40
+ title: "Auto Registered Command",
41
+ handler: () => {
42
+ return "Auto Registered Result";
43
+ },
44
+ } as CommandContribution,
45
+
46
+ // Declarative command without handler (just definition, maybe handled elsewhere)
47
+ {
48
+ id: "test.declarative.no-handler",
49
+ command: "test.declarative.no-handler",
50
+ title: "No Handler Command",
51
+ } as CommandContribution,
52
+ ],
53
+
54
+ // 2. Tool Contributions
55
+ [ContributionPointIds.TOOLS]: [
56
+ {
57
+ id: "test.tool.calculator",
58
+ name: "Calculator",
59
+ description: "Simple calculator",
60
+ execute: async (op: string, a: number, b: number) => {
61
+ if (op === "add") return a + b;
62
+ return 0;
63
+ },
64
+ } as ToolContribution,
65
+ ],
66
+
67
+ // 3. View Contributions
68
+ [ContributionPointIds.VIEWS]: [
69
+ {
70
+ id: "test.view.sidebar",
71
+ name: "Test Sidebar",
72
+ type: "sidebar",
73
+ component: "SidebarComponent", // Mock component string
74
+ location: "left",
75
+ } as ViewContribution,
76
+ ],
77
+ };
78
+ },
79
+ };