@qilin-agent/sdk-client 3.1.3 → 3.1.5
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.i18n.yaml +24 -24
- package/README.md +2 -0
- package/README.zh.md +2 -0
- package/lib/index.js +43 -1
- package/lib/types/api.d.ts +12 -1
- package/lib/types/client.d.ts +14 -0
- package/package.json +8 -8
package/README.i18n.yaml
CHANGED
|
@@ -5,51 +5,51 @@
|
|
|
5
5
|
/:
|
|
6
6
|
en: 3569bd04353e236f
|
|
7
7
|
zh: 3775cf221a0d95b3
|
|
8
|
-
/qilin-sdk-client:
|
|
9
|
-
en:
|
|
10
|
-
zh:
|
|
11
|
-
/qilin-sdk-client/summary:
|
|
12
|
-
en:
|
|
13
|
-
zh:
|
|
14
|
-
/qilin-sdk-client/table-of-contents:
|
|
8
|
+
/qilin-agent-sdk-client:
|
|
9
|
+
en: 2518c7e7142a83a6
|
|
10
|
+
zh: 545d4928b779b606
|
|
11
|
+
/qilin-agent-sdk-client/summary:
|
|
12
|
+
en: 296fd5fa9e2d56ca
|
|
13
|
+
zh: 89f81af039e90708
|
|
14
|
+
/qilin-agent-sdk-client/table-of-contents:
|
|
15
15
|
en: d152484eb41ac6b4
|
|
16
16
|
zh: 09388d293f9be9cb
|
|
17
|
-
/qilin-sdk-client/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
20
|
-
/qilin-sdk-client/use-this-package/running-agent-turns-with-deepseekharness:
|
|
17
|
+
/qilin-agent-sdk-client/use-this-package:
|
|
18
|
+
en: 316b142489dd050f
|
|
19
|
+
zh: 2b37ae57b2a52b5e
|
|
20
|
+
/qilin-agent-sdk-client/use-this-package/running-agent-turns-with-deepseekharness:
|
|
21
21
|
en: 01c58dddd7e62de2
|
|
22
22
|
zh: 6dbd46e244f3f135
|
|
23
|
-
/qilin-sdk-client/use-this-package/lower-level-control-with-harnessclient:
|
|
23
|
+
/qilin-agent-sdk-client/use-this-package/lower-level-control-with-harnessclient:
|
|
24
24
|
en: eb8d1958801816b6
|
|
25
25
|
zh: 1a6087e2dd1a9347
|
|
26
|
-
/qilin-sdk-client/understand-the-implementation:
|
|
26
|
+
/qilin-agent-sdk-client/understand-the-implementation:
|
|
27
27
|
en: 8773f50c51da85f0
|
|
28
28
|
zh: 4649ebc69357deb0
|
|
29
|
-
/qilin-sdk-client/understand-the-implementation/design-concept:
|
|
29
|
+
/qilin-agent-sdk-client/understand-the-implementation/design-concept:
|
|
30
30
|
en: 109a9c832204693c
|
|
31
31
|
zh: 6af985fe4abe57e2
|
|
32
|
-
/qilin-sdk-client/understand-the-implementation/source-map:
|
|
32
|
+
/qilin-agent-sdk-client/understand-the-implementation/source-map:
|
|
33
33
|
en: a3c7978a80f5aba3
|
|
34
34
|
zh: fdc4dfdafd2eccfa
|
|
35
|
-
/qilin-sdk-client/understand-the-implementation/owned-activity-flow:
|
|
35
|
+
/qilin-agent-sdk-client/understand-the-implementation/owned-activity-flow:
|
|
36
36
|
en: 94a42babac5f1c7d
|
|
37
37
|
zh: df9e42ed02f7d002
|
|
38
|
-
/qilin-sdk-client/understand-the-implementation/errors-and-teardown:
|
|
38
|
+
/qilin-agent-sdk-client/understand-the-implementation/errors-and-teardown:
|
|
39
39
|
en: 165364de2cee0a9f
|
|
40
40
|
zh: c4dc37b44e1e621e
|
|
41
|
-
/qilin-sdk-client/further-exploration:
|
|
41
|
+
/qilin-agent-sdk-client/further-exploration:
|
|
42
42
|
en: f6384d7642f7ec43
|
|
43
43
|
zh: dd147c57bfe422a2
|
|
44
|
-
/qilin-sdk-client/model-experience:
|
|
44
|
+
/qilin-agent-sdk-client/model-experience:
|
|
45
45
|
en: e82a55513d3cd30e
|
|
46
46
|
zh: ecd8c0875ff2fb87
|
|
47
|
-
/qilin-sdk-client/model-experience/kv-cache-effect:
|
|
47
|
+
/qilin-agent-sdk-client/model-experience/kv-cache-effect:
|
|
48
48
|
en: 7abe0be104a791e7
|
|
49
49
|
zh: 445311f78b1069ca
|
|
50
|
-
/qilin-sdk-client/known-limitations-and-deferred-work:
|
|
51
|
-
en:
|
|
52
|
-
zh:
|
|
53
|
-
/qilin-sdk-client/known-limitations-and-deferred-work/dev-note:
|
|
50
|
+
/qilin-agent-sdk-client/known-limitations-and-deferred-work:
|
|
51
|
+
en: 7b24f3cd40fd7971
|
|
52
|
+
zh: bdb0f7c37f1658da
|
|
53
|
+
/qilin-agent-sdk-client/known-limitations-and-deferred-work/dev-note:
|
|
54
54
|
en: 6177a56f053936a4
|
|
55
55
|
zh: 0f4b20228c2d15da
|
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@ English | [中文](README.zh.md)
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## Use this package
|
|
27
27
|
|
|
28
|
+
`HarnessSession.getWorkingDirectory()` reads the effective directory; `setWorkingDirectory(path)` changes it and returns the validated absolute path. Either method creates an unknown Session without starting a model turn. Relative paths use the Session's current directory. Origin metadata, permissions, and existing processes remain unchanged. `HarnessClient` exposes the same methods with a leading `sessionId` argument.
|
|
29
|
+
|
|
28
30
|
Use this client when TypeScript code must drive a complete Harness runtime from another process and you can name the runtime executable explicitly. The common path is minimal: construct a `DeepSeekHarness` with a launch spec, run prompts, and close it so the child process is always reaped.
|
|
29
31
|
|
|
30
32
|
### Running agent turns with DeepSeekHarness
|
package/README.zh.md
CHANGED
|
@@ -25,6 +25,8 @@ kind: "package-library"
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## 使用本包
|
|
27
27
|
|
|
28
|
+
`HarnessSession.getWorkingDirectory()` 读取有效目录;`setWorkingDirectory(path)` 修改目录并返回校验后的绝对路径。两个方法都可创建未知 Session,而不启动模型轮次。相对路径以 Session 当前目录解析。起始目录元数据、权限与已有进程保持不变。`HarnessClient` 提供同名方法,并以 `sessionId` 作为首个参数。
|
|
29
|
+
|
|
28
30
|
当 TypeScript 代码需要从另一进程驱动完整 Harness 运行时、且你能显式指名运行时可执行文件时,使用本客户端。常用路径极简:用启动规格构造 `DeepSeekHarness`,运行提示词,然后关闭它,使子进程总能被回收。
|
|
29
31
|
|
|
30
32
|
### 用 DeepSeekHarness 运行 agent 轮次
|
package/lib/index.js
CHANGED
|
@@ -441,6 +441,31 @@ var HarnessClient = class {
|
|
|
441
441
|
return result.messageId;
|
|
442
442
|
}
|
|
443
443
|
/**
|
|
444
|
+
* Read a Session's effective working directory, recovering it if missing.
|
|
445
|
+
* @param sessionId - target Session; an unknown id creates it.
|
|
446
|
+
* @returns the absolute effective directory.
|
|
447
|
+
*/
|
|
448
|
+
getWorkingDirectory(sessionId) {
|
|
449
|
+
return this.workingDirectoryRequest("session/working-directory/get", { sessionId });
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Change a Session's effective directory without changing origin or permissions.
|
|
453
|
+
* @param sessionId - target Session; an unknown id creates it.
|
|
454
|
+
* @param path - absolute or Session-current-directory-relative path.
|
|
455
|
+
* @returns the validated absolute directory.
|
|
456
|
+
*/
|
|
457
|
+
setWorkingDirectory(sessionId, path) {
|
|
458
|
+
return this.workingDirectoryRequest("session/working-directory/set", {
|
|
459
|
+
sessionId,
|
|
460
|
+
path
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
async workingDirectoryRequest(method, params) {
|
|
464
|
+
const result = await this.request(method, params);
|
|
465
|
+
if (!isRecord(result) || typeof result.cwd !== "string") throw new SdkProtocolError(`${method} returned no working directory: ${JSON.stringify(result)}`);
|
|
466
|
+
return result.cwd;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
444
469
|
* Send one JSON-RPC request and await its result.
|
|
445
470
|
* @param method - the wire method name.
|
|
446
471
|
* @param params - the params object; omitted params send `{}`.
|
|
@@ -682,7 +707,7 @@ var DeepSeekHarness = class {
|
|
|
682
707
|
}
|
|
683
708
|
/**
|
|
684
709
|
* Open a session handle (no wire traffic; the runtime creates the session
|
|
685
|
-
* on its first prompt).
|
|
710
|
+
* on its first prompt or working-directory operation).
|
|
686
711
|
* @param sessionId - explicit id to reuse; omitted mints a fresh one.
|
|
687
712
|
* @returns the session handle.
|
|
688
713
|
*/
|
|
@@ -730,6 +755,23 @@ var HarnessSession = class {
|
|
|
730
755
|
this.id = id;
|
|
731
756
|
}
|
|
732
757
|
/**
|
|
758
|
+
* Read the effective directory and recover a missing directory to the Session origin.
|
|
759
|
+
* @returns the absolute directory used by new independent operations.
|
|
760
|
+
*/
|
|
761
|
+
async getWorkingDirectory() {
|
|
762
|
+
await this.harness.start();
|
|
763
|
+
return this.harness.client.getWorkingDirectory(this.id);
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Change the effective directory without moving existing processes or changing permissions.
|
|
767
|
+
* @param path - absolute or Session-current-directory-relative directory.
|
|
768
|
+
* @returns the validated absolute directory.
|
|
769
|
+
*/
|
|
770
|
+
async setWorkingDirectory(path) {
|
|
771
|
+
await this.harness.start();
|
|
772
|
+
return this.harness.client.setWorkingDirectory(this.id, path);
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
733
775
|
* Queue one prompt, then observe the whole session through its next idle.
|
|
734
776
|
* @param input - prompt text, or content blocks sent verbatim.
|
|
735
777
|
* @param options - optional per-notification observer.
|
package/lib/types/api.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export declare class DeepSeekHarness implements AsyncDisposable {
|
|
|
48
48
|
start(): Promise<void>;
|
|
49
49
|
/**
|
|
50
50
|
* Open a session handle (no wire traffic; the runtime creates the session
|
|
51
|
-
* on its first prompt).
|
|
51
|
+
* on its first prompt or working-directory operation).
|
|
52
52
|
* @param sessionId - explicit id to reuse; omitted mints a fresh one.
|
|
53
53
|
* @returns the session handle.
|
|
54
54
|
*/
|
|
@@ -92,6 +92,17 @@ export declare class HarnessSession {
|
|
|
92
92
|
* @param id - the wire session id this handle runs on.
|
|
93
93
|
*/
|
|
94
94
|
constructor(harness: DeepSeekHarness, id: string);
|
|
95
|
+
/**
|
|
96
|
+
* Read the effective directory and recover a missing directory to the Session origin.
|
|
97
|
+
* @returns the absolute directory used by new independent operations.
|
|
98
|
+
*/
|
|
99
|
+
getWorkingDirectory(): Promise<string>;
|
|
100
|
+
/**
|
|
101
|
+
* Change the effective directory without moving existing processes or changing permissions.
|
|
102
|
+
* @param path - absolute or Session-current-directory-relative directory.
|
|
103
|
+
* @returns the validated absolute directory.
|
|
104
|
+
*/
|
|
105
|
+
setWorkingDirectory(path: string): Promise<string>;
|
|
95
106
|
/**
|
|
96
107
|
* Queue one prompt, then observe the whole session through its next idle.
|
|
97
108
|
* @param input - prompt text, or content blocks sent verbatim.
|
package/lib/types/client.d.ts
CHANGED
|
@@ -96,6 +96,20 @@ export declare class HarnessClient {
|
|
|
96
96
|
* @returns the queued message id.
|
|
97
97
|
*/
|
|
98
98
|
prompt(sessionId: string, contentBlocks: SdkPromptContentBlock[]): Promise<string>;
|
|
99
|
+
/**
|
|
100
|
+
* Read a Session's effective working directory, recovering it if missing.
|
|
101
|
+
* @param sessionId - target Session; an unknown id creates it.
|
|
102
|
+
* @returns the absolute effective directory.
|
|
103
|
+
*/
|
|
104
|
+
getWorkingDirectory(sessionId: string): Promise<string>;
|
|
105
|
+
/**
|
|
106
|
+
* Change a Session's effective directory without changing origin or permissions.
|
|
107
|
+
* @param sessionId - target Session; an unknown id creates it.
|
|
108
|
+
* @param path - absolute or Session-current-directory-relative path.
|
|
109
|
+
* @returns the validated absolute directory.
|
|
110
|
+
*/
|
|
111
|
+
setWorkingDirectory(sessionId: string, path: string): Promise<string>;
|
|
112
|
+
private workingDirectoryRequest;
|
|
99
113
|
/**
|
|
100
114
|
* Send one JSON-RPC request and await its result.
|
|
101
115
|
* @param method - the wire method name.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/sdk-client",
|
|
3
3
|
"description": "TypeScript client SDK for driving a QiLin runtime subprocess over stdio JSON-RPC: the DeepSeekHarness high-level turns API and the lower-level HarnessClient",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.5",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
],
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@qilin-agent/cli": "3.1.
|
|
32
|
+
"@qilin-agent/cli": "3.1.5"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@qilin-agent/llm": "3.1.
|
|
36
|
-
"@qilin-agent/sdk-protocol": "3.1.
|
|
35
|
+
"@qilin-agent/llm": "3.1.5",
|
|
36
|
+
"@qilin-agent/sdk-protocol": "3.1.5",
|
|
37
37
|
"@qilin-agent/kylin": "~4.0.3",
|
|
38
|
-
"@qilin-agent/session": "3.1.
|
|
38
|
+
"@qilin-agent/session": "3.1.5"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@qilin-agent/llm": "3.1.
|
|
42
|
-
"@qilin-agent/sdk-protocol": "3.1.
|
|
43
|
-
"@qilin-agent/session": "3.1.
|
|
41
|
+
"@qilin-agent/llm": "3.1.5",
|
|
42
|
+
"@qilin-agent/sdk-protocol": "3.1.5",
|
|
43
|
+
"@qilin-agent/session": "3.1.5",
|
|
44
44
|
"@qilin-agent/kylin": "~4.0.3"
|
|
45
45
|
}
|
|
46
46
|
}
|