@webship.co/workspace-graph 0.0.0-stage → 1.0.0-alpha1
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 +24 -2
- package/commands/cmd-tools-graphs.sh +18 -0
- package/config/workspace.graphs.settings.yml +25 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.js +17 -0
- package/dist/src/index.js.map +1 -0
- package/docs/AGENTS.md +29 -0
- package/docs/CLAUDE.md +7 -0
- package/docs/README.md +11 -0
- package/features/graph.feature +12 -0
- package/package.json +51 -4
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @webship.co/workspace-graph
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The **Graphs** workspace of the [Webship Workspace](https://github.com/webship/workspace) dashboard:
|
|
4
|
+
the `graphs/` folder (type `code`), its settings file (`core/config/workspace.graphs.settings.yml`),
|
|
5
|
+
its commands and its docs, as a plugin.
|
|
6
|
+
|
|
7
|
+
## Use it
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd ~/workspace
|
|
11
|
+
bash core/scripts/plugins.sh --require github:webship/workspace-graph
|
|
12
|
+
bash core/scripts/plugins.sh --activate graph # puts `graphs` on the workspaces list of settings.yml
|
|
13
|
+
bash core/scripts/plugins.sh --install graph # the folder, its settings file (once), its commands, its docs (once)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The settings file and the docs are placed once and never overwritten: they hold what you put there.
|
|
17
|
+
`--deactivate` takes the workspace off the list; the folder and its content stay.
|
|
18
|
+
|
|
19
|
+
## The commands
|
|
20
|
+
|
|
21
|
+
| Command |
|
|
22
|
+
| --- |
|
|
23
|
+
| `cmd-tools-graphs.sh` |
|
|
24
|
+
|
|
25
|
+
The bash functions these commands call live in the dashboard's `core/scripts/functions`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# workspace-name: Graphs (list, collect, serve over MCP)
|
|
4
|
+
|
|
5
|
+
# Bootstrap.
|
|
6
|
+
# Find the workspace tooling from this script, so a fresh clone needs no setup.
|
|
7
|
+
WORKSPACE_SCRIPTS="${WORKSPACE_SCRIPTS:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../core/scripts" && pwd)}";
|
|
8
|
+
source ${WORKSPACE_SCRIPTS}/bootstrap.sh || exit 1 ;
|
|
9
|
+
|
|
10
|
+
# Load workspace settings.
|
|
11
|
+
eval $(parse_yaml ${WORKSPACE_CONFIG}/workspace.graphs.settings.yml);
|
|
12
|
+
|
|
13
|
+
ARGPARSE_DESCRIPTION="Work with the project knowledge graphs kept in ~/workspace/graphs/"
|
|
14
|
+
source ${WORKSPACE_SCRIPTS}/args/arg-graphs.sh || exit 1 ;
|
|
15
|
+
|
|
16
|
+
shift $#;
|
|
17
|
+
|
|
18
|
+
graphs_command ;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
doc:
|
|
2
|
+
name: graphs
|
|
3
|
+
|
|
4
|
+
# Knowledge graphs built by cmd-tools-graphify.sh, one directory per project:
|
|
5
|
+
# graphs/<workspace>/<project>/{graph.json,GRAPH_REPORT.md,graph.html}
|
|
6
|
+
# They live HERE rather than inside the project on purpose: graphify writes tens of MB, Leiden
|
|
7
|
+
# clustering is not bit-stable so every rebuild diffs in full, and half the projects worth mapping
|
|
8
|
+
# are git repositories we ship — a recipe like products/website_starter must not gain a graphify-out/ or a
|
|
9
|
+
# CLAUDE.md block just because someone mapped it.
|
|
10
|
+
presentation:
|
|
11
|
+
icon: tabler:hierarchy-2
|
|
12
|
+
subtitle: Project Knowledge Graphs
|
|
13
|
+
noun: graph
|
|
14
|
+
kind: files
|
|
15
|
+
|
|
16
|
+
# What this folder's projects are, and which actions their rows offer:
|
|
17
|
+
# sites | code | files | media | ai-items — see core/workspace-app/WORKSPACES.md.
|
|
18
|
+
type: code
|
|
19
|
+
|
|
20
|
+
# What the assistant is called on THIS workspace's page, and what its composer says when empty.
|
|
21
|
+
# `default` in either means "whatever settings.yml says" — the global value, so a rename there
|
|
22
|
+
# still reaches this page. Set a value here to override it for this workspace alone.
|
|
23
|
+
assistant:
|
|
24
|
+
name: default
|
|
25
|
+
placeholder: default
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Graphs workspace for Webship Workspace: the `graphs/` folder as a plugin.
|
|
3
|
+
*
|
|
4
|
+
* What the package carries is placed by the installer from the manifest (the folder's settings file,
|
|
5
|
+
* its commands and its docs) and listed by --activate; the dashboard draws the workspace from the
|
|
6
|
+
* settings file like any other. Nothing to register at run time yet: this is where the folder's own
|
|
7
|
+
* rail buttons, row menus or assistant context would go.
|
|
8
|
+
*/
|
|
9
|
+
import type { PluginApi } from '@webship.co/workspace-plugin-api';
|
|
10
|
+
export declare const WORKSPACE_KEY = "graphs";
|
|
11
|
+
export declare function register(api: PluginApi): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The Graphs workspace for Webship Workspace: the `graphs/` folder as a plugin.
|
|
4
|
+
*
|
|
5
|
+
* What the package carries is placed by the installer from the manifest (the folder's settings file,
|
|
6
|
+
* its commands and its docs) and listed by --activate; the dashboard draws the workspace from the
|
|
7
|
+
* settings file like any other. Nothing to register at run time yet: this is where the folder's own
|
|
8
|
+
* rail buttons, row menus or assistant context would go.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.WORKSPACE_KEY = void 0;
|
|
12
|
+
exports.register = register;
|
|
13
|
+
exports.WORKSPACE_KEY = 'graphs';
|
|
14
|
+
function register(api) {
|
|
15
|
+
api.addAssistantContext(() => `The graphs/ workspace is the Graphs workspace (a plugin, @webship.co/workspace-graph); its commands are the cmd-*.sh scripts in that folder.`);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAMH,4BAEC;AAJY,QAAA,aAAa,GAAG,QAAQ,CAAC;AAEtC,SAAgB,QAAQ,CAAC,GAAc;IACrC,GAAG,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC,8IAA8I,CAAC,CAAC;AAChL,CAAC"}
|
package/docs/AGENTS.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Graphs
|
|
2
|
+
|
|
3
|
+
Every project's knowledge graph, one directory per project:
|
|
4
|
+
`graphs/<workspace>/<project>/` with `graph.json`, `GRAPH_REPORT.md` and `graph.html`.
|
|
5
|
+
|
|
6
|
+
Part of the **Webship Workspace** (`~/workspace`), a DDEV-only harness. The rules in the root
|
|
7
|
+
`CLAUDE.md` apply here too; what follows is what is specific to this folder.
|
|
8
|
+
|
|
9
|
+
## Why the graph is not in the project
|
|
10
|
+
|
|
11
|
+
A graph is tens of megabytes, its clustering is not bit-stable so every rebuild re-diffs in full,
|
|
12
|
+
and many of the projects worth mapping are repositories we ship — none should gain a generated
|
|
13
|
+
directory because somebody mapped it. `cmd-tools-graphify.sh` builds it in the project's own
|
|
14
|
+
workspace folder and the result is moved here.
|
|
15
|
+
|
|
16
|
+
**Build one from the project's workspace, never from here:**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
cd ~/workspace/dev && bash cmd-tools-graphify.sh <project>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Commands here
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
bash cmd-tools-graphs.sh # Graphs (list, collect, serve over MCP)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Every one locates the workspace from its own path, so there is nothing to export and nothing to
|
|
29
|
+
install. `--help` on any of them lists its arguments.
|
package/docs/CLAUDE.md
ADDED
package/docs/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Graphs
|
|
2
|
+
|
|
3
|
+
Knowledge graphs of a project's code, one directory per project:
|
|
4
|
+
`graphs/<workspace>/<project>/`.
|
|
5
|
+
|
|
6
|
+
They live here rather than inside the project on purpose. A graph is tens of megabytes, its
|
|
7
|
+
clustering is not bit-stable so every rebuild diffs in full, and half the projects worth mapping
|
|
8
|
+
are repositories we ship — none of them should gain a graph directory because somebody mapped it.
|
|
9
|
+
|
|
10
|
+
A graph answers *what depends on what*, deterministically, from the code. For *where is this
|
|
11
|
+
explained or configured*, see `rag/` — the two are complements, not alternatives.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: The Graphs workspace plugin
|
|
2
|
+
Once the plugin is activated and installed, the graphs workspace is on the dashboard, and the
|
|
3
|
+
Plugins page lists the plugin with its four steps.
|
|
4
|
+
|
|
5
|
+
Scenario: The workspace page is there
|
|
6
|
+
Given I am on "/graphs"
|
|
7
|
+
Then I should see "Graphs"
|
|
8
|
+
|
|
9
|
+
Scenario: The plugin is listed on the Plugins page
|
|
10
|
+
Given I am on "/settings/plugins"
|
|
11
|
+
Then I should see "Graphs"
|
|
12
|
+
And I should see "@webship.co/workspace-graph"
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webship.co/workspace-graph",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0-alpha1",
|
|
4
|
+
"description": "The Graphs workspace for Webship Workspace: the `graphs/` folder (type code), its settings file, its 1 commands and its docs, activated as a plugin.",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/webship/workspace-graph.git"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/src",
|
|
14
|
+
"commands",
|
|
15
|
+
"config",
|
|
16
|
+
"docs",
|
|
17
|
+
"features",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"prepare": "npm run build",
|
|
23
|
+
"test": "npm run build && node --test dist/tests/*.test.js",
|
|
24
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
25
|
+
},
|
|
26
|
+
"workspacePlugin": {
|
|
27
|
+
"name": "graph",
|
|
28
|
+
"label": "Graphs",
|
|
29
|
+
"workspace": {
|
|
30
|
+
"key": "graphs",
|
|
31
|
+
"settingsTemplate": "config/workspace.graphs.settings.yml",
|
|
32
|
+
"files": [
|
|
33
|
+
"commands/cmd-tools-graphs.sh"
|
|
34
|
+
],
|
|
35
|
+
"docs": [
|
|
36
|
+
"docs/AGENTS.md",
|
|
37
|
+
"docs/CLAUDE.md",
|
|
38
|
+
"docs/README.md"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"features": [
|
|
42
|
+
"features/graph.feature"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^24.0.0",
|
|
47
|
+
"@webship.co/workspace-plugin-api": "^1.0.0-alpha1",
|
|
48
|
+
"typescript": "^5.9.0"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
}
|
|
53
|
+
}
|