@jackwener/opencli 1.7.4 → 1.7.6
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 +76 -51
- package/README.zh-CN.md +78 -62
- package/cli-manifest.json +4558 -2979
- package/clis/antigravity/serve.js +71 -25
- package/clis/baidu-scholar/search.js +87 -0
- package/clis/baidu-scholar/search.test.js +23 -0
- package/clis/bilibili/video.js +61 -0
- package/clis/bilibili/video.test.js +81 -0
- package/clis/deepseek/ask.js +94 -0
- package/clis/deepseek/ask.test.js +73 -0
- package/clis/deepseek/history.js +25 -0
- package/clis/deepseek/new.js +20 -0
- package/clis/deepseek/read.js +22 -0
- package/clis/deepseek/status.js +24 -0
- package/clis/deepseek/utils.js +291 -0
- package/clis/deepseek/utils.test.js +37 -0
- package/clis/eastmoney/_secid.js +78 -0
- package/clis/eastmoney/announcement.js +52 -0
- package/clis/eastmoney/convertible.js +73 -0
- package/clis/eastmoney/etf.js +65 -0
- package/clis/eastmoney/holders.js +78 -0
- package/clis/eastmoney/index-board.js +96 -0
- package/clis/eastmoney/kline.js +87 -0
- package/clis/eastmoney/kuaixun.js +54 -0
- package/clis/eastmoney/longhu.js +67 -0
- package/clis/eastmoney/money-flow.js +78 -0
- package/clis/eastmoney/northbound.js +57 -0
- package/clis/eastmoney/quote.js +107 -0
- package/clis/eastmoney/rank.js +94 -0
- package/clis/eastmoney/sectors.js +76 -0
- package/clis/google-scholar/search.js +58 -0
- package/clis/google-scholar/search.test.js +23 -0
- package/clis/gov-law/commands.test.js +39 -0
- package/clis/gov-law/recent.js +22 -0
- package/clis/gov-law/search.js +41 -0
- package/clis/gov-law/shared.js +51 -0
- package/clis/gov-policy/commands.test.js +27 -0
- package/clis/gov-policy/recent.js +47 -0
- package/clis/gov-policy/search.js +48 -0
- package/clis/jianyu/search.js +139 -3
- package/clis/jianyu/search.test.js +25 -0
- package/clis/jianyu/shared/procurement-detail.js +15 -0
- package/clis/jianyu/shared/procurement-detail.test.js +12 -0
- package/clis/nowcoder/companies.js +23 -0
- package/clis/nowcoder/creators.js +27 -0
- package/clis/nowcoder/detail.js +61 -0
- package/clis/nowcoder/experience.js +36 -0
- package/clis/nowcoder/hot.js +24 -0
- package/clis/nowcoder/jobs.js +21 -0
- package/clis/nowcoder/notifications.js +29 -0
- package/clis/nowcoder/papers.js +40 -0
- package/clis/nowcoder/practice.js +37 -0
- package/clis/nowcoder/recommend.js +30 -0
- package/clis/nowcoder/referral.js +39 -0
- package/clis/nowcoder/salary.js +40 -0
- package/clis/nowcoder/search.js +49 -0
- package/clis/nowcoder/suggest.js +33 -0
- package/clis/nowcoder/topics.js +27 -0
- package/clis/nowcoder/trending.js +25 -0
- package/clis/twitter/list-add.js +337 -0
- package/clis/twitter/list-add.test.js +15 -0
- package/clis/twitter/list-remove.js +297 -0
- package/clis/twitter/list-remove.test.js +14 -0
- package/clis/twitter/list-tweets.js +185 -0
- package/clis/twitter/list-tweets.test.js +108 -0
- package/clis/twitter/lists.js +134 -47
- package/clis/twitter/lists.test.js +105 -38
- package/clis/twitter/shared.js +7 -2
- package/clis/twitter/tweets.js +218 -0
- package/clis/twitter/tweets.test.js +125 -0
- package/clis/wanfang/search.js +66 -0
- package/clis/wanfang/search.test.js +23 -0
- package/clis/web/read.js +1 -1
- package/clis/weixin/download.js +3 -2
- package/clis/xiaohongshu/publish.js +149 -28
- package/clis/xiaohongshu/publish.test.js +319 -6
- package/clis/xiaoyuzhou/download.js +8 -4
- package/clis/xiaoyuzhou/download.test.js +23 -13
- package/clis/xiaoyuzhou/episode.js +9 -4
- package/clis/xiaoyuzhou/podcast-episodes.js +15 -11
- package/clis/xiaoyuzhou/podcast.js +9 -4
- package/clis/xiaoyuzhou/utils.js +0 -40
- package/clis/xiaoyuzhou/utils.test.js +15 -75
- package/clis/youtube/channel.js +35 -0
- package/clis/zsxq/dynamics.js +1 -1
- package/clis/zsxq/utils.js +6 -3
- package/clis/zsxq/utils.test.js +31 -0
- package/dist/src/browser/base-page.d.ts +14 -4
- package/dist/src/browser/base-page.js +35 -25
- package/dist/src/browser/bridge.d.ts +1 -0
- package/dist/src/browser/bridge.js +1 -1
- package/dist/src/browser/cdp.d.ts +1 -0
- package/dist/src/browser/cdp.js +13 -4
- package/dist/src/browser/compound.d.ts +59 -0
- package/dist/src/browser/compound.js +112 -0
- package/dist/src/browser/compound.test.js +175 -0
- package/dist/src/browser/daemon-client.d.ts +6 -4
- package/dist/src/browser/daemon-client.js +6 -1
- package/dist/src/browser/daemon-client.test.js +40 -1
- package/dist/src/browser/dom-snapshot.d.ts +7 -0
- package/dist/src/browser/dom-snapshot.js +83 -5
- package/dist/src/browser/dom-snapshot.test.js +65 -0
- package/dist/src/browser/extract.d.ts +69 -0
- package/dist/src/browser/extract.js +132 -0
- package/dist/src/browser/extract.test.js +129 -0
- package/dist/src/browser/find.d.ts +76 -0
- package/dist/src/browser/find.js +179 -0
- package/dist/src/browser/find.test.js +120 -0
- package/dist/src/browser/html-tree.d.ts +75 -0
- package/dist/src/browser/html-tree.js +112 -0
- package/dist/src/browser/html-tree.test.d.ts +1 -0
- package/dist/src/browser/html-tree.test.js +181 -0
- package/dist/src/browser/network-cache.d.ts +48 -0
- package/dist/src/browser/network-cache.js +66 -0
- package/dist/src/browser/network-cache.test.d.ts +1 -0
- package/dist/src/browser/network-cache.test.js +58 -0
- package/dist/src/browser/network-key.d.ts +22 -0
- package/dist/src/browser/network-key.js +66 -0
- package/dist/src/browser/network-key.test.d.ts +1 -0
- package/dist/src/browser/network-key.test.js +49 -0
- package/dist/src/browser/page.d.ts +14 -4
- package/dist/src/browser/page.js +48 -7
- package/dist/src/browser/page.test.js +97 -0
- package/dist/src/browser/shape-filter.d.ts +52 -0
- package/dist/src/browser/shape-filter.js +101 -0
- package/dist/src/browser/shape-filter.test.d.ts +1 -0
- package/dist/src/browser/shape-filter.test.js +101 -0
- package/dist/src/browser/shape.d.ts +23 -0
- package/dist/src/browser/shape.js +95 -0
- package/dist/src/browser/shape.test.d.ts +1 -0
- package/dist/src/browser/shape.test.js +82 -0
- package/dist/src/browser/target-errors.d.ts +14 -1
- package/dist/src/browser/target-errors.js +13 -0
- package/dist/src/browser/target-errors.test.js +39 -6
- package/dist/src/browser/target-resolver.d.ts +57 -10
- package/dist/src/browser/target-resolver.js +195 -75
- package/dist/src/browser/target-resolver.test.js +80 -5
- package/dist/src/cli.js +849 -267
- package/dist/src/cli.test.js +961 -90
- package/dist/src/commanderAdapter.d.ts +0 -1
- package/dist/src/commanderAdapter.js +2 -16
- package/dist/src/commanderAdapter.test.js +1 -1
- package/dist/src/completion-shared.js +2 -5
- package/dist/src/daemon.js +8 -0
- package/dist/src/download/article-download.d.ts +1 -0
- package/dist/src/download/article-download.js +3 -0
- package/dist/src/download/article-download.test.d.ts +1 -0
- package/dist/src/download/article-download.test.js +39 -0
- package/dist/src/execution.js +7 -2
- package/dist/src/execution.test.js +54 -0
- package/dist/src/main.js +16 -0
- package/dist/src/plugin.d.ts +1 -8
- package/dist/src/plugin.js +1 -27
- package/dist/src/plugin.test.js +1 -59
- package/dist/src/registry.d.ts +1 -0
- package/dist/src/registry.js +3 -2
- package/dist/src/registry.test.js +22 -0
- package/dist/src/types.d.ts +32 -8
- package/package.json +1 -1
- package/clis/twitter/lists-parser.js +0 -77
- package/clis/twitter/lists.d.ts +0 -5
- package/dist/src/cascade.d.ts +0 -46
- package/dist/src/cascade.js +0 -135
- package/dist/src/explore.d.ts +0 -99
- package/dist/src/explore.js +0 -402
- package/dist/src/generate-verified.d.ts +0 -105
- package/dist/src/generate-verified.js +0 -696
- package/dist/src/generate-verified.test.js +0 -925
- package/dist/src/generate.d.ts +0 -46
- package/dist/src/generate.js +0 -117
- package/dist/src/record.d.ts +0 -96
- package/dist/src/record.js +0 -657
- package/dist/src/record.test.js +0 -293
- package/dist/src/skill-generate.d.ts +0 -30
- package/dist/src/skill-generate.js +0 -75
- package/dist/src/skill-generate.test.js +0 -173
- package/dist/src/synthesize.d.ts +0 -97
- package/dist/src/synthesize.js +0 -208
- /package/dist/src/{generate-verified.test.d.ts → browser/compound.test.d.ts} +0 -0
- /package/dist/src/{record.test.d.ts → browser/extract.test.d.ts} +0 -0
- /package/dist/src/{skill-generate.test.d.ts → browser/find.test.d.ts} +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Verified adapter generation:
|
|
3
|
-
* discover → synthesize → candidate-bound probe → single-session verify.
|
|
4
|
-
*
|
|
5
|
-
* v1 contract keeps scope narrow:
|
|
6
|
-
* - PUBLIC + COOKIE only
|
|
7
|
-
* - read-only JSON API surfaces
|
|
8
|
-
* - single best candidate only
|
|
9
|
-
* - bounded repair: select/itemPath replacement once
|
|
10
|
-
*
|
|
11
|
-
* Contract design principles:
|
|
12
|
-
* 1. machine-readable
|
|
13
|
-
* 2. explicit + explainable
|
|
14
|
-
* 3. testable + versioned
|
|
15
|
-
* 4. taxonomy by skill decision needs (not internal error sources)
|
|
16
|
-
* 5. early hint / terminal outcome share consistent decision language
|
|
17
|
-
*/
|
|
18
|
-
import { type IBrowserFactory } from './runtime.js';
|
|
19
|
-
import { Strategy } from './registry.js';
|
|
20
|
-
export type Stage = 'explore' | 'cascade' | 'synthesize' | 'verify' | 'fallback';
|
|
21
|
-
export type Confidence = 'high' | 'medium' | 'low';
|
|
22
|
-
export type StopReason = 'no-viable-api-surface' | 'auth-too-complex' | 'no-viable-candidate' | 'execution-environment-unavailable';
|
|
23
|
-
export type EscalationReason = 'empty-result' | 'sparse-fields' | 'non-array-result' | 'unsupported-required-args' | 'timeout' | 'selector-mismatch' | 'verify-inconclusive';
|
|
24
|
-
export type SuggestedAction = 'stop' | 'inspect-with-browser' | 'ask-for-login' | 'ask-for-sample-arg' | 'manual-review';
|
|
25
|
-
export type Reusability = 'verified-artifact' | 'unverified-candidate' | 'not-reusable';
|
|
26
|
-
export type EarlyHintReason = 'api-surface-looks-viable' | 'candidate-ready-for-verify' | 'no-viable-api-surface' | 'auth-too-complex' | 'no-viable-candidate';
|
|
27
|
-
export interface EarlyHint {
|
|
28
|
-
stage: 'explore' | 'synthesize' | 'cascade';
|
|
29
|
-
continue: boolean;
|
|
30
|
-
reason: EarlyHintReason;
|
|
31
|
-
confidence: Confidence;
|
|
32
|
-
candidate?: {
|
|
33
|
-
name: string;
|
|
34
|
-
command: string;
|
|
35
|
-
path: string | null;
|
|
36
|
-
reusability: 'unverified-candidate' | 'not-reusable';
|
|
37
|
-
};
|
|
38
|
-
message?: string;
|
|
39
|
-
}
|
|
40
|
-
export type EarlyHintHandler = (hint: EarlyHint) => void;
|
|
41
|
-
type SupportedStrategy = Strategy.PUBLIC | Strategy.COOKIE;
|
|
42
|
-
export interface GenerateStats {
|
|
43
|
-
endpoint_count: number;
|
|
44
|
-
api_endpoint_count: number;
|
|
45
|
-
candidate_count: number;
|
|
46
|
-
verified: boolean;
|
|
47
|
-
repair_attempted: boolean;
|
|
48
|
-
explore_dir: string;
|
|
49
|
-
}
|
|
50
|
-
export interface VerifiedAdapter {
|
|
51
|
-
site: string;
|
|
52
|
-
name: string;
|
|
53
|
-
command: string;
|
|
54
|
-
strategy: SupportedStrategy;
|
|
55
|
-
path: string;
|
|
56
|
-
metadata_path?: string;
|
|
57
|
-
reusability: 'verified-artifact';
|
|
58
|
-
}
|
|
59
|
-
export interface EscalationContext {
|
|
60
|
-
stage: Stage;
|
|
61
|
-
reason: EscalationReason;
|
|
62
|
-
confidence: Confidence;
|
|
63
|
-
suggested_action: SuggestedAction;
|
|
64
|
-
candidate: {
|
|
65
|
-
name: string;
|
|
66
|
-
command: string;
|
|
67
|
-
path: string | null;
|
|
68
|
-
reusability: Reusability;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export type GenerateOutcome = {
|
|
72
|
-
status: 'success' | 'blocked' | 'needs-human-check';
|
|
73
|
-
adapter?: VerifiedAdapter;
|
|
74
|
-
reason?: StopReason;
|
|
75
|
-
stage?: Stage;
|
|
76
|
-
confidence?: Confidence;
|
|
77
|
-
escalation?: EscalationContext;
|
|
78
|
-
reusability?: Reusability;
|
|
79
|
-
message?: string;
|
|
80
|
-
stats: GenerateStats;
|
|
81
|
-
};
|
|
82
|
-
export interface GenerateVerifiedOptions {
|
|
83
|
-
url: string;
|
|
84
|
-
BrowserFactory: new () => IBrowserFactory;
|
|
85
|
-
goal?: string | null;
|
|
86
|
-
site?: string;
|
|
87
|
-
waitSeconds?: number;
|
|
88
|
-
top?: number;
|
|
89
|
-
workspace?: string;
|
|
90
|
-
noRegister?: boolean;
|
|
91
|
-
onEarlyHint?: EarlyHintHandler;
|
|
92
|
-
}
|
|
93
|
-
export interface VerifiedArtifactMetadata {
|
|
94
|
-
artifact_kind: 'verified';
|
|
95
|
-
schema_version: 1;
|
|
96
|
-
source_url: string;
|
|
97
|
-
goal: string | null;
|
|
98
|
-
strategy: SupportedStrategy;
|
|
99
|
-
verified: true;
|
|
100
|
-
reusable: true;
|
|
101
|
-
reusability_reason: 'verified-artifact';
|
|
102
|
-
}
|
|
103
|
-
export declare function generateVerifiedFromUrl(opts: GenerateVerifiedOptions): Promise<GenerateOutcome>;
|
|
104
|
-
export declare function renderGenerateVerifiedSummary(result: GenerateOutcome): string;
|
|
105
|
-
export {};
|