pm-skill 1.1.1 → 1.1.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.
Files changed (2) hide show
  1. package/dist/workflows.js +26 -4
  2. package/package.json +1 -1
package/dist/workflows.js CHANGED
@@ -5,7 +5,7 @@ import { resolve, dirname } from "path";
5
5
  import { validateEnv, writeEnvFile, PKG_ROOT } from "./env.js";
6
6
  import { loadConfig, getTemplate, resolvePriority, resolveSeverity, validateDocType, validateLabel, } from "./config.js";
7
7
  import { getLinearClient, validateLinearKey, createIssue, getIssue, getIssueDetail, createRelation, createAttachment, createLabel, getTeams, getTeamStates, getTeamLabels, resolveLabels, } from "./linear.js";
8
- import { getNotionClient, createTemplatedPage, createDatabaseEntry, validateNotionKey, } from "./notion.js";
8
+ import { getNotionClient, createTemplatedPage, createDatabaseEntry, validateNotionKey, searchPages, } from "./notion.js";
9
9
  // ── Init ──
10
10
  function copyBundledFile(srcName, destPath) {
11
11
  if (existsSync(destPath)) {
@@ -69,11 +69,33 @@ async function init(args) {
69
69
  throw new Error(`Team '${teamId}' not found. Run 'npx pm-skill init --linear-key <key>' to see available teams.`);
70
70
  }
71
71
  }
72
- // 3. Validate Notion key (optional)
72
+ // 3. Validate Notion key + auto-detect root page
73
+ let selectedNotionPage = notionPage;
73
74
  if (notionKey) {
74
75
  console.log("\n[Notion] Validating API key...");
75
76
  const notionUser = await validateNotionKey(notionKey);
76
77
  console.log(` Authenticated as: ${notionUser.name}`);
78
+ if (!selectedNotionPage) {
79
+ console.log(" Searching for accessible pages...");
80
+ const notionClient = getNotionClient(notionKey);
81
+ const pages = await searchPages(notionClient, "");
82
+ if (pages.length === 0) {
83
+ console.log(" ⚠️ No pages shared with this integration.");
84
+ console.log(" Share a page in Notion: page menu → Connections → add your integration");
85
+ }
86
+ else if (pages.length === 1) {
87
+ selectedNotionPage = pages[0].id;
88
+ console.log(` Auto-selected root page: "${pages[0].title}" (${pages[0].id})`);
89
+ }
90
+ else {
91
+ console.log(`\n Accessible pages (${pages.length}):`);
92
+ for (const page of pages) {
93
+ console.log(` ${page.title} | ${page.id}`);
94
+ }
95
+ selectedNotionPage = pages[0].id;
96
+ console.log(` Using first page: "${pages[0].title}". Override with --notion-page <id>`);
97
+ }
98
+ }
77
99
  }
78
100
  // 4. Write .env
79
101
  console.log("\n[Config] Writing .env...");
@@ -85,8 +107,8 @@ async function init(args) {
85
107
  envEntries.LINEAR_DEFAULT_PROJECT_ID = projectId;
86
108
  if (notionKey)
87
109
  envEntries.NOTION_API_KEY = notionKey;
88
- if (notionPage)
89
- envEntries.NOTION_ROOT_PAGE_ID = notionPage;
110
+ if (selectedNotionPage)
111
+ envEntries.NOTION_ROOT_PAGE_ID = selectedNotionPage;
90
112
  const envPath = writeEnvFile(cwd, envEntries);
91
113
  console.log(` Written: ${envPath}`);
92
114
  // 5. Copy config.yml, SKILL.md, AGENTS.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pm-skill",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Structured project management CLI — Linear + Notion integration for AI coding assistants (Claude Code, Codex)",
5
5
  "type": "module",
6
6
  "bin": {