@agimon-ai/po-core 0.0.0-alpha.101 → 0.0.0-alpha.103
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/headlessHub.cjs +17 -3
- package/dist/headlessHub.cjs.map +1 -1
- package/dist/headlessHub.mjs +17 -3
- package/dist/headlessHub.mjs.map +1 -1
- package/dist/headlessServer.cjs +1 -1
- package/dist/headlessServer.cjs.map +1 -1
- package/dist/headlessServer.mjs +1 -1
- package/dist/headlessServer.mjs.map +1 -1
- package/dist/packageApiServer.cjs +4 -2
- package/dist/packageApiServer.cjs.map +1 -1
- package/dist/packageApiServer.mjs +4 -2
- package/dist/packageApiServer.mjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.cjs +17 -2
- package/dist/src/services/piExtensionHost/index.cjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.d.mts +2 -0
- package/dist/src/services/piExtensionHost/index.d.mts.map +1 -1
- package/dist/src/services/piExtensionHost/index.mjs +17 -2
- package/dist/src/services/piExtensionHost/index.mjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs +24 -12
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs +24 -12
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -1
- package/package.json +4 -4
package/dist/headlessHub.cjs
CHANGED
|
@@ -76,7 +76,20 @@ function scopeOf(session) {
|
|
|
76
76
|
}
|
|
77
77
|
/** Owns direct, same-process session and channel state for presentation adapters. */
|
|
78
78
|
function createHeadlessHub(options) {
|
|
79
|
-
const
|
|
79
|
+
const gitReads = /* @__PURE__ */ new Set();
|
|
80
|
+
const readGitStatus = (cwd, shell, environment) => {
|
|
81
|
+
for (const read of gitReads) if (read.cwd === cwd && read.shell === shell && read.environment === environment) return read.promise;
|
|
82
|
+
const promise = Promise.resolve().then(() => options.readGitStatus ? options.readGitStatus(cwd) : require_index$2.readSessionGitStatus(shell, cwd));
|
|
83
|
+
const read = {
|
|
84
|
+
cwd,
|
|
85
|
+
shell,
|
|
86
|
+
environment,
|
|
87
|
+
promise
|
|
88
|
+
};
|
|
89
|
+
gitReads.add(read);
|
|
90
|
+
promise.finally(() => gitReads.delete(read)).catch(() => {});
|
|
91
|
+
return promise;
|
|
92
|
+
};
|
|
80
93
|
const sessions = /* @__PURE__ */ new Map();
|
|
81
94
|
const pendingSetups = /* @__PURE__ */ new Map();
|
|
82
95
|
const activities = /* @__PURE__ */ new Map();
|
|
@@ -746,9 +759,10 @@ function createHeadlessHub(options) {
|
|
|
746
759
|
sessions.set(session.id, current);
|
|
747
760
|
announceCommunicationReady(session.id);
|
|
748
761
|
const sandboxed = session.workspaceId !== void 0 && workspaces.get(session.workspaceId)?.sandbox !== void 0;
|
|
762
|
+
const gitShell = sandboxed ? void 0 : options.platform.env(session.cwd);
|
|
749
763
|
const refreshGit = () => {
|
|
750
|
-
if (
|
|
751
|
-
readGitStatus(session.cwd).then((git) => {
|
|
764
|
+
if (gitShell === void 0) return;
|
|
765
|
+
readGitStatus(session.cwd, gitShell, session.environment).then((git) => {
|
|
752
766
|
if (closed || sessions.get(session.id)?.host !== session.host) return;
|
|
753
767
|
if (git?.branch === current.git?.branch && git?.dirty === current.git?.dirty) return;
|
|
754
768
|
const { git: _previous, ...rest } = current;
|