@refrainai/cli 0.4.1
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/ai-model-FM6GWCID.js +37 -0
- package/dist/ai-model-FM6GWCID.js.map +1 -0
- package/dist/chunk-2BVDAJZT.js +236 -0
- package/dist/chunk-2BVDAJZT.js.map +1 -0
- package/dist/chunk-2H7UOFLK.js +11 -0
- package/dist/chunk-2H7UOFLK.js.map +1 -0
- package/dist/chunk-7UCVPKD4.js +902 -0
- package/dist/chunk-7UCVPKD4.js.map +1 -0
- package/dist/chunk-AG3CFMYU.js +36 -0
- package/dist/chunk-AG3CFMYU.js.map +1 -0
- package/dist/chunk-CLYJHKPY.js +1131 -0
- package/dist/chunk-CLYJHKPY.js.map +1 -0
- package/dist/chunk-D5SI2PHK.js +74 -0
- package/dist/chunk-D5SI2PHK.js.map +1 -0
- package/dist/chunk-DJVUITRB.js +9084 -0
- package/dist/chunk-DJVUITRB.js.map +1 -0
- package/dist/chunk-H47NWH7N.js +4427 -0
- package/dist/chunk-H47NWH7N.js.map +1 -0
- package/dist/chunk-HQDXLWAY.js +109 -0
- package/dist/chunk-HQDXLWAY.js.map +1 -0
- package/dist/chunk-IGFCYKHC.js +1974 -0
- package/dist/chunk-IGFCYKHC.js.map +1 -0
- package/dist/chunk-RT664YIO.js +245 -0
- package/dist/chunk-RT664YIO.js.map +1 -0
- package/dist/chunk-RYIJPYM3.js +164 -0
- package/dist/chunk-RYIJPYM3.js.map +1 -0
- package/dist/chunk-TDSM3UXI.js +40 -0
- package/dist/chunk-TDSM3UXI.js.map +1 -0
- package/dist/chunk-UGPXCQY3.js +778 -0
- package/dist/chunk-UGPXCQY3.js.map +1 -0
- package/dist/chunk-VPK2MQAZ.js +589 -0
- package/dist/chunk-VPK2MQAZ.js.map +1 -0
- package/dist/chunk-WEYR56ZN.js +953 -0
- package/dist/chunk-WEYR56ZN.js.map +1 -0
- package/dist/chunk-XMFCXPYU.js +275 -0
- package/dist/chunk-XMFCXPYU.js.map +1 -0
- package/dist/chunk-Z33FCOTZ.js +251 -0
- package/dist/chunk-Z33FCOTZ.js.map +1 -0
- package/dist/cli.js +59 -0
- package/dist/cli.js.map +1 -0
- package/dist/compose-MTSIJY5D.js +547 -0
- package/dist/compose-MTSIJY5D.js.map +1 -0
- package/dist/config-ZSUNCFXR.js +9 -0
- package/dist/config-ZSUNCFXR.js.map +1 -0
- package/dist/fix-runbook-ZSBOTLC2.js +294 -0
- package/dist/fix-runbook-ZSBOTLC2.js.map +1 -0
- package/dist/google-sheets-DRWIVEVC.js +482 -0
- package/dist/google-sheets-DRWIVEVC.js.map +1 -0
- package/dist/registry-LZLYTNDJ.js +17 -0
- package/dist/registry-LZLYTNDJ.js.map +1 -0
- package/dist/runbook-data-helpers-KRR2SH76.js +16 -0
- package/dist/runbook-data-helpers-KRR2SH76.js.map +1 -0
- package/dist/runbook-executor-K7T6RJWJ.js +1480 -0
- package/dist/runbook-executor-K7T6RJWJ.js.map +1 -0
- package/dist/runbook-generator-MPXJBQ5N.js +800 -0
- package/dist/runbook-generator-MPXJBQ5N.js.map +1 -0
- package/dist/runbook-schema-3T6TP3JJ.js +35 -0
- package/dist/runbook-schema-3T6TP3JJ.js.map +1 -0
- package/dist/runbook-store-G5GUOWRR.js +11 -0
- package/dist/runbook-store-G5GUOWRR.js.map +1 -0
- package/dist/schema-5G6UQSPT.js +91 -0
- package/dist/schema-5G6UQSPT.js.map +1 -0
- package/dist/server-AG3LXQBI.js +8778 -0
- package/dist/server-AG3LXQBI.js.map +1 -0
- package/dist/tenant-ai-config-QPFEJUVJ.js +14 -0
- package/dist/tenant-ai-config-QPFEJUVJ.js.map +1 -0
- package/dist/yaml-patcher-VGUS2JGH.js +15 -0
- package/dist/yaml-patcher-VGUS2JGH.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/runbook-generator/index.ts","../../../src/runbook-generator/config.ts","../../../src/runbook-generator/review-editor.ts","../../../src/runbook-generator/report-generator.ts"],"sourcesContent":["/**\n * runbook-generator CLIエントリポイント\n *\n * Usage:\n * npx tsx src/runbook-generator/index.ts \\\n * --url \"https://staging.example.com/login\" \\\n * --goal \"メールアドレスとパスワードでログインしてダッシュボードを表示する\" \\\n * --output ./runbooks/login-flow.yaml\n */\n\nimport { writeFile, mkdir } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport { getModel, initModel, trackedGenerateObject } from \"../harness/ai-model\";\nimport { globalMetrics } from \"../harness/ai-metrics\";\nimport { parseArgs } from \"./config\";\nimport { explore } from \"./explorer\";\nimport { buildRunbookYaml } from \"./runbook-builder\";\nimport { createReviewPrompt, reviewResponseSchema } from \"./prompts\";\nimport { promptReviewEdits } from \"./review-editor\";\nimport { intro, outro, log, cancel, promptText } from \"../cli/prompts\";\nimport { t, tf } from \"../i18n\";\nimport { formatDuration } from \"../cli/format\";\nimport { createDebugLogger } from \"../cli/debug-logger\";\nimport { serializeGeneratorOptions } from \"../cli/options-serializer\";\nimport { generateExplorationReport } from \"./report-generator\";\nimport type { ReviewResult } from \"./types\";\n\nasync function main() {\n const totalStart = performance.now();\n const config = await parseArgs();\n await initModel(config.aiModelConfig);\n const cliOptions = serializeGeneratorOptions(config);\n\n intro(\"runbook-generator\");\n log.info(`URL: ${config.url}`);\n log.info(`Goal: ${config.goal}`);\n log.info(`Output: ${config.output}`);\n log.info(`Max iterations: ${config.maxIterations}`);\n log.info(`Step delay: ${config.stepDelay}ms`);\n log.info(`Headless: ${config.headless}`);\n if (config.skills && config.skills.length > 0) {\n log.info(`Skills: ${config.skills.join(\", \")}`);\n }\n log.info(`Context: loaded (${config.contextMarkdown.split(\"\\n\").length} lines)`);\n log.info(\"--- Context Markdown ---\");\n log.info(config.contextMarkdown);\n log.info(\"--- End Context ---\");\n if (config.secrets && Object.keys(config.secrets.values).length > 0) {\n log.info(`Secrets: ${Object.keys(config.secrets.values).length} keys loaded`);\n }\n\n // 探索実行\n const exploreStart = performance.now();\n const { recordedSteps, goalAchieved, additionalGuidance, interventions, cancelled, error: exploreError } = await explore(config);\n\n log.info(`Steps recorded: ${recordedSteps.length}`);\n log.info(`Goal achieved: ${goalAchieved}`);\n if (cancelled) {\n log.warn(\"Exploration was cancelled by user.\");\n }\n if (interventions.length > 0) {\n log.info(`User interventions: ${interventions.length}`);\n }\n log.info(`Exploration completed (${formatDuration(performance.now() - exploreStart)})`);\n\n // エラー終了時のレポート生成\n if (exploreError) {\n log.error(`Exploration failed: ${exploreError.message}`);\n\n const report = await generateExplorationReport({\n goal: config.goal,\n startUrl: config.url,\n outcome: \"error\",\n userFeedback: \"\",\n recordedSteps,\n interventions,\n debugLogPath: config.debugLogPath,\n errorMessage: exploreError.stack ?? exploreError.message,\n cliOptions,\n aiMetrics: globalMetrics.getSummary(),\n totalDurationMs: Math.round(performance.now() - totalStart),\n });\n\n const reportPath = config.output.replace(/\\.\\w+$/, \"-report.md\");\n await mkdir(dirname(reportPath), { recursive: true });\n await writeFile(reportPath, report, \"utf-8\");\n log.info(`Error report written to: ${reportPath}`);\n\n outro(`Exploration failed. Report: ${reportPath}`);\n process.exit(1);\n }\n\n // キャンセルまたはゴール未達成時のレポート生成\n if (cancelled || !goalAchieved) {\n const userFeedback = await promptText(\n t(\"generator.feedbackPrompt\"),\n { validate: () => undefined },\n );\n\n const report = await generateExplorationReport({\n goal: config.goal,\n startUrl: config.url,\n outcome: cancelled ? \"cancelled\" : \"goal_not_achieved\",\n userFeedback: userFeedback?.trim() ?? \"\",\n recordedSteps,\n interventions,\n debugLogPath: config.debugLogPath,\n cliOptions,\n aiMetrics: globalMetrics.getSummary(),\n totalDurationMs: Math.round(performance.now() - totalStart),\n });\n\n const reportPath = config.output.replace(/\\.\\w+$/, \"-report.md\");\n await mkdir(dirname(reportPath), { recursive: true });\n await writeFile(reportPath, report, \"utf-8\");\n log.info(`Report written to: ${reportPath}`);\n\n if (cancelled) {\n outro(t(\"generator.cancelled\"));\n process.exit(0);\n }\n }\n\n if (recordedSteps.length === 0) {\n log.error(\"No steps recorded. Cannot generate runbook.\");\n process.exit(1);\n }\n\n try {\n // デバッグロガー(AI レビュー用)\n const debugLogger = createDebugLogger({\n filePath: config.debugLogPath,\n console: config.debugConsole,\n });\n\n // AIレビュー: 不要ステップ除外・リスク判定・承認要否\n let reviewResult: ReviewResult | undefined;\n try {\n const reviewStart = performance.now();\n log.step(t(\"generator.aiReviewing\"));\n\n const { system: reviewSystem, userPrompt: reviewUserPrompt } = createReviewPrompt(\n config.goal,\n recordedSteps,\n goalAchieved,\n interventions,\n config.locale,\n );\n\n debugLogger.log({\n phase: \"generator\",\n event: \"ai_review\",\n data: { prompt: `${reviewSystem}\\n---\\n${reviewUserPrompt}`.slice(0, 500) },\n });\n\n const { object } = await trackedGenerateObject(\"review\", {\n model: getModel(\"review\"),\n messages: [\n {\n role: \"system\",\n content: reviewSystem,\n providerOptions: {\n anthropic: { cacheControl: { type: \"ephemeral\" } },\n },\n },\n { role: \"user\", content: reviewUserPrompt },\n ],\n schema: reviewResponseSchema,\n temperature: 0,\n });\n\n reviewResult = object as ReviewResult;\n\n debugLogger.log({\n phase: \"generator\",\n event: \"ai_review\",\n data: {\n parsedResult: reviewResult as unknown as Record<string, unknown>,\n },\n });\n\n const kept = reviewResult!.reviewedSteps.filter((s: { keep: boolean }) => s.keep).length;\n const removed = reviewResult!.reviewedSteps.filter((s: { keep: boolean }) => !s.keep).length;\n\n log.info(`AI review done: ${kept} kept, ${removed} removed (${formatDuration(performance.now() - reviewStart)})`);\n log.info(`Summary: ${reviewResult!.summary}`);\n } catch (error) {\n log.warn(tf(\"generator.aiReviewFailed\", { error: error instanceof Error ? error.message : String(error) }));\n reviewResult = undefined;\n }\n\n // 対話的レビュー反映\n let finalGuidance = additionalGuidance;\n if (reviewResult) {\n const edited = await promptReviewEdits(\n reviewResult,\n recordedSteps,\n additionalGuidance,\n );\n reviewResult = edited.reviewResult;\n finalGuidance = edited.humanGuidance;\n }\n\n // 編集内容の確認ログ\n if (reviewResult) {\n const keptWithConfirm = reviewResult.reviewedSteps\n .filter((s) => s.keep && s.requiresConfirmation)\n .map((s) => `#${s.originalOrdinal}`);\n log.info(`Confirmation required for steps: ${keptWithConfirm.join(\", \") || t(\"common.none\")}`);\n }\n\n // YAML生成\n const yamlStart = performance.now();\n const yaml = buildRunbookYaml({\n goal: config.goal,\n startUrl: config.url,\n recordedSteps,\n goalAchieved,\n stepDelay: config.stepDelay,\n contextMarkdown: config.contextMarkdown,\n reviewResult,\n humanGuidance: finalGuidance,\n interventions,\n skills: config.skills,\n });\n\n // ファイル書き出し\n await mkdir(dirname(config.output), { recursive: true });\n await writeFile(config.output, yaml, \"utf-8\");\n log.info(`YAML generation + write (${formatDuration(performance.now() - yamlStart)})`);\n\n await debugLogger.flush();\n\n log.success(`Runbook written to: ${config.output}`);\n if (!goalAchieved) {\n log.warn(\"Goal was NOT fully achieved. Runbook may be incomplete.\");\n }\n\n // AI メトリクスサマリー\n const metrics = globalMetrics.getSummary();\n if (metrics.totalCalls > 0) {\n const purposeSummary = Object.entries(metrics.byPurpose)\n .map(([p, b]) => `${p}(${b.calls})`)\n .join(\" \");\n log.info(\n `AI Metrics: ${metrics.totalCalls} calls, ` +\n `${metrics.totalInputTokens.toLocaleString()} in / ${metrics.totalOutputTokens.toLocaleString()} out tokens, ` +\n `cache ${(metrics.cacheHitRate * 100).toFixed(1)}%, ` +\n `$${metrics.estimatedCostUsd.toFixed(4)}, ` +\n `${(metrics.totalDurationMs / 1000).toFixed(1)}s — ${purposeSummary}`,\n );\n if (metrics.byModel && Object.keys(metrics.byModel).length > 1) {\n const modelSummary = Object.entries(metrics.byModel)\n .map(([id, b]) => `${id}($${b.estimatedCostUsd.toFixed(4)})`)\n .join(\" \");\n log.info(`Models: ${modelSummary}`);\n }\n }\n\n outro(`Total: ${formatDuration(performance.now() - totalStart)}`);\n } catch (postExploreError) {\n const errorMessage = postExploreError instanceof Error\n ? (postExploreError.stack ?? postExploreError.message)\n : String(postExploreError);\n\n log.error(`Post-exploration phase failed: ${errorMessage}`);\n\n const report = await generateExplorationReport({\n goal: config.goal,\n startUrl: config.url,\n outcome: \"error\",\n userFeedback: \"\",\n recordedSteps,\n interventions,\n debugLogPath: config.debugLogPath,\n errorMessage,\n cliOptions,\n aiMetrics: globalMetrics.getSummary(),\n totalDurationMs: Math.round(performance.now() - totalStart),\n });\n\n const reportPath = config.output.replace(/\\.\\w+$/, \"-report.md\");\n await mkdir(dirname(reportPath), { recursive: true });\n await writeFile(reportPath, report, \"utf-8\");\n log.info(`Error report written to: ${reportPath}`);\n\n process.exit(1);\n }\n}\n\nmain().catch((error) => {\n cancel(`Fatal error: ${error instanceof Error ? error.message : String(error)}`);\n if (error instanceof Error && error.stack) {\n console.error(error.stack);\n }\n process.exit(1);\n});\n","/**\n * runbook-generator CLI引数パース\n */\n\nimport { parseArgs as nodeParseArgs } from \"node:util\";\nimport { cancel } from \"../cli/prompts\";\nimport { t, initLocale, getLocale } from \"../i18n\";\nimport { getRawArgs, readContextFile, parseModelConfig } from \"../cli/config-helpers\";\nimport { loadSecrets } from \"../cli/secrets-loader\";\nimport { checkHelpFlag } from \"../cli/help\";\nimport type { GeneratorConfig } from \"./types\";\n\nexport async function parseArgs(): Promise<GeneratorConfig> {\n checkHelpFlag(\"generate\");\n const args = getRawArgs();\n\n const { values } = nodeParseArgs({\n args,\n options: {\n url: { type: \"string\" },\n goal: { type: \"string\" },\n output: { type: \"string\" },\n screenshots: { type: \"string\" },\n context: { type: \"string\" },\n secrets: { type: \"string\" },\n \"max-iterations\": { type: \"string\" },\n \"step-delay\": { type: \"string\" },\n \"stall-check-interval\": { type: \"string\" },\n \"history-window\": { type: \"string\" },\n \"max-failures\": { type: \"string\" },\n \"no-snapshot-filter\": { type: \"boolean\" },\n \"debug-log\": { type: \"string\" },\n debug: { type: \"boolean\" },\n headless: { type: \"string\" },\n model: { type: \"string\" },\n \"model-provider\": { type: \"string\" },\n \"model-base-url\": { type: \"string\" },\n \"model-selector\": { type: \"string\" },\n \"model-extraction\": { type: \"string\" },\n \"model-exploration\": { type: \"string\" },\n \"model-review\": { type: \"string\" },\n \"model-fallback\": { type: \"string\" },\n \"model-exploration-light\": { type: \"string\" },\n \"enable-multi-model\": { type: \"boolean\" },\n video: { type: \"string\" },\n locale: { type: \"string\" },\n stealth: { type: \"boolean\" },\n proxy: { type: \"string\" },\n skill: { type: \"string\" },\n },\n strict: true,\n });\n\n initLocale(values.locale);\n\n if (!values.url) {\n cancel(t(\"cli.urlRequired\"));\n process.exit(1);\n }\n\n if (!values.goal) {\n cancel(t(\"cli.goalRequired\"));\n process.exit(1);\n }\n\n if (!values.output) {\n cancel(t(\"cli.outputRequired\"));\n process.exit(1);\n }\n\n if (!values.context) {\n cancel(t(\"cli.contextRequired\"));\n process.exit(1);\n }\n\n const contextMarkdown = await readContextFile(values.context);\n const secrets = await loadSecrets(values.secrets);\n const aiModelConfig = parseModelConfig(values);\n\n return {\n url: values.url,\n goal: values.goal,\n locale: getLocale(),\n output: values.output,\n screenshotDir: values.screenshots,\n contextMarkdown,\n secrets,\n maxIterations: values[\"max-iterations\"]\n ? Number.parseInt(values[\"max-iterations\"], 10)\n : 20,\n stepDelay: values[\"step-delay\"]\n ? Number.parseInt(values[\"step-delay\"], 10)\n : 500,\n headless: values.headless !== \"false\",\n stallCheckInterval: values[\"stall-check-interval\"]\n ? Number.parseInt(values[\"stall-check-interval\"], 10)\n : 3,\n historyWindow: values[\"history-window\"]\n ? Number.parseInt(values[\"history-window\"], 10)\n : 10,\n maxConsecutiveFailures: values[\"max-failures\"]\n ? Number.parseInt(values[\"max-failures\"], 10)\n : 3,\n snapshotFilter: !values[\"no-snapshot-filter\"],\n debugLogPath: values[\"debug-log\"],\n debugConsole: values.debug ?? false,\n videoDir: values.video,\n aiModelConfig,\n enableMultiModel: values[\"enable-multi-model\"] ?? false,\n stealth: values.stealth ?? false,\n proxy: values.proxy,\n skills: values.skill?.split(\",\").map(s => s.trim()).filter(Boolean),\n };\n}\n","/**\n * AIレビュー結果の対話的編集\n *\n * AIレビュー完了後、YAML書き出し前にユーザーがレビュー内容を確認・修正する。\n */\n\nimport {\n promptSelect,\n promptMultiselect,\n promptText,\n note,\n log,\n} from \"../cli/prompts\";\nimport { t, tf } from \"../i18n\";\nimport type { RecordedStep, ReviewResult, SuggestedCapture } from \"./types\";\n\nexport interface ReviewEditorResult {\n reviewResult: ReviewResult;\n humanGuidance: string[];\n}\n\n/**\n * レビューサマリーのテキストを組み立てる\n */\nfunction buildSummaryText(\n reviewResult: ReviewResult,\n recordedSteps: RecordedStep[],\n humanGuidance: string[],\n): string {\n const lines: string[] = [];\n\n // 保持されるステップ\n const keptSteps = reviewResult.reviewedSteps.filter((s) => s.keep);\n if (keptSteps.length > 0) {\n lines.push(t(\"review.keptSteps\"));\n for (const step of keptSteps) {\n const recorded = recordedSteps.find(\n (r) => r.ordinal === step.originalOrdinal,\n );\n const desc = recorded?.action.description ?? t(\"common.unknown\");\n lines.push(\n ` #${step.originalOrdinal}: ${desc} [risk: ${step.riskLevel}]`,\n );\n }\n }\n\n // 承認が必要なステップ\n const confirmSteps = keptSteps.filter((s) => s.requiresConfirmation);\n lines.push(\"\");\n lines.push(t(\"review.confirmationRequired\"));\n if (confirmSteps.length > 0) {\n for (const step of confirmSteps) {\n const recorded = recordedSteps.find(\n (r) => r.ordinal === step.originalOrdinal,\n );\n const desc = recorded?.action.description ?? t(\"common.unknown\");\n const reason = step.confirmationReason\n ? ` — ${step.confirmationReason}`\n : \"\";\n lines.push(\n ` #${step.originalOrdinal}: ${desc} [risk: ${step.riskLevel}]${reason}`,\n );\n }\n } else {\n lines.push(\" \" + t(\"common.none\"));\n }\n\n // 除外されるステップ\n const removedSteps = reviewResult.reviewedSteps.filter((s) => !s.keep);\n if (removedSteps.length > 0) {\n lines.push(\"\");\n lines.push(t(\"review.removedSteps\"));\n for (const step of removedSteps) {\n const recorded = recordedSteps.find(\n (r) => r.ordinal === step.originalOrdinal,\n );\n const desc = recorded?.action.description ?? t(\"common.unknown\");\n const reason = step.removalReason ?? \"\";\n lines.push(` #${step.originalOrdinal}: ${desc} (理由: ${reason})`);\n }\n }\n\n // キャプチャ\n const captureSteps = recordedSteps.filter(\n (r) => r.action.suggestedCaptures && r.action.suggestedCaptures.length > 0,\n );\n if (captureSteps.length > 0) {\n lines.push(\"\");\n lines.push(t(\"review.capturedValues\"));\n for (const r of captureSteps) {\n for (const c of r.action.suggestedCaptures!) {\n lines.push(\n ` Step #${r.ordinal} → ${c.name} (${c.strategy}${c.pattern ? `: ${c.pattern}` : \"\"})`,\n );\n }\n }\n }\n\n // ノート\n lines.push(\"\");\n lines.push(t(\"review.notes\"));\n if (humanGuidance.length > 0) {\n for (const [i, n] of humanGuidance.entries()) {\n lines.push(` ${tf(\"review.guidancePrefix\", { index: i + 1 })} ${n}`);\n }\n } else {\n lines.push(\" \" + t(\"common.none\"));\n }\n\n // サマリー\n lines.push(\"\");\n lines.push(tf(\"review.summaryLabel\", { summary: reviewResult.summary }));\n\n return lines.join(\"\\n\");\n}\n\nfunction cloneReviewResult(r: ReviewResult): ReviewResult {\n return {\n reviewedSteps: r.reviewedSteps.map((s) => ({ ...s })),\n summary: r.summary,\n };\n}\n\n/**\n * ReviewResult から決定的にノート候補を導出する(追加のAI呼び出しなし)\n */\nfunction deriveSuggestedNotes(\n reviewResult: ReviewResult,\n recordedSteps: RecordedStep[],\n): string[] {\n const suggestions: string[] = [];\n\n // high-risk ステップあり\n const highRiskSteps = reviewResult.reviewedSteps.filter(\n (s) => s.keep && s.riskLevel === \"high\",\n );\n if (highRiskSteps.length > 0) {\n const ordinals = highRiskSteps\n .map((s) => `#${s.originalOrdinal}`)\n .join(\", \");\n suggestions.push(tf(\"review.highRiskNote\", { ordinals }));\n }\n\n // credential 入力あり\n const credentialSteps = recordedSteps.filter(\n (r) => r.action.inputCategory === \"credential\",\n );\n if (credentialSteps.length > 0) {\n suggestions.push(t(\"review.credentialNote\"));\n }\n\n // 多数のステップ除外\n const removedCount = reviewResult.reviewedSteps.filter(\n (s) => !s.keep,\n ).length;\n if (removedCount >= 3) {\n suggestions.push(tf(\"review.removedStepsNote\", { count: removedCount }));\n }\n\n // AIレビュー要約\n if (reviewResult.summary) {\n suggestions.push(`AIレビュー要約: ${reviewResult.summary}`);\n }\n\n return suggestions;\n}\n\n/**\n * 承認要否変更: multiselect チェックボックスで選択\n */\nasync function handleToggleConfirmation(\n reviewResult: ReviewResult,\n recordedSteps: RecordedStep[],\n): Promise<void> {\n const keptSteps = reviewResult.reviewedSteps.filter((s) => s.keep);\n if (keptSteps.length === 0) {\n log.warn(\"保持されるステップがありません。\");\n return;\n }\n\n // AIの推奨値が initialValues にプリセット\n const initialValues = keptSteps\n .filter((s) => s.requiresConfirmation)\n .map((s) => s.originalOrdinal);\n\n const selected = await promptMultiselect<number>(\n t(\"review.selectConfirmSteps\"),\n keptSteps.map((step) => {\n const recorded = recordedSteps.find(\n (r) => r.ordinal === step.originalOrdinal,\n );\n const desc = recorded?.action.description ?? t(\"common.unknown\");\n return {\n value: step.originalOrdinal,\n label: `#${step.originalOrdinal}: ${desc}`,\n hint: `risk: ${step.riskLevel}`,\n };\n }),\n { initialValues },\n );\n\n // 選択結果を反映\n for (const step of keptSteps) {\n step.requiresConfirmation = selected.includes(step.originalOrdinal);\n }\n}\n\n/**\n * ノート編集: AI提案ノート + カスタムノート + 削除\n */\nasync function handleEditNotes(\n humanGuidance: string[],\n reviewResult: ReviewResult,\n recordedSteps: RecordedStep[],\n): Promise<void> {\n const suggestions = deriveSuggestedNotes(reviewResult, recordedSteps);\n\n type NoteAction = \"add_custom\" | \"add_suggested\" | \"delete\";\n const options: { value: NoteAction; label: string; hint?: string }[] = [\n { value: \"add_custom\", label: t(\"review.addCustomNote\") },\n ];\n if (suggestions.length > 0) {\n options.push({\n value: \"add_suggested\",\n label: t(\"review.addSuggestedNote\"),\n hint: `${suggestions.length} ${t(\"common.items\")}`,\n });\n }\n if (humanGuidance.length > 0) {\n options.push({\n value: \"delete\",\n label: t(\"review.deleteNote\"),\n hint: `${humanGuidance.length} ${t(\"common.items\")}`,\n });\n }\n\n const action = await promptSelect<NoteAction>(\n t(\"review.selectNotesAction\"),\n options,\n );\n\n switch (action) {\n case \"add_custom\": {\n const content = await promptText(t(\"review.noteContent\"), {\n validate: (v) => (!v?.trim() ? t(\"review.noteContentRequired\") : undefined),\n });\n humanGuidance.push(content.trim());\n log.success(tf(\"review.notesAdded\", { count: 1 }));\n break;\n }\n case \"add_suggested\": {\n const selected = await promptMultiselect<number>(\n \"追加するノートを選択\",\n suggestions.map((s, i) => ({\n value: i,\n label: s,\n })),\n );\n for (const idx of selected) {\n humanGuidance.push(suggestions[idx]);\n }\n log.success(tf(\"review.notesAdded\", { count: selected.length }));\n break;\n }\n case \"delete\": {\n const toDelete = await promptMultiselect<number>(\n \"削除するノートを選択\",\n humanGuidance.map((g, i) => ({\n value: i,\n label: `${tf(\"review.guidancePrefix\", { index: i + 1 })} ${g}`,\n })),\n );\n // 降順で splice して index がずれないようにする\n for (const idx of [...toDelete].sort((a, b) => b - a)) {\n humanGuidance.splice(idx, 1);\n }\n log.success(tf(\"review.notesDeleted\", { count: toDelete.length }));\n break;\n }\n }\n}\n\n/**\n * ページから取得する値の編集: 各ステップの取得値を accept/reject/add\n */\nasync function handleEditCaptures(\n recordedSteps: RecordedStep[],\n): Promise<void> {\n // 既存キャプチャがあるステップ + キャプチャなしのステップ両方対象\n type CaptureAction = \"accept_all\" | \"reject\" | \"add\";\n const action = await promptSelect<CaptureAction>(\n t(\"review.selectCaptureAction\"),\n [\n { value: \"accept_all\", label: t(\"review.acceptAllCaptures\") },\n { value: \"reject\", label: t(\"review.rejectCaptures\") },\n { value: \"add\", label: t(\"review.addCapture\") },\n ],\n );\n\n switch (action) {\n case \"accept_all\": {\n log.success(t(\"review.allCapturesAccepted\"));\n break;\n }\n case \"reject\": {\n const captureSteps = recordedSteps.filter(\n (r) => r.action.suggestedCaptures && r.action.suggestedCaptures.length > 0,\n );\n if (captureSteps.length === 0) {\n log.warn(t(\"review.noCapturesAvailable\"));\n break;\n }\n const allCaptures: { value: string; label: string }[] = [];\n for (const r of captureSteps) {\n for (const c of r.action.suggestedCaptures!) {\n allCaptures.push({\n value: `${r.ordinal}:${c.name}`,\n label: `Step #${r.ordinal} → ${c.name} (${c.strategy})`,\n });\n }\n }\n const toReject = await promptMultiselect<string>(\n t(\"review.selectCapturesToReject\"),\n allCaptures,\n );\n for (const key of toReject) {\n const [ordStr, name] = key.split(\":\");\n const step = recordedSteps.find((r) => r.ordinal === Number(ordStr));\n if (step?.action.suggestedCaptures) {\n step.action.suggestedCaptures = step.action.suggestedCaptures.filter(\n (c) => c.name !== name,\n );\n }\n }\n log.success(tf(\"review.capturesRejected\", { count: toReject.length }));\n break;\n }\n case \"add\": {\n const ordinalStr = await promptText(t(\"review.captureStepNumber\"), {\n validate: (v) => {\n if (!v?.trim()) return t(\"review.captureStepRequired\");\n if (Number.isNaN(Number(v))) return t(\"review.captureStepNumeric\");\n return undefined;\n },\n });\n const ordinal = Number(ordinalStr);\n const step = recordedSteps.find((r) => r.ordinal === ordinal);\n if (!step) {\n log.warn(tf(\"review.stepNotFound\", { ordinal }));\n break;\n }\n\n const name = await promptText(t(\"review.captureVarName\"), {\n validate: (v) => (!v?.trim() ? t(\"review.captureVarRequired\") : undefined),\n });\n const strategy = await promptSelect<SuggestedCapture[\"strategy\"]>(\n t(\"review.captureStrategy\"),\n [\n { value: \"snapshot\", label: t(\"review.strategySnapshot\") },\n { value: \"url\", label: t(\"review.strategyUrl\") },\n { value: \"ai\", label: t(\"review.strategyAi\") },\n { value: \"expression\", label: t(\"review.strategyExpression\") },\n ],\n );\n\n const newCapture: SuggestedCapture = { name, strategy };\n\n if (strategy === \"snapshot\" || strategy === \"url\") {\n newCapture.pattern = await promptText(t(\"review.regexPattern\"));\n } else if (strategy === \"ai\") {\n newCapture.prompt = await promptText(t(\"review.aiExtractionPrompt\"));\n } else if (strategy === \"expression\") {\n newCapture.expression = await promptText(t(\"review.templateExpression\"));\n }\n\n if (!step.action.suggestedCaptures) {\n step.action.suggestedCaptures = [];\n }\n step.action.suggestedCaptures.push(newCapture);\n log.success(tf(\"review.captureAdded\", { ordinal, name }));\n break;\n }\n }\n}\n\n/**\n * AIレビュー結果をユーザーに提示し、対話的に修正を受け付ける。\n * 修正済みの ReviewResult と humanGuidance を返す。\n */\nexport async function promptReviewEdits(\n reviewResult: ReviewResult,\n recordedSteps: RecordedStep[],\n humanGuidance: string[],\n): Promise<ReviewEditorResult> {\n const edited = cloneReviewResult(reviewResult);\n const editedGuidance = [...humanGuidance];\n\n while (true) {\n // サマリー表示\n const summaryText = buildSummaryText(edited, recordedSteps, editedGuidance);\n note(summaryText, t(\"review.reviewResult\"));\n\n type MenuAction = \"confirm\" | \"toggle_confirmation\" | \"edit_captures\" | \"edit_notes\";\n const hasCaptureSteps = recordedSteps.some(\n (r) => r.action.suggestedCaptures && r.action.suggestedCaptures.length > 0,\n );\n const menuOptions: { value: MenuAction; label: string; hint?: string }[] = [\n { value: \"confirm\", label: t(\"review.confirm\"), hint: t(\"review.confirmHint\") },\n {\n value: \"toggle_confirmation\",\n label: t(\"review.toggleConfirmation\"),\n hint: \"multiselect\",\n },\n ...(hasCaptureSteps\n ? [\n {\n value: \"edit_captures\" as const,\n label: t(\"review.editCaptures\"),\n hint: t(\"review.editCapturesHint\"),\n },\n ]\n : []),\n { value: \"edit_notes\", label: t(\"review.editNotes\") },\n ];\n const action = await promptSelect<MenuAction>(\n t(\"review.selectAction\"),\n menuOptions,\n );\n\n if (action === \"confirm\") {\n break;\n }\n\n switch (action) {\n case \"toggle_confirmation\":\n await handleToggleConfirmation(edited, recordedSteps);\n break;\n case \"edit_captures\":\n await handleEditCaptures(recordedSteps);\n break;\n case \"edit_notes\":\n await handleEditNotes(editedGuidance, edited, recordedSteps);\n break;\n }\n }\n\n return {\n reviewResult: edited,\n humanGuidance: editedGuidance,\n };\n}\n","/**\n * report-generator — 探索キャンセル/失敗時のレポート生成\n *\n * 探索が中断・失敗した際に、実行ログ・ステップ・ユーザーフィードバックを\n * Markdown 形式のレポートとして集約する。\n * コーディングエージェントに渡す素材として利用する。\n */\n\nimport type { RecordedStep, InterventionRecord } from \"./types\";\nimport type { SerializedOption } from \"../cli/options-serializer\";\nimport type { AIMetricsSummary } from \"../harness/ai-metrics\";\nimport { renderOptionsMarkdown } from \"../cli/options-serializer\";\nimport {\n readDebugLog,\n formatAiMetricsSection,\n formatRuntimeEnvironment,\n formatFailureCategoryDistribution,\n formatPerformanceBottlenecks,\n formatDebugLogSections,\n type ReportableStep,\n} from \"../harness/report-sections\";\n\nexport interface ExplorationReportInput {\n goal: string;\n startUrl: string;\n outcome: \"cancelled\" | \"goal_achieved\" | \"goal_not_achieved\" | \"error\";\n userFeedback: string;\n recordedSteps: RecordedStep[];\n interventions: InterventionRecord[];\n debugLogPath?: string;\n errorMessage?: string;\n /** CLI オプション(レポートに記録用) */\n cliOptions?: SerializedOption[];\n /** AI メトリクス */\n aiMetrics?: AIMetricsSummary;\n /** 探索全体の所要時間(ms) */\n totalDurationMs?: number;\n}\n\nfunction formatOutcome(outcome: ExplorationReportInput[\"outcome\"]): string {\n switch (outcome) {\n case \"cancelled\":\n return \"Cancelled by user\";\n case \"goal_achieved\":\n return \"Goal achieved\";\n case \"goal_not_achieved\":\n return \"Goal not achieved\";\n case \"error\":\n return \"Error\";\n }\n}\n\n/** RecordedStep を ReportableStep に変換する */\nfunction toReportableSteps(steps: RecordedStep[]): ReportableStep[] {\n return steps.map((s) => ({\n ordinal: s.ordinal + 1,\n description: `${s.action.action}: ${s.action.description}`,\n status: s.success ? \"success\" as const : \"failed\" as const,\n durationMs: s.durationMs ?? 0,\n error: s.error,\n failureCategory: s.failureCategory,\n }));\n}\n\nexport async function generateExplorationReport(\n input: ExplorationReportInput,\n): Promise<string> {\n const lines: string[] = [];\n\n // Header\n lines.push(\"# Exploration Report\");\n lines.push(\"\");\n\n // Session Info\n lines.push(\"## Session Info\");\n lines.push(`- **Date**: ${new Date().toISOString()}`);\n lines.push(`- **Goal**: ${input.goal}`);\n lines.push(`- **Start URL**: ${input.startUrl}`);\n lines.push(`- **Outcome**: ${formatOutcome(input.outcome)}`);\n lines.push(\"\");\n\n // CLI Options\n if (input.cliOptions && input.cliOptions.length > 0) {\n lines.push(\"## CLI Options\");\n lines.push(...renderOptionsMarkdown(input.cliOptions));\n lines.push(\"\");\n }\n\n // User Feedback\n lines.push(\"## User Feedback\");\n if (input.userFeedback) {\n lines.push(input.userFeedback);\n } else {\n lines.push(\"(No feedback provided)\");\n }\n lines.push(\"\");\n\n // Error Details\n if (input.errorMessage) {\n lines.push(\"## Error Details\");\n lines.push(\"```\");\n lines.push(input.errorMessage);\n lines.push(\"```\");\n lines.push(\"\");\n }\n\n // Execution Summary\n const successCount = input.recordedSteps.filter((s) => s.success).length;\n const failedCount = input.recordedSteps.filter((s) => !s.success).length;\n lines.push(\"## Execution Summary\");\n lines.push(`- **Total Steps**: ${input.recordedSteps.length}`);\n lines.push(`- **Successful**: ${successCount}`);\n lines.push(`- **Failed**: ${failedCount}`);\n lines.push(`- **Interventions**: ${input.interventions.length}`);\n if (input.totalDurationMs !== undefined) {\n lines.push(`- **Duration**: ${input.totalDurationMs}ms`);\n }\n lines.push(\"\");\n\n // Recorded Steps\n if (input.recordedSteps.length > 0) {\n lines.push(\"## Recorded Steps\");\n for (const step of input.recordedSteps) {\n const tag = step.success ? \"DONE\" : \"FAILED\";\n const errorInfo =\n !step.success && step.error ? ` — Error: ${step.error}` : \"\";\n const category = step.failureCategory\n ? ` [${step.failureCategory}]`\n : \"\";\n const duration = step.durationMs !== undefined ? ` (${step.durationMs}ms)` : \"\";\n lines.push(\n `${step.ordinal + 1}. [${tag}] ${step.action.action}: ${step.action.description} (URL: ${step.url})${duration}${errorInfo}${category}`,\n );\n }\n lines.push(\"\");\n }\n\n // Interventions\n if (input.interventions.length > 0) {\n lines.push(\"## Interventions\");\n for (const iv of input.interventions) {\n lines.push(\n `- **Step ${iv.stepIndex}** (${iv.timestamp}): \"${iv.userInstruction}\" (URL: ${iv.url})`,\n );\n }\n lines.push(\"\");\n }\n\n // デバッグログ読み込み(System Insights と Debug Log セクションで共有)\n const debugEntries = input.debugLogPath ? await readDebugLog(input.debugLogPath) : [];\n\n // System Insights(共通モジュール利用)\n const reportableSteps = toReportableSteps(input.recordedSteps);\n const hasInsights =\n (input.aiMetrics && input.aiMetrics.totalCalls > 0) ||\n reportableSteps.some((s) => s.status === \"failed\") ||\n reportableSteps.some((s) => s.durationMs > 3000) ||\n debugEntries.length > 0;\n\n if (hasInsights) {\n lines.push(\"## System Insights\");\n lines.push(\"\");\n lines.push(\"> refrain の機能改善・バグ修正のための分析情報\");\n lines.push(\"\");\n\n lines.push(...formatRuntimeEnvironment());\n\n if (input.aiMetrics && input.aiMetrics.totalCalls > 0) {\n lines.push(...formatAiMetricsSection(input.aiMetrics));\n }\n\n const failedSteps = reportableSteps.filter((s) => s.status === \"failed\");\n lines.push(...formatFailureCategoryDistribution(failedSteps));\n lines.push(...formatPerformanceBottlenecks(reportableSteps));\n }\n\n // Debug Log(共通モジュール利用)\n lines.push(...formatDebugLogSections(debugEntries));\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,WAAW,aAAa;AACjC,SAAS,eAAe;;;ACPxB,SAAS,aAAa,qBAAqB;AAQ3C,eAAsB,YAAsC;AAC1D,gBAAc,UAAU;AACxB,QAAM,OAAO,WAAW;AAExB,QAAM,EAAE,OAAO,IAAI,cAAc;AAAA,IAC/B;AAAA,IACA,SAAS;AAAA,MACP,KAAK,EAAE,MAAM,SAAS;AAAA,MACtB,MAAM,EAAE,MAAM,SAAS;AAAA,MACvB,QAAQ,EAAE,MAAM,SAAS;AAAA,MACzB,aAAa,EAAE,MAAM,SAAS;AAAA,MAC9B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M,UAAU,OAAO,KAAK,CAAC,EAAE;AAC/E,MAAI,iBAAiB,SAAS,MAAM,OAAO;AACzC,YAAQ,MAAM,MAAM,KAAK;AAAA,EAC3B;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
ActionTypeSchema,
|
|
4
|
+
AggregateOperationSchema,
|
|
5
|
+
CaptureStrategySchema,
|
|
6
|
+
DataSourceConfigSchema,
|
|
7
|
+
LoopDefinitionSchema,
|
|
8
|
+
MemoryOperationSchema,
|
|
9
|
+
ParsedRunbookSchema,
|
|
10
|
+
ParsedStepSchema,
|
|
11
|
+
RiskLevelSchema,
|
|
12
|
+
SelectorSchema,
|
|
13
|
+
StepActionSchema,
|
|
14
|
+
StepCaptureSchema,
|
|
15
|
+
VariableDefinitionSchema,
|
|
16
|
+
VariableSourceSchema
|
|
17
|
+
} from "./chunk-RT664YIO.js";
|
|
18
|
+
import "./chunk-2H7UOFLK.js";
|
|
19
|
+
export {
|
|
20
|
+
ActionTypeSchema,
|
|
21
|
+
AggregateOperationSchema,
|
|
22
|
+
CaptureStrategySchema,
|
|
23
|
+
DataSourceConfigSchema,
|
|
24
|
+
LoopDefinitionSchema,
|
|
25
|
+
MemoryOperationSchema,
|
|
26
|
+
ParsedRunbookSchema,
|
|
27
|
+
ParsedStepSchema,
|
|
28
|
+
RiskLevelSchema,
|
|
29
|
+
SelectorSchema,
|
|
30
|
+
StepActionSchema,
|
|
31
|
+
StepCaptureSchema,
|
|
32
|
+
VariableDefinitionSchema,
|
|
33
|
+
VariableSourceSchema
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=runbook-schema-3T6TP3JJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
RunbookStore
|
|
4
|
+
} from "./chunk-WEYR56ZN.js";
|
|
5
|
+
import "./chunk-Z33FCOTZ.js";
|
|
6
|
+
import "./chunk-CLYJHKPY.js";
|
|
7
|
+
import "./chunk-2H7UOFLK.js";
|
|
8
|
+
export {
|
|
9
|
+
RunbookStore
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=runbook-store-G5GUOWRR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
account,
|
|
4
|
+
apiKeys,
|
|
5
|
+
dataMigrationHistory,
|
|
6
|
+
invitations,
|
|
7
|
+
jobAiMetrics,
|
|
8
|
+
jobApprovalRequests,
|
|
9
|
+
jobArtifacts,
|
|
10
|
+
jobDebugSuggestions,
|
|
11
|
+
jobDebugWarnings,
|
|
12
|
+
jobExecutionConfigs,
|
|
13
|
+
jobGenerateConfigs,
|
|
14
|
+
jobRecordedSteps,
|
|
15
|
+
jobResultDiagnostics,
|
|
16
|
+
jobResults,
|
|
17
|
+
jobReviewResults,
|
|
18
|
+
jobReviewedSteps,
|
|
19
|
+
jobVariables,
|
|
20
|
+
jobs,
|
|
21
|
+
runbookSecrets,
|
|
22
|
+
runbookSettings,
|
|
23
|
+
runbookSteps,
|
|
24
|
+
runbookVariables,
|
|
25
|
+
runbookVersionReviews,
|
|
26
|
+
runbookVersions,
|
|
27
|
+
runbooks,
|
|
28
|
+
schedules,
|
|
29
|
+
session,
|
|
30
|
+
telemetryFailureEvents,
|
|
31
|
+
telemetryFailurePatterns,
|
|
32
|
+
telemetryJobSummaries,
|
|
33
|
+
telemetryResolutionOutcomes,
|
|
34
|
+
telemetrySuggestionOutcomes,
|
|
35
|
+
tenantDevelopmentSettings,
|
|
36
|
+
tenantExecutionConfigs,
|
|
37
|
+
tenantExecutionSettings,
|
|
38
|
+
tenantMembers,
|
|
39
|
+
tenantModelOverrides,
|
|
40
|
+
tenantModelProviders,
|
|
41
|
+
tenantUsage,
|
|
42
|
+
tenants,
|
|
43
|
+
user,
|
|
44
|
+
verification
|
|
45
|
+
} from "./chunk-CLYJHKPY.js";
|
|
46
|
+
import "./chunk-2H7UOFLK.js";
|
|
47
|
+
export {
|
|
48
|
+
account,
|
|
49
|
+
apiKeys,
|
|
50
|
+
dataMigrationHistory,
|
|
51
|
+
invitations,
|
|
52
|
+
jobAiMetrics,
|
|
53
|
+
jobApprovalRequests,
|
|
54
|
+
jobArtifacts,
|
|
55
|
+
jobDebugSuggestions,
|
|
56
|
+
jobDebugWarnings,
|
|
57
|
+
jobExecutionConfigs,
|
|
58
|
+
jobGenerateConfigs,
|
|
59
|
+
jobRecordedSteps,
|
|
60
|
+
jobResultDiagnostics,
|
|
61
|
+
jobResults,
|
|
62
|
+
jobReviewResults,
|
|
63
|
+
jobReviewedSteps,
|
|
64
|
+
jobVariables,
|
|
65
|
+
jobs,
|
|
66
|
+
runbookSecrets,
|
|
67
|
+
runbookSettings,
|
|
68
|
+
runbookSteps,
|
|
69
|
+
runbookVariables,
|
|
70
|
+
runbookVersionReviews,
|
|
71
|
+
runbookVersions,
|
|
72
|
+
runbooks,
|
|
73
|
+
schedules,
|
|
74
|
+
session,
|
|
75
|
+
telemetryFailureEvents,
|
|
76
|
+
telemetryFailurePatterns,
|
|
77
|
+
telemetryJobSummaries,
|
|
78
|
+
telemetryResolutionOutcomes,
|
|
79
|
+
telemetrySuggestionOutcomes,
|
|
80
|
+
tenantDevelopmentSettings,
|
|
81
|
+
tenantExecutionConfigs,
|
|
82
|
+
tenantExecutionSettings,
|
|
83
|
+
tenantMembers,
|
|
84
|
+
tenantModelOverrides,
|
|
85
|
+
tenantModelProviders,
|
|
86
|
+
tenantUsage,
|
|
87
|
+
tenants,
|
|
88
|
+
user,
|
|
89
|
+
verification
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=schema-5G6UQSPT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|