@adhdev/daemon-core 0.8.77 → 0.8.79
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/dist/index.d.ts +2 -1
- package/dist/index.js +30 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -11
- package/dist/index.mjs.map +1 -1
- package/dist/logging/command-log.d.ts +1 -0
- package/dist/session-host/app-name.d.ts +9 -0
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/logging/command-log.ts +7 -1
- package/src/session-host/app-name.ts +33 -11
package/dist/index.d.ts
CHANGED
|
@@ -91,7 +91,8 @@ export { NodePtyTransportFactory } from './cli-adapters/pty-transport.js';
|
|
|
91
91
|
export type { PtyRuntimeTransport, PtyTransportFactory, PtySpawnOptions } from './cli-adapters/pty-transport.js';
|
|
92
92
|
export { SessionHostPtyTransportFactory } from './cli-adapters/session-host-transport.js';
|
|
93
93
|
export type { HostedCliRuntimeDescriptor, CliTransportFactoryParams } from './commands/cli-manager.js';
|
|
94
|
-
export { DEFAULT_SESSION_HOST_APP_NAME, DEFAULT_STANDALONE_SESSION_HOST_APP_NAME, resolveSessionHostAppName, } from './session-host/app-name.js';
|
|
94
|
+
export { DEFAULT_SESSION_HOST_APP_NAME, DEFAULT_STANDALONE_SESSION_HOST_APP_NAME, resolveSessionHostAppName, resolveSessionHostAppNameResolution, } from './session-host/app-name.js';
|
|
95
|
+
export type { SessionHostAppNameResolution } from './session-host/app-name.js';
|
|
95
96
|
export { ensureSessionHostReady, listHostedCliRuntimes } from './session-host/runtime-support.js';
|
|
96
97
|
export { getSessionHostRecoveryLabel, getSessionHostSurfaceKind, isSessionHostLiveRuntime, isSessionHostRecoverySnapshot, partitionSessionHostDiagnosticsSessions, partitionSessionHostRecords, } from './session-host/runtime-surface.js';
|
|
97
98
|
export type { SessionHostSurfaceKind, SessionHostSurfaceRecordLike } from './session-host/runtime-surface.js';
|
package/dist/index.js
CHANGED
|
@@ -3667,6 +3667,7 @@ __export(index_exports, {
|
|
|
3667
3667
|
resolveChatMessageKind: () => resolveChatMessageKind,
|
|
3668
3668
|
resolveDebugRuntimeConfig: () => resolveDebugRuntimeConfig,
|
|
3669
3669
|
resolveSessionHostAppName: () => resolveSessionHostAppName,
|
|
3670
|
+
resolveSessionHostAppNameResolution: () => resolveSessionHostAppNameResolution,
|
|
3670
3671
|
runAsyncBatch: () => runAsyncBatch,
|
|
3671
3672
|
saveConfig: () => saveConfig,
|
|
3672
3673
|
saveState: () => saveState,
|
|
@@ -16481,10 +16482,15 @@ function checkSize() {
|
|
|
16481
16482
|
}
|
|
16482
16483
|
var SKIP_COMMANDS = /* @__PURE__ */ new Set([
|
|
16483
16484
|
"heartbeat",
|
|
16484
|
-
"status_report"
|
|
16485
|
+
"status_report",
|
|
16486
|
+
"read_chat",
|
|
16487
|
+
"mark_session_seen"
|
|
16485
16488
|
]);
|
|
16489
|
+
function shouldLogCommand(cmd) {
|
|
16490
|
+
return !SKIP_COMMANDS.has(cmd);
|
|
16491
|
+
}
|
|
16486
16492
|
function logCommand(entry) {
|
|
16487
|
-
if (
|
|
16493
|
+
if (!shouldLogCommand(entry.cmd)) return;
|
|
16488
16494
|
try {
|
|
16489
16495
|
if (++writeCount2 % 500 === 0) {
|
|
16490
16496
|
checkRotation();
|
|
@@ -24962,20 +24968,32 @@ var SessionHostPtyTransportFactory = class {
|
|
|
24962
24968
|
// src/session-host/app-name.ts
|
|
24963
24969
|
var DEFAULT_SESSION_HOST_APP_NAME = "adhdev";
|
|
24964
24970
|
var DEFAULT_STANDALONE_SESSION_HOST_APP_NAME = "adhdev-standalone";
|
|
24965
|
-
function
|
|
24966
|
-
|
|
24967
|
-
throw new Error(
|
|
24968
|
-
`Standalone session-host namespace '${DEFAULT_SESSION_HOST_APP_NAME}' is reserved for the global daemon. Use '${DEFAULT_STANDALONE_SESSION_HOST_APP_NAME}' or another non-default namespace.`
|
|
24969
|
-
);
|
|
24971
|
+
function getReservedStandaloneNamespaceWarning() {
|
|
24972
|
+
return `Standalone session-host namespace '${DEFAULT_SESSION_HOST_APP_NAME}' is reserved for the global daemon. Falling back to '${DEFAULT_STANDALONE_SESSION_HOST_APP_NAME}' for this standalone run.`;
|
|
24970
24973
|
}
|
|
24971
|
-
function
|
|
24974
|
+
function resolveSessionHostAppNameResolution(options = {}) {
|
|
24972
24975
|
const env = options.env || process.env;
|
|
24973
24976
|
const explicit = typeof env.ADHDEV_SESSION_HOST_NAME === "string" ? env.ADHDEV_SESSION_HOST_NAME.trim() : "";
|
|
24974
24977
|
if (explicit) {
|
|
24975
|
-
if (options.standalone
|
|
24976
|
-
|
|
24978
|
+
if (options.standalone && explicit === DEFAULT_SESSION_HOST_APP_NAME) {
|
|
24979
|
+
return {
|
|
24980
|
+
appName: DEFAULT_STANDALONE_SESSION_HOST_APP_NAME,
|
|
24981
|
+
warning: getReservedStandaloneNamespaceWarning(),
|
|
24982
|
+
source: "reserved-standalone-fallback"
|
|
24983
|
+
};
|
|
24984
|
+
}
|
|
24985
|
+
return {
|
|
24986
|
+
appName: explicit,
|
|
24987
|
+
source: "explicit"
|
|
24988
|
+
};
|
|
24977
24989
|
}
|
|
24978
|
-
return
|
|
24990
|
+
return {
|
|
24991
|
+
appName: options.standalone ? DEFAULT_STANDALONE_SESSION_HOST_APP_NAME : DEFAULT_SESSION_HOST_APP_NAME,
|
|
24992
|
+
source: "default"
|
|
24993
|
+
};
|
|
24994
|
+
}
|
|
24995
|
+
function resolveSessionHostAppName(options = {}) {
|
|
24996
|
+
return resolveSessionHostAppNameResolution(options).appName;
|
|
24979
24997
|
}
|
|
24980
24998
|
|
|
24981
24999
|
// src/session-host/runtime-support.ts
|
|
@@ -25636,6 +25654,7 @@ async function shutdownDaemonComponents(components) {
|
|
|
25636
25654
|
resolveChatMessageKind,
|
|
25637
25655
|
resolveDebugRuntimeConfig,
|
|
25638
25656
|
resolveSessionHostAppName,
|
|
25657
|
+
resolveSessionHostAppNameResolution,
|
|
25639
25658
|
runAsyncBatch,
|
|
25640
25659
|
saveConfig,
|
|
25641
25660
|
saveState,
|