@longtable/cli 0.1.29 → 0.1.31
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 +7 -0
- package/dist/cli.js +615 -491
- package/dist/project-session.d.ts +20 -0
- package/dist/project-session.js +55 -7
- package/dist/prompt-renderer.d.ts +11 -0
- package/dist/prompt-renderer.js +130 -0
- package/dist/search/index.d.ts +1 -0
- package/dist/search/index.js +1 -0
- package/dist/search/publisher-access.d.ts +23 -0
- package/dist/search/publisher-access.js +577 -0
- package/dist/search/rank.js +30 -2
- package/dist/search/run.js +9 -1
- package/dist/search/sources.js +29 -2
- package/dist/search/types.d.ts +64 -0
- package/dist/search/types.js +6 -0
- package/package.json +8 -7
package/dist/search/sources.js
CHANGED
|
@@ -62,6 +62,30 @@ function inferEvidenceDepth(abstract, legalFullTextAvailable = false) {
|
|
|
62
62
|
return "abstract_only";
|
|
63
63
|
return "metadata_only";
|
|
64
64
|
}
|
|
65
|
+
function inferAccessStatus(abstract, legalFullTextAvailable = false) {
|
|
66
|
+
if (legalFullTextAvailable)
|
|
67
|
+
return "legal_full_text_available";
|
|
68
|
+
if (abstract)
|
|
69
|
+
return "abstract_available";
|
|
70
|
+
return "metadata_only";
|
|
71
|
+
}
|
|
72
|
+
function inferVerificationDepth(abstract) {
|
|
73
|
+
if (abstract)
|
|
74
|
+
return "abstract";
|
|
75
|
+
return "metadata";
|
|
76
|
+
}
|
|
77
|
+
function verificationNote(abstract, legalFullTextAvailable = false) {
|
|
78
|
+
if (legalFullTextAvailable && abstract) {
|
|
79
|
+
return "Legal full text URL was found, but this card is abstract-based and not full-paper verified.";
|
|
80
|
+
}
|
|
81
|
+
if (legalFullTextAvailable) {
|
|
82
|
+
return "Legal full text URL was found, but LongTable did not retrieve or verify the full text.";
|
|
83
|
+
}
|
|
84
|
+
if (abstract) {
|
|
85
|
+
return "Abstract is available; citation support is abstract-based, not full-paper verified.";
|
|
86
|
+
}
|
|
87
|
+
return "Metadata exists; citation support has not been verified against abstract or full text.";
|
|
88
|
+
}
|
|
65
89
|
function inferResearchDesign(abstract) {
|
|
66
90
|
const normalized = abstract?.toLowerCase() ?? "";
|
|
67
91
|
if (!normalized)
|
|
@@ -111,6 +135,9 @@ function baseCard(input) {
|
|
|
111
135
|
abstract,
|
|
112
136
|
abstractAvailable: Boolean(abstract),
|
|
113
137
|
evidenceDepth: inferEvidenceDepth(abstract, legalFullTextAvailable),
|
|
138
|
+
accessStatus: inferAccessStatus(abstract, legalFullTextAvailable),
|
|
139
|
+
verificationDepth: inferVerificationDepth(abstract),
|
|
140
|
+
verificationNote: verificationNote(abstract, legalFullTextAvailable),
|
|
114
141
|
legalFullTextAvailable,
|
|
115
142
|
fullTextUrl: input.fullTextUrl,
|
|
116
143
|
citationCount: input.citationCount,
|
|
@@ -128,7 +155,7 @@ async function fetchJson(context, url) {
|
|
|
128
155
|
const response = await context.fetch(url, {
|
|
129
156
|
headers: {
|
|
130
157
|
"accept": "application/json",
|
|
131
|
-
"user-agent": "LongTable/0.1.
|
|
158
|
+
"user-agent": "LongTable/0.1.31 (https://github.com/HosungYou/LongTable)"
|
|
132
159
|
}
|
|
133
160
|
});
|
|
134
161
|
if (!response.ok) {
|
|
@@ -140,7 +167,7 @@ async function fetchText(context, url) {
|
|
|
140
167
|
const response = await context.fetch(url, {
|
|
141
168
|
headers: {
|
|
142
169
|
"accept": "application/xml, text/xml, application/atom+xml, text/plain",
|
|
143
|
-
"user-agent": "LongTable/0.1.
|
|
170
|
+
"user-agent": "LongTable/0.1.31 (https://github.com/HosungYou/LongTable)"
|
|
144
171
|
}
|
|
145
172
|
});
|
|
146
173
|
if (!response.ok) {
|
package/dist/search/types.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
export declare const SEARCH_SOURCES: readonly ["crossref", "arxiv", "openalex", "semantic_scholar", "pubmed", "eric", "doaj", "unpaywall"];
|
|
2
2
|
export type SearchSource = typeof SEARCH_SOURCES[number];
|
|
3
|
+
export declare const PUBLISHERS: readonly ["elsevier", "springer_nature", "wiley", "taylor_francis"];
|
|
4
|
+
export type Publisher = typeof PUBLISHERS[number];
|
|
5
|
+
export type PublisherProbeTarget = Publisher | "auto";
|
|
3
6
|
export type ResearchSearchIntentKind = "literature" | "theory" | "measurement" | "citation" | "metadata" | "venue";
|
|
4
7
|
export type EvidenceDepth = "metadata_only" | "abstract_only" | "legal_full_text_available" | "legal_full_text_unavailable" | "secondary_summary_only";
|
|
8
|
+
export type AccessStatus = "metadata_only" | "abstract_available" | "legal_full_text_available" | "licensed_full_text_available" | "licensed_full_text_checked" | "access_denied" | "license_unknown";
|
|
9
|
+
export type VerificationDepth = "metadata" | "abstract" | "legal_full_text" | "licensed_snippet" | "secondary";
|
|
10
|
+
export type EntitlementSource = "crossref_tdm" | "publisher_api" | "institutional_token" | "user_api_key" | "none";
|
|
11
|
+
export type CollectionDepth = "metadata" | "abstract" | "licensed_snippet" | "licensed_full_text_local_only";
|
|
12
|
+
export type CredentialStatus = "missing" | "present" | "valid" | "invalid";
|
|
13
|
+
export type EntitlementStatus = "unknown" | "no_access" | "metadata_only" | "abstract_available" | "licensed_full_text_available";
|
|
14
|
+
export type TdmStatus = "unknown" | "not_configured" | "permitted" | "denied" | "requires_license_review";
|
|
5
15
|
export type CitationSupportStatus = "direct_support" | "indirect_support" | "background" | "questionable_fit" | "not_verified";
|
|
6
16
|
export type SourceRunStatus = "completed" | "skipped" | "failed";
|
|
7
17
|
export type EvidenceRunStatus = "completed" | "partial" | "blocked";
|
|
@@ -39,8 +49,16 @@ export interface EvidenceCard {
|
|
|
39
49
|
abstract?: string;
|
|
40
50
|
abstractAvailable: boolean;
|
|
41
51
|
evidenceDepth: EvidenceDepth;
|
|
52
|
+
accessStatus: AccessStatus;
|
|
53
|
+
verificationDepth: VerificationDepth;
|
|
54
|
+
verificationNote: string;
|
|
42
55
|
legalFullTextAvailable: boolean;
|
|
43
56
|
fullTextUrl?: string;
|
|
57
|
+
publisher?: Publisher | "other";
|
|
58
|
+
entitlementSource?: EntitlementSource;
|
|
59
|
+
collectionDepth?: CollectionDepth;
|
|
60
|
+
licenseNote?: string;
|
|
61
|
+
publisherAccess?: PublisherAccessRecord;
|
|
44
62
|
citationCount?: number;
|
|
45
63
|
researchDesign?: string;
|
|
46
64
|
constructsOrMeasures?: string[];
|
|
@@ -120,4 +138,50 @@ export interface RunResearchSearchInput extends BuildSearchIntentInput {
|
|
|
120
138
|
env?: Record<string, string | undefined>;
|
|
121
139
|
fetch?: SearchFetch;
|
|
122
140
|
allowPartial?: boolean;
|
|
141
|
+
publisherAccess?: boolean;
|
|
142
|
+
}
|
|
143
|
+
export interface CrossrefTdmLink {
|
|
144
|
+
url: string;
|
|
145
|
+
contentType?: string;
|
|
146
|
+
contentVersion?: string;
|
|
147
|
+
intendedApplication?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface CrossrefTdmDiscovery {
|
|
150
|
+
doi: string;
|
|
151
|
+
publisher?: string;
|
|
152
|
+
inferredPublisher?: Publisher | "other";
|
|
153
|
+
title?: string;
|
|
154
|
+
sourceUrl?: string;
|
|
155
|
+
licenseUrls: string[];
|
|
156
|
+
links: CrossrefTdmLink[];
|
|
157
|
+
}
|
|
158
|
+
export interface PublisherAccessRecord {
|
|
159
|
+
publisher: Publisher | "other";
|
|
160
|
+
checkedAt: string;
|
|
161
|
+
credentialStatus: CredentialStatus;
|
|
162
|
+
entitlementStatus: EntitlementStatus;
|
|
163
|
+
tdmStatus: TdmStatus;
|
|
164
|
+
collectionDepth: CollectionDepth;
|
|
165
|
+
requiredEnv: string[];
|
|
166
|
+
presentEnv: string[];
|
|
167
|
+
missingEnv: string[];
|
|
168
|
+
testedDoi?: string;
|
|
169
|
+
endpoint?: string;
|
|
170
|
+
setupHint: string;
|
|
171
|
+
licenseNote?: string;
|
|
172
|
+
verificationNote: string;
|
|
173
|
+
evidenceSnippet?: string;
|
|
174
|
+
crossref?: CrossrefTdmDiscovery;
|
|
175
|
+
}
|
|
176
|
+
export interface SearchCapabilitySnapshot {
|
|
177
|
+
version: 1;
|
|
178
|
+
updatedAt: string;
|
|
179
|
+
contactEmailPresent: boolean;
|
|
180
|
+
records: PublisherAccessRecord[];
|
|
181
|
+
}
|
|
182
|
+
export interface PublisherProbeInput {
|
|
183
|
+
doi: string;
|
|
184
|
+
publisher?: PublisherProbeTarget;
|
|
185
|
+
env?: Record<string, string | undefined>;
|
|
186
|
+
fetch?: SearchFetch;
|
|
123
187
|
}
|
package/dist/search/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longtable/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Researcher-facing LongTable CLI",
|
|
6
6
|
"type": "module",
|
|
@@ -28,12 +28,13 @@
|
|
|
28
28
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@longtable/
|
|
33
|
-
"@longtable/
|
|
34
|
-
"@longtable/
|
|
35
|
-
"@longtable/provider-
|
|
36
|
-
"@longtable/
|
|
31
|
+
"@clack/prompts": "^1.2.0",
|
|
32
|
+
"@longtable/checkpoints": "0.1.31",
|
|
33
|
+
"@longtable/core": "0.1.31",
|
|
34
|
+
"@longtable/memory": "0.1.31",
|
|
35
|
+
"@longtable/provider-claude": "0.1.31",
|
|
36
|
+
"@longtable/provider-codex": "0.1.31",
|
|
37
|
+
"@longtable/setup": "0.1.31"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@types/node": "^22.10.1",
|