@adhdev/mesh-shared 1.0.82-rc.23 → 1.0.82-rc.25
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/assistant-protocol.d.ts +119 -2
- package/dist/index.js +79 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -2
- package/dist/index.mjs.map +1 -1
- package/dist/mesh-tool-names.d.ts +2 -2
- package/dist/protocol/dashboard-daemon-p2p.d.ts +1 -1
- package/dist/worker-protocol.d.ts +1 -1
- package/package.json +1 -1
- package/src/assistant-protocol.ts +208 -2
- package/src/mesh-tool-names.ts +1 -0
- package/src/worker-protocol.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -790,7 +790,8 @@ var CANONICAL_MESH_TOOL_NAMES = [
|
|
|
790
790
|
"mesh_review_inbox",
|
|
791
791
|
"mesh_node_slots",
|
|
792
792
|
"driver_list",
|
|
793
|
-
"driver_describe"
|
|
793
|
+
"driver_describe",
|
|
794
|
+
"artifact_list"
|
|
794
795
|
];
|
|
795
796
|
var CANONICAL_MESH_TOOL_COUNT = CANONICAL_MESH_TOOL_NAMES.length;
|
|
796
797
|
var RETIRED_MESH_TOOLS = {
|
|
@@ -1674,7 +1675,8 @@ var WORKER_TOOLS = [
|
|
|
1674
1675
|
"git_diff",
|
|
1675
1676
|
"driver_list",
|
|
1676
1677
|
"driver_describe",
|
|
1677
|
-
"driver_invoke"
|
|
1678
|
+
"driver_invoke",
|
|
1679
|
+
"artifact_register"
|
|
1678
1680
|
];
|
|
1679
1681
|
var WORKER_TOOL_SET = new Set(WORKER_TOOLS);
|
|
1680
1682
|
function isWorkerTool(value) {
|
|
@@ -1850,6 +1852,63 @@ var ASSISTANT_REVIEW_TURN_VERBS = [
|
|
|
1850
1852
|
];
|
|
1851
1853
|
var ASSISTANT_SESSION_ID_ENV = "ADHDEV_ASSISTANT_SESSION_ID";
|
|
1852
1854
|
var ASSISTANT_SESSION_ID_ARG = "assistantSessionId";
|
|
1855
|
+
var ASSISTANT_ACCOUNT_SLOT = "personal";
|
|
1856
|
+
var ASSISTANT_REMOTE_PROJECT_COMMAND = "assistant_remote_project";
|
|
1857
|
+
var ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND = "assistant_remote_project_catalog";
|
|
1858
|
+
var ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND = "assistant_remote_project_access";
|
|
1859
|
+
var ASSISTANT_REMOTE_FOLLOW_COMMAND = "assistant_remote_follow";
|
|
1860
|
+
var ASSISTANT_FOLLOWER_ALLOWED_OPS = ["status", "read", "poll", "report", "send"];
|
|
1861
|
+
var ASSISTANT_FOLLOWER_ALLOWED_OP_SET = new Set(ASSISTANT_FOLLOWER_ALLOWED_OPS);
|
|
1862
|
+
function isAssistantFollowerAllowedOp(value) {
|
|
1863
|
+
return typeof value === "string" && ASSISTANT_FOLLOWER_ALLOWED_OP_SET.has(value);
|
|
1864
|
+
}
|
|
1865
|
+
function followedRemoteProjectKey(hostDaemonId, meshId) {
|
|
1866
|
+
const canonHost = canonicalDaemonId(hostDaemonId) ?? hostDaemonId.trim();
|
|
1867
|
+
return `${canonHost}::${meshId.trim()}`;
|
|
1868
|
+
}
|
|
1869
|
+
function sanitizeRemoteRepoIdentity(raw) {
|
|
1870
|
+
if (typeof raw !== "string") return null;
|
|
1871
|
+
const trimmed = raw.trim();
|
|
1872
|
+
if (!trimmed) return null;
|
|
1873
|
+
if (trimmed.startsWith("/") || trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("~/") || trimmed.startsWith("\\") || /^[a-zA-Z]:[\\/]/.test(trimmed) || /^file:/i.test(trimmed)) {
|
|
1874
|
+
return null;
|
|
1875
|
+
}
|
|
1876
|
+
const withoutQuery = trimmed.replace(/[?#].*$/, "").replace(/\/+$/, "");
|
|
1877
|
+
if (!withoutQuery) return null;
|
|
1878
|
+
let host = "";
|
|
1879
|
+
let repoPath = "";
|
|
1880
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(withoutQuery)) {
|
|
1881
|
+
try {
|
|
1882
|
+
const url = new URL(withoutQuery);
|
|
1883
|
+
if (url.protocol === "file:") return null;
|
|
1884
|
+
host = url.hostname.toLowerCase();
|
|
1885
|
+
repoPath = decodeURIComponent(url.pathname).replace(/^\/+|\/+$/g, "").replace(/\.git$/i, "");
|
|
1886
|
+
} catch {
|
|
1887
|
+
return null;
|
|
1888
|
+
}
|
|
1889
|
+
} else {
|
|
1890
|
+
const scpMatch = withoutQuery.match(/^(?:[^@/:]+@)?(\[[^\]]+\]|[^/:]+):(.+)$/);
|
|
1891
|
+
if (scpMatch) {
|
|
1892
|
+
host = scpMatch[1].replace(/^\[|\]$/g, "").toLowerCase();
|
|
1893
|
+
repoPath = scpMatch[2].replace(/^\/+|\/+$/g, "").replace(/\.git$/i, "");
|
|
1894
|
+
} else {
|
|
1895
|
+
const slash = withoutQuery.indexOf("/");
|
|
1896
|
+
if (slash > 0) {
|
|
1897
|
+
const rawHost = withoutQuery.slice(0, slash);
|
|
1898
|
+
const atIdx = rawHost.lastIndexOf("@");
|
|
1899
|
+
host = (atIdx >= 0 ? rawHost.slice(atIdx + 1) : rawHost).toLowerCase();
|
|
1900
|
+
repoPath = withoutQuery.slice(slash + 1).replace(/^\/+|\/+$/g, "").replace(/\.git$/i, "");
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
if (!host || !repoPath) return null;
|
|
1905
|
+
if (!host.includes(".") && host !== "localhost") return null;
|
|
1906
|
+
if (/[\s@:\\]/.test(host)) return null;
|
|
1907
|
+
const segments = repoPath.split("/").filter(Boolean);
|
|
1908
|
+
if (segments.length === 0) return null;
|
|
1909
|
+
if (segments.some((seg) => seg === "." || seg === ".." || /[\s@:\\]/.test(seg))) return null;
|
|
1910
|
+
return `${host}/${segments.join("/")}`.slice(0, 200);
|
|
1911
|
+
}
|
|
1853
1912
|
|
|
1854
1913
|
// src/turn-evidence.ts
|
|
1855
1914
|
var MESH_TOPIC_PROTOCOL_VERSION = 2;
|
|
@@ -3675,7 +3734,13 @@ function isProviderQuestionBinding(value) {
|
|
|
3675
3734
|
return b.transport === "codex_async" ? b.requestId === void 0 : typeof b.requestId === "string" && !!b.requestId.trim() || typeof b.requestId === "number" && Number.isFinite(b.requestId);
|
|
3676
3735
|
}
|
|
3677
3736
|
export {
|
|
3737
|
+
ASSISTANT_ACCOUNT_SLOT,
|
|
3738
|
+
ASSISTANT_FOLLOWER_ALLOWED_OPS,
|
|
3678
3739
|
ASSISTANT_OWNER_VERBS,
|
|
3740
|
+
ASSISTANT_REMOTE_FOLLOW_COMMAND,
|
|
3741
|
+
ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND,
|
|
3742
|
+
ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND,
|
|
3743
|
+
ASSISTANT_REMOTE_PROJECT_COMMAND,
|
|
3679
3744
|
ASSISTANT_REVIEW_TURN_VERBS,
|
|
3680
3745
|
ASSISTANT_SESSION_ID_ARG,
|
|
3681
3746
|
ASSISTANT_SESSION_ID_ENV,
|
|
@@ -3884,11 +3949,13 @@ export {
|
|
|
3884
3949
|
expandDaemonIdForms,
|
|
3885
3950
|
findOwnershipConflicts,
|
|
3886
3951
|
foldKeyedDoc,
|
|
3952
|
+
followedRemoteProjectKey,
|
|
3887
3953
|
formatQuotaAccount,
|
|
3888
3954
|
hasGitStatusEvidence,
|
|
3889
3955
|
hasWorkerProtocolFooter,
|
|
3890
3956
|
interpolateString,
|
|
3891
3957
|
isActionableProviderApproval,
|
|
3958
|
+
isAssistantFollowerAllowedOp,
|
|
3892
3959
|
isAssistantTool,
|
|
3893
3960
|
isBlockedStatus,
|
|
3894
3961
|
isBusyStatus,
|
|
@@ -4012,6 +4079,7 @@ export {
|
|
|
4012
4079
|
retiredMeshToolError,
|
|
4013
4080
|
sanitizeModelIdentifier,
|
|
4014
4081
|
sanitizeRefusalCode,
|
|
4082
|
+
sanitizeRemoteRepoIdentity,
|
|
4015
4083
|
scoreGitStatusCandidate,
|
|
4016
4084
|
scoreGitUpstreamFreshness,
|
|
4017
4085
|
sessionIdsEquivalent,
|