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 +21 -0
- package/README.md +45 -3
- package/dist/chunk-GHDLRMQG.js +61 -0
- package/dist/chunk-GHDLRMQG.js.map +1 -0
- package/dist/chunk-HW7MHAEC.js +832 -0
- package/dist/chunk-HW7MHAEC.js.map +1 -0
- package/dist/chunk-JLOSPIJ4.js +340 -0
- package/dist/chunk-JLOSPIJ4.js.map +1 -0
- package/dist/chunk-JPNMDGZN.js +61 -0
- package/dist/chunk-JPNMDGZN.js.map +1 -0
- package/dist/chunk-R6P4MMZW.js +340 -0
- package/dist/chunk-R6P4MMZW.js.map +1 -0
- package/dist/chunk-TUINPVDZ.js +894 -0
- package/dist/chunk-TUINPVDZ.js.map +1 -0
- package/dist/chunk-VI4NPM6C.js +888 -0
- package/dist/chunk-VI4NPM6C.js.map +1 -0
- package/dist/chunk-VU7Z7EZA.js +362 -0
- package/dist/chunk-VU7Z7EZA.js.map +1 -0
- package/dist/chunk-X72ZX6VB.js +835 -0
- package/dist/chunk-X72ZX6VB.js.map +1 -0
- package/dist/chunk-XLNGAH3S.js +29 -0
- package/dist/chunk-XLNGAH3S.js.map +1 -0
- package/dist/cli.js +38 -10
- package/dist/index.d.ts +11 -0
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +4 -1
- package/dist/server.js +1 -1
- package/dist/shell/assets/{index-BD3nZNWX.js → index-BcsdXOsJ.js} +25 -25
- package/dist/shell/favicon.ico +0 -0
- package/dist/shell/index.html +2 -1
- package/dist/standalone.js +3 -3
- package/dist/webpack-loader.js +1 -1
- package/dist/webpack.js +6 -8
- package/dist/webpack.js.map +1 -1
- package/package.json +3 -1
- package/skills/annotask-apply/SKILL.md +8 -0
- package/skills/annotask-watch/SKILL.md +1 -1
|
Binary file
|
package/dist/shell/index.html
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<link rel="icon" href="/__annotask/favicon.ico" />
|
|
6
7
|
<title>Annotask</title>
|
|
7
|
-
<script type="module" crossorigin src="/__annotask/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/__annotask/assets/index-BcsdXOsJ.js"></script>
|
|
8
9
|
<link rel="stylesheet" crossorigin href="/__annotask/assets/index-DwbhEo-C.css">
|
|
9
10
|
</head>
|
|
10
11
|
<body>
|
package/dist/standalone.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startStandaloneServer
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JPNMDGZN.js";
|
|
4
|
+
import "./chunk-XLNGAH3S.js";
|
|
5
|
+
import "./chunk-JLOSPIJ4.js";
|
|
6
6
|
export {
|
|
7
7
|
startStandaloneServer
|
|
8
8
|
};
|
package/dist/webpack-loader.js
CHANGED
package/dist/webpack.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
bridgeClientScript
|
|
3
|
-
|
|
4
|
-
} from "./chunk-2TUWBFQG.js";
|
|
2
|
+
bridgeClientScript
|
|
3
|
+
} from "./chunk-X72ZX6VB.js";
|
|
5
4
|
import {
|
|
6
5
|
startStandaloneServer
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-JPNMDGZN.js";
|
|
7
|
+
import "./chunk-XLNGAH3S.js";
|
|
8
|
+
import "./chunk-JLOSPIJ4.js";
|
|
10
9
|
|
|
11
10
|
// src/webpack/plugin.ts
|
|
12
11
|
import path from "path";
|
|
@@ -49,8 +48,7 @@ var AnnotaskWebpackPlugin = class {
|
|
|
49
48
|
const hooks = htmlPluginConstructor.getHooks(compilation);
|
|
50
49
|
hooks.beforeEmit.tapAsync("AnnotaskWebpackPlugin", (data, cb) => {
|
|
51
50
|
const scripts = `
|
|
52
|
-
<script>${bridgeClientScript()}</script
|
|
53
|
-
<script type="module">${toggleButtonScript(this.serverUrl)}</script>`;
|
|
51
|
+
<script>${bridgeClientScript()}</script>`;
|
|
54
52
|
data.html = data.html.replace("</body>", scripts + "\n</body>");
|
|
55
53
|
cb(null, data);
|
|
56
54
|
});
|
package/dist/webpack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/webpack/plugin.ts"],"sourcesContent":["/**\n * Webpack plugin for Annotask.\n * Starts a standalone server, adds the SFC transform loader,\n * and injects bridge + toggle scripts into HTML.\n */\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { startStandaloneServer } from '../server/standalone.js'\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/webpack/plugin.ts"],"sourcesContent":["/**\n * Webpack plugin for Annotask.\n * Starts a standalone server, adds the SFC transform loader,\n * and injects bridge + toggle scripts into HTML.\n */\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { startStandaloneServer } from '../server/standalone.js'\nimport { bridgeClientScript } from '../plugin/bridge-client.js'\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\n\nexport interface AnnotaskWebpackOptions {\n port?: number\n}\n\nexport class AnnotaskWebpackPlugin {\n private options: AnnotaskWebpackOptions\n private serverUrl: string = ''\n\n constructor(options: AnnotaskWebpackOptions = {}) {\n this.options = options\n }\n\n apply(compiler: any) {\n // Only activate in development\n if (compiler.options.mode !== 'development') return\n\n const projectRoot = compiler.context\n const loaderPath = path.resolve(__dirname, 'webpack-loader.js')\n\n // Add the SFC transform loader (enforce: pre, before vue-loader)\n compiler.options.module.rules.unshift({\n test: /\\.(vue|svelte|[jt]sx?|ts|js)$/,\n enforce: 'pre',\n exclude: /node_modules/,\n use: [{\n loader: loaderPath,\n options: { projectRoot },\n }],\n })\n\n // Start standalone server\n let serverStarted = false\n compiler.hooks.beforeCompile.tapPromise('AnnotaskWebpackPlugin', async () => {\n if (serverStarted) return\n serverStarted = true\n try {\n const { port } = await startStandaloneServer({ projectRoot, port: this.options.port })\n this.serverUrl = `http://localhost:${port}`\n console.log(`[Annotask] Server running at ${this.serverUrl}/__annotask/`)\n } catch (err) {\n console.error('[Annotask] Failed to start server:', err)\n }\n })\n\n // Inject scripts into HTML (works with html-webpack-plugin)\n compiler.hooks.compilation.tap('AnnotaskWebpackPlugin', (compilation: any) => {\n // Find HtmlWebpackPlugin from registered plugins\n const htmlPluginConstructor = compiler.options.plugins\n ?.map((p: any) => p.constructor)\n .find((c: any) => c && typeof c.getHooks === 'function')\n\n if (!htmlPluginConstructor) return\n\n const hooks = htmlPluginConstructor.getHooks(compilation)\n hooks.beforeEmit.tapAsync('AnnotaskWebpackPlugin', (data: any, cb: any) => {\n const scripts = `\\n<script>${bridgeClientScript()}</script>`\n data.html = data.html.replace('</body>', scripts + '\\n</body>')\n cb(null, data)\n })\n })\n }\n}\n"],"mappings":";;;;;;;;;;AAKA,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAI9B,IAAM,YAAY,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AAMtD,IAAM,wBAAN,MAA4B;AAAA,EACzB;AAAA,EACA,YAAoB;AAAA,EAE5B,YAAY,UAAkC,CAAC,GAAG;AAChD,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAM,UAAe;AAEnB,QAAI,SAAS,QAAQ,SAAS,cAAe;AAE7C,UAAM,cAAc,SAAS;AAC7B,UAAM,aAAa,KAAK,QAAQ,WAAW,mBAAmB;AAG9D,aAAS,QAAQ,OAAO,MAAM,QAAQ;AAAA,MACpC,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,MACT,KAAK,CAAC;AAAA,QACJ,QAAQ;AAAA,QACR,SAAS,EAAE,YAAY;AAAA,MACzB,CAAC;AAAA,IACH,CAAC;AAGD,QAAI,gBAAgB;AACpB,aAAS,MAAM,cAAc,WAAW,yBAAyB,YAAY;AAC3E,UAAI,cAAe;AACnB,sBAAgB;AAChB,UAAI;AACF,cAAM,EAAE,KAAK,IAAI,MAAM,sBAAsB,EAAE,aAAa,MAAM,KAAK,QAAQ,KAAK,CAAC;AACrF,aAAK,YAAY,oBAAoB,IAAI;AACzC,gBAAQ,IAAI,gCAAgC,KAAK,SAAS,cAAc;AAAA,MAC1E,SAAS,KAAK;AACZ,gBAAQ,MAAM,sCAAsC,GAAG;AAAA,MACzD;AAAA,IACF,CAAC;AAGD,aAAS,MAAM,YAAY,IAAI,yBAAyB,CAAC,gBAAqB;AAE5E,YAAM,wBAAwB,SAAS,QAAQ,SAC3C,IAAI,CAAC,MAAW,EAAE,WAAW,EAC9B,KAAK,CAAC,MAAW,KAAK,OAAO,EAAE,aAAa,UAAU;AAEzD,UAAI,CAAC,sBAAuB;AAE5B,YAAM,QAAQ,sBAAsB,SAAS,WAAW;AACxD,YAAM,WAAW,SAAS,yBAAyB,CAAC,MAAW,OAAY;AACzE,cAAM,UAAU;AAAA,UAAa,mBAAmB,CAAC;AACjD,aAAK,OAAO,KAAK,KAAK,QAAQ,WAAW,UAAU,WAAW;AAC9D,WAAG,MAAM,IAAI;AAAA,MACf,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "annotask",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"module": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"dev:html-vite": "pnpm --filter @annotask/playground-html-vite dev",
|
|
38
39
|
"dev:astro": "pnpm --filter @annotask/playground-astro dev",
|
|
39
40
|
"dev:htmx-vite": "pnpm --filter @annotask/playground-htmx-vite dev",
|
|
41
|
+
"dev:mfe-vite": "pnpm --filter @annotask/playground-mfe-vite dev",
|
|
40
42
|
"test": "vitest run",
|
|
41
43
|
"test:watch": "vitest",
|
|
42
44
|
"test:e2e": "playwright test"
|
|
@@ -26,6 +26,8 @@ cat .annotask/server.json
|
|
|
26
26
|
|
|
27
27
|
This returns `{ "url": "http://localhost:PORT", "port": PORT }`. Use the `url` value as `BASE_URL` for all API calls below.
|
|
28
28
|
|
|
29
|
+
If the file contains a `"mfe"` field (e.g. `"mfe": "@myorg/my-mfe"`), this project is a **micro-frontend** and the server is running on a remote root shell. Save the `mfe` value as `MFE_FILTER` — you will use it to filter tasks in step 1.
|
|
30
|
+
|
|
29
31
|
If the file does not exist, probe for a running server:
|
|
30
32
|
|
|
31
33
|
```bash
|
|
@@ -37,8 +39,14 @@ Use whichever responds with `{"status":"ok"}`. **IMPORTANT: Do NOT read server.j
|
|
|
37
39
|
|
|
38
40
|
### 1. Fetch pending tasks
|
|
39
41
|
|
|
42
|
+
If `MFE_FILTER` is set (from step 0), append it as a query parameter to filter tasks for this project:
|
|
43
|
+
|
|
40
44
|
```bash
|
|
45
|
+
# Without MFE filter (standard single-project setup):
|
|
41
46
|
curl -s $BASE_URL/__annotask/api/tasks
|
|
47
|
+
|
|
48
|
+
# With MFE filter (micro-frontend setup):
|
|
49
|
+
curl -s $BASE_URL/__annotask/api/tasks?mfe=$MFE_FILTER
|
|
42
50
|
```
|
|
43
51
|
|
|
44
52
|
Response:
|
|
@@ -20,7 +20,7 @@ Connect to the Annotask WebSocket and stream changes as the user makes them visu
|
|
|
20
20
|
```bash
|
|
21
21
|
cat .annotask/server.json
|
|
22
22
|
```
|
|
23
|
-
Use the `
|
|
23
|
+
Use the `url` value as the server URL. If the file contains a `"mfe"` field, this is a micro-frontend setup — the server is running on a remote root shell. Save the `mfe` value for filtering. If not found, probe `curl -s http://localhost:24678/__annotask/api/status` then `curl -s http://localhost:5173/__annotask/api/status`. **Do NOT read server.json from parent or sibling directories.**
|
|
24
24
|
|
|
25
25
|
1. **Start watching** by running in the background:
|
|
26
26
|
```bash
|