gipity 1.1.40 → 1.1.42
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/dist/approval-verify.js +113 -0
- package/dist/commands/approval.js +85 -2
- package/dist/commands/deploy.js +13 -6
- package/dist/commands/key.js +5 -0
- package/dist/commands/load.js +44 -2
- package/dist/commands/notify.js +105 -12
- package/dist/commands/save.js +19 -4
- package/dist/commands/status.js +15 -1
- package/dist/index.js +632 -343
- package/dist/knowledge.js +3 -2
- package/package.json +2 -2
package/dist/commands/status.js
CHANGED
|
@@ -8,6 +8,14 @@ import { getConfig, liveUrl, resolveApiBase } from '../config.js';
|
|
|
8
8
|
import { brand, success, warning, muted, error as clrError } from '../colors.js';
|
|
9
9
|
import { GIPITY_PLUGIN_ID, GIPITY_MARKETPLACE_NAME, setupClaudeHooks, ensureGipityPlugin, ensureGipityPluginInstalled, userScopeInstallState } from '../setup.js';
|
|
10
10
|
import { flushBugQueue } from '../bug-queue.js';
|
|
11
|
+
import { pageAccessLabel } from './deploy.js';
|
|
12
|
+
/** Who may load this project's deployed pages, or null when it can't be read
|
|
13
|
+
* right now (not logged in, API slow or unreachable). Capped like probeAuth. */
|
|
14
|
+
async function probePageAccess(projectGuid) {
|
|
15
|
+
const timeout = new Promise(res => setTimeout(() => res(null), 5000).unref?.());
|
|
16
|
+
const call = get(`/projects/${projectGuid}`).then((res) => res.data?.page_access ?? null, () => null);
|
|
17
|
+
return Promise.race([call, timeout]);
|
|
18
|
+
}
|
|
11
19
|
/** Hooks ship in the Gipity Claude Code plugin now. "Installed" means three
|
|
12
20
|
* things must all hold: the user-scope settings register the marketplace and
|
|
13
21
|
* enable the plugin (declarative), AND Claude Code actually has a user-scope
|
|
@@ -75,7 +83,10 @@ export const statusCommand = new Command('status')
|
|
|
75
83
|
// now go out. Skipped entirely (existsSync short-circuit) when the queue
|
|
76
84
|
// is empty, which is the common case, so this stays a no-op most runs.
|
|
77
85
|
const queueDelivered = (auth && !sessionExpired()) ? await flushBugQueue().catch(() => 0) : 0;
|
|
78
|
-
const probe = await
|
|
86
|
+
const [probe, pageAccess] = await Promise.all([
|
|
87
|
+
probeAuth(!!auth),
|
|
88
|
+
config && (auth || usingEnvToken()) ? probePageAccess(config.projectGuid) : Promise.resolve(null),
|
|
89
|
+
]);
|
|
79
90
|
// RBAC lets a project be shared to a collaborator whose own account
|
|
80
91
|
// legitimately differs from the project owner's - so this is advisory,
|
|
81
92
|
// never a hard error. Only meaningful once a live 'ok' call has actually
|
|
@@ -92,6 +103,7 @@ export const statusCommand = new Command('status')
|
|
|
92
103
|
apiBaseInUse,
|
|
93
104
|
url: liveUrl(config),
|
|
94
105
|
...(config.env ? { env: config.env.name } : {}),
|
|
106
|
+
...(pageAccess ? { pageAccess } : {}),
|
|
95
107
|
} : null,
|
|
96
108
|
// `valid` reflects the refresh token (the real session) - access
|
|
97
109
|
// tokens auto-renew, so their expiry must not read as "invalid".
|
|
@@ -119,6 +131,8 @@ export const statusCommand = new Command('status')
|
|
|
119
131
|
if (config.env)
|
|
120
132
|
console.log(`${muted('Env:')} ${config.env.name}`);
|
|
121
133
|
console.log(`${muted('Live:')} ${liveUrl(config)}`);
|
|
134
|
+
if (pageAccess && pageAccess !== 'public')
|
|
135
|
+
console.log(`${muted('Pages:')} ${pageAccessLabel(pageAccess)}`);
|
|
122
136
|
console.log(`${muted('API:')} ${config.apiBase}`);
|
|
123
137
|
// apiBase is only what THIS project recorded - resolveApiBase() is what
|
|
124
138
|
// every real request actually uses (it can diverge via GIPITY_API_BASE,
|