@sweny-ai/core 0.1.29 → 0.1.31
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/__tests__/skills-index.test.js +4 -4
- package/dist/__tests__/skills.test.js +4 -4
- package/dist/cli/init.d.ts +53 -0
- package/dist/cli/init.js +521 -0
- package/dist/cli/init.test.d.ts +1 -0
- package/dist/cli/init.test.js +664 -0
- package/dist/cli/main.js +5 -11
- package/dist/skills/index.d.ts +3 -4
- package/dist/skills/index.js +6 -12
- package/package.json +2 -1
package/dist/cli/main.js
CHANGED
|
@@ -19,7 +19,8 @@ import { buildWorkflow, refineWorkflow } from "../workflow-builder.js";
|
|
|
19
19
|
import { toMermaid, toMermaidBlock } from "../mermaid.js";
|
|
20
20
|
import { DagRenderer } from "./renderer.js";
|
|
21
21
|
import * as readline from "node:readline";
|
|
22
|
-
import { loadDotenv, loadConfigFile
|
|
22
|
+
import { loadDotenv, loadConfigFile } from "./config-file.js";
|
|
23
|
+
import { runInit } from "./init.js";
|
|
23
24
|
import { registerTriageCommand, registerImplementCommand, parseCliInputs, validateInputs, validateWarnings, } from "./config.js";
|
|
24
25
|
import { c, formatBanner, getStepDetails, formatStepLine, formatDagResultHuman, formatResultJson, formatValidationErrors, formatCrashError, formatCheckResults, } from "./output.js";
|
|
25
26
|
import { checkProviderConnectivity } from "./check.js";
|
|
@@ -55,16 +56,9 @@ const program = new Command()
|
|
|
55
56
|
// ── sweny init ────────────────────────────────────────────────────────
|
|
56
57
|
program
|
|
57
58
|
.command("init")
|
|
58
|
-
.description("
|
|
59
|
-
.action(() => {
|
|
60
|
-
|
|
61
|
-
if (fs.existsSync(target)) {
|
|
62
|
-
console.error(chalk.yellow(" .sweny.yml already exists — skipping."));
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
fs.writeFileSync(target, STARTER_CONFIG, "utf-8");
|
|
66
|
-
console.log(chalk.green(" Created .sweny.yml"));
|
|
67
|
-
console.log(chalk.dim(" Add your secrets to .env and run: sweny triage --dry-run"));
|
|
59
|
+
.description("Interactive setup wizard — creates .sweny.yml, .env template, and optional GitHub Action")
|
|
60
|
+
.action(async () => {
|
|
61
|
+
await runInit();
|
|
68
62
|
});
|
|
69
63
|
// ── sweny check ───────────────────────────────────────────────────────
|
|
70
64
|
program
|
package/dist/skills/index.d.ts
CHANGED
|
@@ -41,10 +41,9 @@ export declare function allSkills(): Map<string, Skill>;
|
|
|
41
41
|
/**
|
|
42
42
|
* Check if a skill is usable given the available environment.
|
|
43
43
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* - Skills with no env-backed config are always considered configured.
|
|
44
|
+
* A skill is configured when all its *required* config fields are set.
|
|
45
|
+
* Optional fields are validated by individual tool handlers at call time,
|
|
46
|
+
* so missing optional config never disqualifies the skill.
|
|
48
47
|
*/
|
|
49
48
|
export declare function isSkillConfigured(skill: Skill, env?: Record<string, string | undefined>): boolean;
|
|
50
49
|
/**
|
package/dist/skills/index.js
CHANGED
|
@@ -106,22 +106,16 @@ export function allSkills() {
|
|
|
106
106
|
/**
|
|
107
107
|
* Check if a skill is usable given the available environment.
|
|
108
108
|
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* - Skills with no env-backed config are always considered configured.
|
|
109
|
+
* A skill is configured when all its *required* config fields are set.
|
|
110
|
+
* Optional fields are validated by individual tool handlers at call time,
|
|
111
|
+
* so missing optional config never disqualifies the skill.
|
|
113
112
|
*/
|
|
114
113
|
export function isSkillConfigured(skill, env = process.env) {
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
return true; // no env needed
|
|
118
|
-
// All required fields must be set
|
|
119
|
-
for (const field of envFields) {
|
|
120
|
-
if (field.required && !env[field.env])
|
|
114
|
+
for (const field of Object.values(skill.config)) {
|
|
115
|
+
if (field.required && field.env && !env[field.env])
|
|
121
116
|
return false;
|
|
122
117
|
}
|
|
123
|
-
|
|
124
|
-
return envFields.some((f) => env[f.env]);
|
|
118
|
+
return true;
|
|
125
119
|
}
|
|
126
120
|
/**
|
|
127
121
|
* From all builtins + custom repo skills, return only the skills that are usable.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sweny-ai/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sweny": "./dist/cli/main.js"
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@anthropic-ai/claude-agent-sdk": "^0.2.84",
|
|
52
|
+
"@clack/prompts": "^1.2.0",
|
|
52
53
|
"chalk": "^5",
|
|
53
54
|
"commander": "^13",
|
|
54
55
|
"yaml": "^2",
|