@agentconnect.md/daemon 1.0.0-rc.160 → 1.0.0-rc.162
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.js +16 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12853,6 +12853,7 @@ const AuthOk = object({
|
|
|
12853
12853
|
heartbeatSec: number().int(),
|
|
12854
12854
|
serverTime: string().datetime(),
|
|
12855
12855
|
webAppUrl: string().optional(),
|
|
12856
|
+
orgSlug: string().optional(),
|
|
12856
12857
|
resume: object({ accepted: boolean() }).optional()
|
|
12857
12858
|
});
|
|
12858
12859
|
//#endregion
|
|
@@ -83753,6 +83754,7 @@ var CpClient = class {
|
|
|
83753
83754
|
this.deps.onDaemonId?.(ok.daemonId);
|
|
83754
83755
|
}
|
|
83755
83756
|
this.deps.onWebAppUrl?.(ok.webAppUrl);
|
|
83757
|
+
this.deps.onOrgSlug?.(ok.orgSlug);
|
|
83756
83758
|
this.state = "REGISTERING";
|
|
83757
83759
|
const snap = (await this.request("register", {
|
|
83758
83760
|
host: this.deps.host,
|
|
@@ -86001,11 +86003,17 @@ var Daemon = class Daemon {
|
|
|
86001
86003
|
/** Web App console base URL the CP sent on `auth/ok` (its own console origin). A local
|
|
86002
86004
|
* `webAppUrl` config overrides it; undefined until auth completes / if neither is set. */
|
|
86003
86005
|
cpWebAppUrl;
|
|
86004
|
-
/**
|
|
86005
|
-
*
|
|
86006
|
-
*
|
|
86006
|
+
/** Slug of the org this daemon belongs to, from `auth/ok` — the console is org-scoped, so
|
|
86007
|
+
* it's the `<orgSlug>` segment of a session deep link. Undefined off a CP (local run) or
|
|
86008
|
+
* when the CP couldn't resolve it; then the segment is dropped. */
|
|
86009
|
+
cpOrgSlug;
|
|
86010
|
+
/** The Web App console URL for a session: `<base>/<orgSlug>/sessions/<id>`, where base is
|
|
86011
|
+
* the explicit local `webAppUrl`, else the CP-provided origin, else the public default
|
|
86012
|
+
* (`DEFAULT_WEB_APP_URL`). The console is org-scoped, so the org slug is inserted when
|
|
86013
|
+
* known; without it the link falls back to `<base>/sessions/<id>`. Always resolves, so
|
|
86014
|
+
* the View-session link is always available. */
|
|
86007
86015
|
sessionLink(acpSessionId) {
|
|
86008
|
-
return `${(this.cfg.webAppUrl ?? this.cpWebAppUrl ?? DEFAULT_WEB_APP_URL).replace(/\/$/, "")}/sessions/${acpSessionId}`;
|
|
86016
|
+
return `${(this.cfg.webAppUrl ?? this.cpWebAppUrl ?? DEFAULT_WEB_APP_URL).replace(/\/$/, "")}${this.cpOrgSlug ? `/${encodeURIComponent(this.cpOrgSlug)}` : ""}/sessions/${acpSessionId}`;
|
|
86009
86017
|
}
|
|
86010
86018
|
/** Assemble a status snapshot from the parts (agent config + host model selector +
|
|
86011
86019
|
* folded ACP usage). Shared by `buildStatusInfo` (per-turn Pending) and
|
|
@@ -86594,6 +86602,10 @@ var Daemon = class Daemon {
|
|
|
86594
86602
|
this.cpWebAppUrl = url;
|
|
86595
86603
|
if (url) this.log.debug(`cp: web app url ${url} (session deep links)`);
|
|
86596
86604
|
},
|
|
86605
|
+
onOrgSlug: (slug) => {
|
|
86606
|
+
this.cpOrgSlug = slug;
|
|
86607
|
+
if (slug) this.log.debug(`cp: org slug "${slug}" (session deep links)`);
|
|
86608
|
+
},
|
|
86597
86609
|
agentVersion: DAEMON_VERSION,
|
|
86598
86610
|
host: hostname(),
|
|
86599
86611
|
heartbeatDefaultMs: cp.heartbeatMs,
|