acrylblends 1.2.0 → 1.3.1

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.
Files changed (52) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.js +44 -10
  3. package/dist/index.js.map +1 -1
  4. package/docs/framework/guides/create-acrylblends.md +4 -2
  5. package/docs/framework/workshop/README.md +4 -2
  6. package/docs/framework/workshop/facilitator.md +1 -1
  7. package/lib/cordis/door.d.ts +54 -2
  8. package/lib/cordis/door.js +131 -4
  9. package/package.json +1 -1
  10. package/plugins/acryl-door/plugin.json +3 -0
  11. package/plugins/acryl-door/src/cli/acryl.ts +63 -6
  12. package/plugins/acryl-door/src/host/door.ts +91 -5
  13. package/plugins/acryl-door/src/host/operator-routes.ts +21 -1
  14. package/plugins/acryl-door/src/host/verbs.ts +11 -1
  15. package/plugins/acryl-door/src/index.ts +2 -1
  16. package/plugins/builder/index.ts +13 -35
  17. package/plugins/builder/plugin.json +4 -2
  18. package/plugins/extensions/index.ts +78 -19
  19. package/plugins/extensions/plugin-store.ts +27 -0
  20. package/plugins/extensions/plugin.json +1 -1
  21. package/plugins/extensions/routes.ts +92 -0
  22. package/plugins/extensions/stage.ts +15 -5
  23. package/plugins/home/index.ts +3 -1
  24. package/plugins/manifest/plugin.json +1 -1
  25. package/plugins/plugin-share/README.md +66 -0
  26. package/plugins/plugin-share/index.ts +581 -0
  27. package/plugins/plugin-share/package.ts +186 -0
  28. package/plugins/plugin-share/plugin.json +15 -0
  29. package/plugins/plugin-share/publish.ts +65 -0
  30. package/plugins/plugin-share/pull-check.ts +129 -0
  31. package/plugins/plugin-share/pulled-records.ts +70 -0
  32. package/templates/agent/.gitattributes +2 -0
  33. package/templates/agent/blend.yaml +2 -0
  34. package/templates/agent/src/app.ts +6 -0
  35. package/templates/agent/template.json +1 -0
  36. package/templates/blank/.gitattributes +2 -0
  37. package/templates/blank/blend.yaml +3 -0
  38. package/templates/blank/src/app.ts +8 -0
  39. package/templates/blank/template.json +1 -0
  40. package/templates/chat/.gitattributes +2 -0
  41. package/templates/chat/blend.yaml +3 -0
  42. package/templates/chat/src/app.ts +8 -0
  43. package/templates/chat/template.json +1 -0
  44. package/templates/nodejs/.gitattributes +2 -0
  45. package/templates/nodejs/blend.yaml +3 -0
  46. package/templates/nodejs/src/app.ts +8 -0
  47. package/templates/nodejs/template.json +1 -0
  48. package/templates/notes/.gitattributes +2 -0
  49. package/templates/notes/blend.yaml +3 -0
  50. package/templates/notes/src/app.ts +8 -0
  51. package/templates/notes/template.json +1 -0
  52. package/templates/todo/.gitattributes +2 -0
@@ -14,6 +14,7 @@ import {
14
14
  loadManifest,
15
15
  type ParameterValue,
16
16
  } from '../plugins/manifest/index.ts'
17
+ import { pluginShare } from '../plugins/plugin-share/index.ts'
17
18
  import { doorEnabled } from './door.ts'
18
19
  import { FRAME_MOUNT_PREFIX, routes } from './routes.ts'
19
20
 
@@ -23,6 +24,7 @@ export const registry = {
23
24
  'acryl-node-server': nodeServer,
24
25
  'acryl-door': door,
25
26
  extensions,
27
+ 'plugin-share': pluginShare,
26
28
  routes,
27
29
  }
28
30
 
