openmeld 0.3.189 → 0.3.190

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 (30) hide show
  1. package/dist/{add-me-membership-4FSvQfCU.js → add-me-membership-BenkUGu-.js} +2 -2
  2. package/dist/{add-me-membership-4FSvQfCU.js.map → add-me-membership-BenkUGu-.js.map} +1 -1
  3. package/dist/{api-client-foundation-MsDmBsQ7.js → api-client-foundation-BQCtnjoZ.js} +2 -2
  4. package/dist/{api-client-foundation-MsDmBsQ7.js.map → api-client-foundation-BQCtnjoZ.js.map} +1 -1
  5. package/dist/{api-client-foundation-Dqrtnv-c.js → api-client-foundation-B_j7MrPg.js} +1 -1
  6. package/dist/{command-CbW36uDg.js → command-MGSPy6o5.js} +50 -28
  7. package/dist/command-MGSPy6o5.js.map +1 -0
  8. package/dist/{dist-C9GguxOC.js → dist-BMd3PLFt.js} +2 -1
  9. package/dist/dist-BMd3PLFt.js.map +1 -0
  10. package/dist/{dist-FbJD1l75.js → dist-DGAEm1uZ.js} +1 -1
  11. package/dist/{elapsed-time-CiC_hWDp.js → elapsed-time-Dh1RJ98-.js} +11 -6
  12. package/dist/elapsed-time-Dh1RJ98-.js.map +1 -0
  13. package/dist/{installer-BdECBoja.js → installer-CR6lINDK.js} +2 -2
  14. package/dist/{installer-BdECBoja.js.map → installer-CR6lINDK.js.map} +1 -1
  15. package/dist/{openmeld-B0jozMAE.js → openmeld-DVgJH9R9.js} +9 -9
  16. package/dist/{openmeld-B0jozMAE.js.map → openmeld-DVgJH9R9.js.map} +1 -1
  17. package/dist/{openmeld-maintenance-worker-B90pIDzd.js → openmeld-maintenance-worker-BhcxpNv2.js} +3 -3
  18. package/dist/{openmeld-maintenance-worker-B90pIDzd.js.map → openmeld-maintenance-worker-BhcxpNv2.js.map} +1 -1
  19. package/dist/{openmeld-tools-update-coordinator-DjrzbnqH.js → openmeld-tools-update-coordinator-D5jLYm-P.js} +10 -7
  20. package/dist/openmeld-tools-update-coordinator-D5jLYm-P.js.map +1 -0
  21. package/dist/openmeld.js +3 -3
  22. package/dist/{upgrade-5UL_FZR0.js → upgrade-ivCR1Vnn.js} +3 -3
  23. package/dist/{upgrade-5UL_FZR0.js.map → upgrade-ivCR1Vnn.js.map} +1 -1
  24. package/dist/upgrade-ogfVZY1d.js +4 -0
  25. package/package.json +1 -1
  26. package/dist/command-CbW36uDg.js.map +0 -1
  27. package/dist/dist-C9GguxOC.js.map +0 -1
  28. package/dist/elapsed-time-CiC_hWDp.js.map +0 -1
  29. package/dist/openmeld-tools-update-coordinator-DjrzbnqH.js.map +0 -1
  30. package/dist/upgrade-eQBz5dR5.js +0 -4
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { r as runSpaceAddMembers } from "./command-CbW36uDg.js";
3
+ import { r as runSpaceAddMembers } from "./command-MGSPy6o5.js";
4
4
  //#region src/space/add-me-membership.ts
