annotask 0.0.0 → 0.0.2

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kurt Stohrer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # Annotask
1
+ <p align="center">
2
+ <img src="annotask-logo.png" alt="Annotask" width="120" />
3
+ </p>
4
+
5
+ <h1 align="center">Annotask</h1>
2
6
 
3
7
  Visual markup tool for web apps. Annotate your UI in the browser — pins, arrows, drawn sections, notes — and Annotask generates structured tasks that AI coding agents apply to your source code. Supports Vue, React, Svelte, Astro, and plain HTML/htmx with Vite and Webpack.
4
8
 
@@ -100,6 +104,42 @@ import { AnnotaskWebpackPlugin } from 'annotask/webpack'
100
104
  plugins: [new AnnotaskWebpackPlugin()]
101
105
  ```
102
106
 
107
+ ### Micro-frontends (single-spa, Module Federation, etc.)
108
+
109
+ For MFE architectures where multiple apps load into a single root shell:
110
+
111
+ **MFE child** (Vite) — adds `data-annotask-mfe` attribute to all elements:
112
+
113
+ ```ts
114
+ import { annotask } from 'annotask'
115
+
116
+ export default defineConfig({
117
+ plugins: [
118
+ vue(),
119
+ annotask({
120
+ mfe: '@myorg/my-mfe', // MFE identity tag
121
+ server: 'http://localhost:24678', // Root's annotask server URL
122
+ }),
123
+ ],
124
+ })
125
+ ```
126
+
127
+ **Root shell** (Webpack) — runs the annotask server, bridge, and shell UI:
128
+
129
+ ```ts
130
+ import { AnnotaskWebpackPlugin } from 'annotask/webpack'
131
+
132
+ plugins: [new AnnotaskWebpackPlugin({ port: 24678 })]
133
+ ```
134
+
135
+ When `server` is set, the MFE's local annotask server is skipped — the root handles it. When only `mfe` is set (no `server`), annotask runs normally for standalone development.
136
+
137
+ Tasks created from MFE elements carry the `mfe` field. Filter them with `GET /__annotask/api/tasks?mfe=@myorg/my-mfe` or use the CLI:
138
+
139
+ ```bash
140
+ annotask report --mfe=@myorg/my-mfe
141
+ ```
142
+
103
143
  Start your dev server, then open:
104
144
  - **App**: `http://localhost:5173/` (Vite) or `http://localhost:8090/` (Webpack)
105
145
  - **Annotask**: `http://localhost:5173/__annotask/`
@@ -134,10 +174,12 @@ annotask status # Check connection
134
174
  annotask init-skills # Install agent skills into your project
