@intflow/sentinelctl 0.11.1 → 0.11.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intflow/sentinelctl",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Sentinel Fleet Console CLI: search device logs, inspect status and metrics, edit metadata, manage roles and create access keys for MCP",
5
5
  "repository": {
6
6
  "type": "git",
package/src/commands.mjs CHANGED
@@ -1315,6 +1315,12 @@ async function changesRecent(context, { options }) {
1315
1315
  }
1316
1316
 
1317
1317
  const commands = [
1318
+ {
1319
+ group: null, name: 'whoami', role: 'viewer', mutates: false,
1320
+ summary: 'Show the authenticated account, role and credential',
1321
+ args: [], options: {}, examples: ['sentinelctl whoami'],
1322
+ run: async context => { const identity = await context.client.get('/api/session'); emit(context, identity, () => identity.user); },
1323
+ },
1318
1324
  {
1319
1325
  group: null, name: 'update', role: 'viewer', mutates: false, mcp: false, local: true,
1320
1326
  run: async (context, { options }) => context.out(JSON.stringify(await update(options))),
@@ -1649,7 +1655,7 @@ const commands = [
1649
1655
  examples: ['sentinelctl sessions revoke <session-id>'], output: 'Confirmation message.',
1650
1656
  },
1651
1657
  {
1652
- group: 'access', name: 'create', run: accessCreate, role: 'viewer', mutates: true, mcp: false,
1658
+ group: 'access', name: 'create', run: accessCreate, role: 'viewer', mutates: true, browser: true,
1653
1659
  summary: 'Create an access key for MCP clients and scripts (shown once)',
1654
1660
  description: 'The key carries your account and role, works without a browser or CLI login, lasts 30 days and gains 7 more days whenever it is used a week or more after the last extension. Up to 10 keys per person. A read key runs only commands that do not change data; the level is fixed when the key is created.',
1655
1661
  args: [{ name: 'name', description: 'A label to recognise the key by, 1-80 characters.' }],
@@ -1660,12 +1666,12 @@ const commands = [
1660
1666
  output: '{id, name, access, createdAt, lastUsedAt, expiresAt, token, mcpUrl}. The token is never shown again.',
1661
1667
  },
1662
1668
  {
1663
- group: 'access', name: 'list', run: accessList, role: 'viewer', mutates: false, mcp: false,
1669
+ group: 'access', name: 'list', run: accessList, role: 'viewer', mutates: false, browser: true,
1664
1670
  summary: 'Your access keys', options: {},
1665
1671
  examples: ['sentinelctl access list'], output: '{keys[]: {id, name, access, createdAt, lastUsedAt, expiresAt}}.',
1666
1672
  },
1667
1673
  {
1668
- group: 'access', name: 'revoke', run: accessRevoke, role: 'viewer', mutates: true, mcp: false,
1674
+ group: 'access', name: 'revoke', run: accessRevoke, role: 'viewer', mutates: true, browser: true,
1669
1675
  summary: 'Revoke one of your access keys now', args: [{ name: 'key-id' }], options: {},
1670
1676
  examples: ['sentinelctl access revoke <key-id>'], output: 'Confirmation message.',
1671
1677
  },
@@ -1800,7 +1806,7 @@ const commands = [
1800
1806
  output: '{sourceId, generatedAt, status, ingest, last, kinds, key, rejections}.',
1801
1807
  },
1802
1808
  {
1803
- group: 'sources', name: 'test', run: sourcesTest, role: 'viewer', mutates: true, mcp: false,
1809
+ group: 'sources', name: 'test', run: sourcesTest, role: 'viewer', mutates: true, browser: true,
1804
1810
  summary: 'Send one test event with a source key file and verify the same event ID in central search',
1805
1811
  args: [{ name: 'source-id' }],
1806
1812
  options: { 'key-file': { type: 'string', placeholder: 'path', description: 'Owner-only source write-key file; the key is never printed.' } },
@@ -1808,7 +1814,7 @@ const commands = [
1808
1814
  output: '{sourceId, eventId, status: verified, receivedAt, test: true}.',
1809
1815
  },
1810
1816
  {
1811
- group: 'sources', name: 'keys issue', run: sourcesKeysIssue, role: 'viewer', mutates: true, mcp: false,
1817
+ group: 'sources', name: 'keys issue', run: sourcesKeysIssue, role: 'viewer', mutates: true, browser: true,
1812
1818
  summary: 'Issue the write key of a source (events:write, 365 days, shown once)',
1813
1819
  description: 'One valid key per source. With --replace the current key is revoked at once and a new one is issued.',
1814
1820
  args: [{ name: 'source-id' }],
package/src/main.mjs CHANGED
@@ -174,7 +174,7 @@ function commandsCatalog(selected = null) {
174
174
  exitCodes,
175
175
  commands: [
176
176
  ...(selected ? [] : Object.entries(specialCommands).map(([name, command]) => ({ command: name, usage: command.usage, summary: command.summary, mutates: name === 'logout' }))),
177
- ...(selected ?? catalog).map((command) => compact({
177
+ ...(selected ?? catalog.filter(command => !Object.hasOwn(specialCommands, commandPath(command)))).map((command) => compact({
178
178
  command: commandPath(command), usage: usageLine(command), summary: command.summary, description: command.description,
179
179
  role: command.role, roleNote: command.roleNote, mutates: command.mutates, args: command.args,
180
180
  options: Object.fromEntries(Object.entries(command.options).map(([name, spec]) => [name, compact({