@aholbreich/agent-skills 0.6.0 → 0.6.1
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aholbreich/agent-skills",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Handcrafted Agent Skills for browser-authenticated Jira and Confluence ingestion, LLM wiki workflows, and developer automation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -131,6 +131,18 @@ async function openDevtoolsTab(url) {
|
|
|
131
131
|
return false;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
async function hasDevtoolsTabForWiki(url) {
|
|
135
|
+
if (!url) return false;
|
|
136
|
+
const host = new URL(url).host;
|
|
137
|
+
const list = await endpoint('/json/list');
|
|
138
|
+
return list.some(t => t.type === 'page' && t.url && (() => {
|
|
139
|
+
try {
|
|
140
|
+
const tabUrl = new URL(t.url);
|
|
141
|
+
return tabUrl.host === host && tabUrl.pathname.startsWith('/wiki');
|
|
142
|
+
} catch { return false; }
|
|
143
|
+
})());
|
|
144
|
+
}
|
|
145
|
+
|
|
134
146
|
function isExecutable(file) {
|
|
135
147
|
try { fs.accessSync(file, fs.constants.X_OK); return true; } catch { return false; }
|
|
136
148
|
}
|
|
@@ -198,9 +210,14 @@ async function ensureBrowser(openUrl) {
|
|
|
198
210
|
console.log(`Reusing Chrome DevTools on port ${opts.port}`);
|
|
199
211
|
const targetUrl = openUrl || wikiBase;
|
|
200
212
|
if (targetUrl) {
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
|
|
213
|
+
const hasTab = await hasDevtoolsTabForWiki(targetUrl);
|
|
214
|
+
if (hasTab) {
|
|
215
|
+
console.log(`Found existing Confluence tab for ${new URL(targetUrl).host}; not opening another tab.`);
|
|
216
|
+
} else {
|
|
217
|
+
const opened = await openDevtoolsTab(targetUrl);
|
|
218
|
+
if (opened) console.log(`Opened target URL in reused browser: ${targetUrl}`);
|
|
219
|
+
else console.warn(`Could not open target URL through DevTools; continuing with existing tabs.`);
|
|
220
|
+
}
|
|
204
221
|
}
|
|
205
222
|
}
|
|
206
223
|
await waitDevtools();
|
|
@@ -143,6 +143,15 @@ async function openDevtoolsTab(url) {
|
|
|
143
143
|
return false;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
async function hasDevtoolsTabForHost(url) {
|
|
147
|
+
if (!url) return false;
|
|
148
|
+
const host = new URL(url).host;
|
|
149
|
+
const list = await endpoint('/json/list');
|
|
150
|
+
return list.some(t => t.type === 'page' && t.url && (() => {
|
|
151
|
+
try { return new URL(t.url).host === host; } catch { return false; }
|
|
152
|
+
})());
|
|
153
|
+
}
|
|
154
|
+
|
|
146
155
|
function isExecutable(file) {
|
|
147
156
|
try { fs.accessSync(file, fs.constants.X_OK); return true; } catch { return false; }
|
|
148
157
|
}
|
|
@@ -520,9 +529,14 @@ async function ensureBrowser(browseUrl) {
|
|
|
520
529
|
} else {
|
|
521
530
|
console.log(`Reusing Chrome DevTools on port ${opts.port}`);
|
|
522
531
|
if (browseUrl) {
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
|
|
532
|
+
const hasTab = await hasDevtoolsTabForHost(browseUrl);
|
|
533
|
+
if (hasTab) {
|
|
534
|
+
console.log(`Found existing Jira/Atlassian tab for ${new URL(browseUrl).host}; not opening another tab.`);
|
|
535
|
+
} else {
|
|
536
|
+
const opened = await openDevtoolsTab(browseUrl);
|
|
537
|
+
if (opened) console.log(`Opened target URL in reused browser: ${browseUrl}`);
|
|
538
|
+
else console.warn(`Could not open target URL through DevTools; continuing with existing tabs.`);
|
|
539
|
+
}
|
|
526
540
|
}
|
|
527
541
|
}
|
|
528
542
|
await waitDevtools();
|