@rulemetric/cli 0.6.9 → 0.7.0
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/base-command.js +4 -3
- package/dist/{chunk-SZ7VDCD6.js → chunk-2HK7RGZB.js} +22 -3
- package/dist/chunk-2HK7RGZB.js.map +7 -0
- package/dist/{chunk-RUCSRN7F.js → chunk-2ORJWTNZ.js} +2 -2
- package/dist/{chunk-SLL3OBKN.js → chunk-37LN5O7M.js} +2 -2
- package/dist/{chunk-RCMXTLQF.js → chunk-3LKVS6W5.js} +5 -5
- package/dist/{chunk-XN23W5HL.js → chunk-4KRMZLQV.js} +91 -7
- package/dist/chunk-4KRMZLQV.js.map +7 -0
- package/dist/{chunk-DAJNO4OI.js → chunk-4LYCDS2N.js} +28 -16
- package/dist/chunk-4LYCDS2N.js.map +7 -0
- package/dist/{chunk-UPXIO7CG.js → chunk-4XAWK6S2.js} +8 -8
- package/dist/{chunk-N5A2IQAK.js → chunk-4YAP7RT7.js} +5 -5
- package/dist/{chunk-QD6X4L4L.js → chunk-5BAOGNUH.js} +4 -4
- package/dist/chunk-5EDMGK3W.js +39 -0
- package/dist/chunk-5EDMGK3W.js.map +7 -0
- package/dist/{chunk-5ADHO5QF.js → chunk-6NBS5XFS.js} +6 -6
- package/dist/chunk-7LVVKQMZ.js +98 -0
- package/dist/chunk-7LVVKQMZ.js.map +7 -0
- package/dist/{chunk-PXVQLD7S.js → chunk-7NNFYWKK.js} +48 -1
- package/dist/chunk-7NNFYWKK.js.map +7 -0
- package/dist/{chunk-BBLTN35F.js → chunk-7UDETV3P.js} +49 -20
- package/dist/chunk-7UDETV3P.js.map +7 -0
- package/dist/{chunk-DTFXCHHI.js → chunk-DNKSVWMD.js} +4 -4
- package/dist/{chunk-6EMZI4Y3.js → chunk-EI5BHWXA.js} +437 -401
- package/dist/chunk-EI5BHWXA.js.map +7 -0
- package/dist/{chunk-HNZLEEG2.js → chunk-EJ3YAFDP.js} +4 -4
- package/dist/{chunk-HNZLEEG2.js.map → chunk-EJ3YAFDP.js.map} +2 -2
- package/dist/{chunk-YSEQWCN4.js → chunk-EYPAAGN5.js} +2 -2
- package/dist/{chunk-JEJ3J5J6.js → chunk-GIUBARWS.js} +2 -2
- package/dist/chunk-GQNJO2P2.js +102 -0
- package/dist/chunk-GQNJO2P2.js.map +7 -0
- package/dist/{chunk-CNMWYYSV.js → chunk-HZK43UCF.js} +6 -6
- package/dist/chunk-ILYDELUE.js +46 -0
- package/dist/chunk-ILYDELUE.js.map +7 -0
- package/dist/chunk-J6QFW4LD.js +55 -0
- package/dist/chunk-J6QFW4LD.js.map +7 -0
- package/dist/{chunk-OTOWLUOJ.js → chunk-JULOLTZS.js} +2 -2
- package/dist/{chunk-DR5WLIOU.js → chunk-KJKBDQ4D.js} +2 -2
- package/dist/{chunk-AHDRN6NE.js → chunk-OO7JDFS4.js} +5 -5
- package/dist/{chunk-N2X35ITW.js → chunk-OQBBVTDG.js} +11 -1
- package/dist/{chunk-N2X35ITW.js.map → chunk-OQBBVTDG.js.map} +2 -2
- package/dist/{chunk-3QH73QOQ.js → chunk-PED7L5GX.js} +2 -2
- package/dist/{chunk-VBGUNFKY.js → chunk-PMI56ED5.js} +5 -5
- package/dist/{chunk-XNNOXGP6.js → chunk-POFTPB33.js} +38 -19
- package/dist/chunk-POFTPB33.js.map +7 -0
- package/dist/{chunk-W4MZXKZ2.js → chunk-UKMLICWS.js} +2 -2
- package/dist/{chunk-3POYC5NA.js → chunk-XK42ZBDE.js} +3 -3
- package/dist/{chunk-ZSGKRCKD.js → chunk-XUV6DDBF.js} +2 -2
- package/dist/{chunk-LAKZUE35.js → chunk-Y3WD5CSW.js} +2 -2
- package/dist/{chunk-3QVMIJUL.js → chunk-YOBA3NAM.js} +5 -5
- package/dist/{chunk-ZRLYHBPN.js → chunk-ZUJBM6HE.js} +20 -2
- package/dist/chunk-ZUJBM6HE.js.map +7 -0
- package/dist/commands/antigravity/backfill.js +5 -4
- package/dist/commands/antigravity/backfill.js.map +1 -1
- package/dist/commands/auth/create-key.js +4 -3
- package/dist/commands/auth/create-key.js.map +1 -1
- package/dist/commands/auth/login.js +13 -9
- package/dist/commands/auth/login.js.map +2 -2
- package/dist/commands/auth/logout.js +4 -3
- package/dist/commands/auth/logout.js.map +1 -1
- package/dist/commands/auth/revoke-key.js +4 -3
- package/dist/commands/auth/revoke-key.js.map +1 -1
- package/dist/commands/auth/signup.js +13 -9
- package/dist/commands/auth/signup.js.map +2 -2
- package/dist/commands/auth/status.js +4 -3
- package/dist/commands/auth/status.js.map +1 -1
- package/dist/commands/catalog/index.js +4 -3
- package/dist/commands/catalog/index.js.map +1 -1
- package/dist/commands/catalog/recommend.js +4 -3
- package/dist/commands/catalog/recommend.js.map +1 -1
- package/dist/commands/convert.js +4 -3
- package/dist/commands/convert.js.map +1 -1
- package/dist/commands/converters.js +4 -3
- package/dist/commands/converters.js.map +1 -1
- package/dist/commands/crons/list.js +4 -3
- package/dist/commands/crons/list.js.map +1 -1
- package/dist/commands/crons/run.js +4 -3
- package/dist/commands/crons/run.js.map +1 -1
- package/dist/commands/dashboard.js +4 -3
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/diagnostics.js +117 -0
- package/dist/commands/diagnostics.js.map +7 -0
- package/dist/commands/eval-targets/create.js +4 -3
- package/dist/commands/eval-targets/create.js.map +1 -1
- package/dist/commands/eval-targets/list.js +4 -3
- package/dist/commands/eval-targets/list.js.map +1 -1
- package/dist/commands/evals/agent.js +44 -23
- package/dist/commands/evals/agent.js.map +2 -2
- package/dist/commands/evals/benchmark.js +5 -4
- package/dist/commands/evals/benchmark.js.map +1 -1
- package/dist/commands/evals/compare.js +4 -3
- package/dist/commands/evals/compare.js.map +1 -1
- package/dist/commands/evals/create.js +4 -3
- package/dist/commands/evals/create.js.map +1 -1
- package/dist/commands/evals/optimize-description.js +4 -3
- package/dist/commands/evals/optimize-description.js.map +1 -1
- package/dist/commands/evals/optimize.js +4 -3
- package/dist/commands/evals/optimize.js.map +1 -1
- package/dist/commands/evals/run.js +4 -3
- package/dist/commands/evals/run.js.map +1 -1
- package/dist/commands/gateway/ensure.js +58 -5
- package/dist/commands/gateway/ensure.js.map +2 -2
- package/dist/commands/hooks/install.js +76 -23
- package/dist/commands/hooks/install.js.map +2 -2
- package/dist/commands/hooks/run.js +4 -3
- package/dist/commands/hooks/run.js.map +1 -1
- package/dist/commands/hooks/uninstall.js +31 -40
- package/dist/commands/hooks/uninstall.js.map +2 -2
- package/dist/commands/import.js +4 -3
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/instructions/create.js +4 -3
- package/dist/commands/instructions/create.js.map +1 -1
- package/dist/commands/instructions/delete.js +4 -3
- package/dist/commands/instructions/delete.js.map +1 -1
- package/dist/commands/instructions/fork.js +4 -3
- package/dist/commands/instructions/fork.js.map +1 -1
- package/dist/commands/instructions/get.js +4 -3
- package/dist/commands/instructions/get.js.map +1 -1
- package/dist/commands/instructions/list.js +4 -3
- package/dist/commands/instructions/list.js.map +1 -1
- package/dist/commands/instructions/promote.js +4 -3
- package/dist/commands/instructions/promote.js.map +1 -1
- package/dist/commands/instructions/pull.js +4 -3
- package/dist/commands/instructions/pull.js.map +1 -1
- package/dist/commands/instructions/upstream.js +4 -3
- package/dist/commands/instructions/upstream.js.map +1 -1
- package/dist/commands/instructions/versions.js +4 -3
- package/dist/commands/instructions/versions.js.map +1 -1
- package/dist/commands/launcher.js +4 -3
- package/dist/commands/launcher.js.map +1 -1
- package/dist/commands/org/current.js +4 -3
- package/dist/commands/org/current.js.map +1 -1
- package/dist/commands/org/list.js +4 -3
- package/dist/commands/org/list.js.map +1 -1
- package/dist/commands/org/switch.js +4 -3
- package/dist/commands/org/switch.js.map +1 -1
- package/dist/commands/packs/add-instruction.js +4 -3
- package/dist/commands/packs/add-instruction.js.map +1 -1
- package/dist/commands/packs/apply.js +4 -3
- package/dist/commands/packs/apply.js.map +1 -1
- package/dist/commands/packs/create.js +4 -3
- package/dist/commands/packs/create.js.map +1 -1
- package/dist/commands/packs/fork.js +4 -3
- package/dist/commands/packs/fork.js.map +1 -1
- package/dist/commands/packs/get.js +4 -3
- package/dist/commands/packs/get.js.map +1 -1
- package/dist/commands/packs/list.js +4 -3
- package/dist/commands/packs/list.js.map +1 -1
- package/dist/commands/packs/remove-instruction.js +4 -3
- package/dist/commands/packs/remove-instruction.js.map +1 -1
- package/dist/commands/proxy/env.js +7 -4
- package/dist/commands/proxy/env.js.map +1 -1
- package/dist/commands/proxy/logs.js +4 -3
- package/dist/commands/proxy/logs.js.map +1 -1
- package/dist/commands/proxy/restart.js +4 -3
- package/dist/commands/proxy/restart.js.map +1 -1
- package/dist/commands/proxy/setup.js +20 -14
- package/dist/commands/proxy/setup.js.map +2 -2
- package/dist/commands/proxy/start.js +18 -14
- package/dist/commands/proxy/start.js.map +2 -2
- package/dist/commands/proxy/status.js +16 -13
- package/dist/commands/proxy/status.js.map +2 -2
- package/dist/commands/proxy/stop.js +21 -12
- package/dist/commands/proxy/stop.js.map +2 -2
- package/dist/commands/research/backfill.js +5 -4
- package/dist/commands/research/backfill.js.map +1 -1
- package/dist/commands/research/tail-transcript.js +5 -4
- package/dist/commands/research/tail-transcript.js.map +1 -1
- package/dist/commands/service/install.js +6 -6
- package/dist/commands/service/status.js +4 -3
- package/dist/commands/service/status.js.map +1 -1
- package/dist/commands/service/uninstall.js +4 -3
- package/dist/commands/service/uninstall.js.map +1 -1
- package/dist/commands/sessions/analyze.js +4 -3
- package/dist/commands/sessions/analyze.js.map +1 -1
- package/dist/commands/sessions/end.js +4 -3
- package/dist/commands/sessions/end.js.map +1 -1
- package/dist/commands/sessions/import.js +4 -3
- package/dist/commands/sessions/import.js.map +1 -1
- package/dist/commands/sessions/list.js +4 -3
- package/dist/commands/sessions/list.js.map +1 -1
- package/dist/commands/sessions/start.js +4 -3
- package/dist/commands/sessions/start.js.map +1 -1
- package/dist/commands/setup.js +10 -6
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skills/export-approved.js +4 -3
- package/dist/commands/skills/export-approved.js.map +1 -1
- package/dist/commands/skills/install.js +4 -3
- package/dist/commands/skills/install.js.map +1 -1
- package/dist/commands/skills/list.js +4 -3
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/publish.js +4 -3
- package/dist/commands/skills/publish.js.map +1 -1
- package/dist/commands/skills/search.js +4 -3
- package/dist/commands/skills/search.js.map +1 -1
- package/dist/commands/skills/update.js +4 -3
- package/dist/commands/skills/update.js.map +1 -1
- package/dist/commands/suggestions/accept.js +4 -3
- package/dist/commands/suggestions/accept.js.map +1 -1
- package/dist/commands/suggestions/dismiss.js +4 -3
- package/dist/commands/suggestions/dismiss.js.map +1 -1
- package/dist/commands/suggestions/list.js +4 -3
- package/dist/commands/suggestions/list.js.map +1 -1
- package/dist/commands/suggestions/refresh.js +4 -3
- package/dist/commands/suggestions/refresh.js.map +1 -1
- package/dist/dashboard/Dashboard.js +16 -16
- package/dist/dashboard/data.js +2 -2
- package/dist/dashboard/launcher/ActiveJobsList.js +2 -2
- package/dist/dashboard/launcher/LauncherOverlay.js +7 -7
- package/dist/dashboard/launcher/NewLaunchForm.js +2 -2
- package/dist/dashboard/launcher/api.js +2 -2
- package/dist/dashboard/launcher/useLaunchJobs.js +3 -3
- package/dist/lib/active-org-refresh.js +2 -2
- package/dist/lib/agent-loop.js +20 -18
- package/dist/lib/antigravity-transcript.js +2 -2
- package/dist/lib/api-client.js +1 -1
- package/dist/lib/diagnostics.js +12 -0
- package/dist/lib/diagnostics.js.map +7 -0
- package/dist/lib/ensure-api-key.js +3 -3
- package/dist/lib/eval-benchmark.js +2 -2
- package/dist/lib/eval-conversation-handler.js +2 -2
- package/dist/lib/gateway-entry.js +39 -1
- package/dist/lib/gateway-entry.js.map +2 -2
- package/dist/lib/gateway-identity.js +16 -0
- package/dist/lib/gateway-identity.js.map +7 -0
- package/dist/lib/gateway-lifecycle.js +9 -3
- package/dist/lib/gateway.js +3 -1
- package/dist/lib/handlers/cron-suggest-instructions.js +3 -3
- package/dist/lib/handlers/process-announcement.js +3 -3
- package/dist/lib/handlers/process-changelog.js +3 -3
- package/dist/lib/handlers/process-conversation.js +3 -3
- package/dist/lib/handlers/process-eval.js +3 -3
- package/dist/lib/handlers/process-insights.js +3 -3
- package/dist/lib/handlers/process-launch.js +2 -2
- package/dist/lib/handlers/process-run-cleanup.js +2 -2
- package/dist/lib/handlers/process-session-goal.js +2 -2
- package/dist/lib/hooks-config.js +14 -1
- package/dist/lib/manual-tasks.js +6 -6
- package/dist/lib/pid-identity.js +14 -0
- package/dist/lib/pid-identity.js.map +7 -0
- package/dist/lib/proxy-respawn.js +12 -0
- package/dist/lib/proxy-respawn.js.map +7 -0
- package/dist/lib/research-client.js +2 -2
- package/dist/lib/setup-steps.js +7 -4
- package/dist/lib/statusline-shim.js +3 -1
- package/dist/lib/telemetry.js +4 -2
- package/dist/lib/terminal-target-heartbeat.js +2 -2
- package/oclif.manifest.json +34 -1
- package/package.json +6 -6
- package/dist/chunk-6EMZI4Y3.js.map +0 -7
- package/dist/chunk-BBLTN35F.js.map +0 -7
- package/dist/chunk-DAJNO4OI.js.map +0 -7
- package/dist/chunk-PXVQLD7S.js.map +0 -7
- package/dist/chunk-SZ7VDCD6.js.map +0 -7
- package/dist/chunk-TX2HKJLA.js +0 -55
- package/dist/chunk-TX2HKJLA.js.map +0 -7
- package/dist/chunk-XN23W5HL.js.map +0 -7
- package/dist/chunk-XNNOXGP6.js.map +0 -7
- package/dist/chunk-ZRLYHBPN.js.map +0 -7
- /package/dist/{chunk-RUCSRN7F.js.map → chunk-2ORJWTNZ.js.map} +0 -0
- /package/dist/{chunk-SLL3OBKN.js.map → chunk-37LN5O7M.js.map} +0 -0
- /package/dist/{chunk-RCMXTLQF.js.map → chunk-3LKVS6W5.js.map} +0 -0
- /package/dist/{chunk-UPXIO7CG.js.map → chunk-4XAWK6S2.js.map} +0 -0
- /package/dist/{chunk-N5A2IQAK.js.map → chunk-4YAP7RT7.js.map} +0 -0
- /package/dist/{chunk-QD6X4L4L.js.map → chunk-5BAOGNUH.js.map} +0 -0
- /package/dist/{chunk-5ADHO5QF.js.map → chunk-6NBS5XFS.js.map} +0 -0
- /package/dist/{chunk-DTFXCHHI.js.map → chunk-DNKSVWMD.js.map} +0 -0
- /package/dist/{chunk-YSEQWCN4.js.map → chunk-EYPAAGN5.js.map} +0 -0
- /package/dist/{chunk-JEJ3J5J6.js.map → chunk-GIUBARWS.js.map} +0 -0
- /package/dist/{chunk-CNMWYYSV.js.map → chunk-HZK43UCF.js.map} +0 -0
- /package/dist/{chunk-OTOWLUOJ.js.map → chunk-JULOLTZS.js.map} +0 -0
- /package/dist/{chunk-DR5WLIOU.js.map → chunk-KJKBDQ4D.js.map} +0 -0
- /package/dist/{chunk-AHDRN6NE.js.map → chunk-OO7JDFS4.js.map} +0 -0
- /package/dist/{chunk-3QH73QOQ.js.map → chunk-PED7L5GX.js.map} +0 -0
- /package/dist/{chunk-VBGUNFKY.js.map → chunk-PMI56ED5.js.map} +0 -0
- /package/dist/{chunk-W4MZXKZ2.js.map → chunk-UKMLICWS.js.map} +0 -0
- /package/dist/{chunk-3POYC5NA.js.map → chunk-XK42ZBDE.js.map} +0 -0
- /package/dist/{chunk-ZSGKRCKD.js.map → chunk-XUV6DDBF.js.map} +0 -0
- /package/dist/{chunk-LAKZUE35.js.map → chunk-Y3WD5CSW.js.map} +0 -0
- /package/dist/{chunk-3QVMIJUL.js.map → chunk-YOBA3NAM.js.map} +0 -0
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/skills/publish.ts"],
|
|
4
4
|
"sourcesContent": ["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { Args, Flags } from '@oclif/core';\nimport { BaseCommand } from '../../base-command.js';\nimport { apiPost } from '../../lib/api-client.js';\n\nexport default class SkillsPublish extends BaseCommand {\n static override description = 'Submit a skill file to the RuleMetric skills registry';\n\n static override examples = [\n '<%= config.bin %> skills publish ./my-skill.md',\n '<%= config.bin %> skills publish ./my-skill.md --category workflow --tool claude_code',\n ];\n\n static override args = {\n file: Args.string({ description: 'Path to skill file (.md)', required: true }),\n };\n\n static override flags = {\n name: Flags.string({ description: 'Skill name (defaults to filename)' }),\n description: Flags.string({ description: 'One-line description' }),\n category: Flags.string({\n description: 'Skill category',\n options: [\n 'workflow', 'language', 'framework', 'tool', 'security',\n 'testing', 'architecture', 'devops', 'documentation',\n 'performance', 'other',\n ],\n default: 'other',\n }),\n tool: Flags.string({\n description: 'Primary tool this skill targets',\n options: ['claude_code', 'cursor', 'copilot', 'windsurf', 'universal'],\n default: 'universal',\n }),\n tags: Flags.string({ description: 'Comma-separated tags', default: '' }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(SkillsPublish);\n this.requireAuth();\n\n const filePath = path.resolve(args.file);\n if (!fs.existsSync(filePath)) {\n this.error(`File not found: ${filePath}`);\n }\n\n const content = fs.readFileSync(filePath, 'utf-8');\n if (content.trim().length < 20) {\n this.error('Skill content is too short (minimum 20 characters)');\n }\n\n const basename = path.basename(filePath, path.extname(filePath));\n const name = flags.name ?? basename\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, c => c.toUpperCase());\n\n const id = basename.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');\n\n const tags = flags.tags\n ? flags.tags.split(',').map(t => t.trim()).filter(Boolean)\n : [];\n\n this.log(`Publishing skill: ${name} (${id})`);\n this.log(` Category: ${flags.category}`);\n this.log(` Tool: ${flags.tool}`);\n if (tags.length > 0) this.log(` Tags: ${tags.join(', ')}`);\n this.log(` Content: ${content.length} characters\\n`);\n\n const payload = {\n id,\n name,\n description: flags.description ?? `Community skill: ${name}`,\n category: flags.category,\n tools: [flags.tool],\n tags,\n content,\n };\n\n try {\n const result = await apiPost<{ id: string; message: string }>('/api/skills/publish', payload);\n this.log(`Published! ${result.message ?? `Skill \"${name}\" submitted to the registry.`}`);\n } catch (err) {\n if (err instanceof Error) {\n this.error(`Failed to publish: ${err.message}`);\n }\n throw err;\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,MAAM,aAAa;AAI5B,IAAqB,gBAArB,MAAqB,uBAAsB,YAAY;AAAA,EACrD,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAgB,OAAO;AAAA,IACrB,MAAM,KAAK,OAAO,EAAE,aAAa,4BAA4B,UAAU,KAAK,CAAC;AAAA,EAC/E;AAAA,EAEA,OAAgB,QAAQ;AAAA,IACtB,MAAM,MAAM,OAAO,EAAE,aAAa,oCAAoC,CAAC;AAAA,IACvE,aAAa,MAAM,OAAO,EAAE,aAAa,uBAAuB,CAAC;AAAA,IACjE,UAAU,MAAM,OAAO;AAAA,MACrB,aAAa;AAAA,MACb,SAAS;AAAA,QACP;AAAA,QAAY;AAAA,QAAY;AAAA,QAAa;AAAA,QAAQ;AAAA,QAC7C;AAAA,QAAW;AAAA,QAAgB;AAAA,QAAU;AAAA,QACrC;AAAA,QAAe;AAAA,MACjB;AAAA,MACA,SAAS;AAAA,IACX,CAAC;AAAA,IACD,MAAM,MAAM,OAAO;AAAA,MACjB,aAAa;AAAA,MACb,SAAS,CAAC,eAAe,UAAU,WAAW,YAAY,WAAW;AAAA,MACrE,SAAS;AAAA,IACX,CAAC;AAAA,IACD,MAAM,MAAM,OAAO,EAAE,aAAa,wBAAwB,SAAS,GAAG,CAAC;AAAA,EACzE;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,MAAM,IAAI,MAAM,KAAK,MAAM,cAAa;AACtD,SAAK,YAAY;AAEjB,UAAM,WAAgB,aAAQ,KAAK,IAAI;AACvC,QAAI,CAAI,cAAW,QAAQ,GAAG;AAC5B,WAAK,MAAM,mBAAmB,QAAQ,EAAE;AAAA,IAC1C;AAEA,UAAM,UAAa,gBAAa,UAAU,OAAO;AACjD,QAAI,QAAQ,KAAK,EAAE,SAAS,IAAI;AAC9B,WAAK,MAAM,oDAAoD;AAAA,IACjE;AAEA,UAAMA,YAAgB,cAAS,UAAe,aAAQ,QAAQ,CAAC;AAC/D,UAAM,OAAO,MAAM,QAAQA,UACxB,QAAQ,UAAU,GAAG,EACrB,QAAQ,SAAS,OAAK,EAAE,YAAY,CAAC;AAExC,UAAM,KAAKA,UAAS,YAAY,EAAE,QAAQ,eAAe,GAAG,EAAE,QAAQ,UAAU,EAAE;AAElF,UAAM,OAAO,MAAM,OACf,MAAM,KAAK,MAAM,GAAG,EAAE,IAAI,OAAK,EAAE,KAAK,CAAC,EAAE,OAAO,OAAO,IACvD,CAAC;AAEL,SAAK,IAAI,qBAAqB,IAAI,KAAK,EAAE,GAAG;AAC5C,SAAK,IAAI,eAAe,MAAM,QAAQ,EAAE;AACxC,SAAK,IAAI,WAAW,MAAM,IAAI,EAAE;AAChC,QAAI,KAAK,SAAS,EAAG,MAAK,IAAI,WAAW,KAAK,KAAK,IAAI,CAAC,EAAE;AAC1D,SAAK,IAAI,cAAc,QAAQ,MAAM;AAAA,CAAe;AAEpD,UAAM,UAAU;AAAA,MACd;AAAA,MACA;AAAA,MACA,aAAa,MAAM,eAAe,oBAAoB,IAAI;AAAA,MAC1D,UAAU,MAAM;AAAA,MAChB,OAAO,CAAC,MAAM,IAAI;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAEA,QAAI;AACF,YAAM,SAAS,MAAM,QAAyC,uBAAuB,OAAO;AAC5F,WAAK,IAAI,cAAc,OAAO,WAAW,UAAU,IAAI,8BAA8B,EAAE;AAAA,IACzF,SAAS,KAAK;AACZ,UAAI,eAAe,OAAO;AACxB,aAAK,MAAM,sBAAsB,IAAI,OAAO,EAAE;AAAA,MAChD;AACA,YAAM;AAAA,IACR;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["basename"]
|
|
7
7
|
}
|
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
} from "../../chunk-4BHDHHKL.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-2HK7RGZB.js";
|
|
7
7
|
import "../../chunk-R56PH7YE.js";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-GQNJO2P2.js";
|
|
9
|
+
import "../../chunk-37LN5O7M.js";
|
|
9
10
|
import "../../chunk-EKJ2CABV.js";
|
|
10
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-ZUJBM6HE.js";
|
|
11
12
|
import "../../chunk-W2YERO7E.js";
|
|
12
13
|
import "../../chunk-NSBPE2FW.js";
|
|
13
14
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/skills/search.ts"],
|
|
4
4
|
"sourcesContent": ["import { Args, Flags } from '@oclif/core';\nimport { BaseCommand } from '../../base-command.js';\nimport { loadRegistry } from '../../lib/skills-loader.js';\nimport type { SkillCategory, ToolId } from '@rulemetric/skills-registry';\n\nexport default class SkillsSearch extends BaseCommand {\n static override description = 'Search the community skills registry';\n\n static override examples = [\n '<%= config.bin %> skills search \"tdd\"',\n '<%= config.bin %> skills search --tool cursor --category testing',\n '<%= config.bin %> skills search --language python',\n ];\n\n static override args = {\n query: Args.string({ description: 'Search term', required: false }),\n };\n\n static override flags = {\n tool: Flags.string({ description: 'Filter by tool', options: ['claude_code', 'cursor', 'copilot', 'windsurf', 'cline', 'universal'] }),\n category: Flags.string({ description: 'Filter by category', options: ['workflow', 'language', 'framework', 'tool', 'security', 'testing', 'architecture', 'devops', 'documentation', 'performance'] }),\n language: Flags.string({ description: 'Filter by programming language' }),\n framework: Flags.string({ description: 'Filter by framework' }),\n limit: Flags.integer({ description: 'Max results', default: 20 }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(SkillsSearch);\n\n const catalog = await loadRegistry(this);\n\n const results = catalog.search({\n query: args.query,\n tool: flags.tool as ToolId | undefined,\n category: flags.category as SkillCategory | undefined,\n language: flags.language,\n limit: flags.limit,\n });\n\n if (results.length === 0) {\n this.log('No skills found matching your criteria.');\n this.log('\\nTry a broader search or run: rulemetric skills list');\n return;\n }\n\n this.log(`Found ${results.length} skill${results.length === 1 ? '' : 's'}:\\n`);\n\n for (const skill of results) {\n const stars = skill.popularity?.stars ? ` (${formatStars(skill.popularity.stars)} stars)` : '';\n const tools = skill.tools.join(', ');\n this.log(` ${skill.id}`);\n this.log(` ${skill.name} \u2014 ${skill.description}`);\n this.log(` tools: ${tools} category: ${skill.category}${stars}`);\n if (skill.tags.length > 0) {\n this.log(` tags: ${skill.tags.join(', ')}`);\n }\n this.log('');\n }\n\n this.log(`Run: rulemetric skills install <id> to install a skill`);\n }\n}\n\nfunction formatStars(n: number): string {\n if (n >= 1000) return `${(n / 1000).toFixed(1)}k`;\n return String(n);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA,SAAS,MAAM,aAAa;AAK5B,IAAqB,eAArB,MAAqB,sBAAqB,YAAY;AAAA,EACpD,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAgB,OAAO;AAAA,IACrB,OAAO,KAAK,OAAO,EAAE,aAAa,eAAe,UAAU,MAAM,CAAC;AAAA,EACpE;AAAA,EAEA,OAAgB,QAAQ;AAAA,IACtB,MAAM,MAAM,OAAO,EAAE,aAAa,kBAAkB,SAAS,CAAC,eAAe,UAAU,WAAW,YAAY,SAAS,WAAW,EAAE,CAAC;AAAA,IACrI,UAAU,MAAM,OAAO,EAAE,aAAa,sBAAsB,SAAS,CAAC,YAAY,YAAY,aAAa,QAAQ,YAAY,WAAW,gBAAgB,UAAU,iBAAiB,aAAa,EAAE,CAAC;AAAA,IACrM,UAAU,MAAM,OAAO,EAAE,aAAa,iCAAiC,CAAC;AAAA,IACxE,WAAW,MAAM,OAAO,EAAE,aAAa,sBAAsB,CAAC;AAAA,IAC9D,OAAO,MAAM,QAAQ,EAAE,aAAa,eAAe,SAAS,GAAG,CAAC;AAAA,EAClE;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,MAAM,IAAI,MAAM,KAAK,MAAM,aAAY;AAErD,UAAM,UAAU,MAAM,aAAa,IAAI;AAEvC,UAAM,UAAU,QAAQ,OAAO;AAAA,MAC7B,OAAO,KAAK;AAAA,MACZ,MAAM,MAAM;AAAA,MACZ,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,MAChB,OAAO,MAAM;AAAA,IACf,CAAC;AAED,QAAI,QAAQ,WAAW,GAAG;AACxB,WAAK,IAAI,yCAAyC;AAClD,WAAK,IAAI,uDAAuD;AAChE;AAAA,IACF;AAEA,SAAK,IAAI,SAAS,QAAQ,MAAM,SAAS,QAAQ,WAAW,IAAI,KAAK,GAAG;AAAA,CAAK;AAE7E,eAAW,SAAS,SAAS;AAC3B,YAAM,QAAQ,MAAM,YAAY,QAAQ,KAAK,YAAY,MAAM,WAAW,KAAK,CAAC,YAAY;AAC5F,YAAM,QAAQ,MAAM,MAAM,KAAK,IAAI;AACnC,WAAK,IAAI,KAAK,MAAM,EAAE,EAAE;AACxB,WAAK,IAAI,OAAO,MAAM,IAAI,WAAM,MAAM,WAAW,EAAE;AACnD,WAAK,IAAI,cAAc,KAAK,eAAe,MAAM,QAAQ,GAAG,KAAK,EAAE;AACnE,UAAI,MAAM,KAAK,SAAS,GAAG;AACzB,aAAK,IAAI,aAAa,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE;AAAA,MAC/C;AACA,WAAK,IAAI,EAAE;AAAA,IACb;AAEA,SAAK,IAAI,wDAAwD;AAAA,EACnE;AACF;AAEA,SAAS,YAAY,GAAmB;AACtC,MAAI,KAAK,IAAM,QAAO,IAAI,IAAI,KAAM,QAAQ,CAAC,CAAC;AAC9C,SAAO,OAAO,CAAC;AACjB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-2HK7RGZB.js";
|
|
4
4
|
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-GQNJO2P2.js";
|
|
6
|
+
import "../../chunk-37LN5O7M.js";
|
|
6
7
|
import "../../chunk-EKJ2CABV.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-ZUJBM6HE.js";
|
|
8
9
|
import "../../chunk-W2YERO7E.js";
|
|
9
10
|
import "../../chunk-NSBPE2FW.js";
|
|
10
11
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/skills/update.ts"],
|
|
4
4
|
"sourcesContent": ["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as os from 'node:os';\nimport { Flags } from '@oclif/core';\nimport { BaseCommand } from '../../base-command.js';\nimport { fetchAllSources, TIER_1_SOURCES, TIER_2_SOURCES } from '@rulemetric/skills-registry';\nimport type { SkillRegistry } from '@rulemetric/skills-registry';\n\nconst CACHE_DIR = path.join(os.homedir(), '.config', 'rulemetric');\nconst REGISTRY_PATH = path.join(CACHE_DIR, 'skills-registry.json');\n\nexport default class SkillsUpdate extends BaseCommand {\n static override description = 'Fetch latest skills from GitHub sources and update local registry';\n\n static override examples = [\n '<%= config.bin %> skills update',\n '<%= config.bin %> skills update --all',\n ];\n\n static override flags = {\n all: Flags.boolean({ description: 'Include Tier 2 (niche) sources', default: false }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(SkillsUpdate);\n\n const sources = flags.all\n ? [...TIER_1_SOURCES, ...TIER_2_SOURCES]\n : TIER_1_SOURCES;\n\n this.log(`Fetching skills from ${sources.length} sources${flags.all ? ' (Tier 1 + 2)' : ''}...\\n`);\n\n const result = await fetchAllSources(sources, {\n onProgress: (source, count) => {\n this.log(` ${source}: ${count} skills`);\n },\n });\n\n const registry: SkillRegistry = {\n version: '1.0.0',\n generatedAt: new Date().toISOString(),\n skills: result.entries,\n };\n\n if (!fs.existsSync(CACHE_DIR)) {\n fs.mkdirSync(CACHE_DIR, { recursive: true });\n }\n\n fs.writeFileSync(REGISTRY_PATH, JSON.stringify(registry));\n this.log(`\\nUpdated registry: ${result.entries.length} skills cached at ${REGISTRY_PATH}`);\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,QAAQ;AACpB,SAAS,aAAa;AAEtB,SAAS,iBAAiB,gBAAgB,sBAAsB;AAGhE,IAAM,YAAiB,UAAQ,WAAQ,GAAG,WAAW,YAAY;AACjE,IAAM,gBAAqB,UAAK,WAAW,sBAAsB;AAEjE,IAAqB,eAArB,MAAqB,sBAAqB,YAAY;AAAA,EACpD,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAgB,QAAQ;AAAA,IACtB,KAAK,MAAM,QAAQ,EAAE,aAAa,kCAAkC,SAAS,MAAM,CAAC;AAAA,EACtF;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,aAAY;AAE/C,UAAM,UAAU,MAAM,MAClB,CAAC,GAAG,gBAAgB,GAAG,cAAc,IACrC;AAEJ,SAAK,IAAI,wBAAwB,QAAQ,MAAM,WAAW,MAAM,MAAM,kBAAkB,EAAE;AAAA,CAAO;AAEjG,UAAM,SAAS,MAAM,gBAAgB,SAAS;AAAA,MAC5C,YAAY,CAAC,QAAQ,UAAU;AAC7B,aAAK,IAAI,KAAK,MAAM,KAAK,KAAK,SAAS;AAAA,MACzC;AAAA,IACF,CAAC;AAED,UAAM,WAA0B;AAAA,MAC9B,SAAS;AAAA,MACT,cAAa,oBAAI,KAAK,GAAE,YAAY;AAAA,MACpC,QAAQ,OAAO;AAAA,IACjB;AAEA,QAAI,CAAI,cAAW,SAAS,GAAG;AAC7B,MAAG,aAAU,WAAW,EAAE,WAAW,KAAK,CAAC;AAAA,IAC7C;AAEA,IAAG,iBAAc,eAAe,KAAK,UAAU,QAAQ,CAAC;AACxD,SAAK,IAAI;AAAA,oBAAuB,OAAO,QAAQ,MAAM,qBAAqB,aAAa,EAAE;AAAA,EAC3F;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,14 +6,15 @@ import {
|
|
|
6
6
|
} from "../../chunk-7NYKWN7U.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseCommand
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-2HK7RGZB.js";
|
|
10
10
|
import "../../chunk-R56PH7YE.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-GQNJO2P2.js";
|
|
12
|
+
import "../../chunk-37LN5O7M.js";
|
|
12
13
|
import "../../chunk-EKJ2CABV.js";
|
|
13
14
|
import {
|
|
14
15
|
apiGet,
|
|
15
16
|
apiPost
|
|
16
|
-
} from "../../chunk-
|
|
17
|
+
} from "../../chunk-ZUJBM6HE.js";
|
|
17
18
|
import "../../chunk-W2YERO7E.js";
|
|
18
19
|
import "../../chunk-NSBPE2FW.js";
|
|
19
20
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/suggestions/accept.ts"],
|
|
4
4
|
"sourcesContent": ["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { Args } from '@oclif/core';\nimport { normalizeProjectPath } from '@rulemetric/core/paths';\nimport { BaseCommand } from '../../base-command.js';\nimport { apiGet, apiPost } from '../../lib/api-client.js';\nimport { validateUuid } from '../../lib/types.js';\nimport type { Instruction } from '../../lib/types.js';\n\ninterface SuggestionDetail {\n id: string;\n instructionId: string;\n instructionScope: string;\n score: number;\n reason: string;\n name: string;\n}\n\ninterface PromoteResponse {\n instructionId: string;\n alreadyExisted: boolean;\n}\n\n/**\n * Append an instruction block to CLAUDE.md in the given directory. Idempotent:\n * skips if a block with the same instructionId already exists. Returns true if\n * the file was modified, false if the block was already present.\n */\nexport function appendToCLAUDEmd(dir: string, instructionId: string, content: string): boolean {\n const filePath = path.join(dir, 'CLAUDE.md');\n const startTag = `<!-- rulemetric:start ${instructionId} -->`;\n const endTag = `<!-- rulemetric:end ${instructionId} -->`;\n\n const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : '';\n\n if (existing.includes(startTag)) {\n return false;\n }\n\n const separator = existing.length > 0 && !existing.endsWith('\\n')\n ? '\\n\\n'\n : existing.length > 0 ? '\\n' : '';\n const block = `${separator}\\n${startTag}\\n${content}\\n${endTag}\\n`;\n\n fs.writeFileSync(filePath, existing + block, 'utf8');\n return true;\n}\n\nexport default class SuggestionsAccept extends BaseCommand {\n static override description = 'Accept a suggestion and append the instruction to CLAUDE.md';\n\n static override examples = [\n '<%= config.bin %> suggestions accept <id>',\n ];\n\n static override args = {\n id: Args.string({ description: 'Suggestion UUID from `suggestions list`', required: true }),\n };\n\n async run(): Promise<void> {\n const { args } = await this.parse(SuggestionsAccept);\n this.requireAuth();\n validateUuid(args.id, 'suggestion ID');\n\n const projectPath = normalizeProjectPath(process.cwd());\n\n const suggestion = await apiGet<SuggestionDetail>(\n `/api/instruction-suggestions/${encodeURIComponent(args.id)}`,\n );\n\n let effectiveInstructionId = suggestion.instructionId;\n\n if (suggestion.instructionScope === 'public') {\n const promoted = await apiPost<PromoteResponse>(\n `/api/instructions/${encodeURIComponent(suggestion.instructionId)}/promote-from-public`,\n { targetScope: 'personal' },\n );\n effectiveInstructionId = promoted.instructionId;\n }\n\n const instruction = await apiGet<Instruction>(\n `/api/instructions/${encodeURIComponent(effectiveInstructionId)}`,\n );\n\n const modified = appendToCLAUDEmd(process.cwd(), effectiveInstructionId, instruction.content);\n\n if (!modified) {\n this.log(`Already present: ${instruction.name} is already in CLAUDE.md (block id: ${effectiveInstructionId}).`);\n } else {\n this.log(`Accepted: added ${instruction.name} to CLAUDE.md. It will be active starting in your next session.`);\n }\n\n await apiPost(`/api/instruction-suggestions/${encodeURIComponent(args.id)}/events`, {\n eventType: 'accepted',\n projectPath,\n });\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,YAAY;AA0Bd,SAAS,iBAAiB,KAAa,eAAuB,SAA0B;AAC3F,QAAM,WAAgB,UAAK,KAAK,WAAW;AAC3C,QAAM,WAAW,yBAAyB,aAAa;AACvD,QAAM,SAAS,uBAAuB,aAAa;AAEnD,QAAM,WAAc,cAAW,QAAQ,IAAO,gBAAa,UAAU,MAAM,IAAI;AAE/E,MAAI,SAAS,SAAS,QAAQ,GAAG;AAC7B,WAAO;AAAA,EACX;AAEA,QAAM,YAAY,SAAS,SAAS,KAAK,CAAC,SAAS,SAAS,IAAI,IAC1D,SACA,SAAS,SAAS,IAAI,OAAO;AACnC,QAAM,QAAQ,GAAG,SAAS;AAAA,EAAK,QAAQ;AAAA,EAAK,OAAO;AAAA,EAAK,MAAM;AAAA;AAE9D,EAAG,iBAAc,UAAU,WAAW,OAAO,MAAM;AACnD,SAAO;AACX;AAEA,IAAqB,oBAArB,MAAqB,2BAA0B,YAAY;AAAA,EACvD,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,OAAgB,OAAO;AAAA,IACnB,IAAI,KAAK,OAAO,EAAE,aAAa,2CAA2C,UAAU,KAAK,CAAC;AAAA,EAC9F;AAAA,EAEA,MAAM,MAAqB;AACvB,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,MAAM,kBAAiB;AACnD,SAAK,YAAY;AACjB,iBAAa,KAAK,IAAI,eAAe;AAErC,UAAM,cAAc,qBAAqB,QAAQ,IAAI,CAAC;AAEtD,UAAM,aAAa,MAAM;AAAA,MACrB,gCAAgC,mBAAmB,KAAK,EAAE,CAAC;AAAA,IAC/D;AAEA,QAAI,yBAAyB,WAAW;AAExC,QAAI,WAAW,qBAAqB,UAAU;AAC1C,YAAM,WAAW,MAAM;AAAA,QACnB,qBAAqB,mBAAmB,WAAW,aAAa,CAAC;AAAA,QACjE,EAAE,aAAa,WAAW;AAAA,MAC9B;AACA,+BAAyB,SAAS;AAAA,IACtC;AAEA,UAAM,cAAc,MAAM;AAAA,MACtB,qBAAqB,mBAAmB,sBAAsB,CAAC;AAAA,IACnE;AAEA,UAAM,WAAW,iBAAiB,QAAQ,IAAI,GAAG,wBAAwB,YAAY,OAAO;AAE5F,QAAI,CAAC,UAAU;AACX,WAAK,IAAI,oBAAoB,YAAY,IAAI,uCAAuC,sBAAsB,IAAI;AAAA,IAClH,OAAO;AACH,WAAK,IAAI,mBAAmB,YAAY,IAAI,iEAAiE;AAAA,IACjH;AAEA,UAAM,QAAQ,gCAAgC,mBAAmB,KAAK,EAAE,CAAC,WAAW;AAAA,MAChF,WAAW;AAAA,MACX;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
} from "../../chunk-7NYKWN7U.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseCommand
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-2HK7RGZB.js";
|
|
10
10
|
import "../../chunk-R56PH7YE.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-GQNJO2P2.js";
|
|
12
|
+
import "../../chunk-37LN5O7M.js";
|
|
12
13
|
import "../../chunk-EKJ2CABV.js";
|
|
13
14
|
import {
|
|
14
15
|
apiPost
|
|
15
|
-
} from "../../chunk-
|
|
16
|
+
} from "../../chunk-ZUJBM6HE.js";
|
|
16
17
|
import "../../chunk-W2YERO7E.js";
|
|
17
18
|
import "../../chunk-NSBPE2FW.js";
|
|
18
19
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/suggestions/dismiss.ts"],
|
|
4
4
|
"sourcesContent": ["import { Args } from '@oclif/core';\nimport { normalizeProjectPath } from '@rulemetric/core/paths';\nimport { BaseCommand } from '../../base-command.js';\nimport { apiPost } from '../../lib/api-client.js';\nimport { validateUuid } from '../../lib/types.js';\n\nexport default class SuggestionsDismiss extends BaseCommand {\n static override description = 'Dismiss a suggestion so it will not re-surface for 30 days';\n\n static override examples = [\n '<%= config.bin %> suggestions dismiss <id>',\n ];\n\n static override args = {\n id: Args.string({ description: 'Suggestion UUID from `suggestions list`', required: true }),\n };\n\n async run(): Promise<void> {\n const { args } = await this.parse(SuggestionsDismiss);\n this.requireAuth();\n validateUuid(args.id, 'suggestion ID');\n\n const projectPath = normalizeProjectPath(process.cwd());\n\n await apiPost(`/api/instruction-suggestions/${encodeURIComponent(args.id)}/events`, {\n eventType: 'dismissed',\n projectPath,\n });\n\n this.log(\"Dismissed. Won't re-surface for 30 days.\");\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AAMrB,IAAqB,qBAArB,MAAqB,4BAA2B,YAAY;AAAA,EACxD,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,OAAgB,OAAO;AAAA,IACnB,IAAI,KAAK,OAAO,EAAE,aAAa,2CAA2C,UAAU,KAAK,CAAC;AAAA,EAC9F;AAAA,EAEA,MAAM,MAAqB;AACvB,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,MAAM,mBAAkB;AACpD,SAAK,YAAY;AACjB,iBAAa,KAAK,IAAI,eAAe;AAErC,UAAM,cAAc,qBAAqB,QAAQ,IAAI,CAAC;AAEtD,UAAM,QAAQ,gCAAgC,mBAAmB,KAAK,EAAE,CAAC,WAAW;AAAA,MAChF,WAAW;AAAA,MACX;AAAA,IACJ,CAAC;AAED,SAAK,IAAI,0CAA0C;AAAA,EACvD;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,13 +3,14 @@ import {
|
|
|
3
3
|
} from "../../chunk-EKP32DLN.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-2HK7RGZB.js";
|
|
7
7
|
import "../../chunk-R56PH7YE.js";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-GQNJO2P2.js";
|
|
9
|
+
import "../../chunk-37LN5O7M.js";
|
|
9
10
|
import "../../chunk-EKJ2CABV.js";
|
|
10
11
|
import {
|
|
11
12
|
apiGet
|
|
12
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-ZUJBM6HE.js";
|
|
13
14
|
import "../../chunk-W2YERO7E.js";
|
|
14
15
|
import "../../chunk-NSBPE2FW.js";
|
|
15
16
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/suggestions/list.ts"],
|
|
4
4
|
"sourcesContent": ["import { Flags } from '@oclif/core';\nimport { printTable } from '@oclif/table';\nimport { normalizeProjectPath } from '@rulemetric/core/paths';\nimport { BaseCommand } from '../../base-command.js';\nimport { apiGet } from '../../lib/api-client.js';\n\ninterface SuggestionItem {\n id: string;\n instructionId: string;\n instructionScope: string;\n score: number;\n reason: string;\n generatedAt: string;\n isStale: boolean;\n name: string;\n description: string | null;\n tags: string[] | null;\n}\n\ninterface SuggestionsResponse {\n suggestions: SuggestionItem[];\n}\n\nexport default class SuggestionsList extends BaseCommand {\n static override description = 'List instruction suggestions for a project';\n\n static override examples = [\n '<%= config.bin %> suggestions list',\n '<%= config.bin %> suggestions list --project /path/to/project',\n ];\n\n static override flags = {\n project: Flags.string({\n char: 'p',\n description: 'Project path (defaults to current directory)',\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(SuggestionsList);\n this.requireAuth();\n\n const projectPath = normalizeProjectPath(flags.project ?? process.cwd());\n const encoded = encodeURIComponent(projectPath);\n const result = await apiGet<SuggestionsResponse>(\n `/api/instruction-suggestions?projectPath=${encoded}&limit=10`,\n );\n\n if (result.suggestions.length === 0) {\n this.log(\n 'No suggestions for this project. The cron runs daily at 04:30; trigger now with: rulemetric suggestions refresh',\n );\n return;\n }\n\n printTable({\n data: result.suggestions.map((s) => ({\n ID: s.id,\n Scope: s.instructionScope,\n Name: s.name,\n Score: s.score.toFixed(2),\n Reason: s.reason.length > 60 ? s.reason.slice(0, 59) + '\u2026' : s.reason,\n })),\n columns: ['ID', 'Scope', 'Name', 'Score', 'Reason'],\n });\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAsB3B,IAAqB,kBAArB,MAAqB,yBAAwB,YAAY;AAAA,EACrD,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACvB;AAAA,IACA;AAAA,EACJ;AAAA,EAEA,OAAgB,QAAQ;AAAA,IACpB,SAAS,MAAM,OAAO;AAAA,MAClB,MAAM;AAAA,MACN,aAAa;AAAA,IACjB,CAAC;AAAA,EACL;AAAA,EAEA,MAAM,MAAqB;AACvB,UAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,gBAAe;AAClD,SAAK,YAAY;AAEjB,UAAM,cAAc,qBAAqB,MAAM,WAAW,QAAQ,IAAI,CAAC;AACvE,UAAM,UAAU,mBAAmB,WAAW;AAC9C,UAAM,SAAS,MAAM;AAAA,MACjB,4CAA4C,OAAO;AAAA,IACvD;AAEA,QAAI,OAAO,YAAY,WAAW,GAAG;AACjC,WAAK;AAAA,QACD;AAAA,MACJ;AACA;AAAA,IACJ;AAEA,eAAW;AAAA,MACP,MAAM,OAAO,YAAY,IAAI,CAAC,OAAO;AAAA,QACjC,IAAI,EAAE;AAAA,QACN,OAAO,EAAE;AAAA,QACT,MAAM,EAAE;AAAA,QACR,OAAO,EAAE,MAAM,QAAQ,CAAC;AAAA,QACxB,QAAQ,EAAE,OAAO,SAAS,KAAK,EAAE,OAAO,MAAM,GAAG,EAAE,IAAI,WAAM,EAAE;AAAA,MACnE,EAAE;AAAA,MACF,SAAS,CAAC,MAAM,SAAS,QAAQ,SAAS,QAAQ;AAAA,IACtD,CAAC;AAAA,EACL;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-2HK7RGZB.js";
|
|
4
4
|
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-GQNJO2P2.js";
|
|
6
|
+
import "../../chunk-37LN5O7M.js";
|
|
6
7
|
import "../../chunk-EKJ2CABV.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-ZUJBM6HE.js";
|
|
8
9
|
import "../../chunk-W2YERO7E.js";
|
|
9
10
|
import "../../chunk-NSBPE2FW.js";
|
|
10
11
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/commands/suggestions/refresh.ts"],
|
|
4
4
|
"sourcesContent": ["import { BaseCommand } from '../../base-command.js';\n\nexport default class SuggestionsRefresh extends BaseCommand {\n static override description = 'Information about refreshing instruction suggestions';\n\n static override examples = [\n '<%= config.bin %> suggestions refresh',\n ];\n\n async run(): Promise<void> {\n this.log(\n 'The suggestion cron runs daily at 04:30. To force a recompute now, restart the worker (`rulemetric service restart`) and the cron will fire on its registered schedule.',\n );\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAEA,IAAqB,qBAArB,cAAgD,YAAY;AAAA,EACxD,OAAgB,cAAc;AAAA,EAE9B,OAAgB,WAAW;AAAA,IACvB;AAAA,EACJ;AAAA,EAEA,MAAM,MAAqB;AACvB,SAAK;AAAA,MACD;AAAA,IACJ;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FrictionPanel
|
|
3
|
+
} from "../chunk-XC6M4CSW.js";
|
|
1
4
|
import {
|
|
2
5
|
InsightsPanel
|
|
3
6
|
} from "../chunk-4SCZK7AL.js";
|
|
@@ -10,34 +13,31 @@ import {
|
|
|
10
13
|
import {
|
|
11
14
|
Overview
|
|
12
15
|
} from "../chunk-IJGF2ETG.js";
|
|
16
|
+
import "../chunk-DQ3KELXD.js";
|
|
13
17
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import "../chunk-RH7NHVSK.js";
|
|
19
|
-
import "../chunk-YSEQWCN4.js";
|
|
20
|
-
import "../chunk-W4MZXKZ2.js";
|
|
18
|
+
loadApiInsights,
|
|
19
|
+
loadLinkedInstructions,
|
|
20
|
+
loadLocalStats
|
|
21
|
+
} from "../chunk-XUV6DDBF.js";
|
|
21
22
|
import {
|
|
22
|
-
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
23
|
+
LauncherOverlay
|
|
24
|
+
} from "../chunk-4XAWK6S2.js";
|
|
25
|
+
import "../chunk-5BAOGNUH.js";
|
|
26
|
+
import "../chunk-DNKSVWMD.js";
|
|
25
27
|
import {
|
|
26
28
|
DIM,
|
|
27
29
|
ORANGE,
|
|
28
30
|
PERIODS,
|
|
29
31
|
PERIOD_LABELS
|
|
30
32
|
} from "../chunk-QJQS6TUN.js";
|
|
31
|
-
import
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
loadLocalStats
|
|
35
|
-
} from "../chunk-ZSGKRCKD.js";
|
|
33
|
+
import "../chunk-RH7NHVSK.js";
|
|
34
|
+
import "../chunk-EYPAAGN5.js";
|
|
35
|
+
import "../chunk-UKMLICWS.js";
|
|
36
36
|
import "../chunk-F5N6CLJJ.js";
|
|
37
37
|
import {
|
|
38
38
|
readActiveOrg
|
|
39
39
|
} from "../chunk-EKJ2CABV.js";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-ZUJBM6HE.js";
|
|
41
41
|
import "../chunk-W2YERO7E.js";
|
|
42
42
|
import "../chunk-NSBPE2FW.js";
|
|
43
43
|
|
package/dist/dashboard/data.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
loadApiInsights,
|
|
3
3
|
loadLinkedInstructions,
|
|
4
4
|
loadLocalStats
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-XUV6DDBF.js";
|
|
6
6
|
import "../chunk-F5N6CLJJ.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ZUJBM6HE.js";
|
|
8
8
|
import "../chunk-W2YERO7E.js";
|
|
9
9
|
import "../chunk-NSBPE2FW.js";
|
|
10
10
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ActiveJobsList
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-RH7NHVSK.js";
|
|
3
|
+
} from "../../chunk-5BAOGNUH.js";
|
|
5
4
|
import "../../chunk-QJQS6TUN.js";
|
|
5
|
+
import "../../chunk-RH7NHVSK.js";
|
|
6
6
|
import "../../chunk-NSBPE2FW.js";
|
|
7
7
|
export {
|
|
8
8
|
ActiveJobsList
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LauncherOverlay
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-RH7NHVSK.js";
|
|
7
|
-
import "../../chunk-YSEQWCN4.js";
|
|
8
|
-
import "../../chunk-W4MZXKZ2.js";
|
|
3
|
+
} from "../../chunk-4XAWK6S2.js";
|
|
4
|
+
import "../../chunk-5BAOGNUH.js";
|
|
5
|
+
import "../../chunk-DNKSVWMD.js";
|
|
9
6
|
import "../../chunk-QJQS6TUN.js";
|
|
10
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-RH7NHVSK.js";
|
|
8
|
+
import "../../chunk-EYPAAGN5.js";
|
|
9
|
+
import "../../chunk-UKMLICWS.js";
|
|
10
|
+
import "../../chunk-ZUJBM6HE.js";
|
|
11
11
|
import "../../chunk-W2YERO7E.js";
|
|
12
12
|
import "../../chunk-NSBPE2FW.js";
|
|
13
13
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NewLaunchForm
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-RH7NHVSK.js";
|
|
3
|
+
} from "../../chunk-DNKSVWMD.js";
|
|
5
4
|
import "../../chunk-QJQS6TUN.js";
|
|
5
|
+
import "../../chunk-RH7NHVSK.js";
|
|
6
6
|
import "../../chunk-NSBPE2FW.js";
|
|
7
7
|
export {
|
|
8
8
|
NewLaunchForm
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
createLaunchJob,
|
|
4
4
|
fetchLaunchJobs,
|
|
5
5
|
listLaunchers
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-UKMLICWS.js";
|
|
7
|
+
import "../../chunk-ZUJBM6HE.js";
|
|
8
8
|
import "../../chunk-W2YERO7E.js";
|
|
9
9
|
import "../../chunk-NSBPE2FW.js";
|
|
10
10
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useLaunchJobs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-EYPAAGN5.js";
|
|
4
|
+
import "../../chunk-UKMLICWS.js";
|
|
5
|
+
import "../../chunk-ZUJBM6HE.js";
|
|
6
6
|
import "../../chunk-W2YERO7E.js";
|
|
7
7
|
import "../../chunk-NSBPE2FW.js";
|
|
8
8
|
export {
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
_resetRefreshAttempt,
|
|
3
3
|
bootstrapActiveOrg,
|
|
4
4
|
maybeRefreshActiveOrg
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-37LN5O7M.js";
|
|
6
6
|
import "../chunk-EKJ2CABV.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ZUJBM6HE.js";
|
|
8
8
|
import "../chunk-W2YERO7E.js";
|
|
9
9
|
import "../chunk-NSBPE2FW.js";
|
|
10
10
|
export {
|
package/dist/lib/agent-loop.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAPABILITIES,
|
|
3
3
|
HANDLERS,
|
|
4
|
+
availableCapabilities,
|
|
4
5
|
pollForWork,
|
|
5
6
|
runAgentLoop
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-7UDETV3P.js";
|
|
8
|
+
import "../chunk-GIUBARWS.js";
|
|
9
|
+
import "../chunk-YOBA3NAM.js";
|
|
10
|
+
import "../chunk-OO7JDFS4.js";
|
|
11
|
+
import "../chunk-QSN77T7C.js";
|
|
12
|
+
import "../chunk-XK42ZBDE.js";
|
|
13
|
+
import "../chunk-3LKVS6W5.js";
|
|
14
|
+
import "../chunk-4YAP7RT7.js";
|
|
15
|
+
import "../chunk-XZXS2W24.js";
|
|
16
|
+
import "../chunk-JULOLTZS.js";
|
|
17
|
+
import "../chunk-6NBS5XFS.js";
|
|
18
|
+
import "../chunk-EI5BHWXA.js";
|
|
12
19
|
import "../chunk-Y4BJXXYV.js";
|
|
13
20
|
import "../chunk-W53GKIZQ.js";
|
|
14
|
-
import "../chunk-3QVMIJUL.js";
|
|
15
|
-
import "../chunk-XZXS2W24.js";
|
|
16
|
-
import "../chunk-RQ2TMLKG.js";
|
|
17
|
-
import "../chunk-VBGUNFKY.js";
|
|
18
|
-
import "../chunk-FZKLLNDS.js";
|
|
19
|
-
import "../chunk-AHDRN6NE.js";
|
|
20
21
|
import "../chunk-DGHWRQXL.js";
|
|
22
|
+
import "../chunk-52WIYRZH.js";
|
|
23
|
+
import "../chunk-RQ2TMLKG.js";
|
|
24
|
+
import "../chunk-PMI56ED5.js";
|
|
21
25
|
import "../chunk-E3BIT53W.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-3POYC5NA.js";
|
|
25
|
-
import "../chunk-DR5WLIOU.js";
|
|
26
|
+
import "../chunk-FZKLLNDS.js";
|
|
27
|
+
import "../chunk-KJKBDQ4D.js";
|
|
26
28
|
import "../chunk-J7N3DLH6.js";
|
|
27
|
-
import "../chunk-52WIYRZH.js";
|
|
28
29
|
import "../chunk-OQSQC7VB.js";
|
|
29
30
|
import "../chunk-EKP32DLN.js";
|
|
30
31
|
import "../chunk-F5N6CLJJ.js";
|
|
@@ -32,12 +33,13 @@ import "../chunk-KRBQLMOP.js";
|
|
|
32
33
|
import "../chunk-3TIMQ3O6.js";
|
|
33
34
|
import "../chunk-YNIH3KMU.js";
|
|
34
35
|
import "../chunk-QN34TGD3.js";
|
|
35
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-ZUJBM6HE.js";
|
|
36
37
|
import "../chunk-W2YERO7E.js";
|
|
37
38
|
import "../chunk-NSBPE2FW.js";
|
|
38
39
|
export {
|
|
39
40
|
CAPABILITIES,
|
|
40
41
|
HANDLERS,
|
|
42
|
+
availableCapabilities,
|
|
41
43
|
pollForWork,
|
|
42
44
|
runAgentLoop
|
|
43
45
|
};
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
readNewRecords,
|
|
7
7
|
stateApi,
|
|
8
8
|
tailAntigravityTranscript
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-2ORJWTNZ.js";
|
|
10
|
+
import "../chunk-ZUJBM6HE.js";
|
|
11
11
|
import "../chunk-W2YERO7E.js";
|
|
12
12
|
import "../chunk-NSBPE2FW.js";
|
|
13
13
|
export {
|
package/dist/lib/api-client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureDeviceApiKey
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-EJ3YAFDP.js";
|
|
4
|
+
import "../chunk-GQNJO2P2.js";
|
|
5
|
+
import "../chunk-ZUJBM6HE.js";
|
|
6
6
|
import "../chunk-W2YERO7E.js";
|
|
7
7
|
import "../chunk-NSBPE2FW.js";
|
|
8
8
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
processConversationJob
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-KJKBDQ4D.js";
|
|
4
4
|
import "../chunk-3TIMQ3O6.js";
|
|
5
5
|
import "../chunk-YNIH3KMU.js";
|
|
6
6
|
import "../chunk-QN34TGD3.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ZUJBM6HE.js";
|
|
8
8
|
import "../chunk-W2YERO7E.js";
|
|
9
9
|
import "../chunk-NSBPE2FW.js";
|
|
10
10
|
export {
|
|
@@ -3,7 +3,16 @@ import {
|
|
|
3
3
|
GATEWAY_PORT,
|
|
4
4
|
MITMPROXY_PORT,
|
|
5
5
|
startGateway
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-7NNFYWKK.js";
|
|
7
|
+
import "../chunk-ILYDELUE.js";
|
|
8
|
+
import {
|
|
9
|
+
getGatewayPid,
|
|
10
|
+
isGatewayRunning
|
|
11
|
+
} from "../chunk-4LYCDS2N.js";
|
|
12
|
+
import {
|
|
13
|
+
probeGatewayIdentity
|
|
14
|
+
} from "../chunk-7LVVKQMZ.js";
|
|
15
|
+
import "../chunk-5EDMGK3W.js";
|
|
7
16
|
import "../chunk-NSBPE2FW.js";
|
|
8
17
|
|
|
9
18
|
// src/lib/gateway-entry.ts
|
|
@@ -11,6 +20,35 @@ var { server, healthInterval } = startGateway(GATEWAY_PORT, MITMPROXY_PORT, {
|
|
|
11
20
|
cliVersion: process.env.RULEMETRIC_CLI_VERSION,
|
|
12
21
|
cliEntry: process.env.RULEMETRIC_CLI_ENTRY
|
|
13
22
|
});
|
|
23
|
+
function logLine(msg) {
|
|
24
|
+
console.log(`[${(/* @__PURE__ */ new Date()).toISOString()}] ${msg}`);
|
|
25
|
+
}
|
|
26
|
+
server.on("error", (err) => {
|
|
27
|
+
clearInterval(healthInterval);
|
|
28
|
+
if (err.code !== "EADDRINUSE") {
|
|
29
|
+
logLine(`gateway listener error: ${err.message}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
void (async () => {
|
|
33
|
+
const identity = await probeGatewayIdentity(GATEWAY_PORT);
|
|
34
|
+
if (identity.status === "ours-live") {
|
|
35
|
+
logLine(`gateway already live on :${GATEWAY_PORT} (pid ${identity.pid ?? "?"}) \u2014 exiting (idempotent spawn)`);
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
if (identity.status === "foreign" && isGatewayRunning() && getGatewayPid() !== process.pid) {
|
|
39
|
+
logLine(`gateway (pre-identity build, pid ${getGatewayPid()}) already holds :${GATEWAY_PORT} \u2014 exiting (idempotent spawn)`);
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
42
|
+
if (identity.status === "dead") {
|
|
43
|
+
logLine(`:${GATEWAY_PORT} was busy at bind time but is silent now \u2014 exiting; next ensure retries`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
logLine(
|
|
47
|
+
`FOREIGN process holds :${GATEWAY_PORT} \u2014 refusing to start (probe: ${identity.detail}). Free the port, then re-run: rulemetric hooks install`
|
|
48
|
+
);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
})();
|
|
51
|
+
});
|
|
14
52
|
function shutdown() {
|
|
15
53
|
console.log(`[${(/* @__PURE__ */ new Date()).toISOString()}] gateway shutting down`);
|
|
16
54
|
clearInterval(healthInterval);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/lib/gateway-entry.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n/**\n * Standalone entry point for the gateway process.\n * Spawned as a detached child process by the CLI.\n */\nimport { startGateway, GATEWAY_PORT, MITMPROXY_PORT } from './gateway.js';\n\nconst { server, healthInterval } = startGateway(GATEWAY_PORT, MITMPROXY_PORT, {\n cliVersion: process.env.RULEMETRIC_CLI_VERSION,\n cliEntry: process.env.RULEMETRIC_CLI_ENTRY,\n});\n\nfunction shutdown() {\n console.log(`[${new Date().toISOString()}] gateway shutting down`);\n clearInterval(healthInterval);\n server.close(() => {\n process.exit(0);\n });\n // Force exit after 5s if connections don't drain\n setTimeout(() => process.exit(0), 5000).unref();\n}\n\nprocess.on('SIGTERM', shutdown);\nprocess.on('SIGINT', shutdown);\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\n/**\n * Standalone entry point for the gateway process.\n * Spawned as a detached child process by the CLI.\n * Must not depend on oclif \u2014 only node builtins + sibling lib modules.\n */\nimport { startGateway, GATEWAY_PORT, MITMPROXY_PORT } from './gateway.js';\nimport { probeGatewayIdentity } from './gateway-identity.js';\nimport { isGatewayRunning, getGatewayPid } from './gateway-lifecycle.js';\n\nconst { server, healthInterval } = startGateway(GATEWAY_PORT, MITMPROXY_PORT, {\n cliVersion: process.env.RULEMETRIC_CLI_VERSION,\n cliEntry: process.env.RULEMETRIC_CLI_ENTRY,\n});\n\nfunction logLine(msg: string): void {\n console.log(`[${new Date().toISOString()}] ${msg}`);\n}\n\n// A second spawn racing an already-bound gateway lands here as EADDRINUSE.\n// Without this handler the listener error crashes the process with a stack\n// trace and \u2014 worse \u2014 nothing ever learns whether the thing holding :8787 is\n// ours or a foreign app. Classify via the identity handshake:\n// - ours-live \u2192 idempotent spawn, exit 0 quietly\n// - anything else \u2192 say what we know, exit non-zero (callers must not pin\n// HTTPS_PROXY at a port we don't own)\nserver.on('error', (err: NodeJS.ErrnoException) => {\n clearInterval(healthInterval);\n if (err.code !== 'EADDRINUSE') {\n logLine(`gateway listener error: ${err.message}`);\n process.exit(1);\n }\n void (async () => {\n const identity = await probeGatewayIdentity(GATEWAY_PORT);\n if (identity.status === 'ours-live') {\n logLine(`gateway already live on :${GATEWAY_PORT} (pid ${identity.pid ?? '?'}) \u2014 exiting (idempotent spawn)`);\n process.exit(0);\n }\n // A gateway from an older CLI build predates the identity endpoint and\n // probes as foreign. If the PID file points at a live gateway-entry\n // process that isn't us, the port holder is still ours \u2014 stay idempotent.\n if (identity.status === 'foreign' && isGatewayRunning() && getGatewayPid() !== process.pid) {\n logLine(`gateway (pre-identity build, pid ${getGatewayPid()}) already holds :${GATEWAY_PORT} \u2014 exiting (idempotent spawn)`);\n process.exit(0);\n }\n if (identity.status === 'dead') {\n // Bind failed but nothing answers now \u2014 we raced a dying process. The\n // next session-start `gateway ensure` retries cleanly.\n logLine(`:${GATEWAY_PORT} was busy at bind time but is silent now \u2014 exiting; next ensure retries`);\n process.exit(1);\n }\n logLine(\n `FOREIGN process holds :${GATEWAY_PORT} \u2014 refusing to start ` +\n `(probe: ${identity.detail}). ` +\n `Free the port, then re-run: rulemetric hooks install`,\n );\n process.exit(1);\n })();\n});\n\nfunction shutdown() {\n console.log(`[${new Date().toISOString()}] gateway shutting down`);\n clearInterval(healthInterval);\n server.close(() => {\n process.exit(0);\n });\n // Force exit after 5s if connections don't drain\n setTimeout(() => process.exit(0), 5000).unref();\n}\n\nprocess.on('SIGTERM', shutdown);\nprocess.on('SIGINT', shutdown);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAUA,IAAM,EAAE,QAAQ,eAAe,IAAI,aAAa,cAAc,gBAAgB;AAAA,EAC5E,YAAY,QAAQ,IAAI;AAAA,EACxB,UAAU,QAAQ,IAAI;AACxB,CAAC;AAED,SAAS,QAAQ,KAAmB;AAClC,UAAQ,IAAI,KAAI,oBAAI,KAAK,GAAE,YAAY,CAAC,KAAK,GAAG,EAAE;AACpD;AASA,OAAO,GAAG,SAAS,CAAC,QAA+B;AACjD,gBAAc,cAAc;AAC5B,MAAI,IAAI,SAAS,cAAc;AAC7B,YAAQ,2BAA2B,IAAI,OAAO,EAAE;AAChD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,QAAM,YAAY;AAChB,UAAM,WAAW,MAAM,qBAAqB,YAAY;AACxD,QAAI,SAAS,WAAW,aAAa;AACnC,cAAQ,4BAA4B,YAAY,SAAS,SAAS,OAAO,GAAG,qCAAgC;AAC5G,cAAQ,KAAK,CAAC;AAAA,IAChB;AAIA,QAAI,SAAS,WAAW,aAAa,iBAAiB,KAAK,cAAc,MAAM,QAAQ,KAAK;AAC1F,cAAQ,oCAAoC,cAAc,CAAC,oBAAoB,YAAY,oCAA+B;AAC1H,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,QAAI,SAAS,WAAW,QAAQ;AAG9B,cAAQ,IAAI,YAAY,8EAAyE;AACjG,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA;AAAA,MACE,0BAA0B,YAAY,qCACzB,SAAS,MAAM;AAAA,IAE9B;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB,GAAG;AACL,CAAC;AAED,SAAS,WAAW;AAClB,UAAQ,IAAI,KAAI,oBAAI,KAAK,GAAE,YAAY,CAAC,yBAAyB;AACjE,gBAAc,cAAc;AAC5B,SAAO,MAAM,MAAM;AACjB,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AAED,aAAW,MAAM,QAAQ,KAAK,CAAC,GAAG,GAAI,EAAE,MAAM;AAChD;AAEA,QAAQ,GAAG,WAAW,QAAQ;AAC9B,QAAQ,GAAG,UAAU,QAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GATEWAY_IDENTITY_PATH,
|
|
3
|
+
GATEWAY_IDENTITY_SERVICE,
|
|
4
|
+
describePortOwner,
|
|
5
|
+
probeGatewayIdentity,
|
|
6
|
+
waitForGatewayIdentity
|
|
7
|
+
} from "../chunk-7LVVKQMZ.js";
|
|
8
|
+
import "../chunk-NSBPE2FW.js";
|
|
9
|
+
export {
|
|
10
|
+
GATEWAY_IDENTITY_PATH,
|
|
11
|
+
GATEWAY_IDENTITY_SERVICE,
|
|
12
|
+
describePortOwner,
|
|
13
|
+
probeGatewayIdentity,
|
|
14
|
+
waitForGatewayIdentity
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=gateway-identity.js.map
|