5
5
  async function runSpaceAddMeMembership(input) {
6
6
  return await runSpaceAddMembers(input);
@@ -8,4 +8,4 @@ async function runSpaceAddMeMembership(input) {
8
8
  //#endregion
9
9
  export { runSpaceAddMeMembership };
10
10
 
11
- //# sourceMappingURL=add-me-membership-4FSvQfCU.js.map
11
+ //# sourceMappingURL=add-me-membership-BenkUGu-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-me-membership-4FSvQfCU.js","names":[],"sources":["../src/space/add-me-membership.ts"],"sourcesContent":["import { runSpaceAddMembers } from \"./command\";\nimport type { SpaceCommandNavigationStatus } from \"./navigation-status\";\n\nexport type SpaceAddMeMembershipInput = Parameters<\n typeof runSpaceAddMembers\n>[0];\nexport type SpaceAddMeMembershipRunner = (\n input: SpaceAddMeMembershipInput\n) => Promise<SpaceCommandNavigationStatus>;\n\nexport async function runSpaceAddMeMembership(\n input: SpaceAddMeMembershipInput\n): Promise<SpaceCommandNavigationStatus> {\n return await runSpaceAddMembers(input);\n}\n"],"mappings":";;;;AAUA,eAAsB,wBACpB,OACuC;CACvC,OAAO,MAAM,mBAAmB,KAAK;AACvC"}
1
+ {"version":3,"file":"add-me-membership-BenkUGu-.js","names":[],"sources":["../src/space/add-me-membership.ts"],"sourcesContent":["import { runSpaceAddMembers } from \"./command\";\nimport type { SpaceCommandNavigationStatus } from \"./navigation-status\";\n\nexport type SpaceAddMeMembershipInput = Parameters<\n typeof runSpaceAddMembers\n>[0];\nexport type SpaceAddMeMembershipRunner = (\n input: SpaceAddMeMembershipInput\n) => Promise<SpaceCommandNavigationStatus>;\n\nexport async function runSpaceAddMeMembership(\n input: SpaceAddMeMembershipInput\n): Promise<SpaceCommandNavigationStatus> {\n return await runSpaceAddMembers(input);\n}\n"],"mappings":";;;;AAUA,eAAsB,wBACpB,OACuC;CACvC,OAAO,MAAM,mBAAmB,KAAK;AACvC"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { t as normalizeBaseUrl } from "./urls-4D7CaXe3.js";
4
4
  import { t as isLoopbackHostname } from "./loopback-hostname-DHQPKq8N.js";
5
- import { Gt as createOpenMeldApiClient, Mn as buildOpenMeldRequestContextHeaders, kn as OPENMELD_HEADER_REQUESTED_ORGANIZATION_ID } from "./dist-C9GguxOC.js";
5
+ import { Gt as createOpenMeldApiClient, Mn as buildOpenMeldRequestContextHeaders, kn as OPENMELD_HEADER_REQUESTED_ORGANIZATION_ID } from "./dist-BMd3PLFt.js";
6
6
  import { M as MAX_SPACE_REQUEST_TIMEOUT_MS, P as MIN_SPACE_REQUEST_TIMEOUT_MS, b as resolveAuthSessionExpiryEligibility, k as DEFAULT_SPACE_REQUEST_TIMEOUT_MS, l as getAuthSessionState } from "./auth-session-BBUxZl0r.js";
7
7
  import crypto from "node:crypto";
8
8
  //#region src/config/auth-request-compatibility.ts
@@ -442,4 +442,4 @@ function createCliApiClientFoundation(baseUrl, options = {}) {
442
442
  //#endregion
443
443
  export { buildOpenMeldProfileIdentityRequestHeadersWithAuth as a, buildRequestAuthHeaders as c, buildOpenMeldRequestContextFromProfileIdentity as d, deriveAuthBaseUrlFromGatewayUrl as f, AuthRequestCredentialError as i, canAttachAuthTokenToRequest as l, fetchSpaceRequestWithTimeout as n, buildOpenMeldProfileRequestHeadersWithAuth as o, resolveAuthRequestCompatibility as p, resolveSpaceRequestTimeoutMsForDiagnostics as r, buildOpenMeldRequestContextHeadersWithAuth as s, createCliApiClientFoundation as t, buildOpenMeldRequestContextFromProfile as u };
444
444
 
445
- //# sourceMappingURL=api-client-foundation-MsDmBsQ7.js.map
445
+ //# sourceMappingURL=api-client-foundation-BQCtnjoZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-client-foundation-MsDmBsQ7.js","names":["resolveSpaceRequestTimeoutMsForDiagnostics","resolveSpaceRequestTimeoutMsForCliDiagnostics"],"sources":["../src/config/auth-request-compatibility.ts","../src/config/openmeld-request-context.ts","../src/config/request-headers.ts","../src/space/request-timeout.ts","../src/space/fetch-with-timeout.ts","../src/space/api-client-foundation.ts"],"sourcesContent":["import { normalizeBaseUrl } from \"../protocol/urls\";\nimport type { StoredAuthSession } from \"./auth-session\";\nimport { isLoopbackHostname } from \"./loopback-hostname\";\n\nexport type AuthRequestCompatibilityReason =\n | \"invalid_request_url\"\n | \"invalid_auth_url\"\n | \"insecure_transport\"\n | \"host_mismatch\"\n | \"loopback\"\n | \"same_host\"\n | \"gateway_sibling\";\n\nexport type AuthRequestCompatibility = {\n compatible: boolean;\n reason: AuthRequestCompatibilityReason;\n requestHost: string | null;\n authHost: string | null;\n expectedGatewayHost: string | null;\n};\n\nexport function resolveAuthRequestCompatibility(input: {\n session: StoredAuthSession;\n requestUrl: string;\n}): AuthRequestCompatibility {\n const requestUrl = parseUrlOrNull(input.requestUrl);\n if (!requestUrl) {\n return {\n compatible: false,\n reason: \"invalid_request_url\",\n requestHost: null,\n authHost: null,\n expectedGatewayHost: null,\n };\n }\n\n const authBaseUrl = parseUrlOrNull(input.session.authBaseUrl);\n if (!authBaseUrl) {\n return {\n compatible: false,\n reason: \"invalid_auth_url\",\n requestHost: requestUrl.host,\n authHost: null,\n expectedGatewayHost: null,\n };\n }\n\n const expectedGatewayHost = deriveGatewayHost(authBaseUrl);\n const requestHost = requestUrl.host;\n const authHost = authBaseUrl.host;\n\n if (\n (isLoopbackHostname(requestUrl.hostname) &&\n isLoopbackHostname(authBaseUrl.hostname)) ||\n // Isolated worktrees share a hostname across Auth and Gateway ports.\n // Never treat different named localhost lanes as interchangeable.\n (requestUrl.hostname.endsWith(\".localhost\") &&\n requestUrl.hostname === authBaseUrl.hostname &&\n isHttpTransportProtocol(authBaseUrl.protocol) &&\n [\"http:\", \"https:\", \"ws:\", \"wss:\"].includes(requestUrl.protocol))\n ) {\n return {\n compatible: true,\n reason: \"loopback\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n }\n\n if (!isSecureTransportProtocol(requestUrl.protocol)) {\n return {\n compatible: false,\n reason: \"insecure_transport\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n }\n\n if (requestHost === authHost) {\n return {\n compatible: true,\n reason: \"same_host\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n }\n\n if (expectedGatewayHost && requestHost === expectedGatewayHost) {\n return {\n compatible: true,\n reason: \"gateway_sibling\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n }\n\n return {\n compatible: false,\n reason: \"host_mismatch\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n}\n\nexport function deriveAuthBaseUrlFromGatewayUrl(\n gatewayUrl: string\n): string | null {\n const parsed = parseUrlOrNull(gatewayUrl);\n if (!parsed) {\n return null;\n }\n if (!isHttpTransportProtocol(parsed.protocol)) {\n return null;\n }\n if (!parsed.hostname.startsWith(\"gateway.\")) {\n return null;\n }\n\n const authUrl = new URL(parsed.toString());\n authUrl.hostname = `auth.${parsed.hostname.slice(\"gateway.\".length)}`;\n authUrl.pathname = \"/\";\n authUrl.search = \"\";\n authUrl.hash = \"\";\n return normalizeBaseUrl(authUrl.toString());\n}\n\nfunction deriveGatewayHost(authBaseUrl: URL): string | null {\n if (!authBaseUrl.hostname.startsWith(\"auth.\")) {\n return null;\n }\n\n const gatewayUrl = new URL(authBaseUrl.toString());\n gatewayUrl.hostname = `gateway.${authBaseUrl.hostname.slice(\"auth.\".length)}`;\n return gatewayUrl.host;\n}\n\nfunction parseUrlOrNull(value: string): URL | null {\n try {\n return new URL(value);\n } catch {\n return null;\n }\n}\n\nfunction isSecureTransportProtocol(protocol: string): boolean {\n return protocol === \"https:\" || protocol === \"wss:\";\n}\n\nfunction isHttpTransportProtocol(protocol: string): boolean {\n return protocol === \"http:\" || protocol === \"https:\";\n}\n","import crypto from \"node:crypto\";\nimport type { OpenMeldRequestContext } from \"@openmeld/schemas/types\";\nimport type { OpenMeldProfile } from \"./openmeld-profiles-api\";\n\nexport type OpenMeldRequestContextProfileIdentity = {\n openMeldProfileId: string;\n profileKind?: \"human\" | \"agent\" | \"system\";\n kind?: \"human\" | \"agent\";\n profileHandle?: string;\n profileName: string;\n ownerUserId?: string;\n ownerName?: string;\n agentControllerConversationId?: string;\n};\n\nexport function buildOpenMeldRequestContextFromProfile(input: {\n openMeldProfile: OpenMeldProfile;\n requestId?: string;\n agentControllerConversationId?: string;\n}): OpenMeldRequestContext {\n const requestId =\n normalizeOptionalText(input.requestId) ?? crypto.randomUUID();\n const agentControllerConversationId = normalizeOptionalText(\n input.agentControllerConversationId\n );\n const ownerName = normalizeOptionalText(input.openMeldProfile.ownerName);\n\n return {\n actorContext: {\n requestId,\n openMeldProfileId: input.openMeldProfile.openMeldProfileId,\n profileKind: input.openMeldProfile.profileKind,\n profileHandle: input.openMeldProfile.profileHandle,\n profileName: input.openMeldProfile.profileName,\n ownerUserId: input.openMeldProfile.ownerUserId,\n ...(ownerName ? { ownerName } : {}),\n },\n ...(agentControllerConversationId ? { agentControllerConversationId } : {}),\n };\n}\n\nexport function buildOpenMeldRequestContextFromProfileIdentity(input: {\n profileIdentity: OpenMeldRequestContextProfileIdentity;\n requestId?: string;\n}): OpenMeldRequestContext {\n const requestId =\n normalizeOptionalText(input.requestId) ?? crypto.randomUUID();\n const profileHandle = normalizeOptionalText(\n input.profileIdentity.profileHandle\n );\n const ownerUserId = normalizeOptionalText(input.profileIdentity.ownerUserId);\n const ownerName = normalizeOptionalText(input.profileIdentity.ownerName);\n const agentControllerConversationId = normalizeOptionalText(\n input.profileIdentity.agentControllerConversationId\n );\n const profileKind =\n input.profileIdentity.profileKind ??\n (input.profileIdentity.kind === \"human\" ||\n input.profileIdentity.kind === \"agent\"\n ? input.profileIdentity.kind\n : \"system\");\n\n return {\n actorContext: {\n requestId,\n openMeldProfileId: input.profileIdentity.openMeldProfileId,\n profileKind,\n ...(profileHandle ? { profileHandle } : {}),\n profileName: input.profileIdentity.profileName,\n ...(ownerUserId ? { ownerUserId } : {}),\n ...(ownerName ? { ownerName } : {}),\n },\n ...(agentControllerConversationId ? { agentControllerConversationId } : {}),\n };\n}\n\nfunction normalizeOptionalText(value: unknown): string | null {\n const normalized = String(value ?? \"\").trim();\n return normalized.length > 0 ? normalized : null;\n}\n","import {\n buildOpenMeldRequestContextHeaders,\n type OpenMeldRequestContextHeadersInput,\n} from \"@openmeld/gateway-contract\";\nimport type { OpenMeldRequestContext } from \"@openmeld/schemas/types\";\nimport {\n type AuthRequestCompatibilityReason,\n resolveAuthRequestCompatibility,\n} from \"./auth-request-compatibility\";\nimport {\n type AuthSessionStateReasonCode,\n getAuthSessionState,\n type StoredAuthSession,\n} from \"./auth-session\";\nimport { resolveAuthSessionExpiryEligibility } from \"./auth-session-expiry\";\nimport type { OpenMeldProfile } from \"./openmeld-profiles-api\";\nimport {\n buildOpenMeldRequestContextFromProfile,\n buildOpenMeldRequestContextFromProfileIdentity,\n type OpenMeldRequestContextProfileIdentity,\n} from \"./openmeld-request-context\";\n\nconst DEFAULT_TOKEN_TYPE = \"Bearer\";\nconst AUTHORIZATION_HEADER = \"Authorization\";\n\ntype RequestAuthHeadersInput = {\n authSession?: StoredAuthSession | null;\n requestUrl: string;\n};\n\ntype OpenMeldRequestContextHeadersWithAuthInput =\n OpenMeldRequestContextHeadersInput & {\n authSession?: StoredAuthSession | null;\n requestUrl: string;\n };\n\nexport type AuthTokenAttachment =\n | {\n status: \"attachable\";\n token: string;\n tokenType: string;\n }\n | {\n status: \"dropped\";\n reason:\n | \"empty_token\"\n | \"session_expired\"\n | \"session_expiry_invalid\"\n | AuthRequestCompatibilityReason;\n requestHost: string | null;\n authHost: string | null;\n expectedGatewayHost: string | null;\n };\n\nexport type DroppedAuthTokenAttachment = Extract<\n AuthTokenAttachment,\n { status: \"dropped\" }\n>;\n\nexport type AuthRequestCredentialFailureReason =\n | DroppedAuthTokenAttachment[\"reason\"]\n | AuthSessionStateReasonCode\n | \"session_invalid\"\n | \"session_revoked\";\n\nexport class AuthRequestCredentialError extends Error {\n readonly authHost: string | null;\n readonly expectedGatewayHost: string | null;\n readonly reason: AuthRequestCredentialFailureReason;\n readonly requestHost: string | null;\n readonly droppedAttachment?: DroppedAuthTokenAttachment;\n\n constructor(input: {\n authHost: string | null;\n expectedGatewayHost: string | null;\n reason: AuthRequestCredentialFailureReason;\n requestHost: string | null;\n droppedAttachment?: DroppedAuthTokenAttachment;\n }) {\n super(\n `OpenMeld refused to send a request with unusable stored credentials (${input.reason}).`\n );\n this.name = \"AuthRequestCredentialError\";\n this.authHost = input.authHost;\n this.expectedGatewayHost = input.expectedGatewayHost;\n this.reason = input.reason;\n this.requestHost = input.requestHost;\n this.droppedAttachment = input.droppedAttachment;\n }\n}\n\nexport async function buildRequestAuthHeaders(\n input: RequestAuthHeadersInput\n): Promise<Record<string, string>> {\n const headers: Record<string, string> = {};\n await attachAuthHeader(headers, input);\n return headers;\n}\n\nexport async function buildOpenMeldRequestContextHeadersWithAuth(\n input: OpenMeldRequestContextHeadersWithAuthInput\n): Promise<Record<string, string>> {\n const headers = buildOpenMeldRequestContextHeaders(input);\n await attachAuthHeader(headers, input);\n return headers;\n}\n\nexport async function buildOpenMeldProfileRequestHeadersWithAuth(input: {\n openMeldProfile: OpenMeldProfile;\n requestUrl: string;\n authSession?: StoredAuthSession | null;\n agentControllerConversationId?: string;\n spacePassword?: string;\n}): Promise<Record<string, string>> {\n return await buildOpenMeldRequestContextHeadersWithAuth({\n requestContext: buildOpenMeldRequestContextFromProfile({\n openMeldProfile: input.openMeldProfile,\n agentControllerConversationId: input.agentControllerConversationId,\n }),\n requestUrl: input.requestUrl,\n ...(input.authSession === undefined\n ? {}\n : { authSession: input.authSession }),\n ...(input.spacePassword === undefined\n ? {}\n : { spacePassword: input.spacePassword }),\n });\n}\n\nexport async function buildOpenMeldProfileIdentityRequestHeadersWithAuth(input: {\n profileIdentity: OpenMeldRequestContextProfileIdentity;\n requestUrl: string;\n authSession?: StoredAuthSession | null;\n spacePassword?: string;\n}): Promise<Record<string, string>> {\n return await buildOpenMeldRequestContextHeadersWithAuth({\n requestContext: buildOpenMeldRequestContextFromProfileIdentity({\n profileIdentity: input.profileIdentity,\n }),\n requestUrl: input.requestUrl,\n ...(input.authSession === undefined\n ? {}\n : { authSession: input.authSession }),\n ...(input.spacePassword === undefined\n ? {}\n : { spacePassword: input.spacePassword }),\n });\n}\n\nexport function withSpacePassword(\n requestContext: OpenMeldRequestContext,\n spacePassword?: string\n): OpenMeldRequestContextHeadersInput {\n return {\n requestContext,\n ...(spacePassword === undefined ? {} : { spacePassword }),\n };\n}\n\n// One decision for \"can this stored session authenticate this request\", with\n// the drop reason preserved. Header building and the daemon stream connect\n// gate must share this so they cannot drift apart.\nexport function resolveAuthTokenAttachment(input: {\n session: StoredAuthSession;\n requestUrl: string;\n}): AuthTokenAttachment {\n const compatibility = resolveAuthRequestCompatibility({\n session: input.session,\n requestUrl: input.requestUrl,\n });\n const token = normalizeAccessToken(input.session);\n if (!token) {\n return {\n status: \"dropped\",\n reason: \"empty_token\",\n requestHost: compatibility.requestHost,\n authHost: compatibility.authHost,\n expectedGatewayHost: compatibility.expectedGatewayHost,\n };\n }\n if (!compatibility.compatible) {\n return {\n status: \"dropped\",\n reason: compatibility.reason,\n requestHost: compatibility.requestHost,\n authHost: compatibility.authHost,\n expectedGatewayHost: compatibility.expectedGatewayHost,\n };\n }\n const expiryReason = resolveSessionExpiryReason(input.session);\n if (expiryReason) {\n return {\n status: \"dropped\",\n reason: expiryReason,\n requestHost: compatibility.requestHost,\n authHost: compatibility.authHost,\n expectedGatewayHost: compatibility.expectedGatewayHost,\n };\n }\n return {\n status: \"attachable\",\n token,\n tokenType: normalizeTokenType(input.session.tokenType),\n };\n}\n\nexport function requireAuthTokenAttachment(input: {\n session: StoredAuthSession;\n requestUrl: string;\n}): Extract<AuthTokenAttachment, { status: \"attachable\" }> {\n const attachment = resolveAuthTokenAttachment(input);\n if (attachment.status === \"dropped\") {\n throw createAuthRequestCredentialError(attachment);\n }\n return attachment;\n}\n\nasync function attachAuthHeader(\n headers: Record<string, string>,\n input: RequestAuthHeadersInput\n): Promise<void> {\n const session = await resolveAuthSessionForHeaders(input);\n if (session === null) {\n // No stored credentials exist, so there is nothing to strip: the caller\n // is knowingly sending an unauthenticated request.\n return;\n }\n\n let attachment: Extract<AuthTokenAttachment, { status: \"attachable\" }>;\n try {\n attachment = requireAuthTokenAttachment({\n session,\n requestUrl: input.requestUrl,\n });\n } catch (error) {\n if (error instanceof AuthRequestCredentialError) {\n logRejectedAuthRequestCredential(error);\n }\n throw error;\n }\n headers[AUTHORIZATION_HEADER] = `${attachment.tokenType} ${attachment.token}`;\n}\n\nfunction logRejectedAuthRequestCredential(\n error: AuthRequestCredentialError\n): void {\n console.error(\"[openmeld.auth.request_credential_rejected]\", {\n authHost: error.authHost,\n expectedGatewayHost: error.expectedGatewayHost,\n reason: error.reason,\n requestHost: error.requestHost,\n });\n}\n\nasync function resolveAuthSessionForHeaders(\n input: RequestAuthHeadersInput\n): Promise<StoredAuthSession | null> {\n if (input.authSession !== undefined) {\n return input.authSession;\n }\n\n const sessionState = await getAuthSessionState({ refreshExpired: true });\n if (sessionState.state === \"missing\") {\n return null;\n }\n if (sessionState.state !== \"valid\" || sessionState.session === null) {\n const error = new AuthRequestCredentialError({\n authHost: null,\n expectedGatewayHost: null,\n reason:\n sessionState.reasonCode ??\n (sessionState.state === \"revoked\"\n ? \"session_revoked\"\n : \"session_invalid\"),\n requestHost: parseRequestHost(input.requestUrl),\n });\n logRejectedAuthRequestCredential(error);\n throw error;\n }\n\n return sessionState.session;\n}\n\nfunction createAuthRequestCredentialError(\n attachment: DroppedAuthTokenAttachment\n): AuthRequestCredentialError {\n return new AuthRequestCredentialError({\n authHost: attachment.authHost,\n expectedGatewayHost: attachment.expectedGatewayHost,\n reason: attachment.reason,\n requestHost: attachment.requestHost,\n droppedAttachment: attachment,\n });\n}\n\nfunction parseRequestHost(requestUrl: string): string | null {\n try {\n return new URL(requestUrl).host || null;\n } catch {\n return null;\n }\n}\n\nfunction normalizeAccessToken(session: StoredAuthSession): string {\n return String(session.accessToken ?? \"\").trim();\n}\n\nfunction normalizeTokenType(tokenType: string | undefined): string {\n const normalized = String(tokenType ?? \"\").trim();\n return normalized.length > 0 ? normalized : DEFAULT_TOKEN_TYPE;\n}\n\nfunction resolveSessionExpiryReason(\n session: StoredAuthSession\n): \"session_expired\" | \"session_expiry_invalid\" | null {\n const eligibility = resolveAuthSessionExpiryEligibility(session.expiresAt);\n if (eligibility.status === \"invalid\") {\n return \"session_expiry_invalid\";\n }\n return eligibility.status === \"expired\" ? \"session_expired\" : null;\n}\n\nexport function canAttachAuthTokenToRequest(\n session: StoredAuthSession,\n requestUrl: string\n): boolean {\n return (\n resolveAuthTokenAttachment({\n session,\n requestUrl,\n }).status === \"attachable\"\n );\n}\n","import {\n DEFAULT_SPACE_CONVERSATION_VALIDATE_TIMEOUT_MS,\n DEFAULT_SPACE_REQUEST_TIMEOUT_MS,\n MAX_SPACE_REQUEST_TIMEOUT_MS,\n MIN_SPACE_REQUEST_TIMEOUT_MS,\n} from \"../strategy-constants\";\n\nconst SPACE_REQUEST_TIMEOUT_ENV_KEY = \"OPENMELD_SPACE_REQUEST_TIMEOUT_MS\";\n\nexport function resolveSpaceRequestTimeoutMs(override?: number): number {\n if (isFinitePositiveNumber(override)) {\n return clampSpaceRequestTimeoutMs(override);\n }\n\n const fromEnv = Number.parseInt(\n String(process.env[SPACE_REQUEST_TIMEOUT_ENV_KEY] ?? \"\"),\n 10\n );\n if (isFinitePositiveNumber(fromEnv)) {\n return clampSpaceRequestTimeoutMs(fromEnv);\n }\n\n return DEFAULT_SPACE_REQUEST_TIMEOUT_MS;\n}\n\nexport function resolveSpaceRequestTimeoutMsForDiagnostics(): number {\n return resolveSpaceRequestTimeoutMs(undefined);\n}\n\nexport function resolveSpaceConversationValidateTimeoutMs(): number {\n return Math.max(\n resolveSpaceRequestTimeoutMs(undefined),\n DEFAULT_SPACE_CONVERSATION_VALIDATE_TIMEOUT_MS\n );\n}\n\nfunction clampSpaceRequestTimeoutMs(value: number): number {\n const normalized = Math.trunc(value);\n return Math.max(\n MIN_SPACE_REQUEST_TIMEOUT_MS,\n Math.min(MAX_SPACE_REQUEST_TIMEOUT_MS, normalized)\n );\n}\n\nfunction isFinitePositiveNumber(value: unknown): value is number {\n return typeof value === \"number\" && Number.isFinite(value) && value > 0;\n}\n","import {\n resolveSpaceRequestTimeoutMs,\n resolveSpaceRequestTimeoutMsForDiagnostics as resolveSpaceRequestTimeoutMsForCliDiagnostics,\n} from \"./request-timeout\";\n\nexport async function fetchSpaceRequestWithTimeout(input: {\n url: string;\n operation: string;\n init?: RequestInit;\n timeoutMs?: number;\n}): Promise<Response> {\n const timeoutMs = resolveSpaceRequestTimeoutMs(input.timeoutMs);\n const timeoutSignal = AbortSignal.timeout(timeoutMs);\n const composed = composeAbortSignals(input.init?.signal, timeoutSignal);\n\n try {\n try {\n return await fetch(input.url, {\n ...input.init,\n signal: composed.signal,\n });\n } catch (error) {\n // A keep-alive connection that a proxy silently dropped fails exactly\n // once and undici evicts it; the retry rides a fresh connection. This\n // is what keeps a long-lived service working behind flaky proxies\n // without asking users to touch their network config.\n if (\n timeoutSignal.aborted ||\n composed.signal.aborted ||\n !shouldWrapNetworkRequestError(error)\n ) {\n throw error;\n }\n return await fetch(input.url, {\n ...input.init,\n signal: composed.signal,\n });\n }\n } catch (error) {\n if (timeoutSignal.aborted) {\n throw createSpaceRequestTimeoutError({\n operation: input.operation,\n timeoutMs,\n cause: error,\n });\n }\n if (shouldWrapNetworkRequestError(error)) {\n throw createSpaceRequestNetworkError({\n operation: input.operation,\n url: input.url,\n cause: error,\n });\n }\n throw error;\n } finally {\n composed.cleanup();\n }\n}\n\nexport function resolveSpaceRequestTimeoutMsForDiagnostics(): number {\n return resolveSpaceRequestTimeoutMsForCliDiagnostics();\n}\n\nfunction createSpaceRequestTimeoutError(input: {\n operation: string;\n timeoutMs: number;\n cause: unknown;\n}): Error {\n const error = new Error(\n `${input.operation} request timed out after ${input.timeoutMs}ms`,\n { cause: input.cause }\n ) as Error & { code?: string };\n error.code = \"network.timeout\";\n return error;\n}\n\nfunction createSpaceRequestNetworkError(input: {\n operation: string;\n url: string;\n cause: unknown;\n}): Error {\n const error = new Error(\n `${input.operation} request could not reach ${describeRequestTarget(input.url)} (${toErrorMessage(input.cause)})`,\n { cause: input.cause }\n ) as Error & { code?: string };\n error.code = \"network.request_failed\";\n return error;\n}\n\nfunction composeAbortSignals(\n parent: AbortSignal | null | undefined,\n timeout: AbortSignal\n): { signal: AbortSignal; cleanup: () => void } {\n if (!parent) {\n return {\n signal: timeout,\n cleanup: () => undefined,\n };\n }\n\n if (parent.aborted || timeout.aborted) {\n const controller = new AbortController();\n controller.abort();\n return {\n signal: controller.signal,\n cleanup: () => undefined,\n };\n }\n\n const controller = new AbortController();\n const abort = () => {\n controller.abort();\n };\n\n parent.addEventListener(\"abort\", abort, { once: true });\n timeout.addEventListener(\"abort\", abort, { once: true });\n\n return {\n signal: controller.signal,\n cleanup: () => {\n parent.removeEventListener(\"abort\", abort);\n timeout.removeEventListener(\"abort\", abort);\n },\n };\n}\n\nfunction describeRequestTarget(url: string): string {\n try {\n return new URL(url).origin;\n } catch {\n return url;\n }\n}\n\nfunction toErrorMessage(error: unknown): string {\n if (error instanceof Error) {\n const message = error.message.trim();\n return message.length > 0 ? message : \"request failed\";\n }\n const message = String(error ?? \"\").trim();\n return message.length > 0 ? message : \"request failed\";\n}\n\nfunction shouldWrapNetworkRequestError(error: unknown): boolean {\n if (error instanceof TypeError) {\n return true;\n }\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n typeof error.code === \"string\" &&\n error.code.startsWith(\"ERR_SSL_\")\n ) {\n return true;\n }\n const message = toErrorMessage(error).toLowerCase();\n return (\n message.includes(\"fetch failed\") ||\n message.includes(\"failed to fetch\") ||\n message.includes(\"network request failed\") ||\n message.includes(\"ssl_decryption_failed_or_bad_record_mac\")\n );\n}\n","import {\n createOpenMeldApiClient,\n type OpenMeldApiClientFoundation,\n} from \"@openmeld/api-client\";\nimport {\n buildOpenMeldRequestContextHeaders,\n OPENMELD_HEADER_REQUESTED_ORGANIZATION_ID,\n} from \"@openmeld/gateway-contract\";\nimport { buildRequestAuthHeaders } from \"../config/request-headers\";\nimport { fetchSpaceRequestWithTimeout } from \"./fetch-with-timeout\";\n\nexport function createCliApiClientFoundation(\n baseUrl: string,\n options: {\n onAuthHeadersResolved?: (headers: Record<string, string>) => void;\n organizationId?: string;\n } = {}\n): OpenMeldApiClientFoundation {\n return createOpenMeldApiClient({\n baseUrl,\n transport: async (request) =>\n await fetchSpaceRequestWithTimeout({\n url: request.url,\n operation: request.operation,\n init: request.init,\n timeoutMs: request.timeoutMs,\n }),\n getAuthHeaders: async ({ requestUrl }) => {\n const headers = await buildRequestAuthHeaders({\n requestUrl,\n });\n if (options.organizationId) {\n headers[OPENMELD_HEADER_REQUESTED_ORGANIZATION_ID] =\n options.organizationId;\n }\n options.onAuthHeadersResolved?.(headers);\n return headers;\n },\n getRequestContextHeaders: async ({ requestContext, spacePassword }) =>\n buildOpenMeldRequestContextHeaders({\n requestContext,\n ...(spacePassword === undefined ? {} : {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AAO,EAAE,gBAAgB,oBACjD,mCAAmC;GACjC;GACA,GAAI,kBAAkB,KAAA,IAAY,CAAC,IAAI,EAAE,cAAc;EACzD,CAAC;CACL,CAAC;AACH"}
1
+ {"version":3,"file":"api-client-foundation-BQCtnjoZ.js","names":["resolveSpaceRequestTimeoutMsForDiagnostics","resolveSpaceRequestTimeoutMsForCliDiagnostics"],"sources":["../src/config/auth-request-compatibility.ts","../src/config/openmeld-request-context.ts","../src/config/request-headers.ts","../src/space/request-timeout.ts","../src/space/fetch-with-timeout.ts","../src/space/api-client-foundation.ts"],"sourcesContent":["import { normalizeBaseUrl } from \"../protocol/urls\";\nimport type { StoredAuthSession } from \"./auth-session\";\nimport { isLoopbackHostname } from \"./loopback-hostname\";\n\nexport type AuthRequestCompatibilityReason =\n | \"invalid_request_url\"\n | \"invalid_auth_url\"\n | \"insecure_transport\"\n | \"host_mismatch\"\n | \"loopback\"\n | \"same_host\"\n | \"gateway_sibling\";\n\nexport type AuthRequestCompatibility = {\n compatible: boolean;\n reason: AuthRequestCompatibilityReason;\n requestHost: string | null;\n authHost: string | null;\n expectedGatewayHost: string | null;\n};\n\nexport function resolveAuthRequestCompatibility(input: {\n session: StoredAuthSession;\n requestUrl: string;\n}): AuthRequestCompatibility {\n const requestUrl = parseUrlOrNull(input.requestUrl);\n if (!requestUrl) {\n return {\n compatible: false,\n reason: \"invalid_request_url\",\n requestHost: null,\n authHost: null,\n expectedGatewayHost: null,\n };\n }\n\n const authBaseUrl = parseUrlOrNull(input.session.authBaseUrl);\n if (!authBaseUrl) {\n return {\n compatible: false,\n reason: \"invalid_auth_url\",\n requestHost: requestUrl.host,\n authHost: null,\n expectedGatewayHost: null,\n };\n }\n\n const expectedGatewayHost = deriveGatewayHost(authBaseUrl);\n const requestHost = requestUrl.host;\n const authHost = authBaseUrl.host;\n\n if (\n (isLoopbackHostname(requestUrl.hostname) &&\n isLoopbackHostname(authBaseUrl.hostname)) ||\n // Isolated worktrees share a hostname across Auth and Gateway ports.\n // Never treat different named localhost lanes as interchangeable.\n (requestUrl.hostname.endsWith(\".localhost\") &&\n requestUrl.hostname === authBaseUrl.hostname &&\n isHttpTransportProtocol(authBaseUrl.protocol) &&\n [\"http:\", \"https:\", \"ws:\", \"wss:\"].includes(requestUrl.protocol))\n ) {\n return {\n compatible: true,\n reason: \"loopback\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n }\n\n if (!isSecureTransportProtocol(requestUrl.protocol)) {\n return {\n compatible: false,\n reason: \"insecure_transport\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n }\n\n if (requestHost === authHost) {\n return {\n compatible: true,\n reason: \"same_host\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n }\n\n if (expectedGatewayHost && requestHost === expectedGatewayHost) {\n return {\n compatible: true,\n reason: \"gateway_sibling\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n }\n\n return {\n compatible: false,\n reason: \"host_mismatch\",\n requestHost,\n authHost,\n expectedGatewayHost,\n };\n}\n\nexport function deriveAuthBaseUrlFromGatewayUrl(\n gatewayUrl: string\n): string | null {\n const parsed = parseUrlOrNull(gatewayUrl);\n if (!parsed) {\n return null;\n }\n if (!isHttpTransportProtocol(parsed.protocol)) {\n return null;\n }\n if (!parsed.hostname.startsWith(\"gateway.\")) {\n return null;\n }\n\n const authUrl = new URL(parsed.toString());\n authUrl.hostname = `auth.${parsed.hostname.slice(\"gateway.\".length)}`;\n authUrl.pathname = \"/\";\n authUrl.search = \"\";\n authUrl.hash = \"\";\n return normalizeBaseUrl(authUrl.toString());\n}\n\nfunction deriveGatewayHost(authBaseUrl: URL): string | null {\n if (!authBaseUrl.hostname.startsWith(\"auth.\")) {\n return null;\n }\n\n const gatewayUrl = new URL(authBaseUrl.toString());\n gatewayUrl.hostname = `gateway.${authBaseUrl.hostname.slice(\"auth.\".length)}`;\n return gatewayUrl.host;\n}\n\nfunction parseUrlOrNull(value: string): URL | null {\n try {\n return new URL(value);\n } catch {\n return null;\n }\n}\n\nfunction isSecureTransportProtocol(protocol: string): boolean {\n return protocol === \"https:\" || protocol === \"wss:\";\n}\n\nfunction isHttpTransportProtocol(protocol: string): boolean {\n return protocol === \"http:\" || protocol === \"https:\";\n}\n","import crypto from \"node:crypto\";\nimport type { OpenMeldRequestContext } from \"@openmeld/schemas/types\";\nimport type { OpenMeldProfile } from \"./openmeld-profiles-api\";\n\nexport type OpenMeldRequestContextProfileIdentity = {\n openMeldProfileId: string;\n profileKind?: \"human\" | \"agent\" | \"system\";\n kind?: \"human\" | \"agent\";\n profileHandle?: string;\n profileName: string;\n ownerUserId?: string;\n ownerName?: string;\n agentControllerConversationId?: string;\n};\n\nexport function buildOpenMeldRequestContextFromProfile(input: {\n openMeldProfile: OpenMeldProfile;\n requestId?: string;\n agentControllerConversationId?: string;\n}): OpenMeldRequestContext {\n const requestId =\n normalizeOptionalText(input.requestId) ?? crypto.randomUUID();\n const agentControllerConversationId = normalizeOptionalText(\n input.agentControllerConversationId\n );\n const ownerName = normalizeOptionalText(input.openMeldProfile.ownerName);\n\n return {\n actorContext: {\n requestId,\n openMeldProfileId: input.openMeldProfile.openMeldProfileId,\n profileKind: input.openMeldProfile.profileKind,\n profileHandle: input.openMeldProfile.profileHandle,\n profileName: input.openMeldProfile.profileName,\n ownerUserId: input.openMeldProfile.ownerUserId,\n ...(ownerName ? { ownerName } : {}),\n },\n ...(agentControllerConversationId ? { agentControllerConversationId } : {}),\n };\n}\n\nexport function buildOpenMeldRequestContextFromProfileIdentity(input: {\n profileIdentity: OpenMeldRequestContextProfileIdentity;\n requestId?: string;\n}): OpenMeldRequestContext {\n const requestId =\n normalizeOptionalText(input.requestId) ?? crypto.randomUUID();\n const profileHandle = normalizeOptionalText(\n input.profileIdentity.profileHandle\n );\n const ownerUserId = normalizeOptionalText(input.profileIdentity.ownerUserId);\n const ownerName = normalizeOptionalText(input.profileIdentity.ownerName);\n const agentControllerConversationId = normalizeOptionalText(\n input.profileIdentity.agentControllerConversationId\n );\n const profileKind =\n input.profileIdentity.profileKind ??\n (input.profileIdentity.kind === \"human\" ||\n input.profileIdentity.kind === \"agent\"\n ? input.profileIdentity.kind\n : \"system\");\n\n return {\n actorContext: {\n requestId,\n openMeldProfileId: input.profileIdentity.openMeldProfileId,\n profileKind,\n ...(profileHandle ? { profileHandle } : {}),\n profileName: input.profileIdentity.profileName,\n ...(ownerUserId ? { ownerUserId } : {}),\n ...(ownerName ? { ownerName } : {}),\n },\n ...(agentControllerConversationId ? { agentControllerConversationId } : {}),\n };\n}\n\nfunction normalizeOptionalText(value: unknown): string | null {\n const normalized = String(value ?? \"\").trim();\n return normalized.length > 0 ? normalized : null;\n}\n","import {\n buildOpenMeldRequestContextHeaders,\n type OpenMeldRequestContextHeadersInput,\n} from \"@openmeld/gateway-contract\";\nimport type { OpenMeldRequestContext } from \"@openmeld/schemas/types\";\nimport {\n type AuthRequestCompatibilityReason,\n resolveAuthRequestCompatibility,\n} from \"./auth-request-compatibility\";\nimport {\n type AuthSessionStateReasonCode,\n getAuthSessionState,\n type StoredAuthSession,\n} from \"./auth-session\";\nimport { resolveAuthSessionExpiryEligibility } from \"./auth-session-expiry\";\nimport type { OpenMeldProfile } from \"./openmeld-profiles-api\";\nimport {\n buildOpenMeldRequestContextFromProfile,\n buildOpenMeldRequestContextFromProfileIdentity,\n type OpenMeldRequestContextProfileIdentity,\n} from \"./openmeld-request-context\";\n\nconst DEFAULT_TOKEN_TYPE = \"Bearer\";\nconst AUTHORIZATION_HEADER = \"Authorization\";\n\ntype RequestAuthHeadersInput = {\n authSession?: StoredAuthSession | null;\n requestUrl: string;\n};\n\ntype OpenMeldRequestContextHeadersWithAuthInput =\n OpenMeldRequestContextHeadersInput & {\n authSession?: StoredAuthSession | null;\n requestUrl: string;\n };\n\nexport type AuthTokenAttachment =\n | {\n status: \"attachable\";\n token: string;\n tokenType: string;\n }\n | {\n status: \"dropped\";\n reason:\n | \"empty_token\"\n | \"session_expired\"\n | \"session_expiry_invalid\"\n | AuthRequestCompatibilityReason;\n requestHost: string | null;\n authHost: string | null;\n expectedGatewayHost: string | null;\n };\n\nexport type DroppedAuthTokenAttachment = Extract<\n AuthTokenAttachment,\n { status: \"dropped\" }\n>;\n\nexport type AuthRequestCredentialFailureReason =\n | DroppedAuthTokenAttachment[\"reason\"]\n | AuthSessionStateReasonCode\n | \"session_invalid\"\n | \"session_revoked\";\n\nexport class AuthRequestCredentialError extends Error {\n readonly authHost: string | null;\n readonly expectedGatewayHost: string | null;\n readonly reason: AuthRequestCredentialFailureReason;\n readonly requestHost: string | null;\n readonly droppedAttachment?: DroppedAuthTokenAttachment;\n\n constructor(input: {\n authHost: string | null;\n expectedGatewayHost: string | null;\n reason: AuthRequestCredentialFailureReason;\n requestHost: string | null;\n droppedAttachment?: DroppedAuthTokenAttachment;\n }) {\n super(\n `OpenMeld refused to send a request with unusable stored credentials (${input.reason}).`\n );\n this.name = \"AuthRequestCredentialError\";\n this.authHost = input.authHost;\n this.expectedGatewayHost = input.expectedGatewayHost;\n this.reason = input.reason;\n this.requestHost = input.requestHost;\n this.droppedAttachment = input.droppedAttachment;\n }\n}\n\nexport async function buildRequestAuthHeaders(\n input: RequestAuthHeadersInput\n): Promise<Record<string, string>> {\n const headers: Record<string, string> = {};\n await attachAuthHeader(headers, input);\n return headers;\n}\n\nexport async function buildOpenMeldRequestContextHeadersWithAuth(\n input: OpenMeldRequestContextHeadersWithAuthInput\n): Promise<Record<string, string>> {\n const headers = buildOpenMeldRequestContextHeaders(input);\n await attachAuthHeader(headers, input);\n return headers;\n}\n\nexport async function buildOpenMeldProfileRequestHeadersWithAuth(input: {\n openMeldProfile: OpenMeldProfile;\n requestUrl: string;\n authSession?: StoredAuthSession | null;\n agentControllerConversationId?: string;\n spacePassword?: string;\n}): Promise<Record<string, string>> {\n return await buildOpenMeldRequestContextHeadersWithAuth({\n requestContext: buildOpenMeldRequestContextFromProfile({\n openMeldProfile: input.openMeldProfile,\n agentControllerConversationId: input.agentControllerConversationId,\n }),\n requestUrl: input.requestUrl,\n ...(input.authSession === undefined\n ? {}\n : { authSession: input.authSession }),\n ...(input.spacePassword === undefined\n ? {}\n : { spacePassword: input.spacePassword }),\n });\n}\n\nexport async function buildOpenMeldProfileIdentityRequestHeadersWithAuth(input: {\n profileIdentity: OpenMeldRequestContextProfileIdentity;\n requestUrl: string;\n authSession?: StoredAuthSession | null;\n spacePassword?: string;\n}): Promise<Record<string, string>> {\n return await buildOpenMeldRequestContextHeadersWithAuth({\n requestContext: buildOpenMeldRequestContextFromProfileIdentity({\n profileIdentity: input.profileIdentity,\n }),\n requestUrl: input.requestUrl,\n ...(input.authSession === undefined\n ? {}\n : { authSession: input.authSession }),\n ...(input.spacePassword === undefined\n ? {}\n : { spacePassword: input.spacePassword }),\n });\n}\n\nexport function withSpacePassword(\n requestContext: OpenMeldRequestContext,\n spacePassword?: string\n): OpenMeldRequestContextHeadersInput {\n return {\n requestContext,\n ...(spacePassword === undefined ? {} : { spacePassword }),\n };\n}\n\n// One decision for \"can this stored session authenticate this request\", with\n// the drop reason preserved. Header building and the daemon stream connect\n// gate must share this so they cannot drift apart.\nexport function resolveAuthTokenAttachment(input: {\n session: StoredAuthSession;\n requestUrl: string;\n}): AuthTokenAttachment {\n const compatibility = resolveAuthRequestCompatibility({\n session: input.session,\n requestUrl: input.requestUrl,\n });\n const token = normalizeAccessToken(input.session);\n if (!token) {\n return {\n status: \"dropped\",\n reason: \"empty_token\",\n requestHost: compatibility.requestHost,\n authHost: compatibility.authHost,\n expectedGatewayHost: compatibility.expectedGatewayHost,\n };\n }\n if (!compatibility.compatible) {\n return {\n status: \"dropped\",\n reason: compatibility.reason,\n requestHost: compatibility.requestHost,\n authHost: compatibility.authHost,\n expectedGatewayHost: compatibility.expectedGatewayHost,\n };\n }\n const expiryReason = resolveSessionExpiryReason(input.session);\n if (expiryReason) {\n return {\n status: \"dropped\",\n reason: expiryReason,\n requestHost: compatibility.requestHost,\n authHost: compatibility.authHost,\n expectedGatewayHost: compatibility.expectedGatewayHost,\n };\n }\n return {\n status: \"attachable\",\n token,\n tokenType: normalizeTokenType(input.session.tokenType),\n };\n}\n\nexport function requireAuthTokenAttachment(input: {\n session: StoredAuthSession;\n requestUrl: string;\n}): Extract<AuthTokenAttachment, { status: \"attachable\" }> {\n const attachment = resolveAuthTokenAttachment(input);\n if (attachment.status === \"dropped\") {\n throw createAuthRequestCredentialError(attachment);\n }\n return attachment;\n}\n\nasync function attachAuthHeader(\n headers: Record<string, string>,\n input: RequestAuthHeadersInput\n): Promise<void> {\n const session = await resolveAuthSessionForHeaders(input);\n if (session === null) {\n // No stored credentials exist, so there is nothing to strip: the caller\n // is knowingly sending an unauthenticated request.\n return;\n }\n\n let attachment: Extract<AuthTokenAttachment, { status: \"attachable\" }>;\n try {\n attachment = requireAuthTokenAttachment({\n session,\n requestUrl: input.requestUrl,\n });\n } catch (error) {\n if (error instanceof AuthRequestCredentialError) {\n logRejectedAuthRequestCredential(error);\n }\n throw error;\n }\n headers[AUTHORIZATION_HEADER] = `${attachment.tokenType} ${attachment.token}`;\n}\n\nfunction logRejectedAuthRequestCredential(\n error: AuthRequestCredentialError\n): void {\n console.error(\"[openmeld.auth.request_credential_rejected]\", {\n authHost: error.authHost,\n expectedGatewayHost: error.expectedGatewayHost,\n reason: error.reason,\n requestHost: error.requestHost,\n });\n}\n\nasync function resolveAuthSessionForHeaders(\n input: RequestAuthHeadersInput\n): Promise<StoredAuthSession | null> {\n if (input.authSession !== undefined) {\n return input.authSession;\n }\n\n const sessionState = await getAuthSessionState({ refreshExpired: true });\n if (sessionState.state === \"missing\") {\n return null;\n }\n if (sessionState.state !== \"valid\" || sessionState.session === null) {\n const error = new AuthRequestCredentialError({\n authHost: null,\n expectedGatewayHost: null,\n reason:\n sessionState.reasonCode ??\n (sessionState.state === \"revoked\"\n ? \"session_revoked\"\n : \"session_invalid\"),\n requestHost: parseRequestHost(input.requestUrl),\n });\n logRejectedAuthRequestCredential(error);\n throw error;\n }\n\n return sessionState.session;\n}\n\nfunction createAuthRequestCredentialError(\n attachment: DroppedAuthTokenAttachment\n): AuthRequestCredentialError {\n return new AuthRequestCredentialError({\n authHost: attachment.authHost,\n expectedGatewayHost: attachment.expectedGatewayHost,\n reason: attachment.reason,\n requestHost: attachment.requestHost,\n droppedAttachment: attachment,\n });\n}\n\nfunction parseRequestHost(requestUrl: string): string | null {\n try {\n return new URL(requestUrl).host || null;\n } catch {\n return null;\n }\n}\n\nfunction normalizeAccessToken(session: StoredAuthSession): string {\n return String(session.accessToken ?? \"\").trim();\n}\n\nfunction normalizeTokenType(tokenType: string | undefined): string {\n const normalized = String(tokenType ?? \"\").trim();\n return normalized.length > 0 ? normalized : DEFAULT_TOKEN_TYPE;\n}\n\nfunction resolveSessionExpiryReason(\n session: StoredAuthSession\n): \"session_expired\" | \"session_expiry_invalid\" | null {\n const eligibility = resolveAuthSessionExpiryEligibility(session.expiresAt);\n if (eligibility.status === \"invalid\") {\n return \"session_expiry_invalid\";\n }\n return eligibility.status === \"expired\" ? \"session_expired\" : null;\n}\n\nexport function canAttachAuthTokenToRequest(\n session: StoredAuthSession,\n requestUrl: string\n): boolean {\n return (\n resolveAuthTokenAttachment({\n session,\n requestUrl,\n }).status === \"attachable\"\n );\n}\n","import {\n DEFAULT_SPACE_CONVERSATION_VALIDATE_TIMEOUT_MS,\n DEFAULT_SPACE_REQUEST_TIMEOUT_MS,\n MAX_SPACE_REQUEST_TIMEOUT_MS,\n MIN_SPACE_REQUEST_TIMEOUT_MS,\n} from \"../strategy-constants\";\n\nconst SPACE_REQUEST_TIMEOUT_ENV_KEY = \"OPENMELD_SPACE_REQUEST_TIMEOUT_MS\";\n\nexport function resolveSpaceRequestTimeoutMs(override?: number): number {\n if (isFinitePositiveNumber(override)) {\n return clampSpaceRequestTimeoutMs(override);\n }\n\n const fromEnv = Number.parseInt(\n String(process.env[SPACE_REQUEST_TIMEOUT_ENV_KEY] ?? \"\"),\n 10\n );\n if (isFinitePositiveNumber(fromEnv)) {\n return clampSpaceRequestTimeoutMs(fromEnv);\n }\n\n return DEFAULT_SPACE_REQUEST_TIMEOUT_MS;\n}\n\nexport function resolveSpaceRequestTimeoutMsForDiagnostics(): number {\n return resolveSpaceRequestTimeoutMs(undefined);\n}\n\nexport function resolveSpaceConversationValidateTimeoutMs(): number {\n return Math.max(\n resolveSpaceRequestTimeoutMs(undefined),\n DEFAULT_SPACE_CONVERSATION_VALIDATE_TIMEOUT_MS\n );\n}\n\nfunction clampSpaceRequestTimeoutMs(value: number): number {\n const normalized = Math.trunc(value);\n return Math.max(\n MIN_SPACE_REQUEST_TIMEOUT_MS,\n Math.min(MAX_SPACE_REQUEST_TIMEOUT_MS, normalized)\n );\n}\n\nfunction isFinitePositiveNumber(value: unknown): value is number {\n return typeof value === \"number\" && Number.isFinite(value) && value > 0;\n}\n","import {\n resolveSpaceRequestTimeoutMs,\n resolveSpaceRequestTimeoutMsForDiagnostics as resolveSpaceRequestTimeoutMsForCliDiagnostics,\n} from \"./request-timeout\";\n\nexport async function fetchSpaceRequestWithTimeout(input: {\n url: string;\n operation: string;\n init?: RequestInit;\n timeoutMs?: number;\n}): Promise<Response> {\n const timeoutMs = resolveSpaceRequestTimeoutMs(input.timeoutMs);\n const timeoutSignal = AbortSignal.timeout(timeoutMs);\n const composed = composeAbortSignals(input.init?.signal, timeoutSignal);\n\n try {\n try {\n return await fetch(input.url, {\n ...input.init,\n signal: composed.signal,\n });\n } catch (error) {\n // A keep-alive connection that a proxy silently dropped fails exactly\n // once and undici evicts it; the retry rides a fresh connection. This\n // is what keeps a long-lived service working behind flaky proxies\n // without asking users to touch their network config.\n if (\n timeoutSignal.aborted ||\n composed.signal.aborted ||\n !shouldWrapNetworkRequestError(error)\n ) {\n throw error;\n }\n return await fetch(input.url, {\n ...input.init,\n signal: composed.signal,\n });\n }\n } catch (error) {\n if (timeoutSignal.aborted) {\n throw createSpaceRequestTimeoutError({\n operation: input.operation,\n timeoutMs,\n cause: error,\n });\n }\n if (shouldWrapNetworkRequestError(error)) {\n throw createSpaceRequestNetworkError({\n operation: input.operation,\n url: input.url,\n cause: error,\n });\n }\n throw error;\n } finally {\n composed.cleanup();\n }\n}\n\nexport function resolveSpaceRequestTimeoutMsForDiagnostics(): number {\n return resolveSpaceRequestTimeoutMsForCliDiagnostics();\n}\n\nfunction createSpaceRequestTimeoutError(input: {\n operation: string;\n timeoutMs: number;\n cause: unknown;\n}): Error {\n const error = new Error(\n `${input.operation} request timed out after ${input.timeoutMs}ms`,\n { cause: input.cause }\n ) as Error & { code?: string };\n error.code = \"network.timeout\";\n return error;\n}\n\nfunction createSpaceRequestNetworkError(input: {\n operation: string;\n url: string;\n cause: unknown;\n}): Error {\n const error = new Error(\n `${input.operation} request could not reach ${describeRequestTarget(input.url)} (${toErrorMessage(input.cause)})`,\n { cause: input.cause }\n ) as Error & { code?: string };\n error.code = \"network.request_failed\";\n return error;\n}\n\nfunction composeAbortSignals(\n parent: AbortSignal | null | undefined,\n timeout: AbortSignal\n): { signal: AbortSignal; cleanup: () => void } {\n if (!parent) {\n return {\n signal: timeout,\n cleanup: () => undefined,\n };\n }\n\n if (parent.aborted || timeout.aborted) {\n const controller = new AbortController();\n controller.abort();\n return {\n signal: controller.signal,\n cleanup: () => undefined,\n };\n }\n\n const controller = new AbortController();\n const abort = () => {\n controller.abort();\n };\n\n parent.addEventListener(\"abort\", abort, { once: true });\n timeout.addEventListener(\"abort\", abort, { once: true });\n\n return {\n signal: controller.signal,\n cleanup: () => {\n parent.removeEventListener(\"abort\", abort);\n timeout.removeEventListener(\"abort\", abort);\n },\n };\n}\n\nfunction describeRequestTarget(url: string): string {\n try {\n return new URL(url).origin;\n } catch {\n return url;\n }\n}\n\nfunction toErrorMessage(error: unknown): string {\n if (error instanceof Error) {\n const message = error.message.trim();\n return message.length > 0 ? message : \"request failed\";\n }\n const message = String(error ?? \"\").trim();\n return message.length > 0 ? message : \"request failed\";\n}\n\nfunction shouldWrapNetworkRequestError(error: unknown): boolean {\n if (error instanceof TypeError) {\n return true;\n }\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n typeof error.code === \"string\" &&\n error.code.startsWith(\"ERR_SSL_\")\n ) {\n return true;\n }\n const message = toErrorMessage(error).toLowerCase();\n return (\n message.includes(\"fetch failed\") ||\n message.includes(\"failed to fetch\") ||\n message.includes(\"network request failed\") ||\n message.includes(\"ssl_decryption_failed_or_bad_record_mac\")\n );\n}\n","import {\n createOpenMeldApiClient,\n type OpenMeldApiClientFoundation,\n} from \"@openmeld/api-client\";\nimport {\n buildOpenMeldRequestContextHeaders,\n OPENMELD_HEADER_REQUESTED_ORGANIZATION_ID,\n} from \"@openmeld/gateway-contract\";\nimport { buildRequestAuthHeaders } from \"../config/request-headers\";\nimport { fetchSpaceRequestWithTimeout } from \"./fetch-with-timeout\";\n\nexport function createCliApiClientFoundation(\n baseUrl: string,\n options: {\n onAuthHeadersResolved?: (headers: Record<string, string>) => void;\n organizationId?: string;\n } = {}\n): OpenMeldApiClientFoundation {\n return createOpenMeldApiClient({\n baseUrl,\n transport: async (request) =>\n await fetchSpaceRequestWithTimeout({\n url: request.url,\n operation: request.operation,\n init: request.init,\n timeoutMs: request.timeoutMs,\n }),\n getAuthHeaders: async ({ requestUrl }) => {\n const headers = await buildRequestAuthHeaders({\n requestUrl,\n });\n if (options.organizationId) {\n headers[OPENMELD_HEADER_REQUESTED_ORGANIZATION_ID] =\n options.organizationId;\n }\n options.onAuthHeadersResolved?.(headers);\n return headers;\n },\n getRequestContextHeaders: async ({ requestContext, spacePassword }) =>\n buildOpenMeldRequestContextHeaders({\n requestContext,\n ...(spacePassword === undefined ? {} : { spacePassword }),\n }),\n });\n}\n"],"mappings":";;;;;;;;AAqBA,SAAgB,gCAAgC,OAGnB;CAC3B,MAAM,aAAa,eAAe,MAAM,UAAU;CAClD,IAAI,CAAC,YACH,OAAO;EACL,YAAY;EACZ,QAAQ;EACR,aAAa;EACb,UAAU;EACV,qBAAqB;CACvB;CAGF,MAAM,cAAc,eAAe,MAAM,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t as createCliApiClientFoundation } from "./api-client-foundation-BQCtnjoZ.js";
4
4
  export { createCliApiClientFoundation };
@@ -4,19 +4,19 @@ import { _ as toSpaceWsUrl, a as toSpaceCreateUrl, d as toSpaceMembersUrl, f as
4
4
  import { t as isLoopbackHostname } from "./loopback-hostname-DHQPKq8N.js";
5
5
  import { A as formatLocalMachineIssueMessage, E as createBackgroundExecutionBlockedIssue, G as isPublishedOpenMeldHome, I as accountsDir, J as normalizeAccountKey, K as legacyAccountProfileSpacesDir, N as accountProfileSpaceCacheDir, Q as openMeldManagedBinaryPath, Y as normalizeOpenMeldProfileId, _ as resolveCliContextId, b as resolveOpenMeldLaneDescriptor, dt as resolveOpenMeldServiceOwnedPathInput, j as OPENMELD_HOME_ENV_KEY, l as resolveOpenMeldOrphanedLockIssue, lt as resolveOpenMeldEnvPreset, r as isOpenMeldLockError, t as acquireLock, tt as openMeldRootDir, u as runWithHeldLock, ut as resolveOpenMeldRootDir, w as assessLocalMachineFailure } from "./lock-Dv-vQTmI.js";
6
6
  import { b as normalizeKnownBuiltinAgentControllerId, d as resolveBuiltinAgentControllerConversationKind, l as buildAgentControllerConversationRef, v as canonicalizeBuiltinAgentControllerRef, x as parseAgentControllerRef, y as normalizeBuiltinAgentControllerId } from "./controller-contract-pe3_Re-c.js";
7
- import { $a as extractAuthenticationPromptAction, $i as emitDaemonLifecycleEvent, $n as isDaemonReconcileInProgressError, $o as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, $r as renderWorkingLanguagePrompt, A as resolveServiceReadiness, Ai as hasActiveDaemonOwners, An as resolveRegistryRuntimeAdapterCapabilitySnapshot, Ao as resolvePreferredDaemonDeviceId, Ar as resolveConversationExecutionStateByLookupKey, At as ensureOpenMeldManagedProfileWorkspace, B as clearDaemonStartFailureState, Bi as resolveDaemonServiceManagerForRuntimeState, Bn as sortAgentRegistrations, Bo as warnDaemonEvent, Br as buildInformationProtectionPromptPlan, Bt as ProjectBindingOperationError, C as ensureDaemonSystemServiceCommandFiles, Cn as updateAgentCustomTarget, Co as assessServerRequiredVersion, Cr as runRuntimeTask, Ct as readLocalEnabledControllers, D as resolveDaemonStatusSnapshot, Di as inspectDaemonServiceInventory, Dn as resolveSkillsAgentRegistry, Do as buildLedgerPaths, Dr as commitResolvedAgentContext, E as formatDaemonFailureContextText, Ei as createProviderOriginalError, Er as appendLedgerHistoryEntry, Et as syncProfileWorkspaceState, F as buildDaemonServiceStatusReadOnlyDetail, Fi as clearDaemonRuntimeStateIfDefinitelyStopped, Fn as requestLocalDaemonShutdown, Fo as normalizeNonNegativeInteger$1, Fr as buildAuthenticatedControlPlaneResponse, Ft as resolveConfiguredProfileWorkspacePathForAccount, G as buildDaemonServiceDependencySummary, Gi as extractDaemonCommandEntryPath, Gn as isHomebrewCommandPath, Go as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, Gt as listProjectConnectionsWithStatus, H as buildDaemonServiceDependencyDetails, Ha as readDaemonCatalogSyncSignal, Hi as cleanupLegacySharedDaemonServiceState, Hn as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, Ho as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, Hr as createAgentControllerInterfaceDisplayRows, Ht as bindProject, I as buildDaemonServiceUpdateRequiredNextStep, Ia as getOpenMeldProfileCapabilities, Ii as getEffectiveDaemonRuntimeStatus, In as sendLocalDaemonControlPlaneRequest, Io as normalizeOptionalText$21, Ir as buildAgentContextLookupKey, It as setCustomProfileWorkspace, J as resolveCurrentReplyReadinessSnapshot, Ji as cleanupInactiveDaemonServiceBundles, Jn as resolveLocalRegistryAgentIdFromAgentControllerRef, Jo as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, Jt as removeMissingProjectConnections, K as buildDaemonServiceDependencyTitle, Ki as resolveDaemonBundleIdFromEntryPath, Kn as isNpmGlobalCommandPath, Ko as DAEMON_RUNTIME_CONTRACT_EPOCH, L as formatDaemonServiceRefreshReliabilityMessage, La as listOpenMeldProfiles, Li as readCurrentDaemonRuntimeContext, Ln as normalizeAgentId, Lo as normalizeText$2, Lr as DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS, M as buildDaemonServiceRefreshNextStep, Ma as resolveOpenMeldProfileOrNull, Mi as resolveDaemonStopStrategy, Mo as dirnamePath, Mr as settleInflightTask, N as buildDaemonServiceRefreshPromptMessage, Na as createOpenMeldAgentProfile, Ni as resolveStoppedContractWriteBlockedReason, Nn as LocalDaemonControlPlaneClientError, No as emitRunLine, Nr as upsertConversationExecutionState, Nt as readProfileWorkspaceConfigForAccount, O as resolveDaemonStatusAttention, Oi as buildDaemonOwnerSnapshotFromObservedState, On as listBuiltinAgentsRegistryEntries, Oo as ensureDaemonRuntimePaths, Or as loadLedgerState, Ot as resolveCurrentEffectiveProfileWorkingFolderRuntime, P as buildDaemonServiceRepairGuidance, Pa as createOpenMeldHumanProfile, Pi as summarizeDaemonOwnerSnapshot, Po as normalizeHeartbeatIntervalMs, Pr as withLedgerStateTransaction, Q as formatReplyReadinessSummary, Qa as createAuthenticationError, Qi as resolveDaemonBundleEntryPathFromState, Qn as SPACE_ACTION_TARGET_GUIDANCE_LINES, Qo as MAX_RECONNECT_DELAY_MS, Qr as renderInformationProtectionPrompt, Qt as setDefaultProjectConnection, R as formatDaemonServiceUpdateRequiredMessage, Ri as readCurrentObservedDaemonRuntimeStatus, Rn as normalizeAgentIds, Ro as nowIsoString, Rr as areAgentControllerInterfaceAccountsSame, S as buildDaemonSystemServiceCommandSpec, Si as createUnsupportedProviderUsageLimits, Sn as setAgentRegistrationEnabled, So as resolveServiceUpdateUrgency, Sr as resolveLatestScopedConversationExecutionState, Ss as resolveBuiltinAgentControllerBrand, St as buildRuntimeRouteTargets, T as captureDaemonServiceEvidenceBestEffort, Ta as resolveRuntimeContext, Ti as materializeCliLaunchCommand, Tn as canManageRegistryAgentSkillTargets, Tr as buildTaskResultEnvelope, Tt as resolveLocalRuntimeControllerSupport, U as buildDaemonServiceDependencyMeaning, Ui as listDaemonOwnedProcesses, Un as resolveBuiltinAgentControllerDefinition, Uo as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, Ut as isProjectBound, V as writeDaemonStartFailureState, Va as assertAdditionalHumanProfileCreationEnabled, Vi as waitForDaemonSystemServiceToStop, Vn as repairBuiltinControllerInstall, Vo as CATALOG_SYNC_RETRY_INTERVAL_MS, Vr as buildWorkingLanguagePromptPlan, Vt as ProjectBindingStoreUpdateRequiredError, W as buildDaemonServiceDependencyNextStep, Wa as clearAllSelectedOpenMeldProfileIds, Wn as isBunGlobalCommandPath, Wo as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, Wr as createAuthorityOpenMeldServiceRuntimeId, Wt as listProjectBindings, Xa as buildCommandAuthenticationPromptMessage$1, Xi as readDaemonActiveBundleState, Xn as syncRuntimeEventToInflightTaskControlRegistry, Xo as DEFAULT_RECONNECT_DELAY_MS, Xt as resolveProjectBindingForPath, Ya as buildAuthenticationStatusLabel, Yi as prepareDaemonServiceBundle, Yn as normalizeDispatchThreadAction, Yo as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, Yr as parseAgentControllerRef$1, Yt as removeProjectConnection, Za as buildHumanAuthenticationCard, Zi as resolveAlignedDaemonActiveBundleEntryPath, Zn as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Zo as HEARTBEAT_RESPONSE_TIMEOUT_MS, _ as isDaemonInventoryRunningAndStartReady$1, _a as resolveCurrentDaemonExpectedVersion, _i as resolveInstalledCodexLaunchCandidates, _n as readAgentRuntimeConfigHealth, _r as resolveCatalogSyncIntervalMs, _t as createMutableRouteCatalogState, a as resolveOpenMeldToolsMaintenanceProjection, aa as runDaemonServiceManagerAction, ai as resolveSelectableCandidates, an as syncDeviceRuntimeStateProjection, ao as resolveDaemonServiceAlignmentDecision, ar as mergeOpenClawGatewayVisibility, as as clearDaemonServiceContract, at as classifyGatewayChainFailure, b as waitForSystemServiceStartup$1, bi as resolveInstalledClaudeCodeLaunchCandidates, bn as removeAgentCustomTarget, br as resolveCompatibleAgentContextMatch, bt as summarizeSkippedDaemonProfiles, ci as createLocalAdapterEntries, cn as emitReconcileStartedEvidence, co as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, cr as createLocalExecutionSlots, cs as upsertDaemonServiceContract, ct as resolveGatewayChainRetryGuidance, d as scheduleDaemonServiceUpdate, di as resolveInstalledOpenCodeLaunchCandidates, dn as addAgentCustomTarget, do as DAEMON_SERVICE_WAKEABILITY_ADVISORY_ANOMALIES, dr as MAX_HEARTBEAT_INTERVAL_MS, ds as formatInlineOpenMeldCliCommands, dt as buildOpenClawSpaceSessionKey, ea as formatDaemonLifecycleOriginSummary, eo as resolveAuthenticationGuidance, er as resolveRouteRegistrationReconcileDecision, es as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, et as REPLY_READINESS_COPY, f as DaemonServiceLifecycleDrainTimeoutError, fi as GrokBuildAcpTransportError, fn as createRegistrationFromCatalogTarget, fo as classifyDaemonServiceRunStartability, fr as MIN_HEARTBEAT_INTERVAL_MS, fs as formatOpenMeldCliCommand, ft as normalizeOpenClawSpaceIdPrefix, g as uninstallDaemonServiceUpdateWorker, ga as DaemonServiceRunError, gi as resolveCodexTimeoutMs, gn as manageAgentRegistrationInstallation, gr as resolveAdaptiveHeartbeatIntervalMs, gs as formatProfileAwareOpenMeldCliCommand, gt as resolveLocalServiceDemand, ha as readDaemonRuntimeContractRepairReport, hi as projectCodexUsageLimits, hn as listAgentTargetStates, ho as compareSemver, hr as pruneStaleLeases, hs as formatOpenMeldCliTextBlock, ht as writeDaemonRouteCatalogCache, i as readOpenMeldToolsMaintenancePolicy, ia as resolveRecentDaemonSignalStopCause, io as buildDaemonServiceTargetSpec, ir as createPendingAgentInteractionRegistry, is as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, it as resolveOpenClawDiagnosticsGuidance, ja as requireOpenMeldProfile, ji as readCurrentDaemonOwnerSnapshot, jn as resolveRegistryRuntimeAdapterContractByAgentControllerRef, jo as asRecord, jr as seedLegacyAgentContext, k as resolveDaemonStatusAuthenticationAttention, ka as resolveCurrentOpenMeldAccountContext, ki as formatDaemonOwnerSummaryLabel, kn as resolveRegistryOriginLaunchCommand, ko as resolveDaemonDeviceId, kr as removeConversationExecutionState, kt as resolveProfileWorkspaceRuntime, la as readLastDaemonServiceUpdate, li as parseOpenCodeGoUsageResponse, lo as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, lr as createInflightTaskControlRegistry, ls as resolveOpenMeldEnvironmentTarget, lt as resolveOpenClawLocalDiagnosticsValue, m as ensureDaemonServiceMaintenanceInstalled, ma as ensureDaemonRuntimeContractState, mi as resolveInstalledGrokBuildLaunchCandidates, mn as listAgentRegistrations, mr as applyIntervalJitterMs, mt as readDaemonRouteCatalogCache, n as readLastOpenMeldToolsUpdateAttempt, na as readLatestDaemonLifecycleOriginEvent, nn as withAgentActivityDeliveryLock, nr as buildDispatchReplyContextSummary, ns as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, nt as resolveReplyReadinessAvailabilityReasonCopy, o as writeOpenMeldToolsMaintenancePolicy, oa as runWithDaemonLifecycleCommandJournal, oi as resolveCatalogSyncSkippedProfilesLogState, on as emitDriftDetectedEvidence, oo as isVersionDowngrade, or as createLocalTaskInterruptSender, os as isDaemonServiceContractIdentityReusable, p as runDaemonServiceLifecycle, pi as probeGrokBuildAcpInterface, pn as listAgentCustomTargets, po as classifyDaemonServiceWakeability, pr as applyAcceptedLeases, ps as formatOpenMeldCliCommands, pt as slugifyOpenClawNamePart, q as resolveDaemonServiceDependencyDiagnostics, qi as isOpenMeldManagedBinaryPath, qn as isPnpmGlobalCommandPath, qo as DAEMON_STREAM_CONNECT_TIMEOUT_MS, qr as isAgentExecutionReadyOrConnecting, qt as removeAgentActivityBindingsWhileDeliveryLocked, r as readPendingOpenMeldToolsUpdateAttempt, rn as withAgentActivityLocalStateLock, ro as resolveAuthenticationReasonFromState, rr as normalizeDispatchPostMessageAction, rs as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, rt as resolveReplyReadinessGuidanceSummaryCopy, s as assessCliUpdate, si as createLocalAdapterContainer, sn as emitReconcileCompletedEvidence, sr as buildLocalServiceDiagnosticsPayload, ss as readDaemonServiceContract, st as resolveGatewayChainRepairGuidance, t as createOpenMeldToolsUpdateCoordinator, ta as readLatestDaemonLifecycleConnectionStateEvent, tn as resolveLocalProjectConnectionForPath, to as resolveAuthenticationGuidanceFromError, tr as createSerialAgentInteractionCallback, ts as REGISTER_RESPONSE_TIMEOUT_MS, tt as formatSpaceMemberCommandRecoveryCopy, ua as readPendingDaemonServiceUpdate, ui as forkOpenCodeServerSession, un as resolveAgentProfilePrimaryAgentControllerReport, uo as DAEMON_SERVICE_REPAIR_ANOMALIES, ur as ADAPTIVE_HEARTBEAT_JITTER_RATIO, us as resolveAuthBaseUrl, ut as prepareProviderRuntime, v as isSystemServiceStartupTimeoutError, va as OPENMELD_VERSION, vi as forkCodexAppServerThread, vn as reconcileNewRunnableBuiltinAgentRegistrations, vr as resolveDispatchQueueLogMeta, vt as createRouteCatalogFromMutableState, w as captureDaemonServiceEvidence, wi as buildCliLaunchInvocation, wn as updateAgentRegistrations, wo as describeServerRequiredVersionUnavailableReason, wr as buildRuntimeWorkspaceFingerprint, wt as resolveLocalController, x as writeDaemonServiceContract, xi as createUnavailableProviderUsageLimits, xn as resolveAgentTargetState, xr as resolveCompatibleConversationExecutionState, xs as compareAgentControllerRefsForDisplay, xt as syncDaemonRouteCatalogState, y as resolveSystemServiceStartupWaitMs, yi as verifyCodexAppServerThread, yr as resolveDispatchContinuityObservation, ys as resolveUserFacingCliEntryCommand, yt as loadDaemonRouteCatalog, zi as resolveDaemonRuntimeState, zn as parseAgentEnabledOption, zo as toErrorMessage$19, zr as buildAgentControllerRef } from "./openmeld-tools-update-coordinator-DjrzbnqH.js";
8
- import { $n as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, An as OPENMELD_HEADER_REQUEST_ID, Ar as resumeCenterAgentRoutineResponseSchema, At as createAccountSpaceIndexApi, Br as localProjectControlDaemonFrameSchema, Bt as createFetchTransport, Cn as MAX_TEXT_LENGTH, Cr as submitFeedbackIssueRequestSchema, Dn as resolveCustomMentionAliasOverride, Dr as listCenterAgentRoutineRunsResponseSchema, En as parseServerErrorFrame$1, Er as deleteCenterAgentRoutineResponseSchema, Fn as spaceEntryTargetSchema, Gn as submitAgentControllerTaskLifecycleEventItemSchema, Gt as createOpenMeldApiClient, Hr as leaveSpaceResponseSchema, In as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Jr as spaceMemberDirectoryEntrySchema, Kr as spaceMemberAgentWakeAvailabilitySchema, Kt as createOrganizationApi, Mt as createAgentProfileBindingApi, Nr as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Or as listCenterAgentRoutinesResponseSchema, Pn as getSpaceUpdatesResponseSchema, Pr as agentActivityEventSchema, Qn as gatewayErrorEnvelopeSchema, Rr as agentActivitySnapshotResponseSchema, Sr as organizationComputersResponseSchema, Tn as parseIncoming$1, Tr as createCenterAgentRoutineResponseSchema, Tt as buildSpaceAttachmentDownloadPath, Ur as postSpaceMembersResponseSchema, Vr as localProjectControlDiscoverProjectsResponseSchema, Wr as removeSpaceMembersResponseSchema, Xr as spaceMemberKindSchema, Yr as spaceMemberDirectorySchema, Zt as createProfileSpaceHistoryApi, ai as listProjectsResponseSchema, ar as organizationSpaceDirectoryWithMemberCountsResponseSchema, ci as centerAgentToolSpeakerSchema, cr as spaceMetaSchema, dn as resolveAccountSpaceIndexGatewayHost, ei as agentActivitySessionInventoryResponseSchema, er as OPENMELD_RUNTIME_CAPABILITIES_HEADER, fn as resolveProfileSpaceHistoryGatewayHost, fr as organizationSkillReleaseSummarySchema, gt as buildProfileSpaceHistoryUpsertPath, hr as organizationDirectoryResponseSchema, ht as buildProfileSpaceHistoryStatusPath, ii as createProjectResponseSchema, jn as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, jr as updateCenterAgentRoutineResponseSchema, jt as createAgentActivityApi, kr as pauseCenterAgentRoutineResponseSchema, lr as getOrganizationSkillResponseSchema, mn as toStructuredApiClientFailure, n as OpenMeldApiClientInvalidResponseError, ni as observedLocalAgentSessionSchema, nn as createSpaceApi, nr as computerFileAccessPolicyInputSchema, oi as projectSchema, or as resolveInitialSpaceAccessMode, pr as organizationSkillSummarySchema, qr as spaceMemberDirectoryAllowedRelationsSchema, ri as archiveProjectResponseSchema, rr as computerFileAccessPolicySchema, si as updateProjectResponseSchema, sr as spaceCreatorSchema, t as OpenMeldApiClientHttpError, tn as createRuntimeReportingApi, tr as computerFileAccessDaemonFrameSchema, ur as listOrganizationSkillsResponseSchema, vi as toCompatibleSpaceAddressingRequestWireValue, wn as parseEnvelope$1, wr as submitFeedbackIssueResponseSchema, xn as DAEMON_STREAM_KEEPALIVE_PING, zr as localProjectControlConnectionSchema } from "./dist-C9GguxOC.js";
7
+ import { $a as extractAuthenticationPromptAction, $i as emitDaemonLifecycleEvent, $n as isDaemonReconcileInProgressError, $o as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, $r as renderWorkingLanguagePrompt, A as resolveServiceReadiness, Ai as hasActiveDaemonOwners, An as resolveRegistryRuntimeAdapterCapabilitySnapshot, Ao as resolvePreferredDaemonDeviceId, Ar as resolveConversationExecutionStateByLookupKey, At as ensureOpenMeldManagedProfileWorkspace, B as clearDaemonStartFailureState, Bi as resolveDaemonServiceManagerForRuntimeState, Bn as sortAgentRegistrations, Bo as warnDaemonEvent, Br as buildInformationProtectionPromptPlan, Bt as ProjectBindingOperationError, C as ensureDaemonSystemServiceCommandFiles, Cn as updateAgentCustomTarget, Co as assessServerRequiredVersion, Cr as runRuntimeTask, Ct as readLocalEnabledControllers, D as resolveDaemonStatusSnapshot, Di as inspectDaemonServiceInventory, Dn as resolveSkillsAgentRegistry, Do as buildLedgerPaths, Dr as commitResolvedAgentContext, E as formatDaemonFailureContextText, Ei as createProviderOriginalError, Er as appendLedgerHistoryEntry, Et as syncProfileWorkspaceState, F as buildDaemonServiceStatusReadOnlyDetail, Fi as clearDaemonRuntimeStateIfDefinitelyStopped, Fn as requestLocalDaemonShutdown, Fo as normalizeNonNegativeInteger$1, Fr as buildAuthenticatedControlPlaneResponse, Ft as resolveConfiguredProfileWorkspacePathForAccount, G as buildDaemonServiceDependencySummary, Gi as extractDaemonCommandEntryPath, Gn as isHomebrewCommandPath, Go as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, Gt as listProjectConnectionsWithStatus, H as buildDaemonServiceDependencyDetails, Ha as readDaemonCatalogSyncSignal, Hi as cleanupLegacySharedDaemonServiceState, Hn as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, Ho as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, Hr as createAgentControllerInterfaceDisplayRows, Ht as bindProject, I as buildDaemonServiceUpdateRequiredNextStep, Ia as getOpenMeldProfileCapabilities, Ii as getEffectiveDaemonRuntimeStatus, In as sendLocalDaemonControlPlaneRequest, Io as normalizeOptionalText$21, Ir as buildAgentContextLookupKey, It as setCustomProfileWorkspace, J as resolveCurrentReplyReadinessSnapshot, Ji as cleanupInactiveDaemonServiceBundles, Jn as resolveLocalRegistryAgentIdFromAgentControllerRef, Jo as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, Jt as removeMissingProjectConnections, K as buildDaemonServiceDependencyTitle, Ki as resolveDaemonBundleIdFromEntryPath, Kn as isNpmGlobalCommandPath, Ko as DAEMON_RUNTIME_CONTRACT_EPOCH, L as formatDaemonServiceRefreshReliabilityMessage, La as listOpenMeldProfiles, Li as readCurrentDaemonRuntimeContext, Ln as normalizeAgentId, Lo as normalizeText$2, Lr as DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS, M as buildDaemonServiceRefreshNextStep, Ma as resolveOpenMeldProfileOrNull, Mi as resolveDaemonStopStrategy, Mo as dirnamePath, Mr as settleInflightTask, N as buildDaemonServiceRefreshPromptMessage, Na as createOpenMeldAgentProfile, Ni as resolveStoppedContractWriteBlockedReason, Nn as LocalDaemonControlPlaneClientError, No as emitRunLine, Nr as upsertConversationExecutionState, Nt as readProfileWorkspaceConfigForAccount, O as resolveDaemonStatusAttention, Oi as buildDaemonOwnerSnapshotFromObservedState, On as listBuiltinAgentsRegistryEntries, Oo as ensureDaemonRuntimePaths, Or as loadLedgerState, Ot as resolveCurrentEffectiveProfileWorkingFolderRuntime, P as buildDaemonServiceRepairGuidance, Pa as createOpenMeldHumanProfile, Pi as summarizeDaemonOwnerSnapshot, Po as normalizeHeartbeatIntervalMs, Pr as withLedgerStateTransaction, Q as formatReplyReadinessSummary, Qa as createAuthenticationError, Qi as resolveDaemonBundleEntryPathFromState, Qn as SPACE_ACTION_TARGET_GUIDANCE_LINES, Qo as MAX_RECONNECT_DELAY_MS, Qr as renderInformationProtectionPrompt, Qt as setDefaultProjectConnection, R as formatDaemonServiceUpdateRequiredMessage, Ri as readCurrentObservedDaemonRuntimeStatus, Rn as normalizeAgentIds, Ro as nowIsoString, Rr as areAgentControllerInterfaceAccountsSame, S as buildDaemonSystemServiceCommandSpec, Si as createUnsupportedProviderUsageLimits, Sn as setAgentRegistrationEnabled, So as resolveServiceUpdateUrgency, Sr as resolveLatestScopedConversationExecutionState, Ss as resolveBuiltinAgentControllerBrand, St as buildRuntimeRouteTargets, T as captureDaemonServiceEvidenceBestEffort, Ta as resolveRuntimeContext, Ti as materializeCliLaunchCommand, Tn as canManageRegistryAgentSkillTargets, Tr as buildTaskResultEnvelope, Tt as resolveLocalRuntimeControllerSupport, U as buildDaemonServiceDependencyMeaning, Ui as listDaemonOwnedProcesses, Un as resolveBuiltinAgentControllerDefinition, Uo as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, Ut as isProjectBound, V as writeDaemonStartFailureState, Va as assertAdditionalHumanProfileCreationEnabled, Vi as waitForDaemonSystemServiceToStop, Vn as repairBuiltinControllerInstall, Vo as CATALOG_SYNC_RETRY_INTERVAL_MS, Vr as buildWorkingLanguagePromptPlan, Vt as ProjectBindingStoreUpdateRequiredError, W as buildDaemonServiceDependencyNextStep, Wa as clearAllSelectedOpenMeldProfileIds, Wn as isBunGlobalCommandPath, Wo as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, Wr as createAuthorityOpenMeldServiceRuntimeId, Wt as listProjectBindings, Xa as buildCommandAuthenticationPromptMessage$1, Xi as readDaemonActiveBundleState, Xn as syncRuntimeEventToInflightTaskControlRegistry, Xo as DEFAULT_RECONNECT_DELAY_MS, Xt as resolveProjectBindingForPath, Ya as buildAuthenticationStatusLabel, Yi as prepareDaemonServiceBundle, Yn as normalizeDispatchThreadAction, Yo as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, Yr as parseAgentControllerRef$1, Yt as removeProjectConnection, Za as buildHumanAuthenticationCard, Zi as resolveAlignedDaemonActiveBundleEntryPath, Zn as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Zo as HEARTBEAT_RESPONSE_TIMEOUT_MS, _ as isDaemonInventoryRunningAndStartReady$1, _a as resolveCurrentDaemonExpectedVersion, _i as resolveInstalledCodexLaunchCandidates, _n as readAgentRuntimeConfigHealth, _r as resolveCatalogSyncIntervalMs, _t as createMutableRouteCatalogState, a as resolveOpenMeldToolsMaintenanceProjection, aa as runDaemonServiceManagerAction, ai as resolveSelectableCandidates, an as syncDeviceRuntimeStateProjection, ao as resolveDaemonServiceAlignmentDecision, ar as mergeOpenClawGatewayVisibility, as as clearDaemonServiceContract, at as classifyGatewayChainFailure, b as waitForSystemServiceStartup$1, bi as resolveInstalledClaudeCodeLaunchCandidates, bn as removeAgentCustomTarget, br as resolveCompatibleAgentContextMatch, bt as summarizeSkippedDaemonProfiles, ci as createLocalAdapterEntries, cn as emitReconcileStartedEvidence, co as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, cr as createLocalExecutionSlots, cs as upsertDaemonServiceContract, ct as resolveGatewayChainRetryGuidance, d as scheduleDaemonServiceUpdate, di as resolveInstalledOpenCodeLaunchCandidates, dn as addAgentCustomTarget, do as DAEMON_SERVICE_WAKEABILITY_ADVISORY_ANOMALIES, dr as MAX_HEARTBEAT_INTERVAL_MS, ds as formatInlineOpenMeldCliCommands, dt as buildOpenClawSpaceSessionKey, ea as formatDaemonLifecycleOriginSummary, eo as resolveAuthenticationGuidance, er as resolveRouteRegistrationReconcileDecision, es as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, et as REPLY_READINESS_COPY, f as DaemonServiceLifecycleDrainTimeoutError, fi as GrokBuildAcpTransportError, fn as createRegistrationFromCatalogTarget, fo as classifyDaemonServiceRunStartability, fr as MIN_HEARTBEAT_INTERVAL_MS, fs as formatOpenMeldCliCommand, ft as normalizeOpenClawSpaceIdPrefix, g as uninstallDaemonServiceUpdateWorker, ga as DaemonServiceRunError, gi as resolveCodexTimeoutMs, gn as manageAgentRegistrationInstallation, gr as resolveAdaptiveHeartbeatIntervalMs, gs as formatProfileAwareOpenMeldCliCommand, gt as resolveLocalServiceDemand, ha as readDaemonRuntimeContractRepairReport, hi as projectCodexUsageLimits, hn as listAgentTargetStates, ho as compareSemver, hr as pruneStaleLeases, hs as formatOpenMeldCliTextBlock, ht as writeDaemonRouteCatalogCache, i as readOpenMeldToolsMaintenancePolicy, ia as resolveRecentDaemonSignalStopCause, io as buildDaemonServiceTargetSpec, ir as createPendingAgentInteractionRegistry, is as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, it as resolveOpenClawDiagnosticsGuidance, ja as requireOpenMeldProfile, ji as readCurrentDaemonOwnerSnapshot, jn as resolveRegistryRuntimeAdapterContractByAgentControllerRef, jo as asRecord, jr as seedLegacyAgentContext, k as resolveDaemonStatusAuthenticationAttention, ka as resolveCurrentOpenMeldAccountContext, ki as formatDaemonOwnerSummaryLabel, kn as resolveRegistryOriginLaunchCommand, ko as resolveDaemonDeviceId, kr as removeConversationExecutionState, kt as resolveProfileWorkspaceRuntime, la as readLastDaemonServiceUpdate, li as parseOpenCodeGoUsageResponse, lo as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, lr as createInflightTaskControlRegistry, ls as resolveOpenMeldEnvironmentTarget, lt as resolveOpenClawLocalDiagnosticsValue, m as ensureDaemonServiceMaintenanceInstalled, ma as ensureDaemonRuntimeContractState, mi as resolveInstalledGrokBuildLaunchCandidates, mn as listAgentRegistrations, mr as applyIntervalJitterMs, mt as readDaemonRouteCatalogCache, n as readLastOpenMeldToolsUpdateAttempt, na as readLatestDaemonLifecycleOriginEvent, nn as withAgentActivityDeliveryLock, nr as buildDispatchReplyContextSummary, ns as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, nt as resolveReplyReadinessAvailabilityReasonCopy, o as writeOpenMeldToolsMaintenancePolicy, oa as runWithDaemonLifecycleCommandJournal, oi as resolveCatalogSyncSkippedProfilesLogState, on as emitDriftDetectedEvidence, oo as isVersionDowngrade, or as createLocalTaskInterruptSender, os as isDaemonServiceContractIdentityReusable, p as runDaemonServiceLifecycle, pi as probeGrokBuildAcpInterface, pn as listAgentCustomTargets, po as classifyDaemonServiceWakeability, pr as applyAcceptedLeases, ps as formatOpenMeldCliCommands, pt as slugifyOpenClawNamePart, q as resolveDaemonServiceDependencyDiagnostics, qi as isOpenMeldManagedBinaryPath, qn as isPnpmGlobalCommandPath, qo as DAEMON_STREAM_CONNECT_TIMEOUT_MS, qr as isAgentExecutionReadyOrConnecting, qt as removeAgentActivityBindingsWhileDeliveryLocked, r as readPendingOpenMeldToolsUpdateAttempt, rn as withAgentActivityLocalStateLock, ro as resolveAuthenticationReasonFromState, rr as normalizeDispatchPostMessageAction, rs as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, rt as resolveReplyReadinessGuidanceSummaryCopy, s as assessCliUpdate, si as createLocalAdapterContainer, sn as emitReconcileCompletedEvidence, sr as buildLocalServiceDiagnosticsPayload, ss as readDaemonServiceContract, st as resolveGatewayChainRepairGuidance, t as createOpenMeldToolsUpdateCoordinator, ta as readLatestDaemonLifecycleConnectionStateEvent, tn as resolveLocalProjectConnectionForPath, to as resolveAuthenticationGuidanceFromError, tr as createSerialAgentInteractionCallback, ts as REGISTER_RESPONSE_TIMEOUT_MS, tt as formatSpaceMemberCommandRecoveryCopy, ua as readPendingDaemonServiceUpdate, ui as forkOpenCodeServerSession, un as resolveAgentProfilePrimaryAgentControllerReport, uo as DAEMON_SERVICE_REPAIR_ANOMALIES, ur as ADAPTIVE_HEARTBEAT_JITTER_RATIO, us as resolveAuthBaseUrl, ut as prepareProviderRuntime, v as isSystemServiceStartupTimeoutError, va as OPENMELD_VERSION, vi as forkCodexAppServerThread, vn as reconcileNewRunnableBuiltinAgentRegistrations, vr as resolveDispatchQueueLogMeta, vt as createRouteCatalogFromMutableState, w as captureDaemonServiceEvidence, wi as buildCliLaunchInvocation, wn as updateAgentRegistrations, wo as describeServerRequiredVersionUnavailableReason, wr as buildRuntimeWorkspaceFingerprint, wt as resolveLocalController, x as writeDaemonServiceContract, xi as createUnavailableProviderUsageLimits, xn as resolveAgentTargetState, xr as resolveCompatibleConversationExecutionState, xs as compareAgentControllerRefsForDisplay, xt as syncDaemonRouteCatalogState, y as resolveSystemServiceStartupWaitMs, yi as verifyCodexAppServerThread, yr as resolveDispatchContinuityObservation, ys as resolveUserFacingCliEntryCommand, yt as loadDaemonRouteCatalog, zi as resolveDaemonRuntimeState, zn as parseAgentEnabledOption, zo as toErrorMessage$19, zr as buildAgentControllerRef } from "./openmeld-tools-update-coordinator-D5jLYm-P.js";
8
+ import { $n as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, An as OPENMELD_HEADER_REQUEST_ID, Ar as resumeCenterAgentRoutineResponseSchema, At as createAccountSpaceIndexApi, Br as localProjectControlDaemonFrameSchema, Bt as createFetchTransport, Cn as MAX_TEXT_LENGTH, Cr as submitFeedbackIssueRequestSchema, Dn as resolveCustomMentionAliasOverride, Dr as listCenterAgentRoutineRunsResponseSchema, En as parseServerErrorFrame$1, Er as deleteCenterAgentRoutineResponseSchema, Fn as spaceEntryTargetSchema, Gn as submitAgentControllerTaskLifecycleEventItemSchema, Gt as createOpenMeldApiClient, Hr as leaveSpaceResponseSchema, In as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Jr as spaceMemberDirectoryEntrySchema, Kr as spaceMemberAgentWakeAvailabilitySchema, Kt as createOrganizationApi, Mt as createAgentProfileBindingApi, Nr as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Or as listCenterAgentRoutinesResponseSchema, Pn as getSpaceUpdatesResponseSchema, Pr as agentActivityEventSchema, Qn as gatewayErrorEnvelopeSchema, Rr as agentActivitySnapshotResponseSchema, Sr as organizationComputersResponseSchema, Tn as parseIncoming$1, Tr as createCenterAgentRoutineResponseSchema, Tt as buildSpaceAttachmentDownloadPath, Ur as postSpaceMembersResponseSchema, Vr as localProjectControlDiscoverProjectsResponseSchema, Wr as removeSpaceMembersResponseSchema, Xr as spaceMemberKindSchema, Yr as spaceMemberDirectorySchema, Zt as createProfileSpaceHistoryApi, ai as listProjectsResponseSchema, ar as organizationSpaceDirectoryWithMemberCountsResponseSchema, ci as centerAgentToolSpeakerSchema, cr as spaceMetaSchema, dn as resolveAccountSpaceIndexGatewayHost, ei as agentActivitySessionInventoryResponseSchema, er as OPENMELD_RUNTIME_CAPABILITIES_HEADER, fn as resolveProfileSpaceHistoryGatewayHost, fr as organizationSkillReleaseSummarySchema, gt as buildProfileSpaceHistoryUpsertPath, hr as organizationDirectoryResponseSchema, ht as buildProfileSpaceHistoryStatusPath, ii as createProjectResponseSchema, jn as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, jr as updateCenterAgentRoutineResponseSchema, jt as createAgentActivityApi, kr as pauseCenterAgentRoutineResponseSchema, lr as getOrganizationSkillResponseSchema, mn as toStructuredApiClientFailure, n as OpenMeldApiClientInvalidResponseError, ni as observedLocalAgentSessionSchema, nn as createSpaceApi, nr as computerFileAccessPolicyInputSchema, oi as projectSchema, or as resolveInitialSpaceAccessMode, pr as organizationSkillSummarySchema, qr as spaceMemberDirectoryAllowedRelationsSchema, ri as archiveProjectResponseSchema, rr as computerFileAccessPolicySchema, si as updateProjectResponseSchema, sr as spaceCreatorSchema, t as OpenMeldApiClientHttpError, tn as createRuntimeReportingApi, tr as computerFileAccessDaemonFrameSchema, ur as listOrganizationSkillsResponseSchema, vi as toCompatibleSpaceAddressingRequestWireValue, wn as parseEnvelope$1, wr as submitFeedbackIssueResponseSchema, xn as DAEMON_STREAM_KEEPALIVE_PING, zr as localProjectControlConnectionSchema } from "./dist-BMd3PLFt.js";
9
9
  import { A as runtimeTransportRegisterSessionRequestSchema, Bn as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, Br as runtimeTransportDeliveryExecutionIdentitySchema, C as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Dn as collectCanonicalMentionTextFragments, E as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, En as MESSAGE_MENTION_TYPE_VALUES, Er as string, F as runtimeTransportRouteCatalogChangedFramePayloadSchema, Fr as parseOptionalClientMessageId, G as openMeldDaemonTaskResultPayloadSchema, Gn as formatLocalComponentsSummaryDescription, Gr as resolveSingleSpaceMentionLabels, Hn as agentInteractionRequestSchema, J as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, Jn as formatLocalSetupActionLabel, Kn as formatLocalComponentsSummaryLabel, Kr as resolveSpaceMentionLabels, L as runtimeTransportSubmitTaskResultRequestSchema, Mn as resolveMessageEnvelopeTargetField, N as runtimeTransportResumeControllerConversationFramePayloadSchema, O as runtimeTransportOpenMeldToolsControlFramePayloadSchema, P as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Q as localFolderPickerHelperResultSchema, Qt as spaceFileNameSchema, Rt as SPACE_FILE_MAX_SIZE_BYTES, S as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, St as sanitizeSignalTextPreview, T as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, Tr as strictObject, Ur as normalizeSpacePasswordText, X as localFolderPickerDaemonFrameSchema, Xn as localCliComponentUpdateProjectionSchema, Y as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, Yn as installedLocalComponentsSnapshotSchema, Z as localFolderPickerHelperProtocolResultSchema, _ as runtimeTransportForkAgentSessionResultSchema, a as localWakeRouteWorkingFolderObservationSchema, ai as normalizeOptionalWorkingDirectory, b as runtimeTransportLocalAgentControlCancelFramePayloadSchema, bt as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, c as runtimeTransportDispatchInteractionDeliveredRequestSchema, d as runtimeTransportDispatchLifecycleRequestSchema, er as localServiceComponentUpdateProjectionSchema, f as runtimeTransportDispatchPreviewEndRequestSchema, fr as discriminatedUnion, gi as MAX_TEXT_LENGTH$1, gr as iso, h as runtimeTransportDispatchToolActivityRequestSchema, ht as CONVERSATION_CONTINUITY_WARNING_PURPOSE, j as runtimeTransportRegisterSessionResponseSchema, jn as normalizeMessageEnvelope, jr as url, k as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, kn as getSpaceMessageAddressingRelationSupportForTargetKind, l as runtimeTransportDispatchInteractionRequestSchema, m as runtimeTransportDispatchRuntimeEvidenceRequestSchema, mr as enumFactory, ni as openMeldRequestContextSchema, oi as openMeldRuntimeProfileIdSchema, p as runtimeTransportDispatchPreviewRequestSchema, q as openMeldSpaceEgressActionSchema, qn as formatLocalSetupActionDescription, qt as resolveSpaceFileMimeType, r as daemonStreamFrameSchema, s as runtimeTransportDeliverDispatchRequestSchema, sn as openMeldDaemonControlPlaneResponseSchema, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, u as runtimeTransportDispatchInteractionResponseFramePayloadSchema, ur as boolean, v as runtimeTransportHeartbeatRequestSchema, vr as literal, w as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, x as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, xi as sanitizeDispatchErrorSummary, xt as SPACE_MENTION_REJECT_NOTICE_PURPOSE, y as runtimeTransportHeartbeatResponseSchema, yi as resolvePublicAgentAvailabilityCopy, yt as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, zr as runtimeCoordinatorExecutionTokenEnvelopeSchema } from "./runtime-transport-DtOI3PNe.js";
10
- import { b as computeDirectoryContentHash, f as ensureLocalSkills, g as loadSelectedSkillAssets, r as collectSkillsReadinessSnapshot, t as installSkillsToTargets, u as resolveSkillInstallStateForTarget, v as withSkillsInstallLock, x as OFFICIAL_CLI_SKILL_URL, y as hashBundledSkillAssets } from "./installer-BdECBoja.js";
10
+ import { b as computeDirectoryContentHash, f as ensureLocalSkills, g as loadSelectedSkillAssets, r as collectSkillsReadinessSnapshot, t as installSkillsToTargets, u as resolveSkillInstallStateForTarget, v as withSkillsInstallLock, x as OFFICIAL_CLI_SKILL_URL, y as hashBundledSkillAssets } from "./installer-CR6lINDK.js";
11
11
  import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
12
12
  import { a as readDaemonLocalStateFile, i as writeDaemonRuntimeLease, o as writeDaemonLocalStateFile } from "./daemon-runtime-lease-D9-PBwDj.js";
13
13
  import { a as beginAuthSessionTransition, h as setAuthSession, i as assertAuthSessionMutationAvailable, l as getAuthSessionState, o as clearAuthSession, v as isBinaryDistribution, y as resolveOpenMeldDistribution } from "./auth-session-BBUxZl0r.js";
14
- import { B as createSpaceRemoveMembersCurrentProfileGuideError, Bt as buildSpaceWakeParticipantLines, F as createSpaceLeaveGuideError, G as createSpaceSendInputFileReadFailedGuideError, Gt as renderSpaceEntryBrief, H as createSpaceResultGuideError, Ht as composeDispatchBrief, I as createSpaceMenuGuideError, It as buildCenterAgentRoleTemplateText, J as createSpaceTargetGuideError, K as createSpaceSendInputRequiredGuideError, Kt as resolvePublicAgentFailureReason, L as createSpaceProfileRequiredGuideError, Lt as buildCompactDispatchActionGuidanceLines, M as createSpaceCreateGuideError, N as createSpaceDeleteHumanApprovalGuideError, O as createSpaceAddMembersCurrentProfileGuideError, P as createSpaceLeaveCreatorGuideError, Pt as buildAgentFacingMentalModelLines, R as createSpacePublicationSetGuideError, Rt as buildSpaceAgentIdentityLine, St as getBuiltinAgentSelectionRequiredArguments, Tt as buildAgentOverviewFromContract, U as createSpaceSendInputConflictGuideError, Ut as deriveContinuity, V as createSpaceRemoveMembersGuideError, W as createSpaceSendInputEmptyGuideError, Wt as isSelfWakeSpaceAction, X as createSpaceUpdatesGuideError, Y as createSpaceUnsupportedProfileKindGuideError, _ as errLine, _t as validateDaemonControlTargetInput, a as formatDaemonServiceDowngradeBlockedRecommendation, at as validateSpaceMemberSelectionInput, b as canUseInteractivePrompts, bt as buildBuiltinAgentSelectionExamples, ct as resolveSpaceAddMembersProgressPhase, d as formatDaemonServiceMissingStatus, et as getCommandEntryContract, f as getDaemonDowngradeBlockedTitle, g as formatMessage, h as sanitizeTerminalDisplayText, ht as getCliVersionInfo, i as formatDaemonInstallFailedMessage, j as createSpaceContractSetGuideError, jt as SPACE_COLLABORATION_CONTEXT_RULE, k as createSpaceAddMembersGuideError, kt as formatAgentOverviewPayload, l as formatDaemonServiceMissingRunStepOne, m as createPresenter, mt as formatCliVersionSummary, n as resolveElapsedTimeMs, nt as ROOT_ENTRY_COMMANDS, o as formatDaemonServiceMissingAction, ot as SPACE_ADD_MEMBERS_AGENT_OVERVIEW_STAGES, p as runDaemonInstallDecisionPrompt, q as createSpaceSubcommandTargetGuideError, qt as resolveSpacePublicationRequirement, r as formatDaemonDowngradeBlockedNextStep, rt as ROOT_ENTRY_START_COMMAND, s as formatDaemonServiceMissingMeaning, st as SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS, t as formatElapsedTime, u as formatDaemonServiceMissingRunStepTwo, v as outJsonLine, w as createProfileCreateGuideError, wt as validateBuiltinAgentSelectionInput, x as createAuthLoginGuideError, xt as getBuiltinAgentSelectionOptionalArguments, y as outLine, yt as buildBuiltinAgentSelectionCommand, z as createSpaceRemoveMembersCreatorGuideError, zt as buildSpaceEntryBriefNeedMoreLine } from "./elapsed-time-CiC_hWDp.js";
14
+ import { B as createSpaceRemoveMembersCurrentProfileGuideError, Bt as buildSpaceEntryBriefNeedMoreLine, F as createSpaceLeaveGuideError, Ft as buildAgentFacingMentalModelLines, G as createSpaceSendInputFileReadFailedGuideError, Gt as isSelfWakeSpaceAction, H as createSpaceResultGuideError, I as createSpaceMenuGuideError, J as createSpaceTargetGuideError, Jt as resolveSpacePublicationRequirement, K as createSpaceSendInputRequiredGuideError, Kt as renderSpaceEntryBrief, L as createSpaceProfileRequiredGuideError, Lt as buildCenterAgentRoleTemplateText, M as createSpaceCreateGuideError, N as createSpaceDeleteHumanApprovalGuideError, Nt as SPACE_PERSONAL_CONTRIBUTION_RULE, O as createSpaceAddMembersCurrentProfileGuideError, P as createSpaceLeaveCreatorGuideError, R as createSpacePublicationSetGuideError, Rt as buildCompactDispatchActionGuidanceLines, St as getBuiltinAgentSelectionRequiredArguments, Tt as buildAgentOverviewFromContract, U as createSpaceSendInputConflictGuideError, Ut as composeDispatchBrief, V as createSpaceRemoveMembersGuideError, Vt as buildSpaceWakeParticipantLines, W as createSpaceSendInputEmptyGuideError, Wt as deriveContinuity, X as createSpaceUpdatesGuideError, Y as createSpaceUnsupportedProfileKindGuideError, _ as errLine, _t as validateDaemonControlTargetInput, a as formatDaemonServiceDowngradeBlockedRecommendation, at as validateSpaceMemberSelectionInput, b as canUseInteractivePrompts, bt as buildBuiltinAgentSelectionExamples, ct as resolveSpaceAddMembersProgressPhase, d as formatDaemonServiceMissingStatus, et as getCommandEntryContract, f as getDaemonDowngradeBlockedTitle, g as formatMessage, h as sanitizeTerminalDisplayText, ht as getCliVersionInfo, i as formatDaemonInstallFailedMessage, j as createSpaceContractSetGuideError, jt as SPACE_COLLABORATION_CONTEXT_RULE, k as createSpaceAddMembersGuideError, kt as formatAgentOverviewPayload, l as formatDaemonServiceMissingRunStepOne, m as createPresenter, mt as formatCliVersionSummary, n as resolveElapsedTimeMs, nt as ROOT_ENTRY_COMMANDS, o as formatDaemonServiceMissingAction, ot as SPACE_ADD_MEMBERS_AGENT_OVERVIEW_STAGES, p as runDaemonInstallDecisionPrompt, q as createSpaceSubcommandTargetGuideError, qt as resolvePublicAgentFailureReason, r as formatDaemonDowngradeBlockedNextStep, rt as ROOT_ENTRY_START_COMMAND, s as formatDaemonServiceMissingMeaning, st as SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS, t as formatElapsedTime, u as formatDaemonServiceMissingRunStepTwo, v as outJsonLine, w as createProfileCreateGuideError, wt as validateBuiltinAgentSelectionInput, x as createAuthLoginGuideError, xt as getBuiltinAgentSelectionOptionalArguments, y as outLine, yt as buildBuiltinAgentSelectionCommand, z as createSpaceRemoveMembersCreatorGuideError, zt as buildSpaceAgentIdentityLine } from "./elapsed-time-Dh1RJ98-.js";
15
15
  import { a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, d as createDefaultRuntimeAgentControllerSettings, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig, i as normalizeGatewayBaseUrlOrNull, l as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, o as resolveBaseUrlOrNull, r as normalizeGatewayBaseUrl } from "./base-url-CcjogygH.js";
16
16
  import { n as toErrorMessage$20, t as sleep } from "./dist-o3UL1EGQ.js";
17
17
  import { A as installDaemon, D as ensureDaemonControlPlaneToken, F as readDaemonServiceRuntimeSnapshot, G as withDaemonServiceRunLock, H as uninstallDaemon, I as releaseDaemonServiceLifecycleLock, K as withDaemonServiceStopLock, L as resolveDaemonControlPlaneEndpoint, R as resolveDaemonServiceRuntimeMetadata, U as withDaemonServiceReconcileLock, V as setDaemonServiceRuntimeState, W as withDaemonServiceRegistrationMutationLock, a as DAEMON_SERVICE_RUNTIME_MODE_ENV, c as acquireDaemonServiceLifecycleLock, d as daemonLifecycleJournalPath, g as daemonRuntimeStateRootPath, i as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, j as isDaemonServiceRuntimeHeartbeatStale, k as getDaemonStatus, l as clearDaemonServiceRuntimeState, m as daemonRuntimeRootPath, o as DAEMON_SERVICE_RUNTIME_STATE_SCHEMA, u as daemonDispatchJournalPath, x as daemonServiceRepairJournalPath } from "./daemon-state-DRo7-Vjz.js";
18
18
  import { S as resolveDaemonServiceManager, _ as readDaemonServiceJobCrashExitCode, a as disableDaemonServiceAutostartIfConfigured, c as getDaemonSystemServiceLogPath, d as isDaemonServiceBackgroundExecutionBlocked, o as formatDaemonServiceJobDiagnosticsEvidence, s as getDaemonServiceLaunchdLabel } from "./daemon-service-manager-C-SEgRHn.js";
19
- import { a as buildOpenMeldProfileIdentityRequestHeadersWithAuth, c as buildRequestAuthHeaders, d as buildOpenMeldRequestContextFromProfileIdentity, f as deriveAuthBaseUrlFromGatewayUrl, i as AuthRequestCredentialError, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, o as buildOpenMeldProfileRequestHeadersWithAuth, p as resolveAuthRequestCompatibility, r as resolveSpaceRequestTimeoutMsForDiagnostics, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation, u as buildOpenMeldRequestContextFromProfile } from "./api-client-foundation-MsDmBsQ7.js";
19
+ import { a as buildOpenMeldProfileIdentityRequestHeadersWithAuth, c as buildRequestAuthHeaders, d as buildOpenMeldRequestContextFromProfileIdentity, f as deriveAuthBaseUrlFromGatewayUrl, i as AuthRequestCredentialError, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, o as buildOpenMeldProfileRequestHeadersWithAuth, p as resolveAuthRequestCompatibility, r as resolveSpaceRequestTimeoutMsForDiagnostics, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation, u as buildOpenMeldRequestContextFromProfile } from "./api-client-foundation-BQCtnjoZ.js";
20
20
  import { createHash, randomUUID } from "node:crypto";
21
21
  import { homedir, loadavg } from "node:os";
22
22
  import { basename, delimiter, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -16425,6 +16425,7 @@ function renderActivationIntentGate(input) {
16425
16425
  return [
16426
16426
  "Activation intent gate:",
16427
16427
  "- Decide from the current Wake message and structured addressing before reading Space history or using any tool. Use one brief pass: assigned, referenced_or_candidate, or ambiguous.",
16428
+ "- Coordination is assigned work: a request to contact, delegate to, or collect results from another member makes you responsible, not a candidate.",
16428
16429
  `- If you are only a candidate, example, alternative, or possible helper while another Agent owns the request, call dispatch-scoped Space Action \`stay_silent\` with reason \`activation_intent.referenced_or_candidate\`; only if unavailable, run \`${buildSpaceActionCommand("silent --reason \"activation_intent.referenced_or_candidate\"")}\`. Stop before reading history, calling business tools, or publishing an explanation.`,
16429
16430
  "- An explicit Wake target does not by itself prove that the words assign work to you. If the message directly assigns you work, continue. When the intent remains ambiguous, honor the explicit Wake and continue; never rewrite the user's structured targets."
16430
16431
  ].join("\n");
@@ -16443,7 +16444,8 @@ function renderEntryBriefSection(input) {
16443
16444
  return renderSpaceEntryBrief({
16444
16445
  needMore: buildSpaceEntryBriefNeedMoreLine({
16445
16446
  cliEntry: input.cliEntry,
16446
- spaceId: input.spaceId
16447
+ spaceId: input.spaceId,
16448
+ targetProfileId: input.targetProfileId
16447
16449
  }),
16448
16450
  spaceGuide: input.spaceGuide,
16449
16451
  thisSpace: buildThisSpaceLine(input),
@@ -16483,7 +16485,8 @@ function renderDispatchBriefSection(input) {
16483
16485
  ...dispatchBrief.continuity,
16484
16486
  cliEntry: input.cliEntry,
16485
16487
  sourceSignalId: input.sourceSignalId,
16486
- spaceId: input.spaceId
16488
+ spaceId: input.spaceId,
16489
+ targetProfileId: input.targetProfileId
16487
16490
  }),
16488
16491
  `- Actions: ${dispatchBrief.whatYouCanDoNow}`,
16489
16492
  ...buildProgressiveContextGuidanceLines(input),
@@ -16493,7 +16496,7 @@ function renderDispatchBriefSection(input) {
16493
16496
  }
16494
16497
  function buildCurrentWakeContextLines(input) {
16495
16498
  const sourceSignalId = normalizeOptionalText$21(input.sourceSignalId);
16496
- const updatesCommand = `${normalizeOptionalText$21(input.cliEntry) ?? "openmeld"} space updates ${normalizeOptionalText$21(input.spaceId) ?? "<space-id>"} --after-signal ${sourceSignalId} --view agent --json`;
16499
+ const updatesCommand = `${normalizeOptionalText$21(input.cliEntry) ?? "openmeld"} space updates ${normalizeOptionalText$21(input.spaceId) ?? "<space-id>"} --after-signal ${sourceSignalId} --profile ${input.targetProfileId} --view agent --json`;
16497
16500
  return buildSpaceWakeParticipantLines({
16498
16501
  targetProfileId: input.targetProfileId,
16499
16502
  activationTargets: input.sourceMessageEnvelope?.activationTargets ?? [],
@@ -16555,20 +16558,21 @@ function buildSendTargetReferenceLines(input) {
16555
16558
  function buildSpaceHistoryCommand(input) {
16556
16559
  const cliEntry = normalizeOptionalText$21(input.cliEntry) ?? "openmeld";
16557
16560
  const normalizedSpaceId = normalizeOptionalText$21(input.spaceId);
16558
- return normalizedSpaceId ? `${cliEntry} space history ${normalizedSpaceId} --kind text --limit 20` : `${cliEntry} space history <space-id> --kind text --limit 20`;
16561
+ return normalizedSpaceId ? `${cliEntry} space history ${normalizedSpaceId} --kind text --limit 20 --profile ${input.targetProfileId} --view agent` : `${cliEntry} space history <space-id> --kind text --limit 20 --profile ${input.targetProfileId} --view agent`;
16559
16562
  }
16560
16563
  function buildSpaceThreadCommand(input) {
16561
- return `${normalizeOptionalText$21(input.cliEntry) ?? "openmeld"} space thread ${normalizeOptionalText$21(input.spaceId) ?? "<space-id>"} ${input.threadId} --view agent`;
16564
+ return `${normalizeOptionalText$21(input.cliEntry) ?? "openmeld"} space thread ${normalizeOptionalText$21(input.spaceId) ?? "<space-id>"} ${input.threadId} --profile ${input.targetProfileId} --view agent`;
16562
16565
  }
16563
16566
  function buildSpaceContextWindowCommand(input) {
16564
- return `${normalizeOptionalText$21(input.cliEntry) ?? "openmeld"} space history ${input.spaceId} --around-signal ${input.sourceSignalId} --before 20 --after 0 --kind text`;
16567
+ return `${normalizeOptionalText$21(input.cliEntry) ?? "openmeld"} space history ${input.spaceId} --around-signal ${input.sourceSignalId} --before 20 --after 0 --kind text --profile ${input.targetProfileId} --view agent`;
16565
16568
  }
16566
16569
  function buildProgressiveContextGuidanceLines(input) {
16567
16570
  const lines = [];
16568
16571
  if (input.threadContext?.threadId) lines.push(`- Exact thread context: run \`${buildSpaceThreadCommand({
16569
16572
  cliEntry: input.cliEntry,
16570
16573
  spaceId: input.spaceId,
16571
- threadId: input.threadContext.threadId
16574
+ threadId: input.threadContext.threadId,
16575
+ targetProfileId: input.targetProfileId
16572
16576
  })}\` only if the provided reply context is insufficient.`);
16573
16577
  return lines;
16574
16578
  }
@@ -16610,7 +16614,8 @@ function renderContinuityLine(input) {
16610
16614
  const readCommand = buildSpaceContextWindowCommand({
16611
16615
  cliEntry: input.cliEntry,
16612
16616
  sourceSignalId,
16613
- spaceId: input.spaceId
16617
+ spaceId: input.spaceId,
16618
+ targetProfileId: input.targetProfileId
16614
16619
  });
16615
16620
  return `- Since your last public reply: ${parts.join("; ")} (run \`${readCommand}\` for bounded context)`;
16616
16621
  }
@@ -21179,29 +21184,32 @@ function attachAgentReplyObservation(input) {
21179
21184
  function buildAgentReplyReconsiderationPrompt(input) {
21180
21185
  const updates = input.relevantSignals.map((signal) => ({
21181
21186
  actorProfileId: readCollaborationActorProfileId(signal),
21187
+ authorKind: signal.profile.kind,
21182
21188
  outcome: resolveCollaborationOutcome(signal),
21183
21189
  signalId: signal.id,
21184
- text: readSignalText(signal).slice(0, SIGNAL_TEXT_LIMIT)
21190
+ text: readSignalText(signal).slice(0, SIGNAL_TEXT_LIMIT),
21191
+ truncated: readSignalText(signal).length > SIGNAL_TEXT_LIMIT
21185
21192
  }));
21186
21193
  return [
21187
21194
  "OpenMeld concurrent Space update review.",
21188
21195
  `Space: ${input.spaceId}`,
21189
- "Continue the assignment below. This review is not a new Wake: do not run activation-intent classification against the newer messages or treat their author as the task owner.",
21196
+ "Continue the original Wake, not a new assignment: do not run activation-intent classification against the newer messages. Another Agent's reply does not turn you into a reference or candidate or transfer your assignment.",
21190
21197
  `Original Wake (the assignment being completed): ${JSON.stringify(input.originalWake)}`,
21191
- "Other public collaboration messages arrived after the room state used for your proposed reply.",
21198
+ "This bounded view includes earlier review facts as well as new public messages, in publication order. Prior review turns may not be present in this conversation.",
21199
+ SPACE_COLLABORATION_CONTEXT_RULE,
21192
21200
  "Your previous action is an unpublished proposal.",
21193
- "If a dispatch-scoped Space Action command said it was accepted, that only means OpenMeld recorded a replaceable proposal; it does not mean the Space published it or that you used your one public reply.",
21194
- "You still have one public reply available for this Wake.",
21195
- "Do not redo completed work, repeat tool calls, or repeat external side effects.",
21201
+ "An accepted action acknowledgement does not mean the Space published it. You still have one public reply available for this Wake.",
21202
+ "Do not redo completed work or repeat external side effects.",
21196
21203
  "A failed, stopped, or silent outcome is not a public contribution. Use it only as truthful availability and coordination context.",
21197
21204
  "Keep the user's full request as the goal. Reconsider only the final Space action in light of these newer messages.",
21198
- "This is a review within your original Wake, not a new assignment. Another Agent's reply does not turn you into a reference or candidate, or transfer the user's request to that Agent.",
21199
- "If the user asked each woken Agent to respond, acknowledge, or report its own result, your own response remains a distinct contribution even when another Agent has already answered. A direct ping to multiple Agents asks each of them to acknowledge.",
21200
- "Replace the proposal when a distinct, useful contribution is still possible. Avoid duplicating work or a conclusion another Agent has already posted.",
21201
- "Choose stay_silent only when no distinct, useful, non-duplicative contribution remains.",
21202
- "Call exactly one dispatch-scoped OpenMeld Space Action tool for the final action. Use the CLI only if the tool is unavailable. Answer text never becomes an action.",
21205
+ SPACE_PERSONAL_CONTRIBUTION_RULE,
21206
+ "For dependent contributions, follow the user's shared constraints and confirmed contributions. In an ordered sequence, contribute only the next valid step, not a future step with unpublished prerequisites. A participant list or proposed division of work is not evidence that earlier steps happened. Avoid duplicating completed work, not requested personal answers.",
21207
+ "Call exactly one dispatch-scoped OpenMeld Space Action tool for the final action and inspect its acknowledgement. Discover the tool before concluding it is unavailable; use the provided CLI only if unavailable. Answer text never becomes an action.",
21208
+ "Record the final action even if you keep the same answer.",
21209
+ ...input.omittedThroughSignalId ? [`Earlier review messages through signal ${JSON.stringify(input.omittedThroughSignalId)} were omitted from this bounded view. Absence is not evidence that nothing happened. Read the originating Space or thread history if those facts affect your action.`] : [],
21210
+ "A truncated message is an excerpt; read its original when omitted details affect your action.",
21203
21211
  `Previous proposed action: ${JSON.stringify(input.action)}`,
21204
- `Newer Space messages: ${JSON.stringify(updates)}`
21212
+ `Observed Space messages: ${JSON.stringify(updates)}`
21205
21213
  ].join("\n");
21206
21214
  }
21207
21215
  async function coordinateDispatchAgentReply(input) {
@@ -21209,11 +21217,24 @@ async function coordinateDispatchAgentReply(input) {
21209
21217
  let observation = input.observation;
21210
21218
  let reconsiderationCount = 0;
21211
21219
  let value = input.currentValue;
21220
+ const observedSignals = /* @__PURE__ */ new Map();
21221
+ let omittedThroughSignalId;
21212
21222
  while (observation.status === "changed") {
21223
+ for (const signal of observation.relevantSignals) {
21224
+ observedSignals.set(signal.id, signal);
21225
+ if (observedSignals.size > OBSERVATION_LIMIT) {
21226
+ const oldestId = observedSignals.keys().next().value;
21227
+ if (oldestId) {
21228
+ observedSignals.delete(oldestId);
21229
+ omittedThroughSignalId = oldestId;
21230
+ }
21231
+ }
21232
+ }
21213
21233
  const reconsidered = await input.reconsider(buildAgentReplyReconsiderationPrompt({
21214
21234
  action,
21215
21235
  originalWake: input.originalWake,
21216
- relevantSignals: observation.relevantSignals,
21236
+ relevantSignals: [...observedSignals.values()],
21237
+ omittedThroughSignalId,
21217
21238
  spaceId: input.spaceId
21218
21239
  }), observation);
21219
21240
  action = reconsidered.action;
@@ -21249,7 +21270,7 @@ function isNewHumanWake(signal) {
21249
21270
  return Boolean(signal.type === "signal.text" && signal.data.messageEnvelope?.activationTargets.length);
21250
21271
  }
21251
21272
  function readCollaborationActorProfileId(signal) {
21252
- return buildSpaceRoundSignalPublication(signal)?.actorProfileId ?? null;
21273
+ return signal.profile.kind === "human" ? signal.profile.profileId : buildSpaceRoundSignalPublication(signal)?.actorProfileId ?? null;
21253
21274
  }
21254
21275
  function resolveCollaborationOutcome(signal) {
21255
21276
  if (signal.type === "signal.text") return "contribution";
@@ -56778,6 +56799,7 @@ function buildSpaceHistoryBriefMessage(input) {
56778
56799
  text: briefText.text,
56779
56800
  textOriginalCharacters: briefText.originalCharacters,
56780
56801
  textTruncated: briefText.truncated,
56802
+ ...input.event.type === "signal.text" && input.event.data.files?.length ? { files: input.event.data.files } : {},
56781
56803
  ...briefText.truncated ? { fullTextCommand: formatOpenMeldCliCommand(`openmeld space history ${input.spaceId} --around-signal ${input.event.id} --before 0 --after 0 --kind ${toHistoryKindOption(input.event.type)} --profile ${input.profileId} --view agent`) } : {},
56782
56804
  ...messageReadProjection?.replyToSignalId ? { replyTo: messageReadProjection.replyToSignalId } : {},
56783
56805
  ...messageReadProjection?.wakeTargets.length ? { wakeTargets: messageReadProjection.wakeTargets } : {},
@@ -63673,4 +63695,4 @@ function isHumanInteractiveSpaceRuntime(runtime) {
63673
63695
  //#endregion
63674
63696
  export { runAgentsDisable as $, getCurrentCommandCheckState as $n, ensureCommandAuthenticationOrCancel as $t, parseEnvelope as A, resolveLocalAgentControllerReportDecision as An, readControllerTaskLifecycleOutboxHealth as Ar, buildProfileWorkspaceRows as At, resolveSpaceWebGatewayOrigin as B, createSpaceMemberIdentityIndex as Bn, getOrganizationJoinLinkResponseSchema as Br, fetchSpaceMeta as Bt, toSpaceMetaUpsertInput as C, computeRetryDelayMs as Cn, normalizeSharedSessionTitle as Cr, runDaemonRunAfterEntryChecks as Ct, formatHumanReadTargetList as D, collectLocalAgentControllerInventory as Dn, readAgentActivityOutboxHealth as Dr, runDaemonTeardownStrict as Dt, buildHumanReplyContextSummary as E, submitRuntimeAgentControllerReports as En, removeProjectInbox as Er, runDaemonStop as Et, resolveOpenMeldProfileForSpaceCommand as F, buildPublicSpaceEntryUrl as Fn, cliJsonOutputEnvelopeSchema as Fr, runDaemonStartDecisionPrompt as Ft, runDaemonServiceParticipationGate as G, runInteractivePrompt as Gn, parseJsonResponse$1 as Gt, resolveHumanControllerDisplayName as H, promptSearchMultiselect as Hn, organizationJoinLinkManagementQuerySchema as Hr, readGatewayJsonResponse as Ht, emitSpaceAgentOverview as I, buildSignalIndex as In, cliJsonSkillsListEnvelopeSchema as Ir, runDaemonStartupPreflight as It, runAgentsCustomAdd as J, readDispatchSpaceActionContextFromEnv as Jn, resolveDaemonServiceParticipationStatus as Jt, runAgents as K, assertDispatchOwnedRuntimePublicWriteAllowed as Kn, resolveLocalComponentsStatus as Kt, emitSpaceCliAgentOverview as L, buildSignalMessageReadProjection as Ln, cliJsonSkillsLoadEnvelopeSchema as Lr, readDaemonStartFailureLogTailLines as Lt, assertFullSignalIdArgument as M, upsertSpaceConfig as Mn, renderTextInfoCard as Mr, emitDaemonAgentOverview as Mt, assertValidSpaceIdTarget as N, buildDispatchResultMessageReadProjection as Nn, emitCliJsonEnvelope as Nr, createDelayedSpinner as Nt, resolveLinkAccessLabel as O, resolveLocalAgentControllerBlockerReasonCodes as On, removeProjectOutbox as Or, runDaemonUninstall as Ot, prepareAuthenticatedSpaceCommandContext as P, buildDispatchResultReplyWorkflowProjection as Pn, cliJsonErrorEnvelopeSchema as Pr, shouldEmitAgentOverview as Pt, runAgentsDetect as Q, finishCurrentCommandCheckScope as Qn, buildCommandAuthenticationPromptMessage as Qt, prepareLocalAgentReadiness as R, buildSpaceRoundReadProjection as Rn, cliJsonSkillsShowEnvelopeSchema as Rr, fetchSpaceUpdates as Rt, loadSpaceSignalIndexOrNull as S, assessActionParticipationCandidate as Sn, resolveObservedAgentActivityBinding as Sr, runDaemonReinstall as St, buildFormalSignalReadPayload as T, submitRuntimeAgentControllerReport as Tn, enqueueAgentActivityHookEvent as Tr, runDaemonStatusFlow as Tt, persistAgentTransportSelection as U, promptSearchSelect as Un, revokeOrganizationJoinLinkResponseSchema as Ur, readGatewayTextResponse as Ut, buildReplyReadinessGuidance as V, formatRemovedCcRelationMessage as Vn, organizationJoinLinkErrorResponseSchema as Vr, updateSpaceMeta as Vt, resolveAgentProfileSetup as W, isReturnKeypress as Wn, toStructuredGatewayFailure as Wt, runAgentsCustomRemove as X, DISPATCH_OWNED_RUNTIME_MODE as Xn, readRecentDaemonDispatchJournalEvents as Xt, runAgentsCustomList as Y, writeDispatchSpaceActionRecord as Yn, readRuntimeReportingHealthState as Yt, runAgentsCustomUpdate as Z, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as Zn, connectWebSocket as Zt, runSpaceWriteWithPasswordRetry as _, resolveCreateProfileName as _n, uninstallAgentActivityIntegrations as _r, runDaemonAutostart as _t, runSpaceDelete as a, exchangeOneTimeTokenAuthSession as an, renderHumanTextErrorCard as ar, formatTransportModeDisplay as at, buildIdentityOnlyMembersSnapshotForReadProjection as b, formatServiceParticipationReadinessLabel as bn, removeAgentActivityContextCache as br, runDaemonInstall as bt, runSpaceLeave as c, formatActiveOrganizationLabel as cn, isAgentActivityRouteRegistered as cr, printOpenMeldBanner as ct, runSpaceRemoveMembers as d, requestDeviceToken as dn, unregisterAgentActivityRoute as dr, renderOpenMeldLogo as dt, evaluateCommandAuthentication as en, isCurrentCommandCheckScopeActive as er, runAgentsEnable as et, runSpaceSend as f, resolveDeviceAuthClientId as fn, AGENT_ACTIVITY_INTEGRATION_OWNER as fr, renderOpenMeldTagline as ft, runSpaceReadWithPasswordRetry as g, resolveCreateProfileKind as gn, resolveAgentActivityDispatcherCommand as gr, runDaemon as gt, uploadPreparedSpaceFiles as h, createProfileByKind as hn, readAgentActivityIntegrationStatus as hr, isManagedSystemServiceBootstrapRun as ht, runSpaceCreate as i, runAuthStatus as in, renderHumanErrorCard as ir, runAgentsShow as it, isSpaceCommandOutputHandledError as j, inspectSpaceCacheFile as jn, renderInfoCard as jr, reconcileCliVersionView as jt, resolveOrganizationVisibilityLabel as k, resolveLocalAgentControllerLaunchability as kn, enqueueControllerTaskLifecycleEventWhileLocked as kr, buildProfileWorkspacePresentation as kt, runSpaceList as l, extractAuthApiErrorMessage as ln, registerAgentActivityRoute as lr, renderOpenMeldBrandBlockLines as lt, prepareRequestedSpaceSendFiles as m, revokeAuthAccessToken as mn, installAgentActivityIntegrations as mr, bestEffortStopCurrentLaneDaemonService as mt, promptAndConfirmSpacePassword as n, runAuthLogout as nn, startCurrentCommandCheckScope as nr, runAgentsManage as nt, runSpaceHistory as o, buildAuthStatusRows as on, LocalProjectConnectionError as or, colorizeAgentLabel as ot, runSpaceWatch as p, resolveDeviceTokenExpiresAt as pn, defaultManagedIntegrationPaths as pr, resolveSpaceSendText as pt, runAgentsConfig as q, readDispatchOwnedRuntimeGuard as qn, writeInstalledLocalComponentsSnapshot as qt, runSpaceAddMembers as r, runAuthMenu as rn, buildHumanErrorCopy as rr, runAgentsRepair as rt, runSpaceJoin as s, buildAuthStatusSnapshot as sn, validateLocalProjectConnectionPath as sr, colorizeDisplayProfileLabel as st, buildCreateSpacePasswordPromptConfig as t, runAuthLogin as tn, resetCurrentCommandCheckState as tr, runAgentsList as tt, runSpacePassword as u, fetchAuthUserSnapshot as un, resolveAgentActivityRouteForPath as ur, renderOpenMeldHeader as ut, buildHumanReadSignalsTranscriptItems as v, promptTextEntry as vn, syncLocalAgentActivity as vr, runDaemonBackgroundStartForDecision as vt, buildFormalDispatchResultReadPayload as w, submitProfileRuntimeAgentControllerReport as wn, readCodexSessionTitles as wr, runDaemonSnapshot as wt, loadSpaceIdentityDirectoryOrNull as x, resolveServiceParticipationReadiness as xn, buildAgentActivityEvent as xr, runDaemonInterrupt as xt, emitHumanReadSignalsTextProjection as y, ensureAgentProfileRuntimeBinding as yn, readAgentActivityContextForPath as yr, runDaemonCancel as yt, resolveGatewayWebOrigin as z, buildUpdatesReplyWorkflowProjection as zn, acceptOrganizationJoinLinkBodySchema as zr, createCliSpaceApi as zt };
63675
63697
 
63676
- //# sourceMappingURL=command-CbW36uDg.js.map
63698
+ //# sourceMappingURL=command-MGSPy6o5.js.map