@amalgm/core 0.4.0 → 0.4.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.
package/PURPOSE.md CHANGED
@@ -134,6 +134,9 @@ that composes an exact Core release with the other product releases.
134
134
  resume persist only identity, tunnel, and machine credentials. Products get
135
135
  short-lived, exact grants from the in-memory broker, and resume removes any
136
136
  retired proxy or HMAC credential left by an older installation.
137
+ 25. **Build output is a projection, never accumulated state.** Every build
138
+ removes `dist` before compiling, and packaging runs that clean build, so a
139
+ deleted source file cannot survive inside a release.
137
140
 
138
141
  ## Five surfaces, one behavior
139
142
 
package/README.md CHANGED
@@ -28,9 +28,9 @@ node surfaces/cli/amalgm-core.mjs label canary
28
28
  ```
29
29
 
30
30
  Rules of the house: zero runtime dependencies; nothing in `src/` imports
31
- `node:*` or reads `process.env`; Shell is the production host and exact-version
32
- composer; tests are exams each states a law, and a mutant must be convicted
33
- by at least one.
31
+ `node:*` or reads `process.env`; every build recreates `dist` from source;
32
+ Shell is the production host and exact-version composer; tests are exams
33
+ each states a law, and a mutant must be convicted by at least one.
34
34
 
35
35
  Package releases use `.github/workflows/publish-package.yml`. A reviewed main
36
36
  commit is tagged exactly `v<package version>`; trusted npm publishing stages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amalgm/core",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "The Amalgm kernel SDK — identity, transport, supervision, and host capability contracts behind host-injected adapters.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -66,7 +66,9 @@
66
66
  "node": ">=18"
67
67
  },
68
68
  "scripts": {
69
- "build": "tsc -p tsconfig.json",
69
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
70
+ "build": "npm run clean && tsc -p tsconfig.json",
71
+ "prepack": "npm run build",
70
72
  "test": "npm run build && node --test",
71
73
  "examine:machine-setup": "npm run build && node --test tests/supervision/installation-plan.test.js tests/machine-setup/examination.test.js",
72
74
  "examine:user-ground": "npm run build && npm --prefix ../amalgm-live run build && node --test examinations/user-ground/login.examination.mjs"
@@ -1,7 +0,0 @@
1
- import type { LocalHarness } from './types.js';
2
- export declare function resolveLocalAgentEnv(agentId: LocalHarness['id'] | string, authMode: string, proxyToken?: string, proxyBaseUrl?: string): Record<string, string>;
3
- export declare function localReauthCommand(agentId: string): {
4
- shell: string;
5
- description: string;
6
- } | null;
7
- //# sourceMappingURL=resolve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/identity/local/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,EACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAajG"}
@@ -1,32 +0,0 @@
1
- export function resolveLocalAgentEnv(agentId, authMode, proxyToken, proxyBaseUrl) {
2
- if (authMode !== 'amalgm' || !proxyToken || !proxyBaseUrl)
3
- return {};
4
- const base = proxyBaseUrl.replace(/\/+$/, '');
5
- switch (agentId) {
6
- case 'claude_code':
7
- return { ANTHROPIC_API_KEY: proxyToken, ANTHROPIC_BASE_URL: `${base}/anthropic` };
8
- case 'codex':
9
- return { OPENAI_API_KEY: proxyToken, OPENAI_BASE_URL: `${base}/openai/v1` };
10
- case 'opencode':
11
- return { AI_GATEWAY_API_KEY: proxyToken, AI_GATEWAY_BASE_URL: `${base}/ai_gateway/v3/ai` };
12
- case 'pi':
13
- return { AI_GATEWAY_API_KEY: proxyToken, AI_GATEWAY_BASE_URL: `${base}/ai_gateway/v1` };
14
- default:
15
- return {};
16
- }
17
- }
18
- export function localReauthCommand(agentId) {
19
- switch (agentId) {
20
- case 'claude_code': return { shell: 'claude', description: 'Run `claude`, then type /login to authenticate.' };
21
- case 'codex': return { shell: 'codex login', description: '`codex login` walks through OAuth or API-key setup.' };
22
- case 'opencode': return { shell: 'opencode auth login', description: '`opencode auth login` walks through provider setup.' };
23
- case 'pi': return { shell: 'pi --terminal-login', description: '`pi --terminal-login` authenticates Pi in the terminal.' };
24
- case 'amp': return { shell: 'amp --setup', description: '`amp --setup` configures Amp credentials.' };
25
- case 'cursor': return {
26
- shell: 'if command -v cursor-agent >/dev/null 2>&1; then cursor-agent login; else "$HOME/.local/bin/cursor-agent" login; fi',
27
- description: '`cursor-agent login` opens the browser login flow.',
28
- };
29
- default: return null;
30
- }
31
- }
32
- //# sourceMappingURL=resolve.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/identity/local/resolve.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,oBAAoB,CAClC,OAAoC,EACpC,QAAgB,EAChB,UAAmB,EACnB,YAAqB;IAErB,IAAI,QAAQ,KAAK,QAAQ,IAAI,CAAC,UAAU,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IACrE,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9C,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,aAAa;YAChB,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,kBAAkB,EAAE,GAAG,IAAI,YAAY,EAAE,CAAC;QACpF,KAAK,OAAO;YACV,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,IAAI,YAAY,EAAE,CAAC;QAC9E,KAAK,UAAU;YACb,OAAO,EAAE,kBAA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