@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/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, STARTER_CONFIG } from "./config-file.js";
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("Create a starter .sweny.yml config file")
59
- .action(() => {
60
- const target = path.join(process.cwd(), ".sweny.yml");
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
@@ -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
- * - All required config fields must have values.
45
- * - If a skill has env-backed config fields (even optional ones),
46
- * at least one must be set — otherwise the skill has zero credentials.
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
  /**
@@ -106,22 +106,16 @@ export function allSkills() {
106
106
  /**
107
107
  * Check if a skill is usable given the available environment.
108
108
  *
109
- * - All required config fields must have values.
110
- * - If a skill has env-backed config fields (even optional ones),
111
- * at least one must be set — otherwise the skill has zero credentials.
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 envFields = Object.values(skill.config).filter((f) => f.env);
116
- if (envFields.length === 0)
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
- // At least one env-backed field must be set (handles all-optional skills like slack)
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.29",
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",