@amalgm/apps 0.1.3-preview.34549838332 → 0.1.3-preview.34562094191

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 (58) hide show
  1. package/README.md +1 -3
  2. package/dist/apps.d.ts +2 -4
  3. package/dist/apps.js +10 -13
  4. package/dist/apps.js.map +1 -1
  5. package/dist/boundaries.d.ts +1 -4
  6. package/dist/boundaries.js +1 -1
  7. package/dist/boundaries.js.map +1 -1
  8. package/dist/cli.d.ts +1 -9
  9. package/dist/cli.js +1 -1
  10. package/dist/cli.js.map +1 -1
  11. package/dist/http.d.ts +2 -3
  12. package/dist/http.js +2 -3
  13. package/dist/http.js.map +1 -1
  14. package/dist/identity.d.ts +1 -1
  15. package/dist/identity.js +18 -2
  16. package/dist/identity.js.map +1 -1
  17. package/dist/index.d.ts +3 -5
  18. package/dist/index.js +2 -4
  19. package/dist/index.js.map +1 -1
  20. package/dist/logs.d.ts +4 -10
  21. package/dist/logs.js +26 -33
  22. package/dist/logs.js.map +1 -1
  23. package/dist/manifest.d.ts +1 -3
  24. package/dist/manifest.js +1 -1
  25. package/dist/manifest.js.map +1 -1
  26. package/dist/ownership.d.ts +1 -2
  27. package/dist/ownership.js +1 -1
  28. package/dist/ownership.js.map +1 -1
  29. package/dist/package.d.ts +5 -15
  30. package/dist/package.js +9 -11
  31. package/dist/package.js.map +1 -1
  32. package/dist/portable.d.ts +3 -1
  33. package/dist/portable.js +10 -2
  34. package/dist/portable.js.map +1 -1
  35. package/dist/reconciler.d.ts +2 -0
  36. package/dist/reconciler.js +3 -0
  37. package/dist/reconciler.js.map +1 -1
  38. package/dist/releases.d.ts +4 -4
  39. package/dist/releases.js +3 -3
  40. package/dist/releases.js.map +1 -1
  41. package/dist/restarts.d.ts +1 -10
  42. package/dist/restarts.js +1 -1
  43. package/dist/restarts.js.map +1 -1
  44. package/dist/schema.js +0 -7
  45. package/dist/schema.js.map +1 -1
  46. package/dist/store.js +1 -7
  47. package/dist/store.js.map +1 -1
  48. package/dist/supervisor.d.ts +1 -3
  49. package/dist/supervisor.js +16 -13
  50. package/dist/supervisor.js.map +1 -1
  51. package/dist/types.d.ts +0 -12
  52. package/docs/SHELL_INTEGRATION.md +5 -9
  53. package/package.json +4 -4
  54. package/skills/apps/SKILL.md +1 -1
  55. package/dist/source-import.d.ts +0 -4
  56. package/dist/source-import.js +0 -77
  57. package/dist/source-import.js.map +0 -1
  58. package/docs/ENGINE_INTEGRATION.md +0 -12
package/dist/types.d.ts CHANGED
@@ -139,11 +139,6 @@ export interface CollectedPackage {
139
139
  excluded: ExcludedPackageFile[];
140
140
  totalBytes: number;
141
141
  }
