@staticpayload/zai-code 1.0.2 → 1.1.1
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/cli.js +7 -17
- package/dist/cli.js.map +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +40 -1
- package/dist/commands.js.map +1 -1
- package/dist/interactive.d.ts +2 -0
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +287 -191
- package/dist/interactive.js.map +1 -1
- package/dist/profiles.js +3 -3
- package/dist/profiles.js.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/settings.d.ts +6 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +9 -9
- package/dist/settings.js.map +1 -1
- package/dist/tui/App.d.ts +11 -0
- package/dist/tui/App.d.ts.map +1 -0
- package/dist/tui/App.js +159 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/CommandPalette.d.ts +17 -0
- package/dist/tui/CommandPalette.d.ts.map +1 -0
- package/dist/tui/CommandPalette.js +50 -0
- package/dist/tui/CommandPalette.js.map +1 -0
- package/dist/tui/Header.d.ts +8 -0
- package/dist/tui/Header.d.ts.map +1 -0
- package/dist/tui/Header.js +33 -0
- package/dist/tui/Header.js.map +1 -0
- package/dist/tui/InputBox.d.ts +13 -0
- package/dist/tui/InputBox.d.ts.map +1 -0
- package/dist/tui/InputBox.js +42 -0
- package/dist/tui/InputBox.js.map +1 -0
- package/dist/tui/OutputArea.d.ts +13 -0
- package/dist/tui/OutputArea.d.ts.map +1 -0
- package/dist/tui/OutputArea.js +26 -0
- package/dist/tui/OutputArea.js.map +1 -0
- package/dist/tui/entry.d.ts +2 -0
- package/dist/tui/entry.d.ts.map +1 -0
- package/dist/tui/entry.js +84 -0
- package/dist/tui/entry.js.map +1 -0
- package/dist/tui/index.d.ts +6 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +14 -0
- package/dist/tui/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.startTUI = startTUI;
|
|
40
|
+
const react_1 = __importDefault(require("react"));
|
|
41
|
+
const ink_1 = require("ink");
|
|
42
|
+
const App_1 = require("./App");
|
|
43
|
+
const orchestrator_1 = require("../orchestrator");
|
|
44
|
+
const session_1 = require("../session");
|
|
45
|
+
const workspace_model_1 = require("../workspace_model");
|
|
46
|
+
const auth_1 = require("../auth");
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
// Capture console.log output for TUI
|
|
49
|
+
let pendingOutput = [];
|
|
50
|
+
const originalLog = console.log;
|
|
51
|
+
function captureLog(type) {
|
|
52
|
+
return (...args) => {
|
|
53
|
+
const text = args.map(a => String(a)).join(' ');
|
|
54
|
+
pendingOutput.push({ type, text });
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// Process input and return output lines
|
|
58
|
+
async function processInput(input) {
|
|
59
|
+
pendingOutput = [];
|
|
60
|
+
// Temporarily override console.log
|
|
61
|
+
console.log = captureLog('plain');
|
|
62
|
+
try {
|
|
63
|
+
await (0, orchestrator_1.orchestrate)(input);
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
pendingOutput.push({ type: 'error', text: String(e) });
|
|
67
|
+
}
|
|
68
|
+
// Restore console.log
|
|
69
|
+
console.log = originalLog;
|
|
70
|
+
return pendingOutput;
|
|
71
|
+
}
|
|
72
|
+
async function startTUI() {
|
|
73
|
+
await (0, auth_1.ensureAuthenticated)();
|
|
74
|
+
const session = (0, session_1.getSession)();
|
|
75
|
+
const ws = (0, workspace_model_1.getWorkspace)(session.workingDirectory);
|
|
76
|
+
// Restore session
|
|
77
|
+
ws.restoreState();
|
|
78
|
+
const projectName = path.basename(session.workingDirectory);
|
|
79
|
+
const { waitUntilExit } = (0, ink_1.render)(react_1.default.createElement(App_1.App, { projectName: projectName, workingDirectory: session.workingDirectory, onCommand: processInput, onExit: () => {
|
|
80
|
+
ws.saveState();
|
|
81
|
+
} }));
|
|
82
|
+
await waitUntilExit();
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/tui/entry.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,4BAuBC;AAhED,kDAA0B;AAC1B,6BAA6B;AAC7B,+BAA4B;AAG5B,kDAA8C;AAC9C,wCAAkE;AAClE,wDAAkD;AAClD,kCAA8C;AAC9C,2CAA6B;AAE7B,qCAAqC;AACrC,IAAI,aAAa,GAAiB,EAAE,CAAC;AACrC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;AAEhC,SAAS,UAAU,CAAC,IAAwB;IACxC,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE;QAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC;AACN,CAAC;AAED,wCAAwC;AACxC,KAAK,UAAU,YAAY,CAAC,KAAa;IACrC,aAAa,GAAG,EAAE,CAAC;IAEnB,mCAAmC;IACnC,OAAO,CAAC,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAElC,IAAI,CAAC;QACD,MAAM,IAAA,0BAAW,EAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,sBAAsB;IACtB,OAAO,CAAC,GAAG,GAAG,WAAW,CAAC;IAE1B,OAAO,aAAa,CAAC;AACzB,CAAC;AAEM,KAAK,UAAU,QAAQ;IAC1B,MAAM,IAAA,0BAAmB,GAAE,CAAC;IAE5B,MAAM,OAAO,GAAG,IAAA,oBAAU,GAAE,CAAC;IAC7B,MAAM,EAAE,GAAG,IAAA,8BAAY,EAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAElD,kBAAkB;IAClB,EAAE,CAAC,YAAY,EAAE,CAAC;IAElB,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE5D,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,YAAM,EAC5B,8BAAC,SAAG,IACA,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,EAC1C,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,GAAG,EAAE;YACT,EAAE,CAAC,SAAS,EAAE,CAAC;QACnB,CAAC,GACH,CACL,CAAC;IAEF,MAAM,aAAa,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandPalette = exports.InputBox = exports.OutputArea = exports.Header = exports.App = void 0;
|
|
4
|
+
var App_1 = require("./App");
|
|
5
|
+
Object.defineProperty(exports, "App", { enumerable: true, get: function () { return App_1.App; } });
|
|
6
|
+
var Header_1 = require("./Header");
|
|
7
|
+
Object.defineProperty(exports, "Header", { enumerable: true, get: function () { return Header_1.Header; } });
|
|
8
|
+
var OutputArea_1 = require("./OutputArea");
|
|
9
|
+
Object.defineProperty(exports, "OutputArea", { enumerable: true, get: function () { return OutputArea_1.OutputArea; } });
|
|
10
|
+
var InputBox_1 = require("./InputBox");
|
|
11
|
+
Object.defineProperty(exports, "InputBox", { enumerable: true, get: function () { return InputBox_1.InputBox; } });
|
|
12
|
+
var CommandPalette_1 = require("./CommandPalette");
|
|
13
|
+
Object.defineProperty(exports, "CommandPalette", { enumerable: true, get: function () { return CommandPalette_1.CommandPalette; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tui/index.tsx"],"names":[],"mappings":";;;AAAA,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,2CAAsD;AAA7C,wGAAA,UAAU,OAAA;AACnB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@staticpayload/zai-code",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Z.ai-native AI code editor - CLI-first, interactive editor shell with keyboard-driven settings, plan-diff-apply workflow, and safety-first design",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|