Add screenshot guided Hose onboarding
This commit is contained in:
1 parent
a92b409768
commit
286d8bfefd
11 files changed
+247
-27
No files matched your search
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
declare module "*.png" {
|
||||
const path: string;
|
||||
export default path;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
// Generated by scripts/generate-embedded-skill.mjs. Do not edit manually.
|
||||
|
||||
import file0 from "../../skills/seal-use/agents/openai.yaml" with { type: "text" };
|
||||
import file1 from "../../skills/seal-use/assets/hose-curl-copy-as-curl.png" with { type: "file" };
|
||||
import file2 from "../../skills/seal-use/assets/hose-curl-network-fetch-xhr.png" with { type: "file" };
|
||||
import file3 from "../../skills/seal-use/assets/hose-curl-open-page-check.png" with { type: "file" };
|
||||
import file4 from "../../skills/seal-use/assets/hose-open-platform-app-center.png" with { type: "file" };
|
||||
import file5 from "../../skills/seal-use/assets/hose-open-platform-credentials.png" with { type: "file" };
|
||||
import file6 from "../../skills/seal-use/assets/hose-open-platform-product-config.png" with { type: "file" };
|
||||
import file7 from "../../skills/seal-use/references/approval-attachment-trace.md" with { type: "text" };
|
||||
import file8 from "../../skills/seal-use/references/approval-bad-cases.md" with { type: "text" };
|
||||
import file9 from "../../skills/seal-use/references/approval-run-lightweight.md" with { type: "text" };
|
||||
import file10 from "../../skills/seal-use/references/cli.md" with { type: "text" };
|
||||
import file11 from "../../skills/seal-use/references/customer-feedback-rule-remediation.md" with { type: "text" };
|
||||
import file12 from "../../skills/seal-use/references/enterprise-onboarding.md" with { type: "text" };
|
||||
import file13 from "../../skills/seal-use/references/first-time-user.md" with { type: "text" };
|
||||
import file14 from "../../skills/seal-use/references/hose-enterprise-auth.md" with { type: "text" };
|
||||
import file15 from "../../skills/seal-use/references/hose-enterprise-deploy.md" with { type: "text" };
|
||||
import file16 from "../../skills/seal-use/references/hose-enterprise-init.md" with { type: "text" };
|
||||
import file17 from "../../skills/seal-use/references/rule-lightweight.md" with { type: "text" };
|
||||
import file18 from "../../skills/seal-use/references/rule-lint.md" with { type: "text" };
|
||||
import file19 from "../../skills/seal-use/references/staging-simulation-workflow.md" with { type: "text" };
|
||||
import file20 from "../../skills/seal-use/SKILL.md" with { type: "text" };
|
||||
|
||||
export const EMBEDDED_SKILL_TEXT_FILES: Record<string, string> = {
|
||||
"agents/openai.yaml": file0,
|
||||
"references/approval-attachment-trace.md": file7,
|
||||
"references/approval-bad-cases.md": file8,
|
||||
"references/approval-run-lightweight.md": file9,
|
||||
"references/cli.md": file10,
|
||||
"references/customer-feedback-rule-remediation.md": file11,
|
||||
"references/enterprise-onboarding.md": file12,
|
||||
"references/first-time-user.md": file13,
|
||||
"references/hose-enterprise-auth.md": file14,
|
||||
"references/hose-enterprise-deploy.md": file15,
|
||||
"references/hose-enterprise-init.md": file16,
|
||||
"references/rule-lightweight.md": file17,
|
||||
"references/rule-lint.md": file18,
|
||||
"references/staging-simulation-workflow.md": file19,
|
||||
"SKILL.md": file20,
|
||||
};
|
||||
|
||||
export const EMBEDDED_SKILL_ASSET_PATHS: Record<string, string> = {
|
||||
"assets/hose-curl-copy-as-curl.png": file1,
|
||||
"assets/hose-curl-network-fetch-xhr.png": file2,
|
||||
"assets/hose-curl-open-page-check.png": file3,
|
||||
"assets/hose-open-platform-app-center.png": file4,
|
||||
"assets/hose-open-platform-credentials.png": file5,
|
||||
"assets/hose-open-platform-product-config.png": file6,
|
||||
};
|
||||
|
||||
export const EMBEDDED_SKILL_ALL_PATHS = [
|
||||
"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-lightweight.md",
|
||||
"references/cli.md",
|
||||
"references/customer-feedback-rule-remediation.md",
|
||||
"references/enterprise-onboarding.md",
|
||||
"references/first-time-user.md",
|
||||
"references/hose-enterprise-auth.md",
|
||||
"references/hose-enterprise-deploy.md",
|
||||
"references/hose-enterprise-init.md",
|
||||
"references/rule-lightweight.md",
|
||||
"references/rule-lint.md",
|
||||
"references/staging-simulation-workflow.md",
|
||||
"SKILL.md",
|
||||
];
|
||||
@@ -4,6 +4,8 @@ import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import packageJson from "../../package.json" with { type: "json" };
|
||||
import {
|
||||
EMBEDDED_SKILL_ALL_PATHS,
|
||||
EMBEDDED_SKILL_ASSETS,
|
||||
EMBEDDED_SKILL_FILES,
|
||||
EMBEDDED_SKILL_VERSION,
|
||||
getSkillContent,
|
||||
@@ -13,11 +15,14 @@ import {
|
||||
} from "./embedded-skill.js";
|
||||
|
||||
describe("embedded-skill", () => {
|
||||
test("embeds SKILL.md and reference files", () => {
|
||||
test("embeds skill text and asset files", () => {
|
||||
expect(EMBEDDED_SKILL_FILES["SKILL.md"]).toBeDefined();
|
||||
expect(EMBEDDED_SKILL_FILES["SKILL.md"]).toContain("name: seal-use");
|
||||
expect(EMBEDDED_SKILL_FILES["references/cli.md"]).toBeDefined();
|
||||
expect(EMBEDDED_SKILL_FILES["references/enterprise-onboarding.md"]).toContain("# Enterprise Onboarding");
|
||||
expect(EMBEDDED_SKILL_FILES["references/first-time-user.md"]).toContain("复制 → 以 cURL 格式复制");
|
||||
expect(EMBEDDED_SKILL_ASSETS["assets/hose-curl-copy-as-curl.png"]).toBeDefined();
|
||||
expect(EMBEDDED_SKILL_ALL_PATHS).toContain("assets/hose-curl-copy-as-curl.png");
|
||||
expect(getSkillContent()).toContain("name: seal-use");
|
||||
});
|
||||
|
||||
@@ -30,6 +35,8 @@ describe("embedded-skill", () => {
|
||||
expect(existsSync(join(tmp, "SKILL.md"))).toBe(true);
|
||||
expect(existsSync(join(tmp, "references", "cli.md"))).toBe(true);
|
||||
expect(existsSync(join(tmp, "references", "enterprise-onboarding.md"))).toBe(true);
|
||||
expect(existsSync(join(tmp, "references", "first-time-user.md"))).toBe(true);
|
||||
expect(existsSync(join(tmp, "assets", "hose-curl-copy-as-curl.png"))).toBe(true);
|
||||
} finally {
|
||||
rmSync(tmp, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
+17
-24
@@ -2,31 +2,17 @@ import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node
|
||||
import { homedir } from "node:os";
|
||||
import { dirname, join } from "node:path";
|
||||
|
||||
import skillMain from "../../skills/seal-use/SKILL.md" with { type: "text" };
|
||||
import agentOpenAi from "../../skills/seal-use/agents/openai.yaml" with { type: "text" };
|
||||
import refRuleLightweight from "../../skills/seal-use/references/rule-lightweight.md" with { type: "text" };
|
||||
import refApprovalBadCases from "../../skills/seal-use/references/approval-bad-cases.md" with { type: "text" };
|
||||
import refCli from "../../skills/seal-use/references/cli.md" with { type: "text" };
|
||||
import refApprovalRunLightweight from "../../skills/seal-use/references/approval-run-lightweight.md" with { type: "text" };
|
||||
import refApprovalAttachmentTrace from "../../skills/seal-use/references/approval-attachment-trace.md" with { type: "text" };
|
||||
import refCustomerFeedbackRuleRemediation from "../../skills/seal-use/references/customer-feedback-rule-remediation.md" with { type: "text" };
|
||||
import refEnterpriseOnboarding from "../../skills/seal-use/references/enterprise-onboarding.md" with { type: "text" };
|
||||
import refHoseEnterpriseAuth from "../../skills/seal-use/references/hose-enterprise-auth.md" with { type: "text" };
|
||||
import refHoseEnterpriseInit from "../../skills/seal-use/references/hose-enterprise-init.md" with { type: "text" };
|
||||
import {
|
||||
EMBEDDED_SKILL_ASSET_PATHS,
|
||||
EMBEDDED_SKILL_TEXT_FILES
|
||||
} from "./embedded-skill.generated.js";
|
||||
|
||||
export const EMBEDDED_SKILL_FILES: Record<string, string> = {
|
||||
"SKILL.md": skillMain,
|
||||
"agents/openai.yaml": agentOpenAi,
|
||||
"references/rule-lightweight.md": refRuleLightweight,
|
||||
"references/approval-bad-cases.md": refApprovalBadCases,
|
||||
"references/cli.md": refCli,
|
||||
"references/approval-run-lightweight.md": refApprovalRunLightweight,
|
||||
"references/approval-attachment-trace.md": refApprovalAttachmentTrace,
|
||||
"references/customer-feedback-rule-remediation.md": refCustomerFeedbackRuleRemediation,
|
||||
"references/enterprise-onboarding.md": refEnterpriseOnboarding,
|
||||
"references/hose-enterprise-auth.md": refHoseEnterpriseAuth,
|
||||
"references/hose-enterprise-init.md": refHoseEnterpriseInit
|
||||
};
|
||||
export { EMBEDDED_SKILL_ALL_PATHS } from "./embedded-skill.generated.js";
|
||||
|
||||
export const EMBEDDED_SKILL_FILES = EMBEDDED_SKILL_TEXT_FILES;
|
||||
export const EMBEDDED_SKILL_ASSETS: Record<string, Uint8Array> = Object.fromEntries(
|
||||
Object.entries(EMBEDDED_SKILL_ASSET_PATHS).map(([relPath, filePath]) => [relPath, readFileSync(filePath)])
|
||||
);
|
||||
|
||||
export function getSkillContent(): string {
|
||||
return EMBEDDED_SKILL_FILES["SKILL.md"] || "";
|
||||
@@ -91,6 +77,13 @@ export function installSkillFiles(targetDir: string = getDefaultGlobalSkillDir()
|
||||
installed.push(relPath);
|
||||
}
|
||||
|
||||
for (const [relPath, content] of Object.entries(EMBEDDED_SKILL_ASSETS)) {
|
||||
const fullPath = join(targetDir, relPath);
|
||||
mkdirSync(dirname(fullPath), { recursive: true });
|
||||
writeFileSync(fullPath, content);
|
||||
installed.push(relPath);
|
||||
}
|
||||
|
||||
return {
|
||||
targetDir,
|
||||
files: installed
|
||||
|
||||
Reference in new issue
Block a user