shiva-code 0.3.0 → 0.4.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.
- package/dist/{github-R3I7U2DQ.js → api-MT23KCO3.js} +3 -2
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/{chunk-G2G6UUWM.js → chunk-6RAACMKF.js} +1 -1
- package/dist/chunk-PMA6MGQW.js +604 -0
- package/dist/{chunk-MDMZWOX7.js → chunk-TI6Y3VT4.js} +2 -2
- package/dist/{chunk-GHAT2D55.js → chunk-TQ6O4QB6.js} +2 -2
- package/dist/{chunk-66D4NGIK.js → chunk-ZDLLPNCK.js} +2 -2
- package/dist/config-D6M6LI6U.js +83 -0
- package/dist/index.js +12565 -4196
- package/dist/{session-manager-THTEDIUG.js → manager-TQIASXKY.js} +3 -2
- package/dist/{package-manager-OOJUNEKG.js → package-manager-NARG55B5.js} +4 -3
- package/package.json +2 -1
- package/dist/chunk-4GL27U2Z.js +0 -174
- package/dist/chunk-KXYP4OCK.js +0 -236
- package/dist/project-config-GELL5QUH.js +0 -40
- package/dist/tags-P6L3BWO7.js +0 -28
|
@@ -19,8 +19,9 @@ import {
|
|
|
19
19
|
isSessionCorrupted,
|
|
20
20
|
parseSessionFile,
|
|
21
21
|
saveRecoveredContext
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-TI6Y3VT4.js";
|
|
23
|
+
import "./chunk-6RAACMKF.js";
|
|
24
|
+
import "./chunk-3RG5ZIWI.js";
|
|
24
25
|
export {
|
|
25
26
|
decodeProjectPath,
|
|
26
27
|
encodeProjectPath,
|
|
@@ -9,9 +9,10 @@ import {
|
|
|
9
9
|
getPackageStats,
|
|
10
10
|
removeProjectFromPackage,
|
|
11
11
|
updatePackage
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-TQ6O4QB6.js";
|
|
13
|
+
import "./chunk-TI6Y3VT4.js";
|
|
14
|
+
import "./chunk-6RAACMKF.js";
|
|
15
|
+
import "./chunk-3RG5ZIWI.js";
|
|
15
16
|
export {
|
|
16
17
|
addProjectToPackage,
|
|
17
18
|
createPackage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shiva-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Makes Claude Code Persistent - Cross-Project Memory CLI",
|
|
5
5
|
"author": "SHIVA AI",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"commander": "^12.1.0",
|
|
27
27
|
"conf": "^13.0.1",
|
|
28
28
|
"inquirer": "^12.3.0",
|
|
29
|
+
"minimatch": "^10.0.1",
|
|
29
30
|
"open": "^10.1.0",
|
|
30
31
|
"ora": "^8.1.1"
|
|
31
32
|
},
|
package/dist/chunk-4GL27U2Z.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
// src/services/tags.ts
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
import * as os from "os";
|
|
5
|
-
function getTagsPath() {
|
|
6
|
-
return path.join(os.homedir(), ".shiva", "tags.json");
|
|
7
|
-
}
|
|
8
|
-
function loadTagsData() {
|
|
9
|
-
const filepath = getTagsPath();
|
|
10
|
-
if (!fs.existsSync(filepath)) {
|
|
11
|
-
return { sessions: {}, tagMeta: {} };
|
|
12
|
-
}
|
|
13
|
-
try {
|
|
14
|
-
const content = fs.readFileSync(filepath, "utf-8");
|
|
15
|
-
return JSON.parse(content);
|
|
16
|
-
} catch {
|
|
17
|
-
return { sessions: {}, tagMeta: {} };
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function saveTagsData(data) {
|
|
21
|
-
const filepath = getTagsPath();
|
|
22
|
-
const dir = path.dirname(filepath);
|
|
23
|
-
if (!fs.existsSync(dir)) {
|
|
24
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
25
|
-
}
|
|
26
|
-
fs.writeFileSync(filepath, JSON.stringify(data, null, 2));
|
|
27
|
-
}
|
|
28
|
-
function addTagToSession(sessionId, tag) {
|
|
29
|
-
const data = loadTagsData();
|
|
30
|
-
const normalizedTag = tag.toLowerCase().trim();
|
|
31
|
-
if (!data.sessions[sessionId]) {
|
|
32
|
-
data.sessions[sessionId] = [];
|
|
33
|
-
}
|
|
34
|
-
if (!data.sessions[sessionId].includes(normalizedTag)) {
|
|
35
|
-
data.sessions[sessionId].push(normalizedTag);
|
|
36
|
-
}
|
|
37
|
-
if (!data.tagMeta[normalizedTag]) {
|
|
38
|
-
data.tagMeta[normalizedTag] = {
|
|
39
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
saveTagsData(data);
|
|
43
|
-
}
|
|
44
|
-
function removeTagFromSession(sessionId, tag) {
|
|
45
|
-
const data = loadTagsData();
|
|
46
|
-
const normalizedTag = tag.toLowerCase().trim();
|
|
47
|
-
if (!data.sessions[sessionId]) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
const index = data.sessions[sessionId].indexOf(normalizedTag);
|
|
51
|
-
if (index === -1) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
data.sessions[sessionId].splice(index, 1);
|
|
55
|
-
if (data.sessions[sessionId].length === 0) {
|
|
56
|
-
delete data.sessions[sessionId];
|
|
57
|
-
}
|
|
58
|
-
saveTagsData(data);
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
function getSessionTags(sessionId) {
|
|
62
|
-
const data = loadTagsData();
|
|
63
|
-
return data.sessions[sessionId] || [];
|
|
64
|
-
}
|
|
65
|
-
function getSessionsByTag(tag) {
|
|
66
|
-
const data = loadTagsData();
|
|
67
|
-
const normalizedTag = tag.toLowerCase().trim();
|
|
68
|
-
return Object.entries(data.sessions).filter(([, tags]) => tags.includes(normalizedTag)).map(([sessionId]) => sessionId);
|
|
69
|
-
}
|
|
70
|
-
function getAllTags() {
|
|
71
|
-
const data = loadTagsData();
|
|
72
|
-
const allTags = /* @__PURE__ */ new Set();
|
|
73
|
-
for (const tags of Object.values(data.sessions)) {
|
|
74
|
-
for (const tag of tags) {
|
|
75
|
-
allTags.add(tag);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return Array.from(allTags).sort();
|
|
79
|
-
}
|
|
80
|
-
function getTagCounts() {
|
|
81
|
-
const data = loadTagsData();
|
|
82
|
-
const counts = {};
|
|
83
|
-
for (const tags of Object.values(data.sessions)) {
|
|
84
|
-
for (const tag of tags) {
|
|
85
|
-
counts[tag] = (counts[tag] || 0) + 1;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return counts;
|
|
89
|
-
}
|
|
90
|
-
function setTagMeta(tag, meta) {
|
|
91
|
-
const data = loadTagsData();
|
|
92
|
-
const normalizedTag = tag.toLowerCase().trim();
|
|
93
|
-
if (!data.tagMeta[normalizedTag]) {
|
|
94
|
-
data.tagMeta[normalizedTag] = {
|
|
95
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
if (meta.color !== void 0) {
|
|
99
|
-
data.tagMeta[normalizedTag].color = meta.color;
|
|
100
|
-
}
|
|
101
|
-
if (meta.description !== void 0) {
|
|
102
|
-
data.tagMeta[normalizedTag].description = meta.description;
|
|
103
|
-
}
|
|
104
|
-
saveTagsData(data);
|
|
105
|
-
}
|
|
106
|
-
function getTagMeta(tag) {
|
|
107
|
-
const data = loadTagsData();
|
|
108
|
-
return data.tagMeta[tag.toLowerCase().trim()] || null;
|
|
109
|
-
}
|
|
110
|
-
function deleteTag(tag) {
|
|
111
|
-
const data = loadTagsData();
|
|
112
|
-
const normalizedTag = tag.toLowerCase().trim();
|
|
113
|
-
let removedCount = 0;
|
|
114
|
-
for (const sessionId of Object.keys(data.sessions)) {
|
|
115
|
-
const index = data.sessions[sessionId].indexOf(normalizedTag);
|
|
116
|
-
if (index !== -1) {
|
|
117
|
-
data.sessions[sessionId].splice(index, 1);
|
|
118
|
-
removedCount++;
|
|
119
|
-
if (data.sessions[sessionId].length === 0) {
|
|
120
|
-
delete data.sessions[sessionId];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
delete data.tagMeta[normalizedTag];
|
|
125
|
-
saveTagsData(data);
|
|
126
|
-
return removedCount;
|
|
127
|
-
}
|
|
128
|
-
function renameTag(oldTag, newTag) {
|
|
129
|
-
const data = loadTagsData();
|
|
130
|
-
const normalizedOld = oldTag.toLowerCase().trim();
|
|
131
|
-
const normalizedNew = newTag.toLowerCase().trim();
|
|
132
|
-
if (normalizedOld === normalizedNew) {
|
|
133
|
-
return 0;
|
|
134
|
-
}
|
|
135
|
-
let renamedCount = 0;
|
|
136
|
-
for (const sessionId of Object.keys(data.sessions)) {
|
|
137
|
-
const index = data.sessions[sessionId].indexOf(normalizedOld);
|
|
138
|
-
if (index !== -1) {
|
|
139
|
-
data.sessions[sessionId][index] = normalizedNew;
|
|
140
|
-
renamedCount++;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (data.tagMeta[normalizedOld]) {
|
|
144
|
-
data.tagMeta[normalizedNew] = data.tagMeta[normalizedOld];
|
|
145
|
-
delete data.tagMeta[normalizedOld];
|
|
146
|
-
}
|
|
147
|
-
saveTagsData(data);
|
|
148
|
-
return renamedCount;
|
|
149
|
-
}
|
|
150
|
-
function sessionHasAnyTag(sessionId, tags) {
|
|
151
|
-
const sessionTags = getSessionTags(sessionId);
|
|
152
|
-
const normalizedTags = tags.map((t) => t.toLowerCase().trim());
|
|
153
|
-
return sessionTags.some((t) => normalizedTags.includes(t));
|
|
154
|
-
}
|
|
155
|
-
function sessionHasAllTags(sessionId, tags) {
|
|
156
|
-
const sessionTags = getSessionTags(sessionId);
|
|
157
|
-
const normalizedTags = tags.map((t) => t.toLowerCase().trim());
|
|
158
|
-
return normalizedTags.every((t) => sessionTags.includes(t));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export {
|
|
162
|
-
addTagToSession,
|
|
163
|
-
removeTagFromSession,
|
|
164
|
-
getSessionTags,
|
|
165
|
-
getSessionsByTag,
|
|
166
|
-
getAllTags,
|
|
167
|
-
getTagCounts,
|
|
168
|
-
setTagMeta,
|
|
169
|
-
getTagMeta,
|
|
170
|
-
deleteTag,
|
|
171
|
-
renameTag,
|
|
172
|
-
sessionHasAnyTag,
|
|
173
|
-
sessionHasAllTags
|
|
174
|
-
};
|
package/dist/chunk-KXYP4OCK.js
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
// src/services/project-config.ts
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
var SHIVA_DIR = ".shiva";
|
|
5
|
-
var CONFIG_FILE = "config.json";
|
|
6
|
-
var SESSIONS_DIR = "sessions";
|
|
7
|
-
var CONTEXT_DIR = "context";
|
|
8
|
-
var GITHUB_CONTEXT_FILE = "github.md";
|
|
9
|
-
var DEFAULT_CONFIG = {
|
|
10
|
-
version: 1,
|
|
11
|
-
autoInjectContext: true,
|
|
12
|
-
branchSessions: {}
|
|
13
|
-
};
|
|
14
|
-
function getShivaDir(projectPath) {
|
|
15
|
-
return path.join(projectPath, SHIVA_DIR);
|
|
16
|
-
}
|
|
17
|
-
function getConfigPath(projectPath) {
|
|
18
|
-
return path.join(getShivaDir(projectPath), CONFIG_FILE);
|
|
19
|
-
}
|
|
20
|
-
function getSessionsDir(projectPath) {
|
|
21
|
-
return path.join(getShivaDir(projectPath), SESSIONS_DIR);
|
|
22
|
-
}
|
|
23
|
-
function getContextDir(projectPath) {
|
|
24
|
-
return path.join(getShivaDir(projectPath), CONTEXT_DIR);
|
|
25
|
-
}
|
|
26
|
-
function hasShivaDir(projectPath) {
|
|
27
|
-
return fs.existsSync(getShivaDir(projectPath));
|
|
28
|
-
}
|
|
29
|
-
function initShivaDir(projectPath) {
|
|
30
|
-
const shivaDir = getShivaDir(projectPath);
|
|
31
|
-
const sessionsDir = getSessionsDir(projectPath);
|
|
32
|
-
const contextDir = getContextDir(projectPath);
|
|
33
|
-
if (!fs.existsSync(shivaDir)) {
|
|
34
|
-
fs.mkdirSync(shivaDir, { recursive: true });
|
|
35
|
-
}
|
|
36
|
-
if (!fs.existsSync(sessionsDir)) {
|
|
37
|
-
fs.mkdirSync(sessionsDir, { recursive: true });
|
|
38
|
-
}
|
|
39
|
-
if (!fs.existsSync(contextDir)) {
|
|
40
|
-
fs.mkdirSync(contextDir, { recursive: true });
|
|
41
|
-
}
|
|
42
|
-
const configPath = getConfigPath(projectPath);
|
|
43
|
-
if (!fs.existsSync(configPath)) {
|
|
44
|
-
fs.writeFileSync(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2), "utf-8");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function addToGitignore(projectPath) {
|
|
48
|
-
const gitignorePath = path.join(projectPath, ".gitignore");
|
|
49
|
-
let content = "";
|
|
50
|
-
if (fs.existsSync(gitignorePath)) {
|
|
51
|
-
content = fs.readFileSync(gitignorePath, "utf-8");
|
|
52
|
-
if (content.includes(".shiva") || content.includes("/.shiva")) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const newEntry = "\n# SHIVA Code local config\n.shiva/\n";
|
|
57
|
-
fs.writeFileSync(gitignorePath, content + newEntry, "utf-8");
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
function removeFromGitignore(projectPath) {
|
|
61
|
-
const gitignorePath = path.join(projectPath, ".gitignore");
|
|
62
|
-
if (!fs.existsSync(gitignorePath)) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
let content = fs.readFileSync(gitignorePath, "utf-8");
|
|
66
|
-
const lines = content.split("\n");
|
|
67
|
-
const filtered = lines.filter((line) => {
|
|
68
|
-
const trimmed = line.trim();
|
|
69
|
-
return trimmed !== ".shiva/" && trimmed !== ".shiva" && trimmed !== "/.shiva/";
|
|
70
|
-
});
|
|
71
|
-
const finalLines = filtered.filter((line, i, arr) => {
|
|
72
|
-
return !(line.includes("# SHIVA Code") && arr[i + 1]?.trim() === "");
|
|
73
|
-
});
|
|
74
|
-
const newContent = finalLines.join("\n");
|
|
75
|
-
if (newContent !== content) {
|
|
76
|
-
fs.writeFileSync(gitignorePath, newContent, "utf-8");
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
function getProjectConfig(projectPath) {
|
|
82
|
-
const configPath = getConfigPath(projectPath);
|
|
83
|
-
if (!fs.existsSync(configPath)) {
|
|
84
|
-
return { ...DEFAULT_CONFIG };
|
|
85
|
-
}
|
|
86
|
-
try {
|
|
87
|
-
const content = fs.readFileSync(configPath, "utf-8");
|
|
88
|
-
const config = JSON.parse(content);
|
|
89
|
-
return { ...DEFAULT_CONFIG, ...config };
|
|
90
|
-
} catch {
|
|
91
|
-
return { ...DEFAULT_CONFIG };
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function saveProjectConfig(projectPath, config) {
|
|
95
|
-
initShivaDir(projectPath);
|
|
96
|
-
const configPath = getConfigPath(projectPath);
|
|
97
|
-
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
98
|
-
}
|
|
99
|
-
function updateProjectConfig(projectPath, updates) {
|
|
100
|
-
const current = getProjectConfig(projectPath);
|
|
101
|
-
const updated = { ...current, ...updates };
|
|
102
|
-
saveProjectConfig(projectPath, updated);
|
|
103
|
-
return updated;
|
|
104
|
-
}
|
|
105
|
-
function sanitizeBranchName(branch) {
|
|
106
|
-
return branch.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
107
|
-
}
|
|
108
|
-
function mapBranchToSession(projectPath, branch, sessionId, metadata) {
|
|
109
|
-
initShivaDir(projectPath);
|
|
110
|
-
const config = getProjectConfig(projectPath);
|
|
111
|
-
config.branchSessions[branch] = {
|
|
112
|
-
branch,
|
|
113
|
-
sessionId,
|
|
114
|
-
lastAccessed: (/* @__PURE__ */ new Date()).toISOString(),
|
|
115
|
-
...metadata
|
|
116
|
-
};
|
|
117
|
-
saveProjectConfig(projectPath, config);
|
|
118
|
-
const sessionsDir = getSessionsDir(projectPath);
|
|
119
|
-
const sessionFile = path.join(sessionsDir, `${sanitizeBranchName(branch)}.json`);
|
|
120
|
-
fs.writeFileSync(
|
|
121
|
-
sessionFile,
|
|
122
|
-
JSON.stringify(config.branchSessions[branch], null, 2),
|
|
123
|
-
"utf-8"
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
function getSessionForBranch(projectPath, branch) {
|
|
127
|
-
const config = getProjectConfig(projectPath);
|
|
128
|
-
if (config.branchSessions[branch]) {
|
|
129
|
-
return config.branchSessions[branch];
|
|
130
|
-
}
|
|
131
|
-
const sessionsDir = getSessionsDir(projectPath);
|
|
132
|
-
const sessionFile = path.join(sessionsDir, `${sanitizeBranchName(branch)}.json`);
|
|
133
|
-
if (fs.existsSync(sessionFile)) {
|
|
134
|
-
try {
|
|
135
|
-
const content = fs.readFileSync(sessionFile, "utf-8");
|
|
136
|
-
return JSON.parse(content);
|
|
137
|
-
} catch {
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
function getAllBranchSessions(projectPath) {
|
|
144
|
-
const config = getProjectConfig(projectPath);
|
|
145
|
-
return config.branchSessions || {};
|
|
146
|
-
}
|
|
147
|
-
function updateBranchSession(projectPath, branch, updates) {
|
|
148
|
-
const existing = getSessionForBranch(projectPath, branch);
|
|
149
|
-
if (!existing) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
mapBranchToSession(projectPath, branch, existing.sessionId, {
|
|
153
|
-
...existing,
|
|
154
|
-
...updates,
|
|
155
|
-
lastAccessed: (/* @__PURE__ */ new Date()).toISOString()
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
function removeBranchSession(projectPath, branch) {
|
|
159
|
-
const config = getProjectConfig(projectPath);
|
|
160
|
-
if (config.branchSessions[branch]) {
|
|
161
|
-
delete config.branchSessions[branch];
|
|
162
|
-
saveProjectConfig(projectPath, config);
|
|
163
|
-
}
|
|
164
|
-
const sessionsDir = getSessionsDir(projectPath);
|
|
165
|
-
const sessionFile = path.join(sessionsDir, `${sanitizeBranchName(branch)}.json`);
|
|
166
|
-
if (fs.existsSync(sessionFile)) {
|
|
167
|
-
fs.unlinkSync(sessionFile);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
function cacheGitHubContext(projectPath, context) {
|
|
171
|
-
initShivaDir(projectPath);
|
|
172
|
-
const contextDir = getContextDir(projectPath);
|
|
173
|
-
const contextFile = path.join(contextDir, GITHUB_CONTEXT_FILE);
|
|
174
|
-
fs.writeFileSync(contextFile, context, "utf-8");
|
|
175
|
-
return contextFile;
|
|
176
|
-
}
|
|
177
|
-
function getCachedGitHubContext(projectPath) {
|
|
178
|
-
const contextDir = getContextDir(projectPath);
|
|
179
|
-
const contextFile = path.join(contextDir, GITHUB_CONTEXT_FILE);
|
|
180
|
-
if (!fs.existsSync(contextFile)) {
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
try {
|
|
184
|
-
return fs.readFileSync(contextFile, "utf-8");
|
|
185
|
-
} catch {
|
|
186
|
-
return null;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function getContextCacheAge(projectPath) {
|
|
190
|
-
const contextDir = getContextDir(projectPath);
|
|
191
|
-
const contextFile = path.join(contextDir, GITHUB_CONTEXT_FILE);
|
|
192
|
-
if (!fs.existsSync(contextFile)) {
|
|
193
|
-
return Infinity;
|
|
194
|
-
}
|
|
195
|
-
try {
|
|
196
|
-
const stats = fs.statSync(contextFile);
|
|
197
|
-
const ageMs = Date.now() - stats.mtimeMs;
|
|
198
|
-
return Math.floor(ageMs / (1e3 * 60));
|
|
199
|
-
} catch {
|
|
200
|
-
return Infinity;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
function clearContextCache(projectPath) {
|
|
204
|
-
const contextDir = getContextDir(projectPath);
|
|
205
|
-
const contextFile = path.join(contextDir, GITHUB_CONTEXT_FILE);
|
|
206
|
-
if (fs.existsSync(contextFile)) {
|
|
207
|
-
fs.unlinkSync(contextFile);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
function removeShivaDir(projectPath) {
|
|
211
|
-
const shivaDir = getShivaDir(projectPath);
|
|
212
|
-
if (fs.existsSync(shivaDir)) {
|
|
213
|
-
fs.rmSync(shivaDir, { recursive: true, force: true });
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export {
|
|
218
|
-
getShivaDir,
|
|
219
|
-
hasShivaDir,
|
|
220
|
-
initShivaDir,
|
|
221
|
-
addToGitignore,
|
|
222
|
-
removeFromGitignore,
|
|
223
|
-
getProjectConfig,
|
|
224
|
-
saveProjectConfig,
|
|
225
|
-
updateProjectConfig,
|
|
226
|
-
mapBranchToSession,
|
|
227
|
-
getSessionForBranch,
|
|
228
|
-
getAllBranchSessions,
|
|
229
|
-
updateBranchSession,
|
|
230
|
-
removeBranchSession,
|
|
231
|
-
cacheGitHubContext,
|
|
232
|
-
getCachedGitHubContext,
|
|
233
|
-
getContextCacheAge,
|
|
234
|
-
clearContextCache,
|
|
235
|
-
removeShivaDir
|
|
236
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addToGitignore,
|
|
3
|
-
cacheGitHubContext,
|
|
4
|
-
clearContextCache,
|
|
5
|
-
getAllBranchSessions,
|
|
6
|
-
getCachedGitHubContext,
|
|
7
|
-
getContextCacheAge,
|
|
8
|
-
getProjectConfig,
|
|
9
|
-
getSessionForBranch,
|
|
10
|
-
getShivaDir,
|
|
11
|
-
hasShivaDir,
|
|
12
|
-
initShivaDir,
|
|
13
|
-
mapBranchToSession,
|
|
14
|
-
removeBranchSession,
|
|
15
|
-
removeFromGitignore,
|
|
16
|
-
removeShivaDir,
|
|
17
|
-
saveProjectConfig,
|
|
18
|
-
updateBranchSession,
|
|
19
|
-
updateProjectConfig
|
|
20
|
-
} from "./chunk-KXYP4OCK.js";
|
|
21
|
-
export {
|
|
22
|
-
addToGitignore,
|
|
23
|
-
cacheGitHubContext,
|
|
24
|
-
clearContextCache,
|
|
25
|
-
getAllBranchSessions,
|
|
26
|
-
getCachedGitHubContext,
|
|
27
|
-
getContextCacheAge,
|
|
28
|
-
getProjectConfig,
|
|
29
|
-
getSessionForBranch,
|
|
30
|
-
getShivaDir,
|
|
31
|
-
hasShivaDir,
|
|
32
|
-
initShivaDir,
|
|
33
|
-
mapBranchToSession,
|
|
34
|
-
removeBranchSession,
|
|
35
|
-
removeFromGitignore,
|
|
36
|
-
removeShivaDir,
|
|
37
|
-
saveProjectConfig,
|
|
38
|
-
updateBranchSession,
|
|
39
|
-
updateProjectConfig
|
|
40
|
-
};
|
package/dist/tags-P6L3BWO7.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addTagToSession,
|
|
3
|
-
deleteTag,
|
|
4
|
-
getAllTags,
|
|
5
|
-
getSessionTags,
|
|
6
|
-
getSessionsByTag,
|
|
7
|
-
getTagCounts,
|
|
8
|
-
getTagMeta,
|
|
9
|
-
removeTagFromSession,
|
|
10
|
-
renameTag,
|
|
11
|
-
sessionHasAllTags,
|
|
12
|
-
sessionHasAnyTag,
|
|
13
|
-
setTagMeta
|
|
14
|
-
} from "./chunk-4GL27U2Z.js";
|
|
15
|
-
export {
|
|
16
|
-
addTagToSession,
|
|
17
|
-
deleteTag,
|
|
18
|
-
getAllTags,
|
|
19
|
-
getSessionTags,
|
|
20
|
-
getSessionsByTag,
|
|
21
|
-
getTagCounts,
|
|
22
|
-
getTagMeta,
|
|
23
|
-
removeTagFromSession,
|
|
24
|
-
renameTag,
|
|
25
|
-
sessionHasAllTags,
|
|
26
|
-
sessionHasAnyTag,
|
|
27
|
-
setTagMeta
|
|
28
|
-
};
|