@meffecta/agent 1.0.8 → 1.0.9
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/engine.json +2 -2
- package/lib/create-job.js +1 -1
- package/lib/verify-credentials.js +2 -2
- package/package.json +1 -1
- package/scripts/verify-credentials.mjs +37 -6
package/engine.json
CHANGED
package/lib/create-job.js
CHANGED
|
@@ -180,7 +180,7 @@ function buildPrompt(description, { timezone, existing }) {
|
|
|
180
180
|
"",
|
|
181
181
|
"Before writing anything, read what this deployment actually is:",
|
|
182
182
|
" - jobs/*.md in your working directory — the house style, and what already exists",
|
|
183
|
-
" - systems/
|
|
183
|
+
" - systems/ — what this deployment can reach, one file per system, and the variables for each",
|
|
184
184
|
" - worlds/ if present — the projects/products a job can be pointed at",
|
|
185
185
|
" - your own available skills — use only skills that exist; never invent a capability",
|
|
186
186
|
"",
|
|
@@ -40,8 +40,8 @@ PART 2 — this deployment's own systems.
|
|
|
40
40
|
|
|
41
41
|
Part 1 tests what the ENGINE knows how to test. It cannot test a system belonging to this
|
|
42
42
|
deployment specifically. The register of those is \`systems/\` in your working directory —
|
|
43
|
-
one file per system
|
|
44
|
-
|
|
43
|
+
one file per system. If it is not there, say so and stop: a deployment with no register has
|
|
44
|
+
no systems of its own that anything can check.
|
|
45
45
|
|
|
46
46
|
Each file's frontmatter says what to do:
|
|
47
47
|
system: what it is
|
package/package.json
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
// Never prints a credential value. Exits 1 if anything configured actually fails.
|
|
9
9
|
|
|
10
10
|
import { execFile } from "node:child_process";
|
|
11
|
-
import { readFileSync } from "node:fs";
|
|
11
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
12
13
|
import { fileURLToPath } from "node:url";
|
|
13
14
|
|
|
14
15
|
const env = process.env;
|
|
@@ -674,8 +675,8 @@ results.sort((a, b) => a.name.localeCompare(b.name));
|
|
|
674
675
|
// because this script ships to EVERY deployment and knows every integration the engine
|
|
675
676
|
// supports — which is always more than any one deployment uses. Listing them individually
|
|
676
677
|
// asks the operator "why is Kleer in my report?", and the honest answer is that it is not
|
|
677
|
-
// theirs and never was. The deployment's own register of what it can reach is
|
|
678
|
-
//
|
|
678
|
+
// theirs and never was. The deployment's own register of what it can reach is `systems/`
|
|
679
|
+
// in its content repo; the catalogue of what it could add is `connect`.
|
|
679
680
|
// Credentials this script has never heard of.
|
|
680
681
|
//
|
|
681
682
|
// A deployment adds its own systems, and their keys are just secrets bound to the service:
|
|
@@ -685,8 +686,8 @@ results.sort((a, b) => a.name.localeCompare(b.name));
|
|
|
685
686
|
// "everything works" while a set-but-never-exercised key sits beside it.
|
|
686
687
|
//
|
|
687
688
|
// So: name them, say plainly that nothing here can test them, and let the run that called
|
|
688
|
-
// this reconcile them against
|
|
689
|
-
//
|
|
689
|
+
// this reconcile them against `systems/` — the deployment's own register does know what
|
|
690
|
+
// they are and which skill reaches them.
|
|
690
691
|
//
|
|
691
692
|
// Known-ness is decided from this file's own source, so the list maintains itself: if the
|
|
692
693
|
// script mentions the variable, or the family it belongs to, it knows about it.
|
|
@@ -736,9 +737,39 @@ console.log(`\n${configured.length - failures.length} working, ${failures.length
|
|
|
736
737
|
if (unknownCredentials.length) {
|
|
737
738
|
// Names only. This script never prints a value, and that holds hardest for the ones it
|
|
738
739
|
// does not understand.
|
|
740
|
+
//
|
|
741
|
+
// Which of them are a PROBLEM, though, is a question this script can answer without
|
|
742
|
+
// knowing anything about the systems themselves: the register travels into every run, so
|
|
743
|
+
// it is right here in the working directory. A credential named in it is deliberate, and
|
|
744
|
+
// proving it works is Part 2's job; one named nowhere is a key no skill will ever reach
|
|
745
|
+
// for, however valid it is. Printing the whole list as a to-do told the operator to
|
|
746
|
+
// register things that were already registered, which is how a real gap gets skimmed
|
|
747
|
+
// past.
|
|
748
|
+
const registered = new Set();
|
|
749
|
+
const registerDir = join(process.cwd(), "systems");
|
|
750
|
+
if (existsSync(registerDir)) {
|
|
751
|
+
for (const entry of readdirSync(registerDir)) {
|
|
752
|
+
if (!entry.endsWith(".md")) continue;
|
|
753
|
+
const text = readFileSync(join(registerDir, entry), "utf8");
|
|
754
|
+
for (const name of unknownCredentials) {
|
|
755
|
+
if (text.includes(name)) registered.add(name);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
const unregistered = unknownCredentials.filter((name) => !registered.has(name));
|
|
739
760
|
console.log(`\nSet, but nothing here knows how to test them (${unknownCredentials.length}):`);
|
|
740
761
|
console.log(` ${unknownCredentials.join(", ")}`);
|
|
741
|
-
|
|
762
|
+
if (!existsSync(registerDir)) {
|
|
763
|
+
// No register to read — say the general thing rather than accuse every one of them.
|
|
764
|
+
console.log(" Each needs a file in systems/ saying which skill reaches it.");
|
|
765
|
+
} else {
|
|
766
|
+
if (registered.size) {
|
|
767
|
+
console.log(` In systems/, so a job can reach them: ${[...registered].sort().join(", ")}`);
|
|
768
|
+
}
|
|
769
|
+
if (unregistered.length) {
|
|
770
|
+
console.log(` Not in systems/, so no skill will find them: ${unregistered.join(", ")}`);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
742
773
|
}
|
|
743
774
|
if (unconfigured.length) {
|
|
744
775
|
console.log(`\nNot set up here (${unconfigured.length}): ${unconfigured.map((r) => r.name).join(", ")}.`);
|