@standardagents/code 0.14.4-branch.9e48e914.ee06ef → 0.14.6-branch.916ffc26.771a5b

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'])
@@ -99,8 +99,9 @@ export function spawnBinary(command, args, options = {}) {
99
99
  }
100
100
 
101
101
  // Install this platform's signed R2 archive when the package names one and
102
- // has no binaries installed yet. Package managers that skip install scripts
103
- // (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).
104
105
  export async function ensureNativeBinaries(options = {}) {
105
106
  if (options.environment?.STANDARD_CODE_BINARY_DIR ?? process.env.STANDARD_CODE_BINARY_DIR) return
106
107
  const platform = platformPackage(options.platform, options.architecture, options.report)
@@ -113,7 +114,20 @@ export async function ensureNativeBinaries(options = {}) {
113
114
  } catch {
114
115
  // No npm platform package: download the archive.
115
116
  }
116
- 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
+ }
117
131
  }
118
132
 
119
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.4-branch.9e48e914.ee06ef",
3
+ "version": "0.14.6-branch.916ffc26.771a5b",
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.4-branch.9e48e914.ee06ef/aarch64-apple-darwin.tar.gz",
35
- "sha256": "7f3838b48309f23c341a597c724ad36a5d70adf0b9bbf8415ae07970cc2b59e7",
36
- "size": 26200073
30
+ "url": "https://builds.standardcode.ai/artifacts/0.14.6-branch.916ffc26.771a5b/aarch64-apple-darwin.tar.gz",
31
+ "sha256": "cdb4d906c96d27fe9536ce41949b903097935ac9babb50ad144d21715675924e",
32
+ "size": 22988586
37
33
  },
38
34
  "x86_64-unknown-linux-gnu": {
39
- "url": "https://builds.standardcode.ai/artifacts/0.14.4-branch.9e48e914.ee06ef/x86_64-unknown-linux-gnu.tar.gz",
40
- "sha256": "874bd4025e2bc77f6ed0b7f8fe13befeb6a28c3cb8c351b66d11266e75d3006a",
41
- "size": 35023132
35
+ "url": "https://builds.standardcode.ai/artifacts/0.14.6-branch.916ffc26.771a5b/x86_64-unknown-linux-gnu.tar.gz",
36
+ "sha256": "bd9b509e3cb173308a5e8355c82dd4e8cacc6d5ebf7423e26ee743063a0cc7ae",
37
+ "size": 28560026
42
38
  }
43
39
  }
44
40
  },