Skip to content

Commit 397e05b

Browse files
authored
Merge branch 'main' into posthog-code/channel-task-diff-button
2 parents 48958a6 + 73b695c commit 397e05b

49 files changed

Lines changed: 2150 additions & 364 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/code/src/main/services/auth/port-adapters.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ import {
3737

3838
@injectable()
3939
export class TokenCipherPortAdapter implements IAuthTokenCipher {
40-
encrypt(plaintext: string): string {
41-
return encrypt(plaintext);
40+
encrypt(plaintext: string): Promise<string> {
41+
return Promise.resolve(encrypt(plaintext));
4242
}
4343

44-
decrypt(encrypted: string): string | null {
45-
return decrypt(encrypted);
44+
decrypt(encrypted: string): Promise<string | null> {
45+
return Promise.resolve(decrypt(encrypted));
4646
}
4747
}
4848

apps/code/src/renderer/desktop-services.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ import {
5050
} from "@posthog/core/speech/identifiers";
5151
import { resolveService } from "@posthog/di/container";
5252
import { ROOT_LOGGER, type RootLogger } from "@posthog/di/logger";
53+
import {
54+
HOST_CAPABILITIES,
55+
type HostCapabilities,
56+
} from "@posthog/platform/host-capabilities";
5357
import {
5458
type INotifications,
5559
NOTIFICATIONS_SERVICE,
@@ -441,3 +445,7 @@ container
441445
.inSingletonScope();
442446

443447
container.bind(SETUP_STORE).toConstantValue(setupStore);
448+
449+
container
450+
.bind(HOST_CAPABILITIES)
451+
.toConstantValue({ localWorkspaces: true } satisfies HostCapabilities);

apps/code/src/renderer/di/bindings.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ import {
139139
HOST_TRPC_CLIENT,
140140
type HostTrpcClient,
141141
} from "@posthog/host-router/client";
142+
import {
143+
HOST_CAPABILITIES,
144+
type HostCapabilities,
145+
} from "@posthog/platform/host-capabilities";
142146
import {
143147
type INotifications,
144148
NOTIFICATIONS_SERVICE,
@@ -338,6 +342,7 @@ export interface RendererBindings {
338342
[FEATURE_FLAGS]: FeatureFlags;
339343
[AUTH_SIDE_EFFECTS]: IAuthSideEffects;
340344
[SETUP_STORE]: ISetupStore;
345+
[HOST_CAPABILITIES]: HostCapabilities;
341346

342347
// --- desktop-contributions.ts ---
343348
[CONTRIBUTION]: Contribution;

apps/code/src/renderer/main.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ import { Providers } from "@components/Providers";
1919
import { DevToolbarHost } from "@features/dev-toolbar/DevToolbarHost";
2020
import { preloadHighlighter } from "@pierre/diffs";
2121
import { boot } from "@posthog/di/contribution";
22+
import { assertHostCapabilities } from "@posthog/di/hostCapabilities";
2223
import { ServiceProvider } from "@posthog/di/react";
2324
import App from "@posthog/ui/shell/App";
2425
import { logger } from "@posthog/ui/shell/logger";
2526
import { initializePostHog } from "@posthog/ui/shell/posthogAnalyticsImpl";
27+
import { REQUIRED_HOST_CAPABILITIES } from "@posthog/ui/shell/requiredHostCapabilities";
2628
import { registerDesktopContributions } from "@renderer/desktop-contributions";
2729
import { container } from "@renderer/di/container";
2830
import "@renderer/desktop-services";
@@ -95,6 +97,11 @@ const root = ReactDOM.createRoot(rootElement);
9597

9698
try {
9799
registerDesktopContributions();
100+
// Fail loudly (into BootErrorScreen) if a capability the shared app resolves
101+
// via service location is unbound, rather than deferring to the first
102+
// navigation that needs it. The renderer container backs every useService, so
103+
// all required tokens must resolve here. Shared with the web host.
104+
assertHostCapabilities(container, REQUIRED_HOST_CAPABILITIES);
98105
boot(container).catch((error: unknown) => {
99106
bootLog.error("Renderer boot sequence failed", error);
100107
// Replaces the mounted tree without running effect cleanup; acceptable

packages/agent/src/acp-extensions.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,22 @@ export const POSTHOG_NOTIFICATIONS = {
8686

8787
/** RTK output-compression token savings tallied at the end of a run */
8888
RTK_SAVINGS: "_posthog/rtk_savings",
89+
90+
/** Latest native Codex goal state, persisted so cold cloud resumes can restore it. */
91+
CODEX_GOAL: "_posthog/codex_goal",
8992
} as const;
9093

94+
export type NativeGoalState = {
95+
objective: string;
96+
status:
97+
| "active"
98+
| "paused"
99+
| "blocked"
100+
| "usageLimited"
101+
| "budgetLimited"
102+
| "complete";
103+
};
104+
91105
/**
92106
* Custom request methods for PostHog-specific operations that need a response
93107
* (request/response, not fire-and-forget). Used with

0 commit comments

Comments
 (0)