135
175
  ```
136
176
 
177
+ Options: `--port=N`, `--host=H`, `--server=URL` (override server.json), `--mfe=NAME` (filter by MFE).
178
+
137
179
  ## API
138
180
 
139
181
  - `GET /__annotask/api/report` — Current change report
140
- - `GET /__annotask/api/tasks` — Task list
182
+ - `GET /__annotask/api/tasks` — Task list (supports `?mfe=NAME` filter)
141
183
  - `POST /__annotask/api/tasks` — Create a task
142
184
  - `PATCH /__annotask/api/tasks/:id` — Update task status
143
185
  - `GET /__annotask/api/status` — Health check
@@ -180,7 +222,7 @@ pnpm test:e2e # Run E2E tests (all frameworks)
180
222
  - `src/schema.ts` — TypeScript types for change reports
181
223
  - `src/cli/` — CLI tool for terminal interaction
182
224
  - `skills/` — Agent skill definitions (shipped with the npm package)
183
- - `playgrounds/` — Test apps (vue-vite, vue-webpack, react-vite, svelte-vite, html-vite, astro, htmx-vite)
225
+ - `playgrounds/` — Test apps (vue-vite, vue-webpack, react-vite, svelte-vite, html-vite, astro, htmx-vite, mfe-vite)
184
226
 
185
227
  ## Troubleshooting
186
228
 
@@ -0,0 +1,61 @@
1
+ import {
2
+ removeServerInfo,
3
+ writeServerInfo
4
+ } from "./chunk-XLNGAH3S.js";
5
+ import {
6
+ createAnnotaskServer
7
+ } from "./chunk-R6P4MMZW.js";
8
+
9
+ // src/server/standalone.ts
10
+ import http from "http";
11
+ async function startStandaloneServer(options) {
12
+ const port = options.port || 24678;
13
+ const uiServer = createAnnotaskServer({ projectRoot: options.projectRoot });
14
+ const httpServer = http.createServer((req, res) => {
15
+ uiServer.middleware(req, res, () => {
16
+ res.statusCode = 404;
17
+ res.end("Not found");
18
+ });
19
+ });
20
+ httpServer.on("upgrade", (req, socket, head) => {
21
+ if (req.url === "/__annotask/ws") {
22
+ uiServer.handleUpgrade(req, socket, head);
23
+ }
24
+ });
25
+ return new Promise((resolve, reject) => {
26
+ httpServer.on("error", (err) => {
27
+ if (err.code === "EADDRINUSE") {
28
+ httpServer.listen(0, () => {
29
+ const addr = httpServer.address();
30
+ writeServerInfo(options.projectRoot, addr.port);
31
+ resolve({
32
+ port: addr.port,
33
+ close: () => {
34
+ removeServerInfo(options.projectRoot);
35
+ uiServer.dispose();
36
+ httpServer.close();
37
+ }
38
+ });
39
+ });
40
+ } else {
41
+ reject(err);
42
+ }
43
+ });
44
+ httpServer.listen(port, () => {
45
+ writeServerInfo(options.projectRoot, port);
46
+ resolve({
47
+ port,
48
+ close: () => {
49
+ removeServerInfo(options.projectRoot);
50
+ uiServer.dispose();
51
+ httpServer.close();
52
+ }
53
+ });
54
+ });
55
+ });
56
+ }
57
+
58
+ export {
59
+ startStandaloneServer
60
+ };
61
+ //# sourceMappingURL=chunk-GHDLRMQG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/server/standalone.ts"],"sourcesContent":["import http from 'node:http'\nimport { createAnnotaskServer } from './index.js'\nimport { writeServerInfo, removeServerInfo } from './discovery.js'\n\nexport interface StandaloneServerOptions {\n projectRoot: string\n port?: number\n}\n\nexport async function startStandaloneServer(options: StandaloneServerOptions): Promise<{\n port: number\n close: () => void\n}> {\n const port = options.port || 24678\n const uiServer = createAnnotaskServer({ projectRoot: options.projectRoot })\n\n const httpServer = http.createServer((req, res) => {\n uiServer.middleware(req, res, () => {\n res.statusCode = 404\n res.end('Not found')\n })\n })\n\n httpServer.on('upgrade', (req, socket, head) => {\n if (req.url === '/__annotask/ws') {\n uiServer.handleUpgrade(req, socket, head)\n }\n })\n\n return new Promise((resolve, reject) => {\n httpServer.on('error', (err: NodeJS.ErrnoException) => {\n if (err.code === 'EADDRINUSE') {\n httpServer.listen(0, () => {\n const addr = httpServer.address() as { port: number }\n writeServerInfo(options.projectRoot, addr.port)\n resolve({\n port: addr.port,\n close: () => { removeServerInfo(options.projectRoot); uiServer.dispose(); httpServer.close() },\n })\n })\n } else {\n reject(err)\n }\n })\n\n httpServer.listen(port, () => {\n writeServerInfo(options.projectRoot, port)\n resolve({\n port,\n close: () => { removeServerInfo(options.projectRoot); uiServer.dispose(); httpServer.close() },\n })\n })\n })\n}\n"],"mappings":";;;;;;;;;AAAA,OAAO,UAAU;AASjB,eAAsB,sBAAsB,SAGzC;AACD,QAAM,OAAO,QAAQ,QAAQ;AAC7B,QAAM,WAAW,qBAAqB,EAAE,aAAa,QAAQ,YAAY,CAAC;AAE1E,QAAM,aAAa,KAAK,aAAa,CAAC,KAAK,QAAQ;AACjD,aAAS,WAAW,KAAK,KAAK,MAAM;AAClC,UAAI,aAAa;AACjB,UAAI,IAAI,WAAW;AAAA,IACrB,CAAC;AAAA,EACH,CAAC;AAED,aAAW,GA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