@ai-workbench/connect 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/components.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/components.js
CHANGED
|
@@ -6,7 +6,7 @@ export function registerComponents(ctx, inventory, temporaryDataParent, componen
|
|
|
6
6
|
const api = () => ctx.get('aiWorkbenchConnect');
|
|
7
7
|
const getState = () => {
|
|
8
8
|
const network = ctx.get('aiWorkbenchNetwork'), connect = api(), state = connect?.getState(), networkState = network?.getState();
|
|
9
|
-
return { workspaceBindings: connect?.getWorkspaceBindingState?.() ?? null, loginComponent: { temporaryDataParent: temporaryDataParent ?? null, download: component?.getState() ?? null, source: sources?.getState() ?? null, observationIntervalMs }, startup: connect?.getLoginPromptState?.() ?? null, inventory: inventory ?? null, network: { serviceProvided: !!network, phase: networkState?.phase ?? 'missing', needCode: networkState?.error?.code ?? networkState?.need?.code }, enrollment: connect?.getEnrollmentState?.() ?? null, connection: connect?.getConnectionState?.() ?? null, connect: { serviceProvided: !!connect, phase: state?.phase ?? 'missing', message: state?.need ? employeeMessage(state.need.code) : '连接服务等待就绪' }, codex: inventory ? { installed:
|
|
9
|
+
return { workspaceBindings: connect?.getWorkspaceBindingState?.() ?? null, loginComponent: { temporaryDataParent: temporaryDataParent ?? null, download: component?.getState() ?? null, source: sources?.getState() ?? null, observationIntervalMs }, startup: connect?.getLoginPromptState?.() ?? null, inventory: inventory ?? null, network: { serviceProvided: !!network, phase: networkState?.phase ?? 'missing', needCode: networkState?.error?.code ?? networkState?.need?.code }, enrollment: connect?.getEnrollmentState?.() ?? null, connection: connect?.getConnectionState?.() ?? null, connect: { serviceProvided: !!connect, phase: state?.phase ?? 'missing', message: state?.need ? employeeMessage(state.need.code) : '连接服务等待就绪' }, codex: inventory?.codex ? { installed: true, message: 'Codex 组件已安装' } : { installed: null, message: '组件清单未装配' } };
|
|
10
10
|
};
|
|
11
11
|
ctx.provide('aiWorkbenchComponents', { getState });
|
|
12
12
|
ctx.inject(['webServer', 'connection'], host => {
|
package/lib/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface Config {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
export declare const Config: z<Config>;
|
|
38
|
-
export declare function register(ctx: Context, ports: Ports,
|
|
38
|
+
export declare function register(ctx: Context, ports: Ports, _inventory?: ComponentInventory, extend?: (api: import('./api.ts').ConnectApi) => void): void;
|
|
39
39
|
export declare function apply(ctx: Context, config?: Config): void;
|
|
40
40
|
export { createProfileEnrollment } from './profile-enrollment.ts';
|
|
41
41
|
export { createWorkspaceBindings } from './workspace-bindings.ts';
|
package/lib/index.js
CHANGED
|
@@ -34,8 +34,9 @@ export const Config = z.object({
|
|
|
34
34
|
executable: z.string().description('darwin-arm64默认Electron.app/Contents/MacOS/Electron;其他平台无默认,管理员可改'), loginOutputMaxBytes: positive().default(L_DEFAULTS.loginOutputMaxBytes).description('登录进程输出字节上限;owner已定1048576,管理员可改'), ipcMaxBytes: positive().default(L_DEFAULTS.ipcMaxBytes).description('私有IPC字节上限;owner已定1048576,管理员可改'),
|
|
35
35
|
}),
|
|
36
36
|
});
|
|
37
|
-
export function register(ctx, ports,
|
|
38
|
-
|
|
37
|
+
export function register(ctx, ports, _inventory, extend) {
|
|
38
|
+
// 当前独立插件始终检查两品牌;保留旧inventory参数兼容调用,但不以交付清单开关能力。
|
|
39
|
+
const api = createConnect(ports, state => ctx.emit('ai-workbench/connect-state', state), { onConnectionState: state => ctx.emit('ai-workbench/connection-state', state), onPromptState: state => ctx.emit('ai-workbench/login-prompt-state', state), onPromptResult: result => ctx.emit('ai-workbench/login-prompt-result', result) });
|
|
39
40
|
extend?.(api);
|
|
40
41
|
ctx.provide('aiWorkbenchConnect', api);
|
|
41
42
|
ctx.effect(() => { void api.refreshLoginPrompts(); return () => api.dispose(); });
|