@mycadet/cli 0.13.0-dev.202611131045.a556a8a → 0.13.0-dev.202611140220.fac72d3
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/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/avatar-manifest/package.json +1 -1
- package/node_modules/@mycadet/environments/package.json +1 -1
- package/node_modules/@mycadet/ipc-server-utils/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/avatar-manifest/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/environments/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/ipc-server-utils/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/shared/package.json +1 -1
- package/node_modules/@mycadet/local-mode/package.json +1 -1
- package/node_modules/@mycadet/local-mode/src/__tests__/hatch-config.test.ts +110 -99
- package/node_modules/@mycadet/local-mode/src/__tests__/{hatch-local-overlay.test.ts → hatch-local-config-api.test.ts} +60 -50
- package/node_modules/@mycadet/local-mode/src/__tests__/local-exec-invocation.test.ts +15 -5
- package/node_modules/@mycadet/local-mode/src/__tests__/teleport-init.test.ts +1 -8
- package/node_modules/@mycadet/local-mode/src/index.ts +3 -9
- package/node_modules/@mycadet/local-mode/src/remotes/docker/hatch.ts +15 -48
- package/node_modules/@mycadet/local-mode/src/remotes/local/common.ts +82 -40
- package/node_modules/@mycadet/local-mode/src/remotes/local/exec.ts +8 -61
- package/node_modules/@mycadet/local-mode/src/remotes/local/hatch-config.ts +71 -44
- package/node_modules/@mycadet/local-mode/src/remotes/local/hatch.ts +15 -8
- package/node_modules/@mycadet/local-mode/src/remotes/local/teleport.ts +5 -13
- package/node_modules/@mycadet/local-mode/src/remotes/local/wake.ts +10 -38
- package/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/shared/package.json +1 -1
- package/package.json +1 -1
|
@@ -11,23 +11,16 @@ import { saveLockfileAssistant } from "../../lockfile";
|
|
|
11
11
|
import { healConflictedLocalPorts } from "./port-heal";
|
|
12
12
|
import { getDaemonPidPath } from "./instance";
|
|
13
13
|
import { startCes, startGateway, startLocalDaemon } from "./common";
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
import type { WakeResult } from "../../operations/wake";
|
|
16
16
|
|
|
17
17
|
export async function wakeLocal(
|
|
18
18
|
entry: LockfileAssistant,
|
|
19
|
-
opts: {
|
|
20
|
-
watch?: boolean;
|
|
21
|
-
/** The hatch's fresh-daemon first-boot workspace config (a temp file — CLI-internal, never a route surface). */
|
|
22
|
-
defaultWorkspaceConfigPath?: string;
|
|
23
|
-
} = {},
|
|
19
|
+
opts: { watch?: boolean } = {},
|
|
24
20
|
): Promise<WakeResult> {
|
|
25
|
-
const { watch = false
|
|
21
|
+
const { watch = false } = opts;
|
|
26
22
|
try {
|
|
27
|
-
return await wakeLocalUnchecked(entry, {
|
|
28
|
-
watch,
|
|
29
|
-
defaultWorkspaceConfigPath,
|
|
30
|
-
});
|
|
23
|
+
return await wakeLocalUnchecked(entry, { watch });
|
|
31
24
|
} catch (err) {
|
|
32
25
|
return {
|
|
33
26
|
ok: false,
|
|
@@ -44,12 +37,9 @@ export async function wakeLocal(
|
|
|
44
37
|
*/
|
|
45
38
|
async function wakeLocalUnchecked(
|
|
46
39
|
entry: LockfileAssistant,
|
|
47
|
-
opts: {
|
|
48
|
-
watch: boolean;
|
|
49
|
-
defaultWorkspaceConfigPath?: string;
|
|
50
|
-
},
|
|
40
|
+
opts: { watch: boolean },
|
|
51
41
|
): Promise<WakeResult> {
|
|
52
|
-
const { watch
|
|
42
|
+
const { watch } = opts;
|
|
53
43
|
if (!isLocalEntry(entry)) {
|
|
54
44
|
throw new WakeRefused(
|
|
55
45
|
`'${entry.assistantId}' is not an on-machine assistant.`,
|
|
@@ -57,10 +47,7 @@ async function wakeLocalUnchecked(
|
|
|
57
47
|
}
|
|
58
48
|
|
|
59
49
|
try {
|
|
60
|
-
return await wakeLocalSteps(entry, {
|
|
61
|
-
watch,
|
|
62
|
-
defaultWorkspaceConfigPath,
|
|
63
|
-
});
|
|
50
|
+
return await wakeLocalSteps(entry, { watch });
|
|
64
51
|
} catch (err) {
|
|
65
52
|
if (err instanceof WakeRefused) {
|
|
66
53
|
return { ok: false, status: 400, error: err.message };
|
|
@@ -71,22 +58,9 @@ async function wakeLocalUnchecked(
|
|
|
71
58
|
|
|
72
59
|
async function wakeLocalSteps(
|
|
73
60
|
entry: LocalAssistant,
|
|
74
|
-
opts: {
|
|
75
|
-
watch: boolean;
|
|
76
|
-
defaultWorkspaceConfigPath?: string;
|
|
77
|
-
},
|
|
61
|
+
opts: { watch: boolean },
|
|
78
62
|
): Promise<WakeResult> {
|
|
79
|
-
const { watch
|
|
80
|
-
|
|
81
|
-
// Refresh the instance's bin/ shims first: they bake the source entries
|
|
82
|
-
// this wake is about to run, and an upgrade that just installed a new
|
|
83
|
-
// runtime must never leave exec resolving the previous one. Best-effort —
|
|
84
|
-
// a shim that cannot resolve just stays absent (exec reports it).
|
|
85
|
-
try {
|
|
86
|
-
ensureLocalBinShims(entry);
|
|
87
|
-
} catch {
|
|
88
|
-
// shim materialization never blocks a wake
|
|
89
|
-
}
|
|
63
|
+
const { watch } = opts;
|
|
90
64
|
|
|
91
65
|
const basePorts = getDefaultPorts();
|
|
92
66
|
const daemonPort = await findAvailablePort(basePorts.daemon);
|
|
@@ -120,9 +94,7 @@ async function wakeLocalSteps(
|
|
|
120
94
|
// longer.
|
|
121
95
|
await Promise.all([
|
|
122
96
|
startCes(watch, entry),
|
|
123
|
-
startLocalDaemon(watch, entry,
|
|
124
|
-
defaultWorkspaceConfigPath,
|
|
125
|
-
}),
|
|
97
|
+
startLocalDaemon(watch, entry),
|
|
126
98
|
startGateway(watch, entry),
|
|
127
99
|
]);
|
|
128
100
|
|