@amalgm/core 0.1.5 → 0.1.7

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 (34) hide show
  1. package/PURPOSE.md +8 -0
  2. package/dist/adapters/index.d.ts +1 -0
  3. package/dist/adapters/index.d.ts.map +1 -1
  4. package/dist/identity/credentials/api.d.ts +3 -0
  5. package/dist/identity/credentials/api.d.ts.map +1 -0
  6. package/dist/identity/credentials/api.js +61 -0
  7. package/dist/identity/credentials/api.js.map +1 -0
  8. package/dist/identity/credentials/index.d.ts +4 -0
  9. package/dist/identity/credentials/index.d.ts.map +1 -0
  10. package/dist/identity/credentials/index.js +3 -0
  11. package/dist/identity/credentials/index.js.map +1 -0
  12. package/dist/identity/credentials/types.d.ts +52 -0
  13. package/dist/identity/credentials/types.d.ts.map +1 -0
  14. package/dist/identity/credentials/types.js +2 -0
  15. package/dist/identity/credentials/types.js.map +1 -0
  16. package/dist/identity/credentials/vault.d.ts +31 -0
  17. package/dist/identity/credentials/vault.d.ts.map +1 -0
  18. package/dist/identity/credentials/vault.js +214 -0
  19. package/dist/identity/credentials/vault.js.map +1 -0
  20. package/dist/identity/index.d.ts +1 -0
  21. package/dist/identity/index.d.ts.map +1 -1
  22. package/dist/identity/index.js +1 -0
  23. package/dist/identity/index.js.map +1 -1
  24. package/dist/transport/index.d.ts +2 -1
  25. package/dist/transport/index.d.ts.map +1 -1
  26. package/dist/transport/index.js +2 -1
  27. package/dist/transport/index.js.map +1 -1
  28. package/dist/transport/routing.d.ts +2 -2
  29. package/dist/transport/routing.js +1 -1
  30. package/dist/transport/shipped-routes.d.ts +13 -5
  31. package/dist/transport/shipped-routes.d.ts.map +1 -1
  32. package/dist/transport/shipped-routes.js +13 -7
  33. package/dist/transport/shipped-routes.js.map +1 -1
  34. package/package.json +5 -1
package/PURPOSE.md CHANGED
@@ -91,6 +91,14 @@ source until each module is cut over.
91
91
  read names one declared service, reads at most the configured tail bound,
92
92
  and applies the shared redaction law before any content crosses the
93
93
  gateway; arbitrary paths and unbounded files are not diagnostic inputs.
94
+ 16. **One machine-local vault owns user credentials.** Every credential is
95
+ encrypted before persistence, every public view contains only a hint and
96
+ fingerprint, and plaintext leaves solely through explicit resolution.
97
+ Compatibility APIs share this vault; they never create a second secret
98
+ file or cloud authority.
99
+ 17. **Retirement is explicit subtraction.** Every retired Engine prefix stays
100
+ named as evidence but is absent from the active route table, so dead
101
+ compatibility surfaces cannot masquerade as unfinished product work.
94
102
 
95
103
  ## Five surfaces, one behavior
96
104
 
@@ -10,4 +10,5 @@
10
10
  export type { ClockIsoPort, ClockMsPort, RandomHexPort, Sha256HexPort, ResolvePathPort, } from '../identity/ports.js';
11
11
  export type { TimingSafeEqualPort } from '../transport/auth.js';
12
12
  export type { HmacHexPort } from '../transport/ingress.js';
