@jackwener/opencli 0.9.1 → 0.9.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.
@@ -880,6 +880,7 @@
880
880
  "name": "text",
881
881
  "type": "str",
882
882
  "required": true,
883
+ "positional": true,
883
884
  "help": "Text, command (e.g. /review), or skill (e.g. $imagegen)"
884
885
  }
885
886
  ],
@@ -10,9 +10,14 @@ export const readCommand = cli({
10
10
  func: async (page) => {
11
11
  const historyText = await page.evaluate(`
12
12
  (function() {
13
+ // Precise Codex selector for chat messages
14
+ const turns = Array.from(document.querySelectorAll('[data-content-search-turn-key]'));
15
+ if (turns.length > 0) {
16
+ return turns.map(t => t.innerText || t.textContent).join('\\n\\n---\\n\\n');
17
+ }
18
+
13
19
  // Fallback robust scraping heuristic for chat history panes
14
- // We look for large scrolling areas or generic message lists
15
- const threadContainer = document.querySelector('[role="log"], [data-testid="conversation"], main, .thread-container, .messages-list');
20
+ const threadContainer = document.querySelector('[role="log"], [data-testid="conversation"], .thread-container, .messages-list, main');
16
21
 
17
22
  if (threadContainer) {
18
23
  return threadContainer.innerText || threadContainer.textContent;
@@ -6,7 +6,7 @@ export const sendCommand = cli({
6
6
  domain: 'localhost',
7
7
  strategy: Strategy.UI,
8
8
  browser: true,
9
- args: [{ name: 'text', required: true, help: 'Text, command (e.g. /review), or skill (e.g. $imagegen)' }],
9
+ args: [{ name: 'text', required: true, positional: true, help: 'Text, command (e.g. /review), or skill (e.g. $imagegen)' }],
10
10
  columns: ['Status', 'InjectedText'],
11
11
  func: async (page, kwargs) => {
12
12
  const textToInsert = kwargs.text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackwener/opencli",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,9 +11,14 @@ export const readCommand = cli({
11
11
  func: async (page) => {
12
12
  const historyText = await page.evaluate(`
13
13
  (function() {
14
+ // Precise Codex selector for chat messages
15
+ const turns = Array.from(document.querySelectorAll('[data-content-search-turn-key]'));
16
+ if (turns.length > 0) {
17
+ return turns.map(t => t.innerText || t.textContent).join('\\n\\n---\\n\\n');
18
+ }
19
+
14
20
  // Fallback robust scraping heuristic for chat history panes
15
- // We look for large scrolling areas or generic message lists
16
- const threadContainer = document.querySelector('[role="log"], [data-testid="conversation"], main, .thread-container, .messages-list');
21
+ const threadContainer = document.querySelector('[role="log"], [data-testid="conversation"], .thread-container, .messages-list, main');
17
22
 
18
23
  if (threadContainer) {
19
24
  return threadContainer.innerText || threadContainer.textContent;
@@ -7,7 +7,7 @@ export const sendCommand = cli({
7
7
  domain: 'localhost',
8
8
  strategy: Strategy.UI,
9
9
  browser: true,
10
- args: [{ name: 'text', required: true, help: 'Text, command (e.g. /review), or skill (e.g. $imagegen)' }],
10
+ args: [{ name: 'text', required: true, positional: true, help: 'Text, command (e.g. /review), or skill (e.g. $imagegen)' }],
11
11
  columns: ['Status', 'InjectedText'],
12
12
  func: async (page, kwargs) => {
13
13
  const textToInsert = kwargs.text as string;