potlot 0.0.0-stage → 0.1.6

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,46 @@
1
+ Potlot Freeware License
2
+
3
+ Copyright (c) 2026 Heru Prasetyo. All rights reserved.
4
+
5
+ Potlot (the "Software") is proprietary software distributed free of charge.
6
+ By installing or using it you agree to these terms.
7
+
8
+ 1. Grant. You may download, install and use the Software, free of charge, on
9
+ any number of devices, for personal or commercial work.
10
+
11
+ 2. Your work. Designs, documents and other output you create with the
12
+ Software belong to you. The author claims no rights in them.
13
+
14
+ 3. Restrictions. Except where these terms or applicable law expressly allow
15
+ it, you may not:
16
+ a. sell, rent, lease, sublicense or otherwise charge for the Software;
17
+ b. redistribute the Software, modified or unmodified; share the official
18
+ download page instead;
19
+ c. modify, decompile, disassemble or reverse engineer the Software, or
20
+ create derivative works from it;
21
+ d. remove or alter any copyright, license or trademark notice in it.
22
+
23
+ 4. Third-party components. The Software includes open-source components
24
+ listed in THIRD_PARTY_NOTICES.txt. Each is licensed under its own terms,
25
+ and nothing in this license limits the rights those terms grant you.
26
+
27
+ 5. Third-party services. Features that use external services (AI providers,
28
+ agent CLIs, image or stock-photo APIs) run with your own accounts and keys.
29
+ Your use of those services, and any costs they charge, are governed by
30
+ their own terms.
31
+
32
+ 6. Updates and future licensing. The author may release later versions of
33
+ the Software under different terms, including an open-source license.
34
+ Those terms apply only to the versions released under them.
35
+
36
+ 7. Termination. Your rights under this license end automatically if you
37
+ breach it. You must then stop using and delete the Software.
38
+
39
+ 8. No warranty. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
40
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
41
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
42
+
43
+ 9. Limitation of liability. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
44
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
45
+ OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
46
+ THE USE OR OTHER DEALINGS IN THE SOFTWARE, INCLUDING LOSS OF DATA.
package/README.md CHANGED
@@ -1,3 +1,43 @@
1
- # Temporary Holding Version
1
+ # potlot
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 Potlot command line. Its `potlot mcp` is an MCP server that lets Claude
4
+ Code, Codex and other agents read and design Potlot documents (`.ptl`).
5
+
6
+ ## Use it from an agent
7
+
8
+ Claude Code:
9
+
10
+ ```sh
11
+ claude mcp add potlot -- npx -y potlot mcp
12
+ ```
13
+
14
+ Any MCP client that starts stdio servers:
15
+
16
+ ```json
17
+ { "mcpServers": { "potlot": { "command": "npx", "args": ["-y", "potlot", "mcp"] } } }
18
+ ```
19
+
20
+ ## With and without the app
21
+
22
+ When the Potlot app is installed, `potlot` runs the binary inside the app, so
23
+ the MCP server and the app's engine are always the same version. When the
24
+ app is running, the agent's edits go through it and show up live. When it is
25
+ not, the engine runs inside the MCP server, and hands its documents over to
26
+ the app as soon as the app starts.
27
+
28
+ To watch the agent work, add `--open-app` (`npx -y potlot mcp --open-app`, or
29
+ set `POTLOT_OPEN_APP=1`): the server starts the app if it is not running and
30
+ shows each document the agent opens. It starts the app once; if you quit it,
31
+ work carries on headless.
32
+
33
+ Two engines never write to one document: a document open in one Potlot
34
+ process waits a few seconds for the other to let go, then fails with a
35
+ message naming that process.
36
+
37
+ `potlot --which` prints the binary in use. `POTLOT_BIN=/path/to/potlot`
38
+ picks another one.
39
+
40
+ Binaries for macOS (Apple Silicon, Intel), Linux (x64, arm64) and Windows
41
+ (x64). Linux and Windows are not tested yet.
42
+
43
+ https://potlot.anaknegeri.dev
package/bin/potlot.js ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ 'use strict'
3
+ // Runs the potlot command line, e.g. `potlot mcp`, the MCP server for agents
4
+ // such as Claude Code and Codex. `potlot --which` prints the binary used.
5
+ const { spawn } = require('node:child_process')
6
+ const fs = require('node:fs')
7
+ const { PLATFORMS, packageName, resolveBinary } = require('../lib/resolve.js')
8
+
9
+ const found = resolveBinary()
10
+ if (!found) {
11
+ const here = `${process.platform}-${process.arch}`
12
+ console.error(
13
+ PLATFORMS.includes(here)
14
+ ? `potlot: ${packageName(process.platform, process.arch)} is not installed. Reinstall without --no-optional, or install the Potlot app.`
15
+ : `potlot: no Potlot binary for ${here}. Supported: ${PLATFORMS.join(', ')}.`,
16
+ )
17
+ process.exit(1)
18
+ }
19
+
20
+ const args = process.argv.slice(2)
21
+ if (args[0] === '--which') {
22
+ console.log(`${found.path} (${found.source})`)
23
+ process.exit(0)
24
+ }
25
+
26
+ if (found.source === 'package' && process.platform !== 'win32') {
27
+ // Some package managers drop the executable bit when unpacking.
28
+ try {
29
+ fs.accessSync(found.path, fs.constants.X_OK)
30
+ } catch {
31
+ try {
32
+ fs.chmodSync(found.path, 0o755)
33
+ } catch {}
34
+ }
35
+ }
36
+
37
+ const child = spawn(found.path, args, { stdio: 'inherit', windowsHide: true })
38
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
39
+ process.on(signal, () => child.kill(signal))
40
+ }
41
+ child.on('error', (err) => {
42
+ console.error(`potlot: could not start ${found.path}: ${err.message}`)
43
+ process.exit(1)
44
+ })
45
+ child.on('exit', (code, signal) => process.exit(signal ? 1 : (code ?? 1)))
package/lib/resolve.js ADDED
@@ -0,0 +1,49 @@
1
+ 'use strict'
2
+ const fs = require('node:fs')
3
+ const os = require('node:os')
4
+ const path = require('node:path')
5
+
6
+ // Platforms with a binary package, as process.platform-process.arch.
7
+ const PLATFORMS = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64', 'win32-x64']
8
+
9
+ // The potlot binary the Potlot app ships, where its installers put it. Using
10
+ // it keeps `potlot mcp` the same version as the app's daemon.
11
+ function appBinaries(platform, env, home) {
12
+ if (platform === 'darwin') {
13
+ const inApp = path.posix.join('Potlot.app', 'Contents', 'MacOS', 'potlot-daemon')
14
+ return [path.posix.join('/Applications', inApp), path.posix.join(home, 'Applications', inApp)]
15
+ }
16
+ if (platform === 'win32' && env.LOCALAPPDATA) return [path.win32.join(env.LOCALAPPDATA, 'Potlot', 'potlot-daemon.exe')]
17
+ return []
18
+ }
19
+
20
+ function packageName(platform, arch) {
21
+ return `@potlot/${platform}-${arch}`
22
+ }
23
+
24
+ /**
25
+ * Picks the potlot binary to run: POTLOT_BIN, else the installed app's,
26
+ * else the one from this platform's package. Returns { path, source } or
27
+ * null when there is none.
28
+ */
29
+ function resolveBinary({
30
+ platform = process.platform,
31
+ arch = process.arch,
32
+ env = process.env,
33
+ home = os.homedir(),
34
+ exists = (p) => fs.existsSync(p),
35
+ resolvePackage = (p) => require.resolve(p),
36
+ } = {}) {
37
+ if (env.POTLOT_BIN) return { path: env.POTLOT_BIN, source: 'POTLOT_BIN' }
38
+ for (const p of appBinaries(platform, env, home)) {
39
+ if (exists(p)) return { path: p, source: 'app' }
40
+ }
41
+ const exe = platform === 'win32' ? 'potlot.exe' : 'potlot'
42
+ try {
43
+ return { path: resolvePackage(`${packageName(platform, arch)}/bin/${exe}`), source: 'package' }
44
+ } catch {
45
+ return null
46
+ }
47
+ }
48
+
49
+ module.exports = { PLATFORMS, appBinaries, packageName, resolveBinary }
package/package.json CHANGED
@@ -1,6 +1,25 @@
1
1
  {
2
2
  "name": "potlot",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.6",
4
+ "description": "Potlot command line and MCP server: let Claude Code, Codex and other agents design in Potlot documents",
5
+ "homepage": "https://potlot.anaknegeri.dev",
6
+ "license": "SEE LICENSE IN LICENSE",
7
+ "bin": {
8
+ "potlot": "bin/potlot.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "lib",
13
+ "LICENSE"
14
+ ],
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
18
+ "optionalDependencies": {
19
+ "@potlot/darwin-arm64": "0.1.6",
20
+ "@potlot/darwin-x64": "0.1.6",
21
+ "@potlot/linux-arm64": "0.1.6",
22
+ "@potlot/linux-x64": "0.1.6",
23
+ "@potlot/win32-x64": "0.1.6"
24
+ }
25
+ }