askshepherd 0.1.25 → 0.1.28
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/README.md +8 -1
- package/bin/shepherd-onboard.js +31 -5
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# AskShepherd
|
|
2
2
|
|
|
3
|
-
Customer-facing
|
|
3
|
+
Customer-facing production onboarding and MCP for Shepherd.
|
|
4
|
+
|
|
5
|
+
The npm package is `askshepherd`. The installed binary also exposes `shepherd`,
|
|
6
|
+
but the public one-liner uses the package name:
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npx -y askshepherd@latest agent
|
|
10
|
+
```
|
|
4
11
|
|
|
5
12
|
## Coding Agent One-liner
|
|
6
13
|
|
package/bin/shepherd-onboard.js
CHANGED
|
@@ -11,7 +11,7 @@ import { fileURLToPath } from "node:url";
|
|
|
11
11
|
const DEFAULT_API_URL = "https://brain-api-customer-facing.up.railway.app";
|
|
12
12
|
const PACKAGE_NAME = "askshepherd";
|
|
13
13
|
const PACKAGE_SPEC = `${PACKAGE_NAME}@latest`;
|
|
14
|
-
const PACKAGE_VERSION = "0.1.
|
|
14
|
+
const PACKAGE_VERSION = "0.1.28";
|
|
15
15
|
const MCP_SERVER_NAME = "shepherd";
|
|
16
16
|
const PACKAGE_DIR = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
17
17
|
const DEFAULT_AGENT_STATE_PATH = join(homedir(), ".shepherd", "raw-onboarding-agent.json");
|
|
@@ -245,6 +245,7 @@ async function runOnboarding() {
|
|
|
245
245
|
{ token: session.sessionToken },
|
|
246
246
|
);
|
|
247
247
|
console.log(`Onboarding status: ${status.status}`);
|
|
248
|
+
printProcessingSummary(status);
|
|
248
249
|
console.log("\nShepherd raw sync setup is ready.\n");
|
|
249
250
|
}
|
|
250
251
|
|
|
@@ -664,7 +665,7 @@ async function runMcpProxy() {
|
|
|
664
665
|
{ StreamableHTTPClientTransport },
|
|
665
666
|
{ Server },
|
|
666
667
|
{ StdioServerTransport },
|
|
667
|
-
{ ResultSchema },
|
|
668
|
+
{ CallToolRequestSchema, ListToolsRequestSchema, ResultSchema },
|
|
668
669
|
] = await Promise.all([
|
|
669
670
|
import("@modelcontextprotocol/sdk/client/index.js"),
|
|
670
671
|
import("@modelcontextprotocol/sdk/client/streamableHttp.js"),
|
|
@@ -672,6 +673,7 @@ async function runMcpProxy() {
|
|
|
672
673
|
import("@modelcontextprotocol/sdk/server/stdio.js"),
|
|
673
674
|
import("@modelcontextprotocol/sdk/types.js"),
|
|
674
675
|
]);
|
|
676
|
+
const proxyRequestOptions = { timeout: 240_000, resetTimeoutOnProgress: true };
|
|
675
677
|
|
|
676
678
|
const remote = new Client(
|
|
677
679
|
{ name: "askshepherd-mcp-proxy", version: PACKAGE_VERSION },
|
|
@@ -696,13 +698,17 @@ async function runMcpProxy() {
|
|
|
696
698
|
fallbackRequestHandler: async (request, extra) => remote.request(
|
|
697
699
|
request,
|
|
698
700
|
passthroughResultSchema,
|
|
699
|
-
{ signal: extra.signal
|
|
701
|
+
{ ...proxyRequestOptions, signal: extra.signal },
|
|
700
702
|
),
|
|
701
703
|
fallbackNotificationHandler: async (notification) => {
|
|
702
704
|
await remote.notification(notification);
|
|
703
705
|
},
|
|
704
706
|
},
|
|
705
707
|
);
|
|
708
|
+
local.setRequestHandler(ListToolsRequestSchema, async (request, extra) =>
|
|
709
|
+
remote.listTools(request.params, { ...proxyRequestOptions, signal: extra.signal }));
|
|
710
|
+
local.setRequestHandler(CallToolRequestSchema, async (request, extra) =>
|
|
711
|
+
remote.callTool(request.params, passthroughResultSchema, { ...proxyRequestOptions, signal: extra.signal }));
|
|
706
712
|
await local.connect(new StdioServerTransport());
|
|
707
713
|
}
|
|
708
714
|
|
|
@@ -905,6 +911,8 @@ async function continueAgentOnboarding() {
|
|
|
905
911
|
console.log(JSON.stringify({
|
|
906
912
|
status: errors ? "waiting" : "completed",
|
|
907
913
|
connected: Object.keys(finalized.connected ?? {}),
|
|
914
|
+
processingEnabled: finalized.processingEnabled === true,
|
|
915
|
+
processing: finalized.processing,
|
|
908
916
|
errors: errors ? safeErrorRecord(errors) : undefined,
|
|
909
917
|
currentAction,
|
|
910
918
|
nextCommand: errors ? `${agentCommand()} agent --continue --messages-handle "<phone_or_apple_id>" --messages-chat-ids "<comma_separated_chat_ids>" --granola-api-key "<granola_key>"` : undefined,
|
|
@@ -930,7 +938,7 @@ async function continueAgentOnboarding() {
|
|
|
930
938
|
|
|
931
939
|
console.log("\nShepherd raw onboarding completed.");
|
|
932
940
|
console.log(`Connected sources: ${Object.keys(finalized.connected ?? {}).join(", ") || "none"}`);
|
|
933
|
-
|
|
941
|
+
printProcessingSummary(finalized);
|
|
934
942
|
}
|
|
935
943
|
|
|
936
944
|
async function printAgentStatus() {
|
|
@@ -945,6 +953,8 @@ async function printAgentStatus() {
|
|
|
945
953
|
account: status.account,
|
|
946
954
|
providers: status.providers,
|
|
947
955
|
rawOnly: status.rawOnly,
|
|
956
|
+
processingEnabled: status.processingEnabled === true,
|
|
957
|
+
processing: status.processing,
|
|
948
958
|
}, null, 2));
|
|
949
959
|
}
|
|
950
960
|
|
|
@@ -1428,7 +1438,10 @@ async function updateAgentStateFromOnboardingResponse(state, response) {
|
|
|
1428
1438
|
const hasGoogleWorkspaceDelegation = response?.googleWorkspaceDelegation
|
|
1429
1439
|
&& typeof response.googleWorkspaceDelegation === "object"
|
|
1430
1440
|
&& !Array.isArray(response.googleWorkspaceDelegation);
|
|
1431
|
-
|
|
1441
|
+
const hasStatus = typeof response?.status === "string";
|
|
1442
|
+
const hasProcessing = typeof response?.processingEnabled === "boolean" || response?.processing;
|
|
1443
|
+
const hasProviders = response?.providers && typeof response.providers === "object" && !Array.isArray(response.providers);
|
|
1444
|
+
if (!hasAuthUrls && !hasGoogleWorkspaceDelegation && !hasStatus && !hasProcessing && !hasProviders) return state;
|
|
1432
1445
|
|
|
1433
1446
|
const next = {
|
|
1434
1447
|
...state,
|
|
@@ -1436,11 +1449,24 @@ async function updateAgentStateFromOnboardingResponse(state, response) {
|
|
|
1436
1449
|
...(hasGoogleWorkspaceDelegation
|
|
1437
1450
|
? { googleWorkspaceDelegation: googleWorkspaceDelegationSetup(response.googleWorkspaceDelegation) }
|
|
1438
1451
|
: {}),
|
|
1452
|
+
...(hasStatus ? { status: response.status } : {}),
|
|
1453
|
+
...(typeof response?.processingEnabled === "boolean" ? { processingEnabled: response.processingEnabled } : {}),
|
|
1454
|
+
...(response?.processing ? { processing: response.processing } : {}),
|
|
1455
|
+
...(hasProviders ? { providers: response.providers } : {}),
|
|
1439
1456
|
};
|
|
1440
1457
|
await writeAgentState(next);
|
|
1441
1458
|
return next;
|
|
1442
1459
|
}
|
|
1443
1460
|
|
|
1461
|
+
function printProcessingSummary(payload) {
|
|
1462
|
+
if (payload?.processingEnabled === true && payload?.processing?.status === "started") {
|
|
1463
|
+
console.log("Downstream processing: started. Wiki, memory, and summary generation are queued or scheduled in production.");
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
console.log("Downstream processing: not started. Run the continue command again after source authorization is complete.");
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1444
1470
|
function publicAgentAccount(account) {
|
|
1445
1471
|
return {
|
|
1446
1472
|
email: account?.email,
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "askshepherd",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Customer-facing Shepherd
|
|
3
|
+
"version": "0.1.28",
|
|
4
|
+
"description": "Customer-facing Shepherd production onboarding and MCP CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"askshepherd": "bin/shepherd-onboard.js",
|
|
8
|
+
"shepherd": "bin/shepherd-onboard.js",
|
|
8
9
|
"shepherd-onboard": "bin/shepherd-onboard.js"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|