@acryldev/blends 1.7.8 → 1.7.10

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/dist/index.js CHANGED
@@ -95,7 +95,7 @@ var packages = {
95
95
  "path": "../plugins/versions"
96
96
  },
97
97
  "@acryldev/blends-frame": {
98
- "version": "0.2.5",
98
+ "version": "0.2.8",
99
99
  "path": "../plugins/blends-frame"
100
100
  }
101
101
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/blends",
3
- "version": "1.7.8",
3
+ "version": "1.7.10",
4
4
  "description": "The Acryl web framework (import { Acryl } from \"acrylblends\") and the acrylblends command that scaffolds Cordis apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -7,7 +7,7 @@
7
7
  "dependencies": {
8
8
  "@deepseek-ai/cordis": "4.0.4",
9
9
  "@acryldev/blends-core": "0.6.0",
10
- "@acryldev/plugin-hub-core": "0.2.2"
10
+ "@acryldev/plugin-hub-core": "0.2.3"
11
11
  },
12
12
  "mount": "mount it after agent and extensions: root.plugin(builder, { dir: join(root, 'plugins') }); dir must be an extensions source",
13
13
  "entries": {
@@ -61,3 +61,11 @@ export function appendHostLog(dir: string, text: string, now: Date = new Date())
61
61
  export function hostCrashed(output: string): boolean {
62
62
  return /Failed running '/u.test(output)
63
63
  }
64
+
65
+ /**
66
+ * Whether the watcher ended or restarted the host (a saved file, or the product copying its new source in on the first start after an update): the
67
+ * host that comes back is a new process with a new process token, so a page signed in to the old one gets 401 and 404 until it loads again.
68
+ */
69
+ export function hostRestarting(output: string): boolean {
70
+ return /Completed running '|Restarting '/u.test(output)
71
+ }
@@ -29,6 +29,7 @@ import {
29
29
  import {
30
30
  type FrameHost,
31
31
  type HostEnd,
32
+ hostAddress,
32
33
  isFrameApp,
33
34
  navigation,
34
35
  openFrameSettings,
@@ -37,7 +38,7 @@ import {
37
38
  withoutToken,
38
39
  } from './frame.ts'
39
40
  import { productGit, withGitFirst } from './git.ts'
40
- import { appendHostLog, hostCrashed, nextRestart } from './host-supervisor.ts'
41
+ import { appendHostLog, hostCrashed, hostRestarting, nextRestart } from './host-supervisor.ts'
41
42
  import { hasSettings, settingsPlacement } from './menu.ts'
42
43
  import { openProductApp, seedSource } from './product.ts'
43
44
  import { createDesktopShutdown, installShutdownRequests } from './shutdown.ts'
@@ -178,6 +179,19 @@ if (!app.requestSingleInstanceLock()) {
178
179
  process.stdout.write(text)
179
180
  // The watcher that runs the host stays alive when the host crashes (it waits for a saved file): that line is the death.
180
181
  recent = (recent + text).slice(-3000)
182
+ // The watcher brought the host back as a new process: the windows sign in to it again, or every call they make answers 401.
183
+ if (serving && hostRestarting(text)) restarting = true
184
+ const again = restarting ? hostAddress(text) : undefined
185
+ if (again !== undefined) {
186
+ restarting = false
187
+ for (const shown of BrowserWindow.getAllWindows())
188
+ if (!shown.isDestroyed())
189
+ shown.loadURL(again).catch((cause: unknown) => {
190
+ console.warn(
191
+ `desktop: the window could not load the restarted host: ${cause instanceof Error ? cause.message : String(cause)}`,
192
+ )
193
+ })
194
+ }
181
195
  if (serving && hostCrashed(text))
182
196
  void started.stop().then(() => recover(started, crashedEnd(recent)))
183
197
  },
@@ -188,6 +202,7 @@ if (!app.requestSingleInstanceLock()) {
188
202
  host = started
189
203
  let serving = false
190
204
  let recent = ''
205
+ let restarting = false
191
206
  // Watched once it serves: a host that ends before that fails the start itself (the caller quits with the reason).
192
207
  return started.ready.then((address) => {
193
208
  serving = true
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/desktop-shell",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Run the app as a desktop app: an Electron window on the app's own server. `npm run desktop`; the app's code never imports electron.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,7 +8,7 @@
8
8
  "@deepseek-ai/cordis": "4.0.4",
9
9
  "@acryldev/app-persistence": "0.1.4",
10
10
  "@acryldev/blends-core": "0.6.0",
11
- "@acryldev/plugin-hub-core": "0.2.2",
11
+ "@acryldev/plugin-hub-core": "0.2.3",
12
12
  "yaml": "2.9.0"
13
13
  },
14
14
  "mount": "mount it after extensions, in development builds: root.plugin(pluginShare, { dir: join(root, 'plugins') }); dir must be an extensions source",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/save",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Save the app to its own git repository, and share it: a repository of its own on GitHub, created and pushed only after a person confirms the plan. Refuses a file that holds a secret, and a private app going to a public remote.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -2,14 +2,20 @@
2
2
  "name": "save",
3
3
  "description": "Save the app to its own git repository, and share it: a repository of its own on GitHub, created and pushed only after a person confirms the plan. Refuses a file that holds a secret, and a private app going to a public remote.",
4
4
  "requires": [],
5
- "inject": ["appInstance"],
5
+ "inject": [
6
+ "appInstance"
7
+ ],
6
8
  "provides": [],
7
9
  "dependencies": {
8
10
  "@deepseek-ai/cordis": "4.0.4",
9
11
  "@acryldev/app-persistence": "0.1.4"
10
12
  },
11
- "mount": "add the scripts \"save\": \"node plugins/save/cli.ts\" and \"share\": \"node plugins/save/share-cli.ts\" to package.json; mount the plugin to give the agent a save_app tool",
13
+ "mount": "mount the plugin to give the agent a save_app tool; its scripts (npm run save, npm run share) are added to package.json with it",
12
14
  "entries": {
13
15
  "": "index.ts"
16
+ },
17
+ "scripts": {
18
+ "save": "node plugins/save/cli.ts",
19
+ "share": "node plugins/save/share-cli.ts"
14
20
  }
15
21
  }
@@ -64,6 +64,20 @@ async function publishedCategories(): Promise<{ categories?: readonly CatalogCat
64
64
  }
65
65
  }
66
66
 
67
+ const HELP = `npm run share [-- options]: send this app to a GitHub repository of your own (through your gh login). The plan comes first; nothing is sent until you type yes.
68
+
69
+ --owner <account> the GitHub account or organization for a new repository (default: yours)
70
+ --visibility private|public who may see a new repository (default: blend.yaml metadata.visibility, else private); kept in blend.yaml
71
+ --list also list it in the Blends store (acrylblends.github.io and Control Center), as Community under your name; public only
72
+ --category <address> its category, one of acrylblends.github.io/blends (default: its earlier place, else its starter's category)
73
+ --subcategory <address> a subcategory of that category
74
+ --license <id> its licence when listed, an SPDX id (default MIT)
75
+ --json print the plan as JSON and send nothing
76
+ --confirm <plan> send exactly this plan (the JSON --json printed); for a surface that showed a person the plan
77
+ -h, --help this text
78
+
79
+ Example: npm run share -- --visibility public --list --category business --subcategory crm`
80
+
67
81
  async function main(argv: readonly string[]): Promise<number> {
68
82
  const appRoot = fileURLToPath(new URL('../..', import.meta.url))
69
83
  const { values } = parseArgs({
@@ -78,8 +92,13 @@ async function main(argv: readonly string[]): Promise<number> {
78
92
  category: { type: 'string' },
79
93
  subcategory: { type: 'string' },
80
94
  license: { type: 'string' },
95
+ help: { type: 'boolean', short: 'h' },
81
96
  },
82
97
  })
98
+ if (values.help === true) {
99
+ console.log(HELP)
100
+ return 0
101
+ }
83
102
  if (
84
103
  values.visibility !== undefined &&
85
104
  values.visibility !== 'private' &&
@@ -48,5 +48,6 @@
48
48
  "1.7.4",
49
49
  "1.7.5",
50
50
  "1.7.6",
51
- "1.7.7"
51
+ "1.7.7",
52
+ "1.7.8"
52
53
  ]
@@ -917,8 +917,8 @@
917
917
  "index.ts": ["48f96cde6c73e781e3e6", "87f0933285eb83af7ad0"],
918
918
  "LICENSE": ["0f98259ccb0f4cafebe9"],
919
919
  "README.md": ["3ca5c183f7ea0bdf6b95"],
920
- "share-cli.ts": ["2201fe37cbbc5d167e17", "97cdb3ceaf2c73327454"],
921
- "share.ts": ["458a795e3298eb69eb82", "353ea9b5e115787c595f"]
920
+ "share-cli.ts": ["2201fe37cbbc5d167e17", "97cdb3ceaf2c73327454", "5027a88554b2a654c563"],
921
+ "share.ts": ["458a795e3298eb69eb82", "353ea9b5e115787c595f", "71410a74dbcc3161b433"]
922
922
  },
923
923
  "showcase": {
924
924
  "cards.ts": ["c1e376b316660e5b37e9"],