@@ -104,6 +106,8 @@ export async function composeInto(
104
106
  const leaveOut = new Set<string>(options.host === true ? HOST_ROWS : [])
105
107
  if (!own) leaveOut.add('acryl-node-server').add('acryl-door')
106
108
  if (!doorEnabled()) leaveOut.add('acryl-door')
109
+ // A pull runs a stranger's code and a publish leaves the machine: development only, like the door.
110
+ if (process.env.NODE_ENV === 'production') leaveOut.add('plugin-share')
107
111
  const manifest = without(read, ...leaveOut)
108
112
  // The rows that name one of the app's own plugin folders (a feature: plugins/<name>/ and its row) rather than a registry import. Each one that runs
109
113
  // is imported here; all of them, off or on, belong to their row, so the extensions row never starts them a second time.
@@ -127,7 +131,11 @@ export async function composeInto(
127
131
  ...(process.env.NODE_ENV === 'production' ? { readOnly: true } : {}),
128
132
  sources: [{ dir: PLUGINS_DIR, trust: 'install' }],
129
133
  rows: ownRows,
134
+ // Messages name a route as the plugin wrote it, not under the frame's canvas prefix.
135
+ ...(prefix === undefined ? {} : { routePrefix: prefix }),
130
136
  },
137
+ // Pulled plugins go where the extensions row installs from.
138
+ 'plugin-share': { dir: PLUGINS_DIR },
131
139
  // Only the app's own server listens; the frame host owns the server and its port.
132
140
  ...(own ? { server: { port: chosen.port.start, scan: chosen.port.scan ? 20 : 0 } } : {}),
133
141
  },
@@ -6,6 +6,7 @@
6
6
  "manifest",
7
7
  "save",
8
8
  "extensions",
9
+ "plugin-share",
9
10
  "acryl-door",
10
11
  "acryl-web-server",
11
12
  "acryl-page"
@@ -0,0 +1,2 @@
1
+ # Every checkout has the same line endings, on every OS. A plugin's digest counts every byte, so a CRLF checkout would make it a different plugin.
2
+ * text=auto eol=lf
@@ -24,6 +24,9 @@ spec:
24
24
  # Read-only when NODE_ENV=production.
25
25
  - id: extensions
26
26
  name: extensions
27
+ # Sharing: `npm run acryl -- plugin pull github:<owner>/<repo>@<version>` installs a plugin someone released (development only).
28
+ - id: plugin-share
29
+ name: plugin-share
27
30
  - id: server
28
31
  name: acryl-node-server
29
32
  config:
@@ -15,6 +15,7 @@ import {
15
15
  loadManifest,
16
16
  type ParameterValue,
17
17
  } from '../plugins/manifest/index.ts'
18
+ import { pluginShare } from '../plugins/plugin-share/index.ts'
18
19
  import { doorEnabled } from './door.ts'
19
20
  import { FRAME_MOUNT_PREFIX, routes } from './routes.ts'
20
21
 
@@ -25,6 +26,7 @@ export const registry = {
25
26
  'acryl-node-server': nodeServer,
26
27
  'acryl-door': door,
27
28
  extensions,
29
+ 'plugin-share': pluginShare,
28
30
  routes,
29
31
  }
30
32
 
@@ -106,6 +108,8 @@ export async function composeInto(
106
108
  const leaveOut = new Set<string>(options.host === true ? HOST_ROWS : [])
107
109
  if (!own) leaveOut.add('acryl-node-server').add('acryl-door')
108
110
  if (!doorEnabled()) leaveOut.add('acryl-door')
111
+ // A pull runs a stranger's code and a publish leaves the machine: development only, like the door.
112
+ if (process.env.NODE_ENV === 'production') leaveOut.add('plugin-share')
109
113
  const manifest = without(read, ...leaveOut)
110
114
  // The rows that name one of the app's own plugin folders (a feature: plugins/<name>/ and its row) rather than a registry import. Each one that runs
111
115
  // is imported here; all of them, off or on, belong to their row, so the extensions row never starts them a second time.
@@ -134,7 +138,11 @@ export async function composeInto(
134
138
  ...(process.env.NODE_ENV === 'production' ? { readOnly: true } : {}),
135
139
  sources: [{ dir: PLUGINS_DIR, trust: 'install' }],
136
140
  rows: ownRows,
141
+ // Messages name a route as the plugin wrote it, not under the frame's canvas prefix.
142
+ ...(prefix === undefined ? {} : { routePrefix: prefix }),
137
143
  },
144
+ // Pulled plugins go where the extensions row installs from.
145
+ 'plugin-share': { dir: PLUGINS_DIR },
138
146
  // Only the app's own server listens; the frame host owns the server and its port.
139
147
  ...(own ? { server: { port: chosen.port.start, scan: chosen.port.scan ? 20 : 0 } } : {}),
140
148
  },
@@ -7,6 +7,7 @@
7
7
  "manifest",
8
8
  "save",
9
9
  "extensions",
10
+ "plugin-share",
10
11
  "acryl-door",
11
12
  "acryl-web-server",
12
13
  "acryl-page"
@@ -0,0 +1,2 @@
1
+ # Every checkout has the same line endings, on every OS. A plugin's digest counts every byte, so a CRLF checkout would make it a different plugin.
2
+ * text=auto eol=lf