@intella/cli 0.0.2 → 0.0.4
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/index.js +11 -19
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// @bun
|
|
4
|
-
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
5
|
// Polyfill import.meta.require for Node.js compatibility
|
|
6
|
-
import { createRequire } from 'module';
|
|
7
6
|
if (typeof import.meta.require === 'undefined') {
|
|
8
7
|
const require = createRequire(import.meta.url);
|
|
9
8
|
Object.defineProperty(import.meta, 'require', {
|
|
@@ -13,7 +12,6 @@ if (typeof import.meta.require === 'undefined') {
|
|
|
13
12
|
});
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
import { createRequire } from "node:module";
|
|
17
15
|
var __create = Object.create;
|
|
18
16
|
var __getProtoOf = Object.getPrototypeOf;
|
|
19
17
|
var __defProp = Object.defineProperty;
|
|
@@ -50325,7 +50323,7 @@ async function standardizePrompt(prompt) {
|
|
|
50325
50323
|
function wrapGatewayError(error95) {
|
|
50326
50324
|
if (!GatewayAuthenticationError.isInstance(error95))
|
|
50327
50325
|
return error95;
|
|
50328
|
-
const isProductionEnv = (process == null ? undefined : "
|
|
50326
|
+
const isProductionEnv = (process == null ? undefined : "production") === "production";
|
|
50329
50327
|
const moreInfoURL = "https://ai-sdk.dev/unauthenticated-ai-gateway";
|
|
50330
50328
|
if (isProductionEnv) {
|
|
50331
50329
|
return new AISDKError3({
|
|
@@ -56071,20 +56069,14 @@ class BaseAgent {
|
|
|
56071
56069
|
};
|
|
56072
56070
|
}
|
|
56073
56071
|
async* stream(request) {
|
|
56074
|
-
fetch("http://127.0.0.1:7243/ingest/af6d1e68-d1f5-4ccb-b7ab-847e12066a89", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ location: "base-agent.ts:50", message: "stream() called", data: { requestPrompt: request.prompt, requestHasMessages: !!request.messages, requestMessagesLength: request.messages?.length, agentType: this.type }, timestamp: Date.now(), sessionId: "debug-session", runId: "run1", hypothesisId: "A" }) }).catch(() => {
|
|
56075
|
-
});
|
|
56076
56072
|
const model = await Promise.resolve(this.getModel());
|
|
56077
56073
|
const messages = this.buildMessages(request);
|
|
56078
|
-
fetch("http://127.0.0.1:7243/ingest/af6d1e68-d1f5-4ccb-b7ab-847e12066a89", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ location: "base-agent.ts:54", message: "messages built", data: { messagesLength: messages.length, messages: messages.map((m) => ({ role: m.role, contentType: typeof m.content, contentIsString: typeof m.content === "string", contentPreview: typeof m.content === "string" ? m.content.substring(0, 50) : "array" })), agentType: this.type }, timestamp: Date.now(), sessionId: "debug-session", runId: "run1", hypothesisId: "B" }) }).catch(() => {
|
|
56079
|
-
});
|
|
56080
56074
|
const result = streamText({
|
|
56081
56075
|
model,
|
|
56082
56076
|
messages,
|
|
56083
56077
|
temperature: request.temperature ?? this.config.temperature,
|
|
56084
56078
|
maxOutputTokens: request.maxTokens ?? this.config.maxTokens
|
|
56085
56079
|
});
|
|
56086
|
-
fetch("http://127.0.0.1:7243/ingest/af6d1e68-d1f5-4ccb-b7ab-847e12066a89", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ location: "base-agent.ts:60", message: "streamText() called", data: { messagesLength: messages.length, agentType: this.type }, timestamp: Date.now(), sessionId: "debug-session", runId: "run1", hypothesisId: "C" }) }).catch(() => {
|
|
56087
|
-
});
|
|
56088
56080
|
let fullText = "";
|
|
56089
56081
|
for await (const chunk of result.fullStream) {
|
|
56090
56082
|
console.log("chunk", chunk);
|
|
@@ -56138,8 +56130,6 @@ class BaseAgent {
|
|
|
56138
56130
|
});
|
|
56139
56131
|
}
|
|
56140
56132
|
buildMessages(request) {
|
|
56141
|
-
fetch("http://127.0.0.1:7243/ingest/af6d1e68-d1f5-4ccb-b7ab-847e12066a89", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ location: "base-agent.ts:135", message: "buildMessages() entry", data: { hasPrompt: !!request.prompt, promptType: typeof request.prompt, promptValue: request.prompt?.substring?.(0, 50), hasSystemPrompt: !!request.systemPrompt, hasMessages: !!request.messages, messagesLength: request.messages?.length, agentType: this.type }, timestamp: Date.now(), sessionId: "debug-session", runId: "run1", hypothesisId: "D" }) }).catch(() => {
|
|
56142
|
-
});
|
|
56143
56133
|
const messages = [];
|
|
56144
56134
|
if (request.systemPrompt) {
|
|
56145
56135
|
messages.push({
|
|
@@ -56153,8 +56143,6 @@ class BaseAgent {
|
|
|
56153
56143
|
continue;
|
|
56154
56144
|
}
|
|
56155
56145
|
const convertedContent = this.convertContent(msg.content);
|
|
56156
|
-
fetch("http://127.0.0.1:7243/ingest/af6d1e68-d1f5-4ccb-b7ab-847e12066a89", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ location: "base-agent.ts:157", message: "converted message content", data: { role: msg.role, originalContentType: typeof msg.content, convertedContentType: typeof convertedContent, isArray: Array.isArray(convertedContent), agentType: this.type }, timestamp: Date.now(), sessionId: "debug-session", runId: "run1", hypothesisId: "E" }) }).catch(() => {
|
|
56157
|
-
});
|
|
56158
56146
|
messages.push({
|
|
56159
56147
|
role: msg.role,
|
|
56160
56148
|
content: convertedContent
|
|
@@ -56167,8 +56155,6 @@ class BaseAgent {
|
|
|
56167
56155
|
content: request.prompt
|
|
56168
56156
|
});
|
|
56169
56157
|
}
|
|
56170
|
-
fetch("http://127.0.0.1:7243/ingest/af6d1e68-d1f5-4ccb-b7ab-847e12066a89", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ location: "base-agent.ts:170", message: "buildMessages() exit", data: { messagesLength: messages.length, messages: messages.map((m) => ({ role: m.role, contentType: typeof m.content, contentPreview: typeof m.content === "string" ? m.content.substring(0, 50) : "array" })), agentType: this.type }, timestamp: Date.now(), sessionId: "debug-session", runId: "run1", hypothesisId: "D" }) }).catch(() => {
|
|
56171
|
-
});
|
|
56172
56158
|
return messages;
|
|
56173
56159
|
}
|
|
56174
56160
|
}
|
|
@@ -295912,7 +295898,7 @@ var require_dev_credentials = __commonJS((exports) => {
|
|
|
295912
295898
|
return auth;
|
|
295913
295899
|
}
|
|
295914
295900
|
function shouldPromptForCredentials() {
|
|
295915
|
-
return
|
|
295901
|
+
return false;
|
|
295916
295902
|
}
|
|
295917
295903
|
async function generateCredentials(opts) {
|
|
295918
295904
|
const { OAuth, pollForToken, getAuth, updateAuthConfig, inferScope } = await importAuth();
|
|
@@ -298281,11 +298267,17 @@ function initializeIntellaDirs() {
|
|
|
298281
298267
|
function initializeAuthDir() {
|
|
298282
298268
|
initializeIntellaDirs();
|
|
298283
298269
|
}
|
|
298270
|
+
function getEnv() {
|
|
298271
|
+
return "production";
|
|
298272
|
+
}
|
|
298284
298273
|
function getApiUrl() {
|
|
298285
298274
|
if (process.env.INTELLA_API_URL) {
|
|
298286
298275
|
return process.env.INTELLA_API_URL;
|
|
298287
298276
|
}
|
|
298288
|
-
|
|
298277
|
+
let isDev = getEnv() === "development";
|
|
298278
|
+
if (process.env.INTELLA_DEV === "true") {
|
|
298279
|
+
isDev = true;
|
|
298280
|
+
}
|
|
298289
298281
|
if (isDev) {
|
|
298290
298282
|
return "http://localhost:3004";
|
|
298291
298283
|
}
|
|
@@ -326593,4 +326585,4 @@ yargs_default(hideBin(process.argv)).scriptName("intella-cli").version("1.0.0").
|
|
|
326593
326585
|
await whoamiCommand();
|
|
326594
326586
|
}).demandCommand(1, "You need at least one command before moving on").help().alias("help", "h").alias("version", "v").strict().parse();
|
|
326595
326587
|
|
|
326596
|
-
//# debugId=
|
|
326588
|
+
//# debugId=20B8594E5F52196064756E2164756E21
|