@quadient/skillshare 1.12.0 → 1.13.0

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/README.md CHANGED
@@ -341,6 +341,26 @@ printf %s "$TOKEN" | skillshare pages secrets set my-app API_TOKEN
341
341
  skillshare pages secrets delete my-app API_TOKEN
342
342
  ```
343
343
 
344
+ ## Page comments (1.13.0+)
345
+
346
+ Every Page is also served at `/pa/<slug>/` with an **Annotations** button. Signed-in
347
+ users highlight text, place pins or add page notes there; comments are stored in
348
+ SkillShare with their author and time. The owner can show the button on the regular
349
+ `/p/<slug>/` address too. The CLI reads and answers comments:
350
+
351
+ ```bash
352
+ skillshare pages comments enable my-app # also on /p/my-app/ (owner or admin)
353
+ skillshare pages comments list my-app --author mine
354
+ skillshare pages comments list my-app --path docs/ --resolved
355
+ skillshare pages comments add my-app "Please add a changelog section" --path index.html
356
+ skillshare pages comments reply my-app 12 "Fixed in revision 4"
357
+ skillshare pages comments resolve my-app 12
358
+ skillshare pages comments delete my-app 12
359
+ ```
360
+
361
+ `--author` accepts `mine` or a user id and keeps threads that person started or
362
+ replied to. Text without an argument, or `-`, is read from stdin.
363
+
344
364
  ## Local Pages development (1.6.0+)
345
365
 
346
366
  Run a celld application without a SkillShare server, repository checkout, Docker,
@@ -15,10 +15,10 @@ export function profilesPath(home = homedir()) {
15
15
  export async function detectAgents(options = {}) {
16
16
  const home = options.home ?? homedir();
17
17
  const env = options.env ?? process.env;
18
- const version = options.version ?? commandVersion;
19
18
  const read = options.read ?? readOptional;
20
19
  const agents = [];
21
20
  const problems = [];
21
+ const version = options.version ?? (command => commandVersion(command, env, problem => problems.push(problem)));
22
22
  const claudeVersion = await version('claude');
23
23
  if (claudeVersion !== null) {
24
24
  const settings = parseJson(await read(join(env.CLAUDE_CONFIG_DIR ?? join(home, '.claude'), 'settings.json')));
@@ -45,6 +45,8 @@ export async function detectAgents(options = {}) {
45
45
  for (const profile of profiles)
46
46
  if (!agents.some(agent => agent.kind === profile.agent))
47
47
  problems.push(`Profile "${profile.name}" uses ${profile.agent}, which is not installed.`);
48
+ if (agents.length === 0)
49
+ problems.push(`Could not run claude --version or codex --version. Check that an agent is installed and runnable on PATH: ${env.PATH ?? env.Path ?? ''}. For a service, check skillshare agents service status and reinstall from a fresh terminal if needed.`);
48
50
  return {
49
51
  capabilities: { agents, profiles: profiles.map(p => ({ name: p.name, agent: p.agent, model: p.model, reasoning: p.reasoning,
50
52
  workdir: p.workdir ? basename(p.workdir) : undefined, ...(p.sandbox ? { sandbox: true } : {}) })) },
@@ -202,8 +204,12 @@ async function readOptional(path) {
202
204
  return null;
203
205
  }
204
206
  }
205
- function commandVersion(command) {
207
+ function commandVersion(command, env, report) {
206
208
  return new Promise(resolvePromise => {
207
- execFile(command, ['--version'], { timeout: 15_000, windowsHide: true, shell: process.platform === 'win32' }, (error, stdout) => resolvePromise(error ? null : stdout.toString()));
209
+ execFile(command, ['--version'], { env, timeout: 15_000, windowsHide: true, shell: process.platform === 'win32' }, (error, stdout) => {
210
+ if (error)
211
+ report(`${command} --version failed (${error.killed ? 'timeout or terminated' : error.code ?? 'unknown error'}). Check the executable and PATH.`);
212
+ resolvePromise(error ? null : stdout.toString());
213
+ });
208
214
  });
209
215
  }
@@ -0,0 +1,52 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { join } from 'node:path';
3
+ const readRegistry = (command, args) => new Promise((resolve, reject) => {
4
+ execFile(command, args, { timeout: 10_000, windowsHide: true }, (error, stdout, stderr) => {
5
+ if (error)
6
+ reject(error);
7
+ else
8
+ resolve({ code: 0, stdout, stderr });
9
+ });
10
+ });
11
+ export function mergeWindowsPath(...paths) {
12
+ const seen = new Set();
13
+ return paths.flatMap(path => path.split(';')).map(part => part.trim()).filter(part => {
14
+ const key = part.replace(/[\\/]+$/, '').toLowerCase();
15
+ if (!part || /(?:^|[\\/])node_modules[\\/]\.bin(?:[\\/]|$)/i.test(part) || seen.has(key))
16
+ return false;
17
+ seen.add(key);
18
+ return true;
19
+ }).join(';');
20
+ }
21
+ /** Refresh before every service detection, including in services installed by older CLIs. */
22
+ export async function refreshServicePath(env = process.env, platform = process.platform, run = readRegistry) {
23
+ if (platform !== 'win32')
24
+ return [];
25
+ const script = `$ErrorActionPreference = 'Stop'
26
+ [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
27
+ foreach ($scope in @('Machine', 'User')) {
28
+ $vars = [Environment]::GetEnvironmentVariables($scope)
29
+ foreach ($key in $vars.Keys) { if ($key -ne 'Path') { [Environment]::SetEnvironmentVariable($key, [Environment]::ExpandEnvironmentVariables($vars[$key]), 'Process') } }
30
+ }
31
+ $machine = [Environment]::GetEnvironmentVariable('Path', 'Machine')
32
+ [Environment]::SetEnvironmentVariable('Path', [Environment]::ExpandEnvironmentVariables($machine), 'Process')
33
+ $user = [Environment]::GetEnvironmentVariable('Path', 'User')
34
+ [Environment]::ExpandEnvironmentVariables($machine + ';' + $user)`;
35
+ const pathKeys = Object.keys(env).filter(key => key.toLowerCase() === 'path');
36
+ const snapshot = pathKeys.map(key => env[key] ?? '').join(';');
37
+ let current = '';
38
+ const warnings = [];
39
+ try {
40
+ const result = await run(join(env.SystemRoot ?? env.SYSTEMROOT ?? 'C:\\Windows', 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'), ['-NoProfile', '-NonInteractive', '-Command', script]);
41
+ if (result.code !== 0)
42
+ throw new Error('registry read failed');
43
+ current = result.stdout.trim();
44
+ }
45
+ catch {
46
+ warnings.push('Could not read current Windows PATH from the registry; using the saved service PATH. Reinstall from a fresh terminal if agents are missing.');
47
+ }
48
+ for (const key of pathKeys)
49
+ delete env[key];
50
+ env.PATH = mergeWindowsPath(current, snapshot);
51
+ return warnings;
52
+ }
@@ -1,3 +1,5 @@
1
+ import { detectAgents } from './agents-detect.js';
2
+ import { refreshServicePath } from './agents-service-path.js';
1
3
  import { existsSync } from 'node:fs';
2
4
  import { mkdir, readFile, rm, writeFile } from 'node:fs/promises';
3
5
  import { homedir } from 'node:os';
@@ -18,6 +20,7 @@ export function defaultServiceEnvironment(appDir) {
18
20
  export function servicePaths(appDir) {
19
21
  return {
20
22
  config: join(appDir, 'agents-service.json'),
23
+ detection: join(appDir, 'agents-service-detection.json'),
21
24
  launcher: join(appDir, 'agents-service.mjs'),
22
25
  log: join(appDir, 'logs', 'agents.log'),
23
26
  // What the service manager catches before the listener's own log opens, such as a launcher that cannot start.
@@ -286,6 +289,20 @@ export async function uninstallService(environment) {
286
289
  await environment.run('systemctl', ['--user', 'daemon-reload']);
287
290
  return existed || wasRunning;
288
291
  }
292
+ export async function detectServiceAgents(appDir) {
293
+ const warnings = await refreshServicePath();
294
+ const detected = await detectAgents();
295
+ detected.problems.unshift(...warnings);
296
+ const report = {
297
+ checkedAt: new Date().toISOString(), path: process.env.PATH ?? '',
298
+ agents: detected.capabilities.agents.map(agent => `${agent.kind} ${agent.version ?? ''}`.trim()),
299
+ problems: detected.problems,
300
+ };
301
+ await writeFile(servicePaths(appDir).detection, JSON.stringify(report, null, 2));
302
+ for (const problem of report.problems)
303
+ console.warn(problem);
304
+ return detected;
305
+ }
289
306
  export async function serviceStatus(environment) {
290
307
  let config;
291
308
  try {
@@ -294,8 +311,15 @@ export async function serviceStatus(environment) {
294
311
  catch { }
295
312
  const lock = await readListenerLock(environment.appDir);
296
313
  const running = lock?.service === true;
314
+ let detection;
315
+ try {
316
+ const report = JSON.parse(await readFile(servicePaths(environment.appDir).detection, 'utf8'));
317
+ if (running && report.checkedAt >= lock.startedAt)
318
+ detection = report;
319
+ }
320
+ catch { }
297
321
  return {
298
- installed: config !== undefined && existsSync(definitionPath(environment)), config, running,
322
+ installed: config !== undefined && existsSync(definitionPath(environment)), config, running, detection,
299
323
  pid: running ? lock.pid : undefined, version: running ? lock.version : undefined, since: running ? lock.startedAt : undefined,
300
324
  };
301
325
  }
@@ -313,6 +337,13 @@ export function renderServiceStatus(status, appDir) {
313
337
  ];
314
338
  if (status.config.args.length)
315
339
  lines.push(`Options: ${status.config.args.join(' ')}`);
340
+ if (status.detection) {
341
+ lines.push(`Service agent detection (${status.detection.checkedAt}): ${status.detection.agents.join(', ') || 'No supported agent found.'}`);
342
+ lines.push(`Service PATH: ${status.detection.path}`);
343
+ lines.push(...status.detection.problems);
344
+ }
345
+ else
346
+ lines.push('Service agent detection is not available yet. Check service logs; reinstall with the updated CLI if needed.');
316
347
  lines.push(`Log: ${servicePaths(appDir).log}`);
317
348
  return lines.join('\n');
318
349
  }
package/dist/agents.js CHANGED
@@ -4,7 +4,7 @@ import { hostname, platform, tmpdir } from 'node:os';
4
4
  import { dirname, join } from 'node:path';
5
5
  import { setTimeout as delay } from 'node:timers/promises';
6
6
  import { createClaudeDriver } from './agents-claude.js';
7
- import { defaultServiceEnvironment, installService, renderServiceStatus, serviceLogs, serviceStatus, uninstallService, } from './agents-service.js';
7
+ import { defaultServiceEnvironment, detectServiceAgents, installService, renderServiceStatus, serviceLogs, serviceStatus, uninstallService, } from './agents-service.js';
8
8
  import { createCodexDriver } from './agents-codex.js';
9
9
  import { detectAgents, expandHome, profilesPath } from './agents-detect.js';
10
10
  import { SessionRunner, errorMessage, } from './agents-session.js';
@@ -135,6 +135,7 @@ export async function runAgentsCommand(client, args, flags, appDirectory, teamsW
135
135
  try {
136
136
  result = await listen({
137
137
  client, listenerId, name: flags.name, workdir, maxConcurrency: max, sandbox, signal: abort.signal, onProgress: console.log, service,
138
+ detect: service ? () => detectServiceAgents(appDirectory) : undefined,
138
139
  updater: worker ? { currentVersion: readCliVersion(), prepare: version => installVersion(appDirectory, version) } : undefined,
139
140
  });
140
141
  }
@@ -183,7 +184,7 @@ export async function runServiceCommand(action, flags, appDirectory, server) {
183
184
  await installService(environment, { server, workdir, args: serviceListenArgs(flags), version });
184
185
  // The service manager starts it right away; it takes a moment to sign in and report.
185
186
  let status = await serviceStatus(environment);
186
- for (let attempt = 0; attempt < 30 && !status.running; attempt++) {
187
+ for (let attempt = 0; attempt < 60 && (!status.running || !status.detection); attempt++) {
187
188
  await delay(500);
188
189
  status = await serviceStatus(environment);
189
190
  }
package/dist/help.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  export const GLOBAL_FLAGS = ['token', 'server', 'help'];
3
- export const BOOLEAN_FLAGS = new Set(['dry-run', 'force', 'headless', 'help', 'json', 'no-teams-watch', 'no-update', 'sandbox']);
3
+ export const BOOLEAN_FLAGS = new Set(['dry-run', 'force', 'headless', 'help', 'json', 'no-teams-watch', 'no-update', 'resolved', 'sandbox']);
4
4
  export const COMMANDS = [
5
5
  {
6
6
  name: 'login',
@@ -90,12 +90,17 @@ export const COMMANDS = [
90
90
  'pages secrets list <slug> [--json]',
91
91
  'pages secrets set <slug> <name> [--json]',
92
92
  'pages secrets delete <slug> <name> [--json]',
93
+ 'pages comments list <slug> [--path <path>] [--author mine|<user id>] [--resolved] [--json]',
94
+ 'pages comments add <slug> [text] [--path <path>] [--json]',
95
+ 'pages comments reply|edit <slug> <id> [text] [--json]',
96
+ 'pages comments resolve|reopen|delete <slug> <id> [--json]',
97
+ 'pages comments enable|disable <slug> [--json]',
93
98
  'pages dev [directory] [--slug <slug>] [--port <port>] [--build <command> --watch-dir <sources>]',
94
99
  ' [--celld <executable>] [--user-id <id>] [--user-name <name>] [--user-email <email>]',
95
100
  ],
96
- description: 'An upload replaces all content of the page. Without --slug the directory name is used; build output folders such as dist need an explicit --slug. Pages owned by someone else are refused unless you are an admin. pages secrets manages the write-only secrets an app reads through SKILLSHARE_SECRETS (owner or admin only, at most 32 per page, 16 KiB each); set reads the value from piped stdin or a masked prompt, never from the command line.',
97
- examples: ['skillshare pages upload ./site --slug release-notes', 'skillshare pages dev . --slug my-app', 'skillshare pages secrets set my-app API_TOKEN', 'printf %s "$TOKEN" | skillshare pages secrets set my-app API_TOKEN'],
98
- flags: ['slug', 'json'],
101
+ description: 'An upload replaces all content of the page. Without --slug the directory name is used; build output folders such as dist need an explicit --slug. Pages owned by someone else are refused unless you are an admin. pages secrets manages the write-only secrets an app reads through SKILLSHARE_SECRETS (owner or admin only, at most 32 per page, 16 KiB each); set reads the value from piped stdin or a masked prompt, never from the command line. pages comments reads and writes the annotations reviewers leave on a Page at /pa/<slug>/ (enable and disable decide whether the regular /p/<slug>/ address shows them too); add creates a page note, text without an argument (or -) is read from stdin, and list hides resolved threads unless --resolved is given.',
102
+ examples: ['skillshare pages upload ./site --slug release-notes', 'skillshare pages dev . --slug my-app', 'skillshare pages secrets set my-app API_TOKEN', 'printf %s "$TOKEN" | skillshare pages secrets set my-app API_TOKEN', 'skillshare pages comments list my-app --author mine', 'skillshare pages comments reply my-app 12 "Fixed in revision 4"'],
103
+ flags: ['slug', 'path', 'author', 'resolved', 'json'],
99
104
  },
100
105
  {
101
106
  name: 'teams',
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import { inspectInstallTarget, installFilesAtomically } from './install-files.js
8
8
  import { preparePageFiles, resolvePageSlug } from './pages.js';
9
9
  import { formatByteSize, formatDateTime, pageUrl, plural, renderPageDetail, renderPageList, renderPageRuntime, renderSkillDetail, renderSkillList, renderSkillVersion, renderUser, } from './output.js';
10
10
  import { runPageDev } from './pages-dev.js';
11
+ import { runPageCommentsCommand } from './pages-comments.js';
11
12
  import { runPageSecretsCommand } from './pages-secrets.js';
12
13
  import { createServer } from 'node:http';
13
14
  import { createHash, randomBytes } from 'node:crypto';
@@ -391,7 +392,11 @@ async function main() {
391
392
  await runPageSecretsCommand(client, options.positionals.slice(1), print);
392
393
  return;
393
394
  }
394
- throw new Error(`Unknown pages command '${action}'. Use list, show, runtime, upload, or secrets.`);
395
+ if (action === 'comments') {
396
+ await runPageCommentsCommand(client, options.positionals.slice(1), options.flags, print);
397
+ return;
398
+ }
399
+ throw new Error(`Unknown pages command '${action}'. Use list, show, runtime, upload, secrets, or comments.`);
395
400
  }
396
401
  }
397
402
  return;
package/dist/output.js CHANGED
@@ -122,6 +122,7 @@ export function renderPageDetail(page, baseUrl, now = new Date()) {
122
122
  `${page.slug} (${page.kind === 'celld' ? 'application' : 'static site'})`,
123
123
  ...fields([
124
124
  ['URL', pageUrl(baseUrl, page.slug)],
125
+ ['Annotate', `${baseUrl.replace(/\/+$/, '')}/pa/${encodeURIComponent(page.slug)}/`],
125
126
  ['Owner', page.ownerDisplayName],
126
127
  ['Revision', `${page.contentRevision}, updated ${formatDateTime(page.updated)}`],
127
128
  ['Users this month', page.monthlyUsage.find((usage) => usage.month === month)?.uniqueUsers ?? 0],
@@ -0,0 +1,143 @@
1
+ import { formatDateTime } from './output.js';
2
+ const ACTIONS = ['list', 'add', 'reply', 'edit', 'resolve', 'reopen', 'delete', 'enable', 'disable'];
3
+ /** Keeps threads where the author (`mine` or a user id) wrote the first comment or any reply. */
4
+ export function filterPageComments(list, filter) {
5
+ const authorId = filter.author === 'mine' ? list.currentUserId : filter.author ? Number(filter.author) : undefined;
6
+ if (filter.author && filter.author !== 'mine' && !Number.isInteger(authorId)) {
7
+ throw new Error('--author must be "mine" or a user id.');
8
+ }
9
+ const threads = list.annotations.filter((comment) => comment.threadId === comment.id);
10
+ return threads.filter((thread) => {
11
+ if (!filter.resolved && thread.resolved)
12
+ return false;
13
+ if (authorId === undefined)
14
+ return true;
15
+ return list.annotations.some((comment) => comment.threadId === thread.id && comment.authorUserId === authorId);
16
+ }).flatMap((thread) => list.annotations.filter((comment) => comment.threadId === thread.id));
17
+ }
18
+ function quote(comment) {
19
+ if (comment.kind !== 'text')
20
+ return null;
21
+ try {
22
+ const anchor = JSON.parse(comment.anchor);
23
+ return anchor.quote ? anchor.quote.replace(/\s+/g, ' ').slice(0, 120) : null;
24
+ }
25
+ catch {
26
+ return null;
27
+ }
28
+ }
29
+ export function renderPageComments(slug, list, comments) {
30
+ const header = list.enabled ? [] : [`/p/${slug}/ hides annotations; comment on /pa/${slug}/.`, ''];
31
+ if (comments.length === 0)
32
+ return [...header, `/p/${slug}/ has no matching comments.`].join('\n');
33
+ const lines = [...header];
34
+ let path = null;
35
+ for (const comment of comments) {
36
+ const isThread = comment.threadId === comment.id;
37
+ if (isThread && comment.path !== path) {
38
+ path = comment.path;
39
+ if (lines.length > header.length)
40
+ lines.push('');
41
+ lines.push(`/p/${slug}/${path}`);
42
+ }
43
+ const indent = isThread ? ' ' : ' ';
44
+ const status = isThread ? ` [${comment.kind}${comment.resolved ? `, resolved by ${comment.resolvedByDisplayName}` : ''}]` : '';
45
+ lines.push(`${indent}#${comment.id}${status} ${comment.authorDisplayName} · ${formatDateTime(comment.created)}`);
46
+ const quoted = quote(comment);
47
+ if (quoted)
48
+ lines.push(`${indent} > ${quoted}`);
49
+ for (const line of comment.body.split('\n'))
50
+ lines.push(`${indent} ${line}`);
51
+ }
52
+ return lines.join('\n');
53
+ }
54
+ /**
55
+ * Reads and writes a Page's annotation comments. /pa/<slug>/ always shows them; enable and disable
56
+ * only decide whether the regular /p/<slug>/ address shows them too. The CLI adds page notes and replies;
57
+ * text highlights and pins are placed in the browser where their position is known.
58
+ */
59
+ export async function runPageCommentsCommand(client, positionals, flags, print, readText = readStdin) {
60
+ const [action = 'list', slug, ...rest] = positionals;
61
+ if (!ACTIONS.includes(action)) {
62
+ throw new Error(`Unknown pages comments command '${action}'. Use ${ACTIONS.join(', ')}.`);
63
+ }
64
+ if (!slug)
65
+ throw new Error(`pages comments ${action} requires <slug>`);
66
+ const base = `/api/pages/${encodeURIComponent(slug)}/annotations`;
67
+ if (action === 'list') {
68
+ const query = flags.path !== undefined ? `?path=${encodeURIComponent(flags.path)}` : '';
69
+ const list = await expectJson(slug, await client.request(base + query, { method: 'GET' }));
70
+ const comments = filterPageComments(list, { path: flags.path, author: flags.author, resolved: flags.resolved === 'true' });
71
+ print(comments, () => renderPageComments(slug, list, comments));
72
+ return;
73
+ }
74
+ if (action === 'enable' || action === 'disable') {
75
+ await expectJson(slug, await client.request(`${base}/settings`, json('PUT', { enabled: action === 'enable' })));
76
+ print({ enabled: action === 'enable' }, () => action === 'enable'
77
+ ? `/p/${slug}/ now shows the Annotations button too. Reload the Page to see it.`
78
+ : `/p/${slug}/ no longer shows annotations. They stay available on /pa/${slug}/.`);
79
+ return;
80
+ }
81
+ if (action === 'add') {
82
+ const body = await commentText(rest, readText);
83
+ const created = await expectJson(slug, await client.request(base, json('POST', { path: normalizePath(flags.path), kind: 'note', anchor: '', body })));
84
+ print(created, () => `Added page note #${created.id} to /p/${slug}/${created.path}.`);
85
+ return;
86
+ }
87
+ const [idText, ...text] = rest;
88
+ const id = Number(idText);
89
+ if (!idText || !Number.isInteger(id) || id <= 0)
90
+ throw new Error(`pages comments ${action} requires <slug> <comment id>`);
91
+ if (action === 'delete') {
92
+ await expectJson(slug, await client.request(`${base}/${id}`, { method: 'DELETE' }), id);
93
+ print({ deleted: id }, () => `Deleted comment #${id} and its replies.`);
94
+ return;
95
+ }
96
+ if (action === 'reply') {
97
+ const created = await expectJson(slug, await client.request(base, json('POST', { threadId: id, body: await commentText(text, readText) })), id);
98
+ print(created, () => `Added reply #${created.id} to #${id}.`);
99
+ return;
100
+ }
101
+ const change = action === 'edit' ? { body: await commentText(text, readText) } : { resolved: action === 'resolve' };
102
+ const updated = await expectJson(slug, await client.request(`${base}/${id}`, json('PATCH', change)), id);
103
+ print(updated, () => action === 'edit' ? `Updated comment #${id}.` : `${action === 'resolve' ? 'Resolved' : 'Reopened'} #${id}.`);
104
+ }
105
+ function json(method, body) {
106
+ return { method, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) };
107
+ }
108
+ function normalizePath(path) {
109
+ return (path ?? '').replace(/^\/+/, '');
110
+ }
111
+ async function commentText(words, readText) {
112
+ const text = (words.length > 0 && words.join(' ') !== '-' ? words.join(' ') : await readText()).trim();
113
+ if (!text)
114
+ throw new Error('The comment is empty. Pass it as an argument or pipe it to stdin.');
115
+ return text;
116
+ }
117
+ async function expectJson(slug, response, id) {
118
+ if (response.status === 204)
119
+ return undefined;
120
+ if (response.ok)
121
+ return await response.json();
122
+ if (response.status === 403) {
123
+ throw new Error(id
124
+ ? `Only the comment's author, the owner of /p/${slug}/ or an administrator can change #${id}.`
125
+ : `Only the owner of /p/${slug}/ or an administrator can change its annotation settings.`);
126
+ }
127
+ if (response.status === 404)
128
+ throw new Error(id ? `Comment #${id} on /p/${slug}/ was not found.` : `Page /p/${slug}/ was not found.`);
129
+ let error = {};
130
+ try {
131
+ error = await response.json();
132
+ }
133
+ catch { }
134
+ throw new Error(error.error ?? `Skillshare returned HTTP ${response.status} for the Page comments.`);
135
+ }
136
+ async function readStdin() {
137
+ if (process.stdin.isTTY)
138
+ return '';
139
+ const chunks = [];
140
+ for await (const chunk of process.stdin)
141
+ chunks.push(Buffer.from(chunk));
142
+ return Buffer.concat(chunks).toString('utf8');
143
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quadient/skillshare",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Skillshare CLI for installing and publishing Quadient skills",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
17
17
  "start": "node ./dist/index.js",
18
18
  "prepublishOnly": "npm run build",
19
- "test": "tsx --test cli-args.test.ts install-files.test.ts output.test.ts pages.test.ts pages-secrets.test.ts pages-dev.test.ts teams-auth.test.ts teams-watch.test.ts teams-browser.test.ts salesforce.test.ts agents.test.ts agents-update.test.ts"
19
+ "test": "tsx --test cli-args.test.ts install-files.test.ts output.test.ts pages.test.ts pages-secrets.test.ts pages-comments.test.ts pages-dev.test.ts teams-auth.test.ts teams-watch.test.ts teams-browser.test.ts salesforce.test.ts agents.test.ts agents-update.test.ts"
20
20
  },
21
21
  "publishConfig": {
22
22
  "access": "public"