@olane/o-lane 0.7.18 → 0.7.20

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.
Files changed (115) hide show
  1. package/dist/src/capabilities/enums/o-capability.type-enum.d.ts +1 -0
  2. package/dist/src/capabilities/enums/o-capability.type-enum.d.ts.map +1 -1
  3. package/dist/src/capabilities/enums/o-capability.type-enum.js +1 -0
  4. package/dist/src/capabilities/index.d.ts +2 -1
  5. package/dist/src/capabilities/index.d.ts.map +1 -1
  6. package/dist/src/capabilities/index.js +2 -1
  7. package/dist/src/capabilities/interfaces/{o-capability.config.d.ts → o-capability.config-interface.d.ts} +5 -4
  8. package/dist/src/capabilities/interfaces/o-capability.config-interface.d.ts.map +1 -0
  9. package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts +1 -2
  10. package/dist/src/capabilities/interfaces/o-capability.result-interface.d.ts.map +1 -1
  11. package/dist/src/capabilities/o-capability.config.d.ts +24 -0
  12. package/dist/src/capabilities/o-capability.config.d.ts.map +1 -0
  13. package/dist/src/capabilities/o-capability.config.js +25 -0
  14. package/dist/src/capabilities/o-capability.d.ts +9 -5
  15. package/dist/src/capabilities/o-capability.d.ts.map +1 -1
  16. package/dist/src/capabilities/o-capability.intelligence.d.ts.map +1 -1
  17. package/dist/src/capabilities/o-capability.intelligence.js +4 -18
  18. package/dist/src/capabilities/o-capability.js +4 -5
  19. package/dist/src/capabilities/o-capability.result.d.ts +6 -12
  20. package/dist/src/capabilities/o-capability.result.d.ts.map +1 -1
  21. package/dist/src/capabilities/o-capability.result.js +2 -10
  22. package/dist/src/capabilities-all/o-capability.all.d.ts +2 -3
  23. package/dist/src/capabilities-all/o-capability.all.d.ts.map +1 -1
  24. package/dist/src/capabilities-all/o-capability.all.js +6 -8
  25. package/dist/src/capabilities-configure/interfaces/o-capability.configure-config.d.ts +2 -2
  26. package/dist/src/capabilities-configure/interfaces/o-capability.configure-config.d.ts.map +1 -1
  27. package/dist/src/capabilities-configure/o-capability.configure.d.ts +0 -15
  28. package/dist/src/capabilities-configure/o-capability.configure.d.ts.map +1 -1
  29. package/dist/src/capabilities-configure/o-capability.configure.js +61 -47
  30. package/dist/src/capabilities-evaluate/o-capability.evaluate.d.ts +1 -0
  31. package/dist/src/capabilities-evaluate/o-capability.evaluate.d.ts.map +1 -1
  32. package/dist/src/capabilities-evaluate/o-capability.evaluate.js +17 -2
  33. package/dist/src/capabilities-execute/execute.capability.d.ts +13 -0
  34. package/dist/src/capabilities-execute/execute.capability.d.ts.map +1 -0
  35. package/dist/src/capabilities-execute/execute.capability.js +111 -0
  36. package/dist/src/capabilities-execute/interfaces/o-capability.configure-config.d.ts +8 -0
  37. package/dist/src/capabilities-execute/interfaces/o-capability.configure-config.d.ts.map +1 -0
  38. package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts +1 -1
  39. package/dist/src/capabilities-multiple-step/interfaces/o-capability.multiple-step-config.d.ts.map +1 -1
  40. package/dist/src/capabilities-multiple-step/o-capability.multiple-step.d.ts.map +1 -1
  41. package/dist/src/capabilities-multiple-step/o-capability.multiple-step.js +0 -1
  42. package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts +1 -1
  43. package/dist/src/capabilities-search/interfaces/o-capability.search-config.d.ts.map +1 -1
  44. package/dist/src/capabilities-search/o-capability.search.d.ts.map +1 -1
  45. package/dist/src/capabilities-search/o-capability.search.js +0 -4
  46. package/dist/src/index.d.ts +1 -2
  47. package/dist/src/index.d.ts.map +1 -1
  48. package/dist/src/index.js +1 -2
  49. package/dist/src/interfaces/o-lane.config.d.ts +5 -0
  50. package/dist/src/interfaces/o-lane.config.d.ts.map +1 -1
  51. package/dist/src/o-lane.d.ts +13 -13
  52. package/dist/src/o-lane.d.ts.map +1 -1
  53. package/dist/src/o-lane.js +52 -180
  54. package/dist/src/o-lane.mixin.d.ts.map +1 -1
  55. package/dist/src/o-lane.mixin.js +9 -5
  56. package/dist/src/prompts/agent.prompt.d.ts +1 -12
  57. package/dist/src/prompts/agent.prompt.d.ts.map +1 -1
  58. package/dist/src/prompts/agent.prompt.js +80 -138
  59. package/dist/src/prompts/configure.prompt.d.ts +1 -8
  60. package/dist/src/prompts/configure.prompt.d.ts.map +1 -1
  61. package/dist/src/prompts/configure.prompt.js +68 -47
  62. package/dist/src/prompts/execute.prompt.d.ts +9 -0
  63. package/dist/src/prompts/execute.prompt.d.ts.map +1 -0
  64. package/dist/src/prompts/execute.prompt.js +47 -0
  65. package/dist/src/prompts/index.d.ts +3 -0
  66. package/dist/src/prompts/index.d.ts.map +1 -0
  67. package/dist/src/prompts/index.js +2 -0
  68. package/dist/src/prompts/interfaces/o-prompt.config.d.ts +8 -0
  69. package/dist/src/prompts/interfaces/o-prompt.config.d.ts.map +1 -0
  70. package/dist/src/prompts/interfaces/o-prompt.config.js +1 -0
  71. package/dist/src/prompts/o-prompt.d.ts +36 -0
  72. package/dist/src/prompts/o-prompt.d.ts.map +1 -0
  73. package/dist/src/prompts/o-prompt.js +92 -0
  74. package/dist/src/storage/default.prompt-loader.d.ts +14 -0
  75. package/dist/src/storage/default.prompt-loader.d.ts.map +1 -0
  76. package/dist/src/storage/default.prompt-loader.js +34 -0
  77. package/dist/src/storage/index.d.ts +1 -3
  78. package/dist/src/storage/index.d.ts.map +1 -1
  79. package/dist/src/storage/index.js +1 -5
  80. package/dist/src/storage/o-lane.storage-manager.d.ts +71 -0
  81. package/dist/src/storage/o-lane.storage-manager.d.ts.map +1 -0
  82. package/dist/src/storage/o-lane.storage-manager.js +208 -0
  83. package/dist/src/storage/prompt-loader.d.ts +10 -28
  84. package/dist/src/storage/prompt-loader.d.ts.map +1 -1
  85. package/dist/src/storage/prompt-loader.js +9 -112
  86. package/dist/test/index.d.ts +1 -0
  87. package/dist/test/index.d.ts.map +1 -0
  88. package/dist/test/index.js +2 -0
  89. package/package.json +12 -10
  90. package/dist/src/capabilities/interfaces/o-capability.config.d.ts.map +0 -1
  91. package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts +0 -16
  92. package/dist/src/capabilities-task/interfaces/o-capability.task-config.d.ts.map +0 -1
  93. package/dist/src/capabilities-task/o-capability.task-result.d.ts +0 -5
  94. package/dist/src/capabilities-task/o-capability.task-result.d.ts.map +0 -1
  95. package/dist/src/capabilities-task/o-capability.task-result.js +0 -3
  96. package/dist/src/capabilities-task/o-capability.task.d.ts +0 -20
  97. package/dist/src/capabilities-task/o-capability.task.d.ts.map +0 -1
  98. package/dist/src/capabilities-task/o-capability.task.js +0 -124
  99. package/dist/src/storage/prompt-schema.d.ts +0 -42
  100. package/dist/src/storage/prompt-schema.d.ts.map +0 -1
  101. package/dist/src/storage/prompt-schema.js +0 -29
  102. package/dist/src/storage/prompt-seeder.d.ts +0 -42
  103. package/dist/src/storage/prompt-seeder.d.ts.map +0 -1
  104. package/dist/src/storage/prompt-seeder.js +0 -141
  105. package/dist/src/storage/prompt-storage-provider.tool.d.ts +0 -99
  106. package/dist/src/storage/prompt-storage-provider.tool.d.ts.map +0 -1
  107. package/dist/src/storage/prompt-storage-provider.tool.js +0 -320
  108. package/dist/test/prompt-seeder.spec.d.ts +0 -2
  109. package/dist/test/prompt-seeder.spec.d.ts.map +0 -1
  110. package/dist/test/prompt-seeder.spec.js +0 -256
  111. package/dist/test/prompt-storage-provider.spec.d.ts +0 -2
  112. package/dist/test/prompt-storage-provider.spec.d.ts.map +0 -1
  113. package/dist/test/prompt-storage-provider.spec.js +0 -457
  114. /package/dist/src/capabilities/interfaces/{o-capability.config.js → o-capability.config-interface.js} +0 -0
  115. /package/dist/src/{capabilities-task/interfaces/o-capability.task-config.js → capabilities-execute/interfaces/o-capability.configure-config.js} +0 -0