13
+ export type { CredentialCipherPort, CredentialStorePort } from '../identity/credentials/index.js';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { CredentialVault } from './vault.js';
2
+ export declare function createCredentialsApi(vault: CredentialVault): (request: Request) => Promise<Response>;
3
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/identity/credentials/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAO7C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAmCpG"}
@@ -0,0 +1,61 @@
1
+ import { CredentialVault } from './vault.js';
2
+ export function createCredentialsApi(vault) {
3
+ return async (request) => {
4
+ const pathname = new URL(request.url).pathname;
5
+ if (pathname !== '/credentials' && pathname !== '/user-api-keys')
6
+ return json(404, { error: 'not found' });
7
+ try {
8
+ if (pathname === '/credentials') {
9
+ if (request.method === 'GET')
10
+ return json(200, { credentials: vault.list() });
11
+ const body = await requestBody(request);
12
+ if (request.method === 'POST') {
13
+ return json(200, { credential: vault.upsert({
14
+ ...(typeof body.id === 'string' ? { id: body.id } : {}),
15
+ ...(typeof body.name === 'string' ? { name: body.name } : {}),
16
+ ...(typeof body.providerKind === 'string' ? { providerKind: body.providerKind } : {}),
17
+ ...(typeof body.baseUrl === 'string' ? { baseUrl: body.baseUrl } : {}),
18
+ key: typeof body.key === 'string' ? body.key : '',
19
+ }) });
20
+ }
21
+ if (request.method === 'DELETE')
22
+ return json(200, vault.delete(typeof body.id === 'string' ? body.id : ''));
23
+ return methodNotAllowed('GET, POST, DELETE');
24
+ }
25
+ const body = await requestBody(request);
26
+ if (request.method === 'POST') {
27
+ const saved = vault.putHarnessKey(body.harnessId, body.apiKey);
28
+ return json(200, { keyHint: saved.keyHint });
29
+ }
30
+ if (request.method === 'DELETE') {
31
+ return json(200, vault.deleteHarnessKeys(body.harnessId));
32
+ }
33
+ return methodNotAllowed('POST, DELETE');
34
+ }
35
+ catch (error) {
36
+ return json(400, { error: error instanceof Error ? error.message : 'Invalid credential request' });
37
+ }
38
+ };
39
+ }
40
+ async function requestBody(request) {
41
+ const text = await request.text();
42
+ if (!text)
43
+ return {};
44
+ const value = JSON.parse(text);
45
+ if (!value || typeof value !== 'object' || Array.isArray(value))
46
+ throw new Error('request body must be an object');
47
+ return value;
48
+ }
49
+ function methodNotAllowed(allow) {
50
+ return new Response(JSON.stringify({ error: 'method not allowed' }), {
51
+ status: 405,
52
+ headers: { 'content-type': 'application/json', 'cache-control': 'no-store', allow },
53
+ });
54
+ }
55
+ function json(status, body) {
56
+ return new Response(JSON.stringify(body), {
57
+ status,
58
+ headers: { 'content-type': 'application/json', 'cache-control': 'no-store' },
59
+ });
60
+ }
61
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/identity/credentials/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAO7C,MAAM,UAAU,oBAAoB,CAAC,KAAsB;IACzD,OAAO,KAAK,EAAE,OAAO,EAAE,EAAE;QACvB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;QAC/C,IAAI,QAAQ,KAAK,cAAc,IAAI,QAAQ,KAAK,gBAAgB;YAAE,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;QAE3G,IAAI,CAAC;YACH,IAAI,QAAQ,KAAK,cAAc,EAAE,CAAC;gBAChC,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK;oBAAE,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAC9E,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,OAAO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AE,CAAC,EAAE;QACnE,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,EAAE;KACpF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,IAAI,CAAC,MAAc,EAAE,IAAa;IACzC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;QACxC,MAAM;QACN,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,UAAU,EAAE;KAC7E,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { createCredentialsApi } from './api.js';
2
+ export { CredentialVault, DEFAULT_BASE_URL, inferProviderKind, normalizeBaseUrl } from './vault.js';
3
+ export type * from './types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identity/credentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACpG,mBAAmB,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createCredentialsApi } from './api.js';
2
+ export { CredentialVault, DEFAULT_BASE_URL, inferProviderKind, normalizeBaseUrl } from './vault.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identity/credentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,52 @@
1
+ export type CredentialProviderKind = 'anthropic_compatible' | 'openai_compatible' | 'ai_gateway';
2
+ export type ByokHarnessId = 'claude_code' | 'codex' | 'opencode' | 'pi';
3
+ export interface CredentialSummary {
4
+ readonly id: string;
5
+ readonly name: string;
6
+ readonly providerKind: CredentialProviderKind;
7
+ readonly keyHint: string;
8
+ readonly tokenFingerprint: string;
9
+ readonly createdAt: string;
10
+ readonly updatedAt: string;
11
+ }
12
+ export interface StoredCredential extends CredentialSummary {
13
+ readonly baseUrl: string;
14
+ readonly encryptedKey: unknown;
15
+ readonly slot?: string;
16
+ }
17
+ export interface CredentialStoreDocument {
18
+ readonly version: 1;
19
+ readonly credentials: readonly StoredCredential[];
20
+ }
21
+ export interface CredentialStorePort {
22
+ read(): unknown;
23
+ write(document: CredentialStoreDocument): void;
24
+ }
25
+ export interface CredentialCipherPort {
26
+ encrypt(secret: string): unknown;
27
+ decrypt(envelope: unknown): string;
28
+ fingerprint(secret: string): string;
29
+ }
30
+ export interface CredentialVaultPorts {
31
+ readonly store: CredentialStorePort;
32
+ readonly cipher: CredentialCipherPort;
33
+ readonly now: () => string;
34
+ readonly randomId: () => string;
35
+ }
36
+ export interface UpsertCredentialInput {
37
+ readonly id?: string;
38
+ readonly name?: string;
39
+ readonly key: string;
40
+ readonly providerKind?: CredentialProviderKind;
41
+ readonly baseUrl?: string;
42
+ }
43
+ export interface ResolveCredentialInput {
44
+ readonly credentialId?: string;
45
+ readonly harness?: ByokHarnessId;
46
+ readonly providerKind?: CredentialProviderKind;
47
+ }
48
+ export interface ResolvedCredential extends CredentialSummary {
49
+ readonly baseUrl: string;
50
+ readonly key: string;
51
+ }
52
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/identity/credentials/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAC9B,sBAAsB,GACtB,mBAAmB,GACnB,YAAY,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,OAAO,GAA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AM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,YAAY,CAAC,EAAE,sBAAsB,CAAC;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,sBAAsB,CAAC;CAChD;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/identity/credentials/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ import type { CredentialProviderKind, CredentialSummary, CredentialVaultPorts, ResolveCredentialInput, ResolvedCredential, UpsertCredentialInput } from './types.js';
2
+ /**
3
+ * Engine reference:
4
+ * - runtime/scripts/chat-core/credentials/store.js
5
+ * - runtime/scripts/amalgm-mcp/credentials/rest.js
6
+ * - runtime/scripts/amalgm-mcp/user-api-keys/rest.js
7
+ */
8
+ declare const DEFAULT_BASE_URL: Record<CredentialProviderKind, string>;
9
+ declare function inferProviderKind(input: {
10
+ readonly baseUrl?: string;
11
+ readonly key?: string;
12
+ }): CredentialProviderKind;
13
+ declare function normalizeBaseUrl(baseUrl: unknown, providerKind: CredentialProviderKind): string;
14
+ export declare class CredentialVault {
15
+ #private;
16
+ constructor(ports: CredentialVaultPorts);
17
+ list(): CredentialSummary[];
18
+ upsert(input: UpsertCredentialInput): CredentialSummary;
19
+ delete(id: string): {
20
+ readonly ok: true;
21
+ readonly deleted: boolean;
22
+ };
23
+ putHarnessKey(harnessId: unknown, apiKey: unknown): CredentialSummary;
24
+ deleteHarnessKeys(harnessId?: unknown): {
25
+ readonly ok: true;
26
+ readonly deleted: number;
27
+ };
28
+ resolve(input?: ResolveCredentialInput): ResolvedCredential | null;
29
+ }
30
+ export { DEFAULT_BASE_URL, inferProviderKind, normalizeBaseUrl };
31
+ //# sourceMappingURL=vault.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../../../src/identity/credentials/vault.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EAEtB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAElB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AAEH,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAI5D,CAAC;AAsCF,iBAAS,iBAAiB,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,sBAAsB,CAM9G;AAED,iBAAS,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,sBAAsB,GAAG,MAAM,CAMxF;AA2DD,qBAAa,eAAe;;gBAGd,KAAK,EAAE,oBAAoB;IAIvC,IAAI,IAAI,iBAAiB,EAAE;IAM3B,MAAM,CAAC,KAAK,EAAE,qBAAqB,GAAG,iBAAiB;IAIvD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE;IAQpE,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,iBAAiB;IAcrE,iBAAiB,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAQvF,OAAO,CAAC,KAAK,GAAE,sBAA2B,GAAG,kBAAkB,GAAG,IAAI;CAoDvE;AAED,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,214 @@
1
+ /**
2
+ * Engine reference:
3
+ * - runtime/scripts/chat-core/credentials/store.js
4
+ * - runtime/scripts/amalgm-mcp/credentials/rest.js
5
+ * - runtime/scripts/amalgm-mcp/user-api-keys/rest.js
6
+ */
7
+ const DEFAULT_BASE_URL = {
8
+ anthropic_compatible: 'https://api.anthropic.com',
9
+ openai_compatible: 'https://api.openai.com/v1',
10
+ ai_gateway: 'https://ai-gateway.vercel.sh/v1',
11
+ };
12
+ const HARNESS = {
13
+ claude_code: { name: 'Anthropic', providerKind: 'anthropic_compatible' },
14
+ codex: { name: 'OpenAI', providerKind: 'openai_compatible' },
15
+ opencode: { name: 'Vercel AI Gateway', providerKind: 'ai_gateway' },
16
+ pi: { name: 'OpenAI', providerKind: 'openai_compatible' },
17
+ };
18
+ const PROVIDERS_FOR_HARNESS = {
19
+ claude_code: ['anthropic_compatible'],
20
+ codex: ['openai_compatible'],
21
+ opencode: ['ai_gateway', 'openai_compatible', 'anthropic_compatible'],
22
+ pi: [],
23
+ };
24
+ function required(value, label) {
25
+ const text = typeof value === 'string' ? value.trim() : '';
26
+ if (!text)
27
+ throw new Error(`${label} is required`);
28
+ return text;
29
+ }
30
+ function provider(value) {
31
+ return value === 'anthropic_compatible'
32
+ || value === 'openai_compatible'
33
+ || value === 'ai_gateway'
34
+ ? value
35
+ : null;
36
+ }
37
+ function harness(value) {
38
+ if (value === 'claude_code' || value === 'codex' || value === 'opencode' || value === 'pi')
39
+ return value;
40
+ throw new Error(`Unsupported BYOK harness: ${String(value || '')}`);
41
+ }
42
+ function inferProviderKind(input) {
43
+ const url = String(input.baseUrl || '').toLowerCase();
44
+ const key = String(input.key || '').trim();
45
+ if (url.includes('anthropic') || key.startsWith('sk-ant-'))
46
+ return 'anthropic_compatible';
47
+ if (url.includes('ai-gateway.vercel') || url.includes('gateway.vercel') || key.startsWith('v0_'))
48
+ return 'ai_gateway';
49
+ return 'openai_compatible';
50
+ }
51
+ function normalizeBaseUrl(baseUrl, providerKind) {
52
+ const value = String(baseUrl || DEFAULT_BASE_URL[providerKind]).trim() || DEFAULT_BASE_URL[providerKind];
53
+ const url = new URL(value);
54
+ if (url.protocol !== 'http:' && url.protocol !== 'https:')
55
+ throw new Error('baseUrl must use http or https');
56
+ if (url.username || url.password)
57
+ throw new Error('baseUrl cannot contain credentials');
58
+ return value.replace(/\/+$/, '');
59
+ }
60
+ function defaultName(providerKind, baseUrl) {
61
+ if (providerKind === 'anthropic_compatible')
62
+ return 'Anthropic';
63
+ if (providerKind === 'ai_gateway')
64
+ return 'Vercel AI Gateway';
65
+ try {
66
+ return new URL(baseUrl).hostname.replace(/^api\./, '') || 'OpenAI Compatible';
67
+ }
68
+ catch {
69
+ return 'OpenAI Compatible';
70
+ }
71
+ }
72
+ function keyHint(key) {
73
+ return `...${key.slice(-4)}`;
74
+ }
75
+ function summary(record) {
76
+ return {
77
+ id: record.id,
78
+ name: record.name,
79
+ providerKind: record.providerKind,
80
+ keyHint: record.keyHint,
81
+ tokenFingerprint: record.tokenFingerprint,
82
+ createdAt: record.createdAt,
83
+ updatedAt: record.updatedAt,
84
+ };
85
+ }
86
+ function storedCredential(value) {
87
+ if (!value || typeof value !== 'object' || Array.isArray(value))
88
+ return null;
89
+ const record = value;
90
+ const providerKind = provider(record.providerKind);
91
+ if (!providerKind)
92
+ return null;
93
+ const id = typeof record.id === 'string' ? record.id.trim() : '';
94
+ const name = typeof record.name === 'string' ? record.name.trim() : '';
95
+ const baseUrl = typeof record.baseUrl === 'string' ? record.baseUrl.trim() : '';
96
+ const hint = typeof record.keyHint === 'string' ? record.keyHint.trim() : '';
97
+ const fingerprint = typeof record.tokenFingerprint === 'string' ? record.tokenFingerprint.trim() : '';
98
+ const createdAt = typeof record.createdAt === 'string' ? record.createdAt.trim() : '';
99
+ const updatedAt = typeof record.updatedAt === 'string' ? record.updatedAt.trim() : '';
100
+ if (!id || !name || !baseUrl || !hint || !fingerprint || !createdAt || !updatedAt || !('encryptedKey' in record))
101
+ return null;
102
+ return {
103
+ id, name, providerKind, baseUrl,
104
+ keyHint: hint,
105
+ tokenFingerprint: fingerprint,
106
+ encryptedKey: record.encryptedKey,
107
+ createdAt,
108
+ updatedAt,
109
+ ...(typeof record.slot === 'string' && record.slot.trim() ? { slot: record.slot.trim() } : {}),
110
+ };
111
+ }
112
+ function document(value) {
113
+ if (!value || typeof value !== 'object' || Array.isArray(value))
114
+ return { version: 1, credentials: [] };
115
+ const records = value.credentials;
116
+ if (!Array.isArray(records))
117
+ return { version: 1, credentials: [] };
118
+ return { version: 1, credentials: records.map(storedCredential).filter((record) => record !== null) };
119
+ }
120
+ export class CredentialVault {
121
+ #ports;
122
+ constructor(ports) {
123
+ this.#ports = ports;
124
+ }
125
+ list() {
126
+ return document(this.#ports.store.read()).credentials
127
+ .map(summary)
128
+ .sort((left, right) => left.createdAt.localeCompare(right.createdAt) || left.id.localeCompare(right.id));
129
+ }
130
+ upsert(input) {
131
+ return summary(this.#save(input));
132
+ }
133
+ delete(id) {
134
+ const target = required(id, 'id');
135
+ const current = document(this.#ports.store.read());
136
+ const credentials = current.credentials.filter((record) => record.id !== target);
137
+ this.#ports.store.write({ version: 1, credentials });
138
+ return { ok: true, deleted: credentials.length !== current.credentials.length };
139
+ }
140
+ putHarnessKey(harnessId, apiKey) {
141
+ const id = harness(harnessId);
142
+ const descriptor = HARNESS[id];
143
+ const current = document(this.#ports.store.read());
144
+ const existing = current.credentials.find((record) => record.slot === `harness:${id}`);
145
+ return summary(this.#save({
146
+ ...(existing ? { id: existing.id } : {}),
147
+ name: descriptor.name,
148
+ providerKind: descriptor.providerKind,
149
+ baseUrl: DEFAULT_BASE_URL[descriptor.providerKind],
150
+ key: required(apiKey, 'apiKey'),
151
+ }, `harness:${id}`));
152
+ }
153
+ deleteHarnessKeys(harnessId) {
154
+ const slot = harnessId === undefined ? null : `harness:${harness(harnessId)}`;
155
+ const current = document(this.#ports.store.read());
156
+ const credentials = current.credentials.filter((record) => slot ? record.slot !== slot : !record.slot?.startsWith('harness:'));
157
+ this.#ports.store.write({ version: 1, credentials });
158
+ return { ok: true, deleted: current.credentials.length - credentials.length };
159
+ }
160
+ resolve(input = {}) {
161
+ const current = document(this.#ports.store.read());
162
+ const allowed = input.providerKind
163
+ ? [input.providerKind]
164
+ : input.harness
165
+ ? PROVIDERS_FOR_HARNESS[harness(input.harness)]
166
+ : [];
167
+ const record = input.credentialId
168
+ ? current.credentials.find((candidate) => candidate.id === input.credentialId)
169
+ : allowed.length
170
+ ? current.credentials.find((candidate) => allowed.includes(candidate.providerKind))
171
+ : undefined;
172
+ if (!record)
173
+ return null;
174
+ if (allowed.length && !allowed.includes(record.providerKind)) {
175
+ throw new Error(`Credential ${record.name || record.id} is not compatible with ${input.harness || input.providerKind}`);
176
+ }
177
+ return { ...summary(record), baseUrl: record.baseUrl, key: this.#ports.cipher.decrypt(record.encryptedKey) };
178
+ }
179
+ #save(input, slot) {
180
+ const key = required(input.key, 'key');
181
+ const explicitProviderKind = input.providerKind === undefined ? null : provider(input.providerKind);
182
+ if (input.providerKind !== undefined && !explicitProviderKind) {
183
+ throw new Error(`Unsupported credential provider: ${String(input.providerKind)}`);
184
+ }
185
+ const providerKind = explicitProviderKind || inferProviderKind({
186
+ ...(input.baseUrl === undefined ? {} : { baseUrl: input.baseUrl }),
187
+ key,
188
+ });
189
+ const baseUrl = normalizeBaseUrl(input.baseUrl, providerKind);
190
+ const now = this.#ports.now();
191
+ const current = document(this.#ports.store.read());
192
+ const id = input.id ? required(input.id, 'id') : this.#ports.randomId();
193
+ const existing = current.credentials.find((record) => record.id === id);
194
+ const record = {
195
+ id,
196
+ name: String(input.name || '').trim() || defaultName(providerKind, baseUrl),
197
+ providerKind,
198
+ baseUrl,
199
+ keyHint: keyHint(key),
200
+ tokenFingerprint: this.#ports.cipher.fingerprint(key),
201
+ encryptedKey: this.#ports.cipher.encrypt(key),
202
+ createdAt: existing?.createdAt || now,
203
+ updatedAt: now,
204
+ ...(slot ? { slot } : existing?.slot ? { slot: existing.slot } : {}),
205
+ };
206
+ this.#ports.store.write({
207
+ version: 1,
208
+ credentials: [...current.credentials.filter((candidate) => candidate.id !== id), record],
209
+ });
210
+ return record;
211
+ }
212
+ }
213
+ export { DEFAULT_BASE_URL, inferProviderKind, normalizeBaseUrl };
214
+ //# sourceMappingURL=vault.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault.js","sourceRoot":"","sources":["../../../src/identity/credentials/vault.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AAEH,MAAM,gBAAgB,GAA2C;IAC/D,oBAAoB,EAAE,2BAA2B;IACjD,iBAAiB,EAAE,2BAA2B;IAC9C,UAAU,EAAE,iCAAiC;CAC9C,CAAC;AAEF,MAAM,OAAO,GAGR;IACH,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,sBAAsB,EAAE;IACxE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE;IAC5D,QAAQ,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE;IACnE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE;CAC1D,CAAC;AAEF,MAAM,qBAAqB,GAA6D;IACtF,WAAW,EAAE,CAAC,sBAAsB,CAAC;IACrC,KAAK,EAAE,CAAC,mBAAmB,CAAC;IAC5B,QAAQ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,CAAC;YACV,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC;SACzF,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -10,6 +10,7 @@ export * from './labels.js';
10
10
  export * from './layout.js';
11
11
  export * from './product-state.js';
12
12
  export * from './local/index.js';
13
+ export * from './credentials/index.js';
13
14
  export * from './ids.js';
14
15
  export * from './auth-records.js';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
@@ -10,6 +10,7 @@ export * from './labels.js';
10
10
  export * from './layout.js';
11
11
  export * from './product-state.js';
12
12
  export * from './local/index.js';
13
+ export * from './credentials/index.js';
13
14
  export * from './ids.js';
14
15
  export * from './auth-records.js';
15
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
@@ -7,7 +7,8 @@
7
7
  * codes.
8
8
  * - routing: ONE routing table (axiom 4) — prefix classification,
9
9
  * the port-mapping and target-port laws, denial contracts. The
10
- * engine's shipped table contents live in shipped-routes.
10
+ * decomposed target contents and explicit Engine retirements live in
11
+ * shipped-routes.
11
12
  * - admission: who gets routed to at all — app refs, the serving
12
13
  * gate and the advertising breaker, preview-port admission, header
13
14
  * hygiene, log redaction.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -7,7 +7,8 @@
7
7
  * codes.
8
8
  * - routing: ONE routing table (axiom 4) — prefix classification,
9
9
  * the port-mapping and target-port laws, denial contracts. The
10
- * engine's shipped table contents live in shipped-routes.
10
+ * decomposed target contents and explicit Engine retirements live in
11
+ * shipped-routes.
11
12
  * - admission: who gets routed to at all — app refs, the serving
12
13
  * gate and the advertising breaker, preview-port admission, header
13
14
  * hygiene, log redaction.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transport/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -7,7 +7,7 @@
7
7
  * vice versa) is that drift cashing out. This module is the one
8
8
  * definition; the table CONTENTS are injected product configuration
9
9
  * (the kernel routes, it does not know what chat is — axiom 3), with
10
- * the engine's shipped lists exported from shipped-routes.ts.
10
+ * the decomposed target lists exported from shipped-routes.ts.
11
11
  *
12
12
  * The pipe never reads the mail: everything here classifies pathnames
13
13
  * and port numbers. Nothing inspects a payload.
@@ -23,7 +23,7 @@ export declare const RUNTIME_SERVICES: readonly ["gateway", "portMonitor", "mcp"
23
23
  /**
24
24
  * The one routing table. Buckets are prefix lists; gateway
25
25
  * additionally owns a set of exact paths. Contents are product
26
- * configuration — see shippedRouteTable for the engine's lists.
26
+ * configuration — see shippedRouteTable for the active target lists.
27
27
  */
28
28
  export interface RouteTable {
29
29
  readonly gatewayPrefixes: readonly string[];
@@ -7,7 +7,7 @@
7
7
  * vice versa) is that drift cashing out. This module is the one
8
8
  * definition; the table CONTENTS are injected product configuration
9
9
  * (the kernel routes, it does not know what chat is — axiom 3), with
10
- * the engine's shipped lists exported from shipped-routes.ts.
10
+ * the decomposed target lists exported from shipped-routes.ts.
11
11
  *
12
12
  * The pipe never reads the mail: everything here classifies pathnames
13
13
  * and port numbers. Nothing inspects a payload.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The engine's shipped routing table, copied byte-for-byte from
3
- * tunnel-events.js:58-89 — the canonical of the three engine copies
2
+ * The decomposed runtime's active routing table, derived from the Engine
3
+ * table in tunnel-events.js:58-89 — the canonical of its three copies
4
4
  * (the other two: tunnel-chat.js:33-64, identical; local-gateway.js:
5
5
  * 133-176, which carries only the chat/mcp/portMonitor buckets
6
6
  * because the gateway dispatches its own routes before consulting a
@@ -9,13 +9,21 @@
9
9
  * under its own '/pty' handling).
10
10
  *
11
11
  * Counts, pinned by tests: 3 gateway prefixes, 5 gateway exact paths,
12
- * 3 port-monitor prefixes, 7 chat prefixes, 26 MCP prefixes.
12
+ * 3 port-monitor prefixes, 7 chat prefixes, 24 active MCP prefixes.
13
13
  *
14
14
  * This is product configuration riding in the kernel repo for the
15
15
  * cutover: the table SHAPE is core's; these CONTENTS belong to the
16
- * products that own the prefixes. A new runtime REST prefix goes here
17
- * (and, until cutover, in all three engine copies) or UI calls 404.
16
+ * products that own the prefixes. Engine compatibility prefixes which the
17
+ * target deliberately will not serve remain named below as retirement
18
+ * evidence instead of disappearing from history.
18
19
  */
19
20
  import type { RouteTable } from './routing.js';
21
+ /**
22
+ * Present in the current Engine gateway, absent from the decomposed target:
23
+ * `/tasks` is the superseded SQLite scheduler facade; `/mcp-connections` is
24
+ * the superseded second registry now represented by Tools connection records
25
+ * plus credential references resolved by Core's machine-local vault.
26
+ */
27
+ export declare const retiredEngineRoutePrefixes: readonly ["/tasks", "/mcp-connections"];
20
28
  export declare const shippedRouteTable: RouteTable;
21
29
  //# sourceMappingURL=shipped-routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shipped-routes.d.ts","sourceRoot":"","sources":["../../src/transport/shipped-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,eAAO,MAAM,iBAAiB,EAAE,UAiC/B,CAAC"}
1
+ {"version":3,"file":"shipped-routes.d.ts","sourceRoot":"","sources":["../../src/transport/shipped-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,yCAA0C,CAAC;AAElF,eAAO,MAAM,iBAAiB,EAAE,UA+B/B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The engine's shipped routing table, copied byte-for-byte from
3
- * tunnel-events.js:58-89 — the canonical of the three engine copies
2
+ * The decomposed runtime's active routing table, derived from the Engine
3
+ * table in tunnel-events.js:58-89 — the canonical of its three copies
4
4
  * (the other two: tunnel-chat.js:33-64, identical; local-gateway.js:
5
5
  * 133-176, which carries only the chat/mcp/portMonitor buckets
6
6
  * because the gateway dispatches its own routes before consulting a
@@ -9,13 +9,21 @@
9
9
  * under its own '/pty' handling).
10
10
  *
11
11
  * Counts, pinned by tests: 3 gateway prefixes, 5 gateway exact paths,
12
- * 3 port-monitor prefixes, 7 chat prefixes, 26 MCP prefixes.
12
+ * 3 port-monitor prefixes, 7 chat prefixes, 24 active MCP prefixes.
13
13
  *
14
14
  * This is product configuration riding in the kernel repo for the
15
15
  * cutover: the table SHAPE is core's; these CONTENTS belong to the
16
- * products that own the prefixes. A new runtime REST prefix goes here
17
- * (and, until cutover, in all three engine copies) or UI calls 404.
16
+ * products that own the prefixes. Engine compatibility prefixes which the
17
+ * target deliberately will not serve remain named below as retirement
18
+ * evidence instead of disappearing from history.
18
19
  */
20
+ /**
21
+ * Present in the current Engine gateway, absent from the decomposed target:
22
+ * `/tasks` is the superseded SQLite scheduler facade; `/mcp-connections` is
23
+ * the superseded second registry now represented by Tools connection records
24
+ * plus credential references resolved by Core's machine-local vault.
25
+ */
26
+ export const retiredEngineRoutePrefixes = ['/tasks', '/mcp-connections'];
19
27
  export const shippedRouteTable = {
20
28
  gatewayPrefixes: ['/__amalgm', '/diagnostics', '/pty'],
21
29
  gatewayExactPaths: ['/', '/healthz', '/runtime-state', '/pty/session', '/pty/resize'],
@@ -24,14 +32,12 @@ export const shippedRouteTable = {
24
32
  mcpPrefixes: [
25
33
  '/mcp',
26
34
  '/events',
27
- '/tasks',
28
35
  '/automations',
29
36
  '/event-triggers',
30
37
  '/workspace',
31
38
  '/project-context',
32
39
  '/github',
33
40
  '/fs',
34
- '/mcp-connections',
35
41
  '/toolbox',
36
42
  '/state',
37
43
  '/local',
@@ -1 +1 @@
1
- {"version":3,"file":"shipped-routes.js","sourceRoot":"","sources":["../../src/transport/shipped-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,MAAM,CAAC,MAAM,iBAAiB,GAAe;IAC3C,eAAe,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC;IACtD,iBAAiB,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,gBAAg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T,KAAK;QACL,UAAU;QACV,QAAQ;QACR,QAAQ;QACR,cAAc;QACd,gBAAgB;QAChB,QAAQ;QACR,QAAQ;QACR,gBAAgB;QAChB,OAAO;QACP,YAAY;QACZ,SAAS;QACT,eAAe;QACf,gBAAgB;QAChB,SAAS;QACT,mBAAmB;QACnB,UAAU;KACX;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amalgm/core",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
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",
@@ -24,6 +24,10 @@
24
24
  "types": "./dist/identity/local/index.d.ts",
25
25
  "default": "./dist/identity/local/index.js"
26
26
  },
27
+ "./credentials": {
28
+ "types": "./dist/identity/credentials/index.d.ts",
29
+ "default": "./dist/identity/credentials/index.js"
30
+ },
27
31
  "./transport": {
28
32
  "types": "./dist/transport/index.d.ts",
29
33
  "default": "./dist/transport/index.js"