@easynet/agent-tool-buildin 0.0.43 → 0.0.44
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/dist/core-tools-manifest.json +2 -92
- package/dist/src/iterm/itermListCurrentWindowSessions.d.ts +12 -0
- package/dist/src/iterm/itermListCurrentWindowSessions.d.ts.map +1 -1
- package/dist/src/iterm/itermListCurrentWindowSessions.js +37 -4
- package/dist/src/iterm/itermListCurrentWindowSessions.js.map +1 -1
- package/package.json +1 -1
|
@@ -932,98 +932,8 @@
|
|
|
932
932
|
"outputSchema": {
|
|
933
933
|
"type": "object",
|
|
934
934
|
"properties": {
|
|
935
|
-
"result": {
|
|
936
|
-
|
|
937
|
-
"properties": {
|
|
938
|
-
"windowId": {
|
|
939
|
-
"type": "number"
|
|
940
|
-
},
|
|
941
|
-
"sessions": {
|
|
942
|
-
"type": "array",
|
|
943
|
-
"items": {
|
|
944
|
-
"type": "object",
|
|
945
|
-
"properties": {
|
|
946
|
-
"windowId": {
|
|
947
|
-
"type": "number"
|
|
948
|
-
},
|
|
949
|
-
"windowName": {
|
|
950
|
-
"type": "string"
|
|
951
|
-
},
|
|
952
|
-
"tabIndex": {
|
|
953
|
-
"type": "number"
|
|
954
|
-
},
|
|
955
|
-
"tabIndexZeroBased": {
|
|
956
|
-
"type": "number"
|
|
957
|
-
},
|
|
958
|
-
"isCurrentTab": {
|
|
959
|
-
"type": "boolean"
|
|
960
|
-
},
|
|
961
|
-
"sessionId": {
|
|
962
|
-
"type": "string"
|
|
963
|
-
},
|
|
964
|
-
"sessionUniqueId": {
|
|
965
|
-
"type": "string"
|
|
966
|
-
},
|
|
967
|
-
"sessionName": {
|
|
968
|
-
"type": "string"
|
|
969
|
-
},
|
|
970
|
-
"tty": {
|
|
971
|
-
"type": "string"
|
|
972
|
-
},
|
|
973
|
-
"isCurrentSession": {
|
|
974
|
-
"type": "boolean"
|
|
975
|
-
}
|
|
976
|
-
},
|
|
977
|
-
"required": [
|
|
978
|
-
"windowId",
|
|
979
|
-
"windowName",
|
|
980
|
-
"tabIndex",
|
|
981
|
-
"tabIndexZeroBased",
|
|
982
|
-
"isCurrentTab",
|
|
983
|
-
"sessionId",
|
|
984
|
-
"sessionUniqueId",
|
|
985
|
-
"sessionName",
|
|
986
|
-
"tty",
|
|
987
|
-
"isCurrentSession"
|
|
988
|
-
]
|
|
989
|
-
}
|
|
990
|
-
},
|
|
991
|
-
"count": {
|
|
992
|
-
"type": "number"
|
|
993
|
-
}
|
|
994
|
-
},
|
|
995
|
-
"required": [
|
|
996
|
-
"windowId",
|
|
997
|
-
"sessions",
|
|
998
|
-
"count"
|
|
999
|
-
]
|
|
1000
|
-
},
|
|
1001
|
-
"evidence": {
|
|
1002
|
-
"type": "array",
|
|
1003
|
-
"items": {
|
|
1004
|
-
"type": "object",
|
|
1005
|
-
"properties": {
|
|
1006
|
-
"type": {
|
|
1007
|
-
"type": "string"
|
|
1008
|
-
},
|
|
1009
|
-
"ref": {
|
|
1010
|
-
"type": "string"
|
|
1011
|
-
},
|
|
1012
|
-
"summary": {
|
|
1013
|
-
"type": "string"
|
|
1014
|
-
},
|
|
1015
|
-
"createdAt": {
|
|
1016
|
-
"type": "string"
|
|
1017
|
-
}
|
|
1018
|
-
},
|
|
1019
|
-
"required": [
|
|
1020
|
-
"type",
|
|
1021
|
-
"ref",
|
|
1022
|
-
"summary",
|
|
1023
|
-
"createdAt"
|
|
1024
|
-
]
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
935
|
+
"result": {},
|
|
936
|
+
"evidence": {}
|
|
1027
937
|
},
|
|
1028
938
|
"required": [
|
|
1029
939
|
"result",
|
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
* @effect none
|
|
6
6
|
*/
|
|
7
7
|
export declare function itermListCurrentWindowSessions(_?: {}): Promise<{
|
|
8
|
+
result: {
|
|
9
|
+
windowId: null;
|
|
10
|
+
sessions: never[];
|
|
11
|
+
count: number;
|
|
12
|
+
};
|
|
13
|
+
evidence: {
|
|
14
|
+
type: string;
|
|
15
|
+
ref: string;
|
|
16
|
+
summary: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
}[];
|
|
19
|
+
} | {
|
|
8
20
|
result: {
|
|
9
21
|
windowId: number;
|
|
10
22
|
sessions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"itermListCurrentWindowSessions.d.ts","sourceRoot":"","sources":["../../../src/iterm/itermListCurrentWindowSessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"itermListCurrentWindowSessions.d.ts","sourceRoot":"","sources":["../../../src/iterm/itermListCurrentWindowSessions.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,8BAA8B,CAAC,CAAC,GAAE,EAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+D9D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { itermListWindows } from "./itermListWindows.js";
|
|
2
|
-
import { createTaggedError } from "./common.js";
|
|
3
2
|
/**
|
|
4
3
|
* List all sessions (panels) in the current iTerm2 window only.
|
|
5
4
|
* Equivalent to: first find the current window, then return all tabs/sessions under it.
|
|
@@ -9,11 +8,45 @@ import { createTaggedError } from "./common.js";
|
|
|
9
8
|
export async function itermListCurrentWindowSessions(_ = {}) {
|
|
10
9
|
const { result } = await itermListWindows();
|
|
11
10
|
const sessions = result.sessions ?? [];
|
|
11
|
+
if (sessions.length === 0) {
|
|
12
|
+
return {
|
|
13
|
+
result: {
|
|
14
|
+
windowId: null,
|
|
15
|
+
sessions: [],
|
|
16
|
+
count: 0,
|
|
17
|
+
},
|
|
18
|
+
evidence: [
|
|
19
|
+
{
|
|
20
|
+
type: "tool",
|
|
21
|
+
ref: "itermListCurrentWindowSessions",
|
|
22
|
+
summary: "No iTerm2 sessions found in current context",
|
|
23
|
+
createdAt: new Date().toISOString(),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
12
28
|
const current = sessions.find((s) => s.isCurrentSession);
|
|
13
|
-
|
|
14
|
-
|
|
29
|
+
const currentTab = sessions.find((s) => s.isCurrentTab);
|
|
30
|
+
const fallback = sessions[0];
|
|
31
|
+
const target = current ?? currentTab ?? fallback;
|
|
32
|
+
if (!target) {
|
|
33
|
+
return {
|
|
34
|
+
result: {
|
|
35
|
+
windowId: null,
|
|
36
|
+
sessions: [],
|
|
37
|
+
count: 0,
|
|
38
|
+
},
|
|
39
|
+
evidence: [
|
|
40
|
+
{
|
|
41
|
+
type: "tool",
|
|
42
|
+
ref: "itermListCurrentWindowSessions",
|
|
43
|
+
summary: "Unable to resolve current iTerm2 window sessions",
|
|
44
|
+
createdAt: new Date().toISOString(),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
15
48
|
}
|
|
16
|
-
const windowId =
|
|
49
|
+
const windowId = target.windowId;
|
|
17
50
|
const windowSessions = sessions.filter((s) => s.windowId === windowId);
|
|
18
51
|
return {
|
|
19
52
|
result: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"itermListCurrentWindowSessions.js","sourceRoot":"","sources":["../../../src/iterm/itermListCurrentWindowSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"itermListCurrentWindowSessions.js","sourceRoot":"","sources":["../../../src/iterm/itermListCurrentWindowSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAC,IAAQ,EAAE;IAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAC5C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;IAEvC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EA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cAAc;YACxB,KAAK,EAAE,cAAc,CAAC,MAAM;SAC7B;QACD,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,GAAG,EAAE,gCAAgC;gBACrC,OAAO,EAAE,UAAU,cAAc,CAAC,MAAM,+BAA+B,QAAQ,EAAE;gBACjF,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easynet/agent-tool-buildin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"description": "Tools extension for @easynet/agent-tool: FS, HTTP, util, security (sandbox, SSRF). Same contract as any other extension.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|