wildcrane 0.0.0-stage → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,105 @@
1
+ # Functional Source License, Version 1.1, ALv2 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-ALv2
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Tao Wu
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,15 @@
1
- # Temporary Holding Version
1
+ # wildcrane
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The CLI for WildCrane. See the draft. Let agents do the rest.
4
+
5
+ See the [project README](https://github.com/ai4kanban/ai4kanban#readme) for the product overview and [documentation](https://wildcrane.ai/docs) for setup and usage.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g wildcrane@latest
11
+ ```
12
+
13
+ Still on the old `ai4kanban` package? Run `npm uninstall -g ai4kanban` first; both install `akb`.
14
+
15
+ Run `akb help` for commands and `akb guide` for workflows.
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+ //
3
+ // wildcrane — the loader. Installed as `akb` too; `npx --yes wildcrane@latest <command>` runs
4
+ // it without installing anything.
5
+ //
6
+ // It does three things and nothing else: work out how the command was typed, find this
7
+ // package's built rules, and hand the whole command line to one of the two trees in there —
8
+ // `akb raw <move>`, or everything else.
9
+ //
10
+ // Why so little lives here: the desktop app carries `bin/` and `dist/` and no node_modules
11
+ // beside them (desktop/scripts/bundle-cli.mjs), so this file must have no dependencies. The
12
+ // commands, their options and their help are declared in cli/src/lib/cli/, which the build
13
+ // bundles — with everything it needs — into the one file this loads.
14
+ //
15
+ // Node 18+, same behaviour on macOS, Linux and Windows.
16
+
17
+ import fs from 'node:fs'
18
+ import path from 'node:path'
19
+ import { fileURLToPath, pathToFileURL } from 'node:url'
20
+
21
+ const PKG_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
22
+ const PKG = JSON.parse(fs.readFileSync(path.join(PKG_DIR, 'package.json'), 'utf8'))
23
+ const NAME = PKG.name
24
+ const VERSION = PKG.version
25
+
26
+ // How this command was reached, spelled so what it prints can be pasted straight back.
27
+ //
28
+ // A global install puts it on the PATH as `akb`, and every example everywhere spells it that
29
+ // way. It is also run as a path — `node cli/bin/ai4kanban.mjs` in a source checkout, the copy
30
+ // inside the desktop app — and printing `akb` to a reader who has none is printing a line
31
+ // that ends in `command not found`. Whoever typed it is right here in argv, so ask that
32
+ // rather than guessing: only the PATH spellings are `akb`, `.mjs` never is.
33
+ //
34
+ // Not what's on the PATH, which is a different question with a different answer: `npx` puts
35
+ // an `akb` on the PATH of THIS process and nothing else, so the reader would still be given a
36
+ // line their own shell can't run. That one is spotted by the cache it runs out of, and
37
+ // answered with the same fetch pinned to this version — never `@latest`, which is how a board
38
+ // comes to be driven by two versions of its own rules.
39
+ //
40
+ // AI4KANBAN_COMMAND is how the desktop app's launcher says what it was typed as. That
41
+ // launcher is reached as `akb` on the PATH and then runs this file by its path, so argv alone
42
+ // would report the copy inside the app — a line no reader can paste.
43
+ const PROGRAM = (() => {
44
+ const named = (process.env.AI4KANBAN_COMMAND || '').trim()
45
+ if (named) return named
46
+ const entry = process.argv[1] || ''
47
+ if (/[\\/](_npx|dlx)[\\/]/.test(entry)) return `npx --yes ${NAME}@${VERSION}`
48
+ const base = path.basename(entry).toLowerCase().replace(/\.(cmd|ps1|exe)$/, '')
49
+ if (base === 'akb' || base === NAME) return 'akb'
50
+ return `node ${nearPath(entry)}`
51
+ })()
52
+
53
+ // How a path is spelled in something a person is meant to paste back.
54
+ //
55
+ // Relative when it is a short hop down from where the command was typed — a checkout says
56
+ // `node cli/bin/ai4kanban.mjs`, which reads inside a sentence and is what the project's own
57
+ // notes spell. Absolute otherwise, and absolute is the safe answer: run from `/`, a relative
58
+ // path is the whole absolute one with its leading slash quietly removed, which runs from that
59
+ // one folder and nowhere else and reads to everyone else like a typo.
60
+ function nearPath(file) {
61
+ const near = path.relative(process.cwd(), file)
62
+ const shortHop = near && !near.startsWith('..') && !path.isAbsolute(near) && near.split(/[\\/]/).length <= 3
63
+ return shortHop ? near : file
64
+ }
65
+
66
+ function fail(msg) {
67
+ console.error(`ai4kanban: ${msg}`)
68
+ process.exit(1)
69
+ }
70
+
71
+ // The board's rules: this package's TypeScript sources built into one file by
72
+ // scripts/build.mjs. Everything this command actually does lives in there — the bookkeeping,
73
+ // the runs, the setup commands, what a skill folder holds — so it is the same one copy
74
+ // whether a terminal or the UI's buttons asks.
75
+ //
76
+ // One path, no searching. A published tarball carries `dist/`, and a source checkout builds
77
+ // it on `npm install` (the `prepare` script).
78
+ async function rules() {
79
+ const file = path.join(PKG_DIR, 'dist', 'kanban.mjs')
80
+ if (!fs.existsSync(file)) {
81
+ fail(
82
+ 'no built rules in this package — run `npm install` (or `npm run build`) in cli/ ' +
83
+ '(a published tarball carries them already, so this one is incomplete)',
84
+ )
85
+ }
86
+ return import(pathToFileURL(file).href)
87
+ }
88
+
89
+ // The two trees, and the one word that picks between them. `akb raw` takes over the whole
90
+ // command line: its moves take options that collide with the rest — `create`, `archive` and
91
+ // `reject` are words on both sides — so it is handed the line untouched, bar the shared
92
+ // options typed before `raw`.
93
+ async function main() {
94
+ const argv = process.argv.slice(2)
95
+ const loaded = await rules()
96
+ const shared = { program: PROGRAM, installHint: `\`${PROGRAM} install\`` }
97
+
98
+ const raw = loaded.rawArgv(argv)
99
+ if (raw) {
100
+ process.exitCode = await loaded.runBoard(raw, { ...shared, program: `${PROGRAM} raw` })
101
+ return
102
+ }
103
+
104
+ const { runAgent } = loaded
105
+ if (typeof runAgent !== 'function') {
106
+ fail('this copy of the board rules is too old for this command — `npm install -g wildcrane@latest`, then `akb update`')
107
+ }
108
+ process.exitCode = await runAgent(argv, shared)
109
+ }
110
+
111
+ main()