@webship.co/workspace-umami 0.0.0-stage → 1.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.
- package/LICENSE +15 -0
- package/README.md +197 -2
- package/ai/agents/umami-builder.md +61 -0
- package/ai/agents/umami-tester.md +54 -0
- package/ai/commands/umami-test.md +29 -0
- package/ai/prompts/umami-build-and-test.md +20 -0
- package/ai/prompts/umami-scenarios-for-a-project.md +18 -0
- package/ai/skills/umami-scenarios/SKILL.md +70 -0
- package/ai/skills/umami-scenarios/examples/people.feature +14 -0
- package/ai/skills/umami-scenarios/examples/session.feature +15 -0
- package/ai/skills/umami-scenarios/examples/websites.feature +21 -0
- package/commands/cmd-umami-project.sh +31 -0
- package/dist/src/index.d.ts +30 -0
- package/dist/src/index.js +54 -0
- package/dist/src/index.js.map +1 -0
- package/features/umami-runtimes.feature +51 -0
- package/features/umami.feature +35 -0
- package/package.json +112 -4
- package/scripts/args/arg-umami.sh +19 -0
- package/scripts/functions/fun-umami.sh +397 -0
- package/scripts/umami-admin.py +104 -0
- package/testing/site.feature +19 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Umami for Webship Workspace: a plugin for Umami, privacy-friendly web analytics.
|
|
4
|
+
*
|
|
5
|
+
* What the package carries is placed by the installer from the manifest: the builder in the sites folders, its
|
|
6
|
+
* functions, argparse and machine files (the script that replaces the default admin password and makes or removes a
|
|
7
|
+
* user through the app's API, a first feature) under core/scripts/plugins/umami/, and its AI items (ai/) in the AI
|
|
8
|
+
* folders. The builder runs Umami from its official image on GHCR by digest, with the project's PostgreSQL (the core's
|
|
9
|
+
* own: its backup is the core's dump), its default admin password replaced at the first start, and no request
|
|
10
|
+
* elsewhere. The step pack (@webship-js/umami-steps) goes into the testing setup of such a project with the core's
|
|
11
|
+
* `cmd-tools-testing.sh <project>`. What register() adds is what the assistant is told.
|
|
12
|
+
*
|
|
13
|
+
* Everything the dashboard is asked for goes through `api`; this package requires nothing from the dashboard's own
|
|
14
|
+
* files, so it can be installed from npm and removed without a trace.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.PROMPTS = exports.AI_COMMANDS = exports.SKILLS = exports.AGENTS = exports.COMMANDS = exports.PLATFORM = void 0;
|
|
18
|
+
exports.assistantContext = assistantContext;
|
|
19
|
+
exports.register = register;
|
|
20
|
+
/** The plugin's name, which its functions are named after. */
|
|
21
|
+
exports.PLATFORM = 'umami';
|
|
22
|
+
/** The commands the installer places in every sites folder. */
|
|
23
|
+
exports.COMMANDS = ['cmd-umami-project.sh'];
|
|
24
|
+
/** The agents the installer places in the AI Agents folder. */
|
|
25
|
+
exports.AGENTS = ['umami-builder', 'umami-tester'];
|
|
26
|
+
/** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
|
|
27
|
+
exports.SKILLS = ['umami-scenarios'];
|
|
28
|
+
/** The slash command the installer places in the AI Commands folder. */
|
|
29
|
+
exports.AI_COMMANDS = ['umami-test'];
|
|
30
|
+
/** The prompts the installer places in the AI Prompts folder: whole launch commands for a new session. */
|
|
31
|
+
exports.PROMPTS = ['umami-build-and-test', 'umami-scenarios-for-a-project'];
|
|
32
|
+
/** What the assistant is told about Umami in this workspace. */
|
|
33
|
+
function assistantContext() {
|
|
34
|
+
return [
|
|
35
|
+
'Umami (a plugin, @webship.co/workspace-umami): its builder runs Umami 3.5.1 from its official image on GHCR by digest, with the',
|
|
36
|
+
'project\'s PostgreSQL 17, with `bash cmd-umami-project.sh <name> --install` from a sites folder (dev, test, sandboxes, demos), at',
|
|
37
|
+
'https://<name>.ddev.site. The app seeds its admin as admin / umami: the builder replaces that default password at the first start with',
|
|
38
|
+
'the one in <project>/.webship-umami/admin-password, so it never stays. Its telemetry and update check are off and its websites\' icons come',
|
|
39
|
+
'from itself (FAVICON_URL), so it makes no request elsewhere. On DDEV Umami runs as a service of the project and DDEV\'s nginx sends the',
|
|
40
|
+
'project\'s address to it; `--runtime docker`, `podman` or `kubernetes` builds it there instead. Its database is the core\'s PostgreSQL:',
|
|
41
|
+
'the row\'s Backup and Restore dump and load it. `bash cmd-tools-add-users.sh <name> umami` makes the user webship-viewer (View only; its',
|
|
42
|
+
'password in .webship-umami/). `bash cmd-tools-testing.sh <name>` sets up webship-js with the step pack @webship-js/umami-steps: its steps',
|
|
43
|
+
'sign in, add websites and read their tracking code, send page views the way the tracker does (to the app only), read what the overview',
|
|
44
|
+
'counts, make users with a role, and remove what a scenario made.',
|
|
45
|
+
`For building or fixing an Umami project, hand over to the agent \`${exports.AGENTS[0]}\`; for testing one, to \`${exports.AGENTS[1]}\`.`,
|
|
46
|
+
`The plugin also places the skill ${exports.SKILLS.map((a) => `\`${a}\``).join(', ')} (the step pack's phrases) in ai-skills/,`,
|
|
47
|
+
`the command ${exports.AI_COMMANDS.map((a) => `\`/${a} <project>\``).join(', ')} in ai-commands/ and the prompts ${exports.PROMPTS.map((a) => `\`${a}\``).join(' and ')} in ai-prompts/.`,
|
|
48
|
+
'Never print or paste a password or a sign-in token (the app keeps it in the browser\'s localStorage as umami.auth).',
|
|
49
|
+
].join(' ');
|
|
50
|
+
}
|
|
51
|
+
function register(api) {
|
|
52
|
+
api.addAssistantContext(assistantContext);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAuBH,4CAiBC;AAED,4BAEC;AAxCD,8DAA8D;AACjD,QAAA,QAAQ,GAAG,OAAO,CAAC;AAEhC,+DAA+D;AAClD,QAAA,QAAQ,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEjD,+DAA+D;AAClD,QAAA,MAAM,GAAG,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAExD,iGAAiG;AACpF,QAAA,MAAM,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAE1C,wEAAwE;AAC3D,QAAA,WAAW,GAAG,CAAC,YAAY,CAAC,CAAC;AAE1C,0GAA0G;AAC7F,QAAA,OAAO,GAAG,CAAC,sBAAsB,EAAE,+BAA+B,CAAC,CAAC;AAEjF,gEAAgE;AAChE,SAAgB,gBAAgB;IAC9B,OAAO;QACL,iIAAiI;QACjI,mIAAmI;QACnI,wIAAwI;QACxI,6IAA6I;QAC7I,yIAAyI;QACzI,yIAAyI;QACzI,0IAA0I;QAC1I,2IAA2I;QAC3I,wIAAwI;QACxI,kEAAkE;QAClE,qEAAqE,cAAM,CAAC,CAAC,CAAC,6BAA6B,cAAM,CAAC,CAAC,CAAC,KAAK;QACzH,oCAAoC,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,2CAA2C;QACvH,eAAe,mBAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,oCAAoC,eAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB;QACzK,qHAAqH;KACtH,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED,SAAgB,QAAQ,CAAC,GAAc;IACrC,GAAG,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Feature: A Umami project on Docker Compose, Podman and Kubernetes
|
|
2
|
+
The builder builds on DDEV by default, and with --runtime on Docker Compose, Podman or a Kubernetes cluster. A project
|
|
3
|
+
built there has the row a DDEV project has: its state, its own address and the runtime's menu, and Umami
|
|
4
|
+
serves it from its official image on GHCR.
|
|
5
|
+
|
|
6
|
+
# Each scenario drives a real project of that runtime, built with cmd-umami-project.sh --runtime: the first running
|
|
7
|
+
# one the workspace holds. Without one it is skipped, with the reason. In the plugin's CI the Docker Compose project is
|
|
8
|
+
# the one the manifest's featuresSite builds: ci-umami.
|
|
9
|
+
|
|
10
|
+
@needs-runtime-docker @needs-platform-umami
|
|
11
|
+
Scenario: A Umami project built on Docker Compose runs at its own address, with the DOCKER menu
|
|
12
|
+
Given I am on the folder of the "docker" site
|
|
13
|
+
Then the row of the "docker" site should show "Running"
|
|
14
|
+
And the row of the "docker" site should link to the address of its runtime
|
|
15
|
+
And the address of the "docker" site should answer
|
|
16
|
+
And the row of the "docker" site should carry the "DOCKER" menu and no DDEV menu
|
|
17
|
+
|
|
18
|
+
# The sign-in page, answered without an account.
|
|
19
|
+
@needs-runtime-docker @needs-platform-umami
|
|
20
|
+
Scenario: Umami on Docker Compose shows its sign-in page
|
|
21
|
+
Given I am on the folder of the "docker" site
|
|
22
|
+
When I open "/login" on the "docker" site
|
|
23
|
+
Then "body" should contain text "Login" within 30 seconds
|
|
24
|
+
|
|
25
|
+
@needs-runtime-podman @needs-platform-umami
|
|
26
|
+
Scenario: A Umami project built on Podman runs at its own address, with the PODMAN menu
|
|
27
|
+
Given I am on the folder of the "podman" site
|
|
28
|
+
Then the row of the "podman" site should show "Running"
|
|
29
|
+
And the row of the "podman" site should link to the address of its runtime
|
|
30
|
+
And the address of the "podman" site should answer
|
|
31
|
+
And the row of the "podman" site should carry the "PODMAN" menu and no DDEV menu
|
|
32
|
+
|
|
33
|
+
@needs-runtime-podman @needs-platform-umami
|
|
34
|
+
Scenario: Umami on Podman shows its sign-in page
|
|
35
|
+
Given I am on the folder of the "podman" site
|
|
36
|
+
When I open "/login" on the "podman" site
|
|
37
|
+
Then "body" should contain text "Login" within 30 seconds
|
|
38
|
+
|
|
39
|
+
@needs-runtime-kubernetes @needs-platform-umami
|
|
40
|
+
Scenario: A Umami project built on Kubernetes runs at the address of its node, with the K8S menu
|
|
41
|
+
Given I am on the folder of the "kubernetes" site
|
|
42
|
+
Then the row of the "kubernetes" site should show "Running"
|
|
43
|
+
And the row of the "kubernetes" site should link to the address of its runtime
|
|
44
|
+
And the address of the "kubernetes" site should answer
|
|
45
|
+
And the row of the "kubernetes" site should carry the "K8S" menu and no DDEV menu
|
|
46
|
+
|
|
47
|
+
@needs-runtime-kubernetes @needs-platform-umami
|
|
48
|
+
Scenario: Umami on Kubernetes shows its sign-in page
|
|
49
|
+
Given I am on the folder of the "kubernetes" site
|
|
50
|
+
When I open "/login" on the "kubernetes" site
|
|
51
|
+
Then "body" should contain text "Login" within 30 seconds
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Feature: The Umami plugin on the dashboard
|
|
2
|
+
Once the plugin is activated and installed, the sites folders offer the Umami builder,
|
|
3
|
+
each AI folder lists the items of its kind the plugin ships, and the Plugins page lists the plugin with what it ships.
|
|
4
|
+
|
|
5
|
+
# Settings lists every plugin that was added; the package and what the plugin ships are on its own page.
|
|
6
|
+
Scenario: Settings lists the plugin, and its own page names its package and what it ships
|
|
7
|
+
Given I am on "/settings"
|
|
8
|
+
Then I should see "Umami"
|
|
9
|
+
When I go to "/settings/plugin/umami"
|
|
10
|
+
Then I should see "@webship.co/workspace-umami"
|
|
11
|
+
And I should see "cmd-umami-project.sh"
|
|
12
|
+
And I should see "umami-builder"
|
|
13
|
+
|
|
14
|
+
Scenario: A sites folder offers the Umami builder
|
|
15
|
+
Given I am on "/dev"
|
|
16
|
+
Then "option[value='cmd-umami-project.sh']" should be attached
|
|
17
|
+
|
|
18
|
+
# The AI folders are searched by name: with every plugin on, a folder lists more than one page of items.
|
|
19
|
+
Scenario: The AI Agents folder lists the agents the plugin ships
|
|
20
|
+
Given I am on "/ai-agents?q=umami-"
|
|
21
|
+
Then I should see "umami-builder"
|
|
22
|
+
And I should see "umami-tester"
|
|
23
|
+
|
|
24
|
+
Scenario: The AI Skills folder lists the skill the plugin ships
|
|
25
|
+
Given I am on "/ai-skills?q=umami-scenarios"
|
|
26
|
+
Then I should see "umami-scenarios"
|
|
27
|
+
|
|
28
|
+
Scenario: The AI Commands folder lists the command the plugin ships
|
|
29
|
+
Given I am on "/ai-commands?q=umami-test"
|
|
30
|
+
Then I should see "umami-test"
|
|
31
|
+
|
|
32
|
+
Scenario: The AI Prompts folder lists the prompts the plugin ships
|
|
33
|
+
Given I am on "/ai-prompts?q=umami-"
|
|
34
|
+
Then I should see "umami-build-and-test"
|
|
35
|
+
And I should see "umami-scenarios-for-a-project"
|
package/package.json
CHANGED
|
@@ -1,6 +1,114 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webship.co/workspace-umami",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Umami for the Webship Workspace: a builder for the web analytics app (its official image by digest, the project's PostgreSQL, its default admin password replaced at the first start, no request elsewhere) on DDEV, Docker Compose, Podman and Kubernetes, the testing hook for its step pack @webship-js/umami-steps, and its AI agents, skill, command and prompts.",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=24"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/webship/workspace-umami.git"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/src",
|
|
17
|
+
"ai",
|
|
18
|
+
"commands",
|
|
19
|
+
"features",
|
|
20
|
+
"scripts",
|
|
21
|
+
"testing",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -p tsconfig.json",
|
|
26
|
+
"prepare": "npm run build",
|
|
27
|
+
"test": "npm run build && node --test dist/tests/*.test.js",
|
|
28
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
29
|
+
},
|
|
30
|
+
"workspacePlugin": {
|
|
31
|
+
"name": "umami",
|
|
32
|
+
"label": "Umami",
|
|
33
|
+
"summary": "Run Umami, privacy-friendly web analytics",
|
|
34
|
+
"needs": [
|
|
35
|
+
[
|
|
36
|
+
"dev",
|
|
37
|
+
"test",
|
|
38
|
+
"sandboxes",
|
|
39
|
+
"demos"
|
|
40
|
+
],
|
|
41
|
+
"ai-agents",
|
|
42
|
+
"ai-skills",
|
|
43
|
+
"ai-commands",
|
|
44
|
+
"ai-prompts"
|
|
45
|
+
],
|
|
46
|
+
"commands": {
|
|
47
|
+
"types": [
|
|
48
|
+
"sites"
|
|
49
|
+
],
|
|
50
|
+
"workspaces": [
|
|
51
|
+
"dev",
|
|
52
|
+
"test",
|
|
53
|
+
"sandboxes",
|
|
54
|
+
"demos"
|
|
55
|
+
],
|
|
56
|
+
"files": [
|
|
57
|
+
"commands/cmd-umami-project.sh"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"functions": [
|
|
62
|
+
"scripts/functions/fun-umami.sh"
|
|
63
|
+
],
|
|
64
|
+
"args": [
|
|
65
|
+
"scripts/args/arg-umami.sh"
|
|
66
|
+
],
|
|
67
|
+
"machine": [
|
|
68
|
+
"scripts/umami-admin.py",
|
|
69
|
+
"testing/site.feature"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"ai": {
|
|
73
|
+
"agents": [
|
|
74
|
+
"ai/agents/umami-builder.md",
|
|
75
|
+
"ai/agents/umami-tester.md"
|
|
76
|
+
],
|
|
77
|
+
"skills": [
|
|
78
|
+
"ai/skills/umami-scenarios"
|
|
79
|
+
],
|
|
80
|
+
"commands": [
|
|
81
|
+
"ai/commands/umami-test.md"
|
|
82
|
+
],
|
|
83
|
+
"prompts": [
|
|
84
|
+
"ai/prompts/umami-build-and-test.md",
|
|
85
|
+
"ai/prompts/umami-scenarios-for-a-project.md"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"features": [
|
|
89
|
+
"features/umami.feature",
|
|
90
|
+
"features/umami-runtimes.feature"
|
|
91
|
+
],
|
|
92
|
+
"featuresSite": "cmd-umami-project.sh ci-umami --install --runtime docker"
|
|
93
|
+
},
|
|
94
|
+
"devDependencies": {
|
|
95
|
+
"@types/node": "^24.0.0",
|
|
96
|
+
"@webship.co/workspace-plugin-api": "^1.0.13",
|
|
97
|
+
"typescript": "^5.9.0"
|
|
98
|
+
},
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"access": "public"
|
|
101
|
+
},
|
|
102
|
+
"keywords": [
|
|
103
|
+
"webship",
|
|
104
|
+
"workspace",
|
|
105
|
+
"workspace-plugin",
|
|
106
|
+
"umami",
|
|
107
|
+
"analytics",
|
|
108
|
+
"web-analytics",
|
|
109
|
+
"ddev",
|
|
110
|
+
"docker",
|
|
111
|
+
"kubernetes",
|
|
112
|
+
"webship-js"
|
|
113
|
+
]
|
|
114
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
argparse "$@" <<ARGEOF || exit 1
|
|
4
|
+
parser.add_argument('PROJECT_NAME',
|
|
5
|
+
help='The name of the project: its folder, and its project on the container runtime.')
|
|
6
|
+
parser.add_argument('--runtime',
|
|
7
|
+
dest='RUNTIME',
|
|
8
|
+
default="_none_",
|
|
9
|
+
choices=['ddev', 'docker', 'podman', 'kubernetes'],
|
|
10
|
+
help='The container runtime to build on: ddev (the default, or container.runtime of settings.yml), docker (Docker Compose), podman or kubernetes.')
|
|
11
|
+
parser.add_argument('-i', '--install',
|
|
12
|
+
action='store_true',
|
|
13
|
+
default=False,
|
|
14
|
+
help="Start Umami (its first start runs the database's migrations), wait for it and replace its default admin password.")
|
|
15
|
+
parser.add_argument('-l', '--launch',
|
|
16
|
+
action='store_true',
|
|
17
|
+
default=False,
|
|
18
|
+
help='Open its address in a browser when it is ready.')
|
|
19
|
+
ARGEOF
|