@jupyter-ai/pi-lite-terminal 0.0.0 → 0.1.0
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.d.ts +7 -0
- package/lib/index.js +20 -0
- package/package.json +72 -1
- package/src/index.ts +32 -0
- package/style/base.css +3 -0
- package/style/index.css +1 -0
- package/style/index.js +1 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
2
|
+
/**
|
|
3
|
+
* Register the `pi` command (and its `ai` alias) in JupyterLite terminals.
|
|
4
|
+
*/
|
|
5
|
+
declare const plugin: JupyterFrontEndPlugin<void>;
|
|
6
|
+
export default plugin;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ILiteTerminalAPIClient } from '@jupyterlite/terminal';
|
|
2
|
+
import { IPiAgent } from '@jupyter-ai/pi-lite';
|
|
3
|
+
/**
|
|
4
|
+
* Register the `pi` command (and its `ai` alias) in JupyterLite terminals.
|
|
5
|
+
*/
|
|
6
|
+
const plugin = {
|
|
7
|
+
id: '@jupyter-ai/pi-lite-terminal:plugin',
|
|
8
|
+
description: 'The pi coding agent as a command in the JupyterLite terminal',
|
|
9
|
+
autoStart: true,
|
|
10
|
+
requires: [ILiteTerminalAPIClient, IPiAgent],
|
|
11
|
+
activate: (app, client, agent) => {
|
|
12
|
+
client.registerExternalCommand({
|
|
13
|
+
name: 'pi',
|
|
14
|
+
command: context => agent.runTerminal(context)
|
|
15
|
+
});
|
|
16
|
+
client.registerAlias('ai', 'pi');
|
|
17
|
+
client.terminalDisposed.connect((sender, shellId) => agent.stopTerminal(shellId));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export default plugin;
|
package/package.json
CHANGED
|
@@ -1,7 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-ai/pi-lite-terminal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The pi coding agent as a command in the JupyterLite terminal",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"jupyter",
|
|
7
|
+
"jupyterlab",
|
|
8
|
+
"jupyterlite",
|
|
9
|
+
"jupyterlab-extension"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/jupyter-ai-contrib/jupyter-ai-pi-lite",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/jupyter-ai-contrib/jupyter-ai-pi-lite/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "BSD-3-Clause",
|
|
16
|
+
"author": "JupyterLite Contributors",
|
|
17
|
+
"files": [
|
|
18
|
+
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf,md}",
|
|
19
|
+
"style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
|
|
20
|
+
"src/**/*.{ts,tsx}"
|
|
21
|
+
],
|
|
22
|
+
"main": "lib/index.js",
|
|
23
|
+
"types": "lib/index.d.ts",
|
|
24
|
+
"style": "style/index.css",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/jupyter-ai-contrib/jupyter-ai-pi-lite.git",
|
|
28
|
+
"directory": "packages/pi-lite-terminal"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "echo 'Building @jupyter-ai/pi-lite-terminal' && jlpm build:lib && jlpm build:labextension:dev",
|
|
32
|
+
"build:dev": "echo 'Building @jupyter-ai/pi-lite-terminal' && jlpm build:lib && jlpm build:labextension:dev",
|
|
33
|
+
"build:prod": "echo 'Building @jupyter-ai/pi-lite-terminal' && jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
|
|
34
|
+
"build:labextension": "jupyter-builder build .",
|
|
35
|
+
"build:labextension:dev": "jupyter-builder build --development True .",
|
|
36
|
+
"build:lib": "tsc --sourceMap",
|
|
37
|
+
"build:lib:prod": "tsc",
|
|
38
|
+
"clean": "jlpm clean:lib",
|
|
39
|
+
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
|
|
40
|
+
"install:extension": "jlpm build",
|
|
41
|
+
"watch": "run-p watch:src watch:labextension",
|
|
42
|
+
"watch:src": "tsc -w --sourceMap",
|
|
43
|
+
"watch:labextension": "jupyter-builder watch ."
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@jupyter-ai/pi-lite": "^0.1.0",
|
|
47
|
+
"@jupyterlab/application": "^4.5.8",
|
|
48
|
+
"@jupyterlite/terminal": "^1.6.2"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@jupyter/builder": "^1.2.2",
|
|
52
|
+
"npm-run-all2": "^7.0.1",
|
|
53
|
+
"rimraf": "^5.0.1",
|
|
54
|
+
"typescript": "~5.8.0"
|
|
55
|
+
},
|
|
56
|
+
"sideEffects": [
|
|
57
|
+
"style/*.css",
|
|
58
|
+
"style/index.js"
|
|
59
|
+
],
|
|
60
|
+
"styleModule": "style/index.js",
|
|
4
61
|
"publishConfig": {
|
|
5
62
|
"access": "public"
|
|
63
|
+
},
|
|
64
|
+
"jupyterlab": {
|
|
65
|
+
"extension": true,
|
|
66
|
+
"outputDir": "../../python/jupyter-ai-pi-lite-terminal/jupyter_ai_pi_lite_terminal/labextension",
|
|
67
|
+
"sharedPackages": {
|
|
68
|
+
"@jupyterlite/terminal": {
|
|
69
|
+
"bundled": false,
|
|
70
|
+
"singleton": true
|
|
71
|
+
},
|
|
72
|
+
"@jupyter-ai/pi-lite": {
|
|
73
|
+
"bundled": false,
|
|
74
|
+
"singleton": true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
6
77
|
}
|
|
7
78
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
JupyterFrontEnd,
|
|
3
|
+
JupyterFrontEndPlugin
|
|
4
|
+
} from '@jupyterlab/application';
|
|
5
|
+
import { ILiteTerminalAPIClient } from '@jupyterlite/terminal';
|
|
6
|
+
import { IPiAgent } from '@jupyter-ai/pi-lite';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Register the `pi` command (and its `ai` alias) in JupyterLite terminals.
|
|
10
|
+
*/
|
|
11
|
+
const plugin: JupyterFrontEndPlugin<void> = {
|
|
12
|
+
id: '@jupyter-ai/pi-lite-terminal:plugin',
|
|
13
|
+
description: 'The pi coding agent as a command in the JupyterLite terminal',
|
|
14
|
+
autoStart: true,
|
|
15
|
+
requires: [ILiteTerminalAPIClient, IPiAgent],
|
|
16
|
+
activate: (
|
|
17
|
+
app: JupyterFrontEnd,
|
|
18
|
+
client: ILiteTerminalAPIClient,
|
|
19
|
+
agent: IPiAgent
|
|
20
|
+
): void => {
|
|
21
|
+
client.registerExternalCommand({
|
|
22
|
+
name: 'pi',
|
|
23
|
+
command: context => agent.runTerminal(context)
|
|
24
|
+
});
|
|
25
|
+
client.registerAlias('ai', 'pi');
|
|
26
|
+
client.terminalDisposed.connect((sender, shellId) =>
|
|
27
|
+
agent.stopTerminal(shellId)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default plugin;
|
package/style/base.css
ADDED
package/style/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url('base.css');
|
package/style/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './base.css';
|