142
- export interface PackageLimits {
143
- manifest?: AppManifest;
144
- maxFileBytes?: number;
145
- maxTotalBytes?: number;
146
- }
147
142
  export interface PackageInspection {
148
143
  manifest: AppManifest;
149
144
  digest: string;
@@ -191,17 +186,14 @@ export interface RegisterInput {
191
186
  cwd: string;
192
187
  port?: number;
193
188
  connectDns?: boolean;
194
- connect_dns?: boolean;
195
189
  autostart?: boolean;
196
190
  keepAlive?: boolean;
197
- keep_alive?: boolean;
198
191
  }
199
192
  export interface DeployInput {
200
193
  cwd?: string;
201
194
  }
202
195
  export interface RollbackInput {
203
196
  releaseId?: string;
204
- versionId?: string;
205
197
  }
206
198
  export interface AppSettingsPatch {
207
199
  name?: string;
@@ -242,10 +234,6 @@ export interface ReadyOptions {
242
234
  export interface CloseOptions {
243
235
  stopProcesses?: boolean;
244
236
  }
245
- export type ExistingAppInput = Record<string, any> & {
246
- id: string;
247
- cwd: string;
248
- };
249
237
  export interface StartOptions {
250
238
  automatic?: boolean;
251
239
  }
@@ -28,12 +28,8 @@ Apps public service, or reimplements release and deployment behavior.
28
28
  ## Current release boundary
29
29
 
30
30
  Shell imports Apps and mounts its HTTP/MCP adapters in composed and development
31
- hosts. In the signed machine host, Apps is initialized lazily when its selected
32
- Toolbox route is invoked. The current signed service catalog still names Core,
33
- Files, Agents, Tools, and Chat; a package dependency or mounted route is not by
34
- itself admission as an independently booted signed service.
35
-
36
- ## Engine evidence
37
-
38
- Legacy `/apps`, `/artifacts`, app-ref, and migration shapes may be compared with
39
- Engine read-only. Engine never runs beside Shell and is never a fallback.
31
+ hosts. In the signed machine host, the runtime boots the Apps service when it
32
+ starts, so apps that should be running resume without waiting for a tool call.
33
+ The current signed service catalog still names Core, Files, Agents, Tools, and
34
+ Chat; a package dependency or mounted route is not by itself admission as an
35
+ independently booted signed service.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amalgm/apps",
3
- "version": "0.1.3-preview.34549838332",
3
+ "version": "0.1.3-preview.34562094191",
4
4
  "description": "Local-first, versioned application deployment for Amalgm.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -89,11 +89,11 @@
89
89
  "package.json"
90
90
  ]
91
91
  },
92
- "gitHead": "95b55594256877bb64fc2e76179955b307525842",
92
+ "gitHead": "62edf089a80bff8c4ac06371296846ff1b1e86a2",
93
93
  "amalgmSource": {
94
94
  "repository": "amalgm-inc/amalgm-apps",
95
95
  "branch": "preview",
96
- "commit": "95b55594256877bb64fc2e76179955b307525842",
97
- "occurrence": "34549838332"
96
+ "commit": "62edf089a80bff8c4ac06371296846ff1b1e86a2",
97
+ "occurrence": "34562094191"
98
98
  }
99
99
  }
@@ -17,7 +17,7 @@ npm install @amalgm/apps
17
17
 
18
18
  The package exposes four entry points, so you only import what your integration needs:
19
19
 
20
- - `@amalgm/apps` — the full SDK: the `Apps` service class, `defaultStateDir`, `runCli`, manifest helpers (`readManifest`, `normalizeManifest`), package helpers (`inspectPackage`, `packPackage`, `unpackPackage`, `validatePackageFiles`, `materialize`), and MCP factories (`createMcpTools`, `createMcpServer`).
20
+ - `@amalgm/apps` — the full SDK: the `Apps` service class, the command surface (`createAppCommands`, `appCommandDefinitions`), `runCli`, `unpackPackage`, and MCP factories (`createMcpTools`, `createMcpServer`).
21
21
  - `@amalgm/apps/lease` — the tiny client your *hosted app* imports to announce health: `connect`, `ready`, `heartbeat`, `grants`, `isManaged`. Zero configuration; inert outside Amalgm.
22
22
  - `@amalgm/apps/http` — `createAppsHttpServer`, a read-only HTTP catalog of your apps for dashboards and embedders.
23
23
  - `@amalgm/apps/mcp` — the MCP tool definitions alone, for hosts that assemble their own MCP server.
@@ -1,4 +0,0 @@
1
- import type { Apps } from './apps.js';
2
- import type { AppView, ExistingAppInput } from './types.js';
3
- declare function importExisting(apps: Apps, input: ExistingAppInput): Promise<AppView>;
4
- export { importExisting };
@@ -1,77 +0,0 @@
1
- import path from 'node:path';
2
- import { allocatePort, allocateRef, assertAppRef } from './identity.js';
3
- import { normalizeManifest, readManifest } from './manifest.js';
4
- import { processIdentity } from './process.js';
5
- import { errorMessage } from './boundaries.js';
6
- function sourceManifest(input, cwd) {
7
- try {
8
- return readManifest(cwd);
9
- }
10
- catch (error) {
11
- if (!input.startCommand && !input.start_command)
12
- throw error;
13
- return normalizeManifest({
14
- schemaVersion: 1,
15
- name: input.name || input.id,
16
- description: input.description || '',
17
- buildCommand: input.buildCommand || input.build_command || null,
18
- startCommand: input.startCommand || input.start_command,
19
- toolIds: input.toolIds || input.tool_ids || [],
20
- package: { include: ['**'], exclude: [] },
21
- });
22
- }
23
- }
24
- async function importExisting(apps, input) {
25
- if (!input?.id || !input?.cwd)
26
- throw new Error('Existing app id and cwd are required');
27
- const existing = apps.store.getApp(input.id);
28
- if (existing)
29
- return apps.view(existing);
30
- const cwd = path.resolve(input.cwd);
31
- const manifest = sourceManifest(input, cwd);
32
- const appRef = assertAppRef(input.appRef || input.app_ref || allocateRef(apps.store));
33
- const now = new Date().toISOString();
34
- let app = apps.store.createApp({
35
- id: input.id,
36
- name: input.name || manifest.name,
37
- description: input.description || manifest.description,
38
- appRef,
39
- publicUrl: input.publicUrl || input.appUrl || `https://${appRef}.${apps.domain}/`,
40
- port: allocatePort(apps.store, input.port, apps.portMin, apps.portMax),
41
- sourceDir: cwd,
42
- dataDir: path.join(apps.stateDir, 'data', input.id),
43
- desiredState: input.desiredState || (input.status === 'stopped' ? 'stopped' : 'running'),
44
- status: 'registered',
45
- dnsConnected: input.dnsConnected !== false,
46
- autostart: input.autostart !== false,
47
- keepAlive: input.keepAlive !== false,
48
- createdAt: input.createdAt || now,
49
- updatedAt: now,
50
- });
51
- try {
52
- const release = await apps.releases.prepare(app, cwd, manifest);
53
- const deployment = await apps.releases.createDeployment(app, release, 'import');
54
- apps.store.activate(app.id, deployment.id);
55
- if (input.pid && await processIdentity(input.pid)) {
56
- app = apps.store.updateApp(app.id, {
57
- pid: input.pid,
58
- status: input.status === 'unresponsive' ? 'unresponsive' : 'running',
59
- desiredState: 'running',
60
- });
61
- }
62
- else if (app.desiredState === 'running') {
63
- app = await apps.supervisor.start(app.id);
64
- }
65
- else {
66
- app = apps.store.updateApp(app.id, { status: 'stopped', pid: null });
67
- }
68
- return apps.view(app);
69
- }
70
- catch (error) {
71
- apps.store.deleteApp(input.id);
72
- apps.removeAppFiles(input.id);
73
- throw new Error(`Existing app import failed: ${errorMessage(error)}`);
74
- }
75
- }
76
- export { importExisting };
77
- //# sourceMappingURL=source-import.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-import.js","sourceRoot":"","sources":["../src/source-import.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,SAAS,cAAc,CAAC,KAAuB,EAAE,GAAW;IAC1D,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAA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for
4
- legacy request shapes, migrations, and parity vectors. It is not a runtime
5
- composer, source-flow destination, generated-product host, or fallback for
6
- `@amalgm/apps`.
7
-
8
- The former workflow copied generated Apps output into Engine. That workflow is
9
- retired: product changes begin and remain in this repository, and active
10
- machine composition uses the published package through `@amalgm/shell`.
11
-
12
- See [SHELL_INTEGRATION.md](./SHELL_INTEGRATION.md) for the current boundary.