@nesso-how/plugin-example 0.6.0 → 0.8.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/README.md CHANGED
@@ -1,39 +1,35 @@
1
1
  # Plugin Example
2
2
 
3
- The official Nesso plugin example: an **Uppercase labels** action and a React **Concept Quiz** with persistent progress. See [`src/index.ts`](src/index.ts) and [`src/Quiz.tsx`](src/Quiz.tsx).
3
+ Two actions built with the Nesso SDK:
4
+
5
+ - **Uppercase labels** changes concept labels in the current view. See [`src/index.ts`](src/index.ts).
6
+ - **Concept Quiz** uses React to quiz you on the view's relations and saves your progress. See [`src/Quiz.tsx`](src/Quiz.tsx).
4
7
 
5
8
  ## Install and try
6
9
 
7
- In the desktop app, open Settings → Plugins, search for `@nesso-how/plugin-example`, and install it. Approve its declared access to concept labels, interactive panels, and private storage. The panel example requires the SDK and app versions containing central-panel support; build from this checkout until that SDK release is published.
10
+ In the desktop app, open Settings → Plugins, search for `@nesso-how/plugin-example`, and install it. Approve access to concept labels, panels, and private storage.
8
11
 
9
12
  Run either action from a view's context menu in the Explorer, or from its actions in the Inspector with nothing selected.
10
13
 
11
14
  ## Build your own
12
15
 
13
- Copy this example into a separate project, then install dependencies and build:
16
+ Use Node.js 24. Copy this example into a separate project. Choose your own package name, update the metadata and action IDs/labels, and remove any permissions you do not use. Then install dependencies and build:
14
17
 
15
18
  ```sh
16
19
  npm install
17
20
  npm run build
18
21
  ```
19
22
 
20
- The Vite configuration bundles code and imported CSS into `dist/index.js`, leaving React and React DOM to Nesso. See the [UI contract](../README.md#action-ui) for runtime requirements.
23
+ The build runs TypeScript checks, then bundles code and CSS into `dist/index.js`. Nesso supplies React and React DOM at runtime. To typecheck without building, run `npm run check`.
21
24
 
22
- Choose your own package name, plugin metadata, and action IDs and labels before publishing.
25
+ See the SDK guide for [tests and package validation](../README.md#build-and-test) and [panel APIs and styling](../README.md#action-ui).
23
26
 
24
27
  ## Test an unpublished build
25
28
 
26
- Open `package.json` and `dist/index.js` in a text editor. In desktop DevTools, set `manifest` to the parsed package JSON and `compiledCode` to the bundled JavaScript as a string:
27
-
28
- ```ts
29
- const result = await window.nessoPlugins.propose(
30
- crypto.randomUUID(),
31
- {
32
- manifest,
33
- files: [{ path: manifest.nesso.entry, bytes: new TextEncoder().encode(compiledCode) }],
34
- },
35
- 'en',
36
- )
29
+ Follow the SDK guide to [connect your agent](../README.md#with-an-agent) and [install through MCP](../README.md#install-or-update-through-mcp). Pass your project's absolute root path to `propose_plugin`, not its `dist` directory:
30
+
31
+ ```json
32
+ { "directory": "/absolute/path/to/my-plugin" }
37
33
  ```
38
34
 
39
- Approve the Nesso access dialog. Installation persists. On success, `result.value` contains the installed package; it is `null` if approval is declined. Failures return `result.issues`. To replace a build, pass the installed package's `contentId` as the fourth argument; development proposals require fresh approval.
35
+ Approve the installation in Nesso when prompted. Rebuilding does not update the installed copy; use the SDK guide's replacement procedure for later builds. If the published example is already installed, your local copy needs a different package name.
package/dist/index.js CHANGED
@@ -10151,7 +10151,7 @@ function Wu({ document: e, storage: t, viewId: s }) {
10151
10151
  let [c, l] = r(null), [u, d] = r(!1), f = `quiz:${s ?? "all"}`;
10152
10152
  n(() => {
10153
10153
  t.list().then((e) => {
10154
- let t = e.find((e) => e.key === f && e.conceptId === void 0)?.value;
10154
+ let t = e.find((e) => e.key === f && e.scope === void 0)?.value;
10155
10155
  l(typeof t == "number" ? t : 0);
10156
10156
  });
10157
10157
  }, [t, f]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nesso-how/plugin-example",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Official example showing how to build Nesso plugins with the SDK and plugin APIs",
5
5
  "keywords": [
6
6
  "nesso-plugin"
@@ -28,12 +28,12 @@
28
28
  "prepack": "npm run build"
29
29
  },
30
30
  "dependencies": {
31
- "@nesso-how/ui": "1.0.0-beta.1",
31
+ "@nesso-how/ui": "1.0.0-beta.8",
32
32
  "react": "^19.2.8",
33
33
  "react-dom": "^19.2.8"
34
34
  },
35
35
  "devDependencies": {
36
- "@nesso-how/plugin": "0.6.0",
36
+ "@nesso-how/plugin": "0.8.0",
37
37
  "@types/react": "^19.2.18",
38
38
  "@types/react-dom": "^19.2.7",
39
39
  "typescript": "~7.0.2",
@@ -54,7 +54,7 @@
54
54
  }
55
55
  },
56
56
  "nesso": {
57
- "apiVersion": 1,
57
+ "apiVersion": 3,
58
58
  "kind": "actions",
59
59
  "entry": "dist/index.js",
60
60
  "writes": [
package/src/Quiz.tsx CHANGED
@@ -11,7 +11,7 @@ export function Quiz({ document, storage, viewId }: ActionContext) {
11
11
  useEffect(() => {
12
12
  void storage.list().then((records) => {
13
13
  const value = records.find(
14
- (record) => record.key === key && record.conceptId === undefined,
14
+ (record) => record.key === key && record.scope === undefined,
15
15
  )?.value
16
16
  setStep(typeof value === 'number' ? value : 0)
17
17
  })