amorphous-cli 0.3.11 → 0.3.13
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/lib/commands.mjs +1 -1
- package/lib/help.mjs +3 -2
- package/lib/help.test.mjs +15 -0
- package/lib/list-command.test.mjs +83 -0
- package/package.json +1 -1
- package/skill/amorphous/SKILL.md +1 -0
package/lib/commands.mjs
CHANGED
|
@@ -395,7 +395,7 @@ function listRow(row) {
|
|
|
395
395
|
row.archived ? 'archived' : null,
|
|
396
396
|
row.collection_path ? `in ${row.collection_path}` : null,
|
|
397
397
|
tags ? `#${tags.replace(/,\s*/g, ' #')}` : null,
|
|
398
|
-
row.live_open ? '
|
|
398
|
+
row.live_open ? 'Anyone with the link' : 'Members only',
|
|
399
399
|
]
|
|
400
400
|
.filter(Boolean)
|
|
401
401
|
.join(' · ')
|
package/lib/help.mjs
CHANGED
|
@@ -51,10 +51,11 @@ Open the browser and finish sign-in there.
|
|
|
51
51
|
|
|
52
52
|
Start the local MCP server on stdio.`,
|
|
53
53
|
|
|
54
|
-
list: `list [--view recents|all|starred|archive] [--folder <name>] [--tag <name>] [--search <q>] [--json]
|
|
54
|
+
list: `list [--view recents|all|starred|archive] [--folder <name>] [--tag <name>] [--search <q>] [--open|--closed] [--json]
|
|
55
55
|
|
|
56
56
|
List abstracts. Default view is all (All Abstracts).
|
|
57
|
-
--folder filters to a folder. --tag filters to a tag
|
|
57
|
+
--folder filters to a folder. --tag filters to a tag.
|
|
58
|
+
Human output ends with the live link audience: “Anyone with the link” or “Members only”. --open and --closed filter that audience; JSON reports it as open.`,
|
|
58
59
|
|
|
59
60
|
create: `create [--name <name>] [--folder <name>] [--template blank|list|board|landing] [--recipe-config <file>] [--json]
|
|
60
61
|
|
package/lib/help.test.mjs
CHANGED
|
@@ -54,3 +54,18 @@ test('visibility help explains public shared-record writes', () => {
|
|
|
54
54
|
test('root help does not hide the write effect of public visibility', () => {
|
|
55
55
|
assert.match(ROOT_HELP, /anyone can view; app may accept shared-record writes/i)
|
|
56
56
|
})
|
|
57
|
+
|
|
58
|
+
test('list help explains that open and closed describe the live link audience', () => {
|
|
59
|
+
let output = ''
|
|
60
|
+
const originalLog = console.log
|
|
61
|
+
console.log = (message) => { output = String(message) }
|
|
62
|
+
try {
|
|
63
|
+
printHelp('list')
|
|
64
|
+
} finally {
|
|
65
|
+
console.log = originalLog
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
assert.match(output, /anyone with the link/i)
|
|
69
|
+
assert.match(output, /members only/i)
|
|
70
|
+
assert.match(output, /--open.*--closed/i)
|
|
71
|
+
})
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import assert from 'node:assert/strict'
|
|
2
|
+
import { createServer } from 'node:http'
|
|
3
|
+
import { mkdtempSync, rmSync } from 'node:fs'
|
|
4
|
+
import { tmpdir } from 'node:os'
|
|
5
|
+
import { join } from 'node:path'
|
|
6
|
+
import test from 'node:test'
|
|
7
|
+
import { runCommand } from './commands.mjs'
|
|
8
|
+
import { saveSession } from './session.mjs'
|
|
9
|
+
|
|
10
|
+
const userId = '10000000-0000-4000-8000-000000000001'
|
|
11
|
+
const payload = (value) => Buffer.from(JSON.stringify(value)).toString('base64url')
|
|
12
|
+
const accessToken = `header.${payload({ sub: userId, exp: Math.floor(Date.now() / 1000) + 3600 })}.signature`
|
|
13
|
+
|
|
14
|
+
test('list says who can open a live abstract instead of calling it closed', async (t) => {
|
|
15
|
+
const root = mkdtempSync(join(tmpdir(), 'am-list-command-'))
|
|
16
|
+
const env = {
|
|
17
|
+
credentials: process.env.AMORPHOUS_CREDENTIALS,
|
|
18
|
+
appUrl: process.env.AMORPHOUS_CLI_APP_URL,
|
|
19
|
+
appOrigin: process.env.APP_ORIGIN,
|
|
20
|
+
}
|
|
21
|
+
process.env.AMORPHOUS_CREDENTIALS = join(root, 'credentials.json')
|
|
22
|
+
process.env.APP_ORIGIN = 'https://amorphous.test'
|
|
23
|
+
saveSession({
|
|
24
|
+
access_token: accessToken,
|
|
25
|
+
refresh_token: 'unused',
|
|
26
|
+
expires_at: Math.floor(Date.now() / 1000) + 3600,
|
|
27
|
+
})
|
|
28
|
+
const rows = [
|
|
29
|
+
{
|
|
30
|
+
id: '20000000-0000-4000-8000-000000000001',
|
|
31
|
+
name: 'Members-only app',
|
|
32
|
+
role: 'use',
|
|
33
|
+
starred: false,
|
|
34
|
+
archived: false,
|
|
35
|
+
tags: [],
|
|
36
|
+
collection_path: null,
|
|
37
|
+
live_open: false,
|
|
38
|
+
updated_at: '2026-10-22T00:00:00.000Z',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: '20000000-0000-4000-8000-000000000002',
|
|
42
|
+
name: 'Public app',
|
|
43
|
+
role: 'owner',
|
|
44
|
+
starred: false,
|
|
45
|
+
archived: false,
|
|
46
|
+
tags: [],
|
|
47
|
+
collection_path: null,
|
|
48
|
+
live_open: true,
|
|
49
|
+
updated_at: '2026-10-22T00:00:00.000Z',
|
|
50
|
+
},
|
|
51
|
+
]
|
|
52
|
+
const server = createServer((req, res) => {
|
|
53
|
+
res.writeHead(200, { 'content-type': 'application/json' })
|
|
54
|
+
res.end(JSON.stringify({ abstracts: rows }))
|
|
55
|
+
})
|
|
56
|
+
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve))
|
|
57
|
+
process.env.AMORPHOUS_CLI_APP_URL = `http://127.0.0.1:${server.address().port}`
|
|
58
|
+
t.after(async () => {
|
|
59
|
+
server.closeAllConnections?.()
|
|
60
|
+
await new Promise((resolve) => server.close(resolve))
|
|
61
|
+
rmSync(root, { recursive: true, force: true })
|
|
62
|
+
if (env.credentials === undefined) delete process.env.AMORPHOUS_CREDENTIALS
|
|
63
|
+
else process.env.AMORPHOUS_CREDENTIALS = env.credentials
|
|
64
|
+
if (env.appUrl === undefined) delete process.env.AMORPHOUS_CLI_APP_URL
|
|
65
|
+
else process.env.AMORPHOUS_CLI_APP_URL = env.appUrl
|
|
66
|
+
if (env.appOrigin === undefined) delete process.env.APP_ORIGIN
|
|
67
|
+
else process.env.APP_ORIGIN = env.appOrigin
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const output = []
|
|
71
|
+
const originalLog = console.log
|
|
72
|
+
console.log = (message) => output.push(String(message))
|
|
73
|
+
try {
|
|
74
|
+
await runCommand(['list', '--view', 'all'])
|
|
75
|
+
} finally {
|
|
76
|
+
console.log = originalLog
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
assert.deepEqual(output, [
|
|
80
|
+
'Members-only app · 20000000-0000-4000-8000-000000000001 · Can use · Members only',
|
|
81
|
+
'Public app · 20000000-0000-4000-8000-000000000002 · Owner · Anyone with the link',
|
|
82
|
+
])
|
|
83
|
+
})
|
package/package.json
CHANGED
package/skill/amorphous/SKILL.md
CHANGED
|
@@ -35,6 +35,7 @@ A private record belongs to the signed-in person who wrote it. The abstract does
|
|
|
35
35
|
## Person
|
|
36
36
|
|
|
37
37
|
After `setup`, invite them to describe what they want made. Build it for them.
|
|
38
|
+
On phones, leave the upper corners clear for Amorphous controls (they move to the upper-left on narrow screens) and leave the lower-right clear for the Report link. Check the actual preview or live abstract at 390 px and 320 px; confirm headings, instructions, and touch controls remain visible and do not overlap the platform controls.
|
|
38
39
|
Prefer `amorphous-cli serve` while you edit. Open the URL and leave it running. It reloads when the files change, and it is the easiest way for them to look at the work.
|
|
39
40
|
Only push, preview, publish, invite, or notify when the person asks for that action. Use `publish --live` only when they explicitly ask to make the version live.
|
|
40
41
|
|