@standardagents/code 0.14.5-branch.9e48e914.ded17d → 0.14.7-canary.1d1274

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/lib/artifact.mjs CHANGED
@@ -26,9 +26,6 @@ export const BUNDLE_ARTIFACT_FILES = Object.freeze([
26
26
  'licenses/THIRD-PARTY.txt',
27
27
  ])
28
28
 
29
- // The Node plugin runner that native releases from before plugin runtime v2
30
- // bundled. Builds no longer produce it; installed launchers keep verifying
31
- // the releases that carry it, which carry either all of these files or none.
32
29
  export const RUNNER_ASSET_NAMES = Object.freeze([
33
30
  'index.mjs', 'worker.mjs', 'loader.mjs', 'sdk.mjs', 'runtime.json', 'THIRD-PARTY.txt',
34
31
  ])
@@ -132,9 +129,8 @@ export const WEB_ARTIFACT_OPTIONAL_FILES = Object.freeze([
132
129
  export const WEB_ARTIFACT_DIRECTORIES = Object.freeze({ fonts: /\.ttf$/, licenses: /\.txt$/ })
133
130
  export const WEB_ARTIFACT_FILE_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/
134
131
  // The sample plugins' browser artifacts (packages/web/scripts/build-plugins.mjs),
135
- // optional: the Worker runtime and index at plugins/, the reference glue at
136
- // plugins/host/, jco's transpiler at plugins/jco/, and one directory per
137
- // sample plugin id holding its manifest, component and world core module.
132
+ // optional: the Worker runtime and index at plugins/, and one directory per
133
+ // plugin id holding its manifest, component, transpiled glue and core modules.
138
134
  export const WEB_ARTIFACT_PLUGIN_FILES = Object.freeze([
139
135
  'plugins/worker.js', 'plugins/runtime.js', 'plugins/samples.json',
140
136
  ])
package/lib/launcher.mjs CHANGED
@@ -6,7 +6,7 @@ import process from 'node:process'
6
6
 
7
7
  import { platformPackage } from './platform.mjs'
8
8
  import { artifactBinaryPath, requireCompatibleGlibc, verifyNativeArtifact } from './artifact.mjs'
9
- import { artifactPointer, installNativeArtifact, installedArtifact, packageMetadata } from './install.mjs'
9
+ import { artifactPointer, installNativeArtifact, installedArtifact, nativeDirectory, packageMetadata } from './install.mjs'
10
10
 
11
11
  const require = createRequire(import.meta.url)
12
12
  const COMMANDS = new Set(['standard', 'standardd'])
@@ -60,17 +60,6 @@ export function stableBinary(command, options = {}) {
60
60
  }
61
61
  }
62
62
 
63
- // The executable this npm package itself carries, never the daemon's
64
- // native-releases slot behind the stable link. Postinstall marks only this
65
- // one executable: a slot's files are verified as release state, and a chmod
66
- // through the stable link would loosen the running release's executables.
67
- export function packagedBinary(command, options = {}) {
68
- if (!COMMANDS.has(command)) {
69
- throw new Error(`Unknown Standard executable: ${command}`)
70
- }
71
- return resolvePackagedBinary(command, options)
72
- }
73
-
74
63
  function resolvePackagedBinary(command, options) {
75
64
  const platform = platformPackage(
76
65
  options.platform,
@@ -110,8 +99,9 @@ export function spawnBinary(command, args, options = {}) {
110
99
  }
111
100
 
112
101
  // Install this platform's signed R2 archive when the package names one and
113
- // has no binaries installed yet. Package managers that skip install scripts
114
- // (pnpm by default) reach this on the first launch instead of postinstall.
102
+ // has no binaries installed yet. The package has no install script, so npm
103
+ // and pnpm install it without an allow-scripts prompt, and the first launch
104
+ // downloads and verifies the native build here (#684).
115
105
  export async function ensureNativeBinaries(options = {}) {
116
106
  if (options.environment?.STANDARD_CODE_BINARY_DIR ?? process.env.STANDARD_CODE_BINARY_DIR) return
117
107
  const platform = platformPackage(options.platform, options.architecture, options.report)
@@ -124,7 +114,20 @@ export async function ensureNativeBinaries(options = {}) {
124
114
  } catch {
125
115
  // No npm platform package: download the archive.
126
116
  }
127
- await installNativeArtifact({ target: platform.rustTarget, root: options.packageRoot, fetchImplementation: options.fetchImplementation })
117
+ const log = options.log ?? (message => console.error(message))
118
+ log(`standard: installing the native build for ${platform.rustTarget} (first launch)`)
119
+ try {
120
+ await installNativeArtifact({ target: platform.rustTarget, root: options.packageRoot, fetchImplementation: options.fetchImplementation })
121
+ } catch (error) {
122
+ if (error?.code === 'EACCES' || error?.code === 'EPERM') {
123
+ throw new Error(
124
+ `cannot write the native build under ${nativeDirectory(platform.rustTarget, options.packageRoot)}. `
125
+ + 'The package belongs to another user (for example an npm install run with sudo); '
126
+ + 'reinstall @standardagents/code with an npm prefix you own.',
127
+ )
128
+ }
129
+ throw error
130
+ }
128
131
  }
129
132
 
130
133
  export async function main(command) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standardagents/code",
3
- "version": "0.14.5-branch.9e48e914.ded17d",
3
+ "version": "0.14.7-canary.1d1274",
4
4
  "description": "Platform launcher for the Standard universal terminal network.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -21,24 +21,20 @@
21
21
  },
22
22
  "files": [
23
23
  "bin",
24
- "lib",
25
- "postinstall.mjs"
24
+ "lib"
26
25
  ],
27
- "scripts": {
28
- "postinstall": "node postinstall.mjs"
29
- },
30
26
  "standardArtifacts": {
31
27
  "schema": 1,
32
28
  "targets": {
33
29
  "aarch64-apple-darwin": {
34
- "url": "https://builds.standardcode.ai/artifacts/0.14.5-branch.9e48e914.ded17d/aarch64-apple-darwin.tar.gz",
35
- "sha256": "97319a7ce9afb9ee725dfabeb4f5ad3ab447f6fae4d6c5f34d3569e6980c915c",
36
- "size": 26202924
30
+ "url": "https://builds.standardcode.ai/artifacts/0.14.7-canary.1d1274/aarch64-apple-darwin.tar.gz",
31
+ "sha256": "bf7994e58cba4d9397024f8ef282540d030a365e12f6b4d9928d34af48c9e156",
32
+ "size": 22986718
37
33
  },
38
34
  "x86_64-unknown-linux-gnu": {
39
- "url": "https://builds.standardcode.ai/artifacts/0.14.5-branch.9e48e914.ded17d/x86_64-unknown-linux-gnu.tar.gz",
40
- "sha256": "696e7c000df3fda3092c8d1dbcb7a1a85f61f541ccd5cc3e3cfd380b66ca83c3",
41
- "size": 35029154
35
+ "url": "https://builds.standardcode.ai/artifacts/0.14.7-canary.1d1274/x86_64-unknown-linux-gnu.tar.gz",
36
+ "sha256": "df3ba37795bf8cd1df967fb6ea80d2843d410d35a4dc4fed2d23b176473aa95b",
37
+ "size": 28560084
42
38
  }
43
39
  }
44
40
  },