@sapiom/agent-core
Advanced tools
+9
-0
| # @sapiom/orchestration-core | ||
| ## 0.10.2 | ||
| ### Patch Changes | ||
| - 87636c1: Make bundled starters work from a fresh Agent Studio session by preserving Studio-owned state, writing the project discovery marker, and handing Claude the local scaffold MCP tool directly. | ||
| - Updated dependencies [cc1ac0c] | ||
| - @sapiom/tools@0.26.0 | ||
| - @sapiom/agent@0.9.3 | ||
| ## 0.10.1 | ||
@@ -4,0 +13,0 @@ |
+16
-1
@@ -16,2 +16,3 @@ "use strict"; | ||
| const node_url_1 = require("node:url"); | ||
| const config_js_1 = require("./config.js"); | ||
| const errors_js_1 = require("./errors.js"); | ||
@@ -115,2 +116,4 @@ const version_fallback_generated_js_1 = require("./version-fallback.generated.js"); | ||
| const full = node_path_1.default.join(dir, entry); | ||
| if (entry === ".sapiom" && (0, node_fs_1.lstatSync)(full).isDirectory()) | ||
| continue; | ||
| if ((0, node_fs_1.statSync)(full).isDirectory()) | ||
@@ -122,2 +125,13 @@ walk(full, onFile); | ||
| } | ||
| function isScaffoldableTarget(targetDir) { | ||
| if (!(0, node_fs_1.existsSync)(targetDir)) | ||
| return true; | ||
| const entries = (0, node_fs_1.readdirSync)(targetDir); | ||
| if (entries.length === 0) | ||
| return true; | ||
| if (entries.length !== 1 || entries[0] !== ".sapiom") | ||
| return false; | ||
| const studioState = (0, node_fs_1.lstatSync)(node_path_1.default.join(targetDir, ".sapiom")); | ||
| return studioState.isDirectory() && !studioState.isSymbolicLink(); | ||
| } | ||
| function copyTemplate(templateDir, targetDir, replacements) { | ||
@@ -164,3 +178,3 @@ (0, node_fs_1.cpSync)(templateDir, targetDir, { recursive: true }); | ||
| const projectName = opts.projectName ?? node_path_1.default.basename(targetDir); | ||
| if ((0, node_fs_1.existsSync)(targetDir) && (0, node_fs_1.readdirSync)(targetDir).length > 0) { | ||
| if (!isScaffoldableTarget(targetDir)) { | ||
| throw new errors_js_1.AgentOperationError({ | ||
@@ -189,4 +203,5 @@ code: "DIR_NOT_EMPTY", | ||
| (0, node_fs_1.writeFileSync)(node_path_1.default.join(devDir, "stubs.json"), JSON.stringify({ version: 1, steps: {} }, null, 2) + "\n"); | ||
| (0, config_js_1.writeConfig)(targetDir, {}); | ||
| const gitInitialized = initGitRepo(targetDir); | ||
| return { targetDir, template, projectName, gitInitialized }; | ||
| } |
| export declare const VERSION_FALLBACK: { | ||
| readonly agent: "0.9.2"; | ||
| readonly tools: "0.25.0"; | ||
| readonly agent: "0.9.3"; | ||
| readonly tools: "0.26.0"; | ||
| }; |
@@ -5,4 +5,4 @@ "use strict"; | ||
| exports.VERSION_FALLBACK = { | ||
| agent: "0.9.2", | ||
| tools: "0.25.0", | ||
| agent: "0.9.3", | ||
| tools: "0.26.0", | ||
| }; |
+17
-2
| import { execFileSync } from "node:child_process"; | ||
| import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync, } from "node:fs"; | ||
| import { cpSync, existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync, } from "node:fs"; | ||
| import path from "node:path"; | ||
| import { fileURLToPath } from "node:url"; | ||
| import { writeConfig } from "./config.js"; | ||
| import { AgentOperationError } from "./errors.js"; | ||
@@ -103,2 +104,4 @@ import { VERSION_FALLBACK } from "./version-fallback.generated.js"; | ||
| const full = path.join(dir, entry); | ||
| if (entry === ".sapiom" && lstatSync(full).isDirectory()) | ||
| continue; | ||
| if (statSync(full).isDirectory()) | ||
@@ -110,2 +113,13 @@ walk(full, onFile); | ||
| } | ||
| function isScaffoldableTarget(targetDir) { | ||
| if (!existsSync(targetDir)) | ||
| return true; | ||
| const entries = readdirSync(targetDir); | ||
| if (entries.length === 0) | ||
| return true; | ||
| if (entries.length !== 1 || entries[0] !== ".sapiom") | ||
| return false; | ||
| const studioState = lstatSync(path.join(targetDir, ".sapiom")); | ||
| return studioState.isDirectory() && !studioState.isSymbolicLink(); | ||
| } | ||
| function copyTemplate(templateDir, targetDir, replacements) { | ||
@@ -152,3 +166,3 @@ cpSync(templateDir, targetDir, { recursive: true }); | ||
| const projectName = opts.projectName ?? path.basename(targetDir); | ||
| if (existsSync(targetDir) && readdirSync(targetDir).length > 0) { | ||
| if (!isScaffoldableTarget(targetDir)) { | ||
| throw new AgentOperationError({ | ||
@@ -177,4 +191,5 @@ code: "DIR_NOT_EMPTY", | ||
| writeFileSync(path.join(devDir, "stubs.json"), JSON.stringify({ version: 1, steps: {} }, null, 2) + "\n"); | ||
| writeConfig(targetDir, {}); | ||
| const gitInitialized = initGitRepo(targetDir); | ||
| return { targetDir, template, projectName, gitInitialized }; | ||
| } |
| export declare const VERSION_FALLBACK: { | ||
| readonly agent: "0.9.2"; | ||
| readonly tools: "0.25.0"; | ||
| readonly agent: "0.9.3"; | ||
| readonly tools: "0.26.0"; | ||
| }; |
| export const VERSION_FALLBACK = { | ||
| agent: "0.9.2", | ||
| tools: "0.25.0", | ||
| agent: "0.9.3", | ||
| tools: "0.26.0", | ||
| }; |
+3
-3
| { | ||
| "name": "@sapiom/agent-core", | ||
| "version": "0.10.1", | ||
| "version": "0.10.2", | ||
| "description": "Pure, stateless core functions for scaffolding, validating, and operating Sapiom agents — shared by the CLI and MCP packages.", | ||
@@ -40,6 +40,6 @@ "license": "MIT", | ||
| "esbuild": "^0.28.1", | ||
| "@sapiom/agent": "^0.9.2", | ||
| "@sapiom/agent": "^0.9.3", | ||
| "@sapiom/agent-runtime": "^0.4.3", | ||
| "@sapiom/analytics-core": "^0.2.1", | ||
| "@sapiom/tools": "^0.25.0" | ||
| "@sapiom/tools": "^0.26.0" | ||
| }, | ||
@@ -46,0 +46,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
468979
0.32%5522
0.55%- Removed
Updated
Updated