@@ -1,144 +1,86 @@
1
- import { CUSTOM_AGENT_PROMPT } from './custom.prompt.js';
2
- /**
3
- * Cycle instructions for seeding - extracted from agent workflow
4
- */
5
- export const CYCLE_INSTRUCTIONS_SEED = `
6
- Every Step Instructions:
7
- 1. Review the provided user intent, context and agent history
8
- 2. If you can complete the user intent, return the "Stop Response" using the [RETURN INSTRUCTIONS] steps
9
- 3. If the intent is already completed in past cycles, return the "Stop Response" using the [RETURN INSTRUCTIONS] steps
10
- 4. If you experience 3 similar errors in a row, return the "Stop Response" indicating an error and follow the [RETURN INSTRUCTIONS] steps
11
- 5. Review the current step number and perform the instructions associated with that step
12
- 6. Start with step 1
13
-
14
- Step 1 - Evaluate the intent
15
- 1. A complex step means there are multiple actions required to complete the user's intent
16
- 2. If the intent is not-complex, continue to step 2
17
- 3. If the intent is complex, break it up into a list of simple concise intents. Return the "Complex Intent Response" using the [RETURN INSTRUCTIONS]
18
-
19
- Step 2 - Search for tools and context
20
- 1. If all entities and tool addresses are known within the user intent, continue to step 4
21
- 2. If you know the tool address to use to complete the user intent, continue to step 4
22
- 3. If there are unknown tool addresses or entities within the user intent, generate search queries to resolve the unknown entities.
23
- 4. Use the o://mcp search tool to find model context protocol servers (MCP servers) that can help you add tooling that could help you complete the user intent.
24
- 5. If there is a placeholder address used (o://.../placeholder), do not extract the contents of the placeholder address unless necessary for completing the user intent.
25
- 6. Use the search results data & tooling to help you resolve the unknown entities.
26
- 7. Continue to step 3.
27
-
28
- Step 3 - Filter Search Results
29
- 1. If all search results are relevant to the user intent resolution, continue to step 4.
30
- 2. Filter the search results for information that may contain supporting data or tooling that can help complete the user intent.
31
- 3. If you do not see anything that can help you. Return the "Stop Response" using the [RETURN INSTRUCTIONS]
32
- 4. Continue to step 4
33
-
34
- Step 4 - Configure the target tool address use
35
- 1. Identify the tool address that most likely will help you complete the user intent.
36
- 2. Review the provided context for past cycles that contain configuration instructions for the target tool address.
37
- 3. If there is no configuration instructions for the target tool address, return the "Configure Response" using the [RETURN INSTRUCTIONS]
38
- 4. Identify if there are any missing parameter values for the target tool address and search for them if so.
39
- 5. If the tool use configuration is already known including all parameter values, continue to step 5
40
-
41
- Step 5 - Use target tool address
42
- 1. If the target tool address configuration is known, return the "Use Tool Response" using the [RETURN INSTRUCTIONS]
43
- 2. If the target tool address with the same configuration has failed in the past cycles, return the "Error Response" using the [RETURN INSTRUCTIONS] steps to indicate the error.
44
- 3. Using this filtered tool list, return the "Use Tool Response" using the [RETURN INSTRUCTIONS] steps to return a series of addresses and respective intents to align with the current user intent resolution goal
45
- 4. Continue to step 6
46
-
47
- Step 6 - Review the tool use results
48
- 1. Analyze each tool use result
49
- 2. When formatting tool results for the user in a Stop Response, present as clean markdown:
50
- - For general contexts, present as clean markdown:
51
- * Use headings to organize different sections
52
- * Use lists for multiple items
53
- * Use bold for important values or labels
54
- * Use code blocks for addresses (e.g., \`o://tool-address\`)
55
- * Transform raw JSON into readable prose and structured lists
56
- 3. In the summary field, provide a 1-2 sentence overview
57
- 4. If it failed, clearly explain why in a user-friendly way
58
-
59
-
60
- `;
61
- /**
62
- * Output instructions for seeding - extracted from return format specifications
63
- */
64
- export const OUTPUT_INSTRUCTIONS_SEED = `
65
- [RETURN INSTRUCTIONS BEGIN]
66
- These are the types of cycle responses: "Complex Intent Response", "Search Response", "Use Tool Response", "Stop Response", "Error Response", "Configure Response".
67
-
68
- All Return Step Instructions:
69
- 1. Do not explain your reasoning process, just return the output in the correct format.
70
- 2. Determine what type of results we have
71
- 3. Output the respective results using the matching output type.
72
- 4. Generate a reasoning key value pair for why this result was returned.
73
- 5. The reasoning should be no longer than 1 sentence.
74
- 6. The summary should be a short message used to inform the user of the result of the cycle. These updates should be insightful and concise and within 1-2 sentences.
75
- 6. Do not include \`\`\`json or \`\`\` in your output.
76
-
77
- Complex Intent Results:
78
- {
79
- "intents": [
80
- "simple intent 1",
81
- "simple intent 2",
82
- "simple intent 3",
83
- ],
84
- "summary": string,
85
- "reasoning": string,
86
- "type": "multiple_step",
87
- }
88
-
89
- Configure Response:
1
+ export const AGENT_PROMPT_TEMPLATE = `
2
+ You are an AI agent in the Olane OS graph network that deeply understands your <human> to help resolve the human’s intent by looping through the <instructions> to complete the <intent> by following the <output> rules.
3
+
4
+ <human>
5
+ {{human_about}}
6
+ </human>
7
+
8
+ <agent:about>
9
+ {{agent_about}}
10
+ </agent:about>
11
+
12
+ <context:global>
13
+ {{context_global}}
14
+ </context:global>
15
+
16
+ <context:olane>
17
+ Olane OS is a digital agentic world graph. Tools and data are contained within an Olane OS. Agents can explore all parts of the graph to discover tools, data, and anything else that might help an agent accomplish a task.
18
+ Everything contained within Olane OS, is addressable. Agents use these addresses to interface with the primitives.
19
+ Olane addresses look like this “o://leader/auth/messaging”. URL addresses are not tool addresses.
20
+ Do NOT make up addresses. Only use addresses that you have discovered or the user has mentioned.
21
+ </context:olane>
22
+
23
+ <context:common_tools>
24
+ o://search = search for tools, data, knowledge, anything
25
+ o://human = if you need to talk to <human> for anything.
26
+ o://secure = secure storage to write/read sensitive data to
27
+ o://mcp = manage Model Context Protocol or MCP integrations here
28
+ </context:common_tools>
29
+
30
+ <output>
31
+ Global output rules:
32
+
33
+ 1. Do not explain the answer, just return the output in the correct format below.
34
+ 2. Determine result type
35
+ 3. Generate a reasoning key value pair for why this output was generated. The reasoning should be no longer than 1-2 sentences.
36
+ 4. Generate a summary key value pair that your human can read. Use the <twin:*> information to influence this value.
37
+ 5. Construct the output using the matching result type
38
+ 6. Do not include \`json or\` in your output.
39
+
40
+ Use Output:
90
41
  {
91
- "intent": string,
92
- "toolAddress": string,
93
- "reasoning": string,
94
- "summary": string,
95
- "type": "configure",
42
+ "task": {
43
+ "address": string,
44
+ "intent": string, // Intent explaining what we want to do with the tool. Include all relevant information
45
+ },
46
+ "summary": string,
47
+ "reasoning": string,
48
+ "type": "execute",
96
49
  }
97
50
 
98
- Search Response:
99
- {
100
- "queries": [
101
- {
102
- "query": "vector database query key terms to search for",
103
- "limit": number,
104
- }
105
- ],
106
- "isExternal": boolean,
107
- "reasoning": string,
108
- "summary": string,
109
- "type": "search",
110
- }
111
51
 
112
- Stop Response:
52
+ Stop Output:
113
53
  {
114
- "result": string, // IMPORTANT: Format this as clean, readable markdown. Use headers (##, ###), lists (-, 1.), bold (**text**), and code blocks (\`code\`) to make the response easy to read. Structure tool outputs, search results, and data clearly. Focus on what the user needs to know, not raw data dumps.
115
- "reasoning": string,
116
- "addresses_to_index": [string], // COMMENT: If the results of a tool use include "address_to_index", list them in the "addresses_to_index" array.
117
- "summary": string, // A concise 1-2 sentence summary for the user
118
- "type": "stop",
54
+ "result": string, // IMPORTANT: Format this as clean, readable markdown. Use headers (##, ###), lists (-, 1.), bold (**text**), and code blocks (code) to make the response easy to read. Structure tool outputs, search results, and data clearly. Focus on what the user needs to know, not raw data dumps.
55
+ "reasoning": string,
56
+ "addresses_to_index": [string], // COMMENT: If the results of a tool use include "address_to_index", list them in the "addresses_to_index" array.
57
+ "summary": string, // A concise 1-2 sentence summary for the user
58
+ "type": "stop",
119
59
  }
120
-
121
- Error Response:
122
- {
123
- "result": "string explaining the error",
124
- "summary": string,
125
- "reasoning": string,
126
- "type": "evaluate",
127
- }
128
-
129
- Use Tool Response:
130
- {
131
- "task": {
132
- "address": string,
133
- "payload": { "method": string, "params": any }
134
- },
135
- "summary": string,
136
- "type": "task",
137
- }
138
- [RETURN INSTRUCTIONS END]
139
-
140
- `;
141
- /**
142
- * Runtime agent prompt function with parameter interpolation
143
- */
144
- export const AGENT_PROMPT = (intent, context, agentHistory, extraInstructions) => CUSTOM_AGENT_PROMPT(intent, context, agentHistory, CYCLE_INSTRUCTIONS_SEED, OUTPUT_INSTRUCTIONS_SEED, extraInstructions);
60
+ </output>
61
+
62
+ <chat_history>
63
+ {{chat_history}}
64
+ </chat_history>
65
+
66
+ <past_cycles>
67
+ {{past_cycles}}
68
+ </past_cycles>
69
+
70
+ <instructions>
71
+
72
+ 1. If all requests are fulfilled from the intent, stop and answer the intent
73
+ 2. Create a list of unknowns from the intent
74
+ 3. Create a question to identify each unknown
75
+ Example:
76
+ intent: "send a message to dillon"
77
+ output: ["What messaging services are available?", "who is dillon?"]
78
+ 4. Create tool use commands
79
+ Example:
80
+ intent: "send a message to dillon"
81
+ questions and answers:
82
+ "What messaging services are available -> slack, email, iMessage"
83
+ "Who is dillon -> Dillon is a close friend and work partner. Dillon information is here: o://leader/knowledge/dillon"
84
+ 5. Go back to 1
85
+
86
+ </instructions>`;
@@ -1,9 +1,2 @@
1
- /**
2
- * Configure instructions for seeding - extracted from configure capability
3
- */
4
- export declare const CONFIGURE_INSTRUCTIONS_SEED = "\n Configure Request Instructions:\n1. Review the provided user intent and context\n2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps\n3. If you experience an error trying to use a tool more than 2 times, stop here and follow the [RETURN INSTRUCTIONS] steps to indicate the error.\n3. Review the current step number and perform the instructions associated with that step.\n4. Start with step 1\n\nStep 1 - Validate the intent\n1. If the intent is not a configure request, continue to step 5\n2. If the context provided would suggest that the intent is already solved, continue to step 5\n2. Continue to step 2\n\nStep 2 - Choose Method\n1. Review the method options and metadata to determine the best method to resolve the user's intent.\n2. Choose the best method to resolve the user's intent.\n3. Continue to step 3\n\nStep 3 - Select Parameters\n1. Review the parameters for the selected best method.\n2. Extract the parameter values from the agent history, provided context and intent. Do NOT use a parameter value that is not mentioned previously.\n3. Do not use placeholder values for parameter values.\n4. Do not use parameter values that are not explicitly mentioned in the agent history, provided context or intent.\n3. Identify missing parameter values.\n4. If you have enough information to complete the configure request, go to step 5.\n5. Continue to step 4\n\nStep 4 - Search for missing parameter values\n1. Identify other methods that can be used to resolve the missing parameter values.\n2. Identify methods that can be used to resolve the missing parameter values.\n3. Continue to step 5\n\nStep 5 - Finish\n1. If the intent seems to be already solved, return answer results.\n1. If this is not a configure request, return an error.\n2. If you are missing parameter values, generate the intents for the \"Complex Intent\" results using other methods or search to help.\n2. If you have enough information to complete the configure request, follow the [RETURN INSTRUCTIONS] steps to return the \"configure results\".\n3. If you do not have enough information to complete the configure request, return an error.\n\n ";
5
- /**
6
- * Alias for backwards compatibility - runtime usage
7
- */
8
- export declare const CONFIGURE_INSTRUCTIONS = "\n Configure Request Instructions:\n1. Review the provided user intent and context\n2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps\n3. If you experience an error trying to use a tool more than 2 times, stop here and follow the [RETURN INSTRUCTIONS] steps to indicate the error.\n3. Review the current step number and perform the instructions associated with that step.\n4. Start with step 1\n\nStep 1 - Validate the intent\n1. If the intent is not a configure request, continue to step 5\n2. If the context provided would suggest that the intent is already solved, continue to step 5\n2. Continue to step 2\n\nStep 2 - Choose Method\n1. Review the method options and metadata to determine the best method to resolve the user's intent.\n2. Choose the best method to resolve the user's intent.\n3. Continue to step 3\n\nStep 3 - Select Parameters\n1. Review the parameters for the selected best method.\n2. Extract the parameter values from the agent history, provided context and intent. Do NOT use a parameter value that is not mentioned previously.\n3. Do not use placeholder values for parameter values.\n4. Do not use parameter values that are not explicitly mentioned in the agent history, provided context or intent.\n3. Identify missing parameter values.\n4. If you have enough information to complete the configure request, go to step 5.\n5. Continue to step 4\n\nStep 4 - Search for missing parameter values\n1. Identify other methods that can be used to resolve the missing parameter values.\n2. Identify methods that can be used to resolve the missing parameter values.\n3. Continue to step 5\n\nStep 5 - Finish\n1. If the intent seems to be already solved, return answer results.\n1. If this is not a configure request, return an error.\n2. If you are missing parameter values, generate the intents for the \"Complex Intent\" results using other methods or search to help.\n2. If you have enough information to complete the configure request, follow the [RETURN INSTRUCTIONS] steps to return the \"configure results\".\n3. If you do not have enough information to complete the configure request, return an error.\n\n ";
1
+ export declare const CONFIGURE_PROMPT_TEMPLATE = "\nYou are an AI agent in the Olane OS graph network that deeply understands your <human> to help configure using this address \"{{address}}\" by looping through the <instructions> to complete the <intent> by following the <output> rules.\n\n<human>\n{{human_about}}\n</human>\n\n<agent:about>\n{{agent_about}}\n</agent:about>\n\n<context:global>\n{{context_global}}\n</context:global>\n\n<context:olane>\n\nOlane OS is a digital agentic world graph. Tools and data are contained within an Olane OS. Agents can explore all parts of the graph to discover tools, data, and anything else that might help an agent accomplish a task.\nEverything contained within Olane OS, is addressable. Agents use these addresses to interface with the primitives.\nOlane addresses look like this \u201Co://leader/auth/messaging\u201D. URL addresses are not tool addresses.\nDo NOT make up addresses. Only use addresses that you have discovered or the user has mentioned.\n\n</context:olane>\n\n<output>\nGlobal output rules:\n\n1. Do not explain the answer, just return the output in the correct format below.\n2. Determine result type\n3. Generate a reasoning key value pair for why this output was generated. The reasoning should be no longer than 1-2 sentences.\n4. Generate a summary key value pair that your human can read. Use the <twin:*> information to influence this value.\n5. Construct the output using the matching result type\n6. Do not include `json or` in your output.\n\nConfigure Output:\n{\n \"task\": {\n \"address\": string,\n \"payload\": { \"method\": string, \"params\": any }\n },\n \"summary\": string,\n \"reasoning\": \n \"type\": \"task\",\n}\n\nError Output:\n{\n \"result\": \"string\", // explain the error\n \"summary\": string,\n \"reasoning\": string,\n \"type\": \"error\",\n}\n</output>\n\n<methods>\n{{methods}}\n</methods>\n\n<instructions>\nConfigure Request Instructions:\n\n1. Select the best method from <methods> using <intent> and <context:*> to help you choose\n2. Identify the required parameters from the selected method\n3. Extract parameter key, value pairs by only using the <intent>, <methods> and <context>. Do NOT generate values that you have not seen before in <intent>, <context> or <methods>\n4. If there are unknown required parameter values still, stop and output an error using <output>\n5. If you can complete the configure <intent>, stop and output the task using <output>\n</instructions>\n";
9
2
  //# sourceMappingURL=configure.prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configure.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/configure.prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,2BAA2B,woEAuCrC,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,sBAAsB,woEAA8B,CAAC"}
1
+ {"version":3,"file":"configure.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/configure.prompt.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,yBAAyB,s5EAmErC,CAAC"}
@@ -1,47 +1,68 @@
1
- /**
2
- * Configure instructions for seeding - extracted from configure capability
3
- */
4
- export const CONFIGURE_INSTRUCTIONS_SEED = `
5
- Configure Request Instructions:
6
- 1. Review the provided user intent and context
7
- 2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps
8
- 3. If you experience an error trying to use a tool more than 2 times, stop here and follow the [RETURN INSTRUCTIONS] steps to indicate the error.
9
- 3. Review the current step number and perform the instructions associated with that step.
10
- 4. Start with step 1
11
-
12
- Step 1 - Validate the intent
13
- 1. If the intent is not a configure request, continue to step 5
14
- 2. If the context provided would suggest that the intent is already solved, continue to step 5
15
- 2. Continue to step 2
16
-
17
- Step 2 - Choose Method
18
- 1. Review the method options and metadata to determine the best method to resolve the user's intent.
19
- 2. Choose the best method to resolve the user's intent.
20
- 3. Continue to step 3
21
-
22
- Step 3 - Select Parameters
23
- 1. Review the parameters for the selected best method.
24
- 2. Extract the parameter values from the agent history, provided context and intent. Do NOT use a parameter value that is not mentioned previously.
25
- 3. Do not use placeholder values for parameter values.
26
- 4. Do not use parameter values that are not explicitly mentioned in the agent history, provided context or intent.
27
- 3. Identify missing parameter values.
28
- 4. If you have enough information to complete the configure request, go to step 5.
29
- 5. Continue to step 4
30
-
31
- Step 4 - Search for missing parameter values
32
- 1. Identify other methods that can be used to resolve the missing parameter values.
33
- 2. Identify methods that can be used to resolve the missing parameter values.
34
- 3. Continue to step 5
35
-
36
- Step 5 - Finish
37
- 1. If the intent seems to be already solved, return answer results.
38
- 1. If this is not a configure request, return an error.
39
- 2. If you are missing parameter values, generate the intents for the "Complex Intent" results using other methods or search to help.
40
- 2. If you have enough information to complete the configure request, follow the [RETURN INSTRUCTIONS] steps to return the "configure results".
41
- 3. If you do not have enough information to complete the configure request, return an error.
42
-
43
- `;
44
- /**
45
- * Alias for backwards compatibility - runtime usage
46
- */
47
- export const CONFIGURE_INSTRUCTIONS = CONFIGURE_INSTRUCTIONS_SEED;
1
+ export const CONFIGURE_PROMPT_TEMPLATE = `
2
+ You are an AI agent in the Olane OS graph network that deeply understands your <human> to help configure using this address "{{address}}" by looping through the <instructions> to complete the <intent> by following the <output> rules.
3
+
4
+ <human>
5
+ {{human_about}}
6
+ </human>
7
+
8
+ <agent:about>
9
+ {{agent_about}}
10
+ </agent:about>
11
+
12
+ <context:global>
13
+ {{context_global}}
14
+ </context:global>
15
+
16
+ <context:olane>
17
+
18
+ Olane OS is a digital agentic world graph. Tools and data are contained within an Olane OS. Agents can explore all parts of the graph to discover tools, data, and anything else that might help an agent accomplish a task.
19
+ Everything contained within Olane OS, is addressable. Agents use these addresses to interface with the primitives.
20
+ Olane addresses look like this “o://leader/auth/messaging”. URL addresses are not tool addresses.
21
+ Do NOT make up addresses. Only use addresses that you have discovered or the user has mentioned.
22
+
23
+ </context:olane>
24
+
25
+ <output>
26
+ Global output rules:
27
+
28
+ 1. Do not explain the answer, just return the output in the correct format below.
29
+ 2. Determine result type
30
+ 3. Generate a reasoning key value pair for why this output was generated. The reasoning should be no longer than 1-2 sentences.
31
+ 4. Generate a summary key value pair that your human can read. Use the <twin:*> information to influence this value.
32
+ 5. Construct the output using the matching result type
33
+ 6. Do not include \`json or\` in your output.
34
+
35
+ Configure Output:
36
+ {
37
+ "task": {
38
+ "address": string,
39
+ "payload": { "method": string, "params": any }
40
+ },
41
+ "summary": string,
42
+ "reasoning":
43
+ "type": "task",
44
+ }
45
+
46
+ Error Output:
47
+ {
48
+ "result": "string", // explain the error
49
+ "summary": string,
50
+ "reasoning": string,
51
+ "type": "error",
52
+ }
53
+ </output>
54
+
55
+ <methods>
56
+ {{methods}}
57
+ </methods>
58
+
59
+ <instructions>
60
+ Configure Request Instructions:
61
+
62
+ 1. Select the best method from <methods> using <intent> and <context:*> to help you choose
63
+ 2. Identify the required parameters from the selected method
64
+ 3. Extract parameter key, value pairs by only using the <intent>, <methods> and <context>. Do NOT generate values that you have not seen before in <intent>, <context> or <methods>
65
+ 4. If there are unknown required parameter values still, stop and output an error using <output>
66
+ 5. If you can complete the configure <intent>, stop and output the task using <output>
67
+ </instructions>
68
+ `;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Execute instructions for seeding - extracted from execute capability
3
+ */
4
+ export declare const EXECUTE_PROMPT_SEED = "\n Configure Request Instructions:\n1. Review the provided user intent and context\n2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps\n3. If you experience an error trying to use a tool more than 2 times, stop here and follow the [RETURN INSTRUCTIONS] steps to indicate the error.\n3. Review the current step number and perform the instructions associated with that step.\n4. Start with step 1\n\nStep 1 - Validate the intent\n1. If the intent is not a configure request, continue to step 5\n2. If the context provided would suggest that the intent is already solved, continue to step 5\n2. Continue to step 2\n\nStep 2 - Choose Method\n1. Review the method options and metadata to determine the best method to resolve the user's intent.\n2. Choose the best method to resolve the user's intent.\n3. Continue to step 3\n\nStep 3 - Select Parameters\n1. Review the parameters for the selected best method.\n2. Extract the parameter values from the agent history, provided context and intent. Do NOT use a parameter value that is not mentioned previously.\n3. Do not use placeholder values for parameter values.\n4. Do not use parameter values that are not explicitly mentioned in the agent history, provided context or intent.\n3. Identify missing parameter values.\n4. If you have enough information to complete the configure request, go to step 5.\n5. Continue to step 4\n\nStep 4 - Search for missing parameter values\n1. Identify other methods that can be used to resolve the missing parameter values.\n2. Identify methods that can be used to resolve the missing parameter values.\n3. Continue to step 5\n\nStep 5 - Finish\n1. If the intent seems to be already solved, return answer results.\n1. If this is not a configure request, return an error.\n2. If you are missing parameter values, generate the intents for the \"Complex Intent\" results using other methods or search to help.\n2. If you have enough information to complete the configure request, follow the [RETURN INSTRUCTIONS] steps to return the \"configure results\".\n3. If you do not have enough information to complete the configure request, return an error.\n\n ";
5
+ /**
6
+ * Alias for backwards compatibility - runtime usage
7
+ */
8
+ export declare const EXECUTE_PROMPT = "\n Configure Request Instructions:\n1. Review the provided user intent and context\n2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps\n3. If you experience an error trying to use a tool more than 2 times, stop here and follow the [RETURN INSTRUCTIONS] steps to indicate the error.\n3. Review the current step number and perform the instructions associated with that step.\n4. Start with step 1\n\nStep 1 - Validate the intent\n1. If the intent is not a configure request, continue to step 5\n2. If the context provided would suggest that the intent is already solved, continue to step 5\n2. Continue to step 2\n\nStep 2 - Choose Method\n1. Review the method options and metadata to determine the best method to resolve the user's intent.\n2. Choose the best method to resolve the user's intent.\n3. Continue to step 3\n\nStep 3 - Select Parameters\n1. Review the parameters for the selected best method.\n2. Extract the parameter values from the agent history, provided context and intent. Do NOT use a parameter value that is not mentioned previously.\n3. Do not use placeholder values for parameter values.\n4. Do not use parameter values that are not explicitly mentioned in the agent history, provided context or intent.\n3. Identify missing parameter values.\n4. If you have enough information to complete the configure request, go to step 5.\n5. Continue to step 4\n\nStep 4 - Search for missing parameter values\n1. Identify other methods that can be used to resolve the missing parameter values.\n2. Identify methods that can be used to resolve the missing parameter values.\n3. Continue to step 5\n\nStep 5 - Finish\n1. If the intent seems to be already solved, return answer results.\n1. If this is not a configure request, return an error.\n2. If you are missing parameter values, generate the intents for the \"Complex Intent\" results using other methods or search to help.\n2. If you have enough information to complete the configure request, follow the [RETURN INSTRUCTIONS] steps to return the \"configure results\".\n3. If you do not have enough information to complete the configure request, return an error.\n\n ";
9
+ //# sourceMappingURL=execute.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/execute.prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB,woEAuC7B,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,cAAc,woEAAsB,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Execute instructions for seeding - extracted from execute capability
3
+ */
4
+ export const EXECUTE_PROMPT_SEED = `
5
+ Configure Request Instructions:
6
+ 1. Review the provided user intent and context
7
+ 2. If you can complete the user intent, return the answer using the [RETURN INSTRUCTIONS] steps
8
+ 3. If you experience an error trying to use a tool more than 2 times, stop here and follow the [RETURN INSTRUCTIONS] steps to indicate the error.
9
+ 3. Review the current step number and perform the instructions associated with that step.
10
+ 4. Start with step 1
11
+
12
+ Step 1 - Validate the intent
13
+ 1. If the intent is not a configure request, continue to step 5
14
+ 2. If the context provided would suggest that the intent is already solved, continue to step 5
15
+ 2. Continue to step 2
16
+
17
+ Step 2 - Choose Method
18
+ 1. Review the method options and metadata to determine the best method to resolve the user's intent.
19
+ 2. Choose the best method to resolve the user's intent.
20
+ 3. Continue to step 3
21
+
22
+ Step 3 - Select Parameters
23
+ 1. Review the parameters for the selected best method.
24
+ 2. Extract the parameter values from the agent history, provided context and intent. Do NOT use a parameter value that is not mentioned previously.
25
+ 3. Do not use placeholder values for parameter values.
26
+ 4. Do not use parameter values that are not explicitly mentioned in the agent history, provided context or intent.
27
+ 3. Identify missing parameter values.
28
+ 4. If you have enough information to complete the configure request, go to step 5.
29
+ 5. Continue to step 4
30
+
31
+ Step 4 - Search for missing parameter values
32
+ 1. Identify other methods that can be used to resolve the missing parameter values.
33
+ 2. Identify methods that can be used to resolve the missing parameter values.
34
+ 3. Continue to step 5
35
+
36
+ Step 5 - Finish
37
+ 1. If the intent seems to be already solved, return answer results.
38
+ 1. If this is not a configure request, return an error.
39
+ 2. If you are missing parameter values, generate the intents for the "Complex Intent" results using other methods or search to help.
40
+ 2. If you have enough information to complete the configure request, follow the [RETURN INSTRUCTIONS] steps to return the "configure results".
41
+ 3. If you do not have enough information to complete the configure request, return an error.
42
+
43
+ `;
44
+ /**
45
+ * Alias for backwards compatibility - runtime usage
46
+ */
47
+ export const EXECUTE_PROMPT = EXECUTE_PROMPT_SEED;
@@ -0,0 +1,3 @@
1
+ export * from './o-prompt.js';
2
+ export * from './interfaces/o-prompt.config.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './o-prompt.js';
2
+ export * from './interfaces/o-prompt.config.js';
@@ -0,0 +1,8 @@
1
+ import { oCapabilityType } from "../../capabilities";
2
+ export interface oPromptConfig {
3
+ rawValue: string;
4
+ type: oCapabilityType;
5
+ provider: string;
6
+ params: any;
7
+ }
8
+ //# sourceMappingURL=o-prompt.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"o-prompt.config.d.ts","sourceRoot":"","sources":["../../../../src/prompts/interfaces/o-prompt.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,GAAG,CAAC;CACb"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ import { oObject } from "@olane/o-core";
2
+ import { oPromptConfig } from "./interfaces/o-prompt.config.js";
3
+ import { oCapabilityType } from "../capabilities/index.js";
4
+ export declare class oPrompt extends oObject {
5
+ private readonly rawValue;
6
+ private readonly type;
7
+ private readonly provider;
8
+ private readonly params;
9
+ private compiledTemplate?;
10
+ constructor(config: oPromptConfig);
11
+ /**
12
+ * Extracts all template variables from the rawValue template
13
+ * @returns Array of variable names found in the template
14
+ */
15
+ getRequiredVariables(): string[];
16
+ /**
17
+ * Validates that all required template variables are present in params
18
+ * @throws Error if any required variables are missing
19
+ */
20
+ validate(): void;
21
+ /**
22
+ * Compiles the template with provided params
23
+ * @returns The compiled template string
24
+ * @throws Error if template variables are missing or compilation fails
25
+ */
26
+ compile(): string;
27
+ /**
28
+ * Alias for compile() for clearer semantics
29
+ */
30
+ render(): string;
31
+ getRawValue(): string;
32
+ getType(): oCapabilityType;
33
+ getProvider(): string;
34
+ getParams(): any;
35
+ }
36
+ //# sourceMappingURL=o-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"o-prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/o-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,qBAAa,OAAQ,SAAQ,OAAO;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAM;IAC7B,OAAO,CAAC,gBAAgB,CAAC,CAA6B;gBAE1C,MAAM,EAAE,aAAa;IAajC;;;OAGG;IACH,oBAAoB,IAAI,MAAM,EAAE;IAgBhC;;;OAGG;IACH,QAAQ,IAAI,IAAI;IAgBhB;;;;OAIG;IACH,OAAO,IAAI,MAAM;IA2BjB;;OAEG;IACH,MAAM,IAAI,MAAM;IAKhB,WAAW,IAAI,MAAM;IAIrB,OAAO,IAAI,eAAe;IAI1B,WAAW,IAAI,MAAM;IAIrB,SAAS,IAAI,GAAG;CAGjB"}
@@ -0,0 +1,92 @@
1
+ import { oObject } from "@olane/o-core";
2
+ import Handlebars from "handlebars";
3
+ export class oPrompt extends oObject {
4
+ constructor(config) {
5
+ super();
6
+ if (!config.rawValue) {
7
+ throw new Error('rawValue is required in oPromptConfig');
8
+ }
9
+ this.rawValue = config.rawValue;
10
+ this.type = config.type;
11
+ this.provider = config.provider;
12
+ this.params = config.params || {};
13
+ }
14
+ /**
15
+ * Extracts all template variables from the rawValue template
16
+ * @returns Array of variable names found in the template
17
+ */
18
+ getRequiredVariables() {
19
+ // Match handlebars variables: {{variable}} or {{object.property}}
20
+ const regex = /\{\{([^}]+)\}\}/g;
21
+ const matches = this.rawValue.matchAll(regex);
22
+ const variables = new Set();
23
+ for (const match of matches) {
24
+ // Extract the variable name (before any dots for nested properties)
25
+ const fullPath = match[1].trim();
26
+ const rootVariable = fullPath.split('.')[0];
27
+ variables.add(rootVariable);
28
+ }
29
+ return Array.from(variables);
30
+ }
31
+ /**
32
+ * Validates that all required template variables are present in params
33
+ * @throws Error if any required variables are missing
34
+ */
35
+ validate() {
36
+ const requiredVariables = this.getRequiredVariables();
37
+ const providedKeys = Object.keys(this.params);
38
+ const missingVariables = requiredVariables.filter((variable) => !providedKeys.includes(variable));
39
+ if (missingVariables.length > 0) {
40
+ throw new Error(`Missing required template variables: ${missingVariables.join(', ')}. ` +
41
+ `Required: [${requiredVariables.join(', ')}], ` +
42
+ `Provided: [${providedKeys.join(', ')}]`);
43
+ }
44
+ }
45
+ /**
46
+ * Compiles the template with provided params
47
+ * @returns The compiled template string
48
+ * @throws Error if template variables are missing or compilation fails
49
+ */
50
+ compile() {
51
+ // Validate first to provide clear error messages
52
+ this.validate();
53
+ try {
54
+ // Compile template if not already compiled
55
+ if (!this.compiledTemplate) {
56
+ this.compiledTemplate = Handlebars.compile(this.rawValue, {
57
+ strict: true,
58
+ noEscape: true, // Don't HTML-escape variables
59
+ });
60
+ }
61
+ // Render the template with params
62
+ const result = this.compiledTemplate(this.params);
63
+ return result;
64
+ }
65
+ catch (error) {
66
+ if (error instanceof Error) {
67
+ throw new Error(`Failed to compile template: ${error.message}. ` +
68
+ `Template type: ${this.type}, Provider: ${this.provider}`);
69
+ }
70
+ throw error;
71
+ }
72
+ }
73
+ /**
74
+ * Alias for compile() for clearer semantics
75
+ */
76
+ render() {
77
+ return this.compile();
78
+ }
79
+ // Getters for config properties
80
+ getRawValue() {
81
+ return this.rawValue;
82
+ }
83
+ getType() {
84
+ return this.type;
85
+ }
86
+ getProvider() {
87
+ return this.provider;
88
+ }
89
+ getParams() {
90
+ return this.params;
91
+ }
92
+ }
@@ -0,0 +1,14 @@
1
+ import { oCapabilityType } from "../capabilities/enums/o-capability.type-enum.js";
2
+ import { PromptLoader } from "./prompt-loader.js";
3
+ import { oPrompt } from "../prompts/o-prompt.js";
4
+ export declare class PromptLoaderDefault extends PromptLoader {
5
+ /**
6
+ * Load a prompt for the given capability type
7
+ * @param type The capability type
8
+ * @param params Parameters to populate the template
9
+ * @param provider Provider identifier (defaults to 'default')
10
+ * @returns oPrompt instance
11
+ */
12
+ loadPromptForType(type: oCapabilityType, params?: any, provider?: string): Promise<oPrompt>;
13
+ }
14
+ //# sourceMappingURL=default.prompt-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.prompt-loader.d.ts","sourceRoot":"","sources":["../../../src/storage/default.prompt-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,qBAAa,mBAAoB,SAAQ,YAAY;IAEnD;;;;;;OAMG;IACG,iBAAiB,CACrB,IAAI,EAAE,eAAe,EACrB,MAAM,GAAE,GAAQ,EAChB,QAAQ,GAAE,MAAkB,GAC3B,OAAO,CAAC,OAAO,CAAC;CAqBpB"}