@lazyingart/agintiflow 0.20.133 → 0.20.134
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazyingart/agintiflow",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.134",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,7 +14,7 @@ AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-a
|
|
|
14
14
|
|
|
15
15
|
Project-oriented programming for agentic workflows.
|
|
16
16
|
|
|
17
|
-
AAPS is a prompt-native programming language and visual studio for turning prompts into structured, verifiable pipelines. It connects wet and dry experiments, hardware and software, and human intent with executable agent work through tasks, typed inputs, declared outputs, validation gates, recovery steps, and durable artifacts.
|
|
17
|
+
AAPS is a project oriented and prompt-native programming language and visual studio for turning prompts into structured, verifiable pipelines. It connects wet and dry experiments, hardware and software, and human intent with executable agent work through tasks, typed inputs, declared outputs, validation gates, recovery steps, and durable artifacts.
|
|
18
18
|
|
|
19
19
|
## Shorter Version
|
|
20
20
|
|
package/scripts/smoke-auth.js
CHANGED
|
@@ -66,9 +66,25 @@ try {
|
|
|
66
66
|
const veniceDefaults = getProviderDefaults("venice");
|
|
67
67
|
assert(veniceDefaults.provider === "venice" && veniceDefaults.model === "venice-uncensored-1-2", "venice provider defaults are not available");
|
|
68
68
|
|
|
69
|
+
process.env.DEEPSEEK_API_KEY = "ambient-deepseek-key";
|
|
70
|
+
process.env.VENICE_API_KEY = "ambient-venice-key";
|
|
71
|
+
process.env.GRSAI_API_KEY = "ambient-grsai-key";
|
|
72
|
+
let status = providerKeyStatus(tempRoot);
|
|
73
|
+
assert(status.deepseek && status.venice && status.grsai, "ambient provider keys were not detected");
|
|
74
|
+
assert(status.localEnv, "ambient provider keys were not persisted into local .aginti/.env");
|
|
75
|
+
const localEnv = await fs.readFile(path.join(tempRoot, ".aginti", ".env"), "utf8");
|
|
76
|
+
assert(localEnv.includes("DEEPSEEK_API_KEY="), "ambient DeepSeek key was not saved locally");
|
|
77
|
+
assert(localEnv.includes("VENICE_API_KEY="), "ambient Venice key was not saved locally");
|
|
78
|
+
assert(localEnv.includes("GRSAI_API_KEY="), "ambient GRS AI key was not saved locally");
|
|
79
|
+
delete process.env.DEEPSEEK_API_KEY;
|
|
80
|
+
delete process.env.VENICE_API_KEY;
|
|
81
|
+
delete process.env.GRSAI_API_KEY;
|
|
82
|
+
status = providerKeyStatus(tempRoot);
|
|
83
|
+
assert(status.deepseek && status.venice && status.grsai, "persisted provider keys were not reloaded after ambient env was cleared");
|
|
84
|
+
|
|
69
85
|
await setProviderKey(tempRoot, "qwen", "test-qwen-key");
|
|
70
86
|
await setProviderKey(tempRoot, "venice", "test-venice-key");
|
|
71
|
-
|
|
87
|
+
status = providerKeyStatus(tempRoot);
|
|
72
88
|
assert(status.qwen, "qwen key status was not detected");
|
|
73
89
|
assert(status.venice, "venice key status was not detected");
|
|
74
90
|
assert(status.envVars.qwen.includes("QWEN_API_KEY"), "qwen env var name was not reported");
|
|
@@ -103,6 +119,7 @@ try {
|
|
|
103
119
|
"provider-key-preview",
|
|
104
120
|
"qwen-defaults",
|
|
105
121
|
"venice-defaults",
|
|
122
|
+
"ambient-key-autopersist",
|
|
106
123
|
"qwen-key-status",
|
|
107
124
|
"venice-key-status",
|
|
108
125
|
"cli-key-status-redacted",
|
package/src/project.js
CHANGED
|
@@ -51,6 +51,16 @@ const PROVIDER_KEY_CANDIDATES = {
|
|
|
51
51
|
grsai: ["GRSAI", "GRSAI_API_KEY"],
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
const AMBIENT_PROVIDER_KEYS = [
|
|
55
|
+
"DEEPSEEK_API_KEY",
|
|
56
|
+
"OPENAI_API_KEY",
|
|
57
|
+
"QWEN_API_KEY",
|
|
58
|
+
"VENICE_API_KEY",
|
|
59
|
+
"GRSAI",
|
|
60
|
+
"GRSAI_API_KEY",
|
|
61
|
+
"LLM_API_KEY",
|
|
62
|
+
];
|
|
63
|
+
|
|
54
64
|
export function resolveProjectRoot(input = process.cwd()) {
|
|
55
65
|
return path.resolve(input || process.cwd());
|
|
56
66
|
}
|
|
@@ -206,6 +216,55 @@ export function parseEnvText(text = "") {
|
|
|
206
216
|
return values;
|
|
207
217
|
}
|
|
208
218
|
|
|
219
|
+
function ensureSecretGitignoreLinesSync(gitignorePath) {
|
|
220
|
+
const lines = [".aginti/.env", ".aginti/.env.*", "!.aginti/.env.example"];
|
|
221
|
+
let current = "";
|
|
222
|
+
try {
|
|
223
|
+
current = fs.readFileSync(gitignorePath, "utf8");
|
|
224
|
+
} catch {
|
|
225
|
+
current = "";
|
|
226
|
+
}
|
|
227
|
+
const existing = new Set(current.split(/\r?\n/).map((line) => line.trim()));
|
|
228
|
+
const missing = lines.filter((line) => !existing.has(line));
|
|
229
|
+
if (missing.length === 0) return;
|
|
230
|
+
const prefix = current && !current.endsWith("\n") ? "\n" : "";
|
|
231
|
+
fs.writeFileSync(gitignorePath, `${current}${prefix}${missing.join("\n")}\n`, "utf8");
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function persistAmbientProviderKeysSync(paths) {
|
|
235
|
+
let parsed = {};
|
|
236
|
+
try {
|
|
237
|
+
parsed = parseEnvText(fs.readFileSync(paths.envPath, "utf8"));
|
|
238
|
+
} catch {
|
|
239
|
+
parsed = {};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
let changed = false;
|
|
243
|
+
const persistedKeys = [];
|
|
244
|
+
for (const keyName of AMBIENT_PROVIDER_KEYS) {
|
|
245
|
+
const value = String(process.env[keyName] || "").trim();
|
|
246
|
+
if (!value || parsed[keyName]) continue;
|
|
247
|
+
parsed[keyName] = value;
|
|
248
|
+
persistedKeys.push(keyName);
|
|
249
|
+
changed = true;
|
|
250
|
+
}
|
|
251
|
+
if (!changed) return { persisted: false, keys: [] };
|
|
252
|
+
|
|
253
|
+
fs.mkdirSync(paths.controlDir, { recursive: true });
|
|
254
|
+
ensureSecretGitignoreLinesSync(paths.gitignorePath);
|
|
255
|
+
const output = Object.entries(parsed)
|
|
256
|
+
.filter(([key]) => LOCAL_ENV_KEYS.has(key))
|
|
257
|
+
.map(([key, value]) => `${key}=${JSON.stringify(value)}`)
|
|
258
|
+
.join("\n");
|
|
259
|
+
fs.writeFileSync(paths.envPath, `${output}\n`, { mode: 0o600 });
|
|
260
|
+
try {
|
|
261
|
+
fs.chmodSync(paths.envPath, 0o600);
|
|
262
|
+
} catch {
|
|
263
|
+
// chmod can fail on non-POSIX filesystems; the file still remains local and gitignored.
|
|
264
|
+
}
|
|
265
|
+
return { persisted: true, keys: persistedKeys };
|
|
266
|
+
}
|
|
267
|
+
|
|
209
268
|
export function loadProjectEnv(projectRoot = process.cwd(), { override = false } = {}) {
|
|
210
269
|
const paths = projectPaths(projectRoot);
|
|
211
270
|
const envPaths = [paths.rootEnvPath, paths.envPath];
|
|
@@ -222,10 +281,14 @@ export function loadProjectEnv(projectRoot = process.cwd(), { override = false }
|
|
|
222
281
|
// Ignore missing or unreadable optional local env files.
|
|
223
282
|
}
|
|
224
283
|
}
|
|
284
|
+
const ambient = persistAmbientProviderKeysSync(paths);
|
|
285
|
+
if (ambient.persisted && !loadedPaths.includes(paths.envPath)) loadedPaths.push(paths.envPath);
|
|
225
286
|
return {
|
|
226
287
|
loaded: loadedPaths.length > 0,
|
|
227
288
|
path: paths.envPath,
|
|
228
289
|
paths: loadedPaths,
|
|
290
|
+
ambientPersisted: ambient.persisted,
|
|
291
|
+
ambientKeys: ambient.keys,
|
|
229
292
|
};
|
|
230
293
|
}
|
|
231
294
|
|