リリース

KScript の各バージョンの変更点とダウンロード。kscript update を実行すると最新版になります。

リリースノートは英語です。

v0.61.2

最新

Fixes

kscript serve no longer keeps every request in memory. A site that draws a component written as a .kscript file, or imports a script, kept each request's interpreter, modules and values for as long as the server ran: about a third of a megabyte a request on the KScript site's homepage. A server with a memory limit answered 500 ("kscript ran out of memory") after a few hundred requests and stayed that way until it was restarted. There were two causes:

  • A request's compiled blocks were kept by the script's parsed statements, which every request shares, so they never went. Since 0.60.0.
  • The expressions in a script component's markup were parsed and kept again on every request. In 0.58 and 0.59 too.

A server's memory now stays level however many requests it answers.

Run kscript update to get this release, and restart kscript serve.

What's Changed

  • Follow a renamed GitHub repository in kscript lib add and restore
  • Merge train: a train's pull request can't be merged or marked ready
  • CI: keep the train-only jobs out of a pull request's checks
  • Docs: keep the language when switching version, and stop the not-found page looping
  • Release 0.61.2: kscript serve lets a request go once it is answered

ダウンロード

v0.61.2 のドキュメントすべてのファイル

v0.61.1

Fixes

kscript serve starts where the JIT runtime can't be run. In a container whose only writable folder is a noexec tmpfs (a read-only container with HOME=/tmp), v0.61.0 downloaded the JIT runtime, couldn't start it and stopped with an Internal error. Now it says so in one line and serves from the installed kscript, as it does when the runtime can't be downloaded.

To skip the download in such a container, set KSCRIPT_JIT=0. To serve on the JIT runtime there, put it in the image with RUN kscript version jit and keep the same HOME when the container runs.

Run kscript update to get this release.

What's Changed

  • Docs translations: the one Russian sentence the 0.59.0 docs were missing
  • Release 0.61.1: serve carries on when the JIT runtime can't be started

ダウンロード

v0.61.1 のドキュメントすべてのファイル

v0.61.0

Highlights

Faster sites. kscript serve now runs on the JIT runtime (fetched once, the first time), and pages are served 2 to 3 times faster. A site built with kscript compile is as fast as kscript serve, and takes --env. Scripts that spend seconds in loops can use it too, with kscript --jit solve.kscript or "jit": true in kscript.json.

Strict types. A file that starts with strict, or a project with "strict": true, holds every value to a type the checker can prove. Type mistakes become errors and the script doesn't run until they are fixed.

Types that do more. value: says what a value reads as (MultiplierEntry('x11') + 1 is 12), .group(1) reads what a type's pattern captured, .ahead and .behind are a value's neighbours in its typed list, and a factory picks the right kind of a type with try each $value |> First, Second.

throw as a value, and blocks in match arms. _ => throw Validation "...", $x ?? throw NotFound "...", and '[two]' => { ... return $doubled } in a match used as a value.

Docs inside VS Code. Cmd-click a built-in to see its docs in a popup, open the full page in a tab beside your code, and search the guides and reference from the new KScript Docs pane.

See where a run's time goes. kscript --timings prints startup phases, the calls that took the most time and the slowest single calls, for run, test, check and serve. --timings file.trace.json exports for Perfetto, file.speedscope.json for speedscope.

Changed: the variants: [...] list from v0.60.0 is now an error that says how to write it as a factory. --no-jit or "jit": false keeps kscript serve in the installed kscript.

Also: fields passed to a built-in error (Validation(field: 'name')) are known where it is caught; kscript docs --translate translates exported docs from locale files; the site and docs follow the device's light or dark mode; a Made with KScript badge for sites.

Run kscript update to get this release.

What's Changed

  • Allow throw where a value goes, and { } blocks in match arms
  • Read a pattern's groups inside a type with .group()
  • Translate the docs in the pull request that changes them, with a CI check, instead of the API
  • CI: start Linux jobs when the build is ready, split the Windows tests, stop early on missing translations
  • Strict types: a strict line or "strict": true holds every value to a proven type
  • CI: docs-only pull requests skip Windows, macOS, AOT and the databases
  • Translate the docs text added by #449 and #450, and speed up CI (#465)
  • Follow the device's light or dark mode on the KScript site and docs
  • Add a Made with KScript badge the other KScript sites share
  • Add value: to native types: what a value reads as
  • Shimmer the site's glass nav as the page passes under it
  • Cmd-click a built-in to see its docs in VS Code
  • Keep the Made with KScript badge's colours on sites with their own footer link colour
  • Merge train: test the waiting pull requests together and merge them on one CI run
  • Merge train: stop the riders' own CI runs once the train leaves
  • Merge train: fix the clash test and stop runs the train makes pointless
  • Make release site uploads one tar stream instead of a file per round trip
  • Read fields passed to a built-in error where it is caught
  • Let a type's methods read the values beside it with .ahead and .behind
  • Serve pages 2 to 3 times faster, and make compiled sites as fast as kscript serve
  • Merge train: start the train's CI with the queue token so its end lands it
  • Docs layout check: stay under the site's request limit
  • Scope-free calls to simple functions, and serve on the JIT runtime
  • Add kscript --timings: where a run's time goes, with Perfetto and speedscope exports
  • Merge train: show the train on each pull request and name its CI run
  • Docs translations: one file per language and page group, in KScript's locales layout
  • kscript docs --translate: the docs' translator, in kscript instead of Node
  • Merge train: pull requests run a quick gate, the train runs the full CI and is a pull request
  • Release 0.61.0

ダウンロード

v0.61.0 のドキュメント

v0.60.0

Highlights

Much faster code. Loop and function bodies, hot loops and closures are compiled, so number code runs about 10x faster, and calls, map and field access and list loops are cheaper.

Imports suggested for types in other files. When a script names a type declared in another script of the project, wherever it lives and whatever its case (number_Entry in puzzle_input.kscript), the error says where it is, a quick fix imports it, and completion offers it with its import.

Type parameters. fn first<T>(items: T[]): T, typed list items, and errors for records of the wrong type.

Sign in with another site's account. An OpenID Connect client, and @openid_question to check what a sign-in provider asks about one person.

Safer public servers. Safe page values, SQL and network limits, CORS, request limits, CSS from style values and symbolic links out of the site folder are all locked down.

Also: KS5018 warns when a value that may be null is used unchecked; @random_generator gives seeded random numbers; kscript check --fix writes renamed methods the new way; a script's fn main runs by itself after its top-level code; fixes for plain form posts in page tests, jobs under test and a view's locale.

Run kscript update to get this release.

What's Changed

  • Security hardening: safe page values, SQL and network limits, CORS, request limits for public servers
  • Stop style values adding CSS, and symbolic links reaching outside the site
  • Remove the dots from the glass K logo
  • Translate the docs in their own workflow, with Haiku
  • Compile loop and function bodies (about 10x faster number code)
  • Docs: one box around a shell command shown as a table, not two
  • Keep translation runs' results, retry bad pieces, and turn thinking off
  • Warn when a value that may be null is used unchecked (KS5018)
  • kscript check --fix writes a renamed method the new way
  • Type parameters (fn first<T>), typed list items, records of the wrong type
  • Sign people in with another site's account
  • Check the questions a sign-in provider asks about one person
  • Translate the v0.59.0 docs
  • Random numbers from a seed
  • Compile hot loops and closures, and make typed calls cheaper
  • Fixes from the Outcoded rebuild: plain form posts in page tests, jobs under test, a view's locale
  • Make loops of numbers and lists several times faster
  • Cheaper calls, map and field access in compiled code, and whole-number loops
  • Cheaper calls to script functions from compiled code
  • Offer to import a type declared in any project script
  • Smaller compiled methods and cheaper list loops
  • Run a script's fn main by itself after its top-level code
  • Add ordered variants to native types
  • Stop the code jumping while typing
  • Release 0.60.0

ダウンロード

v0.60.0 のドキュメントすべてのファイル

v0.59.0

Highlights

Ask your apps for someone's data. A sign-in provider can now gather a person's data from every app they use, for a download in one file. Give an app a data_export_uri in clients.json, and @oidc_data_exports($user) asks each one at once with a signed, minute-long question naming the person; each answers with a JSON object of what it holds about them. Apps that don't answer in time are reported, so you can say which parts are missing. See Signing in to other apps.

Run kscript update to get this release.

What's Changed

  • Turn off /_api in production unless a site asks; safety headers and a rate limit for nginx /docs and /v
  • Ask apps for someone's data (@oidc_data_exports); release 0.59.0

ダウンロード

v0.59.0 のドキュメントすべてのファイル

v0.58.2

Security fixes

These make sites run with kscript serve safer without any change to the site. Update and restart each site to get them.

  • No redirect to another site through a backslash. An address with a backslash or a double slash in it, such as /fr/%5Cexample.com, now names no page and no route, and a Location header sends a backslash encoded. Before, a page that redirected to the address it was asked for could send the browser to another site.
  • Visitors who only look leave nothing in the session store. A session is stored once something is put in it or someone signs in. A page with a form still gets its cookie and CSRF token.
  • A limit on request bodies. A body with no files (a form post, JSON or plain text) may be 1 MiB, and a bigger one is answered 413 before any of your code runs. http.body_limit in kscript.json changes the limit. Uploads keep http.upload_limit.
  • Browser safety headers on every response. X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin and X-Frame-Options: SAMEORIGIN are sent unless the response or http.headers sets its own. An empty value in http.headers sends none.
  • Project files are not served. Dockerfile, Makefile, package.json, node_modules, README.md, database files and logs in the site folder answer 404. Files in the public folder are served as before.
  • SQLite updated to 3.54, which fixes CVE-2025-6965.
  • Control characters in an address are shown as codes in the server log.

Behaviour changes

  • A form post or JSON body over 1 MiB is now refused. Set http.body_limit if your site takes bigger ones.
  • A site that is meant to be shown inside another site's frame needs "X-Frame-Options": "" or a Content-Security-Policy with frame-ancestors in http.headers.

Run kscript update to get this release.

What's Changed

  • Harden kscript serve: empty sessions, safety headers, plain paths, private project files
  • Docs translation: keep progress when a run is stopped
  • Limit a request body without files to 1 MiB (http.body_limit); release 0.58.2

ダウンロード

v0.58.2 のドキュメント

v0.58.1

Fixes

  • A limit on sign-in requests from other apps. One address may now make 60 requests a minute to /auth, the address apps send people to when http.auth.provider is on. Past that it gets a 429 with Retry-After. auth_limit changes the number, and 0 turns the limit off.

Run kscript update to get this release.

What's Changed

  • Completion reads project files once per edit, not per request
  • Homepage: 'One component. Every screen.' section with a morphing recipe card
  • Label every KScript block in the docs so it is coloured
  • Limit /auth to 60 requests a minute per address; release 0.58.1

ダウンロード

v0.58.1 のドキュメントすべてのファイル

v0.58.0

Highlights

Sign people in to your other apps. http.auth.provider makes an app the place other apps sign people in, with OpenID Connect: they send the browser to it, your own pages sign the person in and ask whether the app may know who they are, and the app gets back an ID token signed with ES256. Apps prove themselves with a secret or a key of their own, people can see and remove the apps they've let in (@oidc_connections(), @oidc_disconnect()), and when an account is deleted each app is told, with a signed notice retried until it answers. Before that, @oidc_subscriptions() asks each app which subscriptions the person still has, so you can list them and hold the deletion while one renews. kscript make provider-keys makes the signing key. See Signing in to other apps.

Passkeys in the database. "passkeys": "database" keeps passkeys in the project's database, so every server of an app shares them and they're backed up with the rest of your data. @passkeys() now says when each one was last used, and whether it's synced (kept in a password manager).

Check it's still them. "confirm_within": "5m" asks for a passkey check before a passkey is added or removed, so someone at a computer left signed in can't add their own. @is_confirmed() says whether the last check was recent enough, for anything else that needs one, such as deleting an account.

Security headers on every answer. http.headers adds headers to everything kscript serve sends: pages, files, routes and sign-in. {client_origins} in a value lists the sign-in provider's apps, for a Content-Security-Policy's form-action.

Behind a reverse proxy. http.proxy names the secret your proxy sends, and requests carrying it are counted under the visitor's own address from X-Forwarded-For, for throttle, passkey and sign-in limits. throttle counts an IPv6 visitor by their /64.

A name at passkey sign-up. A sign-up passkey button inside a form with a name field gives the account that name, and the device shows it beside the passkey.

Run kscript update to get this release.

What's Changed

  • Play the agreed logo animation: a syntax error typed and fixed
  • CI: Linux build and test on GitHub-hosted runners, no macOS AOT publish on PRs
  • Keep a time zone's own spelling on macOS
  • Sign people in to your other apps (OpenID provider), passkeys in the database; release 0.58.0

ダウンロード

v0.58.0 のドキュメントすべてのファイル

v0.57.0

Highlights

Serve a folder of files from the site root. serve.public in kscript.json names a folder whose files are served as if they were in the site folder: "serve": { "public": "../public" } serves ../public/favicon.ico at /favicon.ico. A page or a route at the same address wins, and nothing outside the folder can be reached through it.

Notes for editors in pages. A comment that opens with three dashes, <!--- like this --->, is for whoever edits the page and never reaches the browser. Ordinary <!-- --> comments are sent as before.

Markdown reads the way GitHub reads it. Headings get GitHub's ids, so ## 1. About us is #1-about-us and ## Änderungen is #änderungen, and a bare email address becomes a mailto: link. A heading's id may change if it had a number or an accented letter in it: check any links to one.

Fixes

  • Files a site serves (pictures, fonts, scripts) are sent with Last-Modified and an ETag, and a browser that already has one gets 304 Not Modified. Before, every page view downloaded them all again.

  • A // comment between the steps of a method chain no longer ends the statement. The steps after it used to be skipped without an error.

  • kscript check and the editor find a page's or component's <import path> from its own folder, the way pages load it (../lib/site.kscript from _components/), instead of reporting it missing.

  • <respond header-set-cookie="..."> and other header- attributes are no longer reported as unknown. They are documented now.

  • import KScript.Markdown is no longer reported as unused when the script converts Markdown with ->convert(from: markdown, to: html).

Run kscript update to get this release.

What's Changed

  • Keep the homepage illustrations inside the page
  • Homepage: sharp glass illustrations beside the code windows
  • Homepage: package grid links to the docs, with a hover
  • Add a releases page built from GitHub's releases at deploy time
  • Website in 8 more languages, with a language menu
  • Fix locale(set:) in a <do> and /// above a const
  • Homepage: glass K tile in the hero that types itself in
  • Directive options take bare flags: once, trim, prevent, copy
  • Add samples/components: one recipe card on a page, in a window, in the terminal and in a document
  • Site: header menu below 1080px, and the glass K logo everywhere
  • Sad-path tests: 200 wrong-on-purpose scripts, caret-walk editor tests, and the bugs they found
  • $f->call(1, 2) and Size.huge stop the run, as the check says
  • Debugger tests: in-memory pipes, so Windows CI doesn't stall and get cancelled
  • Translate the docs into the site's languages
  • Combined: land all ready PRs in one CI run

ダウンロード

v0.57.0 のドキュメントすべてのファイル

v0.56.1

Fixes

  • The online docs keep their layout. On guide/http, a table cell holding /people/{id} was read as settings for the table, which lost its frame and closed the page's layout early, so the rest of the page ran edge to edge. Braces in a docs table are now plain text, and every page's tags pair up.
  • Wide tables read well. The kscript.json settings show one setting per row, with its name, type and default on the first line and what it does underneath. Long commands sit above what they do, and long lists of values break between values, so no table is wider than the page.

Every release's published docs are now opened in a browser after they go online, and the release fails if a page loses its layout or a table is too wide for it.

Run kscript update to get this release.

What's Changed

  • Describe every kscript.json setting in the editor schemas
  • Flag a number passed to a string parameter; explain null mask symbols at run time
  • Use the glass Orimovo mark in the footer
  • Don't fail the update-PRs workflow when the GitHub API is busy
  • Fix the docs layout broken by {id} in a table, and check published docs in a browser
  • Add illustrations to the homepage code windows
  • Colour the website's code windows with ->highlight
  • Make wide docs tables readable, and release 0.56.1

ダウンロード

v0.56.1 のドキュメントすべてのファイル

v0.56.0

Highlights

Highlight code the way the editor does. ->highlight() turns code into HTML coloured exactly like VS Code colours it. It reads the code with the VS Code extension's own grammars, on the same engine Shiki is built on, so there's no Node and no page script: the HTML comes from the server.

$html = $code->highlight(lang: 'kscript')   // each token in a <span class="hl-...">

lang: takes kscript (the default), ks.xml, html pages (their { values } and @ directives too), ks.css, text, or any language VS Code ships, such as css, js, json, sql and sh. Your stylesheet colours the hl-kw, hl-str, hl-fn and other classes. See "Highlighting code" in the web docs.

Fixes

  • In a website folder with no kscript.json, functions in lib/ scripts that only the site's pages call are no longer reported as never called.
  • Publishing a release to the website now says which step failed, instead of stopping without a message.

Run kscript update to get this release.

What's Changed

  • Write the release index with a KScript script, and say what failed
  • Count a site's pages as callers of its lib scripts; release lists as components
  • Add ->highlight(lang:): editor-exact code highlighting, no Node
  • Shape the hosted docs: --published, --hide and --config for kscript docs --export-to
  • Make the logo's caret jump like a real one instead of gliding
  • Release 0.56.0

ダウンロード

v0.56.0 のドキュメントすべてのファイル

v0.55.0

Highlights

A website for KScript. kscript.orimovo.co.uk has the install commands, examples and downloads, and every release's files at /v/<version>/. It's a KScript site itself, served by kscript serve.

The docs are online, for every release. kscript.orimovo.co.uk/docs has the same docs as kscript docs, starting with this release. A version picker in the header opens the same page in another release's docs.

Read the docs anywhere. kscript docs --export-to <folder> writes the whole docs site as plain files that work offline: open its index.html from the disk, or put the folder on any web server. Search works too.

kscript docs --export-to kscript-docs

Examples can be read, copied and switched between XML and .kscript, but they run only in kscript docs. For several versions on one site, --versions adds a version picker and --stylesheet loads your own CSS after theirs.

Run kscript update to get this release.

What's Changed

  • Publish every release to kscript.orimovo.co.uk/v/<version>/
  • Build the site image from deploy/server
  • Build the KScript website at kscript.orimovo.co.uk
  • Export the docs for offline use: kscript docs --export-to
  • Rebuild the website with kscript serve, and put every release's docs online

ダウンロード

v0.55.0 のドキュメントすべてのファイル

v0.54.0

Highlights

Masks by name, on anything that holds cells. Pass a mask first, straight to text, a list, a grid or a 3D list. ->grid() isn't needed first any more:

fn get_tree_count(input: string): number {
  return $input->shapes(Tree, rotated)->count()
}

$input->shapes([Block, Ell], rotated)        // several masks at once
$input->shapes(Block, square, of: '#')       // masks and built-in shapes together

rotated turns a mask every way the input allows: back to front along a row, four quarter turns in a grid, and all 24 orientations in 3D (where points also have a layer).

Masks are just pictures. Every layout character matches a cell holding the same character, so symbols only lists the exceptions, and any marks a cell that isn't part of the shape:

type Tree extends Mask {
  layout: ```text
    #.#
    ...
    #.#
    ```
  symbols: { '.': any }
}

A blank line in a layout starts the next layer. Hovering a mask's name draws its picture with a legend.

Cleaner suggestions in calls. An argument slot offers only what it can take: no stray variables after a comma, each flag once as its bare word (rotated, never rotated:), and nothing that's already written. Signature help stays open and highlights the parameter you're on, and ->shapes() shows one form at a time.

Breaking changes

  • like: is removed from ->shapes(). Write the mask first: ->shapes(like: Tree) becomes ->shapes(Tree). The quick fix rewrites the call.
  • null in a mask's symbols is now any, with a quick fix.
  • Mask members are written with :. layout = ... is an error with a fix.
  • New mask checks: an empty layout, a layout that's all any, a tab in the picture, layers of different heights, a symbol longer than one character, and a symbol listed twice are errors. KS6025 warns about a character mapped to itself, and KS6026 fades a symbol the layout doesn't use. Each comes with a fix.
  • of:, size:, radius: and distance: given beside only masks are errors, with a fix that removes them.

Run kscript update to get this release.

What's Changed

  • Masks in a .test.kscript file, kept clean in the editor and kscript check
  • Offer only what an argument slot can take, and keep the signature open
  • Masks by name on any input: $input->shapes(Tree, rotated)
  • Release v0.54.0

ダウンロード

v0.53.0

Highlights

Masks extend Mask. A mask is now a type that extends the built-in Mask, and its members need no type written:

/// Trees at the four corners of a 3x3 square, anything between.
type Corners extends Mask {
  layout: ```text
    #.#
    ...
    #.#
    ```
  symbols: { '#': '#', '.': null }
}

echo $grid->shapes(like: Corners)->count()
  • The indentation every layout line shares isn't part of the layout, so a closing fence indented less than the picture works.
  • Mask and Mask[] can be parameter types, taking any type that extends Mask.
  • In the editor, Mask is suggested after extends, a new mask gets layout and symbols written out with a key for each layout character, missing keys are suggested inside symbols: { }, layout characters are coloured by what they match, and hovers explain each part.

Faster macOS release builds. The macOS binaries are built on a larger machine, so releases finish sooner.

Breaking changes

  • A type passed to ->shapes(like:) must extend Mask. Any other type is an error, with a quick fix that adds extends Mask. A mask without layout or symbols is an error too. See docs/upgrading.md.

Run kscript update to get this release.

What's Changed

  • Build macOS release binaries on home-ci-macos
  • Masks extend Mask, written the short way, first-class in the editor
  • Release by changing VERSION
  • Release v0.53.0, with its notes on the release page

ダウンロード

v0.52.0

v0.51.0

Highlights

Debug in the terminal. kscript --debug app.kscript (or kscript run --debug) runs a script in a terminal debugger. It pauses before the first statement, shows the lines around it, and reads commands: n step over (Enter repeats), s step into, o step out, c continue, p <expr> print, v variables, w call stack, b <line> / d <line> breakpoints, q quit and h help. --break 12 pauses at that line instead. Stepping and breakpoints behave the same as in VS Code.

Grids by rows and columns. A list of lists reads like a csv with ->cells(), and ->positions_of() finds where things are:

for column in $grid->cells(columns) {
  echo $column->join('')
}

$trees = $field->grid()->positions_of('#')     // every { row, column } holding a tree

Name each item of a pick. A function given to a pick from ->combinations() or ->permutations() can take one parameter per item:

$trees->combinations(2)->count_of(fn(left, right) => $left.row == $right.row)

Find shapes. ->shapes() finds squares, rectangles, lines and circles in a grid or a list of points, and shapes you draw yourself:

$grid->shapes(square, of: '#', rotated)->count()    // level squares and diamonds
$grid->shapes(line, of: /[#@]/, size: 4)
$grid->shapes(circle, of: '~', radius: 3, distance: moves)

/// Three trees in a V, with anything between them.
type Fork {
  layout: string = ```text
    t~t
    ~t~
    ```
  symbols: map = { t: /[#@]/, '~': null }
}
$grid->shapes(like: [Fork], rotated)

Each match is { kind, points }, and the editor completes their fields. A missing of: on a grid, or a layout character missing from symbols, is an error with a fix.

Breaking changes

  • --debug now starts the terminal debugger. The old flag that shows the .NET stack trace is renamed to --stack-trace, and KSCRIPT_DEBUG to KSCRIPT_STACK_TRACE. --debug on any other command is an error naming --stack-trace.
  • ->transpose() is retired in favour of ->cells(columns). It is an error that names the replacement, with a quick fix. See docs/upgrading.md.

Run kscript update to get this release.

What's Changed

  • Read a grid's rows and columns, find points in it, and name picked items
  • Debug scripts in the terminal with kscript --debug; rename the stack-trace flag to --stack-trace
  • Find shapes in grids and point lists, and masks of your own

ダウンロード

v0.50.0

Highlights

A step debugger in VS Code. Press F5 in a .kscript or .ks.xml script, or click Debug above its first line, and it stops at your breakpoints.

  • Step Over (F10), Step Into (F11), Step Out (Shift+F11), Continue and Pause. Block functions such as ->map(fn(n) { ... }) are stepped into as their own frame.
  • Breakpoints with conditions, hit counts (3, >= 3, % 3) and log points.
  • The Call Stack shows every function the script is inside, each with Locals, Globals and Built-in variables. Lists, maps and records open to show their items.
  • Hovers, watches and the Debug Console work out expressions in the selected frame.
  • The script pauses where an error is thrown, before anything catches it.

The debugger is also available to other editors as kscript debug (the Debug Adapter Protocol on stdio). See docs/debugging.md.

Variables have their $ everywhere. A variable is now written the same way where it is declared, changed and read:

$apples = 12           // declares
$apples += 1           // changes
$count: int = $raw     // declares with a type
const $tax = 0.2       // never changes
echo $apples

Breaking changes

  • The bare spellings apples = 12, count: int = 4 and const tax = 0.2 are now KS6010 errors. The quick fix adds the $, and kscript check --fix rewrites a whole project. Parameters and loop items stay bare (fn double(n), for item in $list), and inside a type's methods a field is still .count += 1. See docs/upgrading.md.

Not yet

  • Debugging test files, @ask() input while debugging, and editing values in the Variables view.

Run kscript update to get this release.

What's Changed

  • Add a step debugger: breakpoints, stepping and variables in VS Code
  • Declare and assign variables with their $: $x = 12

ダウンロード

v0.49.0

Highlights

One-line if. An if, elif or else that does one thing can be written on one line with =>, like match arms and fn(x) =>:

if $score >= 90 => return 'A'
if $temperature < 5 => echo 'Cold'
elif $temperature < 20 => echo 'Mild'
else => echo 'Warm'

Constants from other scripts in the editor. With const puzzle_input = ... in lib/puzzle-input.kscript, typing puz or $puz in main.kscript offers $puzzle_input. Picking it adds import "lib/puzzle-input.kscript" when the file isn't imported yet.

Fixes

  • $puzzle_input written without its import now says which file declares it, with an Import lib/puzzle-input.kscript quick fix (or Change to $day.puzzle_input when the file is imported as day).
  • A line that is only a value's name (puzzle_input) now says to write it with its $, with a fix that writes it (and the import, when one is needed).
  • At the start of a line, a constant is offered as $limit instead of limit, since a constant can't be given a new value.
  • Typing the { that opens a for, while, if, else, try or catch block no longer opens suggestions, so Enter starts a new line instead of writing echo.
  • Inside a collection, the editor suggests and allows only item.

What's Changed

  • Quiet suggestions after a block's opening brace; a collection suggests only item
  • One-line if with =>: if $continue => @method_call()
  • Suggest constants from other project scripts, and import them when picked

ダウンロード

v0.48.1

Highlights

Every row or every column. ->cells(rows) gives every row and ->cells(columns) every column (keyed by the header when there is one). row: and rows are one choice, and so are column: and columns:

$prices->cells(columns)               // { fruit: ['apple', 'plum'], price: [3, 5] }
$numbers->cells(columns)              // [[-903, 692], [-642, 853], [-518], ...]
$prices->cells(rows, column: 'price') // every row's price

Without a header, a column skips the rows too short to reach it, so ->cells(column: 2) is the third number of every row that has one.

Fixes

  • Hovers whose examples hold a ```csv block (such as ->cells()) showed the rest of the example as prose and the docs link as raw text. Code in hovers is now fenced so text blocks stay inside it.
  • ->cells(row) now says row needs a value and offers Change to rows. ->cells(rows, row: 0) is an error in the editor, not only when it runs.

Behaviour changes

  • Without a header, ->cells(column: n) skips rows too short to reach the column instead of failing. A column no row reaches is still an error.

What's Changed

  • Every row or column with ->cells(rows) / ->cells(columns), and fix hovers with text blocks

ダウンロード

v0.48.0

Highlights

One method for csv cells. ->cells() reads every row, one row, one column, or one cell:

$prices->cells()                          // every row
$prices->cells(row: 0)                    // the first row (-1 is the last)
$prices->cells(column: 'price')           // [3, 5]
$prices->cells(row: 1, column: 'price')   // 5

Puzzle input just works. A ```csv block of space-separated numbers splits into numbers, rows can have different lengths, and a first line of numbers is data, not a header:

echo $numbers->cells(row: 0)          // [-903, -642, -518, -585, 446]
echo $numbers->cells(row: -1)->sum()  // 1545

Cells written as numbers come out as numbers (codes such as 007 stay text). Tabs and semicolons split cells too, when there are no commas.

->numbers() on lists. Numbers stay, text gives the numbers in it, and inner lists are read: ['-3 4', 5]->numbers() is [-3, 4, 5].

Flags written as flags. header: false now gets a KS6024 style warning with a fix that writes not header (and overwrite: true becomes overwrite).

Behaviour changes

  • A csv's ->rows() and ->column() are retired in favour of ->cells(). Each is an error that names the replacement, and the quick fix keeps the arguments (->column('price') becomes ->cells(column: 'price')). See docs/upgrading.md.
  • csv cells written as numbers are now numbers, not text.
  • When a script doesn't say header or not header, a csv's first line is a header unless every cell on it is a number. .headers is empty for such a csv.
  • KS6024 (style warning): a yes/no option given true or false by name.

What's Changed

  • Read csv cells with one ->cells(row:, column:), and split numbers by spaces

ダウンロード

v0.47.0

Highlights

One way to convert between formats. ->convert(from:, to:) reads and writes every format, with ->from() and ->to() as shortcuts:

order = $reply->convert(from: json)                 // read text as a value
fruits = $prices->convert(from: csv, as: Fruit[])   // read and check against a type
echo $basket->convert(to: csv, headers: ['fruit'])  // write a value as csv
echo $settings->convert(from: yaml, to: json)       // both at once

A csv type. A ```csv block (or data: csv = 'a,b') is now real CSV, checked where it is written. Read it with .headers, ->rows(not header, as: Row) and ->column(0, not header, as: int[]), or save it with ->save('prices'). Types in as: are written as declarations write them: as: int, as: Price[].

Doc comment names are links. @see @welcome, @deprecated Use @welcome instead., @throws PageMissing and calls in @example are links: Cmd+click goes to the declaration, hovers link to it, and find references and rename include them.

Better suggestions after a typed variable. x: LineValues = 123 then x-> suggests the type's methods and adds the missing $. A type's rules (one_of, not, min, max, pattern, extra) are checked against its base type by one checker shared by the run and the editor, and the type docs table now says which options suit which types.

Printing a fn is caught. Echoing a fn instead of calling it is a KS2006 warning, with a fix when |> call(...) was swallowed into the fn's body. The fn->call docs example is fixed.

Behaviour changes

  • ->json(), ->yaml(), ->csv(), ->markdown(), ->to_json(), ->to_yaml(), ->to_csv(), a response's ->json(), and a document's ->html(), ->latex() and ->markdown() are retired. Each is now an error that names its ->convert() replacement, and the editor's quick fix rewrites the call and keeps its arguments (->json(as: Price[]) becomes ->convert(from: json, as: Price[])). See docs/upgrading.md.
  • @read_csv($data) with csv text in $data is an error: csv text isn't a file path. The same goes for Markdown, LaTeX, json and fenced source given as a path.
  • A text block given to a declared non-csv type (const data: LineValues = ```csv) is an error, with a fix that appends ->column(...) or ->rows(as: ...).
  • A quoted or bracketed type in as: (as: 'Price[]', as: [Price]) is an error with a "Change to Price[]" fix.
  • one_of / not values the base type can't hold, a non-number min / max, a pattern no value can match, and extra: written inside a record's block are errors.
  • Text that isn't a number, given to an int-based type, is an error ('12' still fits).

What's Changed

  • Link names in doc comments (Cmd+click and hover links)
  • Fix the fn->call example that printed its own code; warn when a fn is printed
  • Suggest a typed variable's methods after ->, and check a type's rules against its base
  • Add a csv type for csv text blocks, and write as: types without quotes
  • Convert formats with one ->convert(from:, to:)

ダウンロード

v0.46.0

Highlights

Arguments are checked strictly, in one place. One core rule decides whether an argument fits its parameter. The editor, kscript check and the run all use it and report the same words:

rolls = [4, 6, 6, 2]
$rolls->common(1, least)          // [2]: least on its own is true
$rolls->common(1, least: {})      // Error: The 'least' argument needs true or false, but this is a map.
$rolls->common(fn() => 2)         // Error: The 'count' argument needs a number, but this is a function.
$rolls->common(1, by: 3)          // Error: The 'by' argument needs a function, but this is a number.

A flag given a value offers the quick fix "Write least on its own".

Block functions must give a value where it is used. An empty or return-less block passed to ->map(), ->common(by:) and similar is an error. ->each() and blocks that throw are fine.

Trailing commas. A comma before the closing bracket on the same line is an error in every list: fn(a,), [1, 2,], { a: 1, }, ->take(2,) and fn name(a,). The quick fix is "Remove the comma". Lists written one item per line can still end with a comma.

A default main script. kscript and kscript run with no file now run the project's main script. They look for app.main in kscript.json, then main.kscript or index.kscript. kscript run tools runs a folder's main script. VS Code gets a Run Project command.

Declaration blocks. Completion inside type, native type, model, job, error, extend and enum blocks offers only what that block holds, at every caret position. A statement written there (echo, if, return) is now an error that says where to put it. Keyword hovers link to the docs.

Testing. @check_script(path) returns what kscript check reports for another script, so tests can check editor errors next to run errors.

Behaviour changes

  • A number passed for a true/false parameter is an error. It used to be read as true when it wasn't 0.
  • ->map(fn(x) { ... }) with no return is an error. Use ->each() when only what the block does matters.
  • [1, 2,], fn(a,) and other one-line lists that end in a comma are errors.
  • A statement inside a type, model, job or error block is a KS3007 error.

What's Changed

  • Suggest only what a declaration's block holds, and link keyword hovers to the docs
  • main.kscript and index.kscript are default entry scripts
  • Strictly check argument kinds, block results and trailing commas

ダウンロード

v0.45.0

Highlights

Maths operators. Every operator now comes from one table, with hover text and editor checks in every spacing.

  • %% is mod and wraps round like a clock: -3 %% 12 is 9, where -3 % 12 is still -3. %%= changes a variable in place, and durations take it (-15m %% 1h is 45m).
  • ~/ divides into whole numbers, rounding down: 135 ~/ 60 is 2. It pairs with %%, and ~/= works too.
  • %= and **= join the compound assignments.
  • Comparisons chain one way, as in maths: 0 <= $score < 100. In a query a chain becomes AND.
  • ..= makes a range that takes in its end: 1..=10, $monday..=$monday + 6d.
  • ->bits(and:, or:, xor:, shift:, invert) works on a number's bits. &, |, <<, >> and ^ give errors that name the KScript way.
  • Whole numbers stay exact at any size: 2 ** 60 is 1152921504606846976.

Block functions. A callback can take a block of statements:

with_tax = $prices->map(fn(price) {
  taxed = $price * 1.5
  return $taxed->round()
})

Parameter types come from the call, and the editor and kscript fmt work inside the block.

File paths without quotes. @read_lines(./data/input.txt), ../shared/rates.json and ~/todo.md are file_path values, and the editor suggests the files next to the script after ./.

Lists and text. New ->numbers(), ->blocks() and ->grid() on text, and ->product(), ->combinations(), ->permutations(), ->scan(), ->transpose(), ->rotate() and ->split() on lists. ->common(count?, least) gives the most frequent items, or the rarest with least. .lines() and .is_empty() work in a function's place: ->map(.lines()). Callbacks show and check their signature, such as fn(total, item). New method guides cover every list and text method.

Enums one value per line. An enum can put each value on its own line with no commas, and kscript fmt picks one line or one value per line to fit.

Behaviour changes

  • %% is now mod (wrapping), and % is unchanged as the remainder.
  • ->between() is retired: write a chain, 1 <= $n <= 10.
  • ->most_common() is renamed to ->common(). Use ->common(count?, least) for the rarest first.
  • -5->abs() reads -5 as one number, so it is 5. -$x->abs() and -5 ** 2 keep their meaning.
  • ->reduce() without initial starts from the first item.
  • 2 ** 60 and other large whole-number results are exact rather than rounded.
  • ^ is an error. Use ** for powers.

See docs/upgrading.md for each change.

What's Changed

  • Add puzzle helpers: numbers, blocks, grid, product, combinations, permutations, scan, transpose, rotate, mod
  • One table for every operator, with caret tests in every spacing
  • Add %% for mod, which wraps round like a clock
  • Keep whole numbers exact at any size
  • Add ~/ for whole-number division, and catch // used as division
  • Add %= and **=, explain ^, and ask for brackets round a minus before a power
  • Chain comparisons one way, as in maths, and retire ->between()
  • Add ..= for ranges that take in their end
  • Add ->bits() and explain & | << >> ^ from other languages
  • Callbacks show and check their signature: fn(total, item)
  • ->common(count?, least), list ->split(), .lines() in callbacks, fuller docs
  • Method guides for lists and text, a leading dot in every loop, enums one value per line
  • File paths without quotes (./data/input.txt) with file suggestions; -5->abs() is 5
  • Block functions: ->map(fn(n) { statements })

ダウンロード

v0.44.0

Highlights

->most_common() on lists. $list->most_common(3) gives the items that occur most often, most first, each once and as they are, so numbers stay numbers. Ties keep list order. Leave out the count for every distinct item, and pass by: to match items by a key.

top = $input_data->most_common(3)
echo $top->reduce(fn(total, n) => $total * $n, 1)

Before, this took ->count_by() and sorting a map. Map keys are always text, so the numbers came back as '3' and '12', and + joined them instead of adding.

What's Changed

  • Add list->most_common() for the most frequent items

ダウンロード

v0.43.0

⚠️ Behaviour changes

Change Before Now
Empty comma slots (json,,, auto, [,, id], f(a,, b)) Ignored Error "Nothing comes before this comma." with a Remove the comma fix
Argument with no value (auto: ) Ignored Error on the name
columns: [] / columns: "", auto on a non-int key, enum with values: [] Passed kscript check Errors
Migration steps vs tables and models Not checked AddField of an existing column and DropIndex of a missing index are errors; AddField with no model column and DropField of a column a model still has are warnings
Double-quoted text with nothing to fill in ("text") Fine Style warning KS6020 to write 'text'; kscript check --fix rewrites it
Acronyms in names Conventions said HTTPQuery, make said HttpQuery One word everywhere: HttpQuery, FaqPage. Table names are unchanged

Highlights

Problems for the whole project. VS Code's Problems panel now lists every file kscript check covers, open or closed, and matches it line for line. Turn it off with kscript.problems.workspace. A warm kscript check is also much faster (4.9s → 0.4s on StickyBoard).

.name in for loops. In for account in @file_users() { ... }, .id is $account.id. Nested loops work, .name = ... sets the field, and typing . lists the item's fields first.

Hovers and Enter. Hover examples are in current syntax and highlighted like the file. Enter writes each argument for its type: Index(columns: [$1]), Get(path: /$1) { }, flags bare.

Field defaults agree everywhere. db diff, drift checks (KS5014) and new records read a default the same way, whatever the spelling ('member', member, .member, Role.member). role: Role = member no longer fails at run time.

Fixes

  • Enum values="[small, large]" reads the same in the editor as at run time.
  • "Did you mean" suggestions are the same in the editor and at run time (titel → title).
  • optional="on" and the other yes/no words convert and check the same everywhere.
  • The editor's open migration now applies ChangeField, so column types match what the migrator makes.
  • Through relations no longer get a phantom x_id column in the editor; the SQL preview reads table:.
  • Docs, samples and kscript make stubs use single quotes throughout; templates get quoted and code filters.
  • Model, type, job and error hovers show their fields one per line as code.

PRs: #309, #310, #311, #312, #313, #314, #315, #316, #317, #318, #319, #320, #321.

What's Changed

  • Read enum values and name groups through one core reader
  • One "did you mean" picker for the runtime and the editor
  • One set of case conversions for make, the checks, renames and the ORM
  • Error on empty comma slots and check migration steps
  • Read yes/no words with FlagText everywhere
  • The open migration's columns match what the migrator makes
  • One reader for field defaults: db diff, drift and records agree on every spelling
  • Hover examples in current syntax and highlighting; Enter writes each argument for its type
  • In a for loop .name reads the loop's item
  • List problems for the whole project in the editor, the same as kscript check
  • The editor's model shape asks KScript.Data for relations, keys and tables
  • Keep docs, samples and stubs in clean quotes (KS6020)
  • Hold the formatter's block reading to the parser

ダウンロード

v0.42.0

⚠️ Breaking

Inside its own methods, a record's fields are .name. In a type's methods and its construct block, the old spellings are now KS6012 errors:

Old Now
$title .title
title = ... .title = ...
this.title .title

Run kscript check --fix to rewrite them. $this still means the whole record (return $this, $this->save()), and handlers, bindings and fenced html templates keep $name / {$title}.

Highlights

Dot members. A leading .name means a member of whatever the place expects. Where an enum goes, .red is that enum's value (@paint(color: .red), color: NoteColor = .yellow, match .color { .red => ... }). Inside a record's methods, .text is its field and .save() its method. Anywhere else, .red needs a type here, with a fix that writes NoteColor.red.

Import on Enter. Picking a type or enum from another file of the project writes its import. An exact match is preselected, files imported with an alias offer st.Status, and an unknown type's error names the file it is declared in, with an "Import ..." quick fix.

Suggestions wherever a value is checked. Completion now offers the same values the checker accepts:

  • Migrations: table names for references:, table:, DropTable and RenameTable; enum words for values: [...] and default:. values: can also name an enum (values: NoteColor).
  • Models: extra: options, extends bases and return types.
  • Field names for ->pluck(), ->pick() and ->replicate(except:).
  • Enum words in comparisons, match arms, return '...' and <if test>.
  • Routes and the rest: HTTP methods, path parameters, @view(), @env(), $db->has_table(), cron:, paper: and durations.
  • Typing a space after ,, (, =, extends, as or catch shows what fits there. Quoted values no longer hide every suggestion in VS Code.

Fixes

  • kscript db diff no longer writes a ChangeField for an enum column whose default is written as a word or member (= yellow, = NoteColor.yellow). Negative number defaults (= -1) are kept too.
  • A saved migration that can't run yet (such as values: []) no longer hides enum suggestions and model checks.
  • A one-line trailing comma (key,)) is an error with a "Remove the comma" fix. Wrapped lists still end with a comma.

PRs: #302, #303, #304, #305, #306, #307, #308.

What's Changed

  • db diff: keep enum defaults written as a word or member
  • Suggest table names and enum values where migrations limit them
  • Keep enum suggestions when a saved migration can't run
  • Suggest and check every limited value the audit found
  • Import on Enter everywhere a project type or enum can go
  • Dot members: .red, .title and .save() mean what the place expects
  • Inside its methods a record's fields are .name

ダウンロード

v0.41.1

Highlights

Migrations are checked against their models. An enum column's values: must match the model field's enum. An extra or misspelt word is an error at the word ('ajcn' isn't a NoteColor value, so BoardNote.color can't hold it.) with a "Change to purple" fix, and a missing value is an error on the list (Add purple: ...). A column's type: must be the type its model field needs (BoardNote.x is number, so its column is type: number, not string.). Only the migration that last writes a column is checked, so older migrations that a later one changes are left alone.

Cleaner colours in migrations. Words inside a [...] list (values: [...], columns: [...]) are no longer shown in the italic flag style, and type: enum is coloured as a type, like int and string.

Fixes

  • Hovers, completion details and signature help say string (not text) for plain values, and string[] for a list of names such as values. The docs reference matches.

PRs: #301.

What's Changed

  • Check migration enum values and column types against the model

ダウンロード

v0.41.0

Highlights

The editor knows your types. Hovers, hints and completion keep the types you declare (rank: int, status: Status, lists as Tag[]), and values are checked against them: return types, record fields, type arguments such as int(min: 0), field and parameter defaults, migration default: and references:, and $config keys. Completion reads the same expected-type map the checks use, so it offers what the code accepts: an enum's values, a model's fields in create(...) and where(...), a record's keys inside { }, the project's views, error types after catch, and the statements that fit the block you're in.

One report per mistake. What will stop the script is an error, reported once, where it is, with a "Did you mean" fix: middleware, type and import typos (new KS3012 for a missing import file), unknown fields on closed records, and methods called on the wrong type.

Fields are symbols. Go to definition, find references and rename work on a model's fields across the whole project, from $post.title to where(title: ...) and order_by(title).

Colours and speed. Named arguments, text, types and native values (paths, emails, URLs, durations) each have their own colour, types used by name are coloured as types, and tokens no longer overlap. The language server now skips requests the editor has moved past, so a burst of keystrokes costs one analysis instead of one each.

One method per action. The method families are folded into one method with named arguments and bare-word flags: $date->add(months: 1, days: 2), '--draft'->trim('-', start), '7'->pad(3, '0', start), 'a.tar.gz'->after('.', last), $people->sort(by: .age, order: desc), $items->find(fn(x) => $x.done, last) and 'User ID'->case(snake). Durations and money use ->add()/->subtract() too.

Durations with years and months. 1y, 6mo and 5y10mo move a date by the calendar (m stays minutes), $finish - $start gives a duration, and 1796040000->to_date() reads a Unix timestamp. ->since($born, in: years) counts whole units.

Behaviour changes

  • The old method names are errors that say what to write ("renamed to ..."), with no aliases: add_years/add_months/add_days/add_hours/add_minutes, months_since/years_since, duration_since, duration plus/minus, trim_start/trim_end, pad_left/pad_right, strip_prefix/strip_suffix, before_last/after_last, last_index_of, replace_pattern, find_last, find_index, sort_by, max_by/min_by/unique_by, and snake_case/kebab_case/camel_case/pascal_case. See docs/upgrading.md for the full list.
  • A date no longer moves by a plain number: $date + 1 is an error. Write $date + 1d or $date->add(days: 1). Only durations move dates.
  • $finish - $start is now a duration (it was a number of days).
  • Durations take y and mo for years and months; m stays minutes. Anything that needs a fixed length (wait(1mo), ttl: 1y, .hours, /, %) refuses months with a message.
  • Field defaults are checked against their type: color: NoteColor = 'r' and rank: int(min: 0) = -5 are errors.
  • Reading a field a record type doesn't have is an error in the editor, as it is at run time. A missing import file is KS3012.

PRs: #284-#300.

What's Changed

  • Hide type hints on typed fields; show lists as T[]
  • Check field defaults against their type and suggest only what it allows
  • Editor acceptance scenarios over a fixture project
  • Editor: keep declared types and check values against them
  • Give named arguments, text, types and native values their own colours
  • Editor: one expected-type map that completion and checks share
  • Editor: completion by context
  • Editor: one report per mistake, and errors where the code can't run
  • Dates: one ->add() and ->subtract() for calendar units
  • Editor: fields are symbols
  • Editor: colours from the analysis, and no overlapping tokens
  • Language server: skip requests the editor no longer wants
  • Editor: typed migrations and $config
  • Arithmetic: one add/subtract on every value, durations between dates
  • Text: one method per action, with flags for where it applies
  • Lists and identifier styles: by: and last are options, not methods
  • Years and months in durations: 1y, 6mo, 5y10mo

ダウンロード

v0.40.0

Highlights

The gap audit is built. v0.40.0 fills in the missing methods, features and tidy-ups found in the 2026-11-29 audit, all in one release.

Web, security and scheduling. Multipart posts fill $request.files, and @api takes encoding: and query:. New: @signed_url with the signed middleware, @encrypt/@decrypt, @rate_limit and cache->lock, response cookies, CSV responses and @redirect_back. A scheduler: Schedule { Task(...) } with kscript schedule run|work|list. Sessions, tokens and the cache can live in the database.

Mail and verification. The new KScript.Mail package gives @send_mail with smtp, log and fake drivers, queued sends, @fake_mail() and kscript make mail. make auth now emails password-reset and verification links, with @verification_token, @verify_email, email_verified_at on User and a verified middleware.

Data and queues. Model hooks, update_or_create, group_by totals, sole, increment and touch. event and listener for declarations with @dispatch_event. Job batches, job middleware and @retry, plus ->retry(all) and ->clear(failed). A dispatch inside a transaction waits for the commit (not after_commit queues at once).

Core methods. Case conversions, hmac and set operations on text, lists and maps. Dates gain start_of/end_of, .is_past/.is_weekend, @format_relative, @format_bytes and @format_list. Storage and files read and write bytes. Urls use one method each way: $url->with(path: '/docs', fragment: 'top') and $url->without(query, fragment).

Editor and generators. Components complete as statements and make component --for window|terminal|document. Quick fixes "move to its own file" and "add the import", and renaming a file updates its imports. Typed User fields on @register, table columns checked against their rows, LaTeX commands checked. make controller --model writes real model code, and make model takes --policy, --migration, --controller, --seeder and --all. unique: and exists: request rules.

Behaviour changes

  • ->with_query() is retired: it is an error that points to ->with(query: values). See docs/upgrading.md.
  • Every command, kscript db included, now rejects an option it doesn't have, with one wording: Unknown option '--x' for kscript db. Run kscript db --help for the options. Usage mistakes exit with 2, failures with 1.
  • kscript check --output json writes snake_case keys: end_line, end_column and new_text (were endLine, endColumn, newText). All of KScript's own JSON is snake_case.
  • An import cycle is now an error, KS3011.
  • Type methods write a record's fields by reference, so a change made inside a method is seen by the caller.
  • kscript fmt writes unions without spaces: int|uuid.
  • A queued dispatch inside a transaction now waits for the commit.

PRs: #283.

What's Changed

  • Build the full gap audit: methods, half-built features and refactors

ダウンロード

v0.39.0

Highlights

Built-ins use the new type forms. The built-in options, parameters and methods now declare their types with the forms from v0.38.0, so the editor completes, links and checks them the same way it does your own code.

  • Options that take one of a few words are word unions: Document(style: plain|paper|report|letter|invoice), echo format: text|'json'|'markdown', ->sort_by(fn, order?: asc|desc), $log->is_enabled(level). Write the words bare: format: hex, sort_by(.priority, desc).
  • Options that name fields are typed: job unique_by: Self.fields[], ModelUpdate fields: model.fields[], Resource only/except as (index|store|show|update|destroy)[].
  • Record and list methods name the receiver's fields: ->is_dirty(field?), ->pluck(key), ->pick([title, views]) and ->omit([...]). A typo like $post->pick([titel]) is a KS5013 error with "Did you mean title?".

Typed queries. @db('posts') rows carry the table's columns, and the query builder is declared with Self types: ->find() and ->first() give Self?, ->get() gives Self[], ->value(title) gives the column's type and ->pluck(title) a list of it. Completion after a chain only offers methods that fit. ->where(views: 'many') and ->create(status: deleted) are KS5012 errors that name the field's type, and an unknown table is a KS5013 warning with a did-you-mean fix.

Migrations hold only their steps. Directly inside Migration { }, Down { } and CreateTable { }, completion offers only their steps (CreateTable offers Field, Index, Key). Other code beside the steps is a KS3007 error; put it in a Run { } step.

Test watch redraws in place. At a terminal, kscript test --watch clears the screen before each run so only the latest result shows. Piped output, CI logs and --no-ansi still append. Editing a migration now reruns every test that uses the test database, not just the first one.

Behaviour changes

  • A body on an element that takes none (DropTable(name: 'old') { ... }, <break>x</break>) is now a KS3008 error instead of a warning: DropTable doesn't take a body; remove the { } after it.
  • Code written directly inside Migration, Down or CreateTable (outside Run { }) is now a KS3007 error and fails before the file runs.
  • ->add_days() or ->save() on a @db row is a KS5005 error, and @db('') is an error.
  • ->pick and ->omit on a record refuse a field the record doesn't have, and list its fields.

PRs: #273, #275, #276, #277, #278, #279, #280, #281, #282.

What's Changed

  • Make content on an element that takes none an error
  • Type method chains through @db queries so completion only offers methods that fit
  • Redraw kscript test --watch in place; rerun DB tests when migrations change
  • Migrations hold only their steps: checks and suggestions fit the caret
  • Built-in options and parameters declare their words as word unions
  • Declare the query builder with Self types and read them in the editor
  • Element options that name fields or actions use the type forms
  • Methods that name the receiver's fields are typed Self.fields
  • Docs and samples use bare words and list the typed built-in options

ダウンロード

v0.38.0

Highlights

Types from types. A parameter or field can now take its type from another type, the way TypeScript does, and the editor completes, links and checks the names.

  • Post.fields is one of Post's field names, written bare: fn sort(by: Post.fields) then @sort(title). Post.fields(except: [body]), (only: [...]), (relations: false) and (relations: only) narrow it. A model's own fields (id, keys) and relations count.
  • Post.title is the type of Post's title field, with its rules. Post.title(max: 80) adds rules, Order.address.postcode goes further in, and Order.lines.item is one item of a list field.
  • Self.fields and Self.title work inside a type or model.
  • draft|live is one of these words. int|uuid is a value of either type, and card|'email' quotes a word that would otherwise be a type. (draft|live)[] is a list. Field lines and return types read unions too: status: draft | live = 'draft'.
  • One-of groups can hold unions: id|slug: int|uuid, (as: draft|live | template: Template).
  • A model field written status: draft|live is a database enum column.

Column and field names in lists. Index(columns: [...]), Key, AddIndex, DropField, foreign keys and model options such as hidden: [data] now offer, link (hover, go to definition, colour) and check their table's columns or the model's fields, including tables from earlier migrations and models.

Behaviour changes

  • An unknown column in a query (->where(titel: ...)) or in a migration step is now an error, like any typed argument, instead of a warning.
  • Messages for field names list every name: 'titel' isn't one of Post's fields. Use title, body or tags.

PRs: #270, #272, #274.

What's Changed

  • Types from types: Post.fields, Post.title, .item, Self, word and type unions
  • Type built-in field-name options with Self.fields and table.fields

ダウンロード

v0.37.0

Highlights

Clearer colours in the editor. Variables and parameters ($account, including inside "{ $x }") now have their own colour, a soft orange, or a darker orange in light themes, since many themes left them as plain text. Map keys (insert({ id: ... })), keys in a call (where(id: ...)) and flags such as optional in AddField(...) are coloured like named arguments. (#268, #271)

Field names in column lists are real references. Index(columns: [...]), Key(columns: [...]), AddIndex/DropIndex columns, DropField, RenameField and ChangeField complete, link to and check the fields their table has at that step. (#270)

Fixes

  • A signed-in session cookie now wins over @acting_as_guest() on in-process @api requests, so a test can follow a guest through sign-in and check adopt_guest. (#266)
  • The Down block kscript db diff writes for an Ownable upgrade fills a required field before requiring it, so rolling back works on tables with rows. @file_users() gives its dates as dates. (#267)
  • kscript fmt fully formats files whose doc comments contain an apostrophe, instead of falling back to layout only and reporting nothing changed. (#269)

What's Changed

  • A signed-in session cookie wins over @acting_as_guest() on in-process @api
  • db diff's Down block fills a required field before requiring it; @file_users() dates are dates
  • Colour map keys, named arguments and bare flags like element arguments
  • Fully format files whose doc comments have an apostrophe
  • Complete, link and check field names in column lists
  • Give variables their own colour in the editor

ダウンロード

v0.36.0

Highlights

Migrations can move data. Code in a migration now goes in a Run { } block, which runs at its place among the steps, with the migration's connection and transaction. It sees the tables and columns made above it, and if it fails the migration is undone. A migration with a Run block needs a Down block to roll back. (#260)

Upgrading to Ownable relations. kscript db diff now sees an Ownable model's owner text being replaced by user_id and guest_id, and writes a Run block that copies each row's owner across, making the guests it names, before owner is dropped. A Down block puts it back. @file_users() reads users kept as files, with their ids and password hashes, so a migration can copy them into a published User model. The upgrade guide shows both migrations. (#262)

Fixes

  • Database work in a migration outside a Run block is now an error that points to one. Before, it ran when the file was read, even for kscript db status and db diff, before any table was made. (#260)
  • The old config.files list in kscript.json is now an error that says where each file goes. Since 0.35 it was read as a plain value and its files were skipped, so the app ran on its defaults. (#261)

What's Changed

  • Run { } blocks: migrations move data at their place among the steps
  • kscript.json: the old config.files list is an error that says where each file goes
  • Upgrading Ownable rows and file users: db diff backfills owner, @file_users()

ダウンロード

v0.35.0

Highlights

Tests rerun only what a change affects. While each test runs, KScript notes the functions, types, models, jobs, scripts and files it reaches, so the next kscript test in a project runs only new tests, changed tests, last run's failures and tests whose code changed. --all runs everything and --failed reruns last run's failures. --changed runs the tests git's changes can affect (--changed master compares with a branch), and --watch reruns the affected tests each time you save. Named files, --filter and CI runs still run everything they name. (#232, #233)

Faster kscript serve and kscript check. serve parses each script once and again only when it changes, so a request on a 40-controller site drops from about 75-220 ms to about 35 ms, and the route table is rebuilt when anything the routes reached changes (#236). check keeps its results in .kscript/cache/check.json and analyses a file again only when it or something it looked at changed: an unchanged check of 83 files takes 0.24 s instead of 2.1 s. kscript check --all analyses everything (#237).

Settings live in kscript.json. $config now comes from the config section of kscript.json, with kscript.<env>.json laid over it and an optional config.kscript beside kscript.json for values worked out in code. kscript make config base writes config.kscript, and kscript make config <env> writes kscript.<env>.json. .env files feed @env() only. See "Settings: $config" in the language guide. (#234)

Users, guests and models you can change. Ownable rows now have typed user and guest relations. KScript.Auth's User, Guest and Ownable ship as models a project can copy in and change: kscript publish writes a package's model into your project, and the package then uses your copy (#227). With http.auth.users set, people who sign up with a passkey become User records too, so Ownable and user relations work in passkey apps (#230). queue.connections.<name>.tables renames the database queue's tables, and kscript publish queue writes a migration for them (#231).

Docs. Every guide has been rewritten Laravel style: a short introduction, what each feature is for, and a small example for each idea. A new reference page lists every environment variable kscript reads, and CI now checks that every variable, diagnostic code, format rule and MCP tool is documented. (#226, #228, #239-#256)

Breaking changes

  • YAML config files (config/config.yaml, !kscript expressions) are no longer read. Move their values into the config section of kscript.json, or into config.kscript for computed values.
  • The kscript.json settings config.files, config.root, config.prefix, config.required, config.environment, config.user and paths.config were removed. app.user_config replaces config.user.
  • .env values no longer appear as $config keys. Read them with @env().

What's Changed

  • Docs: Databases guide in the new style, page directives and VS Code reference pages, italic signatures
  • KScript.Data ships Timestamps and SoftDeletes mixins; docs list every built-in mixin, option and table
  • Docs: environment variables reference page, and CI checks that every variable, code, format rule and MCP tool is documented
  • Run CI only on pull requests, and queue auto-merge PRs one at a time
  • Skip CI jobs that have nothing to test, behind one "CI result" check
  • Ownable user and guest relations; User, Guest and Ownable as models a project can publish and change
  • Passkey sign-up keeps users in the User model
  • Queue table names in kscript.json; kscript publish queue writes their migration
  • PR queue: update branches with a token so their own CI runs
  • kscript test runs only the tests a change can affect
  • Docs: Caching guide in the Laravel style
  • Docs: App folders guide in the Laravel style
  • kscript test --changed (git diff) and --watch
  • Docs: Queues guide in the Laravel style
  • Docs: Desktop apps guide in the Laravel style
  • Docs: Installing guide in the Laravel style
  • Keep the app's settings in kscript.json, with kscript.<env>.json and config.kscript laid over it
  • Docs: Stylesheets guide in the Laravel style
  • Docs: Compiling guide in the Laravel style
  • Docs: MCP guide in the Laravel style
  • kscript serve parses each script once, and again only when it changes
  • kscript check analyses only what changed
  • Docs: Standards guide in the Laravel style
  • Docs: Web guide in the Laravel style
  • Docs: Agents guide in the Laravel style
  • Docs: Code format guide in the Laravel style
  • Docs: Formatting guide in the Laravel style
  • Docs: Testing guide in the Laravel style
  • Docs: Documents guide in the Laravel style
  • Docs: Projects guide in the Laravel style
  • Docs: Types guide in the Laravel style
  • Docs: Components guide in the Laravel style
  • Docs: Language guide in the Laravel style

ダウンロード

v0.34.0

Highlights

Models and mixins in the reference. A new reference page, Models: options and built-in mixins (kscript docs, then Reference), lists every option a model takes (soft_deletes, timestamps, mixin, unique, guarded, ...) and every model and mixin a package ships, such as KScript.Auth's Ownable, with its fields, scopes and methods. It is generated from the code, so new mixins appear by themselves. Each option and mixin also has its own search entry and A to Z entry, and package pages link the mixins they ship. (#222)

Fixes

  • @api calls answered in-process (in tests) now read form-urlencoded request bodies, as kscript serve does. Form fields reach the controller, and a _token field no longer fails the CSRF check with 419. (#219, fixed in #221)

What's Changed

  • Read form posts in in-process @api
  • Docs: a reference page for model options and built-in mixins

ダウンロード

v0.33.1

Fixes

Editor colours in .kscript files. A path such as / passed before a later argument that holds a / in quotes, as in @api(/, options: { headers: { Cookie: 'a/b' } }), was coloured as a regex up to the quoted /. That left a quote open for the rest of the file, so ->, method calls, named arguments and brackets below it took the wrong colours, and VS Code showed bracket pairs in red. It is now read as a path, as kscript check and the runtime already did. Two smaller fixes come with it: a call inside a statement call (expect($reply->header('x'), ...)) no longer ends the statement early, and a map key written before { is no longer coloured as a tag. Run kscript ide install after updating. (#220)

What's Changed

  • Fix -> and bracket colours after a root path before a quoted /

ダウンロード

v0.33.0

Highlights

  • One-of parameter groups: fn file(add|remove: file), optional at|after?: date, mixed types (text: string | template: Template). Passing two members, or none of a required group, is an error in kscript check and at run time. Members are passed by name and share one colour in the editor. @api and ->dispatch() use them.
  • KScript.Auth ships an Ownable mixin (owner, ->mine(), ->is_mine()), guest ids with @guest(), @owner() and @acting_as_guest(), and adoption of guest records after sign-in.
  • Packages can ship models and mixins written in KScript.
  • Model scopes are known across files and from mixins, and import aliases are suggested.
  • Docs: every built-in command, method and element has an example. There are CLI example tables, reference pages for types, error types and settings, an A to Z, and a contents page.

Fixes

  • ->dispatch(delay:, at:) with both is refused.

What's Changed

  • Know model scopes across files and from mixins, suggest import aliases, flag statements that only name something
  • Ownable mixin, guest ids and owners, and dispatch(delay:, at:) refused
  • Docs: built-in models and mixins, scopes, and finding them in search_docs and lookup
  • Give every built-in command, method and element an example
  • Show CLI examples as a table of command and what it does
  • Docs: reference pages for types, error types and settings, an A to Z, and a contents page
  • One-of parameter groups: add|remove: file

ダウンロード

v0.32.0

Highlights

Argument names in @-commands are highlighted. Inside @on-click(call: $add, with: [...]), @drag(copy: true, value: $c), @each(Note->all(), as: n) and the rest, argument names now get their own colour, and the values are highlighted as KScript expressions. Named arguments and map keys in .kscript code (@range(1, 10, step: 2), { name: 'x' }) get the same colour. (#206)

HTML attributes next to @-commands keep their colours. A -> or > inside an @-command, such as @each(NoteColor->keys(), as: c) or @if($count > 3), used to end the tag in the editor, so later class, title and aria-label attributes showed as plain text. They're now highlighted as normal. (#206)

Fixes

  • When a tag has more than one handler, each handler's $event now has that handler's own fields, whatever the order. @on-dblclick(...) followed by @on-drop(... $event.drag_value) no longer reports KS5010. (#205, #206)

What's Changed

  • Highlight @-command arguments, keep tags whole after ->, and fix $event per handler (#205)

ダウンロード

v0.31.0

Highlights

$event is typed per handler. Each handler gets the fields it really sends: the common browser fields (type, value, checked, key, x, y, files and more) plus its own (on-event: name, data, source; on-action: name, data; on-sort: item, from, index, order; on-drop: drag_value; on-dragend: vx, vy, moved, z). Completion after $event. offers only those, hover shows each field's type, and reading a field the event doesn't have is KS5010. (#204)

$event.data takes the type of what @emit_event sends. In an on-event listener, hover says which @emit_event('name', data) calls feed it and where they are, and $event.data has their type. $os and $script describe their keys too. (#204)

@visit delivers events between components. An event a handler sends with @emit_event() or emit: now reaches the target block, or every listening block, runs its on-event listener and redraws it, as the browser does. An undo toast after a delete can now be page-tested. (#202)

Fixes

  • KS6002 no longer reports a type's method as never called when the only calls are in scripts that reach the type through another script's function. (#201)
  • A list of records of one type, such as [@zoo.make('a'), $other], keeps that type, so methods on its items check.

What's Changed

  • Count method calls through imports for KS6002, and deliver events in @visit
  • Type $event per handler and infer $event.data from @emit_event

ダウンロード

v0.30.0

Highlights

@visit renders pages that routes serve. A page test now reaches a path the way kscript serve does: routes first (a view: route or a controller returning @view(...), with their middleware), then file pages. Live clicks on a routed page run against the route, a visit keeps the cookies the app sets and follows redirects (.path is where it ended up), @acting_as() signs it in, and @visit(path, { headers: { Cookie: 'guest=abc' } }) or bearer: send headers of their own. Pages from kscript make auth, such as /account and its API tokens, can now have page tests. (#198)

Imported records keep their methods in kscript check. A call through an import alias, such as @notes.find(...), now has the type the function returns in its own script, so a model's list items keep their type's methods: $b.links[0]->address() no longer reports KS5003. (#197)

Fixes

  • kscript make auth no longer breaks a one-line kscript.json ({ "name": "x" }) by writing the password rule after its closing brace.
  • kscript make error refuses a message with an empty {} (what a shell leaves of "{$id}") or a double quote, instead of writing code that doesn't parse. The make error and make native examples now quote $id and $value in single quotes.
  • kscript make middleware's hint shows the import path in quotes.

What's Changed

  • Check aliased imported function calls with their return types
  • Let @visit render pages that routes serve, and fix kscript make

ダウンロード

v0.29.0

Highlights

Handler shorthands, the full set. A handler can name what it does: @on-click(toggle: $open), increment: $count, by: 5, set: $tab, to: 'notes', add: $draft, to: $tags, reset:, cycle:, save:, delete:, emit: and go:. Modifiers change when an action runs: confirm:, key: [ctrl, s], prevent:, debounce:, throttle:, once:, self: and disable:. decrement: never goes below a field's min:, and completion after an action lists only the fields that fit it.

@if and @each on a tag. <p @if($note)>{$note}</p> and <li @each($tasks, as: task, at: i)> replace a wrapping <if> or <for> around a single tag.

Short functions. $orders->sort_by(.priority), ->group_by(.shop.name) and ->map(->trim()).

Bindings. @bind($query, on: blur, debounce: 300ms, as: int, trim: true). Windows take the same options: TextBox(bind: $name, trim: true, on: blur).

More shorthands. @show($open), @class(done: $todo.done), @live-disable(while: $saving), @api(url, post: $body, bearer: $token, as: Note), @view('auth/login', ..., status: 429) and expect($total, equals: 3). Window buttons take actions directly: Button(toggle: $open) "Details".

Components. @drag moves an element or drags a copy onto on-drop. This release also adds on-dblclick, $event.x/$event.y, @drop-files, @drop-class, @focus, @autogrow and @pending.

Breaking changes

Each of these old spellings is now an error, with a quick fix (kscript check --fix) to the new form:

  • @bind-on(blur) and bind-on="blur": write @bind($x, on: blur)
  • @bind('x') and bind="x": write @bind($x)
  • live-confirm="…": write confirm: '…' on the handler
  • prevent-default="keydown": write prevent: true on the handler
  • drag-value: write @drag(copy: true, value: …)
  • @api(url, options: { method: 'POST', body: $b }): write @api(url, post: $b) (also put:, patch: and delete: true)
  • expect(value: $x, equals: 1): write expect($x, equals: 1)

What's Changed

  • Add @focus, @autogrow and @pending component directives
  • Add on-dblclick, $event.x/y, @drop-files and @drop-class
  • Add @drag: move an element, or drag a ghost copy onto on-drop
  • Add handler modifiers, more shorthands, @bind options, @show and @api shorthands
  • Add the remaining shorthands and retire the old spellings

ダウンロード

v0.28.0

Highlights

Sign-in pages made of components. kscript make auth now writes its pages as a layout, a heading and components: sign-in-form, sign-up-form, forgot-password-form, reset-password-form, status-message, account-details, passkey-list and api-tokens. Making and revoking API tokens and removing passkeys happen inside the components as live actions, so /account is a plain page and the old POST routes for them are gone. The auth sample and docs/auth.md use the same components.

Handler shorthands. A handler can name the action it runs: toggle: $open, call: $save, with: [$note.id], increment: $count, by: 5, decrement: $stock, set: $tab, to: 'notes', add: $draft, to: $tags and remove: $tag, from: $tags. The editor completes them and shows on hover the statement each one stands for. A handler's single value is now always an action (a function or method to call), so @on-click($open) is an error with a quick fix to toggle:.

@class. @class(done: $todo.done, 'is-open': $open) adds classes when their conditions are true, on top of the tag's own class. The condition-first form is @class({ $todo.done: ['done', 'struck'] }).

Page tests with @visit. In a .kscript test, @visit('/tasks') renders a page of the project. ->click(text), ->change(label), ->fill(field, value) and ->submit() run its live handlers, and .text, .html and ->classes(text) show the result. New web projects include a Tasks page test, and samples/task-board shows the shorthands with tests.

Tests can act as a user through @api(). @acting_as() now applies to the routes a test calls with @api(), and a Cookie header passed to @api() reaches the route's $cookies.

Every Set-Cookie is kept. .headers['Set-Cookie'] is a list when a response sets more than one cookie, and the new .cookies field gives { name: value } for each cookie a response set.

Markdown and LaTeX blocks. A md block has the document methods (`->html()`, `->latex()`, `->words()`, `->pages()`) and `->save()` renders PDF, Word, LaTeX or HTML from the file extension. A latex block saves as .tex. Calling a method a block doesn't have is now an error rather than a warning.

Docker keeps your accounts. docs/projects.md explains where a container keeps its data (KSCRIPT_STORAGE_ROOT and KSCRIPT_PROJECT_DATA_ROOT), and kscript serve in a container warns when either is missing. Docker files made before 0.27 need the lines in "Docker files from before 0.27" added by hand.

Editor. Typing -> at the end of a line above a fn declaration no longer swallows the declaration, so the editor suggests the right methods.

Upgrading

  • Projects made with an earlier kscript make auth keep working. To switch to the component pages, compare with a new project made by kscript make auth.
  • Change @on-click($flag) on a bool to @on-click(toggle: $flag). kscript check points each one out and offers the fix.

The full list of changes is in #188, #189, #190 and #191.

What's Changed

  • Fix #183-#187: in-process @api() cookies and @acting_as(), every Set-Cookie, Docker storage folders, fence methods
  • Build the sign-in pages from components
  • Keep a fn under an unfinished -> and add the toggle: handler shorthand (on master)
  • Add optional handler shorthands, @class and @visit page tests

ダウンロード

v0.27.0

Highlights

Policies. A policy for Post { } block says who may create, read, update and delete a model's records. Each function in it is an ability that takes the user, then the record, and returns true or false:

policy for Post {
  fn create(user: User) => $user.role == 'editor'
  fn read(user: User?, post: Post) => $post.published or $user?.id == $post.author_id
  fn update(user: User, post: Post) => $user.id == $post.author_id
  fn delete(user: User, post: Post) => $user.id == $post.author_id
}

Ask it with @can(update, $post), @cannot(update, $post) and @authorize(update, $post), with can: update on a route, or with model: Post on a Resource, where each action asks its own ability. A refused user gets a 403. A guest is sent to sign in, or gets a 401 on an API route. kscript make policy Post writes one, @acting_as($user) sets who is asking in a test, and the editor reports an ability the policy doesn't have. See docs/auth.md.

@inject(): take the route's record. An input can default to the record the route holds, so a page writes <post-card /> with nothing passed:

type PostCard extends Component {
  construct({ post: Post = @inject(can: read) })
}

@inject() reads the model from the input's type and the path parameter from its name. @inject(from: article) names another parameter, @inject(can: read) asks the model's policy as the record is taken, and @inject(Post) works on its own anywhere a route is being answered. What a caller passes always wins. It works in any type's construct, not only a component. The editor warns (KS5017) when an injection takes a model that has a policy without asking it. See docs/components.md.

private fields and methods. private count: int and private fn tally() keep a member to the type's own methods. Other code can't read, set, call or pass it, and private fields are left out of JSON. It works on models and on live components, which keep private state between updates. See docs/types.md.

Behaviour changes

  • An error with a status that is raised while a view is drawn (for example NotFound or Forbidden) now answers with that status instead of a 500.
  • policy for Name at the start of a statement now opens a policy block. A variable called policy still works.
  • policies is a new project folder, set with paths.policies in kscript.json.

The full change is in #182.

What's Changed

  • Add private members, @inject() for the route's record, and policies

ダウンロード

v0.26.0

Highlights

Components beyond web apps. A component can now be drawn in a desktop window, in the terminal and in a document as well as on a page. Each place gets its own render, and what the render holds shows where it draws: an html block for a page, KScript.UI elements for a window, echo for the terminal, and document elements or a returned md or latex block for a document. Write a component as a statement (NoteCard(title: $note.title)) to draw it, and use slot for what the caller puts inside. See docs/components.md.

Constructors and one-value handlers. A type can hold one construct({ ... }) { ... } block listing what callers may pass; every other field is the value's own state. Handlers can be a single value: on_click: $open flips a bool, on_click: $save calls a function.

Single-file components. A component can keep the types, enums, errors and models that only it uses inside its own block. kscript db diff and kscript db status read models kept inside components.

About 130 fixes from a full-project audit, including:

  • kscript db fresh --pretend no longer drops tables, and ->limit(n)->update()/delete() is now an error instead of changing every matching row.
  • Values in Markdown pages can't add HTML attributes, cached responses are never shared between signed-in visitors, and @api / @download no longer share cookies between requests.
  • echo prints quoted text exactly as written, spaces included.
  • Tests that time out inside expect_error or try/catch now fail.

Downloads are checked. Every release from this one lists the SHA-256 of its files in SHA256SUMS. The install scripts, kscript update and kscript compile check each download against it and install nothing when it doesn't match. Older releases still install, with a note that the download wasn't checked.

Behaviour changes

  • Stored dates now use the "timezone" setting in kscript.json, which is Europe/London when it isn't set. If your existing rows were written on a computer in another zone, set "timezone" to that zone (for example "UTC") so they keep reading the same.
  • !=, not and where_not in queries also return rows where the column is null.
  • $request.query.x and $request.form.x are a list when the name is sent more than once.
  • Numbers never print with an exponent, and 1 < 2 < 3 is an error.
  • With --env production, a 500 page shows a generic message and the details go to the log.
  • A page's render and style no longer need : Component and : ComponentStyle (the typed form still works).

The full list of fixes and changes is in #180 and #181.

What's Changed

  • Isolate test app data and guide agents toward live components
  • Infer document types from fences and add explicit document exports
  • Fix KScript issues #167–#176 and configure local Docker serving
  • Fix about 130 bugs and inconsistencies found by a full-project audit
  • Components beyond web apps, on top of the audit fixes

ダウンロード

v0.25.0

v0.24.1

v0.24.0

v0.23.0

v0.22.1

v0.22.0

v0.21.1

v0.21.0

v0.20.0

v0.19.2

v0.19.1

v0.19.0

v0.18.0

v0.17.0

v0.16.0

Project configuration migration

KScript projects now select their settings sources in kscript.json under config.files. If your project already uses YAML, list that file to keep loading it. For example:

{
  "config": {
    "files": ["config/config.yaml", ".env?"]
  }
}

File paths are relative to the project folder, or to config.root when set. If config.files is omitted, a project loads its optional .env and environment-specific variant.

New projects use a config script that returns settings from configure(environment). Explicitly selected YAML also supports KScript expressions.

Language and editor

  • Use !condition as shorthand for not condition and ->!method() to negate a method result.
  • Error constructors offer completion and signature help for named arguments. The linter explains how to pass an error payload when it sees a positional map.
  • The editor, local docs, and MCP reference show statement syntax for the selected format.

What's Changed

  • Add script configuration, Boolean negation, and editor coverage

ダウンロード

v0.15.1

v0.15.0

What's Changed

  • Install pinned Git submodules and extract first-party source libraries
  • Restore pinned source libraries and add scoped error handling across KScript tooling
  • Let a project manifest point to its installable library folder
  • Add compact money literals, exchange rates and runnable workflow tests
  • Add 75 runnable KScript language test scenarios

ダウンロード

v0.14.0

v0.13.0

What's Changed

  • Read joined words and native-based types as pattern literals
  • Fix model argument completion for database table methods
  • Align KScript library behavior, editor support, and references

ダウンロード

v0.12.0

Pattern-backed literals

A string refinement can recognize an unquoted word by its pattern. Here, KScript infers PasskeySessionKey from passkey_login.

type PasskeySessionKey with [string] {
  pattern: /^passkey_[a-z]+$/
}

key = passkey_login

Hover over $key to see the inferred type. When multiple visible types match, the checker and runtime name the candidates. Write passkey_login as PasskeySessionKey to select one. Repeated lookups reuse the visible patterns, and computed casts can reuse a successful static check for a repeated short string. Custom validators and normalizers run on every evaluation. Custom literals

Editor and HTTP

  • Typing the opening { of a function or method leaves Enter free to start an indented line. Typing ech still offers echo, and Ctrl+Space still opens suggestions.
  • Served responses now default to Server: kscript, and outgoing script requests default to User-Agent: kscript. A route can set its own server header, and an @api() call can override its user agent for one request. HTTP guide

Pull request #138 · Full changelog

ダウンロード

v0.11.0

Passkeys and live model components

  • kscript make auth --passkeys scaffolds passkey registration and sign-in. Credentials survive restarts, and a user can enroll a second device on the same account. Passkey setup
  • Bind an HTML component to an owner-scoped ModelUpdate declaration. kscript make component ProfileEditor --model-update edit_profile --fields bio generates a Save button. Add --autosave to save after typing pauses. Model-bound forms

Language and tooling

  • expression as Type evaluates the expression once and applies the target's normal conversion, normalization and validation. For example, session_key = "passkey_{$kind}" as PasskeySessionKey. Checked conversions
  • A trailing comma in a refinement declaration such as min: 8, now raises KS1001 at the comma in the CLI and editor. The quick fix removes it.
  • $users->pluck(name) returns a list of names. $users->pluck([id, name]) returns one map per user. Array methods
  • @random_bytes(16, format: 'hex') generates 32 hex characters using the operating system's secure random generator. kscript make docker adds Docker and Compose files to an existing project. Docker scaffolding

What's Changed

  • Add passkeys, live model components, array pluck and checked casts

ダウンロード

v0.10.1

v0.10.0

What's Changed

  • Stop the editor reporting KS1003 in AGENTS.md
  • Suggestions in views: typed $data, loop items and $session
  • Add slash_path and date_format native types, and bare route paths
  • Check standalone scripts and fix workspace targeting in the KScript editor
  • Native types declare their operators: the NativeType contract
  • Make imported modules and typed values work in the editor

What's Changed

  • Stop the editor reporting KS1003 in AGENTS.md
  • Suggestions in views: typed $data, loop items and $session
  • Add slash_path and date_format native types, and bare route paths
  • Check standalone scripts and fix workspace targeting in the KScript editor
  • Native types declare their operators: the NativeType contract
  • Make imported modules and typed values work in the editor

ダウンロード

v0.9.0

Highlights

This release has breaking changes. KScript now has one way to write each thing, and old spellings in a .kscript file are errors that name the new one. Run kscript check --fix to rewrite most of them, then kscript check for the rest. Every change is listed in docs/upgrading.md.

  • One way to write each thing. 45 places where the language had two or more spellings now have one: "double quotes" always fill in $name and { } while 'single quotes' keep text as written, a name being set has no $ (total = 3, fn(n) => $n * 2), types are named bare and called to make a value (Repo(name: 'x')), optional fields are age?: int, model options go in brackets, and elif, <, >= and catch A | B replace their old twins. The command line settles on --output text|json and --syntax kscript|xml. (#123, #124)
  • Postgres, MySQL and MariaDB. KScript.Data connects to them as well as SQLite, from a postgres://, mysql:// or mariadb:// url, and text, case, nulls and dates behave the same on every database. (#116)
  • Model relations. author: User, posts: Post[], many-to-many tags: Tag[] and through: relations come from typed fields, with lazy and eager loading (->with(author, posts.tags)) that avoid N+1 queries, ->with_count(), relation queries and scopes. (#119)
  • Migrations and kscript db. kscript db diff writes a migration from your models, and migrate, rollback, status, fresh and seed run them on any of the four databases. kscript make migration and kscript make seeder start new files. (#121)
  • The ORM across KScript. A controller parameter typed as a model is the record from the path (or a 404), sign-in users can live in a model, each test file gets its own rolled-back database with ->fake() records and @queries(), and the editor completes columns, flags unknown ones and shows the SQL a query sends. (#122)
  • Typed parameters and model suggestions. An untyped parameter takes the type its calls pass, shown as a hint, and KS6007 offers to write it in. Model and type blocks suggest their settings and rules as you type. (#115)
  • One type per file. Every type, model, enum and error lives in its own file and is imported where it is used, and the KS6008 lint flags a second type in one file. (#117)
  • kscript fmt wraps long lines at 80 columns: => bodies, -> chains, |> pipes and comments. (#118)
  • Faster, stricter CI builds once on Linux and shares the build, and any new compiler warning now fails the build. (#120, #126, #127)

What's Changed

  • Suggest model settings while typing, and type parameters by default
  • Add Postgres, MySQL and MariaDB to KScript.Data
  • Put each type in its own file, with a KS6008 lint
  • Wrap long lines in kscript fmt: => bodies, -> chains, |> pipes and comments
  • CI: run the Windows jobs on GitHub-hosted runners
  • KScript.Data: model relations, eager loading and scopes
  • KScript.Data: migrations, kscript db, make migration and make seeder
  • KScript.Data integration: route binding, sign-in users, test databases, editor SQL
  • One way to write each thing: fix the 45 language inconsistencies, with rules that keep them out
  • Old .kscript spellings are errors, and { } in double quotes always holds an expression
  • Fix the build warnings CI annotates, and fail the build on new ones
  • CI: build once on Linux and share it; compile checks join the AOT job

ダウンロード

v0.8.0

Highlights

  • Double quotes fill in values everywhere. "Hello $name, you have { $n * 2 } points." now works in variables, return values and call arguments, not only after echo. 'Single quotes' and ``` text blocks keep text exactly as written. A { } in a value is filled in only when it starts with $ or @, so routes like "/users/{id}" keep their braces, and text written into @sql(...) is still sent as bound parameters. (#113)
  • 23 new native types. url, domain, ip, cidr, mac, port, slug, semver, mime, hex, base64, jwt, json, phone, country, currency, locale, timezone, duration, cron, color, iban and card each check and tidy their value and add methods of their own. Types and enums in a project's natives/ folder work in every script without an import, and kscript make native writes them. (#112)
  • Run scripts and tests from the editor. VS Code gets a Run button (F5), a Testing view with every test file, and commands to serve a site, check, format and create a project. The editor also catches more mistakes before you run, such as a misspelt field or 'Joan' - 1, suggests the most useful statements and methods first, and has a walkthrough for getting started. (#114)
  • Editor errors a learner can act on. Habits from other languages, such as print "hi", function greet(), var x = 1, n++ or foreach, now get a plain explanation of the KScript way and a one-click fix. (#111)
  • Write the missing methods for me. Quick fixes add a job's fn handle() and fn failed(err), and override a base type's methods on a joined type. A method two bases give differently is now an editor error with a fix. (#109)
  • A friendlier kscript make. It uses the new CLI style, asks for a missing name (and the type's options) at a terminal, and the files it makes come with TODO comments that say what to fill in. (#110)

What's Changed

  • Make editor errors something a learner can act on
  • Style kscript make, ask for missing names, and add TODOs to what it makes
  • Quick fixes that write a type's or job's missing methods
  • Double quotes fill in values everywhere, single quotes stay as written
  • Add 23 native types, a project natives/ folder and URL literals
  • Editor help for learners: checks, running, smarter suggestions and a walkthrough

ダウンロード

v0.7.1

Highlights

  • Colour at the terminal, by default. The new CLI output now shows its colours at a real terminal without --ansi. Before, it printed plain text unless you passed the flag. (#103)
  • Suggestions only from what you import. Completion no longer offers commands, elements and methods from packages the script doesn't import, and picking one no longer adds an import behind your back. (#108)
  • Signature help that follows you. The tooltip highlights the argument you're writing, and log(...), wait(...) and other statements now have signature help too. (#105)
  • No stray snippets. A new test in VS Code makes sure other extensions' snippets, such as 1Password's op://, stay out of KScript suggestions. (#104)
  • CI and release actions on Node 24. The workflows use the Node 24 versions of their GitHub actions. (#107)

What's Changed

  • ci: Project templates on home-ci-linux
  • Test that other extensions' snippets (1Password op://) stay out of KScript suggestions
  • Highlight the argument being written in signature help, including log(...) statements
  • Show colours at a terminal without --ansi
  • Only suggest package items once the script imports the package
  • ci: move actions to their Node 24 majors

ダウンロード

v0.7.0

Highlights

  • A new look for the CLI. kscript's output now has coloured INFO, DONE, WARN and ERROR labels, grouped help, dotted two-column lines, timed tasks and box tables. Colour turns off on its own in pipes, files and CI logs, and --ansi, --no-ansi, FORCE_COLOR and NO_COLOR are honoured. (#100)
  • No more .NET exceptions. Every failure is shown as a KScript error with a file, line and error type, such as FileNotFound, Network or Config. Add --debug or set KSCRIPT_DEBUG=1 to see the underlying stack trace. (#97)
  • API and fullstack project templates. kscript make project shop --template api makes a JSON API with models, sign-up and API tokens. --template fullstack makes a web app that calls its own API. Both take --db sqlite|postgres|mysql|none, --auth and --cache, and a setup wizard asks for anything you leave out. @api('/path') calls the app's own routes. (#102)
  • Extension methods. extend date { fn json() => ... } adds methods to built-in types, package types and your own types, and override fn replaces one. (#99)
  • Queues on a database. The queue's new database driver keeps jobs, failed jobs and unique-job locks in tables on any KScript.Data connection. (#98)
  • Better editor help. In doc comments, typing @ suggests the tags, and @arg now means @param. Named arguments appear as soon as you type ( or ,. ``` blocks check their language name, and KScript files get their own K file icon in VS Code. (#96, #101)
  • Only working methods are suggested. Dates, numbers, bools and files are no longer offered string methods that fail at run time. The editor points you to ->to_string() or ->to_json() instead. (#94)

What's Changed

  • Fix the flaky concurrent worker test (lost output, not lost jobs)
  • Use home-ci runner labels
  • Only suggest methods a date, number, bool or file has at run time
  • Editor: doc comment tags (@arg), named arguments on (, and known ``` languages
  • Show every error as a KScript error, never a .NET exception
  • Add the queue database driver
  • Extension methods: extend date { fn json() => ... }
  • Style the kscript CLI like artisan: shared output library, labels, tables and grouped help
  • Give KScript files a K file icon in VS Code
  • Add api and fullstack project templates, a setup wizard, and @api('/path') for the app's own routes

ダウンロード

v0.6.1

v0.6.0

Highlights

Breaking change: @fetch is now @api. KScript.Net's HTTP command is @api(url, options?). There is no alias, so replace @fetch( with @api( in your scripts (#85).

New packages

  • KScript.Data (ORM, SQLite). Declare a model (table, key, timestamps, soft deletes, unique, index, hidden and guarded fields) and query it with where(fn($u) => $u.age >= $min), which compiles to parameterised SQL. Includes order_by, paginate, chunk, aggregates, bulk updates, ->sql() to inspect a query, and transaction { } blocks. Relations, migrations and Postgres/MySQL follow in later releases (#91).
  • KScript.Queue. job declarations with tries, backoff, timeout, retry_on/fail_on and unique_for; dispatch Job(...) or ->dispatch(delay:, queue:); @chain, @queue(name) and @fake_queue() for tests; and kscript worker to run them. Ships with sync, memory and file drivers (#90).

Language

  • Long strings across lines. A \ at the end of a line joins it to the next, and ``` text blocks keep their lines with the closing fence's indentation removed. A tag after the fence (```sql, ```<json>, ```<Repo>) labels or parses the block. kscript fmt gains a wrapStrings rule, on in kscript:recommended (#88).
  • Your own native types. kscript make native Sku --pattern "/^[A-Z]{3}-\d{4}$/" writes a type that works like email or uuid: unquoted values, checked wherever the type is used. The editor now also checks types that come from imported files, and an import used only as a type no longer counts as unused (#87).
  • Native types only offer the string methods that fit. uuid, email, handle and regex values no longer suggest or run methods like ->to_date(); you get KS5005 with a hint to use ->to_string() first (#86).

Documents

  • KScript.Document(to: [paper.pdf, paper.docx]) saves one file per entry. Single strings and comma-separated text still work (#89).

Upgrading

Run kscript update, or reinstall with the install script from the README.

What's Changed

  • Add kscript make native for your own native types
  • Rename @fetch to @api
  • Only offer string methods that fit uuid, email, handle and regex
  • Break long strings across lines: \ line joins and ``` text blocks
  • Let KScript.Document's to: take a list of files
  • Add KScript.Queue: jobs, dispatch, retries and kscript worker
  • KScript.Data: models, a query builder and transactions on SQLite

ダウンロード

v0.5.0

What's Changed

  • Bare projects with --web/--api/--desktop, and a Makefile in every new project
  • .kscript: kscript { } root, /* */ comments everywhere, format-aware import errors
  • Add KScript.Storage and KScript.Cache, with ETags and Cache-Control for routes
  • kscript docs: highlight stylesheet (.ks.css) examples
  • Arrays for lists of names: Middleware(use: [a, b]), only: [index, show], enum lists
  • Suggest everywhere, only what works, in the file's own format
  • kscript make: route, controller, request, view, css and more; command directory; folder layout
  • Docs in step with the code: deprecation markers, a guide check, .kscript names in the reference, and block-form types
  • Add kscript mcp: the docs for AI coding assistants over MCP
  • Bring coverage back to 100% after the v0.5.0 merges
  • OpenAPI 3.1 docs made from the routes: kscript openapi, /_openapi.json and /_api
  • CI: fail fast when a server hangs, cache NuGet on hosted runners, cancel superseded PR runs
  • CI: run the Windows jobs on home-ci's Windows runner
  • kscript agents and kscript watch: agent docs from the code graph, one watcher for generated files, check --format json
  • Error types: declare, throw and catch errors by type
  • Format .kscript files with kscript fmt and Format Document
  • kscript serve --with-docs: the docs next to the site, with a page about your project
  • Native email, password, handle, uuid and regex types; refinement and joined types
  • kscript docs --project: the project's own docs as Markdown, rebuilt on watch and save
  • Fix project guide listing $this as a declaration
  • KScript.Document: papers, reports, letters and invoices as PDF, Word, LaTeX, Markdown and HTML
  • Add KScript.Auth: sign-in for kscript serve apps
  • OpenAPI: cover the untested lines, and keep the document in a file (http.openapi.file)
  • CI: stop a PR's run when it is merged or closed, and cancel superseded master runs
  • Built-in functions take the new types
  • Release kscript as a Native AOT build on every platform

ダウンロード

v0.4.2

v0.4.1

v0.4.0

What's Changed

  • kscript update also updates the editor extension
  • Bring test coverage back to 100% after v0.3.0
  • Make .kscript the default for new projects, scripts and tests (--format xml for XML)
  • Add a bare project template: kscript make project --bare
  • Import path completion, project-aware convert, and .test.kscript files
  • Allow <if $cond> shorthand conditions without test=
  • Add kscript compile: programs for macOS, Windows and Linux that run without kscript
  • Add kscript docs: local docs site with runnable examples
  • Warn about unused functions, variables, parameters and imports
  • Bring coverage back to 100% after the v0.4.0 merges

ダウンロード

v0.3.0

What's Changed

  • Make the editor feel typed: return types, inlay hints, notebook blocks and JSON output
  • Run kscript serve pages on the KScript 2 interpreter
  • Add Life Lab: one KScript program for the terminal, the browser and a Mac app
  • Rewrite the README to sell KScript
  • Show KScript files as XML on GitHub
  • Named arguments for every call: @known_folder(name: 'downloads')
  • Life Lab and KScript.UI: desktop apps written only in KScript
  • Add kscript fmt and Format Document for scripts and pages
  • Use named arguments in the examples, samples, docs, README and tests
  • Enums, consts, yes/no flags, and @join_path(base: $folder, [...])
  • Experiment: .kscript files, kscript convert and doc comments
  • Highlight .kscript files in VS Code; keep fmt off them
  • Typed JSON: map data to <type> records
  • Warn on else in scripts in favour of early returns (KS6001)
  • make project: scaffold a web app with a desktop app, all from customisable templates
  • Add KScript.Http: routes, controllers and middleware
  • .kscript: type and enum declarations
  • Lint and format standards: kscript:recommended by default, shareable standard files
  • KScript.Http: map JSON bodies into typed controller parameters
  • KScript 2: language models, settings, logging, stylesheets, translations and full test coverage

ダウンロード

v0.2.0

v0.1.2

What's Changed

  • Bump esbuild from 0.24.2 to 0.28.1 in /editors/vscode by @dependabot[bot] in https://github.com/kylepantall/kscript/pull/18
  • Keep HTML working in KScript pages, and explain extra make names
  • Add kscript make project and kscript.json project settings
  • Smarter completion: JSON data, lambda parameters and component props

New Contributors

ダウンロード

v0.1.1

v0.1.0

What's Changed

  • Typed method calls, |> pipes and fn() => lambdas on values
  • Port KScript to .NET 8 (cross-platform), rewrite command parser, fix interpreter bugs
  • Run the Linux CI job on the home-ci kscript runner
  • Add kscript serve: tidy HTML/Markdown pages and reactive live blocks
  • Update README for .NET 8, tests, CI and value methods
  • Add a KScript 2 language server, VS Code extension and kscript check
  • Release self-contained kscript binaries (no .NET SDK needed)
  • Tidy up debug scripts and clean the repo
  • Add kscript make: generate components, pages, layouts and scripts from templates
  • Add install scripts and kscript update

ダウンロード