@vpxa/aikit 0.1.72 → 0.1.73

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": "@vpxa/aikit",
3
- "version": "0.1.72",
3
+ "version": "0.1.73",
4
4
  "type": "module",
5
5
  "description": "Local-first AI developer toolkit — knowledge base, code analysis, context management, and developer tools for LLM agents",
6
6
  "license": "MIT",
@@ -257,7 +257,17 @@ Before every tool call, verify:
257
257
  | \`session-handoff\` | Context filling up, session ending, or major milestone |
258
258
  | \`lesson-learned\` | After completing work — extract engineering principles |
259
259
  | \`docs\` | During \`_docs-sync\` epilogue — living documentation convention, templates, change-to-doc mapping |
260
- | \`repo-access\` | When any agent encounters git auth failures (401/403/404, Permission denied) or needs to access private/enterprise repos |
260
+ | \`repo-access\` | **IMMEDIATELY** when YOU or any subagent get auth failures from \`web_fetch\`, \`http\`, or git commands (401, 403, 404, SSO redirect, login HTML, "Permission denied"). NEVER declare a repo "inaccessible" without first loading this skill and walking the Strategy Ladder |
261
+
262
+ ## Repo Access — HARD RULE
263
+
264
+ **If \`web_fetch\` or \`http\` returns 401, 403, 404, SSO redirect, login page HTML, or any auth-like failure for a repository or code URL:**
265
+ 1. **STOP** — do NOT declare the repo "inaccessible" or "behind SSO"
266
+ 2. **Load the \`repo-access\` skill** and follow its Strategy Ladder
267
+ 3. **Walk all 5 steps** before concluding access is impossible
268
+ 4. **Include \`repo-access\` in subagent prompts** when delegating tasks that touch the same repo
269
+
270
+ This applies to YOU (the Orchestrator) when you use \`web_fetch\`/\`http\` directly, not just subagents.
261
271
 
262
272
  **When dispatching subagents**, include relevant skill names in the prompt so subagents know which skills to load (e.g., "Load the \`react\` and \`typescript\` skills for this task").
263
273
 
@@ -274,7 +274,17 @@ Before every tool call, verify:
274
274
  | `session-handoff` | Context filling up, session ending, or major milestone |
275
275
  | `lesson-learned` | After completing work — extract engineering principles |
276
276
  | `docs` | During `_docs-sync` epilogue — living documentation convention, templates, change-to-doc mapping |
277
- | `repo-access` | When any agent encounters git auth failures (401/403/404, Permission denied) or needs to access private/enterprise repos |
277
+ | `repo-access` | **IMMEDIATELY** when YOU or any subagent get auth failures from `web_fetch`, `http`, or git commands (401, 403, 404, SSO redirect, login HTML, "Permission denied"). NEVER declare a repo "inaccessible" without first loading this skill and walking the Strategy Ladder |
278
+
279
+ ## Repo Access — HARD RULE
280
+
281
+ **If `web_fetch` or `http` returns 401, 403, 404, SSO redirect, login page HTML, or any auth-like failure for a repository or code URL:**
282
+ 1. **STOP** — do NOT declare the repo "inaccessible" or "behind SSO"
283
+ 2. **Load the `repo-access` skill** and follow its Strategy Ladder
284
+ 3. **Walk all 5 steps** before concluding access is impossible
285
+ 4. **Include `repo-access` in subagent prompts** when delegating tasks that touch the same repo
286
+
287
+ This applies to YOU (the Orchestrator) when you use `web_fetch`/`http` directly, not just subagents.
278
288
 
279
289
  **When dispatching subagents**, include relevant skill names in the prompt so subagents know which skills to load (e.g., "Load the `react` and `typescript` skills for this task").
280
290
 
@@ -22,7 +22,10 @@ Progressively recover repository access for private, enterprise, and internal gi
22
22
 
23
23
  - `git clone`, `git fetch`, or `git pull` fails with `401`, `403`, `404`, `Authentication failed`, or `Permission denied (publickey)`.
24
24
  - `http` diagnostics against a repo endpoint show auth failure or ambiguous private-repo responses.
25
+ - `web_fetch` returns login page HTML, SSO redirect, "Sign in", "Page not found", or empty/truncated content for a repo URL.
26
+ - Any tool output contains "behind SSO", "SSO required", "SAML", "requires authentication", or similar auth-gate language about a repository.
25
27
  - A repository URL works in a browser for the user but fails from agent tools or terminal commands.
28
+ - **You are about to declare a repo "inaccessible" or "unreachable"** — STOP and activate this skill first.
26
29
 
27
30
  ### Proactive triggers
28
31
 
@@ -113,9 +116,23 @@ Agents often use `web_fetch` or `http` to read individual files without a full c
113
116
  | `raw.githubusercontent.com/{owner}/{repo}/{ref}/{path}` | GitHub | `404` — no auth header accepted |
114
117
  | `github.com/{owner}/{repo}/blob/{ref}/{path}` | GitHub web view | `200` with login HTML, not code |
115
118
  | `api.github.com/repos/{owner}/{repo}/contents/{path}` | GitHub API | `404` (the GitHub 404 trap) |
119
+ | `<ghe-host>/{owner}/{repo}/*` (any GHE URL) | GitHub Enterprise | `200` with SAML SSO redirect page — body contains "Initiating SAML single sign-on" and redirect to `login.microsoftonline.com` or other IdP |
116
120
  | `gitlab.com/{owner}/{repo}/-/raw/{ref}/{path}` | GitLab | `401` or login redirect |
117
121
  | `dev.azure.com/{org}/{project}/_apis/git/repositories/{repo}/items` | Azure DevOps | `401` or `203` non-authoritative |
118
122
 
123
+ ### SAML SSO Detection (CRITICAL)
124
+
125
+ GHE instances with SAML SSO return `200 OK` with an HTML body that is NOT the requested content. **This is the most common false-"inaccessible" scenario.** Detect it by checking `web_fetch` output for ANY of these strings:
126
+
127
+ - `Initiating SAML single sign-on`
128
+ - `login.microsoftonline.com` (Azure AD / Entra ID)
129
+ - `You are being redirected to your identity provider`
130
+ - `/login?return_to=`
131
+ - `SAMLRequest=`
132
+ - `RelayState=`
133
+
134
+ If ANY of these appear → the repo exists and is accessible, it just needs authentication. This is NOT "inaccessible" — follow the Strategy Ladder.
135
+
119
136
  ### Recovery: Authenticated API Reads
120
137
 
121
138
  When `web_fetch` fails on a private repo URL, switch to authenticated `http` calls:
@@ -65,7 +65,34 @@ http GET https://api.github.com/repos/{owner}/{repo}
65
65
 
66
66
  | Edge Case | Signal | Response |
67
67
  |---|---|---|
68
- | GitHub SAML SSO | `403` + `X-GitHub-SSO: required; url=...` | PAT needs SSO authorization for the org |
68
+ | GitHub.com SAML SSO | `403` + `X-GitHub-SSO: required; url=...` | PAT needs SSO authorization for the org |
69
+ | GHE SAML SSO (web_fetch) | `200` + body contains `Initiating SAML single sign-on`, redirect to `login.microsoftonline.com` or other IdP | Repo EXISTS and is auth-gated. NOT inaccessible. Use PAT + `http` with auth headers, or `gh auth login --hostname <host>` |
70
+ | GHE SAML SSO (http) | `302` redirect to `/login?return_to=...` or IdP URL | Same — repo exists, needs auth. Walk the Strategy Ladder |
71
+ | GHE SAML SSO (git CLI) | `fatal: Authentication failed` or credential prompt | `gh auth login --hostname <host>` or PAT via credential helper |
72
+
73
+ ## SAML SSO — Detailed Pattern
74
+
75
+ GitHub Enterprise instances commonly use SAML SSO via Azure AD (Entra ID), Okta, or other IdPs. When `web_fetch` hits a GHE URL without auth:
76
+
77
+ 1. GHE returns `200 OK` (not 401/403!) with an HTML page
78
+ 2. The HTML contains `Initiating SAML single sign-on` and a redirect URL to the IdP
79
+ 3. The redirect URL includes `SAMLRequest=`, `RelayState=`, and often `login.microsoftonline.com`
80
+ 4. The agent sees HTML content and may conclude the repo is "inaccessible" or "behind SSO"
81
+
82
+ **Detection strings** (check `web_fetch` output for ANY of these):
83
+ ```
84
+ Initiating SAML single sign-on
85
+ login.microsoftonline.com
86
+ You are being redirected to your identity provider
87
+ /login?return_to=
88
+ SAMLRequest=
89
+ RelayState=
90
+ ```
91
+
92
+ **Correct response:** The repo exists. The `web_fetch` path will never work for SSO-protected GHE. Switch to:
93
+ - `gh auth login --hostname <ghe-host>` (if `gh` CLI available)
94
+ - PAT + `http` with `Authorization: token <PAT>` against `<ghe-host>/api/v3/repos/{owner}/{repo}/contents/{path}`
95
+ - Ask user for local clone if no token can be obtained
69
96
  | GitLab 2FA enabled | `401` on password auth | PAT is mandatory; 2FA blocks password auth |
70
97
  | Expired token | `401` after providing a valid-looking PAT | Generate a new token and check expiry |
71
98
  | GitHub rate limit | `403` + body contains `rate limit` | Not an auth failure; wait or authenticate for a higher limit |