@qilin-agent/client-ui-plan 0.0.0-stage → 3.1.4

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/lib/index.js ADDED
@@ -0,0 +1,13 @@
1
+ //#region lib/types/index.js
2
+ /**
3
+ * Plan control plugin, node half. Pure UI plugin: the empty apply exists so
4
+ * the plugin appears in the host cordis.yml / Loader; the browser half ships
5
+ * via exports["./client"], discovered through the package.json qilin.client
6
+ * declaration. Plan behavior itself (the /plan command, the plan projection
7
+ * unit, the policy section) is owned by `@qilin-agent/plan-mode`,
8
+ * composed independently on the host roster.
9
+ */
10
+ /** Host plugin body — no host-side behavior for this surface plugin. */
11
+ function apply() {}
12
+ //#endregion
13
+ export { apply };
@@ -0,0 +1,26 @@
1
+ import type { InjectFace, PropsLocale, PropsRuntime, PropsStore } from '@qilin-agent/client-ui-slots';
2
+ import type { ToolCallId } from '@qilin-agent/llm/brand';
3
+ import type { createPlanReviewStore } from './review-store.ts';
4
+ /** Session-bound navigation for logged plans. */
5
+ export interface PlanOpenInjected {
6
+ /** Open or focus the exact submitted plan. */
7
+ openPlan: (callId: ToolCallId) => void;
8
+ }
9
+ /** Session-bound preview navigation for one pending review. */
10
+ export interface PlanReviewOpenInjected {
11
+ /** Open the logged plan, or the request's temporary document when no invocation exists. */
12
+ openReview: (review: PropsRuntime<'conversation.plan-review.actions'>['review'], requestKey: string) => void;
13
+ }
14
+ /**
15
+ * Render the completed Turn's submitted plans in invocation order.
16
+ * @param props - Logged plan, localized copy, and Session-bound navigation.
17
+ * @returns keyboard-accessible plan cards, or null for a Turn without plans.
18
+ */
19
+ export declare function PlanCards({ turn, useChat, openPlan, t }: PropsRuntime<'conversation.chat.turnTail'> & InjectFace<PlanOpenInjected> & PropsLocale<'plan'>): import("react").JSX.Element | null;
20
+ /**
21
+ * Open each pending plan automatically and retain a manual opener without answering it.
22
+ * @param props - Review identity, Session store, localized copy, and navigation.
23
+ * @returns an opener for either logged or temporary plan text.
24
+ */
25
+ export declare function PlanReviewOpen({ review, requestKey, openReview, t, useStore, actions }: PropsRuntime<'conversation.plan-review.actions'> & InjectFace<PlanReviewOpenInjected> & PropsLocale<'plan'> & PropsStore<ReturnType<typeof createPlanReviewStore>>): import("react").JSX.Element;
26
+ //# sourceMappingURL=PlanCard.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
2
+ import type { PlanChipInjected } from './index.ts';
3
+ /** Full plan-seat component props: runtime share (standard kit + locked owner prop) & injected share & the locale seat. */
4
+ export type PlanChipProps = PropsRuntime<'conversation.input.plan'> & InjectFace<PlanChipInjected> & PropsLocale<'plan'>;
5
+ /**
6
+ * Plan-mode status over the host-computed `plan` projection. The chip renders
7
+ * only while the effective target is plan mode (`pending ? !active : active`
8
+ * — a folded host value, not client optimism) and executes /plan off.
9
+ */
10
+ export declare function PlanChip({ useProjection, locked, exitPlanMode, t }: PlanChipProps): import("react").JSX.Element | null;
11
+ //# sourceMappingURL=PlanModeControl.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
2
+ type PlanPreviewProps = PropsRuntime<'sidebar.right.pane.tab'> & PropsLocale<'plan'>;
3
+ /**
4
+ * Render the submitted plan with its complete Markdown and a copy action.
5
+ * @param props - Framework-bound tab identity, resource, and copy.
6
+ * @returns the plan document or a localized loading/failure state.
7
+ */
8
+ export declare function PlanPreview({ useTabInfo, useResource, t }: PlanPreviewProps): import("react").JSX.Element;
9
+ /**
10
+ * Display a plan icon and the heading in its tab after resource recovery.
11
+ * @param props - Framework-bound tab identity and resource reader.
12
+ * @returns a decorative plan icon followed by the recovered title or initial localized label.
13
+ */
14
+ export declare function PlanTitle({ useTabInfo, useResource }: PropsRuntime<'sidebar.right.pane.tab.title'>): import("react").JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=PlanPreview.d.ts.map
@@ -0,0 +1,11 @@
1
+ /** Localized plan-owned failures and unmodified external diagnostics. */
2
+ import type { RemoteFailure } from '@qilin-agent/typert-protocol';
3
+ import type { TranslateNS } from '@qilin-agent/client-locale/client';
4
+ /**
5
+ * Explain a failed plan read in the current locale.
6
+ * @param t - Plan namespace translator.
7
+ * @param failure - Failure reported by the resource provider.
8
+ * @returns localized plan copy, or the external failure's diagnostic.
9
+ */
10
+ export declare function planFailureLine(t: TranslateNS<'plan'>, failure: RemoteFailure): string;
11
+ //# sourceMappingURL=failure-line.d.ts.map
@@ -0,0 +1,25 @@
1
+ import type { Context as ClientContext } from '@qilin-agent/kylin';
2
+ import { type PlanKey } from './locales.ts';
3
+ export type { PlanKey } from './locales.ts';
4
+ declare module '@qilin-agent/client-ui-slots' {
5
+ interface LocaleNamespaceMap {
6
+ /** The composer plan chip's copy. */
7
+ plan: PlanKey;
8
+ }
9
+ }
10
+ /** Injected business face of the composer plan seat. */
11
+ export interface PlanChipInjected {
12
+ /**
13
+ * Leave plan mode by executing /plan off.
14
+ * @returns null on admitted execution; a user-visible failure line otherwise.
15
+ */
16
+ exitPlanMode: () => Promise<string | null>;
17
+ }
18
+ /** Services for plan controls, Conversation projection, and resource navigation. */
19
+ export declare const inject: string[];
20
+ /**
21
+ * Register plan controls, permanent Chat cards, and sidebar document reading.
22
+ * @param ctx - client root context.
23
+ */
24
+ export declare function apply(ctx: ClientContext): void;
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,48 @@
1
+ /** `plan` namespace dictionaries (the composer plan chip's copy). */
2
+ /** Simplified Chinese dictionary (the key-set source of truth). */
3
+ export declare const zh: {
4
+ 'chip.label': string;
5
+ 'preview.title': string;
6
+ 'preview.document': string;
7
+ 'preview.action': string;
8
+ 'preview.open': string;
9
+ 'preview.full': string;
10
+ 'preview.openNamed': string;
11
+ 'preview.loading': string;
12
+ 'preview.failed': string;
13
+ 'preview.invalidAddress': string;
14
+ 'preview.historyUnavailable': string;
15
+ 'preview.notFound': string;
16
+ 'preview.unavailable': string;
17
+ 'preview.expired': string;
18
+ 'chip.on.aria': string;
19
+ 'chip.on.title': string;
20
+ 'chip.off.aria': string;
21
+ 'chip.off.title': string;
22
+ 'chip.exitFailed': string;
23
+ };
24
+ /** The plan namespace key union. */
25
+ export type PlanKey = keyof typeof zh;
26
+ /** English dictionary, checked complete against the zh key set. */
27
+ export declare const en: {
28
+ 'chip.label': string;
29
+ 'preview.title': string;
30
+ 'preview.document': string;
31
+ 'preview.action': string;
32
+ 'preview.open': string;
33
+ 'preview.full': string;
34
+ 'preview.openNamed': string;
35
+ 'preview.loading': string;
36
+ 'preview.failed': string;
37
+ 'preview.invalidAddress': string;
38
+ 'preview.historyUnavailable': string;
39
+ 'preview.notFound': string;
40
+ 'preview.unavailable': string;
41
+ 'preview.expired': string;
42
+ 'chip.on.aria': string;
43
+ 'chip.on.title': string;
44
+ 'chip.off.aria': string;
45
+ 'chip.off.title': string;
46
+ 'chip.exitFailed': string;
47
+ };
48
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { ConversationNodeDefinition } from '@qilin-agent/client-ui-conversation/client';
2
+ import { type SubmittedPlan } from './plan.ts';
3
+ declare module '@qilin-agent/client-ui-chat/client' {
4
+ interface ChatNodeDataMap {
5
+ /** Complete plan submitted through exit_plan_mode, including rejected or dismissed reviews. */
6
+ 'submitted-plan': SubmittedPlan;
7
+ }
8
+ }
9
+ /** One card per invocation; a later PTC settlement retains the original card position. */
10
+ export declare const planDefinition: ConversationNodeDefinition<SubmittedPlan>;
11
+ //# sourceMappingURL=plan-definition.d.ts.map
@@ -0,0 +1,32 @@
1
+ /** Read immutable plan arguments from a Session snapshot and earlier history pages. */
2
+ import type { Context } from '@qilin-agent/kylin';
3
+ import type { ResourceProvider } from '@qilin-agent/client-resources/client';
4
+ import { type SubmittedPlan } from './plan.ts';
5
+ declare module '@qilin-agent/typert-protocol' {
6
+ interface RemoteErrorDetailsMap {
7
+ /** The resource URL does not identify a plan invocation. */
8
+ 'plan/invalid-address': Record<string, never>;
9
+ /** Session history ended before an opening snapshot. */
10
+ 'plan/unavailable': Record<string, never>;
11
+ /** The Session has no readable plan for this invocation. */
12
+ 'plan/not-found': Record<string, never>;
13
+ /** The Session history read failed. */
14
+ 'plan/read-failed': Record<string, never>;
15
+ }
16
+ }
17
+ declare module '@qilin-agent/client-ui-slots' {
18
+ interface ResourceProtocolMap {
19
+ /** Immutable Markdown from a logged exit_plan_mode invocation. */
20
+ plan: SubmittedPlan;
21
+ }
22
+ }
23
+ /**
24
+ * Bind plan reads to the generated Session Remote face.
25
+ * Opening a follow reads projections and may activate a prepared Session on the Host.
26
+ * Generated Remote streams can throw carrier failures; the provider reports failed
27
+ * reads as resource failure frames and preserves Remote error codes.
28
+ * @param remote - Existing Session history API.
29
+ * @returns a provider whose reads stop after finding the exact invocation.
30
+ */
31
+ export declare function planResourceProvider(remote: Pick<Context['remote']['session'], 'follow' | 'page'>): ResourceProvider<'plan'>;
32
+ //# sourceMappingURL=plan-resource.d.ts.map
@@ -0,0 +1,39 @@
1
+ /** Plan text and resource identities derived from logged native or PTC calls. */
2
+ import type { ToolCallId } from '@qilin-agent/llm/brand';
3
+ import type { SessionAddress } from '@qilin-agent/api-session-controller/types';
4
+ /** Complete Markdown and the heading displayed by a plan preview. */
5
+ export interface PlanDocument {
6
+ readonly markdown: string;
7
+ readonly title: string;
8
+ }
9
+ /** One submitted plan, identified by its originating tool invocation. */
10
+ export interface SubmittedPlan extends PlanDocument {
11
+ readonly callId: ToolCallId;
12
+ }
13
+ /** A saved sidebar resource names one invocation in one Session. */
14
+ export interface PlanAddress {
15
+ readonly session: SessionAddress;
16
+ readonly callId: ToolCallId;
17
+ }
18
+ /**
19
+ * Read a complete plan from untrusted logged arguments.
20
+ * @param event - Native call or PTC dispatch event from Session history.
21
+ * @returns the submitted plan, or undefined for unrelated or malformed data.
22
+ */
23
+ export declare function submittedPlan(event: {
24
+ readonly type: string;
25
+ readonly data: unknown;
26
+ }): SubmittedPlan | undefined;
27
+ /**
28
+ * Encode the durable identity of a plan without retaining its text in layout storage.
29
+ * @param target - Session and tool-call identity.
30
+ * @returns the plan resource address.
31
+ */
32
+ export declare function planAddress(target: PlanAddress): string;
33
+ /**
34
+ * Validate a saved or caller-supplied plan resource address.
35
+ * @param address - Address submitted to the sidebar or resource provider.
36
+ * @returns the decoded identity, or undefined for an unsupported address.
37
+ */
38
+ export declare function parsePlanAddress(address: string): PlanAddress | undefined;
39
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1,25 @@
1
+ /** Temporary review previews carry their document in in-memory tab navigation. */
2
+ import type { SessionId } from '@qilin-agent/session/types';
3
+ import type { PlanDocument } from './plan.ts';
4
+ declare module '@qilin-agent/client-ui-sidebar-right/client' {
5
+ interface SidebarRightResourceParamsMap {
6
+ /** Review text without a logged invocation; never persisted in sidebar layout. */
7
+ 'plan-review': {
8
+ planReview: PlanDocument;
9
+ };
10
+ }
11
+ }
12
+ /**
13
+ * Name one temporary review within its browser lifetime and Session.
14
+ * @param sessionId - Session displaying the review.
15
+ * @param requestKey - Browser-unique pending request identity.
16
+ * @returns the address used to focus or reopen its preview.
17
+ */
18
+ export declare function reviewPreviewAddress(sessionId: SessionId, requestKey: string): string;
19
+ /**
20
+ * Recognize temporary plan navigation without interpreting it as logged history.
21
+ * @param address - Saved or caller-supplied navigation address.
22
+ * @returns whether the address identifies a temporary review preview.
23
+ */
24
+ export declare function isReviewPreviewAddress(address: string): boolean;
25
+ //# sourceMappingURL=review-preview.d.ts.map
@@ -0,0 +1,15 @@
1
+ /** Session-owned memory of pending plans already opened automatically. */
2
+ import { type EngineStoreHandle } from '@qilin-agent/client-store';
3
+ interface PlanReviewState {
4
+ opened: Partial<Record<string, true>>;
5
+ }
6
+ type PlanReviewActions = {
7
+ markOpened: (draft: PlanReviewState, reviewKey: string) => void;
8
+ };
9
+ /**
10
+ * Keep manual sidebar closure effective across review component remounts.
11
+ * @returns a transient store handle whose instances belong to Session scopes.
12
+ */
13
+ export declare function createPlanReviewStore(): EngineStoreHandle<PlanReviewState, PlanReviewActions>;
14
+ export {};
15
+ //# sourceMappingURL=review-store.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Plan control plugin, node half. Pure UI plugin: the empty apply exists so
3
+ * the plugin appears in the host cordis.yml / Loader; the browser half ships
4
+ * via exports["./client"], discovered through the package.json qilin.client
5
+ * declaration. Plan behavior itself (the /plan command, the plan projection
6
+ * unit, the policy section) is owned by `@qilin-agent/plan-mode`,
7
+ * composed independently on the host roster.
8
+ */
9
+ /** Host plugin body — no host-side behavior for this surface plugin. */
10
+ export declare function apply(): void;
11
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,84 @@
1
1
  {
2
2
  "name": "@qilin-agent/client-ui-plan",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "Plan mode controls, persistent transcript plan cards, and sidebar Markdown previews",
4
+ "version": "3.1.4",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/kkutysllb/QiLin.git",
11
+ "directory": "packages/client/ui-plan"
12
+ },
13
+ "engines": {
14
+ "node": "^22.19.0 || >=24.0.0"
15
+ },
16
+ "type": "module",
17
+ "main": "lib/index.js",
18
+ "types": "lib/types/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./lib/types/index.d.ts",
22
+ "default": "./lib/index.js"
23
+ },
24
+ "./client": {
25
+ "types": "./lib/types/client/index.d.ts",
26
+ "default": "./lib/client.js"
27
+ },
28
+ "./src/*": "./src/*",
29
+ "./package.json": "./package.json"
30
+ },
31
+ "qilin": {
32
+ "client": {
33
+ "inject": [
34
+ "@qilin-agent/api-remotes",
35
+ "@qilin-agent/client-locale",
36
+ "@qilin-agent/client-ui-conversation",
37
+ "@qilin-agent/client-ui-sidebar-right",
38
+ "@qilin-agent/client-ui-chat",
39
+ "@qilin-agent/client-ui-user-questions",
40
+ "@qilin-agent/client-resources",
41
+ "@qilin-agent/api-session-controller"
42
+ ],
43
+ "platform": "web"
44
+ }
45
+ },
46
+ "license": "MIT",
47
+ "peerDependencies": {
48
+ "@qilin-agent/kylin": "~4.0.3"
49
+ },
50
+ "devDependencies": {
51
+ "@types/react": "~18.3.1",
52
+ "react": "^18.2.0",
53
+ "@qilin-agent/client-store": "3.1.4",
54
+ "@qilin-agent/api-remotes": "3.1.4",
55
+ "@qilin-agent/client-test-runtime": "3.1.4",
56
+ "@qilin-agent/client-locale": "3.1.4",
57
+ "@qilin-agent/client-ui-conversation": "3.1.4",
58
+ "@qilin-agent/client-ui-primitives": "3.1.4",
59
+ "@qilin-agent/plan-mode": "3.1.4",
60
+ "@qilin-agent/kylin": "~4.0.3",
61
+ "@qilin-agent/client-ui-slots": "3.1.4",
62
+ "@qilin-agent/session": "3.1.4",
63
+ "@qilin-agent/client-ui-renderer": "3.1.4",
64
+ "@qilin-agent/api-session-controller": "3.1.4",
65
+ "@qilin-agent/client-ui-chat": "3.1.4",
66
+ "@qilin-agent/client-ui-sidebar-right": "3.1.4",
67
+ "@qilin-agent/client-resources": "3.1.4",
68
+ "@qilin-agent/llm": "3.1.4",
69
+ "@qilin-agent/typert-protocol": "3.1.4",
70
+ "@qilin-agent/tools": "3.1.4",
71
+ "@qilin-agent/client-ui-user-questions": "3.1.4",
72
+ "@qilin-agent/client-ui-session": "3.1.4",
73
+ "@qilin-agent/util-crypto": "3.1.4"
74
+ },
75
+ "files": [
76
+ "lib/index.js",
77
+ "lib/client.js",
78
+ "lib/types/**/*.d.ts"
79
+ ],
80
+ "scripts": {
81
+ "bundle": "tsdown",
82
+ "watch": "tsdown --watch"
83
+ }
6
84
  }