chamba 0.8.0 → 0.9.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 +7 -1
- package/dist/lib/chamba-yaml.js +4 -4
- package/package.json +1 -1
- package/templates/Dockerfile +3 -3
- package/templates/context/baseline.md +2 -2
- package/templates/context/web-pane-craft.md +1 -1
- package/templates/pane-apps/client/assets/api-BBDf_rzz.js +12 -0
- package/templates/pane-apps/client/assets/api-DNLbSBpK.css +1 -0
- package/templates/pane-apps/client/assets/bee-B7t97l5B.webp +0 -0
- package/templates/pane-apps/client/assets/buzz-CUUsbnXH.mp3 +0 -0
- package/templates/pane-apps/client/assets/files-BkmyervY.js +1 -0
- package/templates/pane-apps/client/assets/home-3SeGzySM.css +1 -0
- package/templates/pane-apps/client/assets/home-Cu9xOd2i.js +1 -0
- package/templates/pane-apps/client/assets/pop-D5ZANBC3.mp3 +0 -0
- package/templates/pane-apps/client/assets/reviews-DMrGB-kG.js +153 -0
- package/templates/pane-apps/client/assets/reviews-nK_yRav9.css +1 -0
- package/templates/pane-apps/client/assets/specs-Cabb15F0.js +13 -0
- package/templates/pane-apps/client/assets/useNow-BHFKFraS.js +1 -0
- package/templates/pane-apps/client/home/index.html +16 -0
- package/templates/pane-apps/client/reviews/index.html +6 -4
- package/templates/pane-apps/client/specs/index.html +4 -3
- package/templates/pane-apps/server/home.mjs +12 -0
- package/templates/pane-apps/server/reviews.mjs +19 -18
- package/templates/pane-apps/server/specs.mjs +4 -4
- package/templates/skills/dx-review/SKILL.md +16 -3
- package/templates/skills/dx-review/references/acts.md +86 -15
- package/templates/skills/dx-spec/SKILL.md +7 -3
- package/templates/skills/dx-spec/references/review-guide.md +2 -2
- package/templates/skills/dx-spec/references/spec-guide.md +1 -1
- package/templates/skills/dx-spec/references/stages.md +6 -2
- package/templates/skills/dx-spec-execute/SKILL.md +73 -7
- package/templates/startup.mjs +13 -13
- package/templates/tool-helper.sh +4 -2
- package/templates/webterm/README.md +34 -13
- package/templates/webterm/config.js +20 -0
- package/templates/webterm/public/app/alerts.js +92 -11
- package/templates/webterm/public/app/composer.js +37 -3
- package/templates/webterm/public/app/connection.js +14 -0
- package/templates/webterm/public/app/dom.js +1 -0
- package/templates/webterm/public/app/frames.js +1 -1
- package/templates/webterm/public/app/home-host.js +16 -0
- package/templates/webterm/public/app/main.js +4 -2
- package/templates/webterm/public/app/pane-shape.js +5 -3
- package/templates/webterm/public/app/pane-shell.js +45 -5
- package/templates/webterm/public/app/pane.js +8 -2
- package/templates/webterm/public/app/reviews-host.js +5 -1
- package/templates/webterm/public/app/tool-host.js +19 -3
- package/templates/webterm/public/app/workspace-color.js +1 -1
- package/templates/webterm/public/index.html +5 -1
- package/templates/webterm/public/styles.css +52 -0
- package/templates/webterm/tool-document.js +3 -2
- package/templates/webterm/tools/home.js +58 -0
- package/templates/webterm/tools/index.js +5 -4
- package/templates/webterm/tools/reviews.js +7 -3
- package/templates/pane-apps/client/assets/files-D0nJgFAA.js +0 -12
- package/templates/pane-apps/client/assets/files-h0K1vZyQ.css +0 -1
- package/templates/pane-apps/client/assets/reviews-BsoGZ35r.css +0 -1
- package/templates/pane-apps/client/assets/reviews-iW0Mbn4e.js +0 -153
- package/templates/pane-apps/client/assets/specs-D9z3neR-.js +0 -13
|
@@ -46,8 +46,8 @@ export function withNonce(html, nonce) {
|
|
|
46
46
|
*
|
|
47
47
|
* `default-src 'none'` is the floor, so anything not named below is refused. What runs is named by the nonce
|
|
48
48
|
* alone. What is fetched is named by `origin` - the scheme and host the document was loaded from - because
|
|
49
|
-
* the client's own assets, the tool's data routes and the jailed workspace files
|
|
50
|
-
* and an opaque origin has no `'self'` to say that with. `base-uri` and `form-action` are named on their own,
|
|
49
|
+
* the client's own assets, its images and its clips, the tool's data routes and the jailed workspace files
|
|
50
|
+
* are all served from here, and an opaque origin has no `'self'` to say that with. `base-uri` and `form-action` are named on their own,
|
|
51
51
|
* since neither one falls back to `default-src`.
|
|
52
52
|
*/
|
|
53
53
|
export function documentPolicy(nonce, origin) {
|
|
@@ -56,6 +56,7 @@ export function documentPolicy(nonce, origin) {
|
|
|
56
56
|
`script-src 'nonce-${nonce}'`,
|
|
57
57
|
`style-src-elem 'nonce-${nonce}'`,
|
|
58
58
|
`img-src ${origin}`,
|
|
59
|
+
`media-src ${origin}`,
|
|
59
60
|
`connect-src ${origin}`,
|
|
60
61
|
`frame-src ${origin}`,
|
|
61
62
|
"base-uri 'none'",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// =========================================================================================================================================
|
|
2
|
+
// tools/home.js - What the Home tool is, as one table.
|
|
3
|
+
//
|
|
4
|
+
// The smallest table of the three, and the shape of a tool that only reads. There are no verbs, because Home has no helper and nothing
|
|
5
|
+
// to say to an agent; no events, because it delivers nothing into a session; and no raw side, because it serves no file of the
|
|
6
|
+
// workspace at all. What is left is three reads of the repository the workspace holds.
|
|
7
|
+
//
|
|
8
|
+
// The module is handed two directories rather than one: the workspace, which is the repository it draws, and the state directory
|
|
9
|
+
// outside it, which is where its cache goes. The cache is derived from the repository and is nobody's record, so a file of it in the
|
|
10
|
+
// workspace would show up in the `git status` of every repository Home opens. The module refuses a cache directory inside the
|
|
11
|
+
// workspace, so the two can never be the same place.
|
|
12
|
+
// =========================================================================================================================================
|
|
13
|
+
|
|
14
|
+
import { createHomeModule, refuseRaw, statusFor } from "../../pane-apps/server/home.mjs";
|
|
15
|
+
import { HOME_CACHE_DIR, HOME_KEY, HOME_RAW_TOKEN, MAX_HOME_BYTES, WORKSPACE, WORKSPACE_ROOT } from "../config.js";
|
|
16
|
+
|
|
17
|
+
// The module maker, re-exported so the path to the built dist is written once, as it is for every tool.
|
|
18
|
+
export { createHomeModule };
|
|
19
|
+
|
|
20
|
+
export const HOME_TABLE = {
|
|
21
|
+
id: "home",
|
|
22
|
+
/** What a refusal calls the tool. The word on the tab is the client's own, in `tool-host.js`. */
|
|
23
|
+
label: "Home",
|
|
24
|
+
key: HOME_KEY,
|
|
25
|
+
rawToken: HOME_RAW_TOKEN,
|
|
26
|
+
statusFor,
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The repository this draws, the directory outside it that the cache goes in, and the name to call it.
|
|
30
|
+
*
|
|
31
|
+
* The name is chamba's own for this workspace, which is what the bar wears, so the header row of the page and the corner of the
|
|
32
|
+
* window say the same word. Without it the header would show the mount point, which is "workspace" in every container there is.
|
|
33
|
+
*/
|
|
34
|
+
create: () => createHomeModule({ root: WORKSPACE_ROOT, cacheDir: HOME_CACHE_DIR, name: WORKSPACE }),
|
|
35
|
+
|
|
36
|
+
/** Home delivers nothing into a session, so there is no sentence for one to arrive as. */
|
|
37
|
+
events: {},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* How much a request may carry. Every route is a GET with no body, so nothing reaches this; it is here because the door that
|
|
41
|
+
* gates a body reads it for every tool, and a tool with no number is a tool with no gate.
|
|
42
|
+
*/
|
|
43
|
+
limits: { bytes: MAX_HOME_BYTES },
|
|
44
|
+
|
|
45
|
+
/** Home serves no workspace bytes at all, so every path is refused rather than resolved. */
|
|
46
|
+
raw: (_module, path) => refuseRaw(path),
|
|
47
|
+
|
|
48
|
+
// The three reads, each one a section of the page. Three and not one: each costs what its own question costs, and the page draws
|
|
49
|
+
// each section the moment that section's answer lands.
|
|
50
|
+
routes: (module) => ({
|
|
51
|
+
history: { GET: () => module.history() },
|
|
52
|
+
branches: { GET: () => module.branches() },
|
|
53
|
+
tree: { GET: () => module.tree() },
|
|
54
|
+
}),
|
|
55
|
+
|
|
56
|
+
/** No verbs. The helper door is registered for every tool and answers 400 for every name it is given. */
|
|
57
|
+
verbs: () => ({}),
|
|
58
|
+
};
|
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
// types and how much of the typing channel one session gets. server.js reads the list and never a tool's name, so a third tool is
|
|
6
6
|
// a row here and a table beside it.
|
|
7
7
|
//
|
|
8
|
-
// The order is the order the tabs are drawn in, which is the pane's own list in `public/app/pane-shell.js
|
|
9
|
-
//
|
|
10
|
-
// browser and this file is read in the server.
|
|
8
|
+
// The order is the order the tabs are drawn in, which is the pane's own list in `public/app/pane-shell.js`, less Pages: the
|
|
9
|
+
// interface draws that one itself and it has no table here. The two lists are checked against each other by the interface's tests
|
|
10
|
+
// rather than derived from one another, because the pane is drawn in the browser and this file is read in the server.
|
|
11
11
|
// =========================================================================================================================================
|
|
12
12
|
|
|
13
|
+
import { HOME_TABLE } from "./home.js";
|
|
13
14
|
import { REVIEWS_TABLE } from "./reviews.js";
|
|
14
15
|
import { SPECS_TABLE } from "./specs.js";
|
|
15
16
|
|
|
16
|
-
export const TOOLS = [SPECS_TABLE, REVIEWS_TABLE];
|
|
17
|
+
export const TOOLS = [HOME_TABLE, SPECS_TABLE, REVIEWS_TABLE];
|
|
17
18
|
|
|
18
19
|
/** The table of one tool, or undefined. Asked with `find`, so a name that is not a tool's is not one. */
|
|
19
20
|
export function toolTable(id) {
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
// The same shape as the Specs table beside it, and the differences are the tool's own. A review is a directory with a slug, so its
|
|
5
5
|
// routes name their subject in the path rather than in a query, and the acts of the screen are one route with the act as a segment.
|
|
6
6
|
// Its raw files are two named locations rather than any workspace file, so a browser reaches a stored blob and a signature and
|
|
7
|
-
// nothing else. And it is the
|
|
8
|
-
// well as its own root: every git call it makes runs with the repository as its working directory.
|
|
7
|
+
// nothing else. And it is one of the two modules in this container that run a child process, Home being the other, which is why it
|
|
8
|
+
// is handed the workspace as well as its own root: every git call it makes runs with the repository as its working directory. The
|
|
9
|
+
// runner itself is shared, in the pane-apps server library, and this module hands it a closed table of read-only operations of its own.
|
|
9
10
|
//
|
|
10
11
|
// The framed sentences are the three acts that keep the review with the reviewer. Sending feedback, syncing and filing a review all
|
|
11
12
|
// hand it over, and each of those types the review's command instead: the act starts the agent, and the skill reads the review's
|
|
@@ -111,7 +112,7 @@ export const REVIEWS_TABLE = {
|
|
|
111
112
|
"review/:slug/blob": {
|
|
112
113
|
GET: ({ params, query }) => module.blobLines(params.slug, field(query.name), count(query.from), count(query.count)),
|
|
113
114
|
},
|
|
114
|
-
// One route for every act of
|
|
115
|
+
// One route for every act of a review. The module holds the list of them and refuses a name that is not one, so what
|
|
115
116
|
// an act is stays in one place rather than being a row here as well.
|
|
116
117
|
"review/:slug/:act": { POST: ({ params, body }) => module.act(params.slug, params.act, body) },
|
|
117
118
|
}),
|
|
@@ -125,6 +126,9 @@ export const REVIEWS_TABLE = {
|
|
|
125
126
|
// A review filed from the terminal, which the tab shows with a note saying so.
|
|
126
127
|
start: (_entry, payload) => module.start(payload, "terminal"),
|
|
127
128
|
metadata: (entry, payload) => module.metadata(entry, payload),
|
|
129
|
+
// One group at a time, which several workers may post at once without treading on one another.
|
|
130
|
+
group: (entry, payload) => module.group(entry, payload),
|
|
131
|
+
ungroup: (entry, payload) => module.ungroup(entry, payload),
|
|
128
132
|
reply: (entry, payload) => module.reply(entry, payload),
|
|
129
133
|
activity: (entry, payload) => module.activity(entry, payload),
|
|
130
134
|
done: (entry) => module.done(entry),
|