@trygentic/agentloop 0.1.1-alpha.3 → 0.4.0-alpha.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/LICENSE +1 -1
- package/README.md +178 -59
- package/bin/agentloop +83 -0
- package/package.json +17 -85
- package/scripts/postinstall.mjs +82 -0
- package/bin/dev.js +0 -55
- package/bin/run.js +0 -120
- package/dist-obfuscated/commands/auth/logout.js +0 -3
- package/dist-obfuscated/commands/auth/status.js +0 -3
- package/dist-obfuscated/commands/auth/switch.js +0 -3
- package/dist-obfuscated/commands/config.js +0 -3
- package/dist-obfuscated/commands/interactive.js +0 -3
- package/dist-obfuscated/commands/orchestrator.js +0 -3
- package/dist-obfuscated/commands/query.js +0 -3
- package/dist-obfuscated/commands/telemetry/test.js +0 -3
- package/dist-obfuscated/daemon/index.js +0 -5
- package/dist-obfuscated/hooks/prerun/check-auth.js +0 -3
- package/dist-obfuscated/hooks/prerun/daemon-auto-restart.js +0 -3
- package/dist-obfuscated/instrument.js +0 -4
- package/dist-obfuscated/lib.js +0 -4
- package/dist-obfuscated/workers/agent-worker-sdk-wrapper.js +0 -21397
- package/dist-obfuscated/workers/agent-worker.js +0 -5
package/bin/run.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import "dotenv/config";
|
|
3
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
4
|
-
console.log("[bin/run.js] Script started");
|
|
5
|
-
}
|
|
6
|
-
let useObfuscated = process.env.AGENTLOOP_DEV !== "1";
|
|
7
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
8
|
-
console.log("[bin/run.js] useObfuscated:", useObfuscated);
|
|
9
|
-
}
|
|
10
|
-
if (useObfuscated) {
|
|
11
|
-
try {
|
|
12
|
-
await import("../dist-obfuscated/instrument.js");
|
|
13
|
-
} catch {
|
|
14
|
-
useObfuscated = false;
|
|
15
|
-
try {
|
|
16
|
-
await import("../dist/instrument.js");
|
|
17
|
-
} catch (error) {
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
try {
|
|
21
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
22
|
-
console.log("[bin/run.js] Importing obfuscated lib.js for analytics");
|
|
23
|
-
}
|
|
24
|
-
const obfuscatedLib = await import("../dist-obfuscated/lib.js");
|
|
25
|
-
await obfuscatedLib.initMixpanel();
|
|
26
|
-
globalThis.__agentloop_analytics__ = obfuscatedLib;
|
|
27
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
28
|
-
console.log("[bin/run.js] Stored obfuscated analytics module in globalThis", {
|
|
29
|
-
hasModule: !!obfuscatedLib,
|
|
30
|
-
hasInitMixpanel: typeof obfuscatedLib.initMixpanel === "function",
|
|
31
|
-
globalSet: !!globalThis.__agentloop_analytics__
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
} catch (err) {
|
|
35
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
36
|
-
console.log("[bin/run.js] Failed to import obfuscated lib.js:", err);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
try {
|
|
41
|
-
await import("../dist/instrument.js");
|
|
42
|
-
} catch (error) {
|
|
43
|
-
}
|
|
44
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
45
|
-
console.log("[bin/run.js] Starting import of dist/utils/analytics.js");
|
|
46
|
-
}
|
|
47
|
-
try {
|
|
48
|
-
const analyticsModule = await import("../dist/utils/analytics.js");
|
|
49
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
50
|
-
console.log("[bin/run.js] Import successful, calling initMixpanel()");
|
|
51
|
-
}
|
|
52
|
-
await analyticsModule.initMixpanel();
|
|
53
|
-
globalThis.__agentloop_analytics__ = analyticsModule;
|
|
54
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
55
|
-
console.log("[bin/run.js] Stored analytics module in globalThis", {
|
|
56
|
-
hasModule: !!analyticsModule,
|
|
57
|
-
hasInitMixpanel: typeof analyticsModule.initMixpanel === "function",
|
|
58
|
-
globalSet: !!globalThis.__agentloop_analytics__
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
} catch (err) {
|
|
62
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
63
|
-
console.log("[bin/run.js] dist/utils/analytics.js not found, trying source...", err);
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
const analyticsModule = await import("../src/utils/analytics.js");
|
|
67
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
68
|
-
console.log("[bin/run.js] Source import successful, calling initMixpanel()");
|
|
69
|
-
}
|
|
70
|
-
await analyticsModule.initMixpanel();
|
|
71
|
-
globalThis.__agentloop_analytics__ = analyticsModule;
|
|
72
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
73
|
-
console.log("[bin/run.js] Stored source analytics module in globalThis", {
|
|
74
|
-
hasModule: !!analyticsModule,
|
|
75
|
-
hasInitMixpanel: typeof analyticsModule.initMixpanel === "function",
|
|
76
|
-
globalSet: !!globalThis.__agentloop_analytics__
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
} catch (sourceErr) {
|
|
80
|
-
if (process.env.MIXPANEL_DEBUG === "true") {
|
|
81
|
-
console.log("[bin/run.js] Source import also failed:", sourceErr);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
import { execute } from "@oclif/core";
|
|
87
|
-
import { readFileSync, existsSync } from "fs";
|
|
88
|
-
import { dirname, join } from "path";
|
|
89
|
-
import { fileURLToPath } from "url";
|
|
90
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
91
|
-
const packageJsonPath = join(__dirname, "..", "package.json");
|
|
92
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
93
|
-
const distObfuscatedPath = join(__dirname, "..", "dist-obfuscated");
|
|
94
|
-
const distObfuscatedCommandsPath = join(distObfuscatedPath, "commands");
|
|
95
|
-
if (!existsSync(distObfuscatedCommandsPath) || !useObfuscated) {
|
|
96
|
-
if (packageJson.oclif) {
|
|
97
|
-
if (packageJson.oclif.commands) {
|
|
98
|
-
packageJson.oclif.commands = packageJson.oclif.commands.replace("dist-obfuscated", "dist");
|
|
99
|
-
}
|
|
100
|
-
if (packageJson.oclif.hooks) {
|
|
101
|
-
Object.keys(packageJson.oclif.hooks).forEach((hookName) => {
|
|
102
|
-
const hookValue = packageJson.oclif.hooks[hookName];
|
|
103
|
-
if (typeof hookValue === "string") {
|
|
104
|
-
packageJson.oclif.hooks[hookName] = hookValue.replace("dist-obfuscated", "dist");
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
const args = process.argv.slice(2);
|
|
111
|
-
if (args.length === 0 || args.length === 1 && (args[0] === "--help" || args[0] === "-h")) {
|
|
112
|
-
if (args.length === 0) {
|
|
113
|
-
process.argv.push("interactive");
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
await execute({
|
|
117
|
-
development: false,
|
|
118
|
-
dir: import.meta.url,
|
|
119
|
-
loadOptions: packageJson.oclif ? { root: join(__dirname, ".."), pjson: packageJson } : void 0
|
|
120
|
-
});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{AuthLogoutCmd as C}from'../../lib.js';export default C;
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b45356ff-75c4-59c2-859c-030c7bbc30af")}catch(e){}}();
|
|
3
|
-
//# debugId=b45356ff-75c4-59c2-859c-030c7bbc30af
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{AuthStatusCmd as C}from'../../lib.js';export default C;
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3454d9c1-40cc-561f-bfe5-44cff9d1b268")}catch(e){}}();
|
|
3
|
-
//# debugId=3454d9c1-40cc-561f-bfe5-44cff9d1b268
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{AuthSwitchCmd as C}from'../../lib.js';export default C;
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="07730ca2-9e25-5f33-b224-c17f223ba126")}catch(e){}}();
|
|
3
|
-
//# debugId=07730ca2-9e25-5f33-b224-c17f223ba126
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{ConfigCmd as C}from'../lib.js';export default C;
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7a21f0aa-37f7-5f64-8de2-15a948167ca0")}catch(e){}}();
|
|
3
|
-
//# debugId=7a21f0aa-37f7-5f64-8de2-15a948167ca0
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{InteractiveCmd as C}from'../lib.js';export default C;
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cd540ae0-62ed-5a66-a7cb-93f2fbfed4cc")}catch(e){}}();
|
|
3
|
-
//# debugId=cd540ae0-62ed-5a66-a7cb-93f2fbfed4cc
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{OrchestratorCmd as C}from'../lib.js';export default C;
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fd2a3d63-2328-5135-a346-3a4098e2293f")}catch(e){}}();
|
|
3
|
-
//# debugId=fd2a3d63-2328-5135-a346-3a4098e2293f
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{QueryCmd as C}from'../lib.js';export default C;
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b0914a97-a876-5942-8319-59f1ffdbf8b2")}catch(e){}}();
|
|
3
|
-
//# debugId=b0914a97-a876-5942-8319-59f1ffdbf8b2
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{TelemetryTestCmd as C}from'../../lib.js';export default C;
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="60c0e0a5-bb9a-58f9-a92e-84936b811cd9")}catch(e){}}();
|
|
3
|
-
//# debugId=60c0e0a5-bb9a-58f9-a92e-84936b811cd9
|