@amalgm/apps 0.1.3-preview.37556579173 → 0.1.3-preview.39017162709
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 +24 -12
- package/README.md +39 -32
- package/dist/apps.d.ts +9 -7
- package/dist/apps.js +54 -45
- package/dist/apps.js.map +1 -1
- package/dist/command-surface.d.ts +3 -7
- package/dist/command-surface.js +9 -29
- package/dist/command-surface.js.map +1 -1
- package/dist/construct-surface.js +45 -17
- package/dist/construct-surface.js.map +1 -1
- package/dist/construct.d.ts +0 -5
- package/dist/construct.js +0 -22
- package/dist/construct.js.map +1 -1
- package/dist/folders.d.ts +40 -0
- package/dist/folders.js +94 -0
- package/dist/folders.js.map +1 -0
- package/dist/identity.d.ts +1 -2
- package/dist/identity.js +1 -13
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +20 -0
- package/dist/layout.js +27 -0
- package/dist/layout.js.map +1 -0
- package/dist/logs.js +2 -0
- package/dist/logs.js.map +1 -1
- package/dist/mcp-server.d.ts +1 -1
- package/dist/mcp-server.js +3 -33
- package/dist/mcp-server.js.map +1 -1
- package/dist/ownership.d.ts +1 -1
- package/dist/ownership.js +5 -4
- package/dist/ownership.js.map +1 -1
- package/dist/package.js +10 -2
- package/dist/package.js.map +1 -1
- package/dist/presentation.d.ts +1 -3
- package/dist/presentation.js +1 -12
- package/dist/presentation.js.map +1 -1
- package/dist/releases.d.ts +4 -6
- package/dist/releases.js +15 -24
- package/dist/releases.js.map +1 -1
- package/dist/runtime.js +4 -4
- package/dist/runtime.js.map +1 -1
- package/dist/schema.js +2 -13
- package/dist/schema.js.map +1 -1
- package/dist/store.d.ts +9 -3
- package/dist/store.js +20 -14
- package/dist/store.js.map +1 -1
- package/dist/supervisor.d.ts +2 -2
- package/dist/supervisor.js +11 -11
- package/dist/supervisor.js.map +1 -1
- package/dist/types.d.ts +14 -11
- package/docs/SHELL_INTEGRATION.md +23 -5
- package/docs/STATUS.md +31 -28
- package/docs/SUPERVISION.md +14 -15
- package/package.json +7 -18
- package/skills/apps/SKILL.md +56 -73
- package/dist/bin/apps.d.ts +0 -2
- package/dist/bin/apps.js +0 -6
- package/dist/bin/apps.js.map +0 -1
- package/dist/bin/mcp.d.ts +0 -2
- package/dist/bin/mcp.js +0 -15
- package/dist/bin/mcp.js.map +0 -1
- package/dist/cli.d.ts +0 -15
- package/dist/cli.js +0 -116
- package/dist/cli.js.map +0 -1
- package/dist/http.d.ts +0 -30
- package/dist/http.js +0 -77
- package/dist/http.js.map +0 -1
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAIb,SAAS,OAAO,CAAC,EAAqB;IACpC,EAAE,CAAC,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAIb,SAAS,OAAO,CAAC,EAAqB;IACpC,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEP,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/store.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Generations } from './generations.js';
|
|
2
2
|
import type DatabaseType from 'better-sqlite3';
|
|
3
3
|
import type { AppRecord, Deployment, Release } from './types.js';
|
|
4
|
-
type AppPatch = Partial<Pick<AppRecord, 'name' | 'description' | '
|
|
5
|
-
|
|
4
|
+
type AppPatch = Partial<Pick<AppRecord, 'name' | 'description' | 'folder' | 'activeReleaseId' | 'activeDeploymentId' | 'activeGenerationId' | 'desiredState' | 'status' | 'pid' | 'dnsConnected' | 'autostart' | 'keepAlive' | 'error' | 'readyAt' | 'lastHeartbeatAt' | 'heartbeatIntervalMs' | 'constructVersion'>> & {
|
|
5
|
+
sourceDir?: string | null;
|
|
6
|
+
};
|
|
7
|
+
type NewApp = Omit<AppRecord, 'sourceDir' | 'dataDir' | 'activeReleaseId' | 'activeDeploymentId' | 'activeGenerationId' | 'error' | 'pid' | 'readyAt' | 'lastHeartbeatAt' | 'heartbeatIntervalMs' | 'constructVersion'> & {
|
|
8
|
+
sourceDir: string | null;
|
|
9
|
+
} & Partial<Pick<AppRecord, 'description' | 'desiredState' | 'status' | 'dnsConnected' | 'autostart' | 'keepAlive'>>;
|
|
6
10
|
type NewRelease = Release;
|
|
7
11
|
type NewDeployment = Omit<Deployment, 'sequence' | 'status' | 'error' | 'activatedAt'>;
|
|
8
12
|
declare class Store {
|
|
9
13
|
readonly db: DatabaseType.Database;
|
|
10
14
|
readonly generations: Generations;
|
|
11
|
-
|
|
15
|
+
private readonly root;
|
|
16
|
+
/** The catalog in `file`, for the apps whose folders are in `root`. */
|
|
17
|
+
constructor(file: string, root: string);
|
|
12
18
|
createApp(app: NewApp): AppRecord;
|
|
13
19
|
getApp(id: string): AppRecord | null;
|
|
14
20
|
listApps(): AppRecord[];
|
package/dist/store.js
CHANGED
|
@@ -2,10 +2,12 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import Database from 'better-sqlite3';
|
|
4
4
|
import { Generations } from './generations.js';
|
|
5
|
+
import { appLayout } from './layout.js';
|
|
5
6
|
import { migrate } from './schema.js';
|
|
6
7
|
const APP_COLUMNS = new Map([
|
|
7
8
|
['name', 'name'],
|
|
8
9
|
['description', 'description'],
|
|
10
|
+
['folder', 'folder'],
|
|
9
11
|
['sourceDir', 'source_dir'],
|
|
10
12
|
['activeReleaseId', 'active_release_id'],
|
|
11
13
|
['activeDeploymentId', 'active_deployment_id'],
|
|
@@ -25,9 +27,10 @@ const APP_COLUMNS = new Map([
|
|
|
25
27
|
function boolean(value) {
|
|
26
28
|
return Boolean(value);
|
|
27
29
|
}
|
|
28
|
-
function appRow(row) {
|
|
30
|
+
function appRow(row, root) {
|
|
29
31
|
if (!row)
|
|
30
32
|
return null;
|
|
33
|
+
const layout = appLayout(root, row.folder);
|
|
31
34
|
return {
|
|
32
35
|
id: row.id,
|
|
33
36
|
name: row.name,
|
|
@@ -35,8 +38,9 @@ function appRow(row) {
|
|
|
35
38
|
appRef: row.app_ref,
|
|
36
39
|
publicUrl: row.public_url,
|
|
37
40
|
port: row.port,
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
folder: row.folder,
|
|
42
|
+
sourceDir: row.source_dir ?? layout.dir,
|
|
43
|
+
dataDir: layout.data,
|
|
40
44
|
activeReleaseId: row.active_release_id,
|
|
41
45
|
activeDeploymentId: row.active_deployment_id,
|
|
42
46
|
activeGenerationId: row.active_generation_id,
|
|
@@ -62,7 +66,6 @@ function releaseRow(row) {
|
|
|
62
66
|
id: row.id,
|
|
63
67
|
appId: row.app_id,
|
|
64
68
|
digest: row.digest,
|
|
65
|
-
directory: row.directory,
|
|
66
69
|
manifest: JSON.parse(row.manifest_json),
|
|
67
70
|
createdAt: row.created_at,
|
|
68
71
|
};
|
|
@@ -75,7 +78,6 @@ function deploymentRow(row) {
|
|
|
75
78
|
id: row.id,
|
|
76
79
|
appId: row.app_id,
|
|
77
80
|
releaseId: row.release_id,
|
|
78
|
-
directory: row.directory,
|
|
79
81
|
reason: row.reason,
|
|
80
82
|
status: row.status,
|
|
81
83
|
error: row.error,
|
|
@@ -86,7 +88,10 @@ function deploymentRow(row) {
|
|
|
86
88
|
class Store {
|
|
87
89
|
db;
|
|
88
90
|
generations;
|
|
89
|
-
|
|
91
|
+
root;
|
|
92
|
+
/** The catalog in `file`, for the apps whose folders are in `root`. */
|
|
93
|
+
constructor(file, root) {
|
|
94
|
+
this.root = root;
|
|
90
95
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
91
96
|
this.db = new Database(file);
|
|
92
97
|
this.db.pragma('journal_mode = WAL');
|
|
@@ -98,11 +103,11 @@ class Store {
|
|
|
98
103
|
createApp(app) {
|
|
99
104
|
this.db.prepare(`
|
|
100
105
|
INSERT INTO apps (
|
|
101
|
-
id, name, description, app_ref, public_url, port,
|
|
106
|
+
id, name, description, app_ref, public_url, port, folder, source_dir,
|
|
102
107
|
desired_state, status, dns_connected, autostart, keep_alive,
|
|
103
108
|
created_at, updated_at
|
|
104
109
|
) VALUES (
|
|
105
|
-
@id, @name, @description, @appRef, @publicUrl, @port, @
|
|
110
|
+
@id, @name, @description, @appRef, @publicUrl, @port, @folder, @sourceDir,
|
|
106
111
|
@desiredState, @status, @dnsConnected, @autostart, @keepAlive,
|
|
107
112
|
@createdAt, @updatedAt
|
|
108
113
|
)
|
|
@@ -118,10 +123,11 @@ class Store {
|
|
|
118
123
|
return this.getApp(app.id);
|
|
119
124
|
}
|
|
120
125
|
getApp(id) {
|
|
121
|
-
return appRow(this.db.prepare('SELECT * FROM apps WHERE id = ?').get(id));
|
|
126
|
+
return appRow(this.db.prepare('SELECT * FROM apps WHERE id = ?').get(id), this.root);
|
|
122
127
|
}
|
|
123
128
|
listApps() {
|
|
124
|
-
return this.db.prepare('SELECT * FROM apps ORDER BY created_at, id').all()
|
|
129
|
+
return this.db.prepare('SELECT * FROM apps ORDER BY created_at, id').all()
|
|
130
|
+
.map((value) => appRow(value, this.root)).filter(Boolean);
|
|
125
131
|
}
|
|
126
132
|
updateApp(id, patch) {
|
|
127
133
|
const entries = Object.entries(patch)
|
|
@@ -146,8 +152,8 @@ class Store {
|
|
|
146
152
|
addRelease(release) {
|
|
147
153
|
this.db.prepare(`
|
|
148
154
|
INSERT OR IGNORE INTO releases
|
|
149
|
-
(id, app_id, digest,
|
|
150
|
-
VALUES (@id, @appId, @digest, @
|
|
155
|
+
(id, app_id, digest, manifest_json, created_at)
|
|
156
|
+
VALUES (@id, @appId, @digest, @manifestJson, @createdAt)
|
|
151
157
|
`).run({ ...release, manifestJson: JSON.stringify(release.manifest) });
|
|
152
158
|
return this.getRelease(release.id);
|
|
153
159
|
}
|
|
@@ -162,8 +168,8 @@ class Store {
|
|
|
162
168
|
createDeployment(deployment) {
|
|
163
169
|
this.db.prepare(`
|
|
164
170
|
INSERT INTO deployments
|
|
165
|
-
(id, app_id, release_id,
|
|
166
|
-
VALUES (@id, @appId, @releaseId, @
|
|
171
|
+
(id, app_id, release_id, reason, status, created_at)
|
|
172
|
+
VALUES (@id, @appId, @releaseId, @reason, 'prepared', @createdAt)
|
|
167
173
|
`).run(deployment);
|
|
168
174
|
return this.getDeployment(deployment.id);
|
|
169
175
|
}
|
package/dist/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAmBtC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,QAAQ,EAAE,QAAQ,CAA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d,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;;OAGf,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAC1B,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;;;OAIf,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1D,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,cAAc,CAAC,EAAU,EAAE,KAAc;QACvC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;KAEf,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,kBAAkB,CAAC,KAAa,EAAE,eAA8B;QAC9D,OAAO,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;;;;;KAKpC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;CACF;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/supervisor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppRecord, StartOptions, StopOptions, SupervisorOptions } from './types.js';
|
|
2
2
|
declare class Supervisor {
|
|
3
3
|
private readonly store;
|
|
4
|
-
private readonly
|
|
4
|
+
private readonly root;
|
|
5
5
|
private readonly environment;
|
|
6
6
|
private readonly changed;
|
|
7
7
|
private readonly faults;
|
|
@@ -16,7 +16,7 @@ declare class Supervisor {
|
|
|
16
16
|
private readonly restarts;
|
|
17
17
|
private readonly reconciler;
|
|
18
18
|
constructor(options: SupervisorOptions);
|
|
19
|
-
logPath(
|
|
19
|
+
logPath(app: AppRecord): string;
|
|
20
20
|
start(appId: string, options?: StartOptions): Promise<AppRecord>;
|
|
21
21
|
private onExit;
|
|
22
22
|
stop(appId: string, options?: StopOptions): Promise<AppRecord>;
|
package/dist/supervisor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import crypto from 'node:crypto';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
3
|
import { spawn } from 'node:child_process';
|
|
4
|
+
import { appLayout } from './layout.js';
|
|
5
5
|
import { DEFAULT_MAX_LOG_BYTES, capLog, logTail, openLog } from './logs.js';
|
|
6
6
|
import { appProcessEnvironment, replacePort } from './presentation.js';
|
|
7
7
|
import { isAlive, killTree, processIdentity, waitForDeath, } from './process.js';
|
|
@@ -10,7 +10,7 @@ import { Restarts } from './restarts.js';
|
|
|
10
10
|
import { errorMessage } from './boundaries.js';
|
|
11
11
|
class Supervisor {
|
|
12
12
|
store;
|
|
13
|
-
|
|
13
|
+
root;
|
|
14
14
|
environment;
|
|
15
15
|
changed;
|
|
16
16
|
faults;
|
|
@@ -26,7 +26,7 @@ class Supervisor {
|
|
|
26
26
|
reconciler;
|
|
27
27
|
constructor(options) {
|
|
28
28
|
this.store = options.store;
|
|
29
|
-
this.
|
|
29
|
+
this.root = options.root;
|
|
30
30
|
this.environment = options.environment || (() => ({}));
|
|
31
31
|
this.changed = options.changed || (() => { });
|
|
32
32
|
this.faults = options.faults;
|
|
@@ -50,14 +50,13 @@ class Supervisor {
|
|
|
50
50
|
failed: (appId, error) => this.restarts.afterFailure(appId, error),
|
|
51
51
|
capLogs: () => {
|
|
52
52
|
for (const app of this.store.listApps())
|
|
53
|
-
capLog(this.logPath(app
|
|
53
|
+
capLog(this.logPath(app), this.maxLogBytes);
|
|
54
54
|
},
|
|
55
55
|
faults: this.faults,
|
|
56
56
|
});
|
|
57
|
-
fs.mkdirSync(path.join(this.stateDir, 'logs'), { recursive: true });
|
|
58
57
|
}
|
|
59
|
-
logPath(
|
|
60
|
-
return
|
|
58
|
+
logPath(app) {
|
|
59
|
+
return appLayout(this.root, app.folder).log;
|
|
61
60
|
}
|
|
62
61
|
async start(appId, options = {}) {
|
|
63
62
|
let app = this.store.getApp(appId);
|
|
@@ -92,18 +91,19 @@ class Supervisor {
|
|
|
92
91
|
return this.store.getApp(appId);
|
|
93
92
|
this.restarts.cancel(appId);
|
|
94
93
|
fs.mkdirSync(app.dataDir, { recursive: true });
|
|
94
|
+
const logFile = this.logPath(app);
|
|
95
95
|
const generation = this.store.generations.create({
|
|
96
96
|
id: `gen-${crypto.randomUUID()}`,
|
|
97
97
|
appId,
|
|
98
98
|
deploymentId: deployment.id,
|
|
99
99
|
createdAt: new Date().toISOString(),
|
|
100
100
|
});
|
|
101
|
-
const log = openLog(
|
|
101
|
+
const log = openLog(logFile, this.maxLogBytes);
|
|
102
102
|
const command = replacePort(release.manifest.startCommand, app.port);
|
|
103
103
|
let child;
|
|
104
104
|
try {
|
|
105
105
|
child = this.spawn(command, {
|
|
106
|
-
cwd: deployment.
|
|
106
|
+
cwd: appLayout(this.root, app.folder).deployment(deployment.id),
|
|
107
107
|
env: appProcessEnvironment(app, this.environment(app)),
|
|
108
108
|
shell: true,
|
|
109
109
|
detached: process.platform !== 'win32',
|
|
@@ -129,9 +129,9 @@ class Supervisor {
|
|
|
129
129
|
});
|
|
130
130
|
child.once('exit', (code, signal) => {
|
|
131
131
|
// A rolled-back registration deletes the log, so the error carries its tail.
|
|
132
|
-
const tail = settled ? '' : logTail(
|
|
132
|
+
const tail = settled ? '' : logTail(logFile, 20).join('\n');
|
|
133
133
|
this.faults.guard(appId, 'Managed child exit handler failed', () => {
|
|
134
|
-
capLog(
|
|
134
|
+
capLog(logFile, this.maxLogBytes);
|
|
135
135
|
this.onExit(appId, generation.id, child, code, signal, settled);
|
|
136
136
|
});
|
|
137
137
|
resolve(settled ? null : new Error(`App exited during startup (${signal || `code ${code}`})${tail ? `:\n${tail}` : ''}`));
|
package/dist/supervisor.js.map
CHANGED
|
@@ -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AC,EAAE,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;gBACxD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CACL,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,MAAM,OAAO,CAAC,UAAU,CACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;aAClB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aAC9D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC,CAAC,CACnE,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YAC3C,KAAK,CAAC,kBAAkB,EAAE,CAAC;YAC3B,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAClB,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;CACF;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ChildProcess, SpawnOptions } from 'node:child_process';
|
|
2
|
-
import type { Readable, Writable } from 'node:stream';
|
|
3
2
|
import type { AppHealthSnapshot, AppStatus } from '@amalgm/core/supervision';
|
|
4
3
|
export interface AppManifest {
|
|
5
4
|
schemaVersion: 1;
|
|
@@ -23,7 +22,11 @@ export interface AppRecord {
|
|
|
23
22
|
appRef: string;
|
|
24
23
|
publicUrl: string;
|
|
25
24
|
port: number;
|
|
25
|
+
/** The app's folder in the user's apps root, named after the app. */
|
|
26
|
+
folder: string;
|
|
27
|
+
/** Where the source lives: the app's folder, or the person's own project it was made from. */
|
|
26
28
|
sourceDir: string;
|
|
29
|
+
/** The app's data folder inside its `.private/`, handed to it as AMALGM_APP_DATA_DIR. */
|
|
27
30
|
dataDir: string;
|
|
28
31
|
activeReleaseId: string | null;
|
|
29
32
|
activeDeploymentId: string | null;
|
|
@@ -53,7 +56,6 @@ export interface Release {
|
|
|
53
56
|
id: string;
|
|
54
57
|
appId: string;
|
|
55
58
|
digest: string;
|
|
56
|
-
directory: string;
|
|
57
59
|
manifest: AppManifest;
|
|
58
60
|
createdAt: string;
|
|
59
61
|
}
|
|
@@ -63,7 +65,6 @@ export interface Deployment {
|
|
|
63
65
|
id: string;
|
|
64
66
|
appId: string;
|
|
65
67
|
releaseId: string;
|
|
66
|
-
directory: string;
|
|
67
68
|
reason: string;
|
|
68
69
|
status: DeploymentStatus;
|
|
69
70
|
error: string | null;
|
|
@@ -156,8 +157,12 @@ export interface PackedPackage extends PackageInspection {
|
|
|
156
157
|
}>;
|
|
157
158
|
}
|
|
158
159
|
export interface AppsOptions {
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
/** The user's apps root: one folder per app. */
|
|
161
|
+
root: string;
|
|
162
|
+
/** This computer's apps folder, which holds the catalog (`apps.db`). */
|
|
163
|
+
dir: string;
|
|
164
|
+
/** Where a removed app's `.private/` is kept on this computer. */
|
|
165
|
+
parked: string;
|
|
161
166
|
domain?: string;
|
|
162
167
|
portMin?: number;
|
|
163
168
|
portMax?: number;
|
|
@@ -181,8 +186,6 @@ export interface AppsOptions {
|
|
|
181
186
|
onError?: (error: Error) => unknown;
|
|
182
187
|
runCommand?: RunCommand;
|
|
183
188
|
spawn?: SpawnProcess;
|
|
184
|
-
store?: import('./store.js').Store;
|
|
185
|
-
ownership?: import('./ownership.js').Ownership;
|
|
186
189
|
/** The host's intentional-change door; absent until a runtime holds the rails. */
|
|
187
190
|
recordConstruct?: import('./construct.js').RecordConstruct;
|
|
188
191
|
}
|
|
@@ -226,7 +229,8 @@ export interface StopOptions {
|
|
|
226
229
|
}
|
|
227
230
|
export interface SupervisorOptions {
|
|
228
231
|
store: import('./store.js').Store;
|
|
229
|
-
|
|
232
|
+
/** The user's apps root; each app's process files sit in its folder's `.private/`. */
|
|
233
|
+
root: string;
|
|
230
234
|
faults: import('./faults.js').Faults;
|
|
231
235
|
environment?: (app: AppRecord) => NodeJS.ProcessEnv;
|
|
232
236
|
changed?: (app: AppRecord) => unknown;
|
|
@@ -265,12 +269,11 @@ export interface JsonRpcRequest {
|
|
|
265
269
|
method: string;
|
|
266
270
|
params?: Record<string, any>;
|
|
267
271
|
}
|
|
268
|
-
export interface McpServerOptions
|
|
269
|
-
apps
|
|
272
|
+
export interface McpServerOptions {
|
|
273
|
+
apps: import('./apps.js').Apps;
|
|
270
274
|
}
|
|
271
275
|
export interface McpServer {
|
|
272
276
|
apps: import('./apps.js').Apps;
|
|
273
277
|
tools: McpTool[];
|
|
274
278
|
handle(message: JsonRpcRequest): Promise<unknown>;
|
|
275
|
-
start(input?: Readable, output?: Writable): Promise<unknown>;
|
|
276
279
|
}
|
|
@@ -10,14 +10,17 @@ Apps owns:
|
|
|
10
10
|
|
|
11
11
|
- app, release, deployment, process-generation, and health state;
|
|
12
12
|
- validation, packaging, builds, activation, rollback, and supervision;
|
|
13
|
-
- its SQLite
|
|
14
|
-
- SDK,
|
|
13
|
+
- its SQLite catalog and everything inside each app's folder;
|
|
14
|
+
- SDK, MCP, and app-side lease behavior.
|
|
15
15
|
|
|
16
16
|
Shell owns:
|
|
17
17
|
|
|
18
18
|
- the exact package version used by a Shell release;
|
|
19
19
|
- machine identity, authenticated route mounting, and host effects;
|
|
20
|
-
-
|
|
20
|
+
- the three folders it hands Apps, from Core's `userLayout`: `root` (the
|
|
21
|
+
user's apps root), `dir` (this computer's apps folder, which holds
|
|
22
|
+
`apps.db`), and `parked` (where a removed app's `.private/` is kept);
|
|
23
|
+
- the `amalgm apps` command, which calls the Apps MCP tools at `/mcp/apps`;
|
|
21
24
|
- projection of the Apps catalog into runtime and UI surfaces; and
|
|
22
25
|
- orderly construction and shutdown of the one Apps service instance it owns.
|
|
23
26
|
|
|
@@ -27,8 +30,23 @@ Apps public service, or reimplements release and deployment behavior.
|
|
|
27
30
|
|
|
28
31
|
## Current release boundary
|
|
29
32
|
|
|
30
|
-
Shell
|
|
31
|
-
|
|
33
|
+
Shell constructs the one Apps instance and mounts its MCP tools at
|
|
34
|
+
`/mcp/apps` in composed and development hosts:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
const apps = new Apps({
|
|
38
|
+
root: user.apps,
|
|
39
|
+
dir: user.computer.apps,
|
|
40
|
+
parked: user.computer.parked,
|
|
41
|
+
recordConstruct,
|
|
42
|
+
// runtimeUrl, chatServerUrl, runtimeToken, publishRoutes, onChange, onError
|
|
43
|
+
});
|
|
44
|
+
const mcp = createMcpServer({ apps });
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Apps sets every variable an app process needs, including
|
|
48
|
+
`AMALGM_APP_DATA_DIR` (the app's `.private/data`); Shell sets no path for an
|
|
49
|
+
app. In the signed machine host, the runtime boots the Apps service when it
|
|
32
50
|
starts, so apps that should be running resume without waiting for a tool call.
|
|
33
51
|
The current signed service catalog still names Core, Files, Agents, Tools, and
|
|
34
52
|
Chat; a package dependency or mounted route is not by itself admission as an
|
package/docs/STATUS.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
# Status
|
|
2
2
|
|
|
3
|
-
Last updated 2026-
|
|
3
|
+
Last updated 2026-10-16.
|
|
4
4
|
|
|
5
5
|
## Proven
|
|
6
6
|
|
|
7
|
-
amalgm-apps works
|
|
8
|
-
|
|
7
|
+
amalgm-apps works as an SDK with MCP tools on top. It was tested on macOS
|
|
8
|
+
with the real Design Canvas app.
|
|
9
9
|
|
|
10
|
-
- **All
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
- **All 14 commands work** as MCP tools: create, list, get, update, delete,
|
|
11
|
+
start, stop, deploy, rollback, versions, deployments, logs, validate,
|
|
12
|
+
routes.
|
|
13
13
|
- **Design Canvas runs as an Amalgm app.** `create` built it (npm install and a
|
|
14
14
|
UI build into an immutable release), started it, and it served on its port.
|
|
15
15
|
A design made through its own tool was saved in the app's data directory
|
|
16
16
|
and survived stop, start, deploy, and rollback.
|
|
17
|
-
- **Supervision works.** A killed app restarts by itself. A new owner
|
|
18
|
-
|
|
19
|
-
- **
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- `npm run verify` passes
|
|
17
|
+
- **Supervision works.** A killed app restarts by itself. A new owner adopts
|
|
18
|
+
the running app, and restarts it if it is killed.
|
|
19
|
+
- **Each app is one folder.** An app lives in `apps/<Folder>/` with its
|
|
20
|
+
identity file and `.private/`; a person's own project gains no files. Rename
|
|
21
|
+
moves the folder, delete parks `.private/` and leaves nothing else, and a
|
|
22
|
+
failed create removes only what it made (`test/folders.test.ts`).
|
|
23
|
+
- `npm run verify` passes locally and in CI.
|
|
24
24
|
|
|
25
25
|
## Fixed while testing
|
|
26
26
|
|
|
27
|
-
- **
|
|
28
|
-
through pipes to the owner, which kept it alive; after a handoff
|
|
29
|
-
no reader. Apps now write their own log through an inherited descriptor.
|
|
30
|
-
- **
|
|
31
|
-
|
|
27
|
+
- **A short-lived owner never exited** after create, start, or deploy. App
|
|
28
|
+
output went through pipes to the owner, which kept it alive; after a handoff
|
|
29
|
+
the log had no reader. Apps now write their own log through an inherited descriptor.
|
|
30
|
+
- **A port could be busy.** Allocation only checked its own database. Each
|
|
31
|
+
port is now proven free on the host (nothing answers on loopback).
|
|
32
32
|
- **A failed start did not say why.** The error now carries the log tail.
|
|
33
33
|
|
|
34
34
|
## Cleaned up
|
|
@@ -36,14 +36,16 @@ It was tested on macOS with the real Design Canvas app, outside amalgm-shell.
|
|
|
36
36
|
Deleted the Engine-era importer, snake_case and `versionId` aliases, schema and
|
|
37
37
|
status migrations older than the first publish, unused options, internal
|
|
38
38
|
exports, and the Engine integration doc. The package index exports only the
|
|
39
|
-
SDK and its adapters.
|
|
39
|
+
SDK and its adapters. The standalone CLI and its bins, the read-only HTTP
|
|
40
|
+
catalog, and every default folder went when the runtime began handing Apps its
|
|
41
|
+
folders.
|
|
40
42
|
|
|
41
43
|
## Compared with the old Engine
|
|
42
44
|
|
|
43
45
|
The Engine gave agents 9 app tools: register, validate, list, routes,
|
|
44
46
|
redeploy, start, stop, connect DNS, disconnect DNS. It had no delete, get,
|
|
45
47
|
versions, deployment history, logs, or rollback for agents. Apps has 14
|
|
46
|
-
commands,
|
|
48
|
+
commands, one MCP tool each.
|
|
47
49
|
|
|
48
50
|
## An app is a construct on the rails
|
|
49
51
|
|
|
@@ -55,19 +57,20 @@ version it is running, which is the only thing Apply and Verify believe.
|
|
|
55
57
|
`construct-surface.ts` is the whole seam — the access verbs sharing calls
|
|
56
58
|
(`resolve`, `dependencies`, `copy`, `trash`) and the Apply half the host drives
|
|
57
59
|
(`inspect`, `payloadDependencies`, `switchTo`, `applyStructure`). A received
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
new app is unpacked into a new folder of its own. A received version of an
|
|
61
|
+
app whose source Amalgm owns is unpacked into its folder; for an app made
|
|
62
|
+
from a person's own project it is built from a copy in `.private/build/` that
|
|
63
|
+
leaves afterwards, so the rails never rewrite the directory a person edits.
|
|
60
64
|
|
|
61
65
|
## Remains
|
|
62
66
|
|
|
63
67
|
- **Testing inside amalgm-shell.** The shell hosts Apps in the product. Still
|
|
64
|
-
to prove there: the shell boots Apps and adopts running apps,
|
|
65
|
-
work through the
|
|
66
|
-
`*.apps.amalgm.ai` link opens the app. The preview machine needs a
|
|
67
|
-
build that carries this version of Apps.
|
|
68
|
+
to prove there: the shell boots Apps and adopts running apps, `amalgm apps`
|
|
69
|
+
and the MCP tools work through the runtime, the UI catalog lists apps, and
|
|
70
|
+
a public `*.apps.amalgm.ai` link opens the app. The preview machine needs a
|
|
71
|
+
shell build that carries this version of Apps.
|
|
68
72
|
- **Follow-ups in this repo:** move register out of `apps.ts` (activation now
|
|
69
|
-
lives in `releases.ts`)
|
|
70
|
-
the UI reads `/apps`.
|
|
73
|
+
lives in `releases.ts`).
|
|
71
74
|
- **Outside this repo:** the shell still carries `bundle-apps.ts`, the pack
|
|
72
75
|
sharing adapter apps no longer needs. It goes when agents, automations and
|
|
73
76
|
tools are constructs too and nothing is left to copy by bundle.
|
package/docs/SUPERVISION.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Supervision ownership
|
|
2
2
|
|
|
3
|
-
The Apps supervisor stays in `@amalgm/apps`.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
The Apps supervisor stays in `@amalgm/apps`. Every host that composes Apps
|
|
4
|
+
executes the same supervisor; combining products does not move app lifecycle
|
|
5
|
+
logic into Shell or Core.
|
|
6
6
|
|
|
7
7
|
## Active composition
|
|
8
8
|
|
|
@@ -15,8 +15,8 @@ lifecycle logic into Shell or Core.
|
|
|
15
15
|
└── App B process generations
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Apps owns its domain supervisor. Shell constructs the product once
|
|
19
|
-
|
|
18
|
+
Apps owns its domain supervisor. Shell constructs the product once with the
|
|
19
|
+
folders it hands it and supplies host effects. Core owns portable route
|
|
20
20
|
admission, health vocabulary, and restart decision contracts; it does not own
|
|
21
21
|
the Apps store or a stateful app-process supervisor. The levels have different
|
|
22
22
|
authority:
|
|
@@ -29,19 +29,18 @@ authority:
|
|
|
29
29
|
| Shell composition | machine effects, identity, route mounting, product availability | app lifecycle decisions or Apps persistence |
|
|
30
30
|
|
|
31
31
|
There is never a second Apps supervisor in Shell or Core. Shell instantiates
|
|
32
|
-
the public Apps service or communicates with a process that does.
|
|
33
|
-
|
|
32
|
+
the public Apps service or communicates with a process that does. MCP, the
|
|
33
|
+
`amalgm apps` command, gateways, and UI code are clients or adapters.
|
|
34
34
|
|
|
35
|
-
## One owner per
|
|
35
|
+
## One owner per catalog folder
|
|
36
36
|
|
|
37
|
-
Exactly one live Apps supervisor may mutate a
|
|
38
|
-
responsible for every app process generation
|
|
39
|
-
custody through a defined service restart.
|
|
37
|
+
Exactly one live Apps supervisor may mutate a catalog folder (the folder
|
|
38
|
+
holding `apps.db`). That owner is responsible for every app process generation
|
|
39
|
+
until it stops or transfers custody through a defined service restart.
|
|
40
40
|
|
|
41
|
-
Other processes must not open the same
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
the complete operation, or refuse the mutation.
|
|
41
|
+
Other processes must not open the same catalog as lifecycle writers. They use
|
|
42
|
+
the owning service's MCP tools; a second `Apps` pointed at the same catalog
|
|
43
|
+
refuses to take ownership.
|
|
45
44
|
|
|
46
45
|
## Failure direction
|
|
47
46
|
|