@qilin-agent/cli 0.0.0-stage → 3.1.3
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/LICENSE +21 -0
- package/README.i18n.yaml +22 -0
- package/README.md +69 -2
- package/README.zh.md +70 -0
- package/lib/bin.js +255 -0
- package/lib/dump-config-_HRfhhWz.js +53 -0
- package/lib/plugin-BQ1sn-63.js +239 -0
- package/lib/profile-boot-DSy6PUHQ.js +315 -0
- package/lib/profile-boot.js +2 -0
- package/lib/types/args.d.ts +56 -0
- package/lib/types/bin.d.ts +11 -0
- package/lib/types/dump-config.d.ts +18 -0
- package/lib/types/plugin.d.ts +29 -0
- package/lib/types/process-shutdown.d.ts +20 -0
- package/lib/types/profile-boot.d.ts +92 -0
- package/lib/types/startup-diagnostics.d.ts +19 -0
- package/package.json +171 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Bounded, escalating process shutdown for the long-lived CLI surfaces. */
|
|
2
|
+
/** Maximum grace allowed for the application tree to dispose before process exit. */
|
|
3
|
+
export declare const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
|
|
4
|
+
/** Process-exit controller shared by normal completion and Unix signal handlers. */
|
|
5
|
+
export interface ProcessShutdown {
|
|
6
|
+
/** Start or join graceful disposal before allowing natural completion with `code`. */
|
|
7
|
+
shutdown(code: number): Promise<void>;
|
|
8
|
+
/** Start graceful disposal followed by exit, or force exit when shutdown is already running. */
|
|
9
|
+
interrupt(code: number): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create one process-exit controller around an application disposer.
|
|
13
|
+
* @param dispose - Whole-application teardown that resolves at quiescence.
|
|
14
|
+
* @param forceExit - Function that exits the process immediately, replaceable by tests.
|
|
15
|
+
* @param complete - Function that records the natural completion code, replaceable by tests.
|
|
16
|
+
* @param timeoutMs - Grace before forced exit, replaceable by tests.
|
|
17
|
+
* @returns A controller whose normal calls coalesce and whose repeated signal call escalates.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createProcessShutdown(dispose: () => Promise<void>, forceExit?: (code: number) => void, complete?: (code: number) => void, timeoutMs?: number): ProcessShutdown;
|
|
20
|
+
//# sourceMappingURL=process-shutdown.d.ts.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared profile boot for every `qilin` surface: resolve the profile, stack its
|
|
3
|
+
* patch layers (bundle layers in `qilin.profile.bundles` order, the profile's
|
|
4
|
+
* own `cordis.patch.yml`, `--patch` overlays, the telemetry switch), mount the
|
|
5
|
+
* tree over the profile's empty root config, and wire fail-loud plus bounded shutdown.
|
|
6
|
+
*
|
|
7
|
+
* App flags are not the launcher's business: the invocation's inner arguments
|
|
8
|
+
* are provided to the tree through `ctx.cmdlineArgs`, where any injected app
|
|
9
|
+
* plugin may read the same immutable snapshot.
|
|
10
|
+
* @module @qilin-agent/cli/profile-boot
|
|
11
|
+
*/
|
|
12
|
+
import { type Context } from '@qilin-agent/kylin';
|
|
13
|
+
import { type ProfileContext, type Profile, type ProfileResolutionMode } from '@qilin-agent/app-boot';
|
|
14
|
+
import { type LaunchEnvironmentSnapshot } from '@qilin-agent/launch-environment';
|
|
15
|
+
import { type ProcessShutdown } from './process-shutdown.ts';
|
|
16
|
+
/**
|
|
17
|
+
* The home-level user patch layer (`$QILIN_HOME/cordis.patch.yml`), applied
|
|
18
|
+
* over every profile's own layer. Resolved per call, not at module load:
|
|
19
|
+
* `$QILIN_HOME` may be set by the test or launcher after import.
|
|
20
|
+
* @returns the absolute patch-file path.
|
|
21
|
+
*/
|
|
22
|
+
export declare function homePatchPath(): string;
|
|
23
|
+
/** Absolute path of this qilin installation's package.json (both anchors: src/ and lib/ sit one level under apps/cli). */
|
|
24
|
+
export declare const INSTALL_ANCHOR: string;
|
|
25
|
+
/** Root config filename inside a profile directory. */
|
|
26
|
+
export declare const PROFILE_ROOT_FILENAME = "cordis.yml";
|
|
27
|
+
/**
|
|
28
|
+
* Initialize a missing profile from one shipped template. This copies only
|
|
29
|
+
* the template's bundle list; local state from the
|
|
30
|
+
* same-named shipped profile is not read, and no inheritance metadata is
|
|
31
|
+
* persisted. Shipped profile names are reserved, and the target directory is
|
|
32
|
+
* claimed exclusively so existing or concurrent state is never reused.
|
|
33
|
+
* @param name - the new profile name.
|
|
34
|
+
* @param fromDefaultProfile - shipped profile template to copy.
|
|
35
|
+
* @param home - Harness home containing the profile directory.
|
|
36
|
+
* @throws when the template is unknown, the target name is shipped, or the target directory exists.
|
|
37
|
+
*/
|
|
38
|
+
export declare function initializeProfileFromDefault(name: string, fromDefaultProfile: string, home?: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Load a resolved profile for `name` and (re)write the empty root config. The
|
|
41
|
+
* root is always rewritten: the whole composition is patch layers, and the
|
|
42
|
+
* vendored Loader's tree write-back (a plugin self-disposing persists the
|
|
43
|
+
* current tree) can bake composed rows into this file — which would duplicate
|
|
44
|
+
* every bundle insert on the next boot. The file exists on disk only because
|
|
45
|
+
* the Loader needs a real include root to anchor `baseUrl` at the profile
|
|
46
|
+
* directory (the config dump anchors on the same file, so both compose over
|
|
47
|
+
* the identical base).
|
|
48
|
+
* @param name - the profile name.
|
|
49
|
+
* @param userLayer - `false` skips parsing `cordis.patch.yml` (the default dump).
|
|
50
|
+
* @param fromDefaultProfile - shipped template used once to initialize a missing profile.
|
|
51
|
+
* @returns the loaded profile.
|
|
52
|
+
* @throws when explicit initialization names an unknown template or an existing profile.
|
|
53
|
+
*/
|
|
54
|
+
export declare function prepareProfile(name: string, userLayer?: boolean, fromDefaultProfile?: string): Profile;
|
|
55
|
+
/** An application-owned profile and its independent installation fallback. */
|
|
56
|
+
export interface ResolvedProfileRuntime {
|
|
57
|
+
/** Profile already loaded from the application's own directory. */
|
|
58
|
+
profile: Profile;
|
|
59
|
+
/** Absolute package.json path of the application's qilin installation. */
|
|
60
|
+
installAnchor: string;
|
|
61
|
+
}
|
|
62
|
+
/** Options for {@link runProfile}. */
|
|
63
|
+
export interface RunProfileOptions {
|
|
64
|
+
/** This run's frozen environment snapshot, provided before any entry mounts. */
|
|
65
|
+
environment: LaunchEnvironmentSnapshot;
|
|
66
|
+
/** The profile name to boot. */
|
|
67
|
+
profile: string;
|
|
68
|
+
/** Loaded application profile; bypasses named profile initialization when supplied. */
|
|
69
|
+
resolvedProfile?: ResolvedProfileRuntime | undefined;
|
|
70
|
+
/** Shipped template used once to initialize a missing profile. */
|
|
71
|
+
fromDefaultProfile?: string | undefined;
|
|
72
|
+
/** `--patch` overlay paths, in argv order. */
|
|
73
|
+
patchFiles: readonly string[];
|
|
74
|
+
/** The invocation's inner arguments, handed to the tree through `ctx.cmdlineArgs`. */
|
|
75
|
+
args: readonly string[];
|
|
76
|
+
/** Application-owned package runtime, scoped to plugin package operations. */
|
|
77
|
+
packageManager?: ProfileContext['packageManager'];
|
|
78
|
+
/** Module fallback backend; defaults to runtime. Plain Node callers may override it; pkg executables always use runtime. */
|
|
79
|
+
resolutionMode?: ProfileResolutionMode;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Boot one profile invocation end to end and leave process lifetime to the
|
|
83
|
+
* mounted plugins (or to a one-shot runner the composition mounts).
|
|
84
|
+
* @param options - environment snapshot, profile name, overlays, and the booted app's own arguments.
|
|
85
|
+
* @returns the settled root context and the shutdown controller.
|
|
86
|
+
* @throws after disposing startup resources; cleanup failures retain the original error.
|
|
87
|
+
*/
|
|
88
|
+
export declare function runProfile(options: RunProfileOptions): Promise<{
|
|
89
|
+
ctx: Context;
|
|
90
|
+
shutdown: ProcessShutdown;
|
|
91
|
+
}>;
|
|
92
|
+
//# sourceMappingURL=profile-boot.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Save original startup diagnostics while keeping the terminal report concise. */
|
|
2
|
+
import type { StartupError } from '@qilin-agent/app-boot';
|
|
3
|
+
/** Launcher-owned context; no environment values or plugin configurations are collected. */
|
|
4
|
+
interface StartupDiagnosticContext {
|
|
5
|
+
home: string;
|
|
6
|
+
version: string;
|
|
7
|
+
profile: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Print the startup summary and save a private, uniquely named report under QILIN_HOME/logs.
|
|
11
|
+
* Failed writes print the complete report to stderr instead of claiming a saved path.
|
|
12
|
+
* @param error - startup audit failure retaining plugin metadata and original errors.
|
|
13
|
+
* @param context - resolved Harness home, application version, and selected profile.
|
|
14
|
+
* @param write - terminal output sink; awaited before returning, defaults to stderr.
|
|
15
|
+
* @returns after saving or printing the report and completing terminal writes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function reportStartupFailure(error: StartupError, context: StartupDiagnosticContext, write?: (text: string) => void | Promise<void>): Promise<void>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=startup-diagnostics.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,174 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/cli",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "qilin CLI: profile launch, plugin management, and configuration inspection",
|
|
4
|
+
"version": "3.1.3",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/kkutysllb/QiLin.git",
|
|
11
|
+
"directory": "apps/cli"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"bin": {
|
|
18
|
+
"qilin": "lib/bin.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"lib/*.js",
|
|
22
|
+
"lib/types/*.d.ts"
|
|
23
|
+
],
|
|
24
|
+
"qilin": {
|
|
25
|
+
"configTrees": [
|
|
26
|
+
{
|
|
27
|
+
"mount": "config/agent-presets",
|
|
28
|
+
"path": "../../packages/preset/agent-presets/presets",
|
|
29
|
+
"scanRoster": true
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"commander": "^15.0.0",
|
|
36
|
+
"js-yaml": "^4.2.0",
|
|
37
|
+
"node-addon-require-builtin": "^0.1.6",
|
|
38
|
+
"@qilin-agent/agent-instructions": "3.1.3",
|
|
39
|
+
"@qilin-agent/acp-app": "3.1.3",
|
|
40
|
+
"@qilin-agent/agent-tool-presentation": "3.1.3",
|
|
41
|
+
"@qilin-agent/app-boot": "3.1.3",
|
|
42
|
+
"@qilin-agent/atomic-write": "3.1.3",
|
|
43
|
+
"@qilin-agent/base": "3.1.3",
|
|
44
|
+
"@qilin-agent/client-ui-agent-preset": "3.1.3",
|
|
45
|
+
"@qilin-agent/client-ui-kylin": "3.1.3",
|
|
46
|
+
"@qilin-agent/cmdline": "3.1.3",
|
|
47
|
+
"@qilin-agent/command-compact": "3.1.3",
|
|
48
|
+
"@qilin-agent/command-goal": "3.1.3",
|
|
49
|
+
"@qilin-agent/compaction-basic": "3.1.3",
|
|
50
|
+
"@qilin-agent/compaction-tool-result-pruner": "3.1.3",
|
|
51
|
+
"@qilin-agent/experimental-auto-review": "3.1.3",
|
|
52
|
+
"@qilin-agent/experimental-inspector-profile": "3.1.3",
|
|
53
|
+
"@qilin-agent/experimental-agent-team-profile": "3.1.3",
|
|
54
|
+
"@qilin-agent/experimental-schedule-bundle": "3.1.3",
|
|
55
|
+
"@qilin-agent/experimental-voice-input-bundle": "3.1.3",
|
|
56
|
+
"@qilin-agent/fs-local": "3.1.3",
|
|
57
|
+
"@qilin-agent/headless": "3.1.3",
|
|
58
|
+
"@qilin-agent/goal": "3.1.3",
|
|
59
|
+
"@qilin-agent/goal-round-driver": "3.1.3",
|
|
60
|
+
"@qilin-agent/hmr": "3.1.3",
|
|
61
|
+
"@qilin-agent/home-paths": "3.1.3",
|
|
62
|
+
"@qilin-agent/hooks-claude-code": "3.1.3",
|
|
63
|
+
"@qilin-agent/hooks-codex": "3.1.3",
|
|
64
|
+
"@qilin-agent/http-proxy": "3.1.3",
|
|
65
|
+
"@qilin-agent/jobs-local": "3.1.3",
|
|
66
|
+
"@qilin-agent/kylin": "~4.0.3",
|
|
67
|
+
"@qilin-agent/kylin-client-runner": "3.1.3",
|
|
68
|
+
"@qilin-agent/kylin-plugin-include": "~1.0.8",
|
|
69
|
+
"@qilin-agent/kylin-plugin-timer": "~1.1.5",
|
|
70
|
+
"@qilin-agent/mcp-client": "3.1.3",
|
|
71
|
+
"@qilin-agent/launch-environment": "3.1.3",
|
|
72
|
+
"@qilin-agent/mcp-resources": "3.1.3",
|
|
73
|
+
"@qilin-agent/kylin-plugin-loader": "~1.0.4",
|
|
74
|
+
"@qilin-agent/plan-mode": "3.1.3",
|
|
75
|
+
"@qilin-agent/persona": "3.1.3",
|
|
76
|
+
"@qilin-agent/plugin-manager": "3.1.3",
|
|
77
|
+
"@qilin-agent/pwsh-local": "3.1.3",
|
|
78
|
+
"@qilin-agent/pwsh-sandbox": "3.1.3",
|
|
79
|
+
"@qilin-agent/schedule": "3.1.3",
|
|
80
|
+
"@qilin-agent/sdk-app": "3.1.3",
|
|
81
|
+
"@qilin-agent/sdk-minimal": "3.1.3",
|
|
82
|
+
"@qilin-agent/schemastery": "~3.18.3",
|
|
83
|
+
"@qilin-agent/session-projection": "3.1.3",
|
|
84
|
+
"@qilin-agent/skill": "3.1.3",
|
|
85
|
+
"@qilin-agent/session-reference": "3.1.3",
|
|
86
|
+
"@qilin-agent/skill-filesystem": "3.1.3",
|
|
87
|
+
"@qilin-agent/terminal": "3.1.3",
|
|
88
|
+
"@qilin-agent/terminal-bash": "3.1.3",
|
|
89
|
+
"@qilin-agent/tmux-context": "3.1.3",
|
|
90
|
+
"@qilin-agent/time-context": "3.1.3",
|
|
91
|
+
"@qilin-agent/tool-ask-user": "3.1.3",
|
|
92
|
+
"@qilin-agent/token-meter": "3.1.3",
|
|
93
|
+
"@qilin-agent/tool-bash": "3.1.3",
|
|
94
|
+
"@qilin-agent/tool-fs-search": "3.1.3",
|
|
95
|
+
"@qilin-agent/tool-bash-persistent": "3.1.3",
|
|
96
|
+
"@qilin-agent/tool-goal": "3.1.3",
|
|
97
|
+
"@qilin-agent/tool-jobs": "3.1.3",
|
|
98
|
+
"@qilin-agent/tool-fs": "3.1.3",
|
|
99
|
+
"@qilin-agent/sidebar-opens": "3.1.3",
|
|
100
|
+
"@qilin-agent/tool-kylin": "3.1.3",
|
|
101
|
+
"@qilin-agent/tool-pwsh": "3.1.3",
|
|
102
|
+
"@qilin-agent/tool-present": "3.1.3",
|
|
103
|
+
"@qilin-agent/tool-pwsh-persistent": "3.1.3",
|
|
104
|
+
"@qilin-agent/tool-ralph": "3.1.3",
|
|
105
|
+
"@qilin-agent/tool-schedule": "3.1.3",
|
|
106
|
+
"@qilin-agent/tool-skill": "3.1.3",
|
|
107
|
+
"@qilin-agent/tool-str-replace-editor": "3.1.3",
|
|
108
|
+
"@qilin-agent/tool-todo": "3.1.3",
|
|
109
|
+
"@qilin-agent/tool-subagent": "3.1.3",
|
|
110
|
+
"@qilin-agent/tool-subagent-control": "3.1.3",
|
|
111
|
+
"@qilin-agent/tool-workflow": "3.1.3",
|
|
112
|
+
"@qilin-agent/tool-web": "3.1.3",
|
|
113
|
+
"@qilin-agent/web-app": "3.1.3",
|
|
114
|
+
"@qilin-agent/web-brand": "3.1.3",
|
|
115
|
+
"@qilin-agent/webhook-github": "3.1.3",
|
|
116
|
+
"@qilin-agent/workflow-ptc": "3.1.3",
|
|
117
|
+
"@qilin-agent/webhook": "3.1.3"
|
|
118
|
+
},
|
|
119
|
+
"devDependencies": {
|
|
120
|
+
"@agentclientprotocol/sdk": "1.4.0",
|
|
121
|
+
"@types/js-yaml": "^4.0.9",
|
|
122
|
+
"@types/ws": "8.18.1",
|
|
123
|
+
"execa": "^10.0.0",
|
|
124
|
+
"ws": "8.21.0",
|
|
125
|
+
"@qilin-agent/acp": "3.1.3",
|
|
126
|
+
"@qilin-agent/agent": "3.1.3",
|
|
127
|
+
"@qilin-agent/agent-loop": "3.1.3",
|
|
128
|
+
"@qilin-agent/agent-loop-testkit": "3.1.3",
|
|
129
|
+
"@qilin-agent/deepseek-llm-api-extensions": "3.1.3",
|
|
130
|
+
"@qilin-agent/bash-local": "3.1.3",
|
|
131
|
+
"@qilin-agent/credentials-local": "3.1.3",
|
|
132
|
+
"@qilin-agent/experimental-agent-team": "3.1.3",
|
|
133
|
+
"@qilin-agent/experimental-ptc-runtime-python": "3.1.3",
|
|
134
|
+
"@qilin-agent/experimental-tool-agent-team": "3.1.3",
|
|
135
|
+
"@qilin-agent/fs-observation-policy": "3.1.3",
|
|
136
|
+
"@qilin-agent/fs-sandbox": "3.1.3",
|
|
137
|
+
"@qilin-agent/host-frontend-static": "3.1.3",
|
|
138
|
+
"@qilin-agent/host-webserver": "3.1.3",
|
|
139
|
+
"@qilin-agent/llm": "3.1.3",
|
|
140
|
+
"@qilin-agent/llm-deepseek": "3.1.3",
|
|
141
|
+
"@qilin-agent/llm-deepseek-api-key": "3.1.3",
|
|
142
|
+
"@qilin-agent/llm-mock-server": "3.1.3",
|
|
143
|
+
"@qilin-agent/attachment-local": "3.1.3",
|
|
144
|
+
"@qilin-agent/llm-replay": "3.1.3",
|
|
145
|
+
"@qilin-agent/llm-pi-ai": "3.1.3",
|
|
146
|
+
"@qilin-agent/loader-smoke": "3.1.3",
|
|
147
|
+
"@qilin-agent/plugin-package-inventory-deepseek": "3.1.3",
|
|
148
|
+
"@qilin-agent/sandbox-local": "3.1.3",
|
|
149
|
+
"@qilin-agent/sandbox-policy": "3.1.3",
|
|
150
|
+
"@qilin-agent/session-checkpoint-policy": "3.1.3",
|
|
151
|
+
"@qilin-agent/session": "3.1.3",
|
|
152
|
+
"@qilin-agent/session-log-deepseek": "3.1.3",
|
|
153
|
+
"@qilin-agent/session-persistence-jsonl": "3.1.3",
|
|
154
|
+
"@qilin-agent/settings": "3.1.3",
|
|
155
|
+
"@qilin-agent/shell-env": "3.1.3",
|
|
156
|
+
"@qilin-agent/session-query": "3.1.3",
|
|
157
|
+
"@qilin-agent/subagent-spawn-in-process": "3.1.3",
|
|
158
|
+
"@qilin-agent/subagent": "3.1.3",
|
|
159
|
+
"@qilin-agent/subagent-fork-in-process": "3.1.3",
|
|
160
|
+
"@qilin-agent/settings-file": "3.1.3",
|
|
161
|
+
"@qilin-agent/subprocess-local": "3.1.3",
|
|
162
|
+
"@qilin-agent/system-prompt": "3.1.3",
|
|
163
|
+
"@qilin-agent/tools": "3.1.3",
|
|
164
|
+
"@qilin-agent/user-approval": "3.1.3"
|
|
165
|
+
},
|
|
166
|
+
"exports": {
|
|
167
|
+
"./profile-boot": {
|
|
168
|
+
"types": "./lib/types/profile-boot.d.ts",
|
|
169
|
+
"default": "./lib/profile-boot.js"
|
|
170
|
+
},
|
|
171
|
+
"./lib/*": "./lib/*",
|
|
172
|
+
"./package.json": "./package.json"
|
|
173
|
+
}
|
|
6
174
|
}
|