Luigit
repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

extensions/ultra/mise.toml

Raw
[tasks.bench]
description = "Benchmark Ultra progress reduction"
depends = ["//:install"]
run = "node --no-warnings --experimental-strip-types __bench__/progress.bench.ts"

[tasks.profile]
description = "Profile Ultra progress reduction"
depends = ["//:install"]
run = "node ../../scripts/profile-benchmark.mjs ultra __bench__/progress.bench.ts"

[tasks.benchstat]
description = "Compare Ultra benchmark results"
depends = ["//:install"]
usage = '''
arg "<baseline>"
arg "<candidate>"
'''
run = 'benchstat "{{ usage.baseline }}" "{{ usage.candidate }}"'

[tasks.fmt]
description = "Format ultra extension"
depends = ["//:install"]
run = [
  "biome check --write --config-path ../.. .",
  "rumdl fmt --config ../../.rumdl.toml .",
  "taplo format --config ../../.taplo.toml mise.toml",
]

[tasks.lint]
description = "Lint ultra extension"
depends = ["//:install"]
run = [
  "biome ci --config-path ../.. .",
  "rumdl check --config ../../.rumdl.toml .",
  "taplo format --check --config ../../.taplo.toml mise.toml",
]

[tasks.test]
description = "Test ultra extension"
depends = ["//:install"]
run = [
  { task = "//:test", args = ["extensions/ultra"] },
]

[tasks.authoring-check]
description = "Read-only live authoring-skill check using the configured model"
depends = ["//:install"]
env.PI_OFFLINE = "1"
run = '''
pi --print --mode json --no-session --no-extensions --extension index.ts --no-context-files --no-skills --tools read "Plan an inline two-phase workflow: independently inspect two files, then synthesize the findings. Planning only: do not run workflows, execute commands, or create or edit files. Read the applicable authoring guidance and report which guide you used." | node --input-type=module -e "
import { createInterface } from 'node:readline';
import { resolve } from 'node:path';
let skillCall, skillRead = false, completed = false;
for await (const line of createInterface({ input: process.stdin })) {
  const event = JSON.parse(line);
  if (event.type === 'tool_execution_start') {
    if (event.toolName !== 'read') throw new Error('Unexpected tool: ' + event.toolName);
    console.log('read ' + event.args.path);
    if (resolve(event.args.path) === resolve('prompts/ultra-authoring/SKILL.md')) skillCall = event.toolCallId;
  }
  if (event.type === 'tool_execution_end' && skillCall && event.toolCallId === skillCall && !event.isError) skillRead = true;
  if (event.type === 'message_end' && event.message.role === 'assistant' && event.message.stopReason === 'stop') completed = true;
}
if (!skillRead || !completed) throw new Error('Missing successful authoring-skill read or completed turn');
console.log('PASS: authoring skill read; only read tools used; turn completed.');
"
'''

[tasks.check-settings]
description = "Validate an Ultra settings JSON file"
usage = '''
arg "<path>" help="Path to a Pi settings.json file"
'''
run = '''
node --input-type=module -e "import { readFileSync } from 'node:fs'; import { parseUltraSettings } from './settings.ts'; parseUltraSettings(JSON.parse(readFileSync(process.env.usage_path, 'utf8')).ultra ?? {}); console.log('Ultra settings valid.');"
'''

[tasks.usage-report]
description = "Inspect persisted Pi session usage with ccusage"
usage = '''
arg "[args]" var=#true
'''
run = '''
npx --yes ccusage@latest pi session{% for arg in usage.args %} "{{ arg }}"{% endfor %}
'''

[tasks.check]
description = "Check ultra extension"
depends = ["//:install"]
run = [
  { task = "//:build", args = ["ultra"] },
  { task = "//:build-ext", args = ["ultra"] },
]

[tasks.verify-package]
description = "Build ultra and load the generated package relocated outside the checkout"
depends = ["//:install"]
run = [
  { task = "//:build-ext", args = ["ultra"] },
  { task = "//:verify-packages", args = ["ultra"] },
]