Group core utility modules into util, skill, and update
Move duration, redact, runtime, secure-file, and semver under core/util; embedded-skill and skill-version under core/skill; update-cache under core/update. Move the dev-override test next to the script it covers, and update the embedded-skill generator output path and regenerated manifest. No behavior change.
This commit is contained in:
1 parent
666a12c676
commit
a189f49223
44 files changed
+146
-145
No files matched your search
@@ -13,8 +13,8 @@ When writing or modifying automated tests in `src/`:
|
||||
- **Runner**: Use `bun:test` primitives (`describe`, `test`, `it`, `expect`, `beforeEach`, `afterEach`).
|
||||
- **Colocation**: Place test files directly next to the code they cover using the `*.test.ts` naming convention:
|
||||
```text
|
||||
src/core/update-cache.ts
|
||||
src/core/update-cache.test.ts
|
||||
src/core/update/update-cache.ts
|
||||
src/core/update/update-cache.test.ts
|
||||
```
|
||||
- Do not create isolated `tests/` directories unless testing full external integration fixtures.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
|
||||
import { chmodSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { resolveTargetBinaryPath } from "../../scripts/dev-override.js";
|
||||
import { resolveTargetBinaryPath } from "./dev-override.js";
|
||||
|
||||
describe("development CLI install target", () => {
|
||||
test("npm-linked source is never selected as the binary replacement target", () => {
|
||||
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const skillRoot = resolve(root, "skills", "seal-use");
|
||||
export const embeddedSkillOutput = resolve(root, "src", "core", "embedded-skill.generated.ts");
|
||||
export const embeddedSkillOutput = resolve(root, "src", "core", "skill", "embedded-skill.generated.ts");
|
||||
const textExtensions = new Set([".md", ".yaml", ".yml", ".json", ".txt"]);
|
||||
|
||||
function walk(dir) {
|
||||
@@ -20,7 +20,7 @@ function walk(dir) {
|
||||
return files;
|
||||
}
|
||||
|
||||
export function renderEmbeddedSkill(sourceDir = skillRoot, coreDir = resolve(root, "src", "core")) {
|
||||
export function renderEmbeddedSkill(sourceDir = skillRoot, coreDir = resolve(root, "src", "core", "skill")) {
|
||||
const files = walk(sourceDir).map((fullPath) => ({
|
||||
relativePath: relative(sourceDir, fullPath).split("\\").join("/"),
|
||||
importPath: relative(coreDir, fullPath).split("\\").join("/"),
|
||||
|
||||
@@ -50,15 +50,16 @@ describe("generated documentation contracts", () => {
|
||||
tempDirs.push(dir)
|
||||
const scripts = join(dir, "scripts")
|
||||
const core = join(dir, "src/core")
|
||||
const coreSkill = join(core, "skill")
|
||||
const cli = join(dir, "src/cli")
|
||||
const skill = join(dir, "skills/seal-use")
|
||||
for (const path of [scripts, core, cli, join(skill, "references")]) mkdirSync(path, { recursive: true })
|
||||
for (const path of [scripts, core, coreSkill, cli, join(skill, "references")]) mkdirSync(path, { recursive: true })
|
||||
for (const name of ["generate-embedded-skill.mjs", "check-embedded-skill.mjs", "generate-cli-md.mjs", "check-cli-md.mjs"]) {
|
||||
copyFileSync(join(import.meta.dir, name), join(scripts, name))
|
||||
}
|
||||
writeFileSync(join(cli, "help.ts"), 'export const HELP_REGISTRY = [{ commands: [{ usage: ["seal-use fixture list"] }] }];')
|
||||
writeFileSync(join(skill, "SKILL.md"), "fixture skill")
|
||||
const embeddedPath = join(core, "embedded-skill.generated.ts")
|
||||
const embeddedPath = join(coreSkill, "embedded-skill.generated.ts")
|
||||
const markdownPath = join(skill, "references/cli.md")
|
||||
writeFileSync(embeddedPath, "stale embedded fixture")
|
||||
const markdown = renderCliCommandBlock().replace("seal-use version", "seal-use stale-command")
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { runCli } from "./cli/runner.js";
|
||||
import { isCompiledBinary, performRuntimeSelfHealing, resolveAppRoot, resolveDefaultLauncher } from "./core/runtime.js";
|
||||
import { isCompiledBinary, performRuntimeSelfHealing, resolveAppRoot, resolveDefaultLauncher } from "./core/util/runtime.js";
|
||||
|
||||
process.stdout.on("error", (err: any) => {
|
||||
if (err?.code === "EPIPE") process.exit(0);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { appendFileSync, rmSync, writeFileSync } from "node:fs"
|
||||
import { extname, join, resolve } from "node:path"
|
||||
import { durationSeconds, tokenizeDuration } from "../../core/duration.js"
|
||||
import { durationSeconds, tokenizeDuration } from "../../core/util/duration.js"
|
||||
import { classifyCliError, CliError, usageError } from "../../core/errors.js"
|
||||
import { formatBeijingIso } from "../../core/config/timestamps.js"
|
||||
import { resolveDefaultLauncher } from "../../core/runtime.js"
|
||||
import { resolveDefaultLauncher } from "../../core/util/runtime.js"
|
||||
import { createSealClient } from "../../core/http/factory.js"
|
||||
import { exportApprovalRunsToExcel, normalizeManualApprovalStatus, resolveExportDateRange } from "../../domains/seal/approval-runs/export.js"
|
||||
import {
|
||||
|
||||
@@ -10,11 +10,11 @@ import {
|
||||
getDefaultGlobalSkillDir,
|
||||
getSkillContent,
|
||||
installSkillFiles
|
||||
} from "../../core/embedded-skill.js";
|
||||
} from "../../core/skill/embedded-skill.js";
|
||||
import { booleanOption, stringOption } from "../parser.js";
|
||||
import { printJson } from "../printer.js";
|
||||
import type { ParsedArgs } from "../types.js";
|
||||
import { getSkillVersionStatus } from "../../core/skill-version.js";
|
||||
import { getSkillVersionStatus } from "../../core/skill/skill-version.js";
|
||||
import { VERSION } from "../../version.js";
|
||||
|
||||
export function handleSkillCommand(action: string | undefined, maybeName: string | undefined, args: ParsedArgs) {
|
||||
|
||||
@@ -191,7 +191,7 @@ describe("update command bgSave and cache integration", () => {
|
||||
const { mkdtempSync, rmSync } = await import("node:fs");
|
||||
const { tmpdir } = await import("node:os");
|
||||
const { handleUpdateCommand } = await import("./update.js");
|
||||
const { loadUpdateCache, UPDATE_CACHE_FILE_ENV } = await import("../../core/update-cache.js");
|
||||
const { loadUpdateCache, UPDATE_CACHE_FILE_ENV } = await import("../../core/update/update-cache.js");
|
||||
|
||||
const tempDir = mkdtempSync(join(tmpdir(), "seal-use-bg-save-test-"));
|
||||
const tempCacheFile = join(tempDir, "update-cache.json");
|
||||
|
||||
@@ -2,10 +2,10 @@ import { accessSync, chmodSync, constants, existsSync, lstatSync, mkdirSync, rea
|
||||
import { homedir } from "node:os";
|
||||
import { basename, dirname, join } from "node:path";
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { isCompiledBinary } from "../../core/runtime.js";
|
||||
import { isCompiledBinary } from "../../core/util/runtime.js";
|
||||
import { normalizeBeijingIso } from "../../core/config/timestamps.js";
|
||||
import { readInstalledSkillVersion } from "../../core/embedded-skill.js";
|
||||
import { saveUpdateCache } from "../../core/update-cache.js";
|
||||
import { readInstalledSkillVersion } from "../../core/skill/embedded-skill.js";
|
||||
import { saveUpdateCache } from "../../core/update/update-cache.js";
|
||||
import { VERSION, IS_RELEASE } from "../../version.js";
|
||||
import { printJson } from "../printer.js";
|
||||
import { validationError } from "../../core/errors.js";
|
||||
@@ -1043,7 +1043,7 @@ function extractZip(archivePath: string, targetDir: string, platform: string): s
|
||||
return resolveExtractedBinary(targetDir, platform, archivePath);
|
||||
}
|
||||
|
||||
import { compareSemVer, isNewerVersion } from "../../core/semver.js";
|
||||
import { compareSemVer, isNewerVersion } from "../../core/util/semver.js";
|
||||
// Re-exported for tests and callers that historically imported from here.
|
||||
export { compareSemVer, isNewerVersion };
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import type { WebhookMode } from "../domains/seal/types.js";
|
||||
import type { MaterialPackFilePolicyPatch } from "../domains/seal/material-pack/policy.js";
|
||||
import type { ParsedArgs } from "./types.js";
|
||||
import { type DurationToken, EXPIRE_UNITS, expireSeconds, tokenizeDuration } from "../core/duration.js";
|
||||
import { type DurationToken, EXPIRE_UNITS, expireSeconds, tokenizeDuration } from "../core/util/duration.js";
|
||||
import { usageError, validationError } from "../core/errors.js";
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { writeFileSync } from "node:fs";
|
||||
import { booleanOption, stringOption } from "./parser.js";
|
||||
import { PayloadTooLargeError } from "../core/errors.js";
|
||||
import { redactSensitiveText } from "../core/redact.js";
|
||||
import { redactSensitiveText } from "../core/util/redact.js";
|
||||
import type { OutputOptions } from "./types.js";
|
||||
|
||||
export { redactSensitiveText };
|
||||
|
||||
@@ -3,8 +3,8 @@ import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, test } from "bun:test";
|
||||
import { runCli } from "./runner.js";
|
||||
import { saveUpdateCache, UPDATE_CACHE_FILE_ENV } from "../core/update-cache.js";
|
||||
import { GLOBAL_SKILL_DIR_ENV } from "../core/skill-version.js";
|
||||
import { saveUpdateCache, UPDATE_CACHE_FILE_ENV } from "../core/update/update-cache.js";
|
||||
import { GLOBAL_SKILL_DIR_ENV } from "../core/skill/skill-version.js";
|
||||
|
||||
describe("CLI runner", () => {
|
||||
let tempSkillDir: string;
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@ import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import type { CorpConfig } from "../core/config/types.js";
|
||||
import { VERSION_INFO } from "../version.js";
|
||||
import { isUpdateCacheExpired, loadUpdateCache, triggerBackgroundUpdateCheck } from "../core/update-cache.js";
|
||||
import { isUpdateCacheExpired, loadUpdateCache, triggerBackgroundUpdateCheck } from "../core/update/update-cache.js";
|
||||
import { classifyCliError, usageError, validationError } from "../core/errors.js";
|
||||
import { isCorpDisabledError } from "../core/config/active.js";
|
||||
import {
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
stringOption
|
||||
} from "./parser.js";
|
||||
import { extractHelpRequest } from "./help.js";
|
||||
import { isNewerVersion } from "../core/semver.js";
|
||||
import { getSkillVersionStatus } from "../core/skill-version.js";
|
||||
import { isNewerVersion } from "../core/util/semver.js";
|
||||
import { getSkillVersionStatus } from "../core/skill/skill-version.js";
|
||||
import {
|
||||
formatConsoleOutput,
|
||||
joinOutput,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { LauncherConfig } from "../core/runtime.js";
|
||||
import type { LauncherConfig } from "../core/util/runtime.js";
|
||||
|
||||
export type ParsedArgs = {
|
||||
command: string[];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { writeSecureFile } from "../secure-file.js";
|
||||
import { writeSecureFile } from "../util/secure-file.js";
|
||||
import { SEAL_CONFIG_DIR } from "../paths.js";
|
||||
import {
|
||||
CorpTokenCache,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { CorpConfig, CorpConfigSchema, GlobalConfig, GlobalConfigInput, GlobalConfigSchema } from "./types.js";
|
||||
|
||||
import { writeSecureFile } from "../secure-file.js";
|
||||
import { writeSecureFile } from "../util/secure-file.js";
|
||||
|
||||
const CONFIG_ENV = "SEAL_USE_ENTERPRISES_DIR";
|
||||
const LEGACY_CONFIG_ENV = "SEAL_HOME_ENTERPRISES_DIR";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import { writeSecureFile } from "../secure-file.js";
|
||||
import { writeSecureFile } from "../util/secure-file.js";
|
||||
import { join } from "node:path";
|
||||
import { resolveWritableEnterprisesDir } from "./loader.js";
|
||||
import { CorpConfigSchema, type CorpConfig } from "./types.js";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { PRIMARY_LINTERS_DIR, OFFICIAL_LINTERS_DIR } from "../paths.js";
|
||||
import { VERSION } from "../../version.js";
|
||||
import { getLastCorpConfigLoadIssues, getLastGlobalConfigIssue, loadCorpConfigs, loadGlobalConfig } from "../config/loader.js";
|
||||
import { formatBeijingIso } from "../config/timestamps.js";
|
||||
import { getDefaultGlobalSkillDir, getSkillVersionStatus } from "../skill-version.js";
|
||||
import { getDefaultGlobalSkillDir, getSkillVersionStatus } from "../skill/skill-version.js";
|
||||
import { resolveUsageFilePath } from "../stats/usage-tracker.js";
|
||||
import {
|
||||
EMBEDDED_DIRECTORY_SPECS,
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
// Generated by scripts/generate-embedded-skill.mjs. Do not edit manually.
|
||||
|
||||
import file0 from "../../skills/seal-use/SKILL.md" with { type: "text" };
|
||||
import file1 from "../../skills/seal-use/agents/openai.yaml" with { type: "text" };
|
||||
import file2 from "../../skills/seal-use/assets/hose-curl-copy-as-curl.png" with { type: "file" };
|
||||
import file3 from "../../skills/seal-use/assets/hose-curl-network-fetch-xhr.png" with { type: "file" };
|
||||
import file4 from "../../skills/seal-use/assets/hose-curl-open-page-check.png" with { type: "file" };
|
||||
import file5 from "../../skills/seal-use/assets/hose-open-platform-app-center.png" with { type: "file" };
|
||||
import file6 from "../../skills/seal-use/assets/hose-open-platform-credentials.png" with { type: "file" };
|
||||
import file7 from "../../skills/seal-use/assets/hose-open-platform-product-config.png" with { type: "file" };
|
||||
import file8 from "../../skills/seal-use/references/approval-attachment-trace.md" with { type: "text" };
|
||||
import file9 from "../../skills/seal-use/references/approval-bad-cases.md" with { type: "text" };
|
||||
import file10 from "../../skills/seal-use/references/approval-run-export.md" with { type: "text" };
|
||||
import file11 from "../../skills/seal-use/references/approval-run-lightweight.md" with { type: "text" };
|
||||
import file12 from "../../skills/seal-use/references/cli.md" with { type: "text" };
|
||||
import file13 from "../../skills/seal-use/references/customer-feedback-rule-remediation.md" with { type: "text" };
|
||||
import file14 from "../../skills/seal-use/references/documents.md" with { type: "text" };
|
||||
import file15 from "../../skills/seal-use/references/enterprise-onboarding.md" with { type: "text" };
|
||||
import file16 from "../../skills/seal-use/references/expense-data.md" with { type: "text" };
|
||||
import file17 from "../../skills/seal-use/references/first-time-user.md" with { type: "text" };
|
||||
import file18 from "../../skills/seal-use/references/hose-enterprise-auth.md" with { type: "text" };
|
||||
import file19 from "../../skills/seal-use/references/hose-enterprise-deploy.md" with { type: "text" };
|
||||
import file20 from "../../skills/seal-use/references/hose-enterprise-init.md" with { type: "text" };
|
||||
import file21 from "../../skills/seal-use/references/langfuse-trace.md" with { type: "text" };
|
||||
import file22 from "../../skills/seal-use/references/report-templates.md" with { type: "text" };
|
||||
import file23 from "../../skills/seal-use/references/rule-lightweight.md" with { type: "text" };
|
||||
import file24 from "../../skills/seal-use/references/rule-lint.md" with { type: "text" };
|
||||
import file25 from "../../skills/seal-use/references/sealai-browser-rum.md" with { type: "text" };
|
||||
import file26 from "../../skills/seal-use/references/staging-simulation-workflow.md" with { type: "text" };
|
||||
import file27 from "../../skills/seal-use/references/tenant-status.md" with { type: "text" };
|
||||
import file28 from "../../skills/seal-use/references/webhook-resource-pack.md" with { type: "text" };
|
||||
|
||||
export const EMBEDDED_SKILL_TEXT_FILES: Record<string, string> = {
|
||||
"SKILL.md": file0,
|
||||
"agents/openai.yaml": file1,
|
||||
"references/approval-attachment-trace.md": file8,
|
||||
"references/approval-bad-cases.md": file9,
|
||||
"references/approval-run-export.md": file10,
|
||||
"references/approval-run-lightweight.md": file11,
|
||||
"references/cli.md": file12,
|
||||
"references/customer-feedback-rule-remediation.md": file13,
|
||||
"references/documents.md": file14,
|
||||
"references/enterprise-onboarding.md": file15,
|
||||
"references/expense-data.md": file16,
|
||||
"references/first-time-user.md": file17,
|
||||
"references/hose-enterprise-auth.md": file18,
|
||||
"references/hose-enterprise-deploy.md": file19,
|
||||
"references/hose-enterprise-init.md": file20,
|
||||
"references/langfuse-trace.md": file21,
|
||||
"references/report-templates.md": file22,
|
||||
"references/rule-lightweight.md": file23,
|
||||
"references/rule-lint.md": file24,
|
||||
"references/sealai-browser-rum.md": file25,
|
||||
"references/staging-simulation-workflow.md": file26,
|
||||
"references/tenant-status.md": file27,
|
||||
"references/webhook-resource-pack.md": file28,
|
||||
};
|
||||
|
||||
export const EMBEDDED_SKILL_ASSET_PATHS: Record<string, string> = {
|
||||
"assets/hose-curl-copy-as-curl.png": file2,
|
||||
"assets/hose-curl-network-fetch-xhr.png": file3,
|
||||
"assets/hose-curl-open-page-check.png": file4,
|
||||
"assets/hose-open-platform-app-center.png": file5,
|
||||
"assets/hose-open-platform-credentials.png": file6,
|
||||
"assets/hose-open-platform-product-config.png": file7,
|
||||
};
|
||||
|
||||
export const EMBEDDED_SKILL_ALL_PATHS = [
|
||||
"SKILL.md",
|
||||
"agents/openai.yaml",
|
||||
"assets/hose-curl-copy-as-curl.png",
|
||||
"assets/hose-curl-network-fetch-xhr.png",
|
||||
"assets/hose-curl-open-page-check.png",
|
||||
"assets/hose-open-platform-app-center.png",
|
||||
"assets/hose-open-platform-credentials.png",
|
||||
"assets/hose-open-platform-product-config.png",
|
||||
"references/approval-attachment-trace.md",
|
||||
"references/approval-bad-cases.md",
|
||||
"references/approval-run-export.md",
|
||||
"references/approval-run-lightweight.md",
|
||||
"references/cli.md",
|
||||
"references/customer-feedback-rule-remediation.md",
|
||||
"references/documents.md",
|
||||
"references/enterprise-onboarding.md",
|
||||
"references/expense-data.md",
|
||||
"references/first-time-user.md",
|
||||
"references/hose-enterprise-auth.md",
|
||||
"references/hose-enterprise-deploy.md",
|
||||
"references/hose-enterprise-init.md",
|
||||
"references/langfuse-trace.md",
|
||||
"references/report-templates.md",
|
||||
"references/rule-lightweight.md",
|
||||
"references/rule-lint.md",
|
||||
"references/sealai-browser-rum.md",
|
||||
"references/staging-simulation-workflow.md",
|
||||
"references/tenant-status.md",
|
||||
"references/webhook-resource-pack.md",
|
||||
];
|
||||
@@ -0,0 +1,98 @@
|
||||
// Generated by scripts/generate-embedded-skill.mjs. Do not edit manually.
|
||||
|
||||
import file0 from "../../../skills/seal-use/SKILL.md" with { type: "text" };
|
||||
import file1 from "../../../skills/seal-use/agents/openai.yaml" with { type: "text" };
|
||||
import file2 from "../../../skills/seal-use/assets/hose-curl-copy-as-curl.png" with { type: "file" };
|
||||
import file3 from "../../../skills/seal-use/assets/hose-curl-network-fetch-xhr.png" with { type: "file" };
|
||||
import file4 from "../../../skills/seal-use/assets/hose-curl-open-page-check.png" with { type: "file" };
|
||||
import file5 from "../../../skills/seal-use/assets/hose-open-platform-app-center.png" with { type: "file" };
|
||||
import file6 from "../../../skills/seal-use/assets/hose-open-platform-credentials.png" with { type: "file" };
|
||||
import file7 from "../../../skills/seal-use/assets/hose-open-platform-product-config.png" with { type: "file" };
|
||||
import file8 from "../../../skills/seal-use/references/approval-attachment-trace.md" with { type: "text" };
|
||||
import file9 from "../../../skills/seal-use/references/approval-bad-cases.md" with { type: "text" };
|
||||
import file10 from "../../../skills/seal-use/references/approval-run-export.md" with { type: "text" };
|
||||
import file11 from "../../../skills/seal-use/references/approval-run-lightweight.md" with { type: "text" };
|
||||
import file12 from "../../../skills/seal-use/references/cli.md" with { type: "text" };
|
||||
import file13 from "../../../skills/seal-use/references/customer-feedback-rule-remediation.md" with { type: "text" };
|
||||
import file14 from "../../../skills/seal-use/references/documents.md" with { type: "text" };
|
||||
import file15 from "../../../skills/seal-use/references/enterprise-onboarding.md" with { type: "text" };
|
||||
import file16 from "../../../skills/seal-use/references/expense-data.md" with { type: "text" };
|
||||
import file17 from "../../../skills/seal-use/references/first-time-user.md" with { type: "text" };
|
||||
import file18 from "../../../skills/seal-use/references/hose-enterprise-auth.md" with { type: "text" };
|
||||
import file19 from "../../../skills/seal-use/references/hose-enterprise-deploy.md" with { type: "text" };
|
||||
import file20 from "../../../skills/seal-use/references/hose-enterprise-init.md" with { type: "text" };
|
||||
import file21 from "../../../skills/seal-use/references/langfuse-trace.md" with { type: "text" };
|
||||
import file22 from "../../../skills/seal-use/references/report-templates.md" with { type: "text" };
|
||||
import file23 from "../../../skills/seal-use/references/rule-lightweight.md" with { type: "text" };
|
||||
import file24 from "../../../skills/seal-use/references/rule-lint.md" with { type: "text" };
|
||||
import file25 from "../../../skills/seal-use/references/sealai-browser-rum.md" with { type: "text" };
|
||||
import file26 from "../../../skills/seal-use/references/staging-simulation-workflow.md" with { type: "text" };
|
||||
import file27 from "../../../skills/seal-use/references/tenant-status.md" with { type: "text" };
|
||||
import file28 from "../../../skills/seal-use/references/webhook-resource-pack.md" with { type: "text" };
|
||||
|
||||
export const EMBEDDED_SKILL_TEXT_FILES: Record<string, string> = {
|
||||
"SKILL.md": file0,
|
||||
"agents/openai.yaml": file1,
|
||||
"references/approval-attachment-trace.md": file8,
|
||||
"references/approval-bad-cases.md": file9,
|
||||
"references/approval-run-export.md": file10,
|
||||
"references/approval-run-lightweight.md": file11,
|
||||
"references/cli.md": file12,
|
||||
"references/customer-feedback-rule-remediation.md": file13,
|
||||
"references/documents.md": file14,
|
||||
"references/enterprise-onboarding.md": file15,
|
||||
"references/expense-data.md": file16,
|
||||
"references/first-time-user.md": file17,
|
||||
"references/hose-enterprise-auth.md": file18,
|
||||
"references/hose-enterprise-deploy.md": file19,
|
||||
"references/hose-enterprise-init.md": file20,
|
||||
"references/langfuse-trace.md": file21,
|
||||
"references/report-templates.md": file22,
|
||||
"references/rule-lightweight.md": file23,
|
||||
"references/rule-lint.md": file24,
|
||||
"references/sealai-browser-rum.md": file25,
|
||||
"references/staging-simulation-workflow.md": file26,
|
||||
"references/tenant-status.md": file27,
|
||||
"references/webhook-resource-pack.md": file28,
|
||||
};
|
||||
|
||||
export const EMBEDDED_SKILL_ASSET_PATHS: Record<string, string> = {
|
||||
"assets/hose-curl-copy-as-curl.png": file2,
|
||||
"assets/hose-curl-network-fetch-xhr.png": file3,
|
||||
"assets/hose-curl-open-page-check.png": file4,
|
||||
"assets/hose-open-platform-app-center.png": file5,
|
||||
"assets/hose-open-platform-credentials.png": file6,
|
||||
"assets/hose-open-platform-product-config.png": file7,
|
||||
};
|
||||
|
||||
export const EMBEDDED_SKILL_ALL_PATHS = [
|
||||
"SKILL.md",
|
||||
"agents/openai.yaml",
|
||||
"assets/hose-curl-copy-as-curl.png",
|
||||
"assets/hose-curl-network-fetch-xhr.png",
|
||||
"assets/hose-curl-open-page-check.png",
|
||||
"assets/hose-open-platform-app-center.png",
|
||||
"assets/hose-open-platform-credentials.png",
|
||||
"assets/hose-open-platform-product-config.png",
|
||||
"references/approval-attachment-trace.md",
|
||||
"references/approval-bad-cases.md",
|
||||
"references/approval-run-export.md",
|
||||
"references/approval-run-lightweight.md",
|
||||
"references/cli.md",
|
||||
"references/customer-feedback-rule-remediation.md",
|
||||
"references/documents.md",
|
||||
"references/enterprise-onboarding.md",
|
||||
"references/expense-data.md",
|
||||
"references/first-time-user.md",
|
||||
"references/hose-enterprise-auth.md",
|
||||
"references/hose-enterprise-deploy.md",
|
||||
"references/hose-enterprise-init.md",
|
||||
"references/langfuse-trace.md",
|
||||
"references/report-templates.md",
|
||||
"references/rule-lightweight.md",
|
||||
"references/rule-lint.md",
|
||||
"references/sealai-browser-rum.md",
|
||||
"references/staging-simulation-workflow.md",
|
||||
"references/tenant-status.md",
|
||||
"references/webhook-resource-pack.md",
|
||||
];
|
||||
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
|
||||
import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import packageJson from "../../package.json" with { type: "json" };
|
||||
import packageJson from "../../../package.json" with { type: "json" };
|
||||
import {
|
||||
EMBEDDED_SKILL_ALL_PATHS,
|
||||
EMBEDDED_SKILL_ASSETS,
|
||||
@@ -39,7 +39,7 @@ describe("embedded-skill", () => {
|
||||
expect(existsSync(join(tmp, "assets", "hose-curl-copy-as-curl.png"))).toBe(true);
|
||||
expect([...res.files].sort()).toEqual([...EMBEDDED_SKILL_ALL_PATHS].sort());
|
||||
for (const path of EMBEDDED_SKILL_ALL_PATHS) {
|
||||
expect(readFileSync(join(tmp, path))).toEqual(readFileSync(join(import.meta.dir, "../../skills/seal-use", path)));
|
||||
expect(readFileSync(join(tmp, path))).toEqual(readFileSync(join(import.meta.dir, "../../../skills/seal-use", path)));
|
||||
}
|
||||
} finally {
|
||||
rmSync(tmp, { recursive: true, force: true });
|
||||
@@ -102,4 +102,4 @@ export function syncGlobalSkillIfPresent(): { synced: boolean; targetDir?: strin
|
||||
}
|
||||
|
||||
// Re-export agent host skill bridging capabilities
|
||||
export * from "./agent-hosts/index.js";
|
||||
export * from "../agent-hosts/index.js";
|
||||
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
import { existsSync, readFileSync } from "node:fs"
|
||||
import { homedir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import { compareSemVer } from "./semver.js"
|
||||
import { compareSemVer } from "../util/semver.js"
|
||||
|
||||
export const GLOBAL_SKILL_DIR_ENV = "SEAL_USE_GLOBAL_SKILL_DIR"
|
||||
|
||||
File renamed without changes.
@@ -1,10 +1,10 @@
|
||||
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
||||
import { dirname, join } from "node:path";
|
||||
import { spawn } from "node:child_process";
|
||||
import type { LauncherConfig } from "./runtime.js";
|
||||
import { formatBeijingIso, normalizeBeijingIso } from "./config/timestamps.js";
|
||||
import type { LauncherConfig } from "../util/runtime.js";
|
||||
import { formatBeijingIso, normalizeBeijingIso } from "../config/timestamps.js";
|
||||
|
||||
import { SEAL_CACHE_DIR } from "./paths.js";
|
||||
import { SEAL_CACHE_DIR } from "../paths.js";
|
||||
|
||||
export const UPDATE_CACHE_FILE_ENV = "SEAL_USE_UPDATE_CACHE_FILE";
|
||||
export const DEFAULT_UPDATE_CACHE_TTL_MS = 24 * 60 * 60 * 1000; // 24 hours
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -77,7 +77,7 @@ export async function performRuntimeSelfHealing(): Promise<{
|
||||
const legacySkillDir = join(homedir(), ".agents", "skills", "seal-home");
|
||||
if (existsSync(legacySkillDir)) {
|
||||
// Ordinary discovery must not initialize the embedded resource graph.
|
||||
(await import("./embedded-skill.js")).syncGlobalSkillIfPresent();
|
||||
(await import("../skill/embedded-skill.js")).syncGlobalSkillIfPresent();
|
||||
result.skillHealed = true;
|
||||
}
|
||||
} catch {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
import { CliError } from "../../core/errors.js";
|
||||
import { redactSensitiveText } from "../../core/redact.js";
|
||||
import { redactSensitiveText } from "../../core/util/redact.js";
|
||||
import type { LangfuseConfig } from "./config.js";
|
||||
|
||||
export type HttpQuery = Record<string, string | number | boolean | undefined>;
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { CorpConfig } from "../../core/config/types.js";
|
||||
import { ensureHoseOpenapiToken, fetchHoseCloseApiToken, defaultSealUrl, normalizeBaseUrl } from "../../core/auth/hose.js";
|
||||
import { createSealClientForUrl } from "../../core/http/factory.js";
|
||||
import { redactSensitiveText } from "../../core/redact.js";
|
||||
import { redactSensitiveText } from "../../core/util/redact.js";
|
||||
import { safetyBlocked, validationError } from "../../core/errors.js";
|
||||
import { resolveSealCustomHeaders } from "../../core/http/request-headers.js";
|
||||
import {
|
||||
|
||||
@@ -6,9 +6,9 @@ import { join } from "node:path"
|
||||
import { z } from "zod"
|
||||
import { formatBeijingIso } from "../../../core/config/timestamps.js"
|
||||
import { validationError } from "../../../core/errors.js"
|
||||
import type { LauncherConfig } from "../../../core/runtime.js"
|
||||
import type { LauncherConfig } from "../../../core/util/runtime.js"
|
||||
import { VERSION } from "../../../version.js"
|
||||
import { redactSensitiveText } from "../../../core/redact.js"
|
||||
import { redactSensitiveText } from "../../../core/util/redact.js"
|
||||
|
||||
// Persist only export controls, never the enterprise configuration or session.
|
||||
export const exportTaskOptionsSchema = z.object({
|
||||
|
||||
@@ -8,7 +8,7 @@ import { executeRulePush } from "../rules/push.js";
|
||||
import { formatBeijingIso } from "../../../core/config/timestamps.js";
|
||||
import { loadGlobalConfig } from "../../../core/config/loader.js";
|
||||
import { validationError } from "../../../core/errors.js";
|
||||
import { redactSensitiveText } from "../../../core/redact.js";
|
||||
import { redactSensitiveText } from "../../../core/util/redact.js";
|
||||
import { searchApprovalContent } from "../search/service.js";
|
||||
import { diffRuleVersions, normalizedRuleCode, truncateRuleDiff } from "../rules/diff.js";
|
||||
import { hydrateRuleVersionStableIds, savePublishedRuleVersionSnapshot } from "../rules/version-snapshot.js";
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
type SimulationRuleSourceInput
|
||||
} from "../types.js";
|
||||
import * as helpers from "./helpers.js";
|
||||
import { parseDurationMs } from "../../../core/duration.js";
|
||||
import { parseDurationMs } from "../../../core/util/duration.js";
|
||||
import {
|
||||
batchTimestampMs,
|
||||
collectSimulationBatches,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { join, resolve } from "node:path";
|
||||
import type { KyInstance } from "ky";
|
||||
import { formatBeijingIso } from "../../../core/config/timestamps.js";
|
||||
import type { CorpConfig } from "../../../core/config/types.js";
|
||||
import { writeSecureFile } from "../../../core/secure-file.js";
|
||||
import { writeSecureFile } from "../../../core/util/secure-file.js";
|
||||
import * as api from "../api.js";
|
||||
import { sanitizeFileName } from "../approval-runs/attachments.js";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { formatBeijingIso } from "../../../core/config/timestamps.js";
|
||||
import type { CorpConfig } from "../../../core/config/types.js";
|
||||
import { CliError } from "../../../core/errors.js";
|
||||
import { SEAL_STATE_DIR } from "../../../core/paths.js";
|
||||
import { redactSensitiveText } from "../../../core/redact.js";
|
||||
import { redactSensitiveText } from "../../../core/util/redact.js";
|
||||
import * as api from "../api.js";
|
||||
import {
|
||||
buildRulePushPlan,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { KyInstance } from "ky";
|
||||
import { durationSeconds, tokenizeDuration } from "../../../core/duration.js";
|
||||
import { durationSeconds, tokenizeDuration } from "../../../core/util/duration.js";
|
||||
import { validationError } from "../../../core/errors.js";
|
||||
import * as api from "../api.js";
|
||||
import type { SimulationBatch } from "../types.js";
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import { isReadOnlyCliCommand } from "./cli/read-only.js";
|
||||
import { normalizeCliArgs, tokenizeCommand } from "./cli/tokenize.js";
|
||||
import { classifyCliError } from "./core/errors.js";
|
||||
import { VERSION } from "./version.js";
|
||||
import { isCompiledBinary, resolveAppRoot, resolveDefaultLauncher } from "./core/runtime.js";
|
||||
import { isCompiledBinary, resolveAppRoot, resolveDefaultLauncher } from "./core/util/runtime.js";
|
||||
|
||||
const serverEntryFile = fileURLToPath(import.meta.url);
|
||||
// Source servers and compiled CLI servers share the launcher rules. In a binary,
|
||||
|
||||
Reference in new issue